content
stringlengths
1
15.9M
\section{Introduction} The growth of soluble Baumslag-Solitar groups, $G = BS(1,N) = \langle a,t \mid tat^{-1} = a^N \rangle$, has been widely studied. For instance, it has been shown that they have rational growth with respect to the standard generating set, with an explicitly calculated growth series \cite{ceg}. Moreover, the growth series for a `higher dimensional' generalisation of $BS(1,3)$ -- the ascending HNN-extension of $\mathbb{Z}^m$ given by the `cubing homomorphism' $\mathbf{u} \mapsto 3\mathbf{u}$ -- has been calculated in \cite{sanchez} with respect to standard generators. Some results on growth of Baumslag-Solitar groups that are independent of the choice of a generating set are also known; in particular, the minimal exponential growth rates (with respect to an arbitrary finite generating set) for $BS(1,N)$ have been calculated in \cite{bucher}. This paper aims to provide additional results of this nature. Growth of horocyclic subgroups $\langle a \rangle \cong \mathbb{Z}$ of Baumslag-Solitar groups $G = BS(p,q)$ has been also studied, as this is usually the first step to understanding the growth of $G$ itself: see \cite{fks}. Here we study the growth of the normal closure $A = \langle\!\langle a \rangle\!\rangle \cong \mathbb{Z}\left[\frac1N\right]$ of the horocyclic subgroup of $BS(1,N)$. We say a subset $\mathcal{A} \subseteq G$ is \emph{exponentially negligible} in a group $G$ with respect to a finite generating set $X$ if the proportion of elements that are inside $\mathcal{A}$, counted over the ball of radius $n$ in the Cayley graph $\Gamma(G,X)$, tends to zero exponentially fast as $n \to \infty$ (see \cref{d:negl}). \begin{thm}[see {\cref{t:A}}] \label{t:A-BS} Let $G = BS(1,N)$ with $|N| \geq 2$ and let $A \lhd G$ be the normal closure of the horocyclic subgroup in $G$. Then $A$ is exponentially negligible in $G$ with respect to any finite generating set. \end{thm} Another class of groups this paper aims to study are certain cyclic extensions of $\mathbb{Z}^m$. In particular, we study the semidirect products $G = \mathbb{Z}^m \rtimes \mathbb{Z} = \mathbb{Z}^m \rtimes_T \mathbb{Z}$, where the action of the generator $1 \in \mathbb{Z}$ on $\mathbb{Z}^m$ is represented by a matrix $T \in SL(m,\mathbb{Z})$ that has an eigenvalue $\lambda \in \mathbb{C}$ with $|\lambda| > 1$. In the case $m = 2$, such groups are known to be $3$-manifold groups: they are fundamental groups of orientable prime $3$-manifolds modelled on Sol geometry -- one of the eight geometries of $3$-manifolds appearing in Thurston's Geometrisation Conjecture \cite{scott}. Such groups $G = \mathbb{Z}^m \rtimes_T \mathbb{Z}$ are soluble (in fact, metabelian), but not virtually nilpotent; in particular, such a group $G$ must have exponential growth. There has been some interest in growth properties of these groups in the case $m = 2$. Specifically, it is known that a finite-index subgroup of such a group $G$ has rational growth with respect to some generating set \cite{putman}, and in certain cases (in which $G$ itself has rational growth) the growth series of $G$ was explicitly computed \cite{parry}. Here we study growth of the base subgroup $\mathbb{Z}^m$ of the extension $G = \mathbb{Z}^m \rtimes_T \mathbb{Z}$. \begin{thm}[see {\cref{t:A}}] \label{t:A-3m} Let $G = \mathbb{Z}^m \rtimes_T \mathbb{Z}$ be a cyclic extension of $\mathbb{Z}^m$, where $T \in SL(m,\mathbb{Z})$ has an eigenvalue $\lambda \in \mathbb{C}$ with $|\lambda| > 1$. Then the base group $\mathbb{Z}^m$ is exponentially negligible in $G$ with respect to any finite generating set. \end{thm} As an application of \cref{t:A-BS,t:A-3m}, we study `probabilistic nilpotence' of these classes of groups. In particular, for $r \in \mathbb{N}$ and a group $G$, define \begin{equation} \label{e:NrG} \mathcal{N}_r(G) = \{ (x_0,\ldots,x_r) \in G^{r+1} \mid [x_0,\ldots,x_r] = 1 \} \subseteq G^{r+1}, \end{equation} where we define $[x_0,x_1] = x_0^{-1} x_1^{-1} x_0 x_1$, and, inductively, \[ [x_0,\ldots,x_r] = [[x_0,\ldots,x_{r-1}],x_r]. \] In \cite[Theorem 1.9]{mtvv}, Martino, Tointon, Ventura and the author showed that if a group $G$ is finitely generated and not virtually nilpotent, then the probability that a random walk on a Cayley graph of $G^{r+1}$ will end in $\mathcal{N}_r(G)$ after $n$ steps tends to zero as $n \to \infty$. It is not known whether the same result holds if a `random walk measure' is replaced by a `ball counting measure' -- see \cite[Question 1.32]{mtvv} and discussion before \cref{t:dn}. However, the following result answers this question affirmatively for our particular classes of groups. \begin{thm}[see {\cref{t:dn}}] \label{t:dn-spec} Let $G$ be either $BS(1,N)$ with $|N| \geq 2$ or the cyclic extension $\mathbb{Z}^m \rtimes_T \mathbb{Z}$ where $T \in SL(m,\mathbb{Z})$ has an eigenvalue $\lambda \in \mathbb{C}$ with $|\lambda| > 1$. Then $\mathcal{N}_r(G)$ is exponentially negligible in $G^{r+1}$ with respect to any finite generating set of $G$. \end{thm} In \cref{s:mres}, we give statements of the main results of this paper, \cref{t:A,t:dn}, which apply for ascending HNN-extensions of $\mathbb{Z}^m$. An observation that the latter class of groups includes both the Baumslag-Solitar groups $BS(1,N)$ and the cyclic extensions $\mathbb{Z}^m \rtimes \mathbb{Z}$ mentioned above allows us to deduce \cref{t:A-BS,,t:A-3m,t:dn-spec}. In \cref{s:Ggrowth}, we classify ascending HNN-extensions of $\mathbb{Z}^m$ in terms of their growth: see \cref{p:Ggrowth}. We prove \cref{t:A} in \cref{s:A} and \cref{t:dn} in \cref{s:dn}. \begin{ack} The author would like to thank his PhD supervisor, Armando Martino, without whose guidance and support this work would not have been completed, and the anonymous referee for valuable comments. \end{ack} \section{Main definitions and results} \label{s:mres} To study soluble Baumslag-Solitar groups and cyclic extensions $\mathbb{Z}^m \rtimes \mathbb{Z}$, we consider a more general class of groups. In particular, we study \emph{ascending HNN-extensions of finitely generated free abelian groups}. Such groups can be parametrised by square matrices with integer entries and non-zero determinant: \begin{defn} \label{d:GmT} Let $m \in \mathbb{N}$ and let $T$ be an $m \times m$ matrix with integer entries and $\det T \neq 0$. \begin{enumerate} \item Define the group $G(m,T)$ by the presentation \[ G(m,T) = \left\langle a_1, \cdots, a_m, t \:\middle|\: \begin{array}{@{}c@{}} a_ia_j = a_ja_i \text{ for } 1 \leq i < j \leq m \\ t \mathbf{a}^\mathbf{u} t^{-1} = \mathbf{a}^{T\mathbf{u}} \text{ for all } \mathbf{u} \in \mathbb{Z}^m \end{array} \right\rangle, \] where $\mathbf{a}^\mathbf{v}$ denotes $a_1^{v_1} \cdots a_m^{v_m}$ for any $\mathbf{v} = (v_1,\ldots,v_m) \in \mathbb{Z}^m$. It is easy to see that each element of $G$ can be expressed (although non-uniquely) as $t^{-r}\mathbf{a}^\mathbf{u} t^s$ for some $r,s \geq 0$ and $\mathbf{u} \in \mathbb{Z}^m$. \item Consider the homomorphism $\tau: G(m,T) \to \mathbb{Z}$ given by the $t$-exponent sum: let $\tau(a_i) = 0$ for $1 \leq i \leq m$ and $\tau(t) = 1$. Define the \emph{elliptic subgroup} $A(m,T)$ of $G(m,T)$ as \[ A(m,T) = \ker\tau \trianglelefteq G(m,T); \] notice that $A(m,T)$ is abelian. \end{enumerate} \end{defn} \begin{rmk} \label{r:hnn} As an alternative construction, note that $G(m,T)$ can be expressed as an ascending HNN-extension of $\mathbb{Z}^m$: \[ G(m,T) \cong (\mathbb{Z}^m) \ast_\phi, \] where $\phi: \mathbb{Z}^m \xrightarrow\cong T(\mathbb{Z}^m)$ is defined by $\phi(\mathbf{u}) = T\mathbf{u}$. We may define $A(m,T)$ in terms of the action of the group $G(m,T)$ on its Bass-Serre tree $\mathcal{T}$, corresponding to this HNN-decomposition. In particular, we define $A(m,T)$ to be the union of all point stabilisers with respect to the action of $G(m,T)$ on $\mathcal{T}$. Since this action fixes an end of $\mathcal{T}$, the set $A(m,T)$ turns out to be a (normal) subgroup. \end{rmk} Notice that the family of groups $G(m,T)$ includes both soluble Baumslag-Solitar groups and aforementioned cyclic extensions. Indeed, for $m = 1$ and $T = \begin{pmatrix} N \end{pmatrix}$ for some non-zero $N \in \mathbb{Z}$ we have $G(m,T) \cong BS(1,N)$, whereas if $T \in SL(n,\mathbb{Z})$ then $G(m,T) \cong \mathbb{Z}^m \rtimes_T \mathbb{Z}$. Moreover, the `higher Baumslag-Solitar groups' studied in \cite{sanchez} are just $G(m,3I_m)$, where $I_m$ is the identity matrix. It is worth mentioning that in the case $T \in SL(2,\mathbb{Z})$, if in addition $m = 2$ then the groups $G(m,T)$ appear in the theory of $3$-manifolds. Specifically, we have $G(2,T) \cong \pi_1(M)$ for an orientable prime $3$-manifold $M$ modelled on Euclidean, Nil or Sol geometry -- these are three out of eight geometries appearing in the classification of $3$-manifolds; see \cite{scott}. Moreover, the geometry on which $M$ is modelled can be recognised from $T$: it is Sol if $T$ has two distinct real eigenvalues, Nil if $T$ is not diagonalisable, and Euclidean otherwise. In the present paper we are interested in the growth of the elliptic subgroup $A(m,T)$ relative to the growth of $G(m,T)$. As mentioned above, this subgroup is the normal closure of the horocyclic subgroup in a soluble Baumslag-Solitar group in the case $m = 1$, or the base subgroup of the cyclic extension $\mathbb{Z}^m \rtimes_T \mathbb{Z}$ if $T \in SL(m,\mathbb{Z})$. In order to study the growth of $A(m,T)$, we first need to introduce some terminology. Fix a finitely generated infinite group $G$ and let $Y$ be a finite generating set of $G$. This allows us to define the \emph{word metric} $|\cdot|_Y$ for $G$, by letting $|g|_Y$ to be the minimal word-length of $g \in G$ with respect to $Y$. For $n \in \mathbb{Z}_{\geq 0}$, let \[ B_Y(n) = \{ g \in G \mid |g|_Y \leq n \} \] be the \emph{ball} in $G$ with respect to $Y$ of radius $n$. For any $r \in \mathbb{N}$, we may characterise `small' and `large' subsets of the $r$-fold direct product $G^r = \overbrace{G \times \cdots \times G}^r$ by using ball counting measures, as follows. \begin{defn} \label{d:negl} Let $Y \subset G$ be a finite generating set, let $r \in \mathbb{N}$, and let $\mathcal{A} \subseteq G^r$ be a subset. Let \[ \gamma_n^Y(\mathcal{A}) = \frac{|\mathcal{A} \cap B_Y(n)^r|}{|B_Y(n)|^r}. \] \begin{enumerate} \item We say $\mathcal{A}$ is \emph{negligible} in $G^r$ with respect to $Y$ if \[ \limsup_{n \to \infty} \gamma_n^Y(\mathcal{A}) = 0. \] \item We say $\mathcal{A}$ is \emph{exponentially negligible} in $G^r$ with respect to $Y$ if \[ \limsup_{n \to \infty} \sqrt[n]{\gamma_n^Y(\mathcal{A})} < 1. \] It is clear that an exponentially negligible subset of $G^r$ is also negligible. \item We say $\mathcal{A}$ \emph{has exponential growth} in $G^r$ with respect to $Y$ if \[ \liminf_{n \to \infty} \sqrt[n]{|\mathcal{A} \cap B_Y(n)^r|} > 1. \] \end{enumerate} \end{defn} These concepts are not new: for instance, closely related notions of natural density and exponential density of subsets in groups were introduced in \cite{burillo}. Similar, although not equivalent, notions of negligible and strongly negligible subsets of direct products of groups were considered in \cite{kapovich}. \begin{rmk} It is easy to construct subsets $\mathcal{A} \subseteq G^r$ of a group $G$ of exponential growth such that $\mathcal{A}$ is (exponentially) negligible with respect to some generating set but not with respect to another one. For instance, if $G = F_2 \times F_3$ is a direct product of two free groups of ranks 2 and 3, and if $X_i$ is a basis for $F_i$ ($i \in \{2,3\}$), then $\{1\} \times F_3$ is not negligible in $G$ with respect to the `union' of the generating sets, $Y_\cup = (X_2 \times \{1\}) \cup (\{1\} \times X_3)$, but exponentially negligible with respect to their `product', $Y_\times = (X_2^{\pm 1} \cup \{1\}) \times (X_3^{\pm 1} \cup \{1\})$. Indeed, note that we have \[ B_{Y_\cup}(n) = \bigcup_{i=0}^n \left( B_{X_2}(i) \times B_{X_3}(n-i) \right) \qquad \text{and} \qquad B_{Y_\times}(n) = B_{X_2}(n) \times B_{X_3}(n). \] This allows us to calculate sizes of balls in $G$ and their intersections with $\{1\} \times F_3$ explicitly to obtain asymptotics \[ |B_{Y_\cup}(n)|, |(\{1\} \times F_3) \cap B_{Y_\cup}(n)|, |(\{1\} \times F_3) \cap B_{Y_\times}(n)| \sim 5^n \qquad \text{and} \qquad |B_{Y_\times}(n)| \sim 15^n, \] where we write $f(n) \sim g(n)$ if $\frac{f(n)}{g(n)} \to C$ for some $C \in (0,\infty)$ as $n \to \infty$. On the other hand, note that the inequality $\liminf_{n \to \infty} \sqrt[n]{|\mathcal{A} \cap B_Y(n)^r|} > 1$ is independent of the generating set $Y$ (as all word metrics on $G$ are bi-Lipschitz equivalent), and hence if a subset has exponential growth with respect to some finite generating set, then it has exponential growth with respect to all of them. Thus we may simply say that $\mathcal{A}$ \emph{has exponential growth} in $G^r$ (without referring to a particular generating set). \end{rmk} We now return to the case of a group $G = G(m,T)$ and its elliptic subgroup $A = A(m,T)$, as in \cref{d:GmT}. It is well-known that in many cases, $A$ will have exponential growth in $G$: that is, we have $\liminf_{n \to \infty} \sqrt[n]{|A \cap B_Y(n)|} > 1$ for every finite generating set $Y$ of $G$. More precisely, we have \begin{prop} \label{p:Ggrowth} \begin{enumerate} \item If all eigenvalues of $T$ are equal to $1$, then the group $G(m,T)$ is nilpotent. \item If absolute values of all eigenvalues of $T$ are equal to $1$, then the group $G(m,T)$ is virtually nilpotent. \item Otherwise, $G(m,T)$ has exponential growth, and $A(m,T)$ has exponential growth in $G(m,T)$. \end{enumerate} \end{prop} We prove \cref{p:Ggrowth} in \cref{s:Ggrowth}. As a corollary of \cref{p:Ggrowth}, we immediately obtain the well-known facts that the group $BS(1,N)$ with $|N| \geq 2$ and the fundamental group of a $3$-dimensional Sol-manifold both have exponential growth. These facts allow us to deduce \cref{t:A-3m,t:A-BS} from \cref{t:A}, as well as \cref{t:dn-spec} from \cref{t:dn}. \begin{rmk} We do not claim all of the statements in \cref{p:Ggrowth} to be original: for instance, if $|\det(T)| \geq 2$ then the Bass-Serre tree of $G$ (see \cref{r:hnn}) has infinitely many ends, and in this case it is known (see \cite{hb}) that $G$ has uniformly exponential growth (and hence exponential growth). Nevertheless, we are not aware of any reference in the literature which includes these statements, and thus we prove \cref{p:Ggrowth} here for completeness. \end{rmk} Note that the group $G/A \cong \mathbb{Z}$ has linear growth -- in particular, the number of cosets of $A$ in $G$ that intersect $B_Y(n)$ non-trivially grows linearly with $n$ (for any finite generating set $Y$ of $G$). Hence we might expect $A$ to be `large' in $G$. However, our first general main result states: \begin{thm} \label{t:A} If $G(m,T)$ has exponential growth, then $A(m,T)$ is exponentially negligible in $G(m,T)$ with respect to any finite generating set. \end{thm} We prove \cref{t:A} in \cref{s:A}. \begin{rmk} Note that $G = G(m,T)$ is metabelian, as $A = A(m,T)$ is abelian and the sequence \begin{equation} \label{e:metab} 1 \to A \hookrightarrow G \xrightarrow\tau \mathbb{Z} \to 1 \end{equation} is exact; furthermore, the vector space $A \otimes \mathbb{Q}$ is $m$-dimensional over $\mathbb{Q}$. We suspect that, under some additional technical results, our proof of \cref{t:A} generalises to any groups $G$ and $A \unlhd G$ such that $A$ is abelian, \eqref{e:metab} is exact, and $A \otimes \mathbb{Q}$ is finite-dimensional. In other words, we may expect to generalise the argument in the case when the matrix $T$ has rational entries that are not necessarily integers. Details of this are left to the interested reader. \end{rmk} As an application of \cref{t:A}, we study `probabilistic nilpotence' of the groups $G(m,T)$. In particular, for $r \in \mathbb{N}$ and a group $G$, define $\mathcal{N}_r(G) \subseteq G^{r+1}$ as in \eqref{e:NrG}. Notice that $\mathcal{N}_r(G) = G^{r+1}$ if and only if $G$ is nilpotent of class at most $r$. This suggests that measuring $\mathcal{N}_r(G)$ will tell us how close to being nilpotent a group is. In \cite{mtvv}, Martino, Tointon, Ventura and the author defined the \emph{degree of $r$-nilpotence} of $G$ with respect to a sequence of measures $M = (\mu_n)_{n=1}^\infty$ on $G$ as \[ \operatorname{dc}^k_M(G) = \limsup_{n \to \infty} (\mu_n \times \cdots \times \mu_n)(\mathcal{N}_r(G)). \] It was shown in \cite[Theorem 1.8]{mtvv} that if $G$ is finitely generated and the sequence $(\mu_n)$ measures index uniformly -- that is, $\mu_n(xH) \to [G:H]^{-1}$ uniformly over all $x \in G$ and all subgroups $H \leq G$, where by convention $[G:H]^{-1} = 0$ if $H$ has infinite index in $G$ -- then $\operatorname{dc}^k_M(G) > 0$ if and only if $G$ is virtually $k$-step nilpotent. A particular case of special interest of this are the `random walk measures': it was shown in \cite[Theorem 14]{tointon} that if $\mu$ is a symmetric, finitely supported generating probability measure on $G$ with $\mu(1) > 0$, and if $M = (\mu^{*n})$ is the sequence of measures corresponding to the steps of the random walk on $G$ with respect to $\mu$, then $M$ measures index uniformly on $G$. Instead of random walk measures, here we consider `ball counting measures': that is, we replace the sequence $(\mu^{*n})$ with the sequence $(\gamma_n^Y)$ as in \cref{d:negl}. Intuitively, this can be thought of as avoiding `overcounting' whilst measuring a subset: while $\mu^{*n}(\mathcal{A})$ counts \emph{all} random walks of length $n$ ending up in $\mathcal{A} \cap B_Y(n)$, where $Y$ is the support of $\mu$, the number $\gamma_n^Y(\mathcal{A})$ counts every element of $\mathcal{A} \cap B_Y(n)$ exactly once. In general, the sequence $(\gamma_n^Y)_{n=1}^\infty$ need not measure index uniformly, even if we restrict to groups of the form $G(m,T)$ -- see \cref{r:notunif}. However, we do not know if there exists a finitely generated group $G = \langle Y \rangle$ that is not virtually nilpotent, such that $\mathcal{N}_r(G)$ is not negligible in $G^{r+1}$ with respect to $Y$ -- see \cite[Question 1.32]{mtvv}. The following result follows from \cref{t:A} and shows that a group of the form $G(m,T)$ of exponential growth cannot be taken as such an example, even though (by \cref{p:Ggrowth}) it has an abelian subgroup $A(m,T)$ of exponential growth in $G(m,T)$. \begin{thm} \label{t:dn} If $G = G(m,T)$ has exponential growth, then $\mathcal{N}_r(G)$ is exponentially negligible in $G^{r+1}$ with respect to any finite generating set. \end{thm} We prove \cref{t:dn} in \cref{s:dn}. \begin{rmk} \label{r:notunif} To show that \cref{t:dn} does not follow directly from \cite[Theorem 1.8]{mtvv}, consider the following example. Let $T = \begin{pmatrix} 2 & 0 \\ 0 & 1 \end{pmatrix}$, and let \[ G = G\left( 2,T \right) = \langle a_1,a_2,t \mid [a_1,a_2] = [t,a_2] = 1, ta_1t^{-1} = a_1^2 \rangle \cong BS(1,2) \times \mathbb{Z}. \] Let $X = \{ a_1,a_2,t \}$ be the standard generating set. Let $H = \langle a_1,t \rangle \leq G$, so that $G = H \times \langle a_2 \rangle$ and $H \cong BS(1,2)$. It is known that if $B_{\{a_1,t\}}(n)$ is a ball in $H$ with respect to $\{a_1,t\}$ of radius $n$, then $B_{\{a_1,t\}}(n)/2^n \to C$ for some $C \in (0,\infty)$: see \cite{ceg}. A calculation then shows that $\limsup_{n \to \infty} \gamma_n^X(H) = \frac{1}{3} > 0$, even though $H$ has infinite index in $G$. In particular, the sequence of measures $(\gamma_n^X)$ does not measure index uniformly, and so we cannot apply \cite[Theorem 1.8]{mtvv} in this case. \end{rmk} \section{Classification of the groups \texorpdfstring{$G(m,T)$}{G(m,T)}} \label{s:Ggrowth} In this section we specify which groups \cref{t:A,t:dn} can be applied to. Specifically, we notice that any group $G(m,T)$ is either virtually nilpotent or has exponental growth; by Gromov's Polynomial Growth Theorem \cite{gromov81}, this is just saying that there are no groups $G(m,T)$ of intermediate growth. More precisely, we give a necessary and sufficient condition on the matrix $T$ for the group $G(m,T)$ to have exponential growth (see \cref{p:Ggrowth}). For the rest of the paper, fix an integer $m \in \mathbb{N}$ and an $m \times m$ matrix $T$, and write $G = G(m,T)$ and $A = A(m,T)$. Let $\lambda_1,\ldots,\lambda_m \in \mathbb{C}$ be the eigenvalues of $T$ (counted with multiplicity), and suppose without loss of generality that $|\lambda_1| \leq \cdots \leq |\lambda_m|$. Let $\lambda = |\lambda_m|$, and note that since \[ \lambda^m \geq \prod_{i=1}^m |\lambda_i| = |\det T| \geq 1, \] we have $\lambda \geq 1$, with equality if and only if $|\lambda_i| = 1$ for all $i$. The following two lemmas will be used in the proofs of \cref{p:Ggrowth,t:A}. The first of these is easy to check and its proof is left as an exercise. \begin{lem} \label{l:phi} The map $\varphi$ defined by setting $\varphi(t^n\mathbf{a}^\mathbf{u} t^{-n}) = T^n\mathbf{u}$ for $n \in \mathbb{Z}$ and $\mathbf{u} \in \mathbb{Z}^m$ can be extended to an injective homomorphism $\varphi: A \to \mathbb{Q}^m$. \qed \end{lem} The next Lemma allows us to construct exponentially many elements in $G$ of given word-length. \begin{lem} \label{l:geps} If $|\lambda_i| \neq 1$ for some $i$, then there exist constants $R \in \mathbb{N}$ and $j \in \{ 1,\ldots,m \}$ with the following property. For any $k \in \mathbb{N}$ and $\boldsymbol\varepsilon = (\varepsilon_0,\ldots,\varepsilon_k) \in \{0,1\}^{k+1}$, let \[ g_{\boldsymbol\varepsilon} = a_j^{\varepsilon_0} t^R a_j^{\varepsilon_1} t^R \cdots t^R a_j^{\varepsilon_k} \in G. \] Then $g_{\boldsymbol\varepsilon} \neq g_{\hat\boldsymbol\varepsilon}$ for any two distinct elements $\boldsymbol\varepsilon,\hat\boldsymbol\varepsilon \in \{0,1\}^{k+1}$. \end{lem} \begin{proof} Let $\varphi: A \to \mathbb{Q}^m$ be as in \cref{l:phi}. For $g_{\boldsymbol\varepsilon},g_{\hat\boldsymbol\varepsilon}$ as in the statement, we have \[ \varphi(g_{\boldsymbol\varepsilon}g_{\hat\boldsymbol\varepsilon}^{-1}) = (\varepsilon_0-\hat\varepsilon_0) \mathbf{e}_j + (\varepsilon_1-\hat\varepsilon_1) T^R\mathbf{e}_j + \cdots + (\varepsilon_k-\hat\varepsilon_k) T^{kR}\mathbf{e}_j, \] where $\{ \mathbf{e}_i \mid 1 \leq i \leq n \}$ is the standard basis for $\mathbb{Z}^m$, so that $a_i = \mathbf{a}^{\mathbf{e}_i}$. Thus, by injectivity of $\varphi$, it is enough to find $R \in \mathbb{N}$ and $j \in \{ 1,\ldots,m \}$ such that \[ \| T^{kR} \mathbf{e}_j \| > \sum_{i=0}^{k-1} \| T^{iR} \mathbf{e}_j \| \] for all $k \in \mathbb{N}$ with a suitable choice of norm $\|\cdot\|$. In particular, it is enough to require \begin{equation} \label{e:Tsk} \frac{\| T^{kR} \mathbf{e}_j \|}{\| T^{(k-1)R} \mathbf{e}_j \|} \geq 2 \end{equation} for all $k \in \mathbb{N}$. We will use Jordan normal forms to define a norm $\| \cdot \|$ and to approximate $\| T^{kR} \mathbf{e}_j \|$ for $k$ large. Let $x \in \{ 1,\ldots,m-1 \}$ be such that $|\lambda_x| < |\lambda_{x+1}| = |\lambda_{x+2}| = \cdots = |\lambda_m|$ (and $x = 0$ if $|\lambda_1| = |\lambda_m|$). Let $S \in \mathbb{N}$ be such that both $|\lambda_x|^S + 1 \leq \frac{1}{2} |\lambda_m|^S$ and $|\lambda_m|^S \geq 2$, and consider the Jordan normal form $PT^SP^{-1}$ for $T^S$ (where $P \in GL_m(\mathbb{C})$): it is a block-diagonal matrix with blocks $X,Y_1,\ldots,Y_z$ where \begin{equation*} X = \begin{pmatrix} \lambda_1^S & \alpha_1 \\ & \lambda_2^S & \ddots \\ && \ddots & \alpha_{x-1} \\ &&& \lambda_x^S \end{pmatrix} \in GL_x(\mathbb{C}) \qquad\text{and}\qquad Y_i = \begin{pmatrix} \hat\lambda_i^S & 1 \\ & \hat\lambda_i^S & \ddots \\ && \ddots & 1 \\ &&& \hat\lambda_i^S \end{pmatrix} \in GL_{y_i}(\mathbb{C}) \end{equation*} for some $\alpha_1,\ldots,\alpha_{x-1} \in \{ 0,1 \}$ and some $y_1,\ldots,y_z \in \mathbb{N}$ where, without loss of generality, $y_1 \leq \cdots \leq y_z$, and where $|\hat\lambda_i| = |\lambda_m|$. Furthermore, let $w \in \{1,\ldots,z-1\}$ be such that $y_w < y_{w+1} = \cdots = y_z$ (and $w = 0$ if $y_1 = y_z$), let $\lambda = |\lambda_m|$ and let $y = y_z$. Define a norm on $\mathbb{C}^m$ by \[ \| \mathbf{u} \| = \| P\mathbf{u} \|_\infty = \max \{ |(P\mathbf{u})_i| \mid 1 \leq i \leq m \}, \] and let $j \in \{1,\ldots,m\}$ be such that the last entry of $P\mathbf{e}_j$ is non-zero (such a choice is possible since the $P\mathbf{e}_i$ span $\mathbb{C}^m$). The idea is now to approximate $\| T^{nS}\mathbf{e}_j \|$ by a constant multiple of $\genfrac(){0pt}{1}{nS}{y-1} \lambda^{nS-y+1}$ when $n$ is large. Since the $\ell_1$-norm of any row of $X$ is at most $|\lambda_x|^S+1 \leq \frac{\lambda^S}{2}$, we get $\| X\mathbf{u} \|_\infty \leq \frac{\lambda^S}{2} \|\mathbf{u}\|_\infty$ for any $\mathbf{u} \in \mathbb{C}^x$, and so $\| X^n\mathbf{u} \|_\infty \leq \left(\frac{\lambda^S}{2}\right)^n \|\mathbf{u}\|_\infty$. Moreover, we have \[ Y_i^n = \begin{pmatrix} \hat\lambda_i^n & n \hat\lambda_i^{n-1} & \genfrac(){0pt}{1}{n}{2} \hat\lambda_i^{n-2} & \cdots & \genfrac(){0pt}{1}{n}{y_i-1} \hat\lambda_i^{n-y_i+1} \\ & \hat\lambda_i^n & n \hat\lambda_i^{n-1} & \cdots & \genfrac(){0pt}{1}{n}{y_i-2} \hat\lambda_i^{n-y_i+2} \\ && \ddots & \ddots & \vdots \\ &&& \hat\lambda_i^n & n \hat\lambda_i^{n-1} \\ &&&& \hat\lambda_i^n \end{pmatrix}. \] Now let $w \in \{1,\ldots,z-1\}$ be such that $y_w < y_{w+1} = \cdots = y_z$ (with $w = 0$ if $y_1 = y_z$), and let $y = y_z$. Then the above calculations imply that if we denote \[ PT^{nS}\mathbf{e}_j = (\beta_1^{(n)},\ldots,\beta_x^{(n)},\gamma_{1,1}^{(n)},\ldots,\gamma_{1,y_1}^{(n)},\ldots,\gamma_{z,1}^{(n)},\ldots,\gamma_{z,y_z}^{(n)}), \] then \begin{equation*} \lim_{n \to \infty} \frac{|\beta_i^{(n)}|}{\genfrac(){0pt}{1}{nS}{y-1} \lambda^{nS-y+1}} = 0 \end{equation*} and \begin{equation*} \lim_{n \to \infty} \frac{|\gamma_{i,l}^{(n)}|}{\genfrac(){0pt}{1}{nS}{y-1} \lambda^{nS-y+1}} = \begin{cases} |\gamma_{i,y_i}^{(0)}| & \text{if } l = 1 \text{ and } i > w, \\ 0 & \text{otherwise}. \end{cases} \end{equation*} Since by the choice of $j$ we have $\gamma_{z,y_z}^{(0)} \neq 0$, it follows that there exists a constant $n_0 \in \mathbb{N}$ such that for $n \geq n_0$ we have \begin{equation*} \frac{1}{2} \leq \frac{\| T^{nS}\mathbf{e}_j \|}{\genfrac(){0pt}{1}{nS}{y-1} \lambda^{nS-y+1} \max \{ |\gamma_{i,y_i}^{(0)}| \mid w+1 \leq i \leq z \}} \leq \frac{3}{2}. \end{equation*} By increasing $n_0$ further, we may also assume that $n_0 \geq 3$ and $\| T^{n_0S}\mathbf{e}_j \| \geq 2 \| \mathbf{e}_j \|$. Let $R = n_0S$. Then, since $|\lambda_x|^S+1 \leq \frac{\lambda^S}{2}$ and in particular $\lambda^S \geq 2$, we have \[ \frac{\| T^{kR}\mathbf{e}_j \|}{\| T^{(k-1)R}\mathbf{e}_j \|} \geq \frac{\frac{1}{2}\genfrac(){0pt}{1}{kn_0S}{y-1} \lambda^{kn_0S-y+1}}{\frac{3}{2}\genfrac(){0pt}{1}{(k-1)n_0S}{y-1} \lambda^{(k-1)n_0S-y+1}} \geq \frac{\lambda^{n_0S}}{3} \geq \frac{\lambda^{3S}}{3} \geq \frac{8}{3} > 2 \] for all $k \geq 2$, and also, by assumption on $n_0$, $\| T^{R}\mathbf{e}_j \| / \| \mathbf{e}_j \| \geq 2$. Thus \eqref{e:Tsk} holds, as required. \end{proof} \begin{proof}[Proof of \cref{p:Ggrowth}] \begin{enumerate}[(i)] \item \label{i:pexp0} We proceed by induction on $m$. If $m = 0$, then $G(m,T) \cong \mathbb{Z}$ is abelian, so nilpotent. Let $\mathbf{v} = (v_1,\ldots,v_m) \in \ker (T-I)$ be a non-zero element. Since $T-I$ has integer entries, we can pick $\mathbf{v}$ in such a way that $v_i/v_j \in \mathbb{Q}$ whenever $v_j \neq 0$. Thus, by rescaling $\mathbf{v}$ if necessary, we may assume that $v_i \in \mathbb{Z}$ for all $i$ and $\gcd(v_1,\ldots,v_m) = 1$. Thus $\mathbf{v}$ is a direct summand of $\mathbb{Z}^m$, so after a change of basis we may assume that $\mathbf{v} = \mathbf{e}_m$. It follows that \[ T = \begin{pmatrix} \hat{T} & \mathbf{0} \\ \mathbf{u}^T & 1 \end{pmatrix} \] for some $(m-1) \times (m-1)$ matrix $\hat{T}$ with integer entries and some $\mathbf{u} \in \mathbb{Z}^{m-1}$. Note that $\chi_T(x) = (x-1)\chi_{\hat{T}}(x)$, where $\chi_U(x) = \det(xI-U)$ for a matrix $U$, and so all eigenvalues of $\hat{T}$ are equal to $1$. Then it is easy to check that \[ G(m,T)/\langle a_m \rangle \cong G(m-1,\hat{T}) \] and so $G(m,T)/\langle a_m \rangle$ is nilpotent by induction hypothesis. Now we have $[a_m,a_i] = 1$ for all $i$ and $ta_m t^{-1} = \mathbf{a}^{T\mathbf{e}_m} = \mathbf{a}^{\mathbf{e}_m} = a_m$, so the element $a_m$ is central in $G(m,T)$. Since $G(m,T)/\langle a_m \rangle$ is nilpotent, it follows that $G(m,T)$ is nilpotent as well. \item A theorem by Kronecker \cite{kronecker}, whose proof we sketch here, shows that if a monic polynomial $p$ has integer coefficients and all roots on the unit circle, then all roots of $p$ are roots of unity. Indeed, if $p(X) = \prod_{i=1}^m (X-\lambda_i)$ is such a polynomial, then the coefficients of $p$ are symmetric polynomials in the $\lambda_i$ that generate (over $\mathbb{Q}$) the subalgebra of $\mathbb{Q}[\lambda_1,\ldots,\lambda_m]$ consisting of all symmetric polynomials. It follows that for any $n \in \mathbb{N}$, the polynomial $p_n(X) = \prod_{i=1}^m (X-\lambda_i^n)$ has rational coefficients; but as the $\lambda_i$ are algebraic integers, so are the coefficients of $p_n$, and so the coefficients of $p_n$ are integers. Since $|\lambda_i| = 1$ for all $i$, the coefficient of $X^k$ in $p_n$ is bounded by $\genfrac(){0pt}{1}{m}{k}$ for each $k \in \{ 0,\ldots,m \}$. It follows that the set $\{ p_n \mid n \in \mathbb{N} \}$ contains only finitely many polynomials. Thus there exists a polynomial $\hat{p}(X) = \prod_{i=1}^m (X-\nu_i)$ and an infinite subset $I \subseteq \mathbb{N}$ such that $p_n(X) = \hat{p}(X)$ for all $n \in I$. This means that for all $n \in I$, there exists a permutation $\sigma = \sigma_n \in \mathrm{Sym} \{ 1,\ldots,m \}$ such that $\lambda_i^n = \nu_{\sigma(i)}$ for each $i$. Since $\mathrm{Sym} \{ 1,\ldots,m \}$ is finite, there exist two distinct elements $n_1,n_2 \in I$ such that $\sigma_{n_1} = \sigma_{n_2}$. This implies that $\lambda_i^{n_1} = \lambda_i^{n_2}$ for each $i$, and so $\lambda_i$ is $|n_1-n_2|$-th root of unity, as required. Since the polynomial $\chi_T$ has integer coefficients and all roots on the unit circle, the argument above shows that there exists $n \in \mathbb{N}$ such that all eigenvalues of $T^n$ are equal to $1$. Define a map $\tau_n: G(m,T) \to \mathbb{Z}/n\mathbb{Z}$ by setting $\tau_n(a_i) = 0$ for all $i$ and $\tau_n(t) = 1$: that is, $\tau_n$ is $\tau$ followed by reduction modulo $n$, where $\tau$ is as in \cref{d:GmT}. Now $\ker \tau_n \cong G(m,T^n)$ is nilpotent by part \eqref{i:pexp0} and has index $n$ in $G(m,T)$, and so $G(m,T)$ is virtually nilpotent, as required. \item It is enough to show that $A(m,T)$ has exponential growth in $G(m,T)$. This follows easily from \cref{l:geps}. Indeed, given an integer $k$ the set \[ \{ g_{\boldsymbol\varepsilon}t^{-kR} \mid \boldsymbol\varepsilon \in \{0,1\}^{k+1} \} \] contains $2^{k+1}$ distinct elements of $A(m,T)$, and each of these elements has word length at most $k+1+2kR \leq (k+1)(2R+1)$ over $X = \{ a_1,\ldots,a_m,t \}$. Thus \[ |A(m,T) \cap B_X((2R+1)(k+1))| \geq 2^{k+1} \] for all $k \in \mathbb{N}$, which implies \[ \liminf_{n \to \infty} \frac{\log |A(m,T) \cap B_X(n)|}{n} \geq \frac{\log 2}{2R+1} > 0, \] as required. \qedhere \end{enumerate} \end{proof} \section{Negligibility of the elliptic subgroup} \label{s:A} In this section we prove \cref{t:A}. As a consequence of \cref{p:Ggrowth}, we restrict to matrices $T$ that have eigenvalues of absolute value not equal to $1$. Let $G = G(m,T)$ and $A = A(m,T)$. By \cref{p:Ggrowth}, there exists a constant $\alpha > 1$ such that $|A \cap B_Y(n)| \geq \alpha^n$ for all sufficiently large $n$. Fix $\beta \in (1,\alpha^{1/2m})$, and let $d = \det T$. Let $Y$ be a finite generating set for $G$. Let $\varphi: A \to \mathbb{Q}^m$ be as in \cref{l:phi}. Define the sets \[ \mathcal{Z}_+ = \{ g \in A \mid \beta^{|g|_Y} \leq \|\varphi(g)\|_\infty \} \] and \[ \mathcal{Z}_- = \begin{cases} \{ g \in A \mid d^{\lfloor |g|_Y \log\beta/\log |d| \rfloor}\varphi(g) \notin \mathbb{Z}^m \} & \text{if } |d| \geq 2, \\ \varnothing & \text{if } |d| = 1, \end{cases} \] and let $\mathcal{Z} = \mathcal{Z}_+ \cup \mathcal{Z}_-$. \begin{lem} \label{l:Zgen} Elements of $\mathcal{Z}$ are generic in $A$ with respect to $Y$: that is, $\frac{|\mathcal{Z} \cap B_Y(n)|}{|A \cap B_Y(n)|} \to 1$ as $n \to \infty$. \end{lem} \begin{proof} Suppose first that $|d| \neq 1$. Note that for each $k_1 > 0$ and $k_2 \in \mathbb{N}$, the number of elements in the set \[ \{ \mathbf{u} \in \mathbb{Q}^m \mid \|\mathbf{u}\|_\infty \leq k_1, k_2\mathbf{u} \in \mathbb{Z}^m \} \subseteq \mathbb{Q}^m \] is at most $(2k_1k_2+1)^m \leq 3^mk_1^mk_2^m$. As $|d|^{\log\beta/\log |d|} = \beta$ and $\beta^{2m} < \alpha$, we get \begin{align*} \limsup_{n \to \infty} \frac{|(A \setminus \mathcal{Z}) \cap B_Y(n)|}{|A \cap B_Y(n)|} &\leq \limsup_{n \to \infty} \frac{|\{ \mathbf{u} \in \mathbb{Q}^m \mid \beta^n > \|\mathbf{u}\|_\infty, d^{\lfloor n \log\beta/\log |d| \rfloor}\mathbf{u} \in \mathbb{Z}^m \}|}{|A \cap B_Y(n)|} \\ &\leq 3^m \limsup_{n \to \infty} \left( \frac{\beta^{2m}}{\alpha} \right)^n = 0. \end{align*} If instead $|d| = 1$, then $T \in GL_n(\mathbb{Z})$ and so $A = \{ \mathbf{a}^\mathbf{u} \mid \mathbf{u} \in \mathbb{Z}^n \}$, hence we obtain \[ \limsup_{n \to \infty} \frac{|(A \setminus \mathcal{Z}) \cap B_Y(n)|}{|A \cap B_Y(n)|} \leq \limsup_{n \to \infty} \frac{|\{ \mathbf{u} \in \mathbb{Z}^m \mid \beta^n > \|\mathbf{u}\|_\infty \}|}{|A \cap B_Y(n)|} \leq 3^m \limsup_{n \to \infty} \left( \frac{\beta^m}{\alpha} \right)^n = 0, \] as required. \end{proof} For a path $\omega = y_1 \cdots y_n$ (with $y_i \in Y$) in the Cayley graph $\Gamma(G,Y)$, we may consider its image in the quotient $G/A \cong \mathbb{Z}$. In particular, define the \emph{maximal height}, \emph{minimal height} and \emph{total height} of $\omega$ as the numbers \[ \mathfrak{h}_+(\omega) = \max \{ \tau(y_1 \cdots y_i) \mid 0 \leq i \leq n \}, \] \[ \mathfrak{h}_-(\omega) = \min \{ \tau(y_1 \cdots y_i) \mid 0 \leq i \leq n \} \] and \[ \mathfrak{h}(\omega) = \max\{ \mathfrak{h}_+(\omega),-\mathfrak{h}_-(\omega) \}, \] respectively, where $\tau$ is as in \cref{d:GmT}. Note that $\mathfrak{h}_-(\omega) \leq 0 \leq \mathfrak{h}_+(\omega)$ for any word $\omega$. \begin{lem} \label{l:highwords} There exists a constant $\delta > 0$ such that if $\omega$ is a geodesic word representing $g \in \mathcal{Z}$ with $|g|_Y$ sufficiently large, then $\mathfrak{h}(\omega) \geq \delta |g|_Y$. \end{lem} \begin{proof} Since each element of $Y$ can be expressed as $t^{-r} \mathbf{a}^\mathbf{u} t^s$ for some $\mathbf{u} \in \mathbb{Z}^m$ and $0 \leq r,s \leq c$, it is easy to see -- by induction on the length of $\omega$, say -- that $\varphi(g) \in d^{\mathfrak{h}_-(\omega)-c}\mathbb{Z}^m$. Thus if $g \in \mathcal{Z}_-$ (and so $\mathcal{Z}_- \neq \varnothing$, implying that $|d| \geq 2$) then we have \[ \mathfrak{h}(\omega) \geq -\mathfrak{h}_-(\omega) > \frac{\log\beta}{\log |d|}|g|_Y - c \geq \frac{\log\beta}{2\log |d|}|g|_Y \] if $|g|_Y \geq 2c\log|d|/\log\beta$. Suppose now $g \in \mathcal{Z}_+$. Then we have \begin{equation} \label{e:gY} |g|_Y \leq \log \|\varphi(g)\|_\infty / \log \beta. \end{equation} Let $\omega = y_1 \cdots y_n$ with $y_i \in Y$, and let $L = \max \{ \|T\|_{op}, \|T^{-1}\|_{op} \}$, where $\| \cdot \|_{op}$ denotes the operator norm with respect to the $\ell_\infty$-norm on $\mathbb{C}^m$. Note that, since $G$ has exponential growth, $T$ has an eigenvalue $\lambda$ with $|\lambda| \neq 1$ by \cref{p:Ggrowth}, and so $L > 1$. It is easy to show -- by induction on $i$, say -- that \[ \| \varphi(y_1 \cdots y_i t^{-\tau(y_1 \cdots y_i)}) \|_\infty \leq L^{\mathfrak{h}(y_1 \cdots y_i)} \sum_{j=1}^i \| \varphi(y_jt^{-\tau(y_j)})\|_\infty \] for $1 \leq i \leq n$, and hence \begin{equation} \label{e:phig} \| \varphi(g) \|_\infty \leq c_0 L^{\mathfrak{h}(\omega)} |g|_Y, \end{equation} where $c_0 = \max \{ \|\varphi(yt^{-\tau(y)})\|_\infty \mid y \in Y \}$. Combining \eqref{e:gY} and \eqref{e:phig} yields \[ |g|_Y \leq \frac{1}{\log \beta} \left( \log c_0 + \mathfrak{h}(\omega)\log L + \log |g|_Y \right) \] and hence \[ \mathfrak{h}(\omega) \geq \frac{1}{\log L} \left( |g|_Y \log\beta - \log |g|_Y - \log c_0 \right). \] Now if $|g|_Y$ is big enough then we have $\log |g|_Y + \log c_0 \leq \frac{\log \beta}{2} |g|_Y$; substituting this yields \[ \mathfrak{h}(\omega) \geq \frac{\log\beta}{2\log L}|g|_Y, \] so by setting $\delta = \log\beta / 2\log(\max\{L,|d|\})$ we are done. \end{proof} The next Lemma shows that there exists a particular subset $\mathcal{A} \subseteq \mathcal{Z}$ such that, given an element $g \in \mathcal{A}$, there are `many' words over $Y$ representing $g$ that are `not too long'. More specifically, for $n,p,q \in \mathbb{N}$ with $p \leq n$ and for $h \in \mathbb{Z}$, define \[ \mathcal{A}(n) = \mathcal{A}_{p,h}(n) = \{ g_1 g_2 \mid g_1 \in t^hA \cap B_Y(p), g_2 \in t^{-h}A \cap B_Y(n-p) \} \cap \mathcal{Z}, \] and define the map \begin{align*} \mu_{n,p,q,h}: [t^hA \cap B_Y(p+q)] \times [t^{-h}A \cap B_Y(n-p+q)] &\to A \cap B_Y(n+2q), \\ (g_1,g_2) &\mapsto g_1g_2. \end{align*} Furthermore, let $X = \{ a_1,\ldots,a_m,t \}$ be the standard generating set for $G$. Since the word metrics $|\cdot|_X$ and $|\cdot|_Y$ are bi-Lipschitz equivalent, there exists a constant $c \in \mathbb{N}$ such that \[ |g|_X \leq c |g|_Y \qquad \text{and} \qquad |g|_Y \leq c|g|_X \] for all $g \in G$. \begin{lem} \label{l:manywords} Let $R \in \mathbb{N}$ be given by \cref{l:geps}. Then for any $\hat\delta > 0$, any $n,p,k \in \mathbb{N}$ with $p \leq n$ and $k \leq \hat\delta n / R$, any $h \in \mathbb{Z}$ with $|h| \geq \lfloor \hat\delta n \rfloor$, and any $g \in \mathcal{A}_{p,h}(n)$, we have \[ |(\mu_{n,p,c(c+1)k,h})^{-1}(g)| \geq \genfrac(){0pt}{1}{\lfloor \hat\delta n / R \rfloor}{k}. \] \end{lem} \begin{proof} Let $\mathcal{A} = \mathcal{A}_{p,h}(n)$ and $\mu = \mu_{n,p,c(c+1)k,h}$. Let $\mathcal{P}$ be the set of all subsets of $\{1,\ldots,\lfloor \hat\delta n / R \rfloor\}$ of cardinality $k$. We will find an injection $\mathcal{P} \to \mu^{-1}(g), B \mapsto (l_{B,1},l_{B,2})$, which will prove our claim. Suppose first that $h > 0$. As $g \in \mathcal{A}$, there exists an expression $g = g_1g_2$, where $g_1 \in t^hA \cap B_Y(p)$ and $g_2 \in t^{-h}A \cap B_Y(n-p)$. Let $\omega_1 = y_1 \cdots y_r$ and $\omega_2 = y_{r+1} \cdots y_{|g|_Y}$ be geodesic paths representing $g_1$ and $g_2$, respectively, where $y_i \in Y$. Given $B \in \mathcal{P}$, we `modify' $(g_1,g_2)$ in a way that preserves the product $g_1g_2$, as follows; this construction is illustrated in \cref{f:k1k2}. \begin{figure}[ht] \begin{tikzpicture}[scale=0.65] \filldraw [fill=green!10] (0.8,2) rectangle (10,3); \draw [black,thick] plot [smooth] coordinates { (0,0) (1,1) (2,4.5) (3,4) (4,6) (5,7) (6,7.5) (7,7) (8,5) (9,4) (9.5,3) (10,0) (11,-2) (11.5,0) }; \filldraw (7,7) circle (2pt); \filldraw (0,0) circle (2pt); \filldraw (11.5,0) circle (2pt); \draw [thick,->] (1.998,4.497) -- (2,4.5) node [left] {$\omega_1$}; \draw [thick,->] (8.997,4.006) -- (9,4) node [right] {$\omega_2$}; \draw [very thin] (0,0) -- (11.5,0); \draw [<->] (7,0) -- (7,6.95) node [pos=0.6,right] {$h$}; \draw [<->] (3.8,0) -- (3.8,2) node [pos=0.6,left] {$b_iR-\frac{c}{2}\!$}; \draw [<->] (4,0) -- (4,3) node [pos=0.4,right] {$\!b_iR+\frac{c}{2}$}; \begin{scope}[xshift=13cm,yshift=4.25cm,yscale=1.25] \fill [green!10] (-0.5,0) rectangle (10.5,3); \draw [dashed] (-1,1.5) -- (4.5,1.5); \draw [dash pattern=on 1pt off 3pt] (4.5,1.5) -- (6.5,1.5); \draw [dashed] (6.5,1.5) -- (10,1.5); \draw [|->|] (1.9,1.5) -- (1.9,2.1) node [midway,right] {$q_{i,1}$}; \draw [|->|] (8.8,1.5) -- (8.8,0.6) node [midway,right] {$q_{i,2}$}; \draw [->] (-1,-0.5) -- (-1,3.5) node [above left] {$\tau$} node [midway,left] {$b_iR$}; \draw (4.5,3) -- (-0.5,3) -- (-0.5,0) -- (4.5,0); \draw (6.5,3) -- (10.5,3) -- (10.5,0) -- (6.5,0); \draw [dash pattern=on 1pt off 2pt] (4.5,3) -- (6.5,3); \draw [dash pattern=on 1pt off 2pt] (4.5,0) -- (6.5,0); \draw [thick,dashed] (0.8,-0.6) -- (1,0); \draw [thick,->] (1,0) -- (1.2,0.6) node [left] {$y_{j_{i,1}}$}; \filldraw [thick] (1.2,0.6) -- (1.7,2.1) circle (2pt) -- (2,3); \draw [thick,dashed,->] (2,3) -- (2.2,3.6) node [left] {$y_{j_{i,1}+1}$}; \draw [thick,dashed] (2.2,3.6) -- (2.29,3.87); \draw [thick,dashed] (7.85,3.6) -- (8,3); \draw [thick,->] (8,3) -- (8.2,2.2) node [right] {$y_{j_{i,2}}$}; \filldraw [thick] (8.2,2.2) -- (8.6,0.6) circle (2pt) -- (8.75,0); \draw [thick,dashed,->] (8.75,0) -- (8.9,-0.6) node [right] {$y_{j_{i,2}+1}$}; \draw [thick,dashed] (8.9,-0.6) -- (9,-1); \draw[->,very thick,decorate,decoration=snake] (5.5,-0.25) -- (5.5,-1.75); \end{scope} \begin{scope}[xshift=13cm,yshift=-2cm,yscale=1.25] \fill [green!10] (-0.5,0) rectangle (10.5,3); \draw [dashed] (3.2,1.5) -- (4.5,1.5); \draw [dash pattern=on 1pt off 3pt] (4.5,1.5) -- (6.5,1.5); \draw [dashed] (6.5,1.5) -- (7.1,1.5); \draw [red,thick,->] (7.1,1.5) -- (7.85,1.5) node [above] {$a_j$}; \draw [red,thick] (7.85,1.5) -- (8.6,1.5); \draw [blue,thick,->] (7.1,1.5) -- (7.1,1.05) node [right] {$t^{q_{i,2}}$}; \draw [blue,thick] (7.1,1.05) -- (7.1,0.6); \draw [blue,thick,->] (8.6,1.5) -- (8.6,1.05) node [right] {$t^{q_{i,2}}$}; \draw [blue,thick] (8.6,1.05) -- (8.6,0.6); \draw [red,thick,->] (1.7,1.5) -- (2.45,1.5) node [below] {$a_j$}; \draw [red,thick] (2.45,1.5) -- (3.2,1.5); \draw [blue,thick,->] (1.7,1.5) -- (1.7,1.8) node [right] {$t^{q_{i,1}}$}; \draw [blue,thick] (1.7,1.8) -- (1.7,2.1); \draw [blue,thick,->] (3.2,1.5) -- (3.2,1.8) node [right] {$t^{q_{i,1}}$}; \draw [blue,thick] (3.2,1.8) -- (3.2,2.1); \draw (4.5,3) -- (-0.5,3) -- (-0.5,0) -- (4.5,0); \draw (6.5,3) -- (10.5,3) -- (10.5,0) -- (6.5,0); \draw [dash pattern=on 1pt off 2pt] (4.5,3) -- (6.5,3); \draw [dash pattern=on 1pt off 2pt] (4.5,0) -- (6.5,0); \draw [thick,dashed] (0.8,-0.6) -- (1,0); \draw [thick,->] (1,0) -- (1.2,0.6) node [left] {$y_{j_{i,1}}$}; \filldraw [thick] (1.2,0.6) -- (1.7,2.1) circle (2pt); \filldraw [thick] (3.2,2.1) circle (2pt) -- (3.5,3); \draw [thick,dashed,->] (3.5,3) -- (3.7,3.6) node [left] {$y_{j_{i,1}+1}$}; \draw [thick,dashed] (3.7,3.6) -- (3.79,3.87); \draw [thick,dashed] (7.85,3.6) -- (8,3); \draw [thick,->] (8,3) -- (8.2,2.2) node [right] {$y_{j_{i,2}}$}; \filldraw [thick] (8.2,2.2) -- (8.6,0.6) circle (2pt); \filldraw [thick] (7.1,0.6) circle (2pt) -- (7.25,0); \draw [thick,dashed,->] (7.25,0) -- (7.4,-0.6) node [right] {$y_{j_{i,2}+1}$}; \draw [thick,dashed] (7.4,-0.6) -- (7.5,-1); \end{scope} \end{tikzpicture} \caption{Construction of the words $\psi_{B,1}$ and $\psi_{B,2}$ in the proof of \cref{l:manywords}.} \label{f:k1k2} \end{figure} Let $B \in \mathcal{P}$, and write $B = \{ b_1,\ldots,b_k \}$, where $1 \leq b_1 < b_2 < \cdots < b_k \leq \lfloor \hat\delta n / R \rfloor$. Note that $|y|_X \leq c$ for all $y \in Y$, which implies that $|\tau(y)| \leq c$ for all $y \in Y$. Since $\tau(g_1) = -\tau(g_2) = h \geq \lfloor \hat\delta n \rfloor$, it follows that for each $s \in \{1,\ldots,\lfloor \hat\delta n \rfloor\}$, there exist integers $j_1,j_2$ with $0 \leq j_1 \leq r \leq j_2 \leq |g|_Y$ such that $|\tau(y_1 \cdots y_{j_1})-s| \leq \frac{c}{2}$ and $|\tau(y_{j_2+1} \cdots y_{|g|_Y})+s| \leq \frac{c}{2}$. In particular, for each $i \in \{ 1,\ldots,k \}$, there exist integers $j_{i,1},j_{i,2}$ such that \begin{equation} \label{e:taubR} |\tau(y_1 \cdots y_{j_{i,1}})-b_iR| \leq \frac{c}{2} \qquad \text{and} \qquad |\tau(y_{j_{i,2}+1} \cdots y_{|g|_Y})+b_iR| \leq \frac{c}{2}. \end{equation} Let $j$ be as in \cref{l:geps}, and define the words $\psi_{B,1}$ and $\psi_{B,2}$ as follows. For $\psi_{B,1}$, start with the word $\omega_1$, and for each $i \in \{ 1,\ldots,k \}$, insert a geodesic subword representing $t^{-q_{i,1}} a_j t^{q_{i,1}}$ between $y_{j_{i,1}}$ and $y_{j_{i,1}+1}$, where $q_{i,1} = \tau(y_1 \cdots y_{j_{i,1}})-b_iR$. For $\psi_{B,2}$, start with the word $\omega_2$, and for each $i \in \{ 1,\ldots,k \}$, insert a geodesic subword representing $t^{-q_{i,2}} a_j^{-1} t^{q_{i,2}}$ between $y_{j_{i,2}}$ and $y_{j_{i,2}+1}$, where $q_{i,2} = -\tau(y_{j_{i,2}+1} \cdots y_{|g|_Y})-b_iR$. Let $l_{B,1}$ and $l_{B,2}$ be the elements represented by words $\psi_{B,1}$ and $\psi_{B,2}$, respectively. Then commutativity of $A$ and the choice of the $q_{i,1}$ and the $q_{i,2}$ implies that $l_{B,1}l_{B,2} = g_1g_2 = g$. Furthermore, it is clear that $\tau(l_{B,1}) = \tau(g_1) = h$ and $\tau(l_{B,2}) = \tau(g_2) = -h$. Finally, by \eqref{e:taubR} we have $|q_{i,1}|,|q_{i,2}| \leq \frac{c}{2}$ for each $i$, so every fragment inserted into $\omega_1$ (or $\omega_2$) to form $\psi_{B,1}$ (or $\psi_{B,2}$) has word-length at most $c+1$ with respect to $X$, and so at most $c(c+1)$ with respect to $Y$. It follows that \begin{align*} |l_{B,1}|_Y &\leq |g_1|_Y + c(c+1)k \leq p+c(c+1)k \\ \text{and} \qquad |l_{B,2}|_Y &\leq |g_2|_Y + c(c+1)k \leq n-p+c(c+1)k. \end{align*} Thus indeed $(l_{B,1},l_{B,2}) \in \mu^{-1}(g)$, as required. Finally, to show that the map $\mathcal{P} \to \mu^{-1}(g), B \mapsto (l_{B,1},l_{B,2})$ is injective, we use \cref{l:geps}. Indeed, if $B,C \in \mathcal{P}$ are distinct, then \[ \varphi(l_{B,1}l_{C,1}^{-1}) = \sum_{i=1}^k (\mathbbm{1}_B(i)-\mathbbm{1}_C(i)) T^{iR} \mathbf{e}_j = \varphi(g_{\mathbbm{1}_B}g_{\mathbbm{1}_C}^{-1}), \] where $\varphi$ is as in \cref{l:phi} and $\mathbbm{1}_B,\mathbbm{1}_C: \{1,\ldots,k\} \to \{0,1\}$ are the indicator functions for $B$ and $C$, defined by \[ \mathbbm{1}_B(i) = \begin{cases} 1 & \text{if } i \in B, \\ 0 & \text{otherwise.} \end{cases} \] In particular, by \cref{l:phi,l:geps} we have $l_{B,1}l_{C,1}^{-1} \neq 1$, and so $(l_{B,1},l_{B,2}) \neq (l_{C,1},l_{C,2})$, completing the proof in the case $h > 0$. If instead $h < 0$, then a very similar argument, obtained essentially by `turning \cref{f:k1k2} upside down', works. \end{proof} \cref{t:A} can now be deduced from the following Theorem, which at first glance seems to be marginally weaker than \cref{t:A}. \begin{thm} \label{t:Aalmost} Let $f: \mathbb{N} \to [0,\infty)$ be a function such that $f(n) \to 0$ as $n \to \infty$. Then \[ \log |A \cap B_Y(n)| - \log |B_Y(n)| \leq -nf(n) \] for all sufficiently large $n$. \end{thm} It would seem that \cref{t:A} would only follow from \cref{t:Aalmost} if we were allowed to take $f$ in \cref{t:Aalmost} to be a strictly positive constant function. However, using a general argument on sequences, we can actually deduce \cref{t:A} from \cref{t:Aalmost}. \begin{proof}[Proof of \cref{t:A}] Suppose for contradiction that $A(m,T)$ is not exponentially negligible in $G(m,T)$ with respect to a finite generating set $Y$. This is equivalent to saying that \[ c_i = \frac{\log |A(m,T) \cap B_Y(n_i)|-\log |B_Y(n_i)|}{n_i} \to 0 \qquad \text{as } i \to \infty \] for some (without loss of generality, strictly increasing) sequence $(n_i)_{i=1}^\infty$ in $\mathbb{N}$. Note that, as $A(m,T) \neq G(m,T)$, we have $Y \nsubseteq A(m,T)$ and so $c_i < 0$ for all $i$. Define a function $f: \mathbb{N} \to [0,\infty)$ by \[ f(n) = \begin{cases} -2c_i & \text{if } n = n_i \text{ for some } i, \\ 0 & \text{otherwise.} \end{cases} \] Then $f(n) \to 0$ as $n \to \infty$, and so it would follow from \cref{t:Aalmost} that $-n_ic_i \geq -2n_ic_i$ for $i$ large enough, which gives a contradiction. Therefore $A(m,T)$ is exponentially negligible in $G(m,T)$ with respect to $Y$, as required. \end{proof} \begin{proof}[Proof of \cref{t:Aalmost}] The proof uses \cref{l:Zgen,l:highwords} to find a subset of $A$ of the form $\mathcal{A}(n)$ (as defined before \cref{l:manywords}) that is `large' in an appropriate sense, and then uses \cref{l:manywords} to give bounds. We first show that a generic element of $A$ is `not too short' in terms of word length. Let $\mu > 1$ be the growth rate of $G$ with respect to $Y$: that is, $\mu = \limsup_{n \to \infty} \sqrt[n]{|B_Y(n)|}$, and recall that by \cref{p:Ggrowth} there exists $\alpha > 1$ such that $|A \cap B_Y(n)| \geq \alpha^n$ for all sufficiently large $n$. Fix $\zeta \in \left(0,\frac{\log\alpha}{\log(\mu+1)}\right)$. For $n$ sufficiently large we have $|B_Y(\lfloor \zeta n \rfloor)| \leq (\mu+1)^{\zeta n}$ by the definition of $\mu$, thus \[ \frac{|A \cap B_Y(\lfloor \zeta n \rfloor)|}{|A \cap B_Y(n)|} \leq \frac{|B_Y(\lfloor \zeta n \rfloor)|}{|A \cap B_Y(n)|} \leq \frac{(\mu+1)^{\zeta n}}{\alpha^n} = \left( \frac{(\mu+1)^\zeta}{\alpha} \right)^n \] for sufficiently large $n$, and so $\frac{|A \cap B_Y(\lfloor \zeta n \rfloor)|}{|A \cap B_Y(n)|} \to 0$ as $n \to \infty$. It follows from this and \cref{l:Zgen} that \begin{equation} \label{e:ZB} \frac{|\mathcal{Z} \cap (B_Y(n) \setminus B_Y(\lfloor \zeta n \rfloor))|}{|A \cap B_Y(n)|} \to 1 \qquad \text{as } n \to \infty. \end{equation} We now construct a subset of $|A \cap B_Y(n)|$ of the form $\mathcal{A}(n)$ that contains `enough' elements. For any $g \in G$, choose be a geodesic word $\omega_g$ representing $g$. If $g \in \mathcal{Z}$ and $\zeta n < |g|_Y \leq n$, then it is clear that $\mathfrak{h}(\omega_g) \leq \frac{cn}{2}$; on the other hand, by \cref{l:highwords} we have $\mathfrak{h}(\omega_g) \geq \delta\zeta n$ when $n$ is large enough, for some (universal) constant $\delta > 0$. This gives at most $\frac{cn}{2}$ possible values of $\mathfrak{h}(\omega_g)$, and so by pidgeonhole principle there exists some $h_0 = h_0(n) \in \mathbb{N}$ with $\delta\zeta n \leq h_0 \leq \frac{cn}{2}$ such that \[ |\{ g \in \mathcal{Z} \cap B_Y(n) \mid \mathfrak{h}(\omega_g) = h_0 \}| \geq \frac{2}{cn} |\mathcal{Z} \cap (B_Y(n) \setminus B_Y(\lfloor \zeta n \rfloor))|. \] By the definition of $\mathfrak{h}(\omega_g)$, it follows that for some $h = h(n) \in \{ \pm h_0 \}$, at least a half of the elements in $\{ g \in \mathcal{Z} \cap B_Y(n) \mid \mathfrak{h}(\omega_g) = h_0 \}$ can be written as $g = g_1g_2$, where $g_1 \in t^hA$ and $|g|_Y = |g_1|_Y+|g_2|_Y$. By using the pidgeonhole principle on the set $\{1,\ldots,n-1\}$ of possible values for $p = |g_1|_Y$, we see that \[ |\mathcal{A}_{p,h}(n)| \geq \frac{1}{cn^2} |\mathcal{Z} \cap (B_Y(n) \setminus B_Y(\lfloor \zeta n \rfloor))| \] for some $p = p(n)$, where $\mathcal{A}(n) = \mathcal{A}_{p,h}(n)$ is as defined before \cref{l:manywords}. Combining this with \eqref{e:ZB} yields \begin{equation} \label{e:Aphn} |\mathcal{A}(n)| \geq \frac{1}{2cn^2} |A \cap B_Y(n)| \end{equation} for all sufficiently large $n$. By Fekete's Lemma, it follows that if we write \[ \log |B_Y(n)| = (\log \mu + \varepsilon_n)n, \] then $\varepsilon_n \geq 0$ for all $n$ and $\varepsilon_n \to 0$ as $n \to \infty$. Note that we also have $\delta\zeta n \leq h_0 \leq cp$, and so $p(n) \geq \delta\zeta n/c$; similarly, $n-p(n) \geq \delta\zeta n/c$. Therefore, $p(n) \to \infty$ and $n-p(n) \to \infty$ as $n \to \infty$, and so there exists a function $F: \mathbb{N} \to [0,\infty)$ such that \[ F(n) \geq f(n), \frac{\log n}{n}, \varepsilon_{p(n)}, \varepsilon_{n-p(n)} \quad \text{for all } n, \qquad \text{and} \qquad F(n) \to 0 \quad \text{as } n \to \infty. \] By replacing $F(n)$ with $\lceil nF(n) \rceil/n$ if necessary, we may furthermore assume that $nF(n) \in \mathbb{Z}$ for all $n$. We now apply \cref{l:manywords} with $n$ sufficiently large (so that $F(n) \leq \delta\zeta/R$), with $p = p(n)$ and $h = h(n)$ as above, with $\hat\delta = \delta\zeta$ and with $k = nF(n)$. It then follows that $|\mu^{-1}(g)| \geq \genfrac(){0pt}{1}{\lfloor \delta_0 n \rfloor}{k}$ for each $g \in \mathcal{A}(n)$, where $\mu = \mu_{n,p,c(c+1)nF(n),h}$ and $\delta_0 = \delta\zeta/R$, and therefore \begin{equation} \label{e:Anleq} \begin{aligned} |\mathcal{A}(n)| &\leq \frac{|t^hA \cap B_Y(p+c(c+1)nF(n)| \times |t^{-h}A \cap B_Y(n-p+c(c+1)nF(n)|}{\genfrac(){0pt}{1}{\lfloor \delta_0 n \rfloor}{nF(n)}} \\ &\leq \frac{|B_Y(p+c(c+1)nF(n)| \times |B_Y(n-p+c(c+1)nF(n)|}{\genfrac(){0pt}{1}{\lfloor \delta_0 n \rfloor}{nF(n)}} \\ &\leq \frac{|B_Y(p)| \times |B_Y(n-p)| \times |B_Y(c(c+1)nF(n)|^2}{\genfrac(){0pt}{1}{\lfloor \delta_0 n \rfloor}{nF(n)}}, \end{aligned} \end{equation} where the last inequality comes from the submultiplicativity of the function $n \mapsto |B_Y(n)|$. The Theorem can now be deduced from the results above via a few calculations. Considering each term in \eqref{e:Anleq} separately and taking logarithms, we get the following bounds: \begin{align*} \log |B_Y(p)| &\leq p\log\mu + p\varepsilon_p, \\ \log |B_Y(n-p)| &\leq (n-p)\log\mu + (n-p)\varepsilon_{n-p}, \\ \log |B_Y(c(c+1)nF(n))| &\leq c(c+1)nF(n)\log|Y|, \\ \text{and} \qquad \log \genfrac(){0pt}{1}{\lfloor \delta_0 n \rfloor}{nF(n)} &= \sum_{i=1}^{nF(n)} \log \left( \frac{\lfloor\delta_0n\rfloor-i+1}{i} \right) \geq nF(n) \log \left( \frac{\lfloor\delta_0n\rfloor-nF(n)}{nF(n)} \right) \\ &\geq nF(n)\log(\delta_0/2-F(n)) - nF(n)\log F(n), \end{align*} where the last inequality comes from the bound $\lfloor\delta_0n\rfloor \geq \delta_0n/2$, which is true for $n$ large. Combining these bounds and using \eqref{e:Aphn} and \eqref{e:Anleq} gives \begin{align*} -\log 2c &-2\log n + \log |A \cap B_Y(n)| \leq \log |\mathcal{A}(n)| \leq n\log\mu + p\varepsilon_p + (n-p)\varepsilon_{n-p} \\ &+ 2c(c+1)nF(n)\log |Y| - nF(n)\log(\delta_0/2-F(n)) + nF(n)\log F(n), \end{align*} which can be rearranged to yield \begin{align*} \log |A \cap B_Y(n)| - n\log\mu \leq \log 2c &+2\log n + p\varepsilon_p + (n-p)\varepsilon_{n-p} + 2c(c+1)nF(n)\log |Y| \\ &- nF(n)\log(\delta_0/2-F(n)) + nF(n)\log F(n). \end{align*} It follows from the definition of $F(n)$ that, for $n$ sufficiently large, all the terms on the right hand side except for the last one can be bounded by a constant multiple of $nF(n)$. Therefore, we have \[ \limsup_{n \to \infty} \left( \frac{\log |A \cap B_Y(n)| - n\log\mu}{nF(n)} - \log F(n) \right) < \infty. \] But since $\log F(n) \to -\infty$ as $n \to \infty$, and since $\log |B_Y(n)| \geq n \log \mu$ for all $n$, we see that \[ \frac{\log |A \cap B_Y(n)| - \log |B_Y(n)|}{nF(n)} \leq \frac{\log |A \cap B_Y(n)| - n\log\mu}{nF(n)} \leq -1 \] for all sufficiently large $n$. As $F(n) \geq f(n)$, this implies the result. \end{proof} \section{Degree of nilpotence} \label{s:dn} In this section we prove \cref{t:dn}. We let $G = G(m,T)$ and $A = A(m,T)$, and let $Y$ be a finite generating set for $G$. We assume, as in the previous section, that $G$ has exponential growth. To show \cref{t:dn}, we use the following general Lemma. \begin{lem} \label{l:gennilp} Suppose, given a group $G$ generated by a finite set $Y$, that there exist a subset $\mathcal{N} \subseteq G$ and a function $f: \mathbb{Z}_{\geq 0} \to [0,1]$ satisfying (for all integers $n \geq 0$) \begin{equation} \label{e:gennilp1} \frac{|\mathcal{N} \cap B_Y(n)|}{|B_Y(n)|} \leq f(n) \end{equation} and \begin{equation} \label{e:gennilp2} \frac{|\{ h \in B_Y(n) \mid [g,h] \in \mathcal{N} \}|}{|B_Y(n)|} \leq f(n) \end{equation} for all $g \in G \setminus \mathcal{N}$. Then \[ \frac{|\{ (x_0,\ldots,x_r) \in B_Y(n)^{r+1} \mid [x_0,\ldots,x_r] \in \mathcal{N} \}|}{|B_Y(n)|^{r+1}} \leq (r+1)f(n) \] for all integers $r,n \geq 0$. \end{lem} \begin{proof} Induction on $r$. The base case $r = 0$ follows from \eqref{e:gennilp1}. For $r \geq 1$, write $\bar{x}$ for $[x_0,\ldots,x_{r-1}]$. Then we have \begin{align*} \sum_{\substack{x_0,\ldots,x_{r-1} \in B_Y(n) \\ \bar{x} \in \mathcal{N}}} &\frac{|\{ x_r \in B_Y(n) \mid [\bar{x},x_r] \in \mathcal{N} \}|}{|B_Y(n)|^{r+1}} \\ &\leq |\{ (x_0,\ldots,x_{r-1}) \in B_Y(n)^r \mid \bar{x} \in \mathcal{N} \}| \times \frac{|B_Y(n)|}{|B_Y(n)|^{r+1}} \\ &\leq |B_Y(n)|^r rf(n) \times |B_Y(n)|^{-r} = rf(n) \end{align*} by the induction hypothesis, and \begin{align*} \sum_{\substack{x_0,\ldots,x_{r-1} \in B_Y(n) \\ \bar{x} \notin \mathcal{N}}} &\frac{|\{ x_r \in B_Y(n) \mid [\bar{x},x_r] \in \mathcal{N} \}|}{|B_Y(n)|^{r+1}} \leq \sum_{\substack{x_0,\ldots,x_{r-1} \in B_Y(n) \\ \bar{x} \notin \mathcal{N}}} \frac{|B_Y(n)|f(n)}{|B_Y(n)|^{r+1}} \\ &\leq |B_Y(n)|^r \times \frac{|B_Y(n)|f(n)}{|B_Y(n)|^{r+1}} = f(n) \end{align*} by \eqref{e:gennilp2}. This gives \begin{align*} &\frac{|\{ (x_0,\ldots,x_r) \in B_Y(n)^{r+1} \mid [x_0,\ldots,x_r] \in \mathcal{N} \}|}{|B_Y(n)|^{r+1}} \\ &\qquad = \sum_{x_0,\ldots,x_{r-1} \in B_Y(n)} \frac{|\{ x_r \in B_Y(n) \mid [\bar{x},x_r] \in \mathcal{N} \}|}{|B_Y(n)|^{r+1}} \leq rf(n)+f(n) = (r+1)f(n), \end{align*} as required. \end{proof} For a subgroup $H \leq G$, let $\{1\} = Z_0(H) \unlhd Z_1(H) \unlhd Z_2(H) \unlhd \cdots$ be the upper central series for $H$. We will use \cref{l:gennilp} with $\mathcal{N} = \bigcup_{i=0}^\infty Z_i(H)$ for a particular subgroup $H$. To show \eqref{e:gennilp1}, the following Lemma will be enough. \begin{lem} \label{l:ZHinA} Let $H = \langle a_1,\ldots,a_m,t^N \rangle \leq G$, where $N \in \mathbb{N}$. Then there exists a polynomial $p$ such that \[ \left|\mathcal{N} \cap B_Y(n)\right| \leq p(n) \] for all $n \in \mathbb{N}$, where $\mathcal{N} = \bigcup_{i=0}^\infty Z_i(H)$. \end{lem} \begin{proof} Recall that every element of $G$ can be expressed as $t^{-r}\mathbf{a}^\mathbf{u} t^s$ for some $r,s \geq 0$ and $\mathbf{u} \in \mathbb{Z}^m$. We first show that $\mathcal{N} \subseteq A$. Suppose for contradiction that there exists an element $g = t^{-r}\mathbf{a}^\mathbf{u} t^s \in Z_i(H)$ with $r \neq s$; after replacing $g$ with $g^{-1}$ if necessary, we may assume that $r > s$. Then, for all $\mathbf{v} \in \mathbb{Z}^m$ we have $\mathbf{a}^\mathbf{v} \in H$, and so \[ \mathbf{a}^\mathbf{v} Z_{i-1}(H) = g \mathbf{a}^\mathbf{v} g^{-1} Z_{i-1}(H) = t^{-r} \mathbf{a}^{\mathbf{u} + T^s\mathbf{v} - \mathbf{u}} t^{-r} Z_{i-1}(H) = t^{s-r} \mathbf{a}^\mathbf{v} t^{r-s} Z_{i-1}(H). \] Moreover, since $g \in H$ we have $N \mid \tau(g) = s-r$, and so $t^{s-r} \in H$. This implies that $t^{s-r} \in Z_i(H)$, and so any $(i+1)$-fold simple commtator $[g_1,t^{s-r},g_2,\ldots,g_i]$ vanishes for $g_1,\ldots,g_i \in H$. In particular, since $[ \mathbf{a}^\mathbf{u},t^{s-r}] = \mathbf{a}^{(T^{r-s}-I)\mathbf{u}}$, we have \begin{equation} \label{e:comm} 1 = [ \mathbf{a}^\mathbf{u}, \overbrace{t^{s-r},\ldots,t^{s-r}}^i ] = \mathbf{a}^{(T^{r-s}-I)^i\mathbf{u}} \end{equation} for all $\mathbf{u} \in \mathbb{Z}^m$, and so $(T^{r-s}-I)^i = 0$. Thus all eigenvalues of $T^{r-s}$ are equal to $1$, and so all eigenvalues of $T$ are roots of unity. As we assumed that $G$ has exponential growth, this contradicts \cref{p:Ggrowth}. Thus $t^{-r}\mathbf{a}^\mathbf{u} t^s \notin Z_i(H)$ whenever $r \neq s$, and so $Z_i(H) \leq A$, as required. Therefore, $\mathcal{N} \subseteq A$. If $\mathbf{a}^\mathbf{u} \in Z_i(H)$ then \eqref{e:comm} holds (with $r = N$ and $s = 0$, say) and so $\mathbf{u} \in U \cap \mathbb{Z}^m$, where $U = \bigcup_{i=1}^\infty \ker(T^N-I)^i \leq \mathbb{C}^m$. Therefore, \begin{equation} \label{e:whatisz} Z_i(H) = \{ t^{-r}\mathbf{a}^{\mathbf{u}}t^r \mid \mathbf{u} \in \mathbb{Z}^m, r \geq 0, (T^N-I)^i\mathbf{u} = \mathbf{0} \}. \end{equation} The strategy of the proof is now to show that if $\| \cdot \|$ is a norm on $U$, then $\|\mathbf{u}\|$ will be bounded by a polynomial in $|\mathbf{a}^\mathbf{u}|_Y$ when $\mathbf{u} \in U \cap \mathbb{Z}^m$. Consider the Jordan normal form $PT^NP^{-1}$ for $T^N$ (where $P \in GL_m(\mathbb{C})$): it is a block-diagonal matrix with blocks $\hat{X},\hat{Y}_{\hat{y}_1},\ldots,\hat{Y}_{\hat{y}_{\hat{z}}}$ for some $\hat{y}_1,\ldots,\hat{y}_{\hat{z}} \in \mathbb{N}$ with (without loss of generality) $\hat{y}_1 \leq \cdots \leq \hat{y}_{\hat{z}}$, where $X \in GL_{\hat{x}}(\mathbb{C})$ has no eigenvalues equal to $1$ and \begin{equation*} \hat{Y}_{\hat{y}} = \begin{pmatrix} 1 & 1 \\ & 1 & \ddots \\ && \ddots & 1 \\ &&& 1 \end{pmatrix} \in GL_{\hat{y}}(\mathbb{C}) \end{equation*} for $\hat{y} \in \mathbb{N}$. For an element $\mathbf{u} \in \mathbb{C}^m$, write \[ P\mathbf{u} = (u_1,\ldots,u_{\hat{x}},u_{1,1},\ldots,u_{1,\hat{y}_1},\ldots,u_{\hat{z},1},\ldots,u_{\hat{z},\hat{y}_{\hat{z}}}). \] Define a seminorm on $\mathbb{C}^m$ by setting \[ \| \mathbf{u} \| = \| \pi_U P\mathbf{u} \|_\infty = \max \{ |u_{i,j}| \mid 1 \leq i \leq \hat{z}, 1 \leq j \leq \hat{y}_i \} \] where $\pi_U$ is the projection of $\mathbb{C}^m$ onto $PU$ obtained by setting the first $\hat{x}$ coordinates of $PU$ to zero, and note that $\| \cdot \|$ becomes a norm when restricted to $U$. Note that \begin{equation*} \hat{Y}_{\hat{y}}^n = \begin{pmatrix} 1 & n & \genfrac(){0pt}{1}{n}{2} & \cdots & \genfrac(){0pt}{1}{n}{\hat{y}-1} \\ & 1 & n & \cdots & \genfrac(){0pt}{1}{n}{\hat{y}-2} \\ && \ddots & \ddots & \vdots \\ &&& 1 & n \\ &&&& 1 \end{pmatrix} \end{equation*} for all $\hat{y} \in \mathbb{N}$ and $n \in \mathbb{Z}$, where for any $n \in \mathbb{R}$ and $r \in \mathbb{N}$ we define $\genfrac(){0pt}{1}{n}{r} = \prod_{i=1}^r \frac{n-i+1}{i}$. It follows from the above that \[ \|T^{nN}\mathbf{v}\| \leq \|\mathbf{v}\| \sum_{i=0}^{\hat{y}-1} \left| \genfrac(){0pt}{1}{n}{i} \right| \] for all $\mathbf{v} \in \mathbb{C}^m$, where $\hat{y} = \hat{y}_{\hat{z}}$. Since $\left| \genfrac(){0pt}{1}{\hat{n}}{i} \right| \leq \genfrac(){0pt}{1}{\hat{n}+i}{i} \leq \genfrac(){0pt}{1}{n+i}{i}$ whenever $n \geq \hat{n} \geq 0$ and since $\genfrac(){0pt}{1}{\hat{n}}{i} = (-1)^i \genfrac(){0pt}{1}{-\hat{n}+i-1}{i}$ for $\hat{n} < 0$, it follows that \[ \|T^{\hat{n}N}\mathbf{v}\| \leq \|\mathbf{v}\| p_0(n), \] where $p_0(n) = \sum_{i=0}^{\hat{y}-1} \genfrac(){0pt}{1}{n+i}{i}$, whenever $n \in \mathbb{R}$ and $\hat{n} \in \mathbb{Z}$ with $|\hat{n}| \leq n$. Since any element $g \in B_Y(n)$ has $\mathfrak{h}(\omega_g) \leq cn$ (where $\omega_g$ is a geodesic word representing $g$), it follows that if $\mathbf{a}^\mathbf{u} \in B_X(n)$ then \[ \| \mathbf{u} \| \leq d_0np_0(cn/N) \] where $d_0 = \max \{ \|\mathbf{e}_i\| \mid 1 \leq i \leq m \}$. Now since $U \cap \mathbb{Z}^m$ is free abelian, we may pick a basis $\mathbf{u}_1,\ldots,\mathbf{u}_j$ for $U \cap \mathbb{Z}^m$ and define a norm on $\mathbb{C}\langle U \cap \mathbb{Z}^m \rangle$ by \[ \left\| \sum_{i=1}^j \alpha_i \mathbf{u}_i \right\|' = \max \{ |\alpha_i| \mid 1 \leq i \leq j \}. \] As any two norms on a finite dimensional vector space are bi-Lipschitz equivalent, we obtain \[ \| \mathbf{u} \|' \leq b_0\|\mathbf{u}\| \leq b_0d_0np_0(cn/N) \] for some constant $b_0 > 0$ whenever $\mathbf{u} \in U \cap \mathbb{Z}^m$ and $|\mathbf{a}^\mathbf{u}|_Y \leq n$. But by the construction of $\| \cdot \|'$, there are at most $(2k+1)^j$ elements $\mathbf{u} \in U \cap \mathbb{Z}^m$ with $\| \mathbf{u} \|' \leq k$, and so \[ |\mathcal{N} \cap \langle a_1,\ldots,a_m \rangle \cap B_Y(n)| \leq p_1(n) \] where $p_1(n) = (2b_0d_0np_0(cn/N)+1)^j$ is a polynomial. Finally, since $\mathfrak{h}(\omega_g) \leq cn$ for all $g \in B_Y(n)$, it follows that any element $g \in \mathcal{N} \cap B_Y(n)$ can be written as $g = t^{-cn}\mathbf{a}^\mathbf{u} t^{cn}$ for some $\mathbf{u} \in \mathbb{Z}^m$, and so \[ \mathbf{a}^\mathbf{u} = t^{cn} g t^{-cn} \in \mathcal{N} \cap \langle a_1,\ldots,a_m \rangle \cap B_Y(n+2cn). \] Since conjugation by $t^{cn}$ gives a bijection, we obtain \[ |\mathcal{N} \cap B_Y(n)| \leq |\mathcal{N} \cap \langle a_1,\ldots,a_m \rangle \cap B_Y(n+2cn)| \leq p_1(n+2cn), \] and the right hand side is a polynomial, as required. \end{proof} Now let $N \in \mathbb{N}$ be such that all eigenvalues $\lambda$ of $T$ that are roots of unity satisfy $\lambda^N = 1$. The key fact justifying this choice of $N$ is that if $T^r\mathbf{v} = \mathbf{v}$ for some $\mathbf{v} \in \mathbb{C}^m$ and some $r \neq 0$, then also $T^N\mathbf{v} = \mathbf{v}$, and so we have an inclusion of eigenspaces $\ker(T^r-I) \leq \ker(T^N-I)$ for every $r \neq 0$. Let $H \leq G$ and $\mathcal{N} \subseteq G$ be as in \cref{l:ZHinA}. \begin{lem} \label{l:CGig} For any $g \in G$, let $C_G^{\mathcal{N}}(g) = \{ h \in G \mid [g,h] \in \mathcal{N} \}$. Then there exists a polynomial $q$ such that \[ |C_G^{\mathcal{N}}(g) \cap B_Y(n)| \leq q(n) \] for all $g \in G \setminus A$ and $n \in \mathbb{N}$. \end{lem} \begin{proof} To show this, we will express the condition $[g,h] \in \mathcal{N}$ in terms of a linear equation, and use this and \cref{l:ZHinA} to bound $|C_G^{\mathcal{N}}(g) \cap t^kA \cap B_Y(n)|$ by a polynomial for any $k \in \mathbb{Z}$. By summing over all possible values of $k \in \mathbb{Z}$ the result will then follow easily. Let $k \in \mathbb{Z}$ and let $g = t^{-r} \mathbf{a}^{\mathbf{u}} t^s \in G$ with $g \notin A$ (that is, $r \neq s$). For any $h = t^{-r_0} \mathbf{a}^{\mathbf{u}_0} t^{s_0}$, we have \begin{align*} [g,h] &= t^{-s} \mathbf{a}^{-\mathbf{u}} t^{r-s_0} \mathbf{a}^{-\mathbf{u}_0} t^{r_0-r} \mathbf{a}^{\mathbf{u}} t^{s-r_0} \mathbf{a}^{\mathbf{u}_0} t^{s_0} \\ &= t^{-s-s_0} (t^{s_0} \mathbf{a}^{-\mathbf{u}} t^{-s_0}) (t^r \mathbf{a}^{-\mathbf{u}_0} t^{-r}) (t^{r_0} \mathbf{a}^{\mathbf{u}} t^{-r_0}) (t^s \mathbf{a}^{\mathbf{u}_0} t^{-s}) t^{s+s_0} \\ &= t^{-s-s_0}\mathbf{a}^{-T^{s_0}\mathbf{u}-T^r\mathbf{u}_0+T^{r_0}\mathbf{u}+T^s\mathbf{u}_0} t^{s+s_0}. \end{align*} By \eqref{e:whatisz}, it follows that \begin{equation} \label{e:centcrit} [g,t^{-r_0} \mathbf{a}^{\mathbf{u}_0} t^{s_0}] \in Z_i(H) \qquad \Leftrightarrow \qquad (T^N-I)^i \left( (T^{r_0}-T^{s_0})\mathbf{u} + (T^s-T^r)\mathbf{u}_0 \right) = \mathbf{0}. \end{equation} Now take any two elements $h_j = t^{-r_j} \mathbf{a}^{\mathbf{u}_j} t^{s_j} \in C_G^{\mathcal{N}}(g) \cap t^kA$ for $j = 1,2$ for some $k \in \mathbb{Z}$. Let $i \in \mathbb{N}$ be such that $[h_j,g] \in Z_i(H)$ for $j = 1,2$. Let $\ell = r_1 - r_2$ (and so $\ell = s_1 - s_2$ since $\tau(h_1) = \tau(h_2) = k$). Then by \eqref{e:centcrit} we have \begin{align*} (T^N-I)^i(T^s-T^r)\mathbf{u}_1 &= (T^N-I)^i(T^{s_1}-T^{r_1})\mathbf{u} = (T^N-I)^i(T^{s_2}-T^{r_2})T^\ell\mathbf{u} \\ &= T^\ell(T^N-I)^i(T^{s_2}-T^{r_2})\mathbf{u} = T^\ell(T^N-I)^i(T^s-T^r)\mathbf{u}_2, \end{align*} and so $(T^N-I)^i(T^s-T^r)(T^\ell\mathbf{u}_2-\mathbf{u}_1) = \mathbf{0}$. Since $T$ is invertible over $\mathbb{Q}$, this gives \[ (T^N-I)^i(T^{s-r}-I)(T^\ell\mathbf{u}_2-\mathbf{u}_1) = \mathbf{0}. \] Now by the choice of $N$, and since by assumption on $g$ we have $r \neq s$, it follows that $\ker(T^{s-r}-I) \leq \ker(T^N-I)$, and so $(T^N-I)^{i+1}(T^\ell\mathbf{u}_2-\mathbf{u}_1) = \mathbf{0}$. Hence, by \eqref{e:whatisz}, either $\mathbf{a}^{\mathbf{u}_1-T^\ell\mathbf{u}_2} \in Z_{i+1}(H)$ (if $\ell \geq 0$) or $t^{\ell}\mathbf{a}^{T^{-\ell}\mathbf{u}_1-\mathbf{u}_2}t^{-\ell} \in Z_{i+1}(H)$ (if $\ell < 0$), and since $Z(H)$ is characteristic in $H$ (and so normal in $G$), the conjugate $h_1h_2^{-1}$ is also in $Z_{i+1}(H)$. Note that if $h_1,h_2 \in B_Y(n)$ then we have $|h_1h_2^{-1}|_Y \leq 2n$, and so \cref{l:ZHinA} implies (by fixing $h_1$ and letting $h_2$ vary) that \[ |C_G^{\mathcal{N}}(g) \cap t^kA \cap B_Y(n)| \leq |\mathcal{N} \cap B_Y(2n)| \leq p(2n) \] for a polynomial $p$ (which does not depend on $g$ or $k$). Since any $h \in B_Y(n)$ has $|\tau(h)| \leq cn$, at most $2cn+1$ cosets of $A$ intersect $B_Y(n)$, and so we have \[ |C_G^{\mathcal{N}}(g) \cap B_Y(n)| \leq (2cn+1)p(2n), \] where the right hand side is a polynomial, as required. \end{proof} \begin{proof}[Proof of \cref{t:dn}] By \cref{t:A}, there exists $\beta > 1$ such that $\frac{|A \cap B_Y(n)|}{|B_Y(n)|} \leq \beta^{-n}$ for all $n \in \mathbb{N}$. Let $\alpha \in (1,\beta)$, and let $N$, $H$ be as above. We aim to show that $\gamma_n^Y(\mathcal{N}_r(G)) \leq \alpha^{-n}$ for all sufficiently large $n$. In order to prove this, we will show that the conditions of \cref{l:gennilp} are satisfied with $\mathcal{N}$ as above and a function $f$ such that $f(n) \leq \beta^{-n}$ for $n$ sufficiently large. This will imply the result. For \eqref{e:gennilp1}, the inequality is immediate by \cref{l:ZHinA}. For \eqref{e:gennilp2}, the inequality is immediate by \cref{l:CGig} if $g \in G \setminus A$, hence we are left with the case $g \in A \setminus \mathcal{N}$. Since $A$ is abelian we have \[ \frac{|\{ h \in B_Y(n) \cap A \mid [g,h] \in \mathcal{N} \}|}{|B_Y(n)|} = \frac{|A \cap B_Y(n)|}{|B_Y(n)|} \leq \beta^{-n} \] for all $n \in \mathbb{N}$ and $g \in A$, so it is enough to show that $\{ h \in G \mid [g,h] \in \mathcal{N} \} \subseteq A$ for all $g \in A \setminus \mathcal{N}$. Thus, let $g \in A \setminus \mathcal{N}$, and suppose that $[g,h] \in \mathcal{N}$ for some $h = t^{-r_0}\mathbf{a}^{\mathbf{u}_0}t^{s_0} \in G$: $[g,h] \in Z_i(H)$, say. Then \eqref{e:centcrit} implies that $(T^N-I)^i(T^{r_0-s_0}-I)\mathbf{u} = \mathbf{0}$, where $\mathbf{u} \in \mathbb{Z}^m$ is such that $\mathbf{a}^\mathbf{u}$ is conjugate to $g$. If we had $r_0 \neq s_0$ then we would have $\ker(T^{r_0-s_0}-I) \leq \ker (T^N-I)$ by the choice of $N$, and so $(T^N-I)^{i+1}\mathbf{u} = \mathbf{0}$. This would imply that $g \in Z_{i+1}(H)$, contradicting $g \notin \mathcal{N}$. Hence indeed $r_0 = s_0$ and so $h \in A$, as claimed. \end{proof} \bibliographystyle{amsplain}
\section{Physical realization of two-photon relaxation} \label{App:PhysReal} In this section, we discuss potential physical realization of two-photon relaxation. In order to achieve a dissipator of the form $\mathcal{D}[\hat{a}^2]$ for the cavity, \textit{in principle}, one needs to engineer a cavity-bath coupling of the form \begin{align} \hat{H}_{\text{sb}}\approx\sum\limits_{k}\left[g_{2,k}^*\hat{a}^2\hat{b}_k^{\dag}+g_{2,k}(\hat{a}^\dag)^2\hat{b}_k\right], \label{Eq:PhysReal-Hsb 1} \end{align} where $g_{2,k}$ denotes the strength of the two-photon coupling between the cavity mode and mode $k$ of the bath. Such a coupling requires a three-wave mixing in which two cavity photons convert into one bath photon, but \textit{in practice}, it is realized by means of four-wave mixing including an additional pump tone. In what follows, we revisit the proposal by Wolinsky and Carmichael \cite{Wolinsky_Quantum_1988}, which have been recently experimentally implemented in the context of superconducting circuits \cite{Leghtas_Confining_2015}. In this scheme, the original cavity is required to have a very high quality factor in order to suppress the single-photon relaxation rate. The dominant two-photon relaxation is then achieved by engineering a quartic Kerr coupling to an additional linear cavity as shown in Fig.~\ref{Fig:TwoPhotonRealization}. In superconducting circuits, the quartic nonlinearity can be realized via a weakly nonlinear Josephson junction, in which the cosine potential can be well approximated by the lowest order quartic interaction. The auxiliary readout cavity, on the contrary, has to have very low quality factor in order to quickly dissipate the converted cavity photon pairs into the environment without significant back-scattering. To achieve the desired conversion, the frequencies of the pump and the cavities should satisfy the frequency matching condition \begin{align} \nu_p+\nu_r=2\nu_c. \label{Eq:PhysReal-FreqMatch} \end{align} Under condition~(\ref{Eq:PhysReal-FreqMatch}), the Hamiltonian for the overall system shown in Fig.~\ref{Fig:TwoPhotonRealization} can be approximated up to rotating-wave approximation as \cite{Leghtas_Confining_2015} \begin{align} \begin{split} \hat{H}_{sb}&= g_2^*\hat{a}_c^2\hat{b}_r^{\dag}+g_2(\hat{a}_c^\dag)^2\hat{b}_r+\epsilon_d^*\hat{b}_r+\epsilon_d\hat{b}_r^{\dag}\\ &-\frac{\chi_{cc}}{2}(\hat{a}_c^{\dag})^2\hat{a}_c^2-\frac{\chi_{rr}}{2}(\hat{b}_r^{\dag})^2\hat{b}_r^2-\chi_{cr}\hat{a}_c^{\dag}\hat{a}_c\hat{b}_r^{\dag}\hat{b}_r, \label{Eq:PhysReal-Hsb 2} \end{split} \end{align} where $\hat{b}_r$ denotes the annihilation operator of the readout cavity. Importantly, in this scheme, we have achieved a pump-induced two-photon coupling as $g_2\equiv \chi_{rc}\xi_p/2$ with $\xi_p\equiv -i\epsilon_p/[(\nu_r-\nu_p)+i\kappa_{r1}]$ being the coherent amplitude of the readout cavity and $\kappa_{r1}$ the corresponding single-photon rate. The second line of Eq.~(\ref{Eq:PhysReal-Hsb 2}) keeps track of the additional self- and cross-Kerr interactions denoted by $\chi_{cc}$, $\chi_{rr}$ and $\chi_{rc}$ and can be considered as smaller perturbation compared to $g_2$. The additional drive tone at the readout frequency $\nu_r$ and amplitude $\epsilon_d$ is responsible to prepare the readout cavity with approximately one photon in order to fine-tune the desired conversion. Integrating out the readout degrees of freedom will result in an effective two-photon dissipator for the cavity as $\kappa_{c2}\mathcal{D}[\hat{a}_c^2]$ with relaxation rate $\kappa_{c2}$ given as \cite{Leghtas_Confining_2015} \begin{align} \kappa_{c2}\equiv \frac{\chi_{cr}}{\kappa_{r1}}|\xi_p|^2. \end{align} Finally, we note that in contrast to the aforementioned \textit{active} implementation that employs two drive tones, it might be also feasible to achieve a \textit{passive} implementation following similar ideas as the circuit-QED proposal by Felicetti et. al \cite{Felicetti_Two-Photon_2018} that is capable of achieving two-photon quantum Rabi model using a phase qubit coupled to a DC-SQUID. \begin{figure}[t!] \centering \includegraphics[scale=0.40]{TwoPhotonRealization.png} \caption{Schematic of system consisting of a two-level system coupled to a single cavity mode with two-photon relaxation.} \label{Fig:TwoPhotonRealization} \end{figure} \section{$Z_2$ symmetry of the Rabi model} \label{App:ParSym} In this section, we revisit the $Z_2$ symmetry of the Rabi model and discuss the transformation that diagonalizes the Hamiltonian in its parity representation. We start with the Rabi Hamiltonian, \begin{align} \hat{H}_{\text{s}}\equiv \nu_c\hat{a}^{\dag}\hat{a}+\frac{\nu_q}{2}\hat{\sigma}^z+g\left(\hat{a}+\hat{a}^{\dag}\right)\left(\hat{\sigma}^-+\hat{\sigma}^+\right), \label{Eq:ParSym-Rabi H} \end{align} where $\nu_c$ and $\nu_q$ are the cavity and qubit bare frequencies and $g$ represents the light--matter coupling strength. We define the overall parity operator $\hat{P}$ by its action on the spin and photonic degrees of freedom: \begin{align} \begin{cases} \hat{P}^{\dag}\hat{\sigma}^-\hat{P}=-\hat{\sigma}^-\\ \hat{P}^{\dag}\hat{a}\hat{P}=-\hat{a} \end{cases}. \label{Eq:ParSym-Def of Par Op} \end{align} From~(\ref{Eq:ParSym-Def of Par Op}), one can derive the standard properties of a parity operator, including involution $\hat{P}^2=\hat{\mathbf{1}}$, unitarity $\hat{P}^{\dag}\hat{P}=\hat{\mathbf{1}}$, and Hermiticity $\hat{P}=\hat{P}^{\dag}$. The overall parity operator $\hat{P}$ can then be written as a product of the spin and photonic parity operators as \begin{align} \hat{P}=\hat{P}_q\hat{P}_c=e^{i\pi\hat{\sigma}^+\hat{\sigma}^-}e^{i\pi\hat{a}^{\dag}\hat{a}}=-\hat{\sigma}^{z}(-1)^{\hat{a}^{\dag}\hat{a}}. \label{Eq:ParSym-Pi Sol} \end{align} The $Z_2$ symmetry of the Rabi Hamiltonian~(\ref{Eq:ParSym-Rabi H}) means that $\hat{H}_s$ remains invariant under the transformation \begin{align} \hat{P}^{\dag}\hat{H}_{s}\hat{P}=\hat{H}_s. \label{Eq:ParSym-Def of Z2 Sym} \end{align} In the following, we rewrite the Rabi Hamiltonian such that the $Z_2$ symmetry becomes explicit. In particular, we introduce the following new set of bosonic creation and annihilation operators, \begin{align} \hat{b}\equiv\hat{\sigma}^x \hat{a},\ \hat{b}^{\dag}\equiv \hat{a}^{\dag}\hat{\sigma}^x, \label{Eq:ParSym-Def b} \end{align} from which it follows that, \begin{subequations} \begin{align} &[\hat{b},\hat{b}^{\dag}]=\hat{\sigma}^x[\hat{a},\hat{a}^{\dag}]\hat{\sigma}^x=1, \label{Eq:ParSym-[b,b^dag]}\\ &\hat{b}^{\dag}\hat{b}=\hat{a}^{\dag}(\hat{\sigma}^x)^2\hat{a}=\hat{a}^{\dag}\hat{a}. \label{Eq:ParSym-b^dag b} \end{align} \end{subequations} Employing Eqs.~(\ref{Eq:ParSym-Pi Sol}) and~(\ref{Eq:ParSym-b^dag b}), one can rewrite the Rabi Hamiltonian~(\ref{Eq:ParSym-Rabi H}) as \cite{Casanova_Deep_2010} \begin{align} \hat{H}_{\text{s}}=\nu_c\hat{b}^{\dag}\hat{b}-\frac{\nu_q}{2}e^{i\pi\hat{b}^{\dag}\hat{b}}\hat{P}+g\left(\hat{b}+\hat{b}^{\dag}\right). \label{Eq:ParSym-H_s transformed} \end{align} Since the parity and number operators commute, their eigenstates provide a complete basis for the Hilbert space of the problem. Hence, we define the number-parity basis $\ket{n,p}$, which satisfies: \begin{subequations} \begin{align} &\hat{b}^{\dag}\hat{b}\ket{n,p}=n\ket{n,p}, \ n=0, 1, 2, \ldots\\ &\hat{P}\ket{n,p}=p\ket{n,p}, \ p=\pm 1. \end{align} \end{subequations} The advantage of working with the transformed Rabi Hamiltonian~(\ref{Eq:ParSym-H_s transformed}) is that it is explicitly block-diagonal in the parity sector, \begin{align} \hat{H}_{\text{s}}=\begin{bmatrix} \hat{H}_{\text{s},+} & 0\\ 0 & \hat{H}_{\text{s},-} \end{bmatrix}, \end{align} with $\hat{H}_{\text{s},p}$ denoting the Hamiltonians of the even ($+$) and odd ($-$) parity subspaces, given by: \begin{align} \hat{H}_{\text{s},p} =\nu_c\hat{b}^{\dag}\hat{b}-\frac{p}{2}\nu_q e^{i\pi\hat{b}^{\dag}\hat{b}}+g(\hat{b}+\hat{b}^{\dag}), \quad p=\pm 1. \label{Eq:ParSym-Def of H_(s,pm)} \end{align} \section{Spectrum of the Rabi model} \label{App:ClRabiSpec} In this section, we study the spectrum of the Rabi Hamiltonian~(\ref{Eq:ParSym-Def of H_(s,pm)}) and show that the results can be extended to account for the open case up to phenomenological treatment. At last, we provide a comparison to the open JC, in which the counter-rotating terms in the coupling are dropped. We begin by considering the eigenvalue problem for each parity subspace, \begin{align} \hat{H}_{\text{s,p}}\ket{\Psi_{p}}=\omega_{p}\ket{\Psi_{p}}, \label{Eq:ClRabiSpec-EigProblem 1} \end{align} where $\omega_{p}$ and $\ket{\Psi_{p}}$ denote the eigenfrequency and eigenmode for each parity $p$, respectively. Expanding the unknown wavefunctions $\ket{\Psi_{p}}$ in terms of the number-parity basis, \begin{align} \ket{\Psi_{p}}=\sum\limits_{m=0}^{\infty} c_{p,m}\ket{m,p}, \label{Eq:ClRabiSpec-Psi Ansatz} \end{align} and inserting this expansion into the eigenvalue problem~(\ref{Eq:ClRabiSpec-EigProblem 1}), one obtains \begin{align} \begin{split} &\sum\limits_{m=0}^{\infty}\left[m\nu_c-\frac{p}{2}(-1)^{m}\nu_q-\omega_{p}\right]c_{p,m}\ket{m,p}\\ +&\sum\limits_{m=0}^{\infty}gc_{p,m}\left(\sqrt{m}\ket{m-1,p}+\sqrt{m+1}\ket{m+1,p}\right)=0. \end{split} \label{Eq:ClRabiSpec-EigProblem 2} \end{align} Reindexing the sums and employing the linear independence of the number-parity basis $\{\ket{m,p}\}$, we obtain the recurrence relation for $m\geq 1$ as \begin{subequations} \begin{align} \begin{split} \alpha_{p,m}c_{p,m}&+\beta_{p,m}c_{p,m+1}+\gamma_{p,m}c_{p,m-1}=0, \end{split} \label{Eq:ClRabiSpec-RecRel n>=1} \end{align} with $\alpha_{p,m}$, $\beta_{p,m}$ and $\gamma_{p,m}$ defined as \begin{align} &\alpha_{p,m}\equiv \omega_{p}-m\nu_c+\frac{p}{2}(-1)^m\nu_q, \label{Eq:ClRabiSpec-Def of alpha_p,n}\\ &\beta_{p,m}\equiv-\sqrt{m+1}g, \label{Eq:ClRabiSpec-Def of beta_p,n}\\ &\gamma_{p,m}\equiv-\sqrt{m}g, \label{Eq:ClRabiSpec-Def of gamma_p,n} \end{align} and with initial conditions, \begin{align} \alpha_{p,0}c_{p,0}+\beta_{p,0}c_{p,1}=0. \label{Eq:ClRabiSpec-RecRel n=1} \end{align} \end{subequations} The recursion relation~(\ref{Eq:ClRabiSpec-RecRel n>=1}) and the associated initial condition~(\ref{Eq:ClRabiSpec-RecRel n=1}) uniquely determine $c_{p,m}$ in terms of $c_{p,0}$ for arbitrary $m$. Next, we need to obtain an equation to determine the eigenfrequencies $\omega_p$. Note that the recursion relation above can be represented in matrix form, $\mathbf{M}_p\mathbf{c}_p=0$, in terms of the infinite-dimensional tridiagonal matrix: \begin{align} \mathbf{M}_{p}\equiv \begin{bmatrix} \alpha_{p,0} & \beta_{p,0} & 0 & 0 & \ldots \\ \gamma_{p,1} & \alpha_{p,1} & \beta_{p,1} & 0 & \ldots \\ 0 & \gamma_{p,2} & \alpha_{p,2} & \beta_{p,2} & \ldots \\ \vdots & \vdots & \vdots & \ddots & \ldots \end{bmatrix}. \label{Eq:ClRabiSpec-Def of Mp} \end{align} Hence, the roots of the determinant of $\mathbf{M}_p$ yield the eigenfrequencies corresponding to subspace $p$. Denoting the determinant $G_{p,m}\equiv \det (\mathbf{M}_{p,m})$, where $\mathbf{M}_{p,m}$ is an $(m+1)\times (m+1)$ truncation of $\mathbf{M}_p$, and employing a Laplace expansion, one can obtain a recursive relation for the determinant, \begin{align} G_{p,m}=\alpha_{p,m} G_{p,m-1}-\beta_{p,m-1}\gamma_{p,m}G_{p,m-2}, \label{Eq:ClRabiSpec-RecRelG n>=1} \end{align} with initial condition $G_{p,0}=\alpha_{p,0}$ and $G_{p,1}=\alpha_{p,0} \alpha_{p,1}-\beta_{p,0}\gamma_{p,1}$. Defining, \begin{align} G_p\equiv\lim\limits_{m\to\infty}G_{p,m}, \label{Eq:ClRabiSpec-Def of Gp} \end{align} it follows that the $n$th eigenfrequency in each subspace is given by the $n$th root of $G_p$, obtained by solving $G_p(\omega_{np})=0$. The corresponding eigenmode is found by replacing $\omega_{np}$ in Eq.~(\ref{Eq:ClRabiSpec-Def of alpha_p,n}) to find $\alpha_{np,m}$ and related quantities accordingly. \begin{figure}[t!] \centering \subfloat[\label{subfig:PhenOpSpecRabiVsJCVq8Em1Vc1Qc40FuncOfg}]{% \includegraphics[scale=0.32]{PhenOpSpecRabiVsJCVq8Em1Vc1Qc40FuncOfg.pdf}% } \subfloat[\label{subfig:PhenOpDissRabiVsJCVq8Em1Vc1Qc40FuncOfg}]{% \includegraphics[scale=0.32]{PhenOpDissRabiVsJCVq8Em1Vc1Qc40FuncOfg.pdf}% } \caption{Phenomenological open eigenfrequencies $\omega_{n,p}\equiv \nu_{n,p}-i\kappa_{n,p}$ for $\nu_q=0.8\nu_c$ and $\kappa_{c2}=\nu_c/40$. a) Real part (frequency) of the spectrum and b) imaginary part (decay rate) of the spectrum as a function of light-matter coupling $g$. The red/blue dotted lines show the result obtained from the Rabi model~(\ref{Eq:ClRabiSpec-Def of H_s,ef}), while the solid black lines show the JC result obained from Eq.~(\ref{Eq:ClRabiSpec-H_JC,ef}). The labels $\ket{n_g,\pm}$ in a) and b) are ordered based on values at $g=0$. The frequencies in a) are plotted relative to the ground state $\ket{0_g,+}$.} \label{Fig:PhenOpSpecRabiVsJC} \end{figure} If the relaxation is accounted phenomenologically, we employ the effective Hamilatonian as \begin{align} \hat{H}_{\text{s,ef}}=\nu_c\hat{b}^{\dag}\hat{b}-\frac{\nu_q}{2}e^{i\pi\hat{b}^{\dag}\hat{b}}\hat{P}+g\left(\hat{b}+\hat{b}^{\dag}\right)-i\kappa_{c2} (\hat{b}^{\dag})^2\hat{b}^2. \label{Eq:ClRabiSpec-Def of H_s,ef} \end{align} Note that the additional term $-i\kappa_{c2}(\hat{b}^{\dag})^2\hat{b}^2$ is diagonal in the number basis with matrix elements $-i m(m-1)\kappa_{c2}$. Therefore, following the same steps as in Eqs.~(\ref{Eq:ClRabiSpec-Psi Ansatz}-\ref{Eq:ClRabiSpec-EigProblem 2}), we find similar recursion relations as Eqs.~(\ref{Eq:ClRabiSpec-RecRel n>=1}) and~(\ref{Eq:ClRabiSpec-RecRelG n>=1}), for the eigenmodes and spectrum respectively, where the diagonal coefficient $\alpha_{p,m}$ gets replaced due to the dissipative contribution as \begin{align} \begin{split} \alpha_{p,m}&\rightarrow \alpha_{p,m}+im\left(m-1\right)\kappa_{c2}\\ &=\omega_{p}-m\nu_c+\frac{p}{2}(-1)^m\nu_q+im\left(m-1\right)\kappa_{c2} \end{split}, \label{Eq:ClRabiSpec-Def of alpha_p,n^ph} \end{align} while the off-diagonoal coefficients $\beta_{p,m}$ and $\gamma_{p,m}$ remain intact. As expected, the eigenfrequencies $\omega_{np}$ become complex. An example comparing the closed and open spectrum is shown in Fig.~2 of the paper. Lastly, we study the Jaynes-Cummings (JC) model with two-photon relaxation and employ the \textit{analytical} solutions to its spectrum to compare to and benchmark the result obtained from our recursion relations. Consider the phenomenological effective JC Hamiltonian with two-photon relaxation [analogous to Eq.~(\ref{Eq:ClRabiSpec-Def of H_s,ef})] as \begin{align} \hat{H}_{\text{JC,ef}}=\nu_c\hat{a}^{\dag}\hat{a}+\frac{\nu_q}{2}\hat{\sigma}^z+g(\hat{a}\hat{\sigma}^{+}+\hat{a}^{\dag}\hat{\sigma}^-)-i\kappa_{c2}(\hat{a}^\dag)^2\hat{a}^2. \label{Eq:ClRabiSpec-H_JC,ef} \end{align} where the counter-rotating terms are dropped. Hamiltonian~(\ref{Eq:ClRabiSpec-H_JC,ef}) commutes with the total excitation number $\hat{N}\equiv \hat{a}^{\dag}\hat{a}+\hat{\sigma}^+\hat{\sigma}^-$. Therefore, it is block-diagonal consisting of the singlet $\ket{0,g}$ with eigenfrequency $\omega_{0,+}=-\nu_q/2$ and doublets $\{\ket{n-1,e},\ket{n,g}\}$ as \begin{widetext} \begin{align} \begin{bmatrix} (n-1)\nu_c+\nu_q/2-i(n-1)(n-2)\kappa_{c2} & g\sqrt{n}\\ g\sqrt{n} & n\nu_c-\nu_q/2-i\kappa_{c2}(n-1)n \end{bmatrix}. \label{Eq:ClRabiSpec-H_JC 2X2} \end{align} \end{widetext} The eigenfrequencies of Eq.~(\ref{Eq:ClRabiSpec-H_JC 2X2}) can be immediately found as \begin{subequations} \begin{align} \begin{split} \omega^{\text{JC}}_{n,(-1)^n}&=\left(n-\frac{1}{2}\right)\nu_c-i(n-1)^2\kappa_{c2}\\ +&\frac{1}{2}\sqrt{[\nu_c-\nu_q-2i(n-1)\kappa_{c2}]^2+4g^2n}, \end{split} \label{Eq:ClRabiSpec-JC Om_(n)} \end{align} \begin{align} \begin{split} \omega^{\text{JC}}_{n-1,(-1)^n}&=\left(n-\frac{1}{2}\right)\nu_c-i(n-1)^2\kappa_{c2}\\ -&\frac{1}{2}\sqrt{[\nu_c-\nu_q-2i(n-1)\kappa_{c2}]^2+4g^2n}. \end{split} \label{Eq:ClRabiSpec-JC Om_(n-1)} \end{align} \end{subequations} where the labels are chosen to be consistent with our convention for the Rabi eigenvectors $\omega_{np}$. Figure~\ref{Fig:PhenOpSpecRabiVsJC} provides a comparison between the phenomenological spectrum obtained from the Rabi and JC models. Besides the well-known spurious level crossings that is observed in the real part of the JC spectrum (Fig.~\ref{subfig:PhenOpSpecRabiVsJCVq8Em1Vc1Qc40FuncOfg}), we observe that the JC model generate decay rates that \textit{plateau} as $g$ is enhanced and hence completely mischaracterizes the interplay of the coupling and the two-photon relaxation at ultrastrong coupling (Fig.~\ref{subfig:PhenOpDissRabiVsJCVq8Em1Vc1Qc40FuncOfg}). \section{Full effective Hamiltonian} \label{App:EffHam} In the previous section, we obtained a rather simple generalization of the recursion relation for the spectrum to the open case up to phenomenological treatment of the opening [Eq.~(\ref{Eq:ClRabiSpec-Def of alpha_p,n^ph})]. We have employed the resulting approximate result to analyze the excitation-relaxation dynamics discussed in the main paper. The main purpose of this section is to provide more discussion on the validity of such an approximation. In subsection~\ref{SubApp:GenDis}, we first revisit the possibility of extending the effective Hamiltonian approach such that it accounts for the collapse terms as well. The full effective Hamiltonian belongs to a larger Hilbert space, hence an immediate question is the possibility of decomposition of the full spectrum. This is discussed in subsection~\ref{SubApp:SpecDecom}. Subsection~\ref{SubApp:DissTLS} applies the full effective Hamiltonian approach and the spectral decomposition on the simplest case of a two-level system with relaxation, and provides important insight on the role of collapse term in renormalizaiton of eigenmodes and spectrum. Finally, in Sec.~\ref{SubApp:EfHamRabi}, we provide a comparison between the spectrum derived from phenomenological and full effective Hamiltonian approaches for our system. \subsection{General discussion} \label{SubApp:GenDis} Here, we revisit the derivation of the full effective Hamiltonian approach for open quantum systems that was first introduced by Yi et. al \cite{Yi_Effective_2001}. Consider a generic Lindblad equation \begin{subequations} \begin{align} \dot{\hat{\rho}}_s=-i[\hat{H}_s,\hat{\rho}_s]+\sum\limits_{\lambda}2\gamma_{\lambda}\mathcal{D}[\hat{C}_{s,\lambda}]\hat{\rho}_s, \label{Eq:EffHam-Lindblad 1} \end{align} where $\hat{\rho}_s$ and $\hat{H}_s$ are the system density matrix and Hamiltonian, respectively. Moreover, we assume a set of dissipation channels, with relaxation rate $\gamma_{\lambda}$ and collapse operator $\hat{C}_{\lambda}$ of the form \begin{align} \mathcal{D}[\hat{C}_{s,\lambda}]\equiv \hat{C}_{s,\lambda}(\bullet)\hat{C}_{s,\lambda}^{\dag}-\frac{1}{2}\left\{\hat{C}_{s,\lambda}^{\dag}\hat{C}_{s,\lambda},(\bullet)\right\}. \label{Eq:EffHam-Def of D[c]} \end{align} \end{subequations} The diagonal terms (anti-commutator) in Eq.~(\ref{Eq:EffHam-Def of D[c]}) can be expressed as effective decay if we define an effective system Hamiltonian as \begin{subequations} \begin{align} \hat{H}_{\text{s,ef}}\equiv \hat{H}_s-\sum\limits_{\lambda}i\gamma_{\lambda}\hat{C}_{s,\lambda}^{\dag}\hat{C}_{s,\lambda}, \label{Eq:EffHam-Def of H_s,ef} \end{align} in terms of which the original Lindblad Eq.~(\ref{Eq:EffHam-Lindblad 1}) can be recast into \begin{align} \dot{\hat{\rho}}_s=-i\left[\hat{H}_{\text{s,ef}}\hat{\rho}_s-\hat{\rho}_s(t)\hat{H}_{\text{s,ef}}^{\dag}\right]+\sum\limits_{\lambda}2\gamma_{\lambda}\hat{C}_{s,\lambda}\hat{\rho}_s\hat{C}_{s,\lambda}^{\dag}. \label{Eq:EffHam-Lindblad 2} \end{align} \end{subequations} The idea of the full effective Hamiltonian approach is to map the Lindblad Eq.~(\ref{Eq:EffHam-Lindblad 2}) to an effective Schrodinger equation. This is achieved by introducing an auxiliary system with the same Hilbert space size as the original system, which plays the role of adjoint (left) quantum states. This allows extending the size of the composite Hilbert space to that of the original Lindbladian. We therefore introduce a full orthonormal basis $\left\{\ket{n_s}\ket{n_a}\right\}$ and define the following full wavefunction \begin{align} \ket{\Psi_{\hat{\rho}}(t)}\equiv \sum\limits_{n_s,n_a}\rho_{s,n_s n_a}(t)\ket{n_s}\ket{n_a}, \label{Eq:EffHam-Def of Psi_rho} \end{align} where $\rho_{s,n_s n_a}(t)$ are the matrix elements of the system density matrix defined as $\rho_{s,n_s n_a}(t)\equiv\bra{n_s}\hat{\rho}_{s}(t)\ket{n_a}$. We then seek an effective Hamiltonian such that the Schr\"odinger dynamics of the pure wavefunction $\ket{\Psi_{\hat{\rho}_s}(t)}$ matches the original Lindblad dynamics in terms of the matrix elements $\rho_{s,n_sn_a}(t)$. The resulting full effective Hamiltonian for the system can be found as \cite{Yi_Effective_2001} \begin{subequations} \begin{align} \hat{H}_{\text{u,ef}}\equiv\hat{H}_{\text{s,ef}}-\hat{H}_{\text{a,ef}}+i\sum\limits_{\lambda}2\gamma_{\lambda}\hat{C}_{s,\lambda}\hat{C}_{a,\lambda}, \label{Eq:EffHam-Def of H_u} \end{align} where $\hat{H}_{\text{a,ef}}$ and $\hat{C}_{a,\lambda}$ are the effective Hamiltonian and collapse operator for the auxiliary system that satisfy \begin{align} &\bra{n_a'}\hat{H}_{\text{a,ef}}\ket{n_a}=\bra{n_s}\hat{H}_{\text{s,ef}}^{\dag}\ket{n_s'}, \label{Eq:EffHam-Def of H_a,ef}\\ &\bra{n_a'}\hat{C}_{a,\lambda}\ket{n_a}=\bra{n_s}\hat{C}_{s,\lambda}^{\dag}\ket{n_s'}. \label{Eq:EffHam-Def of C_a} \end{align} \end{subequations} Consequently, in this approach, we seek a solution to the wavefunction as \begin{align} \ket{\Psi_{\hat{\rho}}(t)}=e^{-i\int_{0}^{t}\hat{H}_{\text{u,ef}}dt'}\ket{\Psi_{\hat{\rho}}(0)}, \label{Eq:EffHam-Sol of |Psi_rho>} \end{align} from which one can infer the solution for $\hat{\rho}_s(t)$. Equation~(\ref{Eq:EffHam-Def of H_u}) clarifies the distinction between the phenomenological effective Hamiltonian~(\ref{Eq:EffHam-Def of H_s,ef}) and the full effective Hamiltonian more clear. In the phenomenological treatment, the system spectrum is determined by the eigenvalues of $\hat{H}_{\text{s,ef}}$, where the additional coupling caused by the collapse operators between the left and right states are neglected. \subsection{Spectral decomposition} \label{SubApp:SpecDecom} At first sight, it seems that the additional coupling (last term) in the full effective Hamitlonian~(\ref{Eq:EffHam-Def of H_u}) breaks the possibility of spectral decomposition, i.e. writing the full spectrum as linear sum of each constituent. It has been shown that for quadratic Lindbladians it is feasible to obtain a reduced effective spectrum for the system in terms of the full spectrum \cite{Prosen_Spectral_2010} due to the following self-conjugation symmetry. Note that under the transformation \begin{subequations} \begin{align} \hat{C}_{s,\lambda}\leftrightarrow \hat{C}_{a,\lambda}, \label{Eq:EffHam-C_s<->C_a} \end{align} which maps the original system to the adjoint system, we obtain from Eq.~(\ref{Eq:EffHam-Def of H_u}) the self-conjugation symmetry \begin{align} \hat{H}_{\text{u,ef}}\rightarrow - \hat{H}_{\text{u,ef}}^*. \label{Eq:EffHam-Sym of H_u,ef} \end{align} \end{subequations} The consequence of symmetry~(\ref{Eq:EffHam-Sym of H_u,ef}) for a quadratic Lindbladian is that the full eigenfrequencies can always be effectively decomposed as \begin{align} \left\{\omega_{u,mn}\right\}=\left\{\omega_{m}-\omega_{n}^*\right\}, \label{Eq:EffHam-Om_u,mn} \end{align} where $\{\omega_{u,mn}\}$ is the set of full eigenfrequencies and $\{\omega_n\}$ is the set of reduced eigenfrequencies for the system that accounts for the collapse terms by construct. Assuming that we have access to the full spectrum, analytically or numerically, we face the problem of obtaining $N$ reduced complex eigenfrequencies for the system in terms of the corresponding $N^2$ full complex eigenfrequencies, with $N$ being the cut-off number for the Hilbert space. We note that the elementwise Eq.~(\ref{Eq:EffHam-Om_u,mn}) can be compactly represented as a Tensor Rank Decomposition \cite{Kolda_Tensor_2009} problem of the form \begin{subequations} \begin{align} &\mathbf{\Omega}_u=\mathbf{\Omega}\otimes\mathbf{1}_a-\mathbf{1}_s\otimes\mathbf{\Omega}^*, \label{Eq:EffHam-TRD for Om} \end{align} or in terms of real frequency and decay rate tensors as \begin{align} &\mathbf{V}_u=\mathbf{V}\otimes\mathbf{1}_a-\mathbf{1}_s\otimes\mathbf{V}, \label{Eq:EffHam-TRD for V}\\ &\mathbf{K}_u=\mathbf{K}\otimes\mathbf{1}_a+\mathbf{1}_s\otimes\mathbf{K}, \label{Eq:EffHam-TRD for K} \end{align} \end{subequations} with $\mathbf{1}$, $\mathbf{V}$, $\mathbf{K}$ being the identity, frequency and decay matrices for each sector. The solution for $\mathbf{V}$ in terms of $\mathbf{V}_u$ is unique up to a overall translation, e.g. if $\mathbf{V}$ is a solution then $\mathbf{V}+c\mathbf{1}$ is also a solution for $c\in \mathbb{R}$. This is not an issue, since the overall constant only changes the global reference point with respect to which the frequency levels in $\mathbf{V}$ are evaluated, while leaves the $\textit{physical}$ difference that appears in the time-evolution of the system invariant. In contrast to the spectrum, it is not in general possible to tensor decompose the full eigenmodes into a reduced set of eigenmodes for the system. As an example, a full quantum state \begin{align} \ket{\Psi_{u,mn}}=\ket{m_s}\ket{n_a}\pm \ket{n_s}\ket{m_a}, \label{Eq:RabiSpec-No TRD for Psi_u,mn} \end{align} is a valid possibility for the full eigenmode since it respects the symmetry~(\ref{Eq:EffHam-Sym of H_u,ef}) of the full Hamiltonian. However, a full quantum state like Eq.~(\ref{Eq:RabiSpec-No TRD for Psi_u,mn}) can not be expresed as a tensor product of two independent states in each sector, i.e. $\ket{\Psi_{u,mn}}\neq \ket{\Psi_{s,m}}\ket{\Psi_{a,n}}$. \subsection{A two-level system with relaxation} \label{SubApp:DissTLS} Here, we study the case of a two-level system with relaxation. The aim of this subsection is to apply the tools from Secs.~\ref{SubApp:GenDis} and~\ref{SubApp:SpecDecom} on a rather simple example that can be handled analytically. The main outcome of this calculation is that the phenomenological treatment of the opening captures the spectrum correctly, but not the ground state and the modal structure in general. Hence, using the phenomenological treatment provides a good approximation of the spectrum (in this case exact), but cannot be used to draw conclusions about the eigenmodes and in particular the steady state. Consider the Lindblad equation \begin{align} \dot{\hat{\rho}}(t)=-i[\hat{H}_q,\hat{\rho}(t)]+2\gamma_q\mathcal{D}[\hat{\sigma}^-]\hat{\rho}(t), \label{Eq:DissTLS-Lindblad Eq} \end{align} where $\hat{H}_q$ and $\mathcal{D}[\hat{\sigma}^-]$ are the Hamiltonian and the dissipator superoperator given in terms of spin-$1/2$ Pauli matrices as \begin{align} &\hat{H}_q\equiv \nu_q\hat{\sigma}^+\hat{\sigma}^-, \label{Eq:DissTLS-Def of Hq}\\ &\mathcal{D}[\hat{\sigma}^-](\bullet)\equiv \hat{\sigma}^-(\bullet)\hat{\sigma}^+-\frac{1}{2}\left\{\hat{\sigma}^+\hat{\sigma}^-,(\bullet)\right\}. \label{Eq:DissTLS-Def of D[sig-]} \end{align} In terms of the phenomenological effective Hamiltonian \begin{align} &\hat{H}_{q,\text{ef}}\equiv\hat{H}_q-i\gamma_q\hat{\sigma}^+\hat{\sigma}^-=\omega_q\hat{\sigma}^+\hat{\sigma}^-, \label{Eq:DissTLS-Def of H_ef} \end{align} with complex frequency $\omega_q\equiv \nu_q-i\gamma_q$, we can reexpress Eq.~(\ref{Eq:DissTLS-Lindblad Eq}) as \begin{align} \dot{\hat{\rho}}(t)=-i\left[\hat{H}_{q,\text{ef}}\hat{\rho}(t)-\hat{\rho}(t)\hat{H}_{q,\text{ef}}^{\dag}\right]+2\gamma_q\hat{\sigma}^-\hat{\rho}(t)\hat{\sigma}^+. \label{Eq:DissTLS-Lindblad Eq 2} \end{align} Next, we discuss the solution to the Lindblad Eq.~(\ref{Eq:DissTLS-Lindblad Eq 2}) using Effective Hamiltonian approach. The full effective Hamiltonian includes an auxiliary TLS and reads \begin{align} \hat{H}_{\text{u,ef}}=(\nu_q-i\gamma_q)\hat{\sigma}^{+}\hat{\sigma}^--(\nu_q+i\gamma_q)\hat{\Sigma}^{+}\hat{\Sigma}^-+2i\gamma_q \hat{\sigma}^{-}\hat{\Sigma}^{-}, \label{Eq:DissTLS-H_u,ef} \end{align} where we have denoted the spin operators of the auxiliary system with $\hat{\Sigma}$. In the following we prepare the system in a generic pure state \begin{align} \begin{split} \ket{\Psi_{\hat{\rho}}(0)}&=\rho_{ee}(0)\ket{e_s}\ket{e_a}+\rho_{eg}(0)\ket{e_s}\ket{g_a}\\ &+\rho_{ge}(0)\ket{g_s}\ket{e_a}+\rho_{gg}(0)\ket{g_s}\ket{g_a}, \end{split} \label{Eq:DissTLS-IC for Psi(0)} \end{align} and solve for the Schrodinger equation \begin{align} i\partial_t \ket{\Psi_{\hat{\rho}}(t)}=\hat{H}_{\text{u,ef}}\ket{\Psi_{\hat{\rho}}(t)}. \label{Eq:DissTLS-Schro Eq} \end{align} Expressing the full effective Hamiltonian~(\ref{Eq:DissTLS-H_u,ef}) in the basis $\{\ket{s_{\sigma}}\ket{s_{\Sigma}}\}$ we find \begin{align} \mathbf{H}_{\text{u,ef}}\equiv \begin{bmatrix} -2i\gamma_q & 0 & 0 & 0\\ 0 & \nu_q-i\gamma_q & 0 & 0\\ 0 & 0 & -\nu_q-i\gamma_q & 0\\ 2i\gamma_q & 0 & 0 & 0 \end{bmatrix}. \label{Eq:DissTLS-Rep of H_u,ef} \end{align} We can then directly compute the matrix representation of time-evolution operator $\hat{U}(t)\equiv e^{-i\hat{H}_{\text{u,ef}} t}$ as \begin{align} \mathbf{U}(t)= \begin{bmatrix} e^{-2\gamma_q t} & 0 & 0 & 0\\ 0 & e^{-\gamma_q t-i\nu_q t} & 0 & 0\\ 0 & 0 & e^{-\gamma_q t+i\nu_q t} & 0\\ 1-e^{-2\gamma_q t} & 0 & 0 & 1 \end{bmatrix}. \label{Eq:DissTLS-Rep of U(t)} \end{align} The solution for $\ket{\Psi_{\hat{\rho}}(t)}$ is obtained as \begin{align} \ket{\Psi_{\hat{\rho}}(t)}=\hat{U}(t)\ket{\Psi_{\hat{\rho}}(0)}, \end{align} which can be expressed element-wise as\begin{subequations} \begin{align} &\rho_{ee}(t)=\rho_{ee}(0)e^{-2\gamma_q t}, \label{Eq:DissTLS-rho_ee Sol}\\ &\rho_{eg}(t)=\rho_{eg}(0)e^{-\gamma_q t-i\nu_q t}, \label{Eq:DissTLS-rho_eg Sol}\\ &\rho_{ge}(t)=\rho_{ge}(0)e^{-\gamma_q t+i\nu_q t}. \label{Eq:DissTLS-rho_ge Sol}\\ &\rho_{gg}(t)=\rho_{ee}(0)[1-e^{-2\gamma_q t}]+\rho_{gg}(0). \label{Eq:DissTLS-rho_gg Sol} \end{align} \end{subequations} It is instructive to clarify the role of collapse term in this rather simple example. The full effective Hamiltonian~(\ref{Eq:DissTLS-Rep of H_u,ef}) is lower triangular, i.e. that the collapse term does not change the eigenfrequencies, but rather the eigenvectors of the system. Regardless of the inclusion of the collapse terms, the eigenvalues of $\hat{H}_{\text{u,ef}}$ read \begin{subequations} \begin{align} &\omega_{u,ee}=-2i\gamma_q, \label{Eq:DissTLS-Om_u,ee}\\ &\omega_{u,eg}=\nu_q-i\gamma_q, \label{Eq:DissTLS-Om_u,eg}\\ &\omega_{u,ge}=-\nu_q-i\gamma_q, \label{Eq:DissTLS-Om_u,ge}\\ &\omega_{u,gg}=0. \label{Eq:DissTLS-Om_u,gg} \end{align} \end{subequations} On the other hand, if the collapse term is neglected, the eigenvectors are simply the starting excitation basis $\{\ket{e_s}\ket{e_a}, \ket{e_s}\ket{g_a}, \ket{g_s}\ket{e_a}, \ket{g_s}\ket{g_a}\}$; while the eigenvectors of Eq.~(\ref{Eq:DissTLS-Rep of H_u,ef}) read \begin{subequations} \begin{align} &\ket{\Psi_{u,ee}}=\ket{e_s}\ket{e_a}, \label{Eq:DissTLS-Psi_u,gg}\\ &\ket{\Psi_{u,eg}}=\ket{e_s}\ket{g_a}, \label{Eq:DissTLS-Psi_u,gg}\\ &\ket{\Psi_{u,ge}}=\ket{g_s}\ket{g_a}, \label{Eq:DissTLS-Psi_u,gg}\\ &\ket{\Psi_{u,gg}}=\frac{1}{\sqrt{2}}\left(\ket{g_s}\ket{g_a}-\ket{e_s}\ket{e_a}\right). \label{Eq:DissTLS-Psi_u,gg} \end{align} \end{subequations} Therefore, the last eigenvector changes from $\ket{g_s}\ket{g_a}$ to $1/\sqrt{2}(\ket{g_s}\ket{g_a}-\ket{e_s}\ket{e_a})$. The modification of the eigenvector has a significant impact on the dynamics and the steady state in particular. For example, without the collapse term, the solution for $\rho_{gg}(t)$ in Eq.~(\ref{Eq:DissTLS-rho_gg Sol}) is wrongly reduced to $\rho_{gg}(t)=\rho_{gg}(0)$, which breaks the conservation of probability. At last, we discuss the application of tensor rank decomposition of the full spectrum~(\ref{Eq:DissTLS-Om_u,ee}-\ref{Eq:DissTLS-Om_u,gg}) into a reduced spectrum as discussed in Sec.~(\ref{App:EffHam}). Defining the reduced spectrum \begin{align} \omega_g=0, \quad \omega_e\equiv \nu_q-i\gamma_q, \end{align} it is clear that the full spectrum is simply found as $\omega_{u,mn}=\omega_{m}-\omega_{n}^*$ for $m,n \in \{e,g\}$. \subsection{Rabi model with two-photon relaxation} \label{SubApp:EfHamRabi} \begin{figure}[t!] \centering \subfloat[\label{subfig:QuOpRabiSpecPP}]{% \includegraphics[scale=0.40]{QuOpRabiSpecPPVq8Em1Vc1Qc40FuncOfg.pdf}% } \hfill \subfloat[\label{subfig:QuOpRabiSpecPM}]{% \includegraphics[scale=0.40]{QuOpRabiSpecPMVq8Em1Vc1Qc40FuncOfg.pdf}% }\\ \subfloat[\label{subfig:QuOpRabiSpecMP}]{% \includegraphics[scale=0.40]{QuOpRabiSpecMPVq8Em1Vc1Qc40FuncOfg.pdf}% }\hfill \subfloat[\label{subfig:QuOpRabiSpecMM}]{% \includegraphics[scale=0.40]{QuOpRabiSpecMMVq8Em1Vc1Qc40FuncOfg.pdf}% } \caption{Quantum open Rabi eigenfrequencies for the same parameters as in Fig.~2 of the main paper as a function of light-matter coupling $g$. The eigenvalues are denoted by four colors. \textcolor{blue}{Blue} is for the $\color{blue}\ket{p_s=+}\ket{p_a=+}\color{black}$ subspace of the full effective Hamiltonian, \textcolor{red}{red} for $\color{red}\ket{p_s=-}\ket{p_a=-}\color{black}$, black for $\ket{p_s=+}\ket{p_a=-}$ and \textcolor{byzantine}{purple} for $\color{byzantine}\ket{p_s=-}\ket{p_a=+}$. The solid lines show the result for the full effective Hamiltonian, while the dotted line is the phenomenological case. The Hilbert space cutoff for each boson, i.e. $\hat{b}$ and $\hat{B}$, has been chosen as $N_c=4$ for clarity.} \label{fig:QuOpRabiSpec} \end{figure} \begin{figure}[t!] \centering \subfloat[\label{subfig:QuOpRabiDissPP}]{% \includegraphics[scale=0.40]{QuOpRabiDissPPVq8Em1Vc1Qc40FuncOfg.pdf}% } \hfill \subfloat[\label{subfig:QuOpRabiDissPP}]{% \includegraphics[scale=0.40]{QuOpRabiDissPMVq8Em1Vc1Qc40FuncOfg.pdf}% }\\ \subfloat[\label{subfig:QuOpRabiDissPP}]{% \includegraphics[scale=0.40]{QuOpRabiDissMPVq8Em1Vc1Qc40FuncOfg.pdf}% }\hfill \subfloat[\label{subfig:QuOpRabiDissPP}]{% \includegraphics[scale=0.40]{QuOpRabiDissMMVq8Em1Vc1Qc40FuncOfg.pdf}% } \caption{Quantum open Rabi eigendecays for the same parameters and plotting conventions as in Fig.~\ref{fig:QuOpRabiSpec} as a function of light-matter coupling $g$.} \label{fig:QuOpRabiDiss} \end{figure} In this subsection, we discuss the derivation of the full effective Hamiltonian approach for the quantum Rabi model with two-photon relaxation and check the validity of the phenomenological results for the spectrum. We start by the Lindblad equation \begin{align} \dot{\hat{\rho}}(t)=-i[\hat{H}_s,\hat{\rho}(t)]+2\kappa_{c2}\mathcal{D}[\hat{a}^2]\hat{\rho}(t), \label{Eq:EfHamRabi-Lindblad Eq 1} \end{align} where we have included a two-photon relaxation for the cavity mode. Importantly, the two-photon dissipator respects the $Z_2$ symmetry of the Rabi model, since \begin{align} \hat{P}^{\dag}\mathcal{D}[\hat{a}^2]\hat{P}=\mathcal{D}[(-\hat{a})^2]=\mathcal{D}[\hat{a}^2]. \label{Eq:EfHamRabi-ParSym of D[a]} \end{align} Therefore, we expect that the full Lindblad equation become block-diagonal in the parity sector. To see this explicitly, we first divide the dissipator into decay and collapse contributions and rewrite the Lindblad Eq.~(\ref{Eq:EfHamRabi-Lindblad Eq 1}) as \begin{align} \dot{\hat{\rho}}(t)=-i\left[\hat{H}_{\text{s,ef}}\hat{\rho}(t)-\hat{\rho}(t)\hat{H}_{\text{s,ef}}^{\dag}\right]+2\kappa_{c2}\hat{a}^2\hat{\rho}(t)\left(\hat{a}^{\dag}\right)^2, \label{Eq:EfHamRabi-Lindblad Eq 2} \end{align} where the effective system Hamiltonian reads \begin{align} \hat{H}_{\text{s,ef}}\equiv \frac{\nu_q}{2}\hat{\sigma}^z+\nu_c\hat{a}^{\dag}\hat{a}+g\left(\hat{a}+\hat{a}^{\dag}\right)\hat{\sigma}^x-i\kappa_{c2}(\hat{a}^{\dag})^2\hat{a}^2. \label{Eq:EfHamRabi-H_R,ef} \end{align} Second, we reexpress the Lindblad Eq.~(\ref{Eq:EfHamRabi-Lindblad Eq 2}) in the number-parity basis. Using definition~(\ref{Eq:ParSym-Def b}) we find that \begin{align} \hat{b}^2=(\hat{\sigma}_x\hat{a})^2=\hat{\sigma}_x^2\hat{a}^2=\hat{a}^2, \label{Eq:EfHamRabi-Sol for H_s,ef} \end{align} from which we can reexpress the effective system Hamiltonian~(\ref{Eq:EfHamRabi-H_R,ef}) as \begin{align} \hat{H}_{\text{s,ef}}=\nu_c\hat{b}^{\dag}\hat{b}-\frac{\nu_q}{2}(-1)^{\hat{b}^{\dag}\hat{b}}\hat{P}_s+g\left(\hat{b}+\hat{b}^{\dag}\right)-i\kappa_{c2}(\hat{b}^{\dag})^2\hat{b}^2. \label{Eq:EfHamRabi-Sol for H_s,ef} \end{align} The Lindblad Eq.~(\ref{Eq:EfHamRabi-Lindblad Eq 2}) then takes the form \begin{align} \dot{\hat{\rho}}(t)=-i\left[\hat{H}_{\text{s,ef}}\hat{\rho}(t)-\hat{\rho}(t)\hat{H}_{\text{s,ef}}^{\dag}\right]+2\kappa_{c2}\hat{b}^2\hat{\rho}(t)(\hat{b}^{\dag})^2=0. \label{Eq:EfHamRabi-Lindblad Eq 3} \end{align} Comparing Eq.~(\ref{Eq:EfHamRabi-Lindblad Eq 3}) to the generic Lindblad form~(\ref{Eq:EffHam-Lindblad 2}) and following the discussion in Sec.~(\ref{SubApp:GenDis}), we can define a full effective Hamiltonian as \begin{subequations} \begin{align} \hat{H}_{\text{u,ef}}=\hat{H}_{\text{s,ef}}-\hat{H}_{\text{a,ef}}+2i\kappa_{c2}\hat{b}^2\hat{B}^2, \label{Eq:EfHamRabi-Def of H_u,ef} \end{align} where $\hat{H}_{\text{s,ef}}$ and $\hat{H}_{\text{a,ef}}$ are defined as \begin{align} \begin{split} \hat{H}_{\text{s,ef}}&=\nu_c\hat{b}^{\dag}\hat{b}-\frac{\nu_q}{2}e^{i\pi\hat{b}^{\dag}\hat{b}}\hat{P}_s\\ &+g\left(\hat{b}+\hat{b}^{\dag}\right)-i\kappa_{c2}(\hat{b}^{\dag})^2\hat{b}^2, \end{split} \label{Eq:EfHamRabi-Sol for H_s,ef}\\ \begin{split} \hat{H}_{\text{a,ef}}&=\nu_c\hat{B}^{\dag}\hat{B}-\frac{\nu_q}{2}e^{i\pi\hat{B}^{\dag}\hat{B}}\hat{P}_a\\ &+g\left(\hat{B}+\hat{B}^{\dag}\right)+i\kappa_{c2}(\hat{B}^{\dag})^2\hat{B}^2. \end{split} \label{Eq:EfHamRabi-Sol for H_a,ef} \end{align} \end{subequations} In Eqs.~(\ref{Eq:EfHamRabi-Def of H_u,ef}-\ref{Eq:EfHamRabi-Sol for H_a,ef}), $\hat{b}$ and $\hat{P}_s$ denote the cavity annihilation and parity operators for the system sector, while $\hat{B}$ and $\hat{P}_a$ are the counterparts for the auxiliary sector. Even though it is in principle possible to obtain recursion relations for the eigenfrequencies and eigenmodes of the full effective Hamiltonian~(\ref{Eq:EfHamRabi-Def of H_u,ef}), due to the larger Hilbert space compared to the phenomenological treatment, the results will be more involved. Alternatively, we avoid analytics and compute the complex spectrum of the full effective Hamiltonian~(\ref{Eq:EfHamRabi-Def of H_u,ef}) numerically. To make a meaningful comparison to the phenomenological result of Sec.~\ref{App:ClRabiSpec}, we can in principle follow two possible routes. The first possibility is to employ spectral decomposition of the full spectrum, which provides a reduced spectrum that could be in principle compared with the phenomenological result. The Rabi model is not quadratic, and a numerical study shows that the aforementioned spectral decomposition [Eq.~(\ref{Eq:EffHam-TRD for Om})] does not hold for this system. Therefore, we follow the second possibility of using the Hamiltonian $\hat{H}_{\text{u,ph}}=\hat{H}_{\text{s,ef}}-\hat{H}_{\text{a,ef}}$, that lacks the collapse terms, and compare its spectrum with that of $\hat{H}_{\text{u,ef}}$ in Eq.~(\ref{Eq:EfHamRabi-Def of H_u,ef}). An example for the spectrum is shown in Figs.~\ref{fig:QuOpRabiSpec} and~\ref{fig:QuOpRabiDiss} for the real part (frequency) and imaginary part (decay) of the complex spectrum, respectively. For clarity, the spectrum has been partitioned into four (i.e. $p_s=\pm, p_a=\pm$) possible parity subspaces. Following the results in the main paper, we have kept the lowest 5 levels for the system and auxiliary bosons. Therefore, we observe $5^2=25$ distinct quantum levels for each of the four possible parity subspaces. Note that the collapse term has a representation in the number basis that is lower triangular. Therefore, at $g=0$, we expect the spectrum of the two Hamiltonians to be exactly the same. On the other hand, the coupling terms have tridiagonal representations and due to the distinct interplay of coupling with the dissipation, with and without the collapse, we expect to get deviations at larger values of $g$ as seen in Fig.~\ref{fig:QuOpRabiDiss}. The real frequencies, on the contrary, barely show any modification due to the collapse terms (See Fig.~\ref{fig:QuOpRabiSpec}).
\section{Introduction} Circumstellar disks are ubiquitous across all masses of star formation \citep[e.g.][]{Andrews13, Ricci14, Ilee16, Lazareff16, Kraus17}: a consequence of the conservation of angular momentum during gravitational collapse. These disks provide the building materials and the natal environment for planets to form and evolve in. The reprocessing of starlight by dust in the innermost regions of protoplanetary disks produces strong near-infrared (NIR) continuum emission, in excess of that expected from a stellar photosphere. Developments in the field of NIR interferometry during the late 1990s enabled the first spatially-resolved observations of the circumstellar structure of Herbig Ae/Be stars -- the precursors to intermediate-mass stars \citep{Herbig60, Strom72} -- to be obtained. The milliarcsecond (mas) resolution offered by the Infrared Optical Telescope Array (IOTA) and Palomar Testbed Interferometer (PTI) showed that the inner disk regions did not extend down to the stellar surface \citep[e.g][]{Millan99, Akeson00}, in agreement with prior spectral energy distribution (SED) modeling \citep{Hillenbrand92}. As the number of Herbig Ae/Be stars observed with NIR interferometry increased, a relationship between the host star luminosity and the characteristic size of the NIR-emitting region emerged \citep{Monnier02}. The slope of this size-luminosity relationship suggests the NIR-emitting region arises from a dust sublimation rim at a temperature of $\sim1800\,$K \citep{Lazareff16}. Early disk models incorporating a dust sublimation rim used a vertical-wall approximation \citep{Dullemond01, Natta01}. However, the strong viewing angle-dependency to the NIR emission associated with such a model is in conflict with the similar levels of NIR excess observed among Herbig Ae/Be stars over a wide range of disk inclination angles \citep{Natta01, Dominik03}. In addition, the significant closure phase ($\phi_{\rm{CP}}$) signals associated with the strongly asymmetric NIR brightness distribution in vertical rim models was not observed \citep{Monnier06,Kraus09}. Instead, curvature of the inner rim is understood to arise due to the dependence of the dust sublimation temperature and grain cooling efficiency on, for example, the gas density, the size distribution of dust grains, grain growth-induced vertical settling, and the relative abundance of different grain compositions \citep{Isella05, Tannirkulam07, Kama09, McClure13}. The picture was further complicated with the first \emph{sub}-mas NIR observations of Herbig Ae/Be stars, made possible with the $\sim330\,$m baselines of the Center for High Angular Resolution Astronomy (CHARA) Array. Through their observations of \object{MWC 275} and \object{AB Aur}, \citet{Tannirkulam08a} found that the ``bounce'' in the secondary visibility lobe predicted by curved rim models was not observed. Instead, to explain the relatively flat profiles of the observed second visibility lobes, an additional NIR-emitting component interior to the silicate dust sublimation front was required. Further evidence for this has been reported in studies using NIR spectro-interferometry \citep[e.g.][]{Kraus08, Eisner09}, high resolution spectroscopy \citep[e.g.][]{Ilee14}, and photometry \citep[e.g.][]{Fischer11}. The nature of this material remains unclear with plausible suggestions including a hot gas reservoir and/or more refractory grain species \citep{Tannirkulam08b, Eisner09}. Here, we focus on the shape, location and viewing geometry of the circumstellar disk of the Herbig Ae star, \object{HD\,142666} (spectral type A8Ve; \citealt{Meeus98}). The IR excess of \object{HD\,142666} (common aliases include V1026~Sco), first identified by \citet{Walker88}, has previously been studied using NIR and mid-IR (MIR) interferometers with operational baselines $\lesssim100\,$m. The characteristic size of the $H$- and $K$-band-emitting regions observed with the Keck Interferometer (KI), VLTI/AMBER and VLTI/PIONIER (henceforth referred to as AMBER and PIONIER, respectively) are consistent with that expected from dust sublimation ($\sim0.4\,$au at a stellar distance of $150\,$pc; \citealt{Monnier05, Lazareff16}) while the MIR emission observed with VLTI/MIDI is more extended than predicted by typically-adopted temperature gradient models suggesting a narrow, dust-free gap is present within the inner few au of the disk \citep{Schegerer13, Vural14}. However, the usual features indicative of optically thin disk regions or disk cavities are not seen in the SED of \object{HD\,142666} \citep{Dominik03} meaning the disk is not typically considered to be (pre-)transitional. Intermediate disk inclinations for HD\,142666 have been indicated via NIR and MIR interferometry ( $48.6^{\circ}\,^{+2.9}_{-3.6}$, \citealt{Vural14}; $\sim60^{\circ}$, \citealt{Lazareff16}), SED analysis ($\sim55^{\circ}$, \citealt{Dominik03}) and ALMA ($\sim60^{\circ}$, \citealt{Rubinstein18}). VLT/NACO differential imaging and ALMA indicate the disk major axis position angle\footnote{Quoted disk position angles, PA$_{\rm{major}}$, are for the disk major axis, measured east of north.}, PA$_{\rm{major}}$, is oriented along a nearly North-South direction ($\sim180^{\circ}$, \citealt{Garufi17}; $161^{\circ}$, \citealt{Rubinstein18})). We present new, high-resolution NIR interferometric data of \object{HD\,142666} obtained using the CLASSIC two-telescope and CLIMB three-telescope beam combiners of the CHARA Array \citep{Brummelaar13}. Section~\ref{sec:obs} details our CHARA observations and the supplementary, shorter baseline NIR interferometry retrieved from the archives. With its $\sim331\,$m maximum baseline length, our CHARA observations offer us the opportunity to distinguish between different curved rim models to understand the dominant process of rim curvature in the disk of \object{HD\,142666}. Our analysis builds upon that of \citet{Tannirkulam08b} who used the TORUS Monte Carlo radiative transfer code \citep{Harries00} to model the NIR interferometric visibilities of two other Herbig Ae stars -- \object{MWC\,275} and \object{AB\,Aur} (spectral types of A1 and A0, respectively; \citealt{Mora01, Hernandez04}) -- obtained with CHARA/CLASSIC (henceforth referred to as CLASSIC). In addition to considering a later-type Herbig~Ae star, (i) our $(u,v)$-plane coverage is much improved compared to the \citet{Tannirkulam08b} study, (ii) we probe $H$- as well as $K$-band emission, and (iii) with the addition of CHARA/CLIMB (henceforth referred to as CLIMB) data, we use $\phi_{\rm{CP}}$ information to further constrain our modeling. A two-fold approach is used in our analysis. First, we constrain the stellar flux contribution to the NIR flux by fitting stellar atmosphere models to optical photometry and employ centro-symmetric geometric models to constrain the viewing geometry of the NIR-emitting region. We then build on these models using the TORUS Monte Carlo radiative transfer code to explore the physical bases behind the location and shape of the observed inner disk rim. Our modeling approach is outlined in Section~\ref{sec:methodology} while the results of our geometric and radiative transfer analysis are presented in Sections~\ref{sec:geoFitResults} and \ref{sec:RTresults}, respectively. In Section~\ref{sec:discussion}, we discuss our results in the context of grain growth to micron sizes in the inner rim and comment on indirect evidence for further complexity in the NIR-emitting region. \section{Observations and complementary archival data}\label{sec:obs} \subsection{CHARA interferometry} CHARA is a Y-shaped array of six $1\,$m-class telescopes located at Mount Wilson Observatory offering operational baselines between $34$ and $331\,$m \citep{Brummelaar05}. CLASSIC and CLIMB \citep{Brummelaar13} were used to obtain $K$-band observations of \object{HD\,142666} between 2009 June and 2013 June. Additional $H$-band observations of \object{HD\,142666} were obtained with CLIMB in 2014 May and June. \begin{deluxetable*}{lclcc} \tabletypesize{\scriptsize} \tablecolumns{5} \tablecaption{CHARA observation log\label{tab:obslog}} \tablehead{ \colhead{Date (UT)} & \colhead{Beam Combiner} & \colhead{Stations} & \colhead{Filter} & \colhead{Calibrator(s)} } \startdata 2009 Jun 24 & CLASSIC & S2 E2 & K & 1, 2\\ 2010 Jun 15 & CLASSIC & S2 W1 & K & 3, 4\\ 2011 Jun 15 & CLIMB & E1 W1 W2 & K & 3\\ 2011 Jun 20 & CLIMB & (E1)\tablenotemark{a} W1 W2 & K & 3\\ 2011 Jun 23 & CLIMB & S1 W1 W2 & K & 3, 5\\ 2011 Jun 25 & CLIMB & S1 E2 W2 & K & 6, 7\\ 2011 Jun 27 & CLIMB & S1 W1 W2 & K & 6\\ 2011 Jun 28 & CLIMB & S1 E2 W2 & K & 6\\ 2011 Aug 03 & CLIMB & S1 E2 W1 & K & 3, 5\\ 2012 Jun 29 & CLIMB & E1 E2 W1 & K & 3\\ 2012 Jul 01 & CLIMB & S1 S2 W1 & K & 6\\ 2013 Jun 10 & CLIMB & S1 W1 W2 & K & 8\\ 2013 Jun 13 & CLIMB & S1 W1 W2 & K & 9, 10\\ 2013 Jun 14 & CLIMB & S2 E2 W2 & K & 8, 9\\ 2013 Jun 16 & CLIMB & E2 W1 W2 & K & 11\\ 2014 May 28 & CLIMB & S2 E2 W2 & H & 3\\ 2014 May 29 & CLIMB & S2 E2 W2 & H & 3, 5\\ 2014 May 30 & CLIMB & S2 E2 W2 & H & 3, 5\\ 2014 Jun 04 & CLIMB & S2 E2 W1 & H & 3, 5\\ 2014 Jun 09 & CLIMB & E1 E2 W1 & H & 5\\ 2014 Jun 10 & CLIMB & S2 W1 W2 & H & 3, 5 \enddata \tablenotetext{a}{CLIMB operating as a two-telescope beam combiner.} \tablecomments{Calibrators and their UD diameters: (1) HD\,141465, $0.28\pm0.02\,$mas; (2) HD\,143766, $0.311\pm0.022\,$mas; (3) HD\,140990, $0.230\pm0.016\,$mas; (4) HD\,141597, $0.24\pm0.05\,$mas; (5) HD\,143616, $0.222\pm0.016\,$mas; (6) HD\,148211, $0.250\pm0.018\,$mas; (7) HD\,152429, $0.272\pm0.019\,$mas; (8) HD\,148198, $0.255\pm0.018\,$mas; (9) HD\,144766, $0.324\pm0.023\,$mas; (10) HD\,145809, $0.417\pm0.029\,$mas; (11) HD\,141937, $0.307\pm0.022\,$mas.} \end{deluxetable*} \begin{figure} \centering \includegraphics[width=0.36\textwidth]{uvcoverage_HD142666_H.pdf}\\ \includegraphics[width=0.36\textwidth]{uvcoverage_HD142666_K.pdf} \caption{($u, v$)-plane coverage for \object{HD\,142666} in H- (top) and K-band (bottom). Positive values of $v$ and $u$ correspond to North and East, respectively. Our new CLASSIC and CLIMB data (see Table~\ref{tab:obslog}) are shown as red and blue points, respectively. Supplementary archival NIR interferometric data, listed in Table~\ref{tab:supldata}, are also indicated: KI (cyan); PIONIER (green). } \label{fig:uvplane} \end{figure} A variety of telescope configurations were used during the observing campaign with a maximum projected baseline length of $313\,$m (corresponding to an angular resolution\footnote{$\lambda/2B$ with $\lambda$ the operational wavelength and $B$ the projected baseline length.} of $0.70\,$mas). Further details regarding the individual observations are provided in Table~\ref{tab:obslog}. The resulting ($u, v$)-plane coverage is displayed in Figure~\ref{fig:uvplane}. The CLASSIC and CLIMB data were reduced using pipelines developed at the University of Michigan which are better suited to recovering faint fringes for low visibility data than the standard CHARA reduction pipeline of \citet{Brummelaar12}. The waterfall plot of raw data scans was first inspected for instrumental or observational effects such as drifting scans or flux drop-out on one or more telescope, for example. Any scans displaying these effects were flagged and rejected. In the majority of cases, this affected at most $5-10$ per cent of scans. Extra care was taken on the few occasions where drift or low signal-to-noise dominated the majority of scans. In these cases, the affected scans were carefully flagged while the power spectrum, averaged over the retained scans, was inspected for a signal. After this process, the foreground, background and flux recorded for each baseline pair were each inspected for flux drop-out. Finally, the power spectrum for each telescope pair and CLIMB output (P0, P1 and P2; see \citealt{Brummelaar12}) was inspected and the background level set manually. This results in one $\phi_{\rm{CP}}$ for each baseline triplet, three estimates of the square visibility, $V^{2}$, for one baseline pair and two estimates of $V^{2}$ for the remaining two CLIMB baseline pairs. Calibration of the $V^{2}$ and $\phi_{\rm{CP}}$ measurements were made using standard stars observed before and/or after each science observation. None of the calibrators used are known binary systems. As a further check, the $\phi_{\rm{CP}}$ signals of each of the calibrators observed more than once were inspected: no signatures of binarity were found. The uniform diameters (UDs) of each calibrator, obtained from JMMC SearchCal \citep{Bonneau06, Bonneau11}, where available, or gcWeb\footnote{http://nexsciweb.ipac.caltech.edu/gcWeb/gcWeb.jsp}, are listed in Table~\ref{tab:obslog}. The transfer function across the full observation sequence was inspected to ensure its flatness. Finally, the multiple estimates of the calibrated $V^{2}$ on each baseline pair were checked for consistency before a weighted-average value was computed. For our analysis, we thus have one estimate of $V^{2}$ for each baseline pair. The raw and calibrated data will be made available in oifits format \citep{Pauls05, Duvert17} through the CHARA archive (Jones et al.\ in prep) and the Optical interferometry Database (OiDb; \citealt{Haubois14}) of the JMMC following publication. \subsection{Supplementary archival interferometry} \begin{deluxetable*}{lccccc} \tabletypesize{\scriptsize} \tablecolumns{6} \tablecaption{Supplementary Archival NIR Interferometric Data\label{tab:supldata}} \tablehead{ \colhead{Instrument} & \colhead{Observation Date (UT)} & \colhead{Program ID} & \colhead{Stations} & \colhead{Filter} & \colhead{Calibrator(s)} } \startdata VLTI PIONIER & 2012 Mar 28 & 088.D-0185 & A1 G1 I1 K0 & H & \nodata \\ & 2012 Mar 29 & 088.C-0763 & A1 G1 I1 K0 & H & \nodata \\ & 2013 Jun 06 & 190.C-0963 & A1 G1 J3 K0 & H & \nodata \\ & 2013 Jun 17 & 190.C-0963 & D0 G1 H0 I1 & H & \nodata \\ & 2013 Jul 03 & 190.C-0963 & A1 B2 C1 D0 & H & \nodata \\ KI V2-SPR & 2004 Mar 05 & 13 & K1K2 & K & 1\\ & 2007 Jul 02 & 32 & K1K2 & K & 2, 3\\ & 2009 Jul 16 & 31 & K1K2 & K & 2, 3, 4, 5\\ & 2012 May 02 & 57 & K1K2 & K & 6\\ & 2012 May 03 & 57 & K1K2 & K & 7 \enddata \tablecomments{Calibrators listed in column 7 for the instances where a re-reduction of the data was required: (1) HD\,134967, $0.15\pm0.01\,$mas; (2) HD\,139364, $0.323\pm0.023\,$mas; (3) HD\,141465, $0.28\pm0.02\,$mas; (4) HD\,142301, $0.159\pm0.011\,$mas; (5) HD\,143766 $0.311\pm0.022\,$mas; (6) HD\,145809, $0.417\pm0.029\,$mas; (7) HD\,141597, $0.24\pm0.05\,$mas.} \end{deluxetable*} To better constrain the geometry of the disk, we supplemented our long-baseline CLASSIC and CLIMB data with shorter baseline archival NIR interferometry. Calibrated PIONIER \citep{leBouquin11} data for \object{HD\,142666}, originally published in \citet[][program IDs 190.C-0963, 088.D-0185, and 088.C-0763]{Lazareff16}, were retrieved from the OiDb. PIONIER data from UT date 2013 June 17, not available on the OiDb, were also provided by Bernard Lazareff (private communication). KI \citep{Colavita13} data were retrieved from the Keck Observatory Archive. The wide-band KI data were calibrated using the NExScI Wide-band Interferometric Visibility Calibration (wbCalib v1.4.4) tool with the flux bias correction and ratio correction options selected. Table~\ref{tab:supldata} provides further details on the collated data and, for the occasions where the data required (re-)reduction, also the names and UD diameters of the standard stars used to calibrate $V^{2}$ and $\phi_{\rm{CP}}$. \section{Modeling methodology}\label{sec:methodology} We model the location and extent of the circumstellar NIR-emitting region of \object{HD\,142666} using the Monte Carlo radiative transfer code, TORUS \citep{Harries00, Harries04, Kurosawa06, Tannirkulam07}. Exploring viewing geometries using TORUS would be computationally expensive so, to allow for a more rapid exploration, we employed a series of geometric models to determine best-fit inclinations and position angles. In the subsections that follow, we outline the methodology adopted in both our analyses. \subsection{Geometric modeling of the visibilities}\label{sec:geofit} The visibility of the circumstellar emission is \begin{equation} V_{\rm{CS}} = \frac{|V_{\rm{obs}}(F_{\star} + F_{\rm{CS}}) - V_{\star}F_{\star}|}{F_{\rm{CS}}}, \end{equation} where $V_{\rm{obs}}$ is the observed visibility and $F_{\star}$ and $F_{\rm{CS}}$ refer to the stellar and circumstellar flux contributions, respectively. The stellar emission component of \object{HD\,142666} is expected to be unresolved as the stellar radius is much smaller than the length scales we are able to probe. As such, we set the visibility of the stellar component to unity, i.e.\ $V_{\star}=1$. We required an independent assessment of $F_{\star}$ at $H$- and $K$-bands to avoid degeneracies associated with fitting both the characteristic size of the emitting region and $F_{\star}$ simultaneously (see, for example, \citealt{Lazareff16}). Multi-wavelength photometry were retrieved from the literature while a post-processed, flux-calibrated \textit{Spitzer} Infrared Spectrograph \citep[IRS;][]{Houck04} spectrum \citep[AORkey 3586816]{Keller08} was retrieved from the \emph{Spitzer} Heritage Archive. The full list of collated photometry, together with the individual references, is presented in Table~\ref{tab:phot:HD} in Appendix~\ref{apen:phot}. The photospheric portion (Johnson-$B$, -$V$, and Cousins-$I_{c}$ wavebands) of the SED constructed for \object{HD\,142666} was then fit using \citet{Kurucz79} model atmospheres appropriate for the star (see Section~\ref{sec:geoFitResults}). The measured $\phi_{\rm{CP}}$ were inspected for deviations from centro-symmetry. While no significant indication for non-zero $\phi_{\rm{CP}}$ was visible in the full $H$-band data set (CLIMB+PIONIER), a possible deviation from centro-symmetry is suggested by the full $K$-band data set (CLIMB). Assuming the NIR emission from \object{HD\,142666} emanates from the inner regions of an inclined disk, a non-zero $\phi_{\rm{CP}}$ may indicate a degree of skewness to the disk emission caused by self-shielding, for example. Alternative scenarios include, but are not restricted to, the presence of regions with enhanced brightness, possibly indicating an increased disk scale height (i.e.\ disk warp) or eluding to the presence of additional companions. If these features co-orbit with the disk, their dynamical timescales may be smaller than the four year timescale over which the $\phi_{\rm{CP}}$ were obtained. In Fig.~\ref{fig:cps}, we plot the observed $\phi_{\rm{CP}}$ against the maximum spatial frequency probed by each triplet of baseline vectors, split by observational epoch and waveband. In each panel, the reduced-$\chi^{2}$ ($\chi^{2}_{\rm{r}}$) value computed for a centro-symmetric model ($\phi_{\rm{CP}}=0$ at all spatial frequencies) is displayed in the top left-hand corner. Although there may be an indication for deviation from centro-symmetry in the 2011 and 2013 $K$-band data, the $\phi_{\rm{CP}}=0^{\circ}$ model provides a good fit to all epochs. Thus, to estimate the geometry of the $H$- and $K$-band-emitting regions, we restrict our analysis to centro-symmetric models. \begin{figure} \centering \includegraphics[width=0.47\textwidth]{cps_byyear.pdf} \caption{Closure phase as a function of the maximum spatial frequency probed by each closed triangle of baseline vectors. Left-hand panels contain the $H$-band PIONIER and CLIMB data while right-hand panels contain the $K$-band CLIMB data, each split by the year of observation (see Tables~\ref{tab:obslog} and \ref{tab:supldata}). Data points are colored as in Fig.~\ref{fig:uvplane}. The $\chi^{2}_{\rm{r}}$ for centro-symmetric models ($\phi_{\rm{CP}}=0^{\circ}$ on all spatial scales) is displayed in the lower left corner of each panel. } \label{fig:cps} \end{figure} In Section~\ref{sec:geoFitResults}, we consider two geometric models for the brightness distribution. Both of these use a point source component to model the stellar flux contribution and assume, for simplicity, that all non-stellar NIR emission arises from the innermost regions of a disk. In the first model, a thin ring of emission is used to emulate the disk component, corresponding to the emission expected from a centrally-illuminated vertical wall. The free parameters of this point source-plus-ring (PS+R) model are the ring radius, $R$, its inclination, $i$ (where $0^{\circ}$ corresponds to a face-on viewing geometry), and its major axis position angle, PA$_{\rm{major}}$ (measured east of north). In the second model, the disk emission is approximated as a Gaussian-smoothed ring, avoiding the sharp edges of the ring model and corresponding to a more spatially-extended NIR emitting region. The full-width at half-maximum (FWHM) of the Gaussian used in the convolution remains a free parameter in the fitting procedure. These point source-plus-smoothed ring models are henceforth referred to as PS+SR. During the fitting procedure, errors on the best-fit parameters (found via $\chi^{2}$ minimization) were estimated via bootstrapping. A thousand new realizations of the original visibility data sets were created and fed through the same modeling procedure as the original data. The initial values of the parameters in the fitting remained consistent between data sets in the same waveband and throughout the bootstrapping process. Histograms were created from the resulting bootstrapped model outputs and errors were estimated from $1\sigma$-Gaussian fits to each histogram. \subsection{Monte Carlo Radiative Transfer modeling with TORUS}\label{sec:RTmodel} The TORUS Monte Carlo radiative transfer code uses the \citet{Lucy99} algorithm to compute radiative equilibrium on a two-dimensional, cylindrical adaptive mesh grid. Assuming that all of the circumstellar NIR emission of \object{HD\,142666} arises from a disk, we prescribe the TORUS models as follows. The initial density structure of the gas component of the disk, $\rho(r, z)$, is based on the $\alpha$-disk prescription of \citet{Shakura73}: \begin{equation}\label{eq:gasdensity} \rho(r, z) = \frac{\Sigma(r)}{h(r)\sqrt{2\pi}} \exp\left\{-\frac{1}{2}\left[\frac{z}{h(r)}\right]^{2}\right\}. \end{equation} Here, $r$ and $z$ are the radial distance into the disk and the vertical height above the disk midplane, respectively. The parameters $h(r)$ and $\Sigma(r)$ describe the scale height, \begin{equation}\label{eq:scaleheight} h(r) = h_{\rm{0,gas}}\left(\frac{r}{100\,\rm{au}}\right)^{\beta}, \end{equation} and the surface density, \begin{equation} \Sigma(r) = \Sigma_{\rm{0,gas}}\left(\frac{r}{100\,\rm{au}}\right)^{-p}, \end{equation} of the gas component of the disk, respectively. The constants $h_{\rm{0,gas}}$ and $\Sigma_{\rm{0,gas}}$ are each equated at $r=100\,$au. We keep $p=1.0$ fixed in all models. The disk is passively heated by a single star located at the grid centre and is assumed to be in local thermodynamic equilibrium. The temperature structure of the disk and the location and shape of the dust sublimation region are established in an iterative manner using the \citet{Lucy99} algorithm. To investigate the shape of the inner rim of the disk, we use two different parameterizations of the sublimation region facilitated by TORUS. These are summarised in Table~\ref{tab:RTmodels}, discussed briefly in Section~\ref{sec:graincomp} and the interested reader is referred to \citet{Tannirkulam07} for further details. In both cases, an e-folding factor of $10\,$K to the dust sublimation temperature has been introduced to enable convergence. TORUS solves for radiative equilibrium with or without imposing vertical hydrostatic equilibrium. If vertical hydrostatic equilibrium is imposed, the vertical structure of the disk is modified via the equation of vertical hydrostatic equilibrium according to an adapted form of the \citet{Walker04} algorithm following each \citet{Lucy99} iteration \citep{Tannirkulam07}. The process of establishing a converged temperature and dust sublimation structure is then repeated. Typically, these models converge after the third iteration of imposing vertical hydrostatic equilibrium. \begin{deluxetable}{lccc} \tabletypesize{\scriptsize} \tablecolumns{6} \tablecaption{TORUS radiative transfer models summary showing grain fractions by mass, dust scale height ($h_{\rm{0,dust}}$) relative to gas scale height ($h_{\rm{0,gas}}$), and sublimation temperature ($T_{\rm{sub}}$) \label{tab:RTmodels}} \tablehead{ \colhead{} & \colhead{S:small} & \colhead{S:large} & \colhead{THM07} } \startdata $0.1\,\mu$m grain fraction ($\%$) & 100 & 0 & 90 \\ $1.2\,\mu$m grain fraction ($\%$) & 0 & 100 & 10 \\ $0.1\,\mu$m grain $h_{\rm{0,dust}}$ ($h_{\rm{0,gas}}$) & 1.0 & \nodata & 1.0 \\ $1.2\,\mu$m grain $h_{\rm{0,dust}}$ ($h_{\rm{0,gas}}$) & \nodata & 1.0 & 0.6 \\ $T_{\rm{sub}}$ (K) & $G\rho^{\gamma}(r, z)$ & $G\rho^{\gamma}(r, z)$ & 1400 \enddata \end{deluxetable} Following convergence, a separate Monte Carlo algorithm is used to compute model SEDs and $H$- and $K$-band images based on the optical properties of the dust species used in the particular model (\citealt{Harries00}; see Section~\ref{sec:graincomp} for details of the grain prescriptions used in our models). All model outputs were computed at a distance of $150\,$pc \citep{Lindegren16} based on the distance inferred from the Gaia DR1 parallax and consistent with that inferred from the more recent Gaia DR2 parallax ($148\pm1\,$pc; \citealt{Gaia16, Gaia18, Bailer18}), and at the best-fit disk inclinations found through our geometric modeling (see Section~\ref{sec:geoFitResults}). Visibility amplitudes and phases were extracted from the model images at PA$_{\rm{base}}$ and baseline lengths corresponding to the ($u,v$)-plane positions of our interferometric data (see Fig.~\ref{fig:uvplane}). Model $\phi_{\rm{CP}}$ were then computed from the sum of the visibility Fourier phases over each closed triangle of baseline vectors. Due to the combined effects of the model image resolution (which introduces errors when the image is rotated and via the interpolation between pixels to the correct baseline length) and numerical estimation of the complex visibilities, our procedure for estimating model $\phi_{\rm{CP}}$ introduces an uncertainty of $\sim1^{\circ}$. This is within our CLIMB measurement uncertainties. \subsubsection{Dust grain prescription and implementation of rim curvature}\label{sec:graincomp} The location of the disk inner rim is controlled by the dust species with the highest sublimation temperature, $T_{\rm{sub}}$, and greatest cooling efficiency \citep{Isella05, Kama09}. We limit our analysis to astronomical silicate grains which sublimate at temperatures consistent with those inferred from the NIR size-luminosity relation \citep{Pollack94}. The grains are modeled as homogeneous spheres with a mass density of $3.3\,\rm{g\,cm^{-3}}$ \citep{Kim94} and optical constants prescribed by \citet{Draine03} which differ from those of \citet{Draine84} only in the details. In one set of TORUS models, inner disk rim curvature arises due to the dependence of $T_{\rm{sub}}$ on the local gas density \citep{Pollack94, Isella05}: \begin{equation} T_{\rm{sub}} = G\rho^{\gamma}(r, z). \end{equation} Here, $\gamma=1.95\times10^{-2}$ and the constant, $G=2000\,$K for silicate grains. Grains larger than $\sim1.3\,\mu$m in size do not contribute sufficiently to the disk opacity and thus do not play a role in determining the location of the dust rim \citep{Isella05}. As such, we adopt two different grain size prescriptions for these models: one set with small grains ($0.1\,\mu$m in size) and the other with large grains ($1.2\,\mu$m in size), consistent with the original \citet{Isella05} study. As these models use a single grain size, they are henceforth referred to as the S:small and S:large models, respectively. \begin{deluxetable*}{cccccccccccc} \tabletypesize{\scriptsize} \tablecaption{Adopted stellar parameters\label{tab:starParam}} \tablewidth{0pc} \tablehead{ \colhead{SpT} & \colhead{$T_{\rm{eff}}$ (K)} & \colhead{$\log g$} & \colhead{$\log Z$} & \colhead{$d$ (pc)} & \colhead{$L_{\star}/L_{\odot}$} & \colhead{$A_{\rm{V}}$} & \colhead{$R_{\star}/R_{\odot}$} & \colhead{$M_{\star}/M_{\odot}$} & \colhead{$F_{\star ,\rm{H}}$} & \colhead{$F_{\star ,\rm{K}}$} & \colhead{$R_{\rm{out}}$ (au)} } \startdata A8 & $7500$ & $4.3$ & $0.2$ & $150$ & $19.3$ & $1.63$ & $2.42$ & $1.97$ & $0.61$ & $0.35$ & $60$ \enddata \tablecomments{References for $T_{\rm{eff}}$, $\log g$, $\log Z$, $d$ and $R_{\rm{out}}$: \citet{Dent05}, \citet{Guimaraes06}, \citet{Lindegren16}, \citet{Garufi17}, \citet{McDonald17}.} \end{deluxetable*} In our other set of TORUS models, rim curvature arises due to the dependence of dust sublimation on the grain size-dependent cooling efficiency \citep{Kamp04, Kama09} and settling, as originally prescribed in \citet{Tannirkulam07}. These are henceforth referred to as THM07 models. We adopt a thermally coupled mixture of $0.1\,\mu$m and $1.2\,\mu$m grains in a ratio of $9$:$1$ by mass in favour of the small grains. $T_{\rm{sub}}=1400\,$K is used for both grain sizes for consistency with the original \citet{Tannirkulam08b} study of Herbig Ae stars \object{AB Aur} and \object{MWC 275}. We also limit the disk scale height of the $1.2\,\mu$m grains to 60\,\% that of the gas, $h_{\rm{0,gas}}$, while the $0.1\,\mu$m grains inhabit the full $h_{\rm{0,gas}}$ range. \subsubsection{Adopted parameters for the outer disk}\label{sec:RdMd} The flux across (sub-)millimeter wavelengths provides an indication of the mass contained within the dust component of protoplanetary disks (e.g.\ \citealt{Hildebrand83, Beckwith90}) as the emission is optically thin. In preliminary modeling with TORUS, we found that the (sub-)millimeter portion of the SED was reasonably well fit using a total disk mass of $0.20\,\rm{M_{\odot}}$, assuming a radially invariant gas-to-dust ratio of $100$:$1$. As the dust grain prescription we adopt in our TORUS modeling is rather simplistic (see previous subsection), we acknowledge that this assessment of the disk mass is likely unrealistic. For instance, the adoption of different grain size distribution or inclusion of another grain species with a different mass density and optical properties would affect the inferred value (c.f.\ \citealt{Wood02}). The radial extent of the disk around \object{HD\,142666} has been constrained from VLT/NACO imaging \citep{Garufi17} and through analysis of rotationally-broadened emission lines of gaseous species in the outer disk regions \citep{Dent05}. In both cases, a value of $\sim60\,$au was indicated, assuming a distance to \object{HD\,142666} of $150\,$pc. This value is also consistent with the $65\,$au found recently by \citet{Rubinstein18} from ALMA band 6 continuum observations. Our preliminary TORUS models showed that an outer disk radius, $R_{\rm{out}}=60\,$au provided a good fit to the long wavelength portion of the SED. This value was adopted in all our TORUS models. \section{Results from geometric modeling}\label{sec:geoFitResults} As outlined in Section~\ref{sec:geofit}, an independently-assessed $F_{\star}$ estimate was used to avoid degeneracies associated with using geometric models to simultaneously fit $F_{\star}$ and the characteristic size of the NIR-emitting region. To estimate $F_{\star}$ at $1.67\,\mu$m ($H$-band) and $2.13\,\mu$m ($K$-band), estimates of the stellar effective temperature, $T_{\rm{eff}}$, surface gravity, $\log g$, and metallicity, $\log Z$, of \object{HD\,142666} were retrieved from the literature (see Table~\ref{tab:starParam}). Using the python package {\sc pysynphot} \citep{pysynphot} and the ``minimize'' function of the python {\sc lmfit} library \citep{Newville14}, the corresponding \citet{Kurucz79} model atmosphere was compared to Johnson-Cousins $BVI_{\rm{C}}$ photometry to assess the $V$-band extinction, $A_{\rm{V}}$, and the stellar radius\footnote{The radius enters the fit through the scaling factor, ($d/R_{\star})^{2}$ which arises from the \citet{Kurucz79} model being in units of surface flux.}, $R_{\star}$. As \object{HD\,142666} displays flux variations at optical and NIR wavelengths \citep[e.g.][c.f. Section~\ref{sec:disc:geom}]{Makarov94}, we ensured that the $BVI_{\rm{C}}$ photometry were obtained contemporaneously. The reddening law of \citet{Cardelli89} with a total-to-selective extinction, $R_{\rm{V}}=5.0$ was adopted based on previous analyses of Herbig Ae/Be stars by \citet{Hernandez04} and \citet{Manoj06}. The fitting procedure uses the differential evolution method which is less susceptible to regions of local minima than e.g.\ the Levenberg-Marquardt method. The values of $R_{\star}$ and $A_{\rm{V}}$ found in the fitting process were then combined with the values of $T_{\rm{eff}}$, $\log g$, $d$, and $\log Z$ to estimate $F_{\star,H}$ and $F_{\star,K}$. The best-fit values are presented in Table~\ref{tab:starParam}. These results were used to determine self-consistent estimates for the remaining stellar parameters required as inputs for the TORUS radiative transfer models. The stellar luminosity, $L_{\star}$, was estimated from the $V$-band magnitude and extinction using $T_{\rm{eff}}$-dependent bolometric corrections taken from Table~5 of \citet{Pecaut13} and a value of $4.755\,$mag for the bolometric magnitude of the Sun \citep{Mamajek12}. The stellar mass, $M_{\star}$, was estimated by comparing $T_{\rm{eff}}$ and $L_{\star}$ to \citet{Siess00} pre-main-sequence evolutionary models with $Z=0.02$ (without convective overshooting). These values are also presented in Table~\ref{tab:starParam}. PS+R models were fit to the visibilities obtained with CLASSIC and CLIMB before repeating the process with the inclusion of the shorter baseline PIONIER ($H$-band) or KI ($K$-band) data. In each case, the $H$- and $K$-band data were fit separately. The stellar flux contribution remained fixed at the values in Table~\ref{tab:starParam}. The resulting best-fit parameters (and corresponding $\chi^{2}_{\rm{r}}$) for each model are displayed in Table~\ref{tab:psringHD}. The observed $H$- and $K$-band visibilities are compared to those of the best fit models (grey solid lines) in Figs.~\ref{fig:psringH} and \ref{fig:psringK}, respectively. The PS+R model suggests $i\sim53-61^{\circ}$ and PA$_{\rm{major}}\sim155-166^{\circ}$, depending on the data set. Inclusion of the shorter baseline data favours slightly lower inclinations in $K$-band and reduces the uncertainty range on our estimates of $i$ and PA$_{\rm{major}}$ across both wavebands. These values for $i$ and PA$_{\rm{major}}$ agree well with previous analyses of NIR and MIR interferometric data ($30<i<60^{\circ}$ and PA$_{\rm{major}}\sim170^{\circ}$ \citealt{Vural14, Lazareff16}) together with the recent VLT/NACO imaging of \citet{Garufi17} who found a preference for an inclined disk with PA$_{\rm{major}}$ along a North-South direction. \begin{deluxetable*}{lcclcr} \tabletypesize{\scriptsize} \tablecolumns{6} \tablecaption{Results from PS+R model fits to $H$- and $K$-band visibilities \label{tab:psringHD} } \tablehead{ \colhead{Dataset} & \colhead{$R$ (mas)} & \colhead{$i$ ($^\circ$)} & \colhead{P.A. ($^\circ$)} & \colhead{$F_{\star}$} & \colhead{$\chi^{2}_{\rm{r}}$} } \startdata \multicolumn{6}{c}{$H$-band} \\ \tableline CLIMB & $1.61\pm0.08$ & $57.1\pm5.1$ & $163\pm14$ & $0.61$ (fixed) & $21.97$ \\ & $1.61\pm0.11$ & $56.6\pm4.9$ & $166\pm18$ & $0.57\pm0.07$ & $19.84$ \\ CLIMB+PIONIER & $1.44\pm0.05$ & $55.5\pm2.1$ & $155\pm2$ & $0.61$ (fixed) & $11.41$\\ & $1.58\pm0.09$ & $57.1\pm1.7$ & $159\pm3$ & $0.64\pm0.03$ & $10.71$\\ \tableline \multicolumn{6}{c}{$K$-band} \\ \tableline CLIMB+CLASSIC & $1.29\pm0.06$ & $60.7\pm3.1$ & $157\pm3$ & $0.35$ (fixed) & $34.64$\\ & $1.46\pm0.06$ & $55.0\pm3.3$ & $156\pm4$ & $0.46\pm0.06$ & $21.03 $ \\ CLIMB+CLASSIC+KI & $1.28\pm0.04$ & $57.4\pm3.0$ & $162\pm4.2$ & $0.35$ (fixed) & $34.10$\\ & $1.50\pm0.07$ & $52.9\pm2.6$ & $164\pm5$ & $0.46\pm0.06$ & $19.98 $ \enddata \end{deluxetable*} \begin{deluxetable*}{lcccccr} \tabletypesize{\scriptsize} \tablecolumns{6} \tablecaption{Results from PS+SR model fits to $H$- and $K$-band visibilities \label{tab:pssmoothringHD} } \tablehead{ \colhead{Dataset} & \colhead{$R$ (mas)} & \colhead{$i$ ($^\circ$)} & \colhead{P.A. ($^\circ$)} & \colhead{FWHM (mas)} & \colhead{$\chi^{2}_{\rm{r}}$} } \startdata \multicolumn{6}{c}{$H$-band} \\ \tableline CLIMB & $1.78\pm0.09$ & $57.2\pm5.0$ & $165\pm14$ & $<2\times10^{-4}$ & $22.67$\\ CLIMB+PIONIER & $1.59\pm0.04$ & $56.7\pm1.9$ & $159\pm2$ & $0.60\pm0.09$ & $9.54$\\ \tableline \multicolumn{6}{c}{$K$-band} \\ \tableline CLIMB+CLASSIC & $1.51\pm0.08$ & $62.9\pm3.6$ & $153\pm3$ & $0.87\pm0.09$ & $14.24$\\ CLIMB+CLASSIC+KI & $1.50\pm0.08$ & $60.5\pm3.6$ & $159\pm3$ & $0.95\pm0.12$ & $14.36$\\ \enddata \end{deluxetable*} \begin{figure}[t] \centering \includegraphics[width=0.48\textwidth]{plt_psring_pssmoothring_allHav.pdf} \caption{PA$_{\rm{base}}$-separated $H$-band visibilities plotted against spatial frequency. Grey solid lines represent the best-fit PS+R (with fixed $F_{\star,H}$) model visibility curves for the CLIMB+PIONIER data set (see Table~\ref{tab:psringHD}). Grey dashed lines represent the best-fit PS+SR model visibility curves for the same data set (see Table~\ref{tab:pssmoothringHD}). Three model curves are plotted in each panel, corresponding to steps of $10^{\circ}$ in PA$_{\rm{base}}$. The range of PA$_{\rm{base}}$ included in each figure window is listed above each window. Data points are colored as in Fig.~\ref{fig:uvplane}.} \label{fig:psringH} \end{figure} \begin{figure}[t] \centering \includegraphics[width=0.48\textwidth]{plt_psring_pssmoothring_KI_and_allKav.pdf} \caption{As Fig.~\ref{fig:psringH} but for $K$-band. Grey solid lines represent the best-fit PS+R (with fixed $F_{\star,K}$) model visibility curves for the CLIMB+CLASSIC+KI data set (see Table~\ref{tab:psringHD}) while grey dashed lines correspond to those of the best-fit PS+SR model (see Table~\ref{tab:pssmoothringHD}).} \label{fig:psringK} \end{figure} According to the PS+R model-fitting results, the $H$ band-emitting region has an effective radius of $\sim1.44-1.61\,$mas ($\sim0.22-0.24\,$au at $150\,$pc). Assuming this region is associated with dust sublimation, we use the \citet{Whitney04} temperature-radius relation, \begin{equation} R_{\rm{sub}} = R_{\star}\left(\frac{T_{\rm{sub}}}{T_{\rm{eff}}}\right)^{-2.1}, \end{equation} to infer a sublimation temperature, $T_{\rm{sub}}\sim1750-1820\,$K. Typically quoted values of $T_{\rm{sub}}$ for silicate grains vary between $\sim1500-1800\,$K \citep{Pollack94}, indicating that the $H$-band emission is consistent with arising from the silicate dust sublimation rim. This value of $R$ is larger than the inferred value of $1.3\,$mas from \citet{Vural14} but we note that those authors also adopt a lower value of $F_{\star, H}$ ($0.53$). The degeneracy between the stellar flux contribution and characteristic size of the emitting region found through geometric modeling is well known (see \citealt{Lazareff16} for a discussion) and is likely responsible for these differences. Interestingly, at first glance, our PS+R model fitting suggests that the $K$-band emission from \object{HD\,142666} traces material \emph{interior} to the $H$-band-emitting region. This is counter-intuitive as longer wavelength emission traces cooler material. If stellar radiation is the dominant heating mechanism, the cooler, $K$-band emission should emerge from larger disk radii than the warmer, $H$-band emission. However, under closer inspection, this is more likely to be a result of the poorer fit provided by the PS+R model to the $K$-band visibilities compared to those at $H$-band wavelengths. We investigated alternative models in an attempt to improve the fit. Firstly, we relaxed the constraint on $F_{\star}$, allowing it to vary between $0$ and $1$ in the fitting process\footnote{The total emission remained at 1 so the circumstellar emission provided a flux contribution of $1-F_{\star}$.}. Secondly, we adopted PS+SR models with $F_{\star}$ fixed at the values in Table~\ref{tab:starParam}. The resulting best-fit values and $\chi^{2}_{\rm{r}}$ for these alternative models are presented in Tables~\ref{tab:psringHD} and \ref{tab:pssmoothringHD}, respectively. From Table~\ref{tab:psringHD}, we can see that the fit is improved in all cases when the constraints on $F_{\star}$ are lifted. For the $H$-band emission, the fitted $F_{\star}$ values are consistent with the values adopted in our prior fitting within their uncertainties: $0.57\pm0.07$ (CLIMB) and $0.65\pm0.04$ (CLIMB+PIONIER) compared with the value of $0.61$ found via SED fitting. For the $K$-band emission, both data sets reveal a preferred value of $0.46\pm0.06$ over the value of $0.35$ found via SED fitting. \object{HD\,142666} exhibits variability across optical and NIR wavelengths \citep{Meeus98, Zwintz09} and these discrepancies in $F_{\star}$ are consistent with the intrinsic $H$- and $K$-band variability of $0.14$ and $0.30\,$mags, respectively. At the same time, an increase (decrease) in $F_{\star}$ coincides with an increase (decrease) in $R$, highlighting the degeneracy that exists when fitting $R$ and $F_{\star}$ simultaneously. Without the constraints on $F_{\star}$, we see that the characteristic radius of the $H$- and $K$-band-emitting regions is consistent within the bootstrapped errors. A further reduction in $\chi^{2}_{\rm{r}}$ is provided by the PS+SR models (dashed grey lines in Fig.~\ref{fig:psringH} and \ref{fig:psringK}). The PS+R model prescribes the NIR-emitting region as a central star with circumstellar emission provided by a vertical disk rim. In comparison, the circumstellar component of the PS+SR model emulates a more rounded rim in which the emitting region is more spatially extended. The better fit provided by the PS+SR model over the PS+R model suggests that the inner rim of the disk of \object{HD\,142666} is not well-approximated by a vertical wall. This is consistent with previous studies of other Herbig Ae/Be stars (e.g.\ \citealt{Tannirkulam07, Kraus09, McClure13}). As with the PS+R models, we see that the characteristic radius of the $H$ band-emitting region found via the PS+SR model fitting is consistently larger than that of the $K$-band emission though the two are roughly consistent within their estimated uncertainties: $1.59\pm0.04\,$mas (CLIMB+PIONIER; $H$-band) compared with $1.50\pm0.08\,$mas (CLIMB+CLASSIC+KI; $K$-band). Furthermore, the FWHM of the Gaussian component used to convolve the ring in these models is larger in $K$-band than in $H$-band, suggesting that the $K$-band emission may originate over a broader range of disk annuli. \begin{figure} \centering \includegraphics[width=0.47\textwidth]{vis2_effBase_Hband.pdf} \includegraphics[width=0.47\textwidth]{vis2_effBase_Kband.pdf} \caption{ Distribution of $H$- (top) and $K$-band (bottom) squared visibilities with respect to the effective spatial frequency, computed using $i=58^{\circ}$ and PA$_{\rm{major}}=160^{\circ}$. Data points are colored as in Fig.~\ref{fig:uvplane}. } \label{fig:effbase} \end{figure} \section{Results from TORUS radiative transfer modeling}\label{sec:RTresults} In light of our geometric modeling results, we adopted $i=58^{\circ}$ and PA$_{\rm{major}}=160^{\circ}$ throughout our TORUS modeling for computation of model SEDs and images. Fig.~\ref{fig:effbase} shows the distribution of squared visibilities ($V^{2}$) as a function of effective spatial frequency which accounts for the change in resolution across the uv-plane due to this inferred viewing geometry. With inclination effects accounted for, the vertical scatter in $V^{2}$ at each effective spatial frequency is assumed to arise due to the combined effects of calibration uncertainties and temporal variability (see Section~\ref{sec:disc:geom}). When extracting $\phi_{\rm{CP}}$ from the TORUS model images, we orient the disk such that its north-eastern portion is the far side (and, thus, the brighter side) of the disk. This is based on the asymmetric brightness distribution seen in the VLT/NACO polarimetry \citep{Garufi17}. \subsection{Models imposing vertical hydrostatic equilibrium}\label{sec:hydroresults} \begin{figure} \centering \includegraphics[width=0.47\textwidth]{sed_hydromodels.pdf} \caption{ SEDs for our TORUS models with vertical hydrostatic equilibrium enforced. Photometric data are shown as black points while the \emph{Spitzer} spectrum is represented by a solid blue line. Grey lines correspond to the reddened TORUS model SEDs computed at $i=58^{\circ}$ (solid line: S:small; dashed line: S:large; dot-dashed line: THM07). } \label{fig:hydroSEDs} \end{figure} \begin{deluxetable}{lcccc} \tabletypesize{\scriptsize} \tablecolumns{5} \tablecaption{Converged structure of TORUS models computed at disk inclinations of $58^{\circ}$ with vertical hydrostatic equilibrium imposed and their respective stellar contribution to the total model $H$- and $K$-band fluxes \label{tab:hydro} } \tablehead{\colhead{Model} & \colhead{$h_{\rm{0,gas}}$ (au)} & \colhead{$\beta$} & \colhead{$F_{\star,H}$} & \colhead{$F_{\star,K}$}} \startdata S:small & $4.6$ & $1.14$ & $0.85$ & $0.68$ \\ S:large & $5.0$ & $1.17$ & $0.67$ & $0.50$ \\ THM07 & $4.7$ & $1.18$ & $0.75$ & $0.62$ \enddata \end{deluxetable} We first computed S:small, S:large and THM07 models with vertical hydrostatic equilibrium established. In each case, the disk temperature and density structure converged after three iterations. We used equation~(\ref{eq:scaleheight}) to determine an approximate value of $\beta$ for the converged disk structure and present these alongside the values of $h_{\rm{0,gas}}$, $F_{\star,H}$, and $F_{\star,K}$ in Table~\ref{tab:hydro}. The SEDs computed for each model were reddened and are compared to the observed SED in Fig.~\ref{fig:hydroSEDs}. A relative dearth of NIR flux up to $\sim3\,\mu$m combined with a relative excess of flux over $\sim3-10\,\mu$m is provided by the S:small model (solid grey line) compared with the S:large and THM07 models (dashed and dot-dashed lines, respectively). Interestingly, the models including larger grains produce noticeably different SED shapes across NIR wavelengths: although the flux across $H$- and $K$-bands is underestimated in both cases, the S:large model produces NIR flux levels closest to those observed. These differences arise due to differences in the size of the disk area which directly intercepts stellar radiation in the innermost disk regions. The inclusion of larger grains extends the inner edge of the disk to smaller radii, as already discussed in, for example, \citet{Monnier02, Isella05, Tannirkulam07, Kama09} and \citet{McClure13}. The rim curvature provided by the THM07 model is also shallower and more extended than the S:large model. As such, if we consider the surface layers of the disk behind the sublimation rim, the directly illuminated disk area between disk annuli, $r$, and $r+\delta r$ will be smaller in the THM07 model than in the S:large model. As more optically thick disk material exists at hotter temperatures, this produces a larger NIR flux-emitting disk area. In all three cases, our assumption that all the circumstellar NIR emission arises from a disk in vertical hydrostatic equilibrium leads to a poor SED fit. To better reproduce the observed SED, our models require more NIR-emission at the expense of FIR-emission. This discrepancy has previously been seen in both radiation hydrodynamic and radiation hydrostatic model fits to the SEDs of other Herbig AeBe stars \citep{Mulders12, Flock16a}. Turbulence associated with, for example, magneto-rotational instability (MRI) \citep{Turner14, Flock16} and/or the presence of magnetospheric or photo-evaporative disk winds \citep{Alexander07, Bans12} could contribute to lifting optically thick material above the disk scale heights predicted by our hydrostatic models. In addition, the presence of any optically thick gaseous material existing interior to the dust sublimation rim \citep{Tannirkulam08a, Tannirkulam08b} would affect the temperature structure of the dusty disk. As our CHARA interferometry does not reveal a bounce in the visibilities (Fig.~\ref{fig:effbase}), we are unable to comment on whether optically thick material interior to the sublimation rim contributes to the NIR flux. The extension of current optical interferometry facilities such as the CHARA Array to longer operational baselines and/or the construction of longer baseline optical interferometers equipped with NIR detectors (e.g.\ Planet Formation Imager; \citealt{Kraus14}) are essential for investigating whether NIR continuum emission also arises interior to the silicate sublimation rim in disks of later type Herbig Ae stars and their low-mass counterparts, the T~Tauri stars. The introduction of a dusty disk wind is also beyond the scope of this paper and we defer this to future study. Instead, in the subsections that follow, we focus on whether turbulence-induced scale height inflation is able to simultaneously fit the observed SED and interferometry of HD~142666. \begin{figure*} \centering \includegraphics[width=0.47\textwidth]{IN05Rim01m_sed_comparison.pdf} \includegraphics[width=0.47\textwidth]{cpmaxsf_hdIN05Rim01mh10b106.pdf} \includegraphics[width=0.47\textwidth]{vissf_IN05Rim01mh10b106i58pa160_H.pdf} \includegraphics[width=0.47\textwidth]{vissf_IN05Rim01mh10b106i58pa160_K.pdf} \caption{ Summary plots for S:small model providing the best fit to the observed SED across the NIR ($h_{0}=7\,$au, $\beta=1.09$). Top left: As Fig.~\ref{fig:hydroSEDs} but comparing this best-fit model (solid grey line) to the S:small model with $h_{0}=10\,$au and $\beta=1.06$ (dashed grey line). Top middle and top right: $H$- and $K$-band $\phi_{\rm{CP}}$ (top) and the residuals (bottom), respectively. Both are displayed as a function of the maximum spatial frequency probed by the closed triangle of baseline vectors. Bottom rows: visibilities as a function of spatial frequency, separated by PA$_{\rm{base}}$. As in Fig.~\ref{fig:psringH}, three model visibility curves are plotted in each panel corresponding to $10^{\circ}$ steps in PA$_{\rm{base}}$. The nine panels on the left-hand side correspond to the $H$-band data while those on the right are for the $K$-band. Data in the visibility and $\phi_{\rm{CP}}$ plots are colored as in Fig.~\ref{fig:uvplane}. } \label{fig:IN05small} \end{figure*} To artificially emulate scale height inflation in the inner disk, we computed a series of grids of TORUS models without establishing vertical hydrostatic equilibrium. Each model grid was computed at a range of gas disk scale heights ($h_{0,\rm{gas}}=6, 7, 8, 9, 10, 11\,$au) and flaring parameters ($\beta=1.05, 1.06, 1.07, 1.08, 1.09, 1.10$) while the stellar parameters, disk mass and outer disk radius each remained fixed (see Table~\ref{tab:starParam}). \subsection{Small grain models} Over the range of $h_{\rm{0,gas}}$ and $\beta$ probed, none of our S:small models were able to reproduce the observed SED across the full wavelength range. In the top left panel of Fig.~\ref{fig:IN05small}, the SED of \object{HD\,142666} is compared to the reddened SEDs of the two best-fitting S:small models. The S:small model with $h_{\rm{0,gas}}=7\,$au and $\beta=1.09$ (dashed grey line) provides the best fit to the SED over the full wavelength range but clearly provides insufficient NIR flux. To fit the NIR portion of the SED, a greater scale height was required: the $h_{0}=10\,$au and $\beta=1.06$ model (solid grey line) provides the best fit across this wavelength range while still reproducing the SED longward of $\sim100\,\mu$m. However, this latter model clearly overestimates the MIR to FIR flux. \begin{figure*} \centering \includegraphics[width=0.47\textwidth]{sed_IN05Rim12mh7b109.pdf} \includegraphics[width=0.47\textwidth]{cpmaxsf_hdIN05Rim12mh7b109ro60.pdf} \includegraphics[width=0.47\textwidth]{vissf_IN05Rim12h7b109_H.pdf} \includegraphics[width=0.47\textwidth]{vissf_IN05Rim12h7b109_K.pdf} \caption{ As Fig.~\ref{fig:IN05small} but for the S:large model providing the best fit to the observed SED ($h_{\rm{0,gas}}=7\,$au and $\beta=1.09$). } \label{fig:IN05large} \end{figure*} As the NIR flux is well-approximated by the S:small model with $h_{0}=10\,$au and $\beta=1.06$, we examined the visibilities and $\phi_{\rm{CP}}$ for this model to inspect the rim position and shape. These are displayed in the remaining panels of Fig.~\ref{fig:IN05small}. Here, as in Figs.~\ref{fig:psringH} and \ref{fig:psringK}, the different panels show visibilities measured along different baseline position angles, PA$_{\rm{base}}$. In addition to providing too much flux across MIR-to-FIR wavelengths, we see in the bottom panels of Fig.~\ref{fig:IN05small} that the first lobe of the model visibility curves drop more rapidly at short baselines than measured by the data. As such, optically thick material is required to exist interior to the silicate dust sublimation rim location predicted by S:small models. This is consistent with results from analyses of NIR size-luminosity relations for Herbig Ae stars in which the size of the NIR-emitting region is controlled by the sublimation of larger grains ($\sim1\,\mu$m in size; e.g. \citealt{Monnier02}). \subsection{Models invoking grain growth}\label{sec:largegrains} \begin{figure*} \centering \includegraphics[width=0.47\textwidth]{sed_hdTHM07Rim91rh8b109T1400.pdf} \includegraphics[width=0.47\textwidth]{cpmaxsf_hdTHM07Rim91rh8b109T1400.pdf} \includegraphics[width=0.47\textwidth]{vissf_hdTHM07Rim91rh8b109T1400_H.pdf} \includegraphics[width=0.47\textwidth]{vissf_hdTHM07Rim91rh8b109T1400_K.pdf} \caption{ As Fig.~\ref{fig:IN05small} but for the THM07 model providing the best fit to the observed SED across NIR wavelengths ($h_{\rm{0,gas}}=8\,$au and $\beta=1.09$) . } \label{fig:THM07} \end{figure*} Figs.~\ref{fig:IN05large} and \ref{fig:THM07} show the SED, visibilities and $\phi_{\rm{CP}}$ of the best-fitting S:large and THM07 models, respectively. The $\chi^{2}_{\rm{r}}$ fits to the SED ($\chi^{2}_{\rm{r,SED}}$), visibilities ($\chi^{2}_{\rm{r,vis}}$), and $\phi_{\rm{CP}}$ ($\chi^{2}_{\rm{r,CP}}$) are presented in Table~\ref{tab:chisq}. Models invoking grain growth to micron sizes clearly provide an improved fit to the SED and visibilities compared to the S:small models we explored. The best-fitting S:large and THM07 models are both able to provide a reasonable estimate of the fluxes in the SED across the full range of wavelengths probed. Though the SEDs provided by the S:large and THM07 models in Figs.~\ref{fig:IN05large} and \ref{fig:THM07} are broadly consistent with one another, the S:large model is able to reproduce the general shape of the \emph{Spitzer} spectrum out to $\sim12\,\mu$m better than the THM07 model. \begin{deluxetable}{lccrrr} \tabletypesize{\scriptsize} \tablecolumns{6} \tablecaption{Parameters of the best-fitting TORUS models without vertical hydrostatic equilibrium imposed (adopting $i=58^{\circ}$ and PA$_{\rm{major}}=160^{\circ}$) and their $\chi^{2}_{\rm{r}}$ fits to the SED, visibilities, and closure phases ($362$, $337$, and $153$ degrees of freedom, respectively) \label{tab:chisq} } \tablehead{\colhead{Model} & \colhead{$h_{\rm{0,gas}}$} & \colhead{$\beta$} & \colhead{$\chi^{2}_{\rm{r,SED}}$} & \colhead{$\chi^{2}_{\rm{r,vis}}$} & \colhead{$\chi^{2}_{\rm{r,CP}}$} } \startdata S:small & 10 & 1.06 & $109554$ & $74.3$ & $9.3$ \\ S:large & 7 & 1.09 & $1086$ & $14.4$ & $16.3$ \\ THM07 & 8 & 1.09 & $2029$ & $22.1$ & $18.2$ \enddata \end{deluxetable} The scale height and flaring parameters of the best-fitting models are broadly consistent: $h_{\rm{0,gas}}=7\,$au and $\beta=1.09$ for S:large versus $h_{\rm{0,gas}}=8\,$au and $\beta=1.09$ for THM07. The S:small model which provided the best fit across the full wavelength range probed by the observed SED (while underestimating the NIR flux; see dashed grey line in the top left panel of Fig.~\ref{fig:IN05small}) also had $h_{\rm{0,gas}}=7\,$au and $\beta=1.09$. The differences in the scale heights required for the different models to produce the same NIR flux is consistent with what we saw for the models invoking vertical hydrostatic equilibrium (Section~\ref{sec:hydroresults}) whereby the different rim curvature prescriptions give rise to inner rims with varying radial extents. This is shown more clearly in Fig.~\ref{fig:images}: the rim produced by the S:small model is located further from the star than that of the S:large and THM07 models. The curvature of the rim produced by the THM07 model is also sharper than that produced by the S:large model. As a result, the NIR flux arises from a smaller range of disk radii than the S:large model. The best-fitting S:large and THM07 models provide similarly good fits to the observed $H$- and $K$-band visibilities with the S:large model providing a marginally better fit to the observed visibilities than the THM07 model (see Table~\ref{tab:chisq}). The first lobe of the model visibility curves is in good agreement with the data across most PA$_{\rm{base}}$, suggesting that the location of the inner disk rim of \object{HD\,142666} is consistent with the silicate sublimation region predicted by the models invoking grain growth to micron sizes. In Fig.~\ref{fig:images}, we see that the THM07 models predict a rim location which is slightly more extended than the S:large models while the S:large model is able to provide more flux in the south-west portion of the disk. Upon closer inspection, the visibilities and $\phi_{\rm{CP}}$ in Figs.~\ref{fig:IN05large} and \ref{fig:THM07} indicate additional complexity to the circumstellar component of the NIR emission which remains unexplained in our suite of models. In the visibility plots, the models appear under-resolved compared to the data along the apparent disk minor axis ($60-80^{\circ}$ PA$_{\rm{base}}$ panels) while the often significant ($\sim50-100^{\circ}$) $\phi_{\rm{CP}}$ signals predicted by the models are not present in the data. These discrepancies indicate the presence of additional material along the disk minor axis interior to the sky-projected location of the dust sublimation rim predicted by our models as well as a more centro-symmetric brightness distribution. We discuss this further in Section~\ref{sec:disc:geom}. \begin{figure*} \centering \includegraphics[width=0.40\textwidth]{temp_profile_au_axes0000.pdf} \includegraphics[width=0.29\textwidth]{imageH_inc58_hdIN05Rim01mh10b106.pdf} \includegraphics[width=0.29\textwidth]{imageK_inc58_hdIN05Rim01mh10b106.pdf}\\ \includegraphics[width=0.40\textwidth]{temp_profile_au_axes0001.pdf} \includegraphics[width=0.29\textwidth]{H_hdIN05Rim12mh7b109_inc58.pdf} \includegraphics[width=0.29\textwidth]{K_hdIN05Rim12mh7b109_inc58.pdf}\\ \includegraphics[width=0.40\textwidth]{temp_profile_au_axes0002.pdf} \includegraphics[width=0.29\textwidth]{hdTHM07Rim91rh8b109T1400inc58_H.pdf} \includegraphics[width=0.29\textwidth]{hdTHM07Rim91rh8b109T1400inc58_K.pdf} \caption{ Cross-section of the disk temperature profile (in Kelvin; left hand panel) and model $H$- and $K$-band images (middle and right hand panels, respectively) output by TORUS for the S:small model with $h_{\rm{0,gas}}=10\,$au and $\beta=1.06$ (top row), the S:large model with $h_{\rm{0,gas}}=7\,$au and $\beta=1.09$ (middle row), and the THM07 model with $h_{\rm{0,gas}}=8\,$au and $\beta=1.09$ (bottom row). } \label{fig:images} \end{figure*} \section{Discussion}\label{sec:discussion} \subsection{Grain growth in the disk of HD\,142666 and the inner rim location} The results presented in Section~\ref{sec:RTresults} indicate that models in which the inner disk rim is dominated by small ($0.1\,\mu$m) grains are incompatible with the SED and NIR interferometry obtained for \object{HD\,142666}. Instead, models invoking the growth of dust grains to micron sizes provide improved fits to the observations. These results support those of \citet{vanBoekel03} who, in their analysis of the shape and strength of the silicate feature in the \emph{Spitzer} spectrum of \object{HD\,142666}, found strong evidence for growth from $0.1\,\mu$m to $2.0\,\mu$m grains with a mass ratio of 1:1.54 in favour of large grains. As MIR emission arises from the disk surface layers, and larger grains are expected to settle to lower scale heights in the disk \citep{Testi14}, the dominance of micron-sized grains in the disk midplane was anticipated to be even more pronounced. Our results support this idea as the models invoking the presence of larger, micron-sized grains (S:large model with $h_{\rm{0,gas}}=7\,$au and $\beta=1.09$ and THM07 mode with $h_{\rm{0,gas}}=8\,$au and $\beta=1.09$) are able to simultaneously reproduce the NIR portion of the SED, the shape and flux of the \emph{Spitzer} spectrum, and the observed $H$- and $K$-band visibilities. The lower $\chi^{2}_{\rm{r,vis}}$ provided by the S:large model fit to the visibilities compared to the THM07 model (see Table~\ref{tab:chisq}) further suggests that the inner disk rim of \object{HD\,142666} is more consistent with models invoking a gas density-dependent dust sublimation temperature \citep[e.g.][]{Isella05} than those invoking constant dust sublimation temperatures where rim curvature arises due to the relative abundance of different grain sizes (in $r$ and $z$) and their relative cooling efficiencies \citep[e.g.][]{Tannirkulam07}. However, it should be noted that using (i) grains $<1.2\,\mu$m as the larger grains, (ii) a different size for the smaller grains, (iii) a different value for $h_{\rm{0,dust}}$ for the larger grains, and/or (iv) a different silicate sublimation temperature (see Table~\ref{tab:RTmodels}) would all affect the rim shape, location and temperature structure predicted by the THM07 models. The parameters we adopted in our THM07 models were chosen for their consistency with the original \citet{Tannirkulam07} study and a comprehensive evaluation of the impact of these variables is beyond the scope of this paper. However, our use of $1.2\,\mu$m-sized grains as the ``large'' grains should produce inner rim locations close to the lower limit allowed by the \citet{Tannirkulam07} and \citep{Isella05} models. This is because silicate grains larger than $\sim1.3\,\mu$m do not significantly contribute to the dust opacity and thus their inclusion would not make the rim any more compact \citep{Isella05}. Of the parameters explored herein, our best model (the S:large model with $h_{\rm{0,gas}}=7\,$au and $\beta=1.09$) produces a sublimation rim that remains optically thick down to within $0.17\,$au of the star (in the disk midplane). This is broadly consistent with the results of our geometric fitting (Section~\ref{sec:geoFitResults}) in which the characteristic radii of the $H$- and $K$-band-emitting regions were found to be $\sim0.22-0.24\,$au in both the PS+R and PS+SR fits. These inner radii are lower than previously published estimates by \citet{Monnier05} and \citet{Schegerer13} based on short-baseline NIR and MIR visibilities ($\sim0.38-0.39\,$au, accounting for differences in the adopted distance to \object{HD\,142666}) but consistent with those in \citet[][$0.19-0.23\,$au]{Vural14}. However, we note that the adopted stellar parameters (including the stellar flux contribution) are not consistent across these studies nor between these studies and our own. As discussed in \citet{Lazareff16}, the characteristic size of the emitting region and the circumstellar flux contribution are intrinsically linked in the visibility so it is understandable that differences in one parameter will lead to differences in the other when comparing studies. \subsection{Indicators of additional complexity in the NIR-emitting region}\label{sec:disc:geom} Throughout our radiative transfer analysis (Section~\ref{sec:RTresults}), we first required our TORUS models to reproduce the observed SED before assessing the fit to the interferometry. In this way, we assume that the disk in our TORUS models accounts for all the NIR circumstellar flux. If additional NIR-emitting gaseous material exists interior to the sublimation rim \citep{Tannirkulam08a, Tannirkulam08b} and/or a dusty outflow exists \citep{Alexander07, Bans12} -- neither of which are accounted for in our models -- they will also contribute to the observed $H$- and $K$-band flux. Additionally, in our geometric modeling (Section~\ref{sec:geoFitResults}), we assumed all the circumstellar NIR flux could be fit using a Gaussian-smoothed ring model and, from this, estimated a disk major axis position angle and inclination of $160^{\circ}$ and $58^{\circ}$, respectively. While this viewing geometry agrees with previous assessments of the disk inclination ($40-60^{\circ}$ \citealt{Dominik03}, \citealt{Vural14}, \citealt{Lazareff16}, \citealt{Rubinstein18}) and position angle ($\sim140-180^{\circ}$ \citealt{Garufi17}, \citealt{Rubinstein18}), indirect evidence for further model complexity is suggested in the visibility and $\phi_{\rm{CP}}$ residuals. As stated in Section~\ref{sec:largegrains}, while the models invoking grain growth to micron sizes provide a good fit to the visibilities across a wide range of PA$_{\rm{base}}$, the model visibility curves appear under-resolved compared to the data along the apparent disk minor axis. In addition, the significant ($\sim50-100^{\circ}$) $\phi_{\rm{CP}}$ signals predicted by our best-fitting TORUS models are not present in the data, indicating the true brightness distribution is more centro-symmetric. \begin{figure} \centering \includegraphics[width=0.47\textwidth]{twoD_chisqmap_3_new.pdf} \caption{ $\chi^{2}_{\rm{r}}$ map showing the comparative goodness-of-fit provided by the S:large model with $h_{\rm{0,gas}}=7\,$au and $\beta=1.09$ to the $H$- and $K$-band visibilities using disk inclinations, $52^{\circ}\leq i\leq 64^{\circ}$, and position angles, $140^{\circ}\leq$PA$_{\rm{major}}\leq 180^{\circ}$. } \label{fig:pa_inc} \end{figure} Further indirect evidence of additional model complexity is found when considering the UX~Ori-type phenomena displayed by \object{HD~142666} \citep{Meeus98, Zwintz09}. This type of variability is associated with line-of-sight fluctuations in opacity and is typically attributed to circumstellar disk occultation \citep{Grinin91, Natta97} although unsteady accretion \citep{Herbst99} and/or the existence of dusty outflows \citep{Vinkovic07, Tambovtseva08} have been proposed as alternative causes. As the disk- and outflow-based origins require intermediate-to-high disk inclinations for line-of-sight occultations to arise, and the inferred disk inclination of $58^{\circ}$ for \object{HD~142666} is relatively low compared to the $\sim70^{\circ}$ inferred for other UX~Ori stars (VV~Ser, KK~Oph, and UX~Ori itself; \citealt{Pontoppidan07, Kreplin13, Kreplin16}), the photometric variability observed for HD~142666 may suggest that the disk is more inclined. Alternatively, the UX~Ori variability may indicate that azimuthal and temporal variations in disk scale height exist. To investigate whether the residuals in the interferometry fits could be reconciled solely by changing the disk viewing geometry, we explored whether a better fit to the visibilities could be achieved if our best-fit S:large TORUS model ($h_{\rm{0,gas}}=7\,$au and $\beta=1.09$) was observed at differing viewing geometries: $52^{\circ}\leq i\leq 64^{\circ}$ and $140^{\circ}\leq$\,\,PA$_{\rm{major}}\leq180^{\circ}$. The resulting $\chi^{2}_{\rm{r}}$ map is shown in Fig.~\ref{fig:pa_inc}. At the original viewing geometry (PA$_{\rm{major}}=160^{\circ}$ and $i=58^{\circ}$), the model provides $\chi^{2}_{\rm{r}}=14.4$. Over the range of inclinations and position angles probed, the model with $i=58^{\circ}$ and PA$_{\rm{major}}=155^{\circ}$ provides the best fit to the visibilities but the improvement in $\chi^{2}_{\rm{r}}$ is small: $\chi^{2}_{\rm{r,min}}=13.9$. This revised disk viewing geometry unsurprisingly still produces model visibilities which are under-resolved along the apparent disk minor axis and model $\phi_{\rm{CP}}$ signals in excess of those observed. As such, the residuals in our TORUS model fitting cannot be explained simply be changing the viewing geometry and instead point to additional model complexity. The disk models we have explored with TORUS assume azimuthal symmetry: we have not accounted for the possible presence of azimuthal variations of the disk scale height (i.e. disk warps). The disk of \object{HD\,142666} is not strongly flared (Section~\ref{sec:RTresults}; c.f.\ \citealt{Meeus01}) and, as such, disk regions at large distances from the star are unlikely to provide line-of-sight stellar occultations when observed at an inclination of $58^{\circ}$ (see Fig.~\ref{fig:images}). Assuming that optically thick material only exists exterior to the dust rim location predicted by the best-fit S:large TORUS model, a disk inclination of $58^{\circ}$ requires azimuthal scale height increases of around $40\%$ in the inner disk for direct line-of-sight occultation. The periods of minimum brightness observed for \object{HD\,142666} last for a maximum of $\sim2-3\,$days \citep{Zwintz09}. Comparing this to the orbital timescale at the inner disk rim ($18.2\,$days), these scale height variations would be required to extend over a maximum of $\sim10-15\%$ of the disk circumference. Furthermore, as the photometric variability is aperiodic, the scale height variations would have to rise and fall on timescales within the $\sim18.2\,$days orbital period. Taking this all into account, the $58^{\circ}$ disk inclination inferred for \object{HD~142666} appears inconsistent with a disk-based origin for the UX~Ori phenomena. In light of this, and the fact that the visibilities of the best-fit S:large TORUS model appear under-resolved along baseline position angles that probe the disk minor axis, it seems likely that either the disk is inclined at $>58^{\circ}$ or that the UX~Ori phenomena observed for HD~142666 is attributed to an outflow component of variable optical depth which is oriented perpendicular to the disk midplane. In both cases, additional NIR emitting material exterior to the flared disk we have considered here is required. \section{Summary}\label{sec:conclusion} We have used geometric and radiative transfer modeling to explore the shape and structure of the inner rim of the disk of \object{HD\,142666}. Our results are summarized as follows: \begin{itemize} \item Fitting geometric models in which all the circumstellar emission arises from the innermost regions of a disk to the $H$- and $K$-band visibilities suggest a viewing geometry for HD~142666 of $i=58^{\circ}$ from face-on and major axis position angle of $160^{\circ}$ east of north. These values agree with previous interferometric modeling \citep{Vural14, Lazareff16}, VLT/NACO imaging \citep{Garufi17}, and ALMA cycle 2 observations \citep{Rubinstein18} of the object. This viewing geometry was adopted in all our TORUS radiative transfer modeling. \item The TORUS radiative transfer models we explore which invoke vertical hydrostatic equilibrium in the circumstellar disk are unable to reproduce the SED of \object{HD\,142666}. This is consistent with previous results from radiation hydrodynamic and radiation hydrostatic modeling by \citet{Mulders12} and \citet{Flock16a} for other Herbig~Ae/Be stars. Using a series of TORUS models without vertical hydrostatic equilibrium invoked, we further investigated whether the inflation of the inner disk to greater scale heights, induced by turbulence arising from MRI \citep{Turner14, Flock16}, for example, could reproduce the observed SED. Among the models we explored, we found that those in which small grains ($0.1\,\mu$m in size) are the largest grains in the inner disk rim and thus determine the rim location and shape are unable to simultaneously fit the NIR, MIR and FIR portions of the SED. Instead, we found that our models required the presence of silicate dust of at least micrometer size to be present in the disk rim to be able to reproduce the SED across the full optical-to-millimeter wavelength range. \item TORUS models invoking the existence of micron grains were also found to provide an improved fit to the NIR visibilities compared to the models including only small grains. This is consistent with the original study of the grain size-dependence of the silicate dust destruction radius around Herbig Ae/Be stars by \citet{Monnier02}. Furthermore, we found that models in which rim curvature arises due to the dependence of the dust sublimation temperature on the local gas density \citep{Isella05} provide improved fits to the visibilities ($\chi^{2}_{\rm{r,vis}}=14.4$) compared to those in which the rim curvature arises from grain growth induced settling (the THM07 models; \citealt{Tannirkulam07}, $\chi^{2}_{\rm{r,vis}}=22.1$). In particular, the model providing the best fit to the SED and visibilities is the S:large model with disk scale height, $h_{\rm{0,gas}}=7\,$au and flaring parameter, $\beta=1.09$. A slight improvement to the fit for the S:large model is found using a viewing geometry of $i=58^{\circ}$ and PA$_{\rm{major}}=155^{\circ}$ ($\chi^{2}_{\rm{r}}=13.94$ assuming $337$ degrees of freedom). \item The visibility and closure phase residuals in the best-fit S:large TORUS model point to the presence of additional complexity to the NIR emitting region which is unaccounted for in our TORUS models. The model closure phase signals are overestimated, indicating the emission is more centro-symmetric while the model visibilities are under-resolved along position angles tracing the apparent disk minor axis. In addition, we argue that the inclination we infer for HD~142666 is inconsistent with a disk-based origin for its UX~Ori-type variability. This is further indication for the requirement of additional model complexity. Additional optically thick material present in dusty disk winds \citep{Alexander07, Bans12} and/or the gaseous disk material interior to the dust sublimation rim \citep{Tannirkulam08a, Tannirkulam08b}, for example, appear to be required. \end{itemize} \acknowledgments C.L.D., S.K., A.K. and A.L. acknowledge support from the ERC Starting Grant ``ImagePlanetFormDiscs'' (Grant Agreement No. 639889), STFC Rutherford fellowship/grant (ST/J004030/1, ST/K003445/1) and Philip Leverhulme Prize (PLP-2013-110). J.D.M., F.B., and B.K. acknowledge support from NSF grants AST-1210972 and AST-1506540. We would like to thank Bernard Lazareff, Jean-Baptiste Le Bouquin and Rachel Akeson for their assistance in acquiring archival data for \object{HD\,142666}. This work is based upon observations obtained with the Georgia State University Center for High Angular Resolution Astronomy Array at Mount Wilson Observatory. The CHARA Array is supported by the National Science Foundation under Grant No.\ AST-1211929. Institutional support has been provided from the GSU College of Arts and Sciences and the GSU Office of the Vice President for Research and Economic Development. The calculations for this paper were performed on the University of Exeter Supercomputer, a DiRAC Facility jointly funded by STFC, the Large Facilities Capital Fund of BIS, and the University of Exeter. This research has made use of: the NASA/IPAC Infrared Science Archive, which is operated by the Jet Propulsion Laboratory, California Institute of Technology, under contract with the National Aeronautics and Space Administration; the Keck Observatory Archive (KOA), which is operated by the W. M. Keck Observatory and the NASA Exoplanet Science Institute (NExScI), under contract with the National Aeronautics and Space Administration; the Jean-Marie Mariotti Center \texttt{OiDB} service\footnote{Available at http://oidb.jmmc.fr }; NASA's Astrophysics Data System; the VizieR catalogue access tool, CDS, Strasbourg, France; the SIMBAD database, operated at CDS, Strasbourg, France; NumPy \citep{van2011numpy}; matplotlib, a Python library for publication quality graphics \citep{Hunter07}; Astropy, a community-developed core Python package for Astronomy \citep{astropy}; the Jean-Marie Mariotti Center \texttt{SearchCal} service\footnote{Available at http://www.jmmc.fr/searchcal} co-developped by LAGRANGE and IPAG, and of CDS Astronomical Databases SIMBAD and VIZIER \footnote{Available at http://cdsweb.u-strasbg.fr/}. This work has made use of services produced by the NASA Exoplanet Science Institute at the California Institute of Technology. \facility{VLTI, CHARA, Keck}. \software{TORUS \citep{Harries00,Harries04,Kurosawa06,Tannirkulam07}, pysynphot \citep{pysynphot}, NumPy \citep{van2011numpy}, matplotlib \citep{Hunter07}, Astropy \citep{astropy}}
\section{Introduction} This paper focuses on improving the AO PSF characterisation in a wide-field by retrieving the distribution of atmospheric turbulence along altitude it depends on, referred as the $C_n^2(h)$ profile. We consider Single Conjugate Adaptive Optics (SCAO) system-assisted observations; \textcolor{black}{the correction provided by AO is optimal in the Guide star~(GS) direction, that can be either natural~(NGS) or artificial using laser~(LGS)}, but degrades across the field on account of the anisoplanatism effect~\cite{Fried1982}. This \textcolor{black}{latter} results from the spatial decorrelation of the incoming electric field phase that propagates through the atmosphere. The way this decorrelation occurs is a direct function of the $C_n^2(h)$ and outer scale profiles. As a consequence, anisoplanatism broaden the PSF and induces a spatial variation of the PSF morphology across the field.\\ However, the PSF model is one of the key limitations in the current exploitation of images of crowded-field stellar populations~\cite{Fritz2010,Yelda2010,Shodel2010} that are affected by anisoplanatism. To strengthen the data-processing outcome, we propose to improve the anisoplanatism characterisation. We have established a complete and general anisoplanatism model in~\cite{BeltramoMartin2018} as a function of the input $C_n^2(h)$ profile. This information is not accessible from the AO telemetry for SCAO systems, though. Dedicated instruments exist to monitor this profile~\cite{Osborn2015,Butterley2006,Wilson2002}, but they aim at characterising the observation site in terms of atmosphere quality and do not observe in the telescope line of sight. Consequently, their estimated profile deviate up to at least 10~\%~\cite{Ono2017}, from AO telemetry-based approaches available for multi-GS AO systems~\cite{Helin2018,Guesalaga2017,Laidlaw2016,Martin2016L3S,Neichel2014}. \textcolor{black}{However, according to \cite{BeltramoMartin2018}, 10\% of error on the $C_n^2(h)$ estimation may degrade the photometry and astrometry determination up to respectively 3\% and 300 $\mu$as in a 20"-FOV, while we are seeking to reach better than 1\% and 150 $\mu$as.} \\ We propose in this paper to rely on the SCAO-compensated PSFs available across the field. \textcolor{black}{We focus on SCAO systems that do not permit to identify the $C_n^2(h)$ from the telemetry and would benefit to have an internal images-based facility to retrieve the profile, either for post-processing or real-time application. The methodology we present can be extended to multi-GS systems, but at the cost of a larger numerical complexity to include the AO system control specificity, such as the tomographic reconstruction step or the optimal fitting in multi-conjugated AO. Before considering such systems, we will address the ground-layer AO case and compare our present approach to telemetry-based $C_n^2(h)$ estimation.}\\ Spatial variations of the AO PSF encodes the real $C_n^2(h)$ that affects images and the one that we want to determine. To extract the profile from images, we have developed the Focal plane profiling~(FPP) method as a non-linear least-square minimisation procedure that adjust a $C_n^2(h)$-dependent PSF model to match a collection of observations and deliver a joint estimation of the PSF model and $C_n^2(h)$ profile. If the model is not consistent with real atmosphere statistics, because we consider a profile over too few bins for instance, the minimisation process allows to mitigate these errors when extrapolating the PSF in the field. At the contrary, if we feed this inaccurate model with a wrong $C_n^2(h)$ without any feedback from a real PSF, we risk to amplify the error propagation and \textcolor{black}{degrade} the PSF extrapolation.\\ We describe the FPP algorithm in Sect.~\ref{S:FPP}. Sect.~\ref{S:simu} is dedicated to FPP performance assessment; we illustrate that the FPP allows to retrieve the $C_n^2(h)$ at a 1\%-level accuracy when bright stars are available. We present an application to PSF extrapolation on simulated images of NIRC2 \cite{McLean2000} at Keck II and evaluate what are the conditions in terms of calibration stars magnitudes and field location to decrease errors provoked by PSF-model indetermination on photometry and astrometry, down to respectively 1\% and 50$\mu$as. We make a step further in applying the FPP to Canada's NRC-Herzberg HENOS testbed images and compare successfully the FPP-retrieved $C_n^2(h)$ to existing measurements. \section{Focal plane profiling} \label{S:FPP} The FWHM of a seeing-limited PSF is known to be fully related to atmospheric turbulence properties, such as the seeing and the outer scale. Thus, these parameters can be extracted directly from observed PSFs as it has already been investigated and validated~\cite{Martinez2010}. In this paper, we extend this methodology to characterise the entire $C_n^2(h)$ profile based on AO-compensated PSF. FPP is designed to exploit anisoplanatism patterns observed on off-axis PSFs, i.e. not in the guide star location, to retrieve the $C_n^2(h)$ profile as really seen by the AO system. It relies on a PSF model~\cite{BeltramoMartin2018} regarding angular variations across the field due to anisoplanatism. Furthermore, to inverse the problem, it performs iteratively a joint estimation of the PSF and the input parameters, based on a non-linear least-square minimisation yielded by a Levenberg-Marquardt algorithm. \subsection{Direct problem} Let $\boldsymbol{\rho}$, $\lambda$ and $\theta$ be respectively the coordinates vector in the pupil, the imaging wavelength and the angular position in the sky. We define $\otf{}(\boldsymbol{\rho}/\lambda,C_n^2(h),\theta)$ as an AO-compensated estimated Optical transfer function~(OTF) in the direction $\theta$ in the field and is derived as follows \begin{equation}\label{E:model} \otf{}(\boldsymbol{\rho}/\lambda,C_n^2(h),\theta) = \otf{0}(\boldsymbol{\rho}/\lambda) \cdot \atf{}(\boldsymbol{\rho}/\lambda,C_n^2(h),\theta) \end{equation} where $\otf{0}$ is the OTF in the reference direction, that can be either a real observation or a model delivered by PSF reconstruction~\cite{Veran1997} for instance. In the rest of this paper, we will assume to perfectly know $ \otf{0}$. Then, \textcolor{black}{the PSF in the field direction $\theta$} is given by the Fourier transform of $\otf{}(\boldsymbol{\rho}/\lambda,C_n^2(h),\theta)$.\\ ATF defined in Eq.~\ref{E:model} is the Anisoplanatism transfer function as introduced by~\cite{Fusco2000} and derives as \begin{equation} \label{E:atf} \begin{aligned} &\text{ATF}(\boldsymbol{\rho}/\lambda,C_n^2(h),\theta) =\\ & \dfrac{\iint_\mathcal{P} \mathcal{P}(\boldsymbol{r})\mathcal{P}(\boldsymbol{r}+\boldsymbol{\rho})\exp\para{-0.5\times D_\Delta(\boldsymbol{r},\boldsymbol{\rho},C_n^2(h),\theta)}\boldsymbol{dr}}{\iint_\mathcal{P} \mathcal{P}(\boldsymbol{r})\mathcal{P}(\boldsymbol{r}+\boldsymbol{\rho})\boldsymbol{dr}} \end{aligned} \end{equation} where $\mathcal{P}$ is the pupil function, $\boldsymbol{r}/\boldsymbol{\rho}$ are respectively the location/separation vector in the pupil and $D_\Delta$ the anisoplanatic phase structure function. \textcolor{black}{$D_\Delta(\boldsymbol{r}, \boldsymbol{\rho}, C_n^2(h), \theta)$ characterises the spatial decorrelation of two wavefront coming from two stars angularly separated by $\theta$ in the field. Through the ATF calculation in Eq.~\ref{E:atf}, it sharpens the angular frequencies support, i.e. $\otf{0}$, that elongates the PSF towards the GS direction. At a field position $\theta$, the PSF broadening is fully determined by $D_\Delta(\boldsymbol{r}, \boldsymbol{\rho}, C_n^2(h), \theta)$, which is a function of the $C_n^2(h)$ as detailed in the literature \cite{BeltramoMartin2018,Flicker2008,Fusco2000,Britton2006,Whiteley1998,Tyler1994}. Note that the ATF should not be pupil model-dependent regarding Eq.~\ref{E:atf} that introduces the normalisation by the diffraction OTF. The real telescope pupil filtering is carried by $\otf{0}$.} \subsection{Problem inversion} Eq.~\ref{E:atf}, highlights that the PSF model is highly non-linear regarding the inputs. The approach to inverse the problem we have chosen consists in least-squares minimising iteratively a criterion using a Levenberg-Marquardt algorithm. For $n_\text{psf}$ observations in the field, FPP minimises the following cost function \begin{equation} \varepsilon^2(C_n^2(h)) = \sum_{i=1}^{n_\text{psf}} \norme{\para{\text{PSF}(\boldsymbol{\alpha},\theta_i) - \widehat{\text{PSF}}(\boldsymbol{\alpha},\theta_i,C_n^2(h))}}^2_{\mathcal{L}_2}, \label{E:criteria} \end{equation} where $\text{PSF}(\boldsymbol{\alpha},\theta_i)$ and $\widehat{\text{PSF}}(\boldsymbol{\alpha},\theta_i,C_n^2(h))$ are respectively the observed and modelled PSF in the field direction $\theta_i$ as function of the angular separation vector $\boldsymbol{\alpha}$ in the focal plane. We report in Fig.\ref{F:FPP} the FPP architecture as a block diagram.\\ \textcolor{black}{It starts from an initial guess on the profile, that is chosen flat but with an integral that corresponds to $r_0^{-5/3}$. This constrain is quite easily reached thanks to the AO telemetry that permits a $r_0$ estimation within 10\% of accuracy. FPP derives the OTF in the field directions given by the vector $\boldsymbol{\theta}$ using Eq.~\ref{E:model}, where $\otf{0}$ is an input of the problem. Then, we do zero-pad and interpolate the OTF and compute its Fourier transform to get the PSF with the desired pixel-scale and FOV, before scaling it to set its flux to the observation's. From the concatenation of the modelled PSFs given at any element of $\boldsymbol{\theta}$, FPP calculates the criterion in Eq.~\ref{E:criteria} and evaluates the trueness of the stop conditions; either the criterion or the relative increment on the $C_n^2(h)$ reaches $10^{-10}$ for any bin, or when the iteration number meets 300, that is a reasonable empirical evaluation. In the situation the algorithm ought to continue getting through the iterative loop, it updates the $C_n^2(h)$ value from the empirical model gradient and update the PSF model until reaching the stop conditions. When these ones met, the FPP delivers the PSF model at any field position given by $\boldsymbol{\theta}$ and the corresponding $C_n^2(h)$ estimation. }\\ \textcolor{black}{We could define an OTF-based criterion; we can select a Cartesian area in the PSF by applying a sinc filter to the OTF, to remove the PSF wings contribution for instance, that are not sensitive to the $C_n^2(h)$ distribution but only the integrated value. Nevertheless, the anisoplanatism enlarges the PSF and does sharpen the OTF, though. Consequently, a strong anisoplanatism effect narrows the OTF and decrease the number of useful pixels to be model-fitted, which yields a sensitivity loss to $C_n^2(h)$. On top of that, an OTF-based fitting would potentially permit to deal more efficiently with white noise, but the processing of NIRC2 images, we will test the method on, has shown that the noise can be quite spatially correlated and contaminates more than the central OTF pixel. It is not consequently necessarily straightforward to mitigate the noise contribution in an OTF-based criterion with spatially correlated noise. So far the PSF-based criterion appeared to be more convenient for us in a first implementation of the method and also more intelligible for the community of potential users, but we plan to improve the FPP robustness and efficiency in the future. We will particularly figure out whether an OTF-based criterion may help to go to this direction.}\\ \begin{figure*} \centering \includegraphics[width = 18cm]{fpp.pdf} \caption{Block diagram representing the FPP architecture. I must be provided by a reference OTF ($\otf{0}$) and an initial guess on the $C_n^2(h)$. We have chosen a flat initial profile whose the integral corresponds to $r_0^{-5/3}$.} \label{F:FPP} \end{figure*} As illustrated by Eq.~\ref{E:criteria}, FPP takes benefits from pixels intensity variations in the focal plane and more particularly on a feature that is spatially correlated. When the PSF is off-axis, a large part of this spatial variation is induced by anisoplanatism as illustrated in Fig.~\ref{F:PSFgrid}. \textcolor{black}{We could potentially rely on the FWHM value only to estimate the original $C_n^2(h)$ that explains the PSF broadening, but we see several main problems. Firstly, the PSF FWHM varies very little regarding $\theta$ as long as $\theta$ is lower than $1.5\times \theta_0$. It would consequently require a large field, basically 30" in H-band, to have a linear dependency between the FWHM and the $C_n^2(h)$ value, which can be larger than the imager FOV. On top of that, the FWHM is only a scalar value and we need to retrieve the $C_n^2(h)$ value over several bins, at least seven as mentioned in \cite{BeltramoMartin2018}; as a consequence we would need at least seven PSF in different position in the field to expect a full profile retrieval, which can be quite challenging. The use of all the PSF pixels within the AO control radius ensure to have theoretically enough sensibility to extract the profile from a single PSF.}\\ \begin{figure} \centering \includegraphics[width=8.8cm]{psfsGridfull_NGS.pdf} \includegraphics[width=8.8cm]{fwhmVsDist_NGS.pdf} \caption{\textbf{Left~:} AO-compensated PSFs across the field. Ticks are giving the corresponding PSF location from the guide star direction. \textbf{Right~:} FWHM as function of field position from on-axis.} \label{F:PSFgrid} \end{figure} \section{Method sensitivity and performance} \label{S:simu} We have simulated a grid of PSFs presented in Fig.~\ref{F:PSFgrid} using the wavefront propagation object-oriented code OOMAO~\cite{Conan2014OOMAO}. Atmosphere set up refers to Mauna Kea median conditions, telescope and AO characteristics follows a Keck II baseline as detailed in Tab.~\ref{T:setup}. \textcolor{black}{We did not have simulated a real AO system, we have assumed that the on-axis PSF is diffraction-limited and defined by a circular pupil only. We want to figure out the potential of the FPP method in such a limit case before applying it to real AO sky data. More generally, FPP does not need any assumption about the AO system thanks to the knowledge of $\otf{0}$ that contains exactly what the AO system has done. It only cares about the atmospherical turbulence distribution that makes the PSF varies across the field. In other words, simulating a real on-axis PSF would not have really change the results we are showing below, because we assume to know $\otf{0}$ perfectly. The case we do not do this assumption anymore and use PSF reconstruction to identify $\otf{0}$ is treated is another publication.}\\ \begin{table} \centering \caption{Simulation set up summary based on Mauna Kea median profile. Note that the anisoplanatism accounts on layer bin strictly above 0 km only. } \begin{tabular}{l|l} Sources wavelength [$\mu$m] & 1.65 \\ Exposure time [s] & 30 \\ Zero point [mag/s] & 25.5\\ $r_0$ [nm] (500nm) & 0.16 \\ $L_0$ [m] & 25 \\ $\theta_0$ (1.65$\mu$m) & 22"\\ fractional $r_0$ [\%] & 51.7, 11.9, 6.3, 6.1, 10.5, 8.1, 5.4 \\ altitude layer [km] & 0, 0.5, 1, 2, 4, 8, 16\\ Telescope diameter [m] & 10\\ Telescope elevation [$\deg$] & 30\\ \# pixels in the pupil & 200\\ DM actuator pitch [m] & 0.5\\ WFS \# lenslets & 20\\ \end{tabular} \label{T:setup} \end{table} In the following, we compare the FPP $C_n^2(h)$ retrieval regarding the calibration star magnitudes and numbers. \textcolor{black}{In all the following, the term calibration will refer to the $C_n^2(h)$ estimation using FPP that performs this calibration. For instance, \emph{calibration stars} points the specific stars in the field whose the PSF is provided to FPP to identify the $C_n^2(h)$.} Simulated PSFs are distributed along concentric rings of 5" up to 40"-Zenith Angle (ZA) as represented in Fig.~\ref{F:polar}. \textcolor{black}{In Sect.~\ref{SS:sensitivity}, we asses the limit on the calibration field position to ensure a full $C_n^2(h)$ retrieval. In Sect.~\ref{SS:noise}, we perform an analyses about how the noise that contaminates calibration PSFs does propagate into the $C_n^2(h)$ retrieval process. To do so, we have picked-off calibration PSFs from 40" to 20"-ZA to feed the FPP. To increase the number of non-redundant information and the overall Signal to Noise Ratio (SNR), we have concatenated these PSF from the farthest to the closest, i.e. in Eq.~\ref{E:criteria}, $i=1$ refers to the 40"-ZA star. As long as the calibration PSF is located beyond $\theta_0$, we have verified that the FPP can get back to the entire profile using this PSF, i.e. there is no specific gain by relying on the sole 20"-ZA or the 40"-ZA star, at least for noise-free images. When introducing noise, the 40"-ZA star is more elongated and its energy is spread over the focal plane and it is so more contaminated by the Poisson noise. By getting from the 40"-ZA to 20"-ZA star, we increase progressively the overall SNR.}\\ Stars magnitudes are set up by scaling the PSF flux with regard to the H-band zeropoint value of 25.5 mag/s for the NIRC2 detector at Keck II. We consider 38 counts by pixel for the read-out noise and 0.08 count/pixel/sec for the dark current. Photon noise is included as well as the sky background as well that reaches 13.6 mag/arcsec$^2$/s in H-band.\\ \textcolor{black}{Finally, in all the following, both simulation and FPP model have the same altitude resolution capability, i.e. we configured the FPP to retrieve the 6 layers in altitude. The impact of altitude distribution errors is discussed in \cite{BeltramoMartin2018}. Because we assume to know $\otf{0}$, the ground layer fraction at 0 km does not participate to the anisoplanatism and can not be identified by FPP. We will present in an future publication an extension to FPP in order to estimate the ground layer contribution as well by adjusting the PSF wings.} \begin{figure} \centering \includegraphics[width = 9cm]{polar.pdf} \caption{Spatial distribution of simulated sources in the (azimuth angle, zenith angle) plan. Circle markers refer to calibration stars position where the FPP picks off PSFs, in an ordered range from labelled 1 up to 4, to calibrate the $C_n^2(h)$ profile.} \label{F:polar} \end{figure} \subsection{Sensitivity to anisoplanatism strength} \label{SS:sensitivity} We consider that atmosphere bins heights are perfectly known. We firstly address the question of FPP sensitivity: how large must be the field of view to be sufficiently affected by anisoplanatism? \textcolor{black}{Closest PSFs are less contaminated by anisoplanatism as illustrated in Fig.~\ref{F:PSFgrid}, i.e. there are less pixels the FPP can rely on to perform the retrieval. We thus expect that it exists a threshold on $\theta$ below which the FPP can not identify accurately the entire profile.}\\ To figure out the existence of this threshold, we have run the FPP algorithm to retrieve the $C_n^2(h)$ using a single simulated PSF located between 1" up to 40" from the GS position. We report in Fig.~\ref{F:cnhVloc} a comparison of estimated $C_n^2(h)$ regarding the PSF location. It shows that the profile is perfectly identified as long as the PSF is sufficiently affected by the anisoplanatism. \\ Its is confirmed by Fig.~\ref{F:cnhVlocnonoise} that shows the accuracy on bins strengths regarding the calibration star position. It does spectacularly highlight that the entire profile is retrieved as long as $\theta > 2/3\theta_0$. Below this threshold, bins at the lowest altitude are not well retrieved, with a clear trend of accuracy degradation for shorter PSF location and lower altitude. \textcolor{black}{We notice that the accuracy improvement is not linear with respect to $\theta$, but resembles more like to a succession of plateaus. We believe is due to the particular Mauna Kea median profile that we have used to perform this study; if we took another one we would have a different shape, but still the same level of mean error and a strong breakout at $\theta = 2/3\theta_0$, in a way it does not change the main conclusion of our analyses.} \\ Fig.~\ref{F:cnhVlocnonoise} gives also the number of layers we can reconstruct with regard to the location we pick-off the PSF. For instance, to get 1\% of accuracy on the $C_n^2(h)$ using a 10"-ZA PSF, we can only reconstruct the three highest layers, down to two for a 5"-ZA PSF. In other words, in the case of a 10"-FOV, as for the narrow-field mode of NIRC2, a 3 altitude layers-based PSF model is sufficient to characterize its properties at 1\%-level accuracy. \begin{figure} \centering \includegraphics[width=16cm]{cnhVloc.pdf} \caption{Retrieved $C_n^2(h)$ profile using a single PSF located either at 5" or 20"-ZA.} \label{F:cnhVloc} \end{figure} \begin{figure} \centering \includegraphics[width=16cm]{cnhVloc_nonoise.pdf} \caption{Accuracy on $C_n^2(h)$ bins regarding the calibration PSF location that is provided to the FPP.} \label{F:cnhVlocnonoise} \end{figure} We report in Tab.~\ref{T:th0} the isoplanatic angle value as function of the $r_0$ value at zenith and the telescope elevation for an outer scale of 25~m. Considering we need a PSF positioned $\theta_0$ off-axis, it informs about where we must pick-off an observation to ensure the full $C_n^2(h)$ retrieval at 1\% accuracy. For instance, for median conditions ($r_0$ = 16 cm), we would need an observation at 22" to retrieve 7 layers for 30 degree of telescope elevation. \begin{table} \centering \caption{Isoplanatic angle values at 1.65 $\mu$m regarding the $r_0$ zenith value at 500 nm at Mauna Kea and the telescope elevation. The outer scale was fixed to 25m.} \begin{tabular}{|c|c|c|c|c|c|} \hline & \multicolumn{5}{c|}{Telescope elevation [deg]}\\ \hline $r_0@500$nm [cm] & 0 & 15 & 30 & 45 & 60 \\ \hline 8 & 12.1& 11.4 & 9.5 & 6.7 & 3.8 \\ \hline 12 & 19.8& 18.6& 15.0 & 10.9 & 6.0\\ \hline 16 & 28.6& 26.9& 22.0 &15.5 & 8.5\\ \hline 18 & 33.5& 31.4& 26.1 & 18.0& 9.8\\ \hline 20 & 38.7& 36.3& 30.2 & 20.6 & 11.2\\ \hline \end{tabular} \label{T:th0} \end{table} \subsection{Sensitivity to noise} \label{SS:noise} We now consider a 40"-field case~(NIRC2 wide-field mode), with the atmosphere/telescope set up displayed in Tab.~\ref{T:setup}. We address the point about how noise propagation affects the $C_n^2(h)$ retrieval. We keep handling simulated images, that are now contaminated following a NIRC2 baseline. As we saw previously, these PSFs are anisoplanatism-contaminated enough to permit a full profile retrieval over the 7 layers. \\ The FPP algorithm is tested for a collection of PSFs whose magnitude~(the same for each star) varied from H=10 to 17. We report in Fig.~\ref{F:th0Vnpsf} the FPP-estimated $\theta_0$ as function of the calibration stars magnitudes and numbers. It illustrates that the noise that contaminates calibration PSF propagates through the minimisation process and does degrade the $C_n^2(h)$ retrieval. This contamination can be fought and mitigated by relying on more calibration PSFs, which improves the overall SNR and the $C_n^2(h)$ accuracy. 1\% of accuracy on $\theta_0$ is roughly obtained with a single star of magnitude 13.5. \begin{figure} \centering \includegraphics[width=16cm]{th0vMag.pdf} \caption{H-band isoplanatic angle $\theta_0$ accuracy as function of the FPP calibration stars magnitudes. Envelopes are given from a 1-$\sigma$ standard-deviation. } \label{F:th0Vnpsf} \end{figure} We report in Figs.~\ref{F:cn2hVnpsf} and~\ref{F:cn2hVmag} the FPP-estimated $C_n^2(h)$ profile compared to the simulation reference for different numbers of collected PSFs and different magnitude levels. As previously, results confirm that increasing the number of calibration stars does help the identification. Furthermore, the lowest bins are the most sensitive to the noise level; they are the ones that contribute the least to anisoplanatism effect as discussed in Sect.~\ref{SS:sensitivity}. The degradation of $\theta_0$ is consequently mostly explained by inaccuracies on these lowest layers. As a conclusion, in order to provide a $C_n^2(h)$ profile estimation that reaches 1\% of accuracy on $\theta_0$, the FPP needs to rely on a single-star of magnitude H=13.5, located at least beyond $2/3\times\theta_0$ and regarding the NIRC2 baseline we have considered in this study. We expand this quantitative constrain of the FPP as function of the exposition time and number of calibration stars in Sect.~\ref{SS:threshold}. \begin{figure} \centering \includegraphics[width=16cm]{cnhvnpsf.pdf} \caption{Retrieved $C_n^2(h)$ profile as function of the number of collected PSFs for calibration stars magnitudes set to 15.} \label{F:cn2hVnpsf} \end{figure} \begin{figure} \centering \includegraphics[width=16cm]{cnhvmag.pdf} \caption{Retrieved $C_n^2(h)$ profile with respect to calibration stars magnitudes when picking off 4 PSFs in the field.} \label{F:cn2hVmag} \end{figure} \section{Application to PSF extrapolation} We still refer to our simulation baseline in order to assess how accurate the FPP permits the PSF extrapolation. As previously, we picked-off several stars in a anisoplanatism-limited area, with noise contamination, to calibrate the PSF model across all the field. Modelled PSFs are compared to simulation in terms of Strehl-ratio~(SR) and Full width at half maximum~(FWHM).\\ On top of that, we aim at quantifying astronomical-related metrics, such as photometry and astrometry. We followed the same baseline as presented in~\cite{BeltramoMartin2018} for tight binaries. For each simulated star, we create a corresponding 100 mas-separated fake binaries by duplicating and shifting the PSF. The purpose of this manipulation is to measure how well we can retrieve the binaries characteristics by fitting a model provided by the FPP. \textcolor{black}{Basically, photometry and astrometry are measured from the residual of the PSFs scaling and relative positions adjustments over the synthetic binary, when using a binary model based on the FPP PSF model that may differ from the real simulated PSF. The process is repeated for any value of $\theta$.} Because the FPP relies on noisy calibration PSFs, we aim here at assessing how the noise impacts the binaries parameters estimation by biasing the PSF-model representation that we calibrate using the FPP. We summarise the methodology in Fig.~\ref{F:bin}.\\ For each considered metric, we look either at its mean value across the field regarding the calibration stars magnitudes, or how it does vary with angular separation from on-axis. \begin{figure*} \centering \includegraphics[width=18cm]{binarisation.pdf} \caption{Sketch of the binary parameters retrieval. For each field location $\theta_s$, we create a fake binary with a known separation $\alpha$ and magnitude $m_0$. In parallel, we calibrate the PSF model using the FPP over a collection of noise-contaminated calibration PSFs of magnitude $m$, with zp the zero-point and T$_\text{exp}$ the exposure time. This model is duplicated to create a binary-model as function of the stars fluxes and relative separation, which is adjusted iteratively over the synthetic observation. } \label{F:bin} \end{figure*} \subsection{Impact on PSF morphology} \label{SS:sr} SR and FWHM are known~\cite{Roddier1999} to follow $\theta_0$-dependent laws given respectively by $\exp(\theta_0^{-5/3})$ and $\para{\theta/\theta_0}^{-5/3}$. We expect to retrieve trends connected to what is presented in Fig.~\ref{F:th0Vnpsf}.\\ Figs.~\ref{F:srVmag},~\ref{F:fwhmVmag} display SR and FWHM mean accuracy in the field with regard to the calibration stars magnitudes. We retrieve the similar linear trends with respect to $\theta_0$ as presented in Fig.~\ref{F:th0Vnpsf}, that confirms that accuracy of those parameters are connected to $\theta_0$ estimation errors regarding the noise level.\\ \begin{figure} \centering \includegraphics[width=16cm]{srvmag.pdf} \caption{H-band SR accuracy averaged out over the field regarding the calibration stars magnitudes. Envelopes are given from a 1-$\sigma$ standard-deviation.} \label{F:srVmag} \end{figure} \begin{figure} \centering \includegraphics[width=16cm]{fwhmvmag.pdf} \caption{H-band FWHM accuracy averaged out over the field regarding the calibration stars magnitudes. Envelopes are given from a 1-$\sigma$ standard-deviation.} \label{F:fwhmVmag} \end{figure} We illustrate in Figs.~\ref{F:srVnpsf} and~\ref{F:fwhmVnpsf}, SR and FWHM accuracy as function of $\theta$ when calibrating the $C_n^2(h)$ profile with 1 up to 4 stars of magnitude 15. When relying on more stars, the $C_n^2(h)$ estimation is better as seen in Sect.~\ref{SS:noise}, which translates into a better PSF modelling downstream.\\ Nevertheless, the model accuracy is not uniform across the field. Closest stars images from on-axis are the less affected by anisoplanatism, i.e. the PSF at those position are not sensitive to any $C_n^2(h)$ mis-retrieval, which explains why SR and FWHM values get better estimated for weaker separation. Then, the PSF model is calibrated using at least the 40"-ZA star; consequently the PSF must be well characterised at this specific location for the single calibration PSF case, which justifies why we see this drop in error for the 40" separation. By gathering up more calibration stars from 40"-ZA to 20"-ZA, in addition to improve the PSF morphology characterisation, we also make estimates more uniform across the field. \begin{figure} \centering \includegraphics[width=16cm]{srvtheta.pdf} \caption{H-band SR accuracy in the field regarding number of calibration stars of magnitude 15. Envelopes are given from a 1-$\sigma$ standard-deviation.} \label{F:srVnpsf} \end{figure} \begin{figure} \centering \includegraphics[width=16cm]{fwhmvtheta.pdf} \caption{H-band FWHM accuracy in the field regarding number of calibration stars of magnitude 15. Envelopes are given from a 1-$\sigma$ standard-deviation.} \label{F:fwhmVnpsf} \end{figure} \subsection{Impact on binaries photometry and astrometry} We report in Figs.~\ref{F:photoVtheta} and~\ref{F:astroVtheta} respectively the photometry and astrometry with respect to the PSF location in the field. As for PSF-related metrics, photometry and astrometry are not estimated uniformly for the same reasons as explained in Sect.~\ref{SS:sr}. Figs.~\ref{F:photoVmag} and~\ref{F:astroVmag} show the same linear trends on science estimates errors with respect to calibration stars magnitudes.\\ As a matter of fact, we observe that photometry and astrometry accuracy are respectively connected to SR and FWHM estimation as we were expecting~\cite{BeltramoMartin2018}. For a single calibration star of magnitude 14, we obtain 1\%-level of photometry and 50$\mu$as of astrometry. These values reflect only PSF-model errors onto the estimates; we do not consider any other potential effects that participate to the overall error breakdown as detailed in~\cite{Fritz2010} for astrometry in the galactic center for instance. It explains why the astrometry drops down to zero for stars close to the guide star: in absence of anisoplanatism, we do not propagate any $C_n^2(h)$ mis-retrieval into the PSF model. Contrary to photometry, astrometry behaves as a monotonic function of the field location, though. It points out that the astrometry is roughly given by the ratio FWHM/SNR and so sensitive to the \textcolor{black}{slope of the averaged PSF core.} Because the PSF FWHM increases monotonically as function of $\theta$ as shown in Fig.~\ref{F:PSFgrid}, we retrieve the same behaviour for the astrometry versus $\theta$, where the function goes up less rapidly if we increase the SNR by calibrating the PSF model over more stars.\\ One may argue that more optimal tools exist to estimate photometry and astrometry. Yet, our purpose is only to focus on PSF model error contributions due to bad anisoplanatism characterisation, which does not require to deploy such algorithms to be figured out. We highlight these contributions reaches down to $50\mu$as and 1\% respectively of astrometry and photometry over 40" in calibrating the FPP using a single star. In a near-future, we will apply the FPP on real crowded field observations and use standard pipeline to asses the potential gain on estimates. \begin{figure} \centering \includegraphics[width=16cm]{photovmag.pdf} \caption{H-band photometry accuracy averaged out over the field regarding the calibration stars magnitudes. Envelopes are given from 1-$\sigma$ standard-deviation.} \label{F:photoVmag} \end{figure} \begin{figure} \centering \includegraphics[width=16cm]{astrovmag.pdf} \caption{H-band astrometry accuracy averaged out over the field regarding the calibration stars magnitudes. Envelopes are given from 1-$\sigma$ standard-deviation.} \label{F:astroVmag} \end{figure} \begin{figure} \centering \includegraphics[width=16cm]{photovtheta.pdf} \caption{H-band photometry accuracy in the field regarding number of calibration stars of magnitude 15. Envelopes are given from 1-$\sigma$ standard-deviation.} \label{F:photoVtheta} \end{figure} \begin{figure} \centering \includegraphics[width=16cm]{astrovtheta.pdf} \caption{H-band astrometry accuracy in the field regarding number of calibration stars of magnitude 15. Envelopes are given from 1-$\sigma$ standard-deviation.} \label{F:astroVtheta} \end{figure} \subsection{Threshold values} \label{SS:threshold} We benefit from our previous analyses to figure out which configuration permits a 1\%-accuracy estimation of a given metric. We will do the exercise for photometry, but the same methodology is applicable for any other metrics, as long as we have identified how it does vary with regard to the SNR.\\ According to Fig.~\ref{F:photoVmag}, a 1\%-level photometry in the field require to calibrate the FPP model using a single $m_0 = 14$ magnitude PSF imaged with 30~s exposure time. For a different star magnitude, exposure time and number of collected images, we must ensure that the total gathered flux corresponds to a 14 magnitude star. If $m_\star(n_\text{psf},T_\text{exp})$ is the magnitude limit over the $n_\text{psf}$ we get from the field and imaged at $T_\text{exp}$ seconds of exposure time, it must satisfy \begin{equation} -2.5\times\log_{10}\para{\dfrac{n_\text{psf}\times T_\text{exp}}{30}\times 10^{-0.4\times m_\star}} = m_0 \end{equation} that leads to \begin{equation} \label{E:maglim} m_\star(n_\text{psf},T_\text{exp}) = m_0 + 2.5\times\log_{10}\para{\dfrac{n_\text{psf}\times T_\text{exp}}{30}}, \end{equation} where finally $m_\star$ indicates what must be the maximal magnitude to ensure 1\%-level of photometry estimation across the 40"x40"-field. We report in Tabs.~\ref{T:maglim} results of Eq.~\ref{E:maglim} for couples ($n_\text{psf}$/$T_\text{exp}$). We emphasise that these are empirical results obtained for a NIRC2 baseline with a specific electronic noise configuration, but they highlight that deploying the FPP approach is feasible. We will also consider the near infra-red spectro-imager OSIRIS at Keck II that has an 20.4"-FOV imager located at 19" from the spectrograph, which permits to access strongly anisoplanatism-contaminated PSFs. The next step of this work will consist in coupling FPP with on-axis PSF reconstruction to be tested on crowded field images. \begin{table} \centering \caption{H-band stars magnitude limits regarding the number of star and exposure time to get 1\% of accuracy on photometry within 40"$\times$40" FOV using NIRC2 at Keck II. } \begin{tabular}{|c|c|c|c|c|c|} \hline & \multicolumn{5}{c|}{$T_\text{exp}$ [s]}\\ \hline $n_\text{psf}$ & 1 & 10 & 30 & 60 & 120 \\ \hline 1 & 10.3& 12.8 & 14 & 14.7 & 15.5 \\ \hline 2 & 11.0& 13.6& 14.7 & 15.5 & 16.3\\ \hline 3 & 11.5& 14.0& 15.2 &15.9 & 16.7\\ \hline 4 & 11.8& 14.3& 15.5 & 16.3& 17.0\\ \hline 5 & 12.0& 14.6& 15.7 & 16.5 & 17.2\\ \hline \end{tabular} \label{T:maglim} \end{table} \section{Application to the HeNOS testbed} \label{S:henos} HeNOS (Herzberg NFIRAOS Optical Simulator) is a multi-conjugated AO test bench designed to be a scaled down version of NFIRAOS, the first light adaptive optics system for the Thirty Meter Telescope~\cite{Rosensteiner2016}. We used HeNOS in SCAO mode and closed the loop on ones of the 4 LGSs distributed over a 4.5" square constellation, while atmosphere is created using three phase screens. Summary of main parameters is given in Tab.~\ref{T:setupHENOS}. To simulate the expected PSF degradation across the field on NFIRAOS at TMT, all altitudes are stretched up by a factor 11. Moreover, at the time we acquired HeNOS data, science camera was conjugated at the LGSs altitude; LGSs beams are propagating along a cone but are arriving in-focus at the science camera entrance. \begin{table} \centering \caption{HENOS set up summary.} \begin{tabular}{l|l} Asterism side length & 4.5"\\ Sources wavelength & 670 nm \\ $r_0$ (670 nm) & 0.751 \\ $\theta_0$ (670 nm) & 0.854" \\ fractional $r_0$ & 74.3\% ,17.4\%,8.2\% \\ altitude layer & (0.6, 5.2, 16.3) km\\ source height & 98.5 km \\ Telescope diameter & 8.13~m\\ DM actuator pitch & 0.813~m\\ \end{tabular} \label{T:setupHENOS} \end{table} We have acquired closed-loop telemetry when guiding the AO system on a LGS in SCAO mode in July 2017. On top of that, we have measured PSFs without phase screens through the beam to characterise best-performance in the current set-up. We report in Tab.~\ref{T:SRHenOS} Strehl-ratio and FWHM measurements. On off-axis PSFs, we see that anisoplanatism degrade significantly the performance, and dominates any other sources of residual errors on off-axis PSFs. This is an ideal situation to test the FPP. \begin{table} \caption{Strehl-ratio and FWHM measured on HeNOS PSFs when closing the loop in a SCAO mode.} \centering \begin{tabular}{|c|c|c|c|c|} \hline & PSF on-axis & PSF 1 & PSF 2 & PSF 3 \\ \hline Strehl ratio [\%]& 28.5& 4.0 & 5.1&4.9 \\ \hline No phase screen & 39& 41 & 36& 38 \\ \hline \hline FWHM [mas] & 21 & 116& 71 & 100\\ \hline No phase screen & 21& 20 & 21&19 \\ \hline \end{tabular} \label{T:SRHenOS} \end{table} $C_n^2(h)$ on the HeNOS bench was estimated using a SLODAR method~\cite{Wilson2002} based on WFS cross-correlation, with a 1-km altitude resolution and a measurement precision up to 10\%. Consequently, we expect FPP to retrieve a profile very close to the reference given in Tab.~\ref{T:setupHENOS} \textcolor{black}{within the measurements accuracy given by the WFS cross-correlation method.} We have employed FPP to retrieve both weights and heights of three layers by handling one up to three stars, in providing the reference profile as the initial guess. We illustrate in Fig.~\ref{F:comparPSF} the three off-axis PSFs derived using the 3 PSFs-based FPP-outputs profile compared to the observations, that illustrates that our model produces a satisfactory anisoplanatism pattern which matches bench images. We provide in Fig.~\ref{F:comparAlt} the averaged $C_n^2(h)$ profile over all PSF pairs configurations compared to the reference. Errors bars at 1-$\sigma$ are deduced from a quadratic mean on fitting residual given by the minimisation procedure and averaged out over PSFs pairs~(1/2 PSFs cases).\\ \begin{figure} \centering \includegraphics[width=16cm]{psfHenosModel.pdf} \caption{\small (\textbf{1st line}) off-axis HeNOS PSFs (\textbf{2nd line}) best-fitted PSFs model using FPP (\textbf{3rd line}) fitting residual. Colorbars give the PSF log scale intensity in digital numbers.} \label{F:comparPSF} \end{figure} \begin{figure} \centering \includegraphics[width=16cm]{cnhHenos.pdf} \caption{\small Retrieved $C_n^2(h)$ profile compared to reference value given in Tab.~\ref{T:setupHENOS}.} \label{F:comparAlt} \end{figure} First of all, FPP retrieval depends on the number of stars; we see that the single-PSF case does not lead to a successful retrieval when looking at the highest layer \textcolor{black}{that is strongly overestimated from what we expect}. It is confirmed in Tab.~\ref{T:fvuHenOS} that shows that accuracy on PSF characteristics are worse for the single-star case than using the reference profile as our PSF model inputs. \textcolor{black}{We mention the Fraction of Variance Unexplained (FVU) that derives from the reconstruction residual integrated over all the image, and normalised by the bench mean-free PSF integral as explicated in \cite{BeltramoMartin2018}.} This is explained by the presence of effects that are not included into the model so far and not or weakly spatially correlated over the three off-axis PSFs, as field-dependent static aberrations for instance. These latter modify the PSF spatial intensity distribution as anisoplanatism does, which may confuse the FPP, especially on a single star. A first lever we have to mitigate unmodelled static phase in the PSF model is to calibrate them as it was done for Keck II~\cite{Witzel2016}. Furthermore, their influence onto the retrieval process is diminished by simply collecting more PSFs in the field as it is illustrated on present results. Contrary to anisoplanatism effect, field-dependent features decorrelates spatially and do not necessarily mimic the elongated anisoplanatism pattern onto the PSF.\\ Identification starts providing a better PSF characterisation starting from two collected PSFs. For the three PSFs-case, we get a $C_n^2(h)$ estimation that complies with the 10\%-level precision and 1~km altitude resolution of the WFS-based measurements. Tab.~\ref{T:fvuHenOS} confirms this retrieved set of $C_n^2(h)$ values help modelling more accurately the off-axis PSFs. The difference we see may also be introduced by either anisoplanatism model error - a wrong stretch factor would make the equivalent asterism different for instance - or differential conjugation altitude of sources and science camera that may slightly impact the real $C_n^2(h)$ as seen in the focal plane compared to WFS-based identification.\\ Fig.~\ref{F:comparAlt} gives the evidence that the retrieved seeing is quite stable and close to the reference value at 10\%-level. On top of that, we notice that only the highest layer altitude estimation is sensitive to the number of stars. This layer contributes the most to spread out the PSF and the FPP tunes the corresponding altitude height to reproduce the FWHM more faithfully. The next step of this work is to go further in this identification process by collecting more data in closed-loop on different LGS for increasing the number of observations. We will be able to pinpoint whether this difference is a real physical effect or just a limitation on our system description. Shifting the real position of phase screens will allow to have insights on the FPP altitude resolution as well. \begin{table} \caption{Percentage accuracy on outputs retrieved by FPP with regard to the number of PSF. For 1 and 2 stars cases, we have averaged out over all combination of PSF pairs. Error bars are given at 1-$\sigma$. FVU refers to the fraction of variance unexplained defined in \cite{BeltramoMartin2018}. } \centering \begin{tabular}{|c|c|c|c|c|} \hline & 1 star & 2 stars & 3 stars & Reference $C_n^2(h)$ \\ \hline FVU & 3.5 & 3.1 & 3.0 & 3.2\\ \hline SR & 12.0 & 6.7 & 6.5 & 9.9\\ \hline FWHM & 12.4 & 11.8 & 11.6 & 11.8\\ \hline \end{tabular} \label{T:fvuHenOS} \end{table} \section{Conclusion} \label{S:conclusions} We present in this paper the focal plane profiling as a $C_n^2(h)$ retrieval method that relies on partially compensated AO images affected by anisoplanatism. It performs a non-linear least-square minimisation of a PSF model over observations and provide both a PSF model across the field and the $C_n^2(h)$ profile. To mitigate noise propagation and the sensitivity to unmodelled aberrations, such as field-dependent static aberrations, we must collect several PSF from the field; we show for the NIRC2 imaging camera at Keck II that the FPP can retrieve both atmosphere and PSF characteristics, photometry at 1\%-level accuracy and 50$\mu$as astrometry if we get $n_\text{psf}$ PSFs of magnitude given by $H=14 + 2.5\times\log(n_\text{psf}\times T_\text{exp}/30)$, with a breakdown to H=15.5 mag when picking off 4 stars in the field. We have deployed this approach on the HeNOS testbench where $C_n^2(h)$ values are measured from WFS cross-correlation. Thanks to FPP, we retrieved a profile that complies with WFS-based measurements when using three stars distributed over 4.5" with $\theta_0 = 0.854"$. We demonstrate that collecting more stars allows to mitigate model errors such as field-dependent static aberrations for instance.\\ We focused in this paper for the $C_n^2(h)$ profiling in the purpose of assessing the reliability and limitations of this method. Our next work will consist in deploying both FPP and PSF-reconstruction technique to asses what are the potential gains on crowded fields observations, such as the Galactic center with Keck and the ELT with MICADO. Furthermore, we will investigate to extend the FPP to tomographic systems for improving the $C_n^2(h)$ profiling, especially in the purpose to deploy such an approach to the multi-conjugated system MAORY coupled with MICADO, or the laser-tomographic mode of HARMONI and METIS.\\ \section*{Acknowledgements} This work was supported by the A*MIDEX project (no. ANR-11-IDEX-0001-02) funded by the "Investissements d'Avenir" French Government programme, managed by the French National Research Agency (ANR). \bibliographystyle{plain}
\section{Introduction}\label{sec:intro} An \emph{ordinary line} of a set of points in the plane is a line passing through exactly two points of the set. The classical Sylvester--Gallai theorem states that every finite non-collinear point set in the plane spans at least one ordinary line. In fact, for sufficiently large $n$, an $n$-point non-collinear set in the plane spans at least $n/2$ ordinary lines, and this bound is tight if $n$ is even. This was shown by Green and Tao \cite{GT13} via a structure theorem characterising all finite point sets with few ordinary lines. It is then natural to consider higher dimensional analogues. Motzkin \cite{M51} noted that there are finite non-coplanar point sets in $3$-space that span no plane containing exactly three points of the set. He proposed considering instead hyperplanes $\Pi$ in $d$-space such that all but one point contained in $\Pi$ is contained in a $(d-2)$-dimensional flat of $\Pi$. The existence of such hyperplanes was shown by Motzkin \cite{M51} for $3$-space and by Hansen \cite{H65} in higher dimensions. Purdy and Smith \cite{PS10} considered instead finite non-coplanar point sets in $3$-space with no three points collinear, and provided a lower bound on the number of planes containing exactly three points of the set. Referring to such a plane as an \emph{ordinary plane}, Ball \cite{B18} proved a $3$-dimensional analogue of Green and Tao's \cite{GT13} structure theorem, and found the exact minimum number of ordinary planes spanned by sufficiently large non-coplanar point sets in real projective $3$-space with no three points collinear. Using an alternative method, we \cite{LS18} were able to prove a more detailed structure theorem but with a stronger condition; see Theorem~\ref{thm:plane} in Section~\ref{sec:proof}. Ball and Monserrat \cite{BM17} made the following definition, generalising ordinary planes to higher dimensions. \begin{definition} An \emph{ordinary hyperplane} of a set of points in real projective $d$-space, where every $d$ points span a hyperplane, is a hyperplane passing through exactly $d$ points of the set. \end{definition} They \cite{BM17} also proved bounds on the minimum number of ordinary hyperplanes spanned by such sets (see also \cite{M15}). Our first main result is a structure theorem for sets with few ordinary hyperplanes. The elliptic normal curves and rational acnodal curves mentioned in the theorem and their group structure will be described in Section~\ref{sec:curves}. Our methods extend those in our earlier paper \cite{LS18}, and we detail them in Section~\ref{sec:tools}. \begin{theorem}\label{thm:main1} Let $d \geqslant 4$, $K > 0$, and suppose $n \geqslant C\max\{(dK)^8, d^3 2^dK\}$ for some sufficiently large absolute constant $C > 0$. Let $P$ be a set of $n$ points in $\mathbb{R}\mathbb{P}^d$ where every $d$ points span a hyperplane. If $P$ spans at most $K\binom{n-1}{d-1}$ ordinary hyperplanes, then $P$ differs in at most $O(d2^dK)$ points from a configuration of one of the following types: \begin{enumerate}[label=\rom] \item A subset of a hyperplane;\label{case:hyperplane} \item A coset $H \oplus x$ of a subgroup $H$ of an elliptic normal curve or the smooth points of a rational acnodal curve of degree $d+1$, for some $x$ such that $(d+1)x \in H$.\label{case:curve} \end{enumerate} \end{theorem} It is easy to show that conversely, a set of $n$ points where every $d$ span a hyperplane and differing from \ref{case:hyperplane} or \ref{case:curve} by $O(K)$ points, spans $O(K\binom{n-1}{d-1})$ ordinary hyperplanes. By \cite{BM17}*{Theorem 2.4}, if a set of $n$ points where every $d$ points span a hyperplane itself spans $K\binom{n-1}{d-1}$ ordinary hyperplanes, and is not contained in a hyperplane, then $K = \Omega(1/d)$. Theorem~\ref{thm:main2} below implies that $K\ge1$ for sufficiently large $n$ depending on $d$. For a similar structure theorem in dimension $4$ but with $K = o(n^{1/7})$, see Ball and Jimenez \cite{BJ18}, who show that $P$ lies on the intersection of five quadrics. Theorem~\ref{thm:main1} proves \cite{BJ18}*{Conjecture~12}, noting that elliptic normal curves and rational acnodal curves lie on $\binom{d}{2} - 1$ linearly independent quadrics \citelist{\cite{Klein}*{p.~365}\cite{Fi08}*{Proposition~5.3}}. We also mention that Monserrat \cite{M15}*{Theorem 2.10} proved a structure theorem stating that almost all points of the set lie on the intersection of $d-1$ hypersurfaces of degree at most~$3$. Our second main result is a tight bound on the minimum number of ordinary hyperplanes, proving \cite{BM17}*{Conjecture 3}. Note that our result holds only for sufficiently large $n$; see \citelist{\cite{BM17}\cite{M15}\cite{J18}} for estimates when $d$ is small or $n$ is not much larger than $d$. \begin{theorem}\label{thm:main2} Let $d \geqslant 4$ and let $n\geqslant Cd^3 2^d$ for some sufficiently large absolute constant $C > 0$. The minimum number of ordinary hyperplanes spanned by a set of $n$ points in $\mathbb{R}\mathbb{P}^d$, not contained in a hyperplane and where every $d$ points span a hyperplane, is \[ \binom{n-1}{d-1} - O\left(d2^{-d/2}\binom{n}{\lfloor\frac{d-1}{2}\rfloor}\right).\] This minimum is attained by a coset of a subgroup of an elliptic normal curve or the smooth points of a rational acnodal curve of degree $d+1$, and when $d+1$ and $n$ are coprime, by $n-1$ points in a hyperplane together with a point not in the hyperplane. \end{theorem} Green and Tao \cite{GT13} also used their structure theorem to solve the classical orchard problem of finding the maximum number of $3$-point lines spanned by a set of $n$ points in the plane, for $n$ sufficiently large. We solved the $3$-dimensional analogue in \cite{LS18}. Our third main result is the $d$-dimensional analogue. We define a \emph{$(d+1)$-point hyperplane} to be a hyperplane through exactly $d+1$ points of a given set. \begin{theorem}\label{thm:main3} Let $d \geqslant 4$ and let $n\geqslant Cd^3 2^d$ for some sufficiently large absolute constant $C > 0$. The maximum number of $(d+1)$-point hyperplanes spanned by a set of $n$ points in $\mathbb{R}\mathbb{P}^d$ where every $d$ points span a hyperplane is \[ \frac{1}{d+1} \binom{n-1}{d} + O\left(2^{-d/2}\binom{n}{\lfloor\frac{d-1}{2}\rfloor}\right). \] This maximum is attained by a coset of a subgroup of an elliptic normal curve or the smooth points of a rational acnodal curve of degree $d+1$. \end{theorem} While the bounds in Theorems~\ref{thm:main2} and~\ref{thm:main3} are asymptotic, we provide a recursive method (as part of our proofs) to calculate the exact extremal values for a given $d$ and $n$ sufficiently large in Section~\ref{sec:extremal}. In principle, the exact values can be calculated for any given $d$ and turns out to be a quasi-polynomial in $n$ with a period of $d+1$. We present the values for $d = 4, 5, 6$ at the end of Section~\ref{sec:extremal}. \subsection*{Relation to previous work} The main idea in our proof of Theorem~\ref{thm:main1} is to induct on the dimension $d$, with the base case $d=3$ being our earlier structure theorem for sets defining few ordinary planes \cite{LS18}, which in turn is based on Green and Tao's Intermediate Structure Theorem for sets defining few ordinary lines \cite{GT13}*{Proposition~5.3}. Roughly, the structure theorem in $3$-space states that if a finite set of points is in general position (no three points collinear) and spans few ordinary planes, then most of the points must lie on a plane, two disjoint conics, or an elliptic or acnodal space quartic curve. In fact, we can define a group structure on these curves encoding when four points are coplanar, in which case our point set must be very close to a coset of the curve. (See Theorem~\ref{thm:plane} for a more precise statement.) As originally observed by Ball \cite{B18} in $3$-space, the general position condition allows the use of projection to leverage Green and Tao's Intermediate Structure Theorem \cite{GT13}*{Proposition~5.3}. This avoids having to apply their Full Structure Theorem \cite{GT13}*{Theorem~1.5}, which has a much worse lower bound on $n$, as it avoids the technical Section~6 of \cite{GT13}, dealing with the case in the plane when most of the points lie on a large, though bounded, number of lines. On the other hand, to get to the precise coset structure, we used additive-combinatorial results from \cite{GT13}*{Section~7}, specifically \cite{GT13}*{Propositions~A.5, Lemmas 7.2, 7.4, 7.7, and Corollary 7.6}. In this paper, the only result of Green and Tao \cite{GT13} we explicitly use is \cite{GT13}*{Proposition~A.5}, which we extend in Proposition~\ref{cor:a5}, while all other results are subsumed in the structure theorem in $3$-space. In dimensions $d>3$, the general position condition also allows the use of projections from a point to a hyperplane (see also Ball and Monserrat \cite{BM17}). In Section~\ref{ssec:projections} we detail various technical results about the behaviour of curves under such projections, which are extensions of $3$-dimensional results in \cite{LS18}. While the group structure on elliptic or singular space quartic curves are well studied (see for instance \cite{Muntingh}), we could not find references to the group structure on singular rational curves in higher dimensions. This is our main focus in Section~\ref{sec:curves}, which in a way extends \cite{LS18}*{Section 3}. In particular, we look at Sylvester's theorem on when a binary form can be written as a sum of perfect powers, which has its roots in classical invariant theory. In extending the results of \cite{LS18}*{Section 3}, we have to consider how to generalise the catalecticant (of a binary quartic form), which leads us to the secant variety of the rational normal curve as a determinantal variety. Green and Tao's Intermediate Structure Theorem in $2$-space has a slightly different flavour to their Full Structure Theorem, the structure theorem in $3$-space, and Theorem~\ref{thm:main1}. However, this is not the only reason why we start our induction at $d=3$. A more substantial reason is that there are no smooth rational cubic curves in $2$-space; as is well known, all rational planar cubic curves are singular. Thus, both smooth and singular rational quartics in $3$-space project onto rational cubics, and we need some way to tell them apart. In higher dimensions, we have Lemma~\ref{lemma:singular_projection} to help us, but since this is false when $d=3$, the induction from the plane to $3$-space \cite{LS18} is more technical. This is despite the superficial similarity between the $2$- and $3$-dimensional situations where there are two almost-extremal cases while there is essentially only one case when $d>3$. Proving Theorem~\ref{thm:main1}, which covers the $d > 3$ cases, is thus in some sense less complicated, since not only are we leveraging a more detailed structure theorem (Theorems~\ref{thm:main1} and~\ref{thm:plane} as opposed to \cite{GT13}*{Proposition~5.3}), we also lose a case. However, there are complications that arise in how to generalise and extend results from $2$- and $3$-space to higher dimensions. \section{Notation and tools}\label{sec:tools} By $A = O(B)$, we mean there exists an absolute constant $C > 0$ such that $0\leqslant A \leqslant CB$. Thus, $A=-O(B)$ means there exists an absolute constant $C>0$ such that $-CB\leqslant A\leqslant 0$. We also write $A=\Omega(B)$ for $B=O(A)$. None of the $O(\cdot)$ and $\Omega(\cdot)$ statements in this paper have implicit dependence on the dimension~$d$. We write $A\mathbin{\triangle} B$ for the symmetric difference of the sets $A$ and $B$. Let $\mathbb{F}$ denote the field of real or complex numbers, let $\mathbb{F}^* = \mathbb{F}\setminus{\{0\}}$, and let $\mathbb{F}\mathbb{P}^d$ denote the $d$-dimensional projective space over $\mathbb{F}$. We denote the homogeneous coordinates of a point in $d$-dimensional projective space by a $(d+1)$-dimensional vector $[x_0, x_1, \dots, x_d]$. We call a linear subspace of dimension $k$ in $\mathbb{F}\mathbb{P}^d$ a \emph{$k$-flat}; thus a point is a $0$-flat, a line is a $1$-flat, a plane is a $2$-flat, and a hyperplane is a $(d-1)$-flat. We denote by $Z_{\mathbb{F}}(f)$ the set of $\mathbb{F}$-points of the algebraic hypersurface defined by the vanishing of a homogeneous polynomial $f\in\mathbb{F}[x_0, x_1, \dots, x_d]$. More generally, we consider a (closed, projective) \emph{variety} to be any intersection of algebraic hypersurfaces. We say that a variety is pure-dimensional if each of its irreducible components has the same dimension. We consider a \emph{curve} of degree $e$ in $\mathbb{C}\mathbb{P}^d$ to be a variety $\delta$ of pure dimension $1$ such that a generic hyperplane in $\mathbb{C}\mathbb{P}^d$ intersects $\delta$ in $e$ distinct points. More generally, the degree of a variety $X \subset \mathbb{C}\mathbb{P}^d$ of dimension $r$ is \[ \deg(X) := \max \setbuilder{|\Pi \cap X|}{\text{$\Pi$ is a $(d-r)$-flat such that $\Pi \cap X$ is finite}}. \] We say that a curve is \emph{non-degenerate} if it is not contained in a hyperplane, and \emph{non-planar} if it is not contained in a $2$-flat. We call a curve \emph{real} if each of its irreducible components contains infinitely many points of $\mathbb{R}\mathbb{P}^d$. Whenever we consider a curve in $\mathbb{R}\mathbb{P}^d$, we implicitly assume that its Zariski closure is a real curve. We denote the Zariski closure of a set $S \subseteq \mathbb{C}\mathbb{P}^d$ by $\overline{S}$. We will use the \emph{secant variety $\Sec_{\mathbb{C}}(\delta)$} of a curve $\delta$, which is the Zariski closure of the set of points in $\mathbb{C}\mathbb{P}^d$ that lie on a line through some two points of $\delta$. \subsection{B\'ezout's theorem}\label{ssec:bezout} B\'ezout's theorem gives the degree of an intersection of varieties. While it is often formulated as an equality, in this paper we only need the weaker form that ignores multiplicity and gives an upper bound. The (set-theoretical) intersection $X\cap Y$ of two varieties is just the variety defined by $P_X\cup P_Y$, where $X$ and $Y$ are defined by the collections of homogeneous polynomials $P_X$ and $P_Y$ respectively. \begin{theorem}[B\'ezout \cite{Fu84}*{Section~2.3}]\label{thm:bezout} Let $X$ and $Y$ be varieties in $\mathbb{C}\mathbb{P}^d$ with no common irreducible component. Then $\deg(X \cap Y) \leqslant \deg(X) \deg(Y)$. \end{theorem} \subsection{Projections}\label{ssec:projections} Given $p\in\mathbb{F}\mathbb{P}^d$, the \emph{projection from $p$}, $\pi_p\colon \mathbb{F}\mathbb{P}^d\setminus\{p\}\to \mathbb{F}\mathbb{P}^{d-1}$, is defined by identifying $\mathbb{F}\mathbb{P}^{d-1}$ with any hyperplane $\Pi$ of $\mathbb{F}\mathbb{P}^d$ not passing through $p$, and then letting $\pi_p(x)$ be the point where the line $px$ intersects $\Pi$ \cite{H92}*{Example~3.4}. Equivalently, $\pi_p$ is induced by a surjective linear transformation $\mathbb{F}^{d+1}\to\mathbb{F}^d$ where the kernel is spanned by the vector~$p$. As in our previous paper \cite{LS18}, we have to consider projections of curves where we do not have complete freedom in choosing a generic projection point $p$. Let $\delta \subset \mathbb{C}\mathbb{P}^d$ be an irreducible non-planar curve of degree $e$, and let $p$ be a point in $\mathbb{C}\mathbb{P}^d$. We call $\pi_p$ \emph{generically one-to-one on $\delta$} if there is a finite subset $S$ of $\delta$ such that $\pi_p$ restricted to $\delta\setminus S$ is one-to-one. (This is equivalent to the birationality of $\pi_p$ restricted to $\delta\setminus\{p\}$ \cite{H92}*{p.~77}.) If $\pi_p$ is generically one-to-one, the degree of the curve $\overline{\pi_p(\delta \setminus \{p\})}$ is $e-1$ if $p$ is a smooth point on $\delta$, and is $e$ if $p$ does not lie on~$\delta$; if $\pi_p$ is not generically one-to-one, then the degree of $\overline{\pi_p(\delta \setminus \{p\})}$ is at most $(e-1)/2$ if $p$ lies on $\delta$, and is at most $e/2$ if $p$ does not lie on~$\delta$ \cite{H92}*{Example 18.16}, \cite{Kollar}*{Section 1.15}. The following three lemmas on projections are proved in \cite{LS18} in the case $d=3$. They all state that most projections behave well and can be considered to be quantitative versions of the trisecant lemma \cite{KKT08}. The proofs of Lemmas~\ref{lem:projection2} and \ref{lem:projection3} are almost word-for-word the same as the proofs of the $3$-dimensional cases in \cite{LS18}. All three lemmas can also be proved by induction on the dimension $d \geqslant 3$ from the $3$-dimensional case. We illustrate this by proving Lemma~\ref{lem:projection1}. \begin{lemma}\label{lem:projection1} Let $\delta$ be an irreducible non-planar curve of degree $e$ in $\mathbb{C}\mathbb{P}^d$, $d\geqslant 3$. Then there are at most $O(e^4)$ points $p$ on $\delta$ such that $\pi_p$ restricted to $\delta\setminus\{p\}$ is not generically one-to-one. \end{lemma} \begin{proof} The case $d=3$ was shown in \cite{LS18}, based on the work of Furukawa \cite{Fu11}. We next assume that $d \geqslant 4$ and that the lemma holds in dimension $d-1$. Since $d>3$ and the dimension of $\Sec_\mathbb{C}(\delta)$ is at most $3$ \cite{H92}*{Proposition~11.24}, there exists a point $p \in \mathbb{C}\mathbb{P}^d$ such that all lines through $p$ have intersection multiplicity at most $1$ with $\delta$. It follows that the projection $\delta':=\overline{\pi_p(\delta)}$ of $\delta$ is a non-planar curve of degree $e$ in $\mathbb{C}\mathbb{P}^{d-1}$. Consider any line $\ell$ not through $p$ that intersects $\delta$ in at least three distinct points $p_1,p_2,p_3$. Then $\pi_p(\ell)$ is a line in $\mathbb{C}\mathbb{P}^{d-1}$ that intersects $\delta'$ in three points $\pi_p(p_1), \pi_p(p_2), \pi_p(p_3)$. It follows that if $x\in\delta$ is a point such that for all but finitely many points $y\in\delta$, the line $xy$ intersects $\delta$ in a point other than $x$ or $y$, then $x':=\pi_p(x)$ is a point such that for all but finitely many points $y':=\pi_p(y)\in\delta'$, the line $x'y'$ intersects $\delta'$ in a third point. That is, if $\pi_x$ restricted to $\delta$ is not generically one-to-one, then the projection map $\pi_{x'}$ in $\mathbb{C}\mathbb{P}^{d-1}$ restricted to $\delta'$ is not generically one-to-one. By the induction hypothesis, there are at most $O(e^4)$ such points and we are done. \end{proof} \begin{lemma}\label{lem:projection2} Let $\delta$ be an irreducible non-planar curve of degree $e$ in $\mathbb{C}\mathbb{P}^d$, $d\geqslant 3$. Then there are at most $O(e^3)$ points $x \in \mathbb{C}\mathbb{P}^d \setminus \delta$ such that $\pi_x$ restricted to $\delta$ is not generically one-to-one. \end{lemma} \begin{lemma}\label{lem:projection3} Let $\delta_1$ and $\delta_2$ be two irreducible non-planar curves in $\mathbb{C}\mathbb{P}^d$, $d\geqslant 3$, of degree $e_1$ and $e_2$ respectively. Then there are at most $O(e_1e_2)$ points $p$ on $\delta_1$ such that $\overline{\pi_p(\delta_1\setminus\{p\})}$ and $\overline{\pi_p(\delta_2\setminus\{p\})}$ coincide. \end{lemma} \section{Curves of degree \texorpdfstring{$d+1$}{d+1}}\label{sec:curves} In this paper, irreducible non-degenerate curves of degree $d+1$ in $\mathbb{C}\mathbb{P}^d$ play a fundamental role. Indeed, the elliptic normal curve and rational acnodal curve mentioned in Theorem~\ref{thm:main1} are both such curves. In this section, we describe their properties that we need. These properties are all classical, but we did not find a reference for the group structure on singular rational curves of degree $d+1$, and therefore consider this in detail. It is well-known in the plane that there is a group structure on any smooth cubic curve or the set of smooth points of a singular cubic. This group has the property that three points sum to the identity if and only if they are collinear. Over the complex numbers, the group on a smooth cubic is isomorphic to the torus $(\mathbb{R}/\mathbb{Z})^2$, and the group on the smooth points of a singular cubic is isomorphic to $(\mathbb{C},+)$ or $(\mathbb{C}^*,\cdot)$ depending on whether the singularity is a cusp or a node. Over the real numbers, the group on a smooth cubic is isomorphic to $\mathbb{R}/\mathbb{Z}$ or $\mathbb{R}/\mathbb{Z}\times\mathbb{Z}_2$ depending on whether the real curve has one or two semi-algebraically connected components, and the group on the smooth points of a singular cubic is isomorphic to $(\mathbb{R},+)$, $(\mathbb{R},+)\times\mathbb{Z}_2$, or $\mathbb{R}/\mathbb{Z}$ depending on whether the singularity is a cusp, a crunode, or an acnode. See for instance \cite{GT13} for a more detailed description. In higher dimensions, it turns out that an irreducible non-degenerate curve of degree $d+1$ does not necessarily have a natural group structure, but if it has, the behaviour is similar to the planar case. For instance, in $\mathbb{C}\mathbb{P}^3$, an irreducible non-degenerate quartic curve is either an elliptic quartic, with a group isomorphic to an elliptic curve such that four points on the curve are coplanar if and only if they sum to the identity, or a rational curve. There are two types, or species, of rational quartics. The rational quartic curves of the first species are intersections of two quadrics (as are elliptic quartics), they are always singular, and there is a group on the smooth points such that four points on the curve are coplanar if and only if they sum to the identity. Those of the second species lie on a unique quadric, are smooth, and there is no natural group structure analogous to the other cases. See \cite{LS18} for a more detailed account. The picture is similar in higher dimensions. \begin{definition}[Clifford \cite{Clifford}, Klein \cite{Klein}] An \emph{elliptic normal curve} is an irreducible non-degenerate smooth curve of degree $d+1$ in $\mathbb{C}\mathbb{P}^d$ isomorphic to an elliptic curve in the plane. \end{definition} \begin{prop}[\cite{S09}*{Exercise 3.11 and Corollary 5.1.1}, \cite{S94}*{Corollary 2.3.1}]\label{prop:elliptic_group} An elliptic normal curve $\delta$ in $\mathbb{C}\mathbb{P}^d$, $d\geqslant 2$, has a natural group structure such that $d+1$ points in $\delta$ lie on a hyperplane if and only if they sum to the identity. This group is isomorphic to $(\mathbb{R}/\mathbb{Z})^2$. If the curve is real, then the group is isomorphic to $\mathbb{R}/\mathbb{Z}$ or $\mathbb{R}/\mathbb{Z}\times\mathbb{Z}_2$ depending on whether the real curve has one or two semi-algebraically connected components. \end{prop} A similar result holds for singular rational curves of degree $d+1$. Since we need to work with such curves and a description of their group structure is not easily found in the literature, we give a detailed discussion of their properties in the remainder of this section. A \emph{rational curve} $\delta$ in $\mathbb{F}\mathbb{P}^d$ of degree $e$ is a curve that can be parametrised by the projective line, \[ \delta\colon \mathbb{F}\mathbb{P}^1 \to \mathbb{F}\mathbb{P}^d, \quad [x,y] \mapsto [q_0(x,y),\dots,q_{d}(x,y)], \] where each $q_i$ is a homogeneous polynomial of degree $e$ in the variables $x$ and $y$. The following lemma is well known (see for example \cite{SR85}*{p.~38, Theorem~VIII}), and can be proved by induction from the planar case using projection. \begin{prop}\label{prop:curves} An irreducible non-degenerate curve of degree $d+1$ in $\mathbb{C}\mathbb{P}^d$, $d \geqslant 2$, is either an elliptic normal curve or rational. \end{prop} We next describe when an irreducible non-degenerate rational curve of degree $d+1$ in $\mathbb{C}\mathbb{P}^d$ has a natural group structure. It turns out that this happens if and only if the curve is singular. We write $\nu_{d+1}$ for the \emph{rational normal curve} in $\mathbb{C}\mathbb{P}^{d+1}$ \cite{H92}*{Example~1.14}, which we parametrise as \[ \nu_{d+1}:[x,y] \mapsto [y^{d+1},-xy^d,x^2y^{d-1},\dotsc,(-x)^{d-1}y^2,(-x)^dy,(-x)^{d+1}]. \] Any irreducible non-degenerate rational curve $\delta$ of degree $d+1$ in $\mathbb{C}\mathbb{P}^d$ is the projection of the rational normal curve, and we have \[ \delta[x,y] = [y^{d+1},-xy^d,x^2y^{d-1},\dotsc,(-x)^{d-1}y^2,(-x)^dy,(-x)^{d+1}] A, \] where $A$ is a $(d+2)\times(d+1)$ matrix of rank $d+1$ (since $\delta$ is non-degenerate) with entries derived from the coefficients of the polynomials $q_i$ of degree $d+1$ in the parametrisation of the curve (with suitable alternating signs). Thus $\delta \subset \mathbb{C}\mathbb{P}^d$ is the image of $\nu_{d+1}$ under the projection map $\pi_p$ defined by $A$. In particular, the point of projection $p=[p_0,p_1,\dots,p_{d+1}]\in\mathbb{C}\mathbb{P}^{d+1}$ is the ($1$-dimensional) kernel of $A$. If we project $\nu_{d+1}$ from a point $p\in \nu_{d+1}$, then we obtain a rational normal curve in $\mathbb{C}\mathbb{P}^d$. However, since $\delta$ is of degree $d+1$, necessarily $p\notin \nu_{d+1}$. Conversely, it can easily be checked that for any $p\notin \nu_{d+1}$, the projection of $\nu_{d+1}$ from $p$ is a rational curve of degree $d+1$ in $\mathbb{C}\mathbb{P}^d$. We will use the notation $\delta_p$ for this curve. We summarise the above discussion in the following proposition that will be implicitly used in the remainder of the paper. \begin{prop} An irreducible non-degenerate rational curve of degree $d+1$ in $\mathbb{C}\mathbb{P}^d$ is projectively equivalent to $\delta_p$ for some $p\in\mathbb{C}\mathbb{P}^{d+1}\setminus\nu_{d+1}$. \end{prop} We use the projection point $p$ to define a binary form and a multilinear form associated to $\delta_p$. The \emph{fundamental binary form} associated to $\delta_p$ is the homogeneous polynomial of degree $d+1$ in two variables $f_p(x,y) := \sum_{i=0}^{d+1}p_i\binom{d+1}{i}x^{d+1-i}y^i$. Its \emph{polarisation} is the multilinear form $F_p\colon(\mathbb{F}^2)^{d+1}\to\mathbb{F}$ \cite{D03}*{Section~1.2} defined by \[ F_p(x_0,y_0,x_1,y_1,\dots,x_d,y_d) := \frac{1}{(d+1)!}\sum_{I\subseteq\{0,1,\dots,d\}} (-1)^{d+1-|I|} f_p\left(\sum_{i\in I} x_i,\sum_{i\in I} y_i\right). \] Consider the multilinear form $G_p(x_0,y_0,\dots,x_d,y_d) = \sum_{i=0}^{d+1} p_i P_i$, where \begin{equation}\label{eq:P_i} P_i(x_0,y_0,x_1,y_1,\dots,x_d,y_d) := \sum_{I\in\binom{\{0,1,\dots,d\}}{i}}\prod_{j\in\overline{I}} x_j\prod_{j\in I} y_j \end{equation} for each $i=0,\dots,d+1$. Here the sum is taken over all subsets $I$ of $\{0,1,\dots,d\}$ of size $i$, and $\overline{I}$ denotes the complement of $I$ in $\{0,1,\dots,d\}$. It is easy to see that the binary form $f_p$ is the \emph{restitution} of $G_p$, namely \cite{D03}*{Section~1.2} \[ f_p(x,y) = G_p(x,y,x,y,\dots,x,y). \] Since the polarisation of the restitution of a multilinear form is itself \cite{D03}*{Section~1.2}, we must thus have $F_p = G_p$. (This can also be checked directly.) \begin{lemma}\label{lem:cohyperplane} Let $\delta_p$ be an irreducible non-degenerate rational curve of degree $d+1$ in $\mathbb{C}\mathbb{P}^d$, $d\geqslant 2$, where $p\in\mathbb{C}\mathbb{P}^{d+1}\setminus \nu_{d+1}$. A hyperplane intersects $\delta_p$ in $d+1$ points $\delta_p[x_i,y_i]$, $i=0,\dots,d$, counting multiplicity, if and only if $F_p(x_0,y_0,x_1,y_1,\dots,x_d,y_d)=0$. \end{lemma} \begin{proof} We first prove the statement for distinct points $[x_i,y_i]\in\mathbb{C}\mathbb{P}^1$. Then the points $\delta_p[x_i,y_i]$ are all on a hyperplane if and only if the hyperplane in $\mathbb{C}\mathbb{P}^{d+1}$ through the points $\nu_{d+1}[x_i,y_i]$ passes through $p$. It will be sufficient to prove the identity \begin{equation}\label{identity} D:= \det\begin{pmatrix} \nu_{d+1}[x_0,y_0] \\ \vdots \\ \nu_{d+1}[x_d,y_d] \\ p \end{pmatrix} = F_p(x_0,y_0,x_1,y_1,\dots,x_d,y_d) \prod_{0 \leqslant j<k \leqslant d} \begin{vmatrix} x_j & x_k\\ y_j & y_k \end{vmatrix}, \end{equation} since the second factor on the right-hand side does not vanish because the points $[x_i, y_i]$ are distinct. We first note that \begin{align} D &= \begin{vmatrix} y_0^{d+1} & -x_0y_0^d & x_0^2y_0^{d-1} & \dotsc & (-x_0)^dy_0 & (-x_0)^{d+1} \\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\ y_d^{d+1} & -x_d y_d ^d & x_d ^2y_d ^{d-1} & \dotsc & (-x_d )^dy_d & (-x_d )^{d+1} \\ p_0 & p_1 & p_2 & \dotsc & p_d & p_{d+1} \end{vmatrix} \notag \\ & = (-1)^{\left \lfloor \frac{d+2}{2} \right \rfloor} \begin{vmatrix} y_0^{d+1} & x_0y_0^d & x_0^2y_0^{d-1} & \dotsc & x_0^d y_0 & x_0^{d+1} \\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\ y_d^{d+1} & x_d y_d ^d & x_d ^2y_d ^{d-1} & \dotsc & x_d^dy_d & x_d^{d+1} \\[3pt] p_0 & -p_1 & p_2 & \dotsc & (-1)^d p_d & (-1)^{d+1} p_{d+1} \end{vmatrix}. \label{det} \end{align} We next replace $(-1)^i p_i$ by $x^i y^{d+1-i}$ for each $i=0,\dots,d+1$ in the last row of the determinant in \eqref{det} and obtain the Vandermonde determinant \begin{align*} \phantom{D} &\mathrel{\phantom{=}} (-1)^{\left \lfloor \frac{d+2}{2} \right \rfloor} \begin{vmatrix} y_0^{d+1} & x_0y_0^d & x_0^2y_0^{d-1} & \dotsc & x_0^d y_0 & x_0^{d+1} \\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\ y_d^{d+1} & x_d y_d^d & x_d^2 y_d^{d-1} & \dotsc & x_d^d y_d & x_d^{d+1} \\[3pt] y^{d+1} & x y^d & x^2 y^{d-1} & \dotsc & x^d y & x^{d+1} \end{vmatrix} \\ &= (-1)^{\left \lfloor \frac{d+2}{2} \right \rfloor} \prod_{0\leqslant j<k\leqslant d} \begin{vmatrix} y_j & y_k \\ x_j & x_k \end{vmatrix} \prod_{0\leqslant j\leqslant d} \begin{vmatrix} y_j & y \\ x_j & x \end{vmatrix} \\ &= (-1)^{\left \lfloor \frac{d+2}{2} \right \rfloor} (-1)^{\binom{d+2}{2}} \prod_{0\leqslant j<k\leqslant d} \begin{vmatrix} x_j & x_k \\ y_j & y_k \end{vmatrix} \prod_{0\leqslant j\leqslant d} \begin{vmatrix} x_j & x \\ y_j & y \end{vmatrix}. \end{align*} Finally, note that $(-1)^{\lfloor(d+2)/2\rfloor} (-1)^{\binom{d+2}{2}} = 1$ and that the coefficient of $x^i y^{d+1-i}$ in $\prod_{0\leqslant j\leqslant d} \begin{vmatrix} x_j & x \\ y_j & y \end{vmatrix}$ is \[ \sum_{I\subseteq\binom{\{0,\dots,d\}}{i}}\prod_{j\in I}(-y_j)\prod_{j\in\overline{I}} x_j = (-1)^iP_i, \] where $P_i$ is as defined in \eqref{eq:P_i}. It follows that the coefficient of $p_i$ in \eqref{det} is $P_i$, and \eqref{identity} follows. We next complete the argument for the case when the points $[x_i,y_i]$ are not all distinct. First suppose that a hyperplane $\Pi$ intersects $\delta_p$ in $\delta_p[x_i,y_i]$, $i=0,\dots,d$. By Bertini's theorem \cite{H77}*{Theorem~II.8.18 and Remark~II.8.18.1}, there is an arbitrarily close perturbation $\Pi'$ of $\Pi$ that intersects $\delta_p$ in distinct points $\delta_p[x_i',y_i']$. By what has already been proved, $F_p(x_0',y_0',\dots,x_d',y_d')=0$. Since $\Pi'$ is arbitrarily close and $F_p$ is continuous, $F_p[x_0,y_0,\dots,x_d,y_d]=0$. Conversely, suppose that $F_p(x_0,y_0,\dots,x_d,y_d)=0$ where the $[x_i,y_i]$ are not all distinct. Perturb the points $[x_0,y_0],\dots,[x_{d-1},y_{d-1}]$ by an arbitrarily small amount to $[x_0',y_0'],\dots,[x_{d-1}',y_{d-1}']$ respectively, so as to make $\delta_p[x_0',y_0'],\dots,\delta_p[x_{d-1}',y_{d-1}']$ span a hyperplane $\Pi'$ that intersects $\delta_p$ again in $\delta_p[x_d',y_d']$, say, and so that $[x_0',y_0'],\dots,[x_{d}',y_{d}']$ are all distinct. If we take the limit as $[x_i',y_i']\to[x_i,y_i]$ for each $i=0,\dots,d-1$, we obtain a hyperplane $\Pi$ intersecting $\delta_p$ in $\delta_p[x_0,y_0],\dots,\delta_p[x_{d-1},y_{d-1}],\delta_p[x_d'',y_d'']$, say. Then $F_p(x_0,y_0,\dots,x_{d-1},y_{d-1},x_d'',y_d'')=0$. Since the multilinear form $F_p$ is non-trivial, it follows that $[x_d,y_d]=[x_d'',y_d'']$. Therefore, $\Pi$ is a hyperplane that intersects $\delta_p$ in $\delta_p[x_i,y_i]$, $i=0,\dots,d$. \end{proof} The secant variety $\Sec_{\mathbb{C}}(\nu_{d+1})$ of the rational normal curve $\nu_{d+1}$ in $\mathbb{C}\mathbb{P}^{d+1}$ is equal to the set of points that lie on a proper secant or tangent line of $\nu_{d+1}$, that is, on a line with intersection multiplicity at least $2$ with $\nu_{d+1}$. We also define the real secant variety of $\nu_{d+1}$ to be the set $\Sec_{\mathbb{R}}(\nu_{d+1})$ of points in $\mathbb{R}\mathbb{P}^{d+1}$ that lie on a line that either intersects $\nu_{d+1}$ in two distinct real points or is a tangent line of $\nu_{d+1}$. The \emph{tangent variety} $\Tan_{\mathbb{F}}(\nu_{d+1})$ of $\nu_{d+1}$ is defined to be the set of points in $\mathbb{F}\mathbb{P}^{d+1}$ that lie on a tangent line of $\nu_{d+1}$. We note that although $\Tan_{\mathbb{R}}(\nu_{d+1}) = \Tan_{\mathbb{C}}(\nu_{d+1})\cap\mathbb{R}\mathbb{P}^{d+1}$, we only have a proper inclusion $\Sec_{\mathbb{R}}(\nu_{d+1}) \subset \Sec_{\mathbb{C}}(\nu_{d+1})\cap\mathbb{R}\mathbb{P}^{d+1}$ for $d\geqslant 2$. We will need a concrete description of $\Sec_{\mathbb{C}}(\nu_{d+1})$ and its relation to the smoothness of the curves $\delta_p$. For any $p\in\mathbb{F}\mathbb{P}^{d+1}$ and $k=2,\dots,d-1$, define the $(k+1)\times(d-k+2)$ matrix \begin{equation*} M_{k}(p) := \begin{pmatrix} p_0 & p_1 & p_2 & \dots & p_{d-k+1} \\ p_1 & p_2 & p_3 & \dots & p_{d-k+2} \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ p_k & p_{k+1} & p_{k+2} & \dots & p_{d+1} \end{pmatrix}. \end{equation*} Suppose that $\delta_p$ has a double point, say $\delta_p[x_0,y_0]=\delta_p[x_1,y_1]$. This is equivalent to $p$, $\nu_{d+1}[x_0,y_0]$, and $\nu_{d+1}[x_1,y_1]$ being collinear, which is equivalent to $p$ being on the secant variety of $\nu_{d+1}$. (In the degenerate case where $[x_0,y_0]=[x_1,y_1]$, we have that $p\in\Tan_\mathbb{F}(\nu_{d+1})$.) Then $\delta_p[x_0,y_0]$, $\delta_p[x_1,y_1]$, $\delta_p[x_2,y_2]$,\dots, $\delta_p[x_d,y_d]$ are on a hyperplane in $\mathbb{F}\mathbb{P}^d$ for all $[x_2,y_2],\dots,[x_d,y_d]\in\mathbb{F}\mathbb{P}^1$. It follows that the coefficients of $F_p(x_0,y_0,x_1,y_1,x_2,y_2,\dots,x_d,y_d)$ as a polynomial in $x_2,y_2,\dots,x_d,y_d$ all vanish, that is, \[ p_ix_0x_1 + p_{i+1}(x_0y_1+y_0x_1) + p_{i+2}y_0y_1 = 0\] for all $i=0,\dots,d-1$. This can be written as $[x_0x_1, x_0y_1 + y_0x_1, y_0y_1] M_{2}(p) = 0$. Conversely, if $M_{2}(p)$ has rank $2$ with say $[c_0, 2c_1, c_2] M_{2}(p) = 0$, then there is a non-trivial solution to the linear system with $c_0 = x_0x_1$, $c_1 = x_0y_1 + y_0x_1$, $c_2 = y_0y_1$, and we have $c_0x^2+2c_1xy+c_2y^2 = (x_0x+y_0y)(x_1x+y_1y)$. In the degenerate case where $[x_0,y_0]=[x_1,y_1]$, we have that the quadratic form has repeated roots. It follows that $M_{2}(p)$ has rank at most $2$ if and only if $p\in\Sec_{\mathbb{C}}(\nu_{d+1})$ (also note that $M_{2}(p)$ has rank $1$ if and only if $p\in\nu_{d+1}$). We note for later use that since the null space of $M_{2}(p)$ is $1$-dimensional if it has rank $2$, it follows that each $p\in\Sec_{\mathbb{C}}(\nu_{d+1})$ lies on a unique secant (which might degenerate to a tangent). This implies that $\delta_p$ has a unique singularity when $p\in\Sec_{\mathbb{C}}(\nu_{d+1})\setminus{\nu_{d+1}}$, which is a node if $p\in\Sec_{\mathbb{C}}(\nu_{d+1})\setminus\Tan_{\mathbb{C}}(\nu_{d+1})$ and a cusp if $p\in\Tan_{\mathbb{C}}(\nu_{d+1})\setminus{\nu_{d+1}}$. In the real case there are two types of nodes. If $p\in\Sec_{\mathbb{R}}(\nu_{d+1})\setminus\nu_{d+1}$, then the roots $[x_0,y_0],[x_1,y_1]$ are real, and $\delta_p$ has either a cusp when $p\in\Tan_{\mathbb{R}}(\nu_{d+1})\setminus\nu_{d+1}$ and $[x_0,y_0]=[x_1,y_1]$, or a crunode when $p\in\Sec_{\mathbb{R}}(\nu_{d+1})\setminus\Tan_{\mathbb{R}}(\nu_{d+1})$ and $[x_0,y_0]$ and $[x_1,y_1]$ are distinct roots of the real binary quadratic form $c_0x^2+2c_1xy+c_2y^2$. If $p\in\Sec_{\mathbb{C}}(\nu_{d+1})\setminus\Sec_{\mathbb{R}}(\nu_{d+1})\cap\mathbb{R}\mathbb{P}^{d+1}$ then the quadratic form has conjugate roots $[x_0,y_0]=[\overline{x_1},\overline{y_1}]$ and $\delta_p$ has an acnode. If $p\notin\Sec(\nu_{d+1})$, then $\delta_p$ is a smooth curve of degree $d+1$. It follows that $\delta_p$ is singular if and only if $p\in\Sec(\nu_{d+1})\setminus{\nu_{d+1}}$. For the purposes of this paper, we make the following definitions. \begin{definition} A \emph{rational singular curve} is an irreducible non-degenerate singular rational curve of degree $d+1$ in $\mathbb{C}\mathbb{P}^d$. In the real case, a \emph{rational cuspidal curve}, \emph{rational crunodal curve}, or \emph{rational acnodal curve} is a rational singular curve isomorphic to a singular planar cubic with a cusp, crunode, or acnode respectively. \end{definition} In particular, we have shown the case $k=2$ of the following well-known result. \begin{prop}[\cite{H92}*{Proposition~9.7}]\label{prop:secant} Let $d\geqslant 3$. For any $k=2,\dots,d-1$, the secant variety of $\nu_{d+1}$ is equal to the locus of all $[p_0, p_1,\dots,p_{d+1}]$ such that $M_{k}(p)$ has rank at most~$2$. \end{prop} \begin{corollary}\label{lem:first_species} Let $d\geqslant 3$. For any $k=2,\dots,d-1$ and $p\in\mathbb{C}\mathbb{P}^{d+1}\setminus\nu_{d+1}$, the curve $\delta_p$ of degree $d+1$ in $\mathbb{C}\mathbb{P}^d$ is singular if and only if $\rank M_{k}(p) \leqslant 2$. \end{corollary} We next use Corollary~\ref{lem:first_species} to show that the projection of a smooth rational curve of degree $d+1$ in $\mathbb{C}\mathbb{P}^d$ from a generic point on the curve is again smooth when $d\geqslant 4$. This is not true for $d=3$, as there is a trisecant through each point of a quartic curve of the second species in $3$-space. (The union of the trisecants form the unique quadric on which the curve lies \cite{H92}*{Exercise 8.13}.) \begin{lemma}\label{lemma:singular_projection} Let $\delta_p$ be a smooth rational curve of degree $d+1$ in $\mathbb{C}\mathbb{P}^d$, $d\geqslant 4$. Then for all but at most three points $q\in\delta_p$, the projection $\overline{\pi_q(\delta_p\setminus\{q\})}$ is a smooth rational curve of degree $d$ in $\mathbb{C}\mathbb{P}^{d-1}$. \end{lemma} \begin{proof} Let $q=\delta_p[x_0,y_0]$. Suppose that $\overline{\pi_q(\delta_p\setminus\{q\})}$ is singular. Then there exist $[x_1,y_1]$ and $[x_2,y_2]$ such that $\pi_q(\delta_p[x_1,y_1])=\pi_q(\delta_p[x_2,y_2])$ and the points $\delta_p[x_0,y_0]$, $\delta_p[x_1,y_1]$, and $\delta_p[x_2,y_2]$ are collinear. Then for arbitrary $[x_3,y_3],\dots,[x_d,y_d]\in\mathbb{C}\mathbb{P}^1$, the points $\delta_p[x_i,y_i]$, $i=0,\dots,d$ are on a hyperplane, so by Lemma~\ref{lem:cohyperplane}, $F_p(x_0,y_0,\dots,x_d,y_d)$ is identically $0$ as a polynomial in $x_3,y_3,\dots,x_d,y_d$. The coefficients of this polynomial are of the form \[ p_i x_0x_1x_2 + p_{i+1}(x_0x_1y_2+x_0y_1x_2+y_0x_1x_2) + p_{i+2}(x_0y_1y_2+y_0x_1y_2+y_0y_1x_2) + p_{i+3} y_0y_1y_2 \] for $i=0,\dots,d-2$. This means that the linear system $[c_0, 3c_1, 3c_2, c_3] M_3(p) = 0$ has a non-trivial solution $c_0=x_0x_1x_2$, $3c_1=x_0x_1y_2+x_0y_1x_2+y_0x_1x_2$, $3c_2=x_0y_1y_2+y_0x_1y_2+y_0y_1x_2$, $c_3=y_0y_1y_2$. The binary cubic form $c_0 x^3 + 3c_1 x^2y + c_2 xy^2 + c_3 y^3$ then has the factorisation $(x_0x+y_0y)(x_1x+y_1y)(x_2x+y_2y)$, hence its roots give the collinear points on $\delta_p$. Since $\delta_p$ is smooth, $M_3(p)$ has rank at least $3$ by Corollary~\ref{lem:first_species}, and so the cubic form is unique up to scalar multiples. It follows that there are at most three points $q$ such that the projection $\overline{\pi_q(\delta_p\setminus\{q\})}$ is not smooth. \end{proof} We need the following theorem on the fundamental binary form $f_p$ that is essentially due to Sylvester \cite{S51} to determine the natural group structure on rational singular curves. Reznick \cite{Rez2013} gives an elementary proof of the generic case where $p$ does not lie on the tangent variety. (See also Kanev \cite{K99}*{Lemma~3.1} and Iarrobino and Kanev \cite{IK99}*{Section~1.3}.) We provide a very elementary proof that includes the non-generic case. \begin{theorem}[Sylvester \cite{S51}]\label{thm:sylvester} Let $d\geqslant 2$. \begin{enumerate}[label=\rom] \item \label{sylvester1} If $p\in\Tan_{\mathbb{C}}(\nu_{d+1})$, then there exist binary linear forms $L_1,L_2$ such that $f_p(x,y)=L_1(x,y)^dL_2(x,y)$. Moreover, if $p \notin \nu_{d+1}$ then $L_1$ and $L_2$ are linearly independent, and if $p\in\mathbb{R}\mathbb{P}^{d+1}$ then $L_1$ and $L_2$ are both real. \item\label{sylvester2} If $p\in\Sec_{\mathbb{C}}(\nu_{d+1})\setminus\Tan_{\mathbb{C}}(\nu_{d+1})$, then there exist linearly independent binary linear forms $L_1, L_2$ such that $f_p(x,y) = L_1(x,y)^{d+1} - L_2(x,y)^{d+1}$. Moreover, if $p\in\mathbb{R}\mathbb{P}^{d+1}\setminus\Sec_{\mathbb{R}}(\nu_{d+1})$ then $L_1$ and $L_2$ are complex conjugates, while if $p\in\Sec_{\mathbb{R}}(\nu_{d+1})$ then there exist linearly independent real binary linear forms $L_1, L_2$ such that $f_p(x,y) = L_1(x,y)^{d+1} \pm L_2(x,y)^{d+1}$, where we can always choose the lower sign when $d$ is even, and otherwise depends on $p$. \end{enumerate} \end{theorem} \begin{proof} \ref{sylvester1}: We work over $\mathbb{F}\in\{\mathbb{R},\mathbb{C}\}$. Let $p = [p_0,p_1,\dots,p_{d+1}]\in \Tan_\mathbb{F}(\nu_{d+1})$. Let $p_*=\nu_{d+1}[\alpha_1,\alpha_2]$ be the point on $\nu_{d+1}$ such that the line $pp_*$ is tangent to $\nu_{d+1}$ (if $p\in\nu_{d+1}$, we let $p_*=p$). We will show that \begin{equation}\label{tangent} f_p(x,y) = \sum_{i=0}^{d+1} p_i\binom{d+1}{i}x^{d+1-i}y^i = (\alpha_2 x - \alpha_1 y)^d(\beta_2 x-\beta_1 y) \end{equation} for some $[\beta_1,\beta_2]\in\mathbb{F}\mathbb{P}^1$. First consider the special case $\alpha_1=0$. Then $p_*=[1,0,\dots,0]$ and the tangent to $\nu_{d+1}$ at $p_*$ is the line $x_2=x_3=\dots=x_{d+1}=0$. It follows that $f_p(x,y)= p_0x^{d+1} + p_1(d+1)x^dy = (1x-0y)^d(p_0x+p_1(d+1)y)$. If $p_1 = 0$, then $p = p_* \in \nu_{d+1}$. Thus, if $p \notin \nu_{d+1}$, then $p_1 \ne 0$, and $x$ and $p_0x+p_1(d+1)y$ are linearly independent. We next consider the general case $\alpha_1\neq 0$. Equating coefficients in \eqref{tangent}, we see that we need to find $[\beta_1,\beta_2]$ such that \[ p_i\binom{d+1}{i} = \binom{d}{i}\alpha_2^{d-i}(-\alpha_1)^i\beta_2-\binom{d}{i-1}\alpha_2^{d-i+1}(-\alpha_1)^{i-1}\beta_1 \] for each $i=0,\dots,d+1$, where we use the convention $\binom{d}{-1}=\binom{d}{d+1}=0$. This can be simplified to \begin{equation}\label{tangent2} p_i = \left(1-\frac{i}{d+1}\right)\alpha_2^{d-i}(-\alpha_1)^i\beta_2 - \frac{i}{d+1}\alpha_2^{d-i+1}(-\alpha_1)^{i-1}\beta_1. \end{equation} Since we are working projectively, we can fix the value of $\beta_1$ from the instance $i=d+1$ of~\eqref{tangent2} to get \begin{equation}\label{tangent3} p_{d+1} = -(-\alpha_1)^d\beta_1. \end{equation} If $p_{d+1}\neq 0$, we can divide \eqref{tangent2} by \eqref{tangent3}. After setting $\alpha=\alpha_2/\alpha_1$, $\beta=\beta_2/\beta_1$, and $a_i=p_i/p_{d+1}$, we then have to show that for some $\beta\in\mathbb{F}$, \begin{equation}\label{eqn:*} a_i = -\left(1-\frac{i}{d+1}\right)(-\alpha)^{d-i}\beta+\frac{i}{d+1}(-\alpha)^{d-i+1} \end{equation} for each $i=0,\dots,d$. We next calculate in the affine chart $x_{d+1}=1$ where the rational normal curve becomes $\nu_{d+1}(t) = ((-t)^{d+1},(-t)^d,\dots,-t)$, $p=(a_0,\dots,a_d)$, and $p_*=\nu_{d+1}(\alpha)$. The tangency condition means that $p_*-p$ is a scalar multiple of \[\nu_{d+1}'(\alpha) = ((d+1)(-\alpha)^d,d(-\alpha)^{d-1},\dots,2\alpha,-1), \] that is, we have for some $\lambda\in\mathbb{F}$ that $(-\alpha)^{d+1-i}-a_i = \lambda(d+1-i)(-\alpha)^{d-i}$ for all $i=0,\dots,d$. Set $\beta=\alpha+\lambda(d+1)$. Then $(-\alpha)^{d+1-i}-a_i = (\beta-\alpha)(1-\frac{i}{d+1})(-\alpha)^{d-i}$, and we have \begin{align*} a_i &= (-\alpha)^{d+1-i}-(\beta-\alpha)\left(1-\frac{i}{d+1}\right)(-\alpha)^{d-i} \\ &= -\left(1-\frac{i}{d+1}\right)(-\alpha)^{d-i}\beta+\frac{i}{d+1}(-\alpha)^{d-i+1}, \end{align*} giving \eqref{eqn:*} as required. If $\alpha = \beta$, then $\lambda = 0$ and $p = p_* \in \nu_{d+1}$. Thus, if $p \notin \nu_{d+1}$, then $\alpha \ne \beta$, and $\alpha_2 x - \alpha_1 y$ and $\beta_2 x - \beta_1 y$ are linearly independent. We still have to consider the case $p_{d+1}=0$. Then $\beta_1=0$ and we need to find $\beta_2$ such that \begin{equation}\label{eqn:**} p_i = \left(1-\frac{i}{d+1}\right)\alpha_2^{d-i}(-\alpha_1)^i\beta_2 \end{equation} for all $i=0,\dots,d$. Since $p_{d+1}=0$, we have that $\nu_{d+1}'(\alpha)$ is parallel to $(p_0,\dots,p_d)$, that is, \[ p_i = \lambda(d+1-i)(-\alpha)^{d-i}\] for some $\lambda\in\mathbb{F}^*$. Set $\beta_2 = \lambda(d+1)/(-\alpha_1)^d$. Then \begin{equation*} p_i = \frac{(-\alpha_1)^d\beta_2}{d+1}(d+1-i)\left(\frac{\alpha_2}{-\alpha_1}\right)^{d-i} = \left(1-\frac{i}{d+1}\right)\alpha_2^{d-i}(-\alpha_1)^i\beta_2, \end{equation*} again giving \eqref{eqn:**} as required. Note that since $\alpha_1 \ne 0$ but $\beta_1 = 0$, $\alpha_2 x - \alpha_1 y$ and $\beta_2 x - \beta_1 y$ are linearly independent. Note also that since $\lambda \ne 0$, we have $\beta_2 \ne 0$ and $p \ne [1,0,\dotsc,0]$, hence $p \notin \nu_{d+1}$. \ref{sylvester2}: Let $p=[p_0,\dots,p_{d+1}] \in \Sec_{\mathbb{C}}(\nu_{d+1})\setminus\Tan_{\mathbb{C}}(\nu_{d+1})$, and suppose that $p$ lies on the secant line through the distinct points $p_1 := \nu_{d+1}[\alpha_1, \alpha_2]$ and $p_2 := \nu_{d+1}[\beta_1, \beta_2]$. Since $p, p_1, p_2$ are distinct and collinear, there exist $\mu_1, \mu_2\in\mathbb{C}^*$ such that $p = \mu_1 p_1 + \mu_2 p_2$. This means that for $i = 0, \dotsc, d+1$, we have \[ p_i = \mu_1(-\alpha_1)^i\alpha_2^{d+1-i} + \mu_2(-\beta_1)^i\beta_2^{d+1-i}. \] Then \begin{align*} f_p(x,y) &= \sum_{i=0}^{d+1} p_i \binom{d+1}{i} x^{d+1-i} y^{i} \\ &= \mu_1\sum_{i=0}^{d+1}\binom{d+1}{i}(\alpha_2 x)^{d+1-i}(-\alpha_1 y)^i + \mu_2 \sum_{i=0}^{d+1}\binom{d+1}{i}(\beta_2 x)^{d+1-i}(-\beta_1 y)^i \\ &= \mu_1(\alpha_2 x-\alpha_1 y)^{d+1} + \mu_2(\beta_2 x-\beta_1 y)^{d+1}\\ &= L_1(x,y)^{d+1}- L_2(x,y)^{d+1} \end{align*} where the linear forms $L_1,L_2$ are linearly independent. If $p\in\mathbb{R}\mathbb{P}^{d+1}\setminus{\Sec_{\mathbb{R}}(\nu_{d+1})}$, then $f_p$ is real and $p_1$ and $p_2$ are non-real points. Taking conjugates, we have \[ p = \overline{\mu_1}\nu_{d+1}[\overline{\alpha_1},\overline{\alpha_2}]+\overline{\mu_2}\nu_{d+1}[\overline{\beta_1},\overline{\beta_2}] \] as vectors, and because of the uniqueness of secants of the rational normal curve through a given point, we obtain $\overline{\mu_1}=\mu_2$ and $\nu_{d+1}[\overline{\alpha_1},\overline{\alpha_2}] = \nu_{d+1}[\beta_1,\beta_2]$, hence $\overline{\alpha_1}=\beta_1$ and $\overline{\alpha_2}=\beta_2$. It follows that $\overline{L_1(x,y)} = L_2(\overline{x},\overline{y})$. If $p\in\Sec_{\mathbb{R}}(\nu_{d+1})$, then $p_1$ and $p_2$ are real, so $[\mu_1,\mu_2],[\alpha_1,\alpha_2],[\beta_1,\beta_2]\in\mathbb{R}\mathbb{P}^1$, and we obtain $f_p(x,y)=L_1^{d+1}\pm L_2^{d+1}$ for some linearly independent $L_1,L_2$ over $\mathbb{R}$, where the choice of sign depends on~$p$. \end{proof} We are now in a position to describe the group laws on rational singular curves. We first note the effect of a change of coordinates on the parametrisation of $\delta_p$. Let $\varphi\colon\mathbb{F}\mathbb{P}^1\to\mathbb{F}\mathbb{P}^1$ be a projective transformation. Then $\nu_{d+1}\circ\varphi$ is a reparametrisation of the rational normal curve. It is not difficult to see that there exists a projective transformation $\psi\colon\mathbb{F}\mathbb{P}^{d+1}\to\mathbb{F}\mathbb{P}^{d+1}$ such that $\nu_{d+1}\circ\varphi = \psi\circ\nu_{d+1}$. It follows that if we reparametrise $\delta_p$ using $\varphi$, we obtain \[ \delta_p\circ\varphi = \pi_p\circ\nu_{d+1}\circ\varphi = \pi_p\circ\psi\circ\nu_{d+1} = \psi'\circ\pi_{\psi^{-1}(p)}\circ\nu_{d+1}\cong\delta_{\psi^{-1}(p)}, \] where $\psi'\colon\mathbb{F}\mathbb{P}^d\to\mathbb{F}\mathbb{P}^d$ is an appropriate projective transformation such that first transforming $\mathbb{F}\mathbb{P}^{d+1}$ with $\psi$ and then projecting from $p$ is the same as projecting from $\psi^{-1}(p)$ and then transforming $\mathbb{F}\mathbb{P}^d$ with $\psi'$. So by reparametrising $\delta_p$, we obtain $\delta_{p'}$ for some other point $p'$ that is in the orbit of $p$ under the action of projective transformations that fix $\nu_{d+1}$. Since $\delta_p\circ\varphi[x_0,y_0],\dots,\delta_p\circ\varphi[x_d,y_d]$ lie on a hyperplane if and only if the $\delta_{\psi^{-1}(p)}[x_i,y_i]$'s are on a hyperplane, it follows from Lemma~\ref{lem:cohyperplane} that $F_p(\varphi(x_0,y_0),\dots,\varphi(x_d,y_d))$ is a scalar multiple of $F_{\psi^{-1}(p)}(x_0,y_0,\dots,x_d,y_d)$, in which case $f_p\circ\varphi = f_{\psi^{-1}(p)}$ up to a scalar multiple. Thus, we obtain the same reparametrisation of the fundamental binary form $f_p$. \begin{prop}\label{prop:rational_group} A rational singular curve $\delta_p$ in $\mathbb{C}\mathbb{P}^d$ has a natural group structure on its subset of smooth points $\delta_p^*$ such that $d+1$ points in $\delta_p^*$ lie on a hyperplane if and only if they sum to the identity. This group is isomorphic to $(\mathbb{C},+)$ if the singularity of $\delta_p$ is a cusp and isomorphic to $(\mathbb{C}^*,\cdot)$ if the singularity is a node. If the curve is real and cuspidal or acnodal, then it has a group isomorphic to $(\mathbb{R},+)$ or $\mathbb{R}/\mathbb{Z}$ depending on whether the singularity is a cusp or an acnode, such that $d+1$ points in $\delta_p^*$ lie on a hyperplane if and only if they sum to the identity. If the curve is real and the singularity is a crunode, then the group is isomorphic to $(\mathbb{R},+) \times \mathbb{Z}_2$, but $d+1$ points in $\delta_p^*$ lie on a hyperplane if and only if they sum to $(0,0)$ or $(0,1)$, depending on $p$. \end{prop} \begin{proof} First suppose $\delta_p$ is cuspidal and $\mathbb{F}\in\{\mathbb{R},\mathbb{C}\}$, so that $p \in \Tan_{\mathbb{F}}(\nu_{d+1}) \setminus{\nu_{d+1}}$. By Theorem~\ref{thm:sylvester}, $f_p=L_1^dL_2$ for some linearly independent linear forms $L_1$ and $L_2$. By choosing $\varphi$ appropriately, we may assume without loss of generality that $L_1(x,y)=x$ and $L_2(x,y)=(d+1)y$, so that $f_p(x,y)=(d+1)x^dy$ and $p=[0,1,0,\dots,0]$, with the cusp of $\delta_p$ at $\delta_p[0,1]$. It follows that the polarisation of $f_p$ is $F_p(x_0,y_0,\dotsc,x_d,y_d)= P_1 = x_0x_1\dotsb x_d\sum_{i=0}^d y_i/x_i$. For $[x_i,y_i]\neq[0,1]$, $i=0,\dots,d$, the points $\delta_p[x_i,y_i]$ are on a hyperplane if and only if $\sum_{i=0}^d y_i/x_i=0$. Thus we identify $\delta_p[x,y]\in\delta_p^*$ with $y/x\in\mathbb{F}$, and the group is $(\mathbb{F},+)$. Next suppose $\delta_p$ is nodal, so that $p \in \Sec_{\mathbb{C}}(\nu_{d+1})\setminus\Tan_{\mathbb{C}}(\nu_{d+1})$. By Theorem~\ref{thm:sylvester}, $f_p=L_1^{d+1}-L_2^{d+1}$ for some linearly independent linear forms $L_1$ and $L_2$. Again by choosing $\varphi$ appropriately, we may assume without loss of generality that $L_1(x,y)=x$ and $L_2(x,y)=y$, so that $f_p(x,y)=x^{d+1}-y^{d+1}$ and $p=[1,0,\dots,0,-1]$, with the node of $\delta_p$ at $\delta_p[0,1]=\delta_p[1,0]$. The polarisation of $f_p$ is $F_p(x_0,y_0,\dots,x_d,y_d)= P_0-P_{d+1} = x_0x_1\dotsb x_d - y_0y_1\dotsb y_d$. Therefore, $\delta_p[x_i,y_i]$, $i=0,\dotsc,d$, are on a hyperplane if and only if $\prod_{i=0}^d y_i/x_i = 1$. Thus we identify $\delta_p[x,y]\in\delta_p^*$ with $y/x\in\mathbb{C}^*$, and the group is $(\mathbb{C}^*,\cdot)$. Now suppose $\delta_p$ is real and the node is an acnode. Then the linearly independent linear forms $L_1$ and $L_2$ given by Theorem~\ref{thm:sylvester} are $L_1(x,y) = \alpha x+ \beta y$ and $L_2(x,y)=\overline{\alpha} x + \overline{\beta} y$ for some $\alpha,\beta\in\mathbb{C}\setminus\mathbb{R}$. There exists $\varphi\colon\mathbb{R}\mathbb{P}^1\to\mathbb{R}\mathbb{P}^1$ such that $L_1\circ\varphi = x + iy$ and $L_2\circ\varphi = x-iy$, hence we may assume after such a reparametrisation that $f_p(x,y) = (x+iy)^{d+1} - (x-iy)^{d+1}$ and that the node is at $\delta_p[i,1]=\delta_p[-i,1]$. The polarisation of $f_p$ is $F_p(x_0,y_0,\dots,x_d,y_d) = \prod_{j=0}^d(x_j+iy_j) - \prod_{j=0}^d(x_j-iy_j)$, and it follows that $\delta_p[x_0,y_0], \dotsc, \delta_p[x_d,y_d]$ are collinear if and only if $\prod_{j=0}^d\frac{x_j+iy_j}{x_j-iy_j} = 1$. We now identify $\mathbb{R}\mathbb{P}^1$ with the circle $\mathbb{R}/\mathbb{Z} \cong \setbuilder{z \in \mathbb{C}}{|z|=1}$ using the M\"obius transformation $[x,y]\to \frac{x+iy}{x-iy}$. It remains to consider the crunodal case. Then, similar to the complex nodal case, we obtain after a reparametrisation that $\delta_p[x_i,y_i]$, $i = 0, \dotsc, d$, are on a hyperplane if and only if $\prod_{i=0}^d y_i/x_i = \pm 1$, where the sign depends on $p$. Thus we identify $\delta_p[x,y]\in\delta_p^*$ with $y/x\in\mathbb{R}^*$, and the group is $(\mathbb{R}^*,\cdot)\cong\mathbb{R}\times\mathbb{Z}_2$, where $\pm 1\in\mathbb{R}^*$ corresponds to $(0,0),(0,1)\in\mathbb{R}\times\mathbb{Z}_2$ respectively. \end{proof} The group on an elliptic normal curve or a rational singular curve of degree $d+1$ as described in Propositions~\ref{prop:elliptic_group} and \ref{prop:rational_group} is not uniquely determined by the property that $d+1$ points lie on a hyperplane if and only if they sum to some fixed element $c$. Indeed, for any $t\in(\delta^*,\oplus)$, $x\boxplus y:= x\oplus y\oplus t$ defines another abelian group on $\delta^*$ with the property that $d+1$ points lie on a hyperplane if and only if they sum to $c\oplus dt$. However, these two groups are isomorphic in a natural way with an isomorphism given by the translation map $x\mapsto x\ominus t$. The next proposition show that we always get uniqueness up to some translation. It will be used in Section~\ref{sec:extremal}. \begin{prop}\label{prop:unique} Let $(G,\oplus,0)$ and $(G,\boxplus,0')$ be abelian groups on the same ground set, such that for some $d\geqslant 2$ and some $c,c'\in G$, \[ x_1\oplus\dotsb\oplus x_{d+1} =c \iff x_1\boxplus\dotsb\boxplus x_{d+1}=c'\quad\text{for all }x_1,\dots,x_{d+1}\in G.\] Then $(G,\oplus,0) \to (G,\boxplus,0'), x\mapsto x\boxminus 0 = x \oplus 0'$ is an isomorphism, and \[ c'=c\boxplus \underbrace{0 \boxplus \dotsb \boxplus 0}_\text{$d$ times} = c \ominus (\underbrace{0' \oplus \dotsb \oplus 0'}_\text{$d$ times}). \] \end{prop} \begin{proof} It is clear that the cases $d\geqslant 3$ follow from the case $d=2$, which we now show. First note that for any $x,y\in G$, $x\boxplus y\boxplus(c \ominus x \ominus y) = c'$ and $(x \oplus y)\boxplus 0\boxplus(c \ominus x \ominus y) = c'$, since $x \oplus y \oplus (c \ominus x \ominus y)=(x \oplus y) \oplus 0 \oplus (c \ominus x \ominus y)=c$. Thus we have $x\boxplus y = (x \oplus y)\boxplus 0$, hence $(x \oplus y) \boxminus 0 = x \boxplus y \boxminus 0 \boxminus 0 = (x \boxminus 0) \boxplus (y \boxminus 0)$. Similarly we have $x \oplus y=(x\boxplus y) \oplus 0'$, hence $x \boxplus y = x \oplus y \ominus 0'$, so in particular $0' = 0 \boxminus 0 = 0 \oplus (\boxminus 0) \ominus 0'$, and $\boxminus 0 = 0' \oplus 0'$. So we also have $x\boxminus 0 = x \oplus (\boxminus 0) \ominus 0' = x \oplus 0'$, and $(G,\oplus,0) \to (G,\boxplus,0'), x\mapsto x\boxminus 0 = x \oplus 0'$ is an isomorphism. \end{proof} \section{Structure theorem}\label{sec:proof} We prove Theorem~\ref{thm:main1} in this section. The main idea is to induct on the dimension $d$ via projection. We start with the following statement of the slightly different case $d=3$, which is \cite{LS18}*{Theorem~1.1}. Note that it contains one more type that does not occur when $d\geqslant 4$. \begin{theorem}\label{thm:plane} Let $K > 0$ and suppose $n \geqslant C\max\{K^8,1\}$ for some sufficiently large absolute constant $C > 0$. Let $P$ be a set of $n$ points in $\mathbb{R}\mathbb{P}^3$ with no $3$ points collinear. If $P$ spans at most $Kn^2$ ordinary planes, then up to projective transformations, $P$ differs in at most $O(K)$ points from a configuration of one of the following types: \begin{enumerate}[label=\rom] \item A subset of a plane; \item A subset of two disjoint conics lying on the same quadric with $\frac{n}{2}\pm O(K)$ points of $P$ on each of the two conics; \item A coset of a subgroup of the smooth points of an elliptic or acnodal space quartic curve. \end{enumerate} \end{theorem} We first prove the following weaker lemma using results from Section~\ref{sec:tools}. \begin{lemma}\label{lem:intermediate} Let $d \geqslant 4$, $K > 0$, and suppose $n \geqslant C\max\{d^3 2^dK, (dK)^8\}$ for some sufficiently large absolute constant $C > 0$. Let $P$ be a set of $n$ points in $\mathbb{R}\mathbb{P}^d$ where every $d$ points span a hyperplane. If $P$ spans at most $K\binom{n-1}{d-1}$ ordinary hyperplanes, then all but at most $O(d2^dK)$ points of $P$ are contained in a hyperplane or an irreducible non-degenerate curve of degree $d+1$ that is either elliptic or rational and singular. \end{lemma} \begin{proof} We use induction on $d \geqslant 4$ to show that for all $K>0$ and all $n \geqslant f(d,K)$, for all sets $P$ of $n$ points in $\mathbb{R}\mathbb{P}^d$ with any $d$ points spanning a hyperplane, if $P$ has at most $K\binom{n-1}{d-1}$ ordinary hyperplanes, then all but at most $g(d,K)$ points of $P$ are contained in a hyperplane or an irreducible non-degenerate curve of degree $d+1$, and that if the curve is rational then it has to be singular, where \[ g(d,K) := \sum_{k=0}^d k^3 2^{d-k} + C_12^d(d-1)K \] and \[ f(d,K) := d^2(g(d,K) + C_2 d^{10}) + C(d-1)^8K^8 \] for appropriate $C_1,C_2>0$ to be determined later and $C$ from Theorem~\ref{thm:plane}. We assume that this holds in $\mathbb{R}\mathbb{P}^{d-1}$ if $d \geqslant 5$, while Theorem~\ref{thm:plane} takes the place of the induction hypothesis when $d=4$. Let $P'$ denote the set of points $p \in P$ such that there are at most $\frac{d-1}{d-2}K\binom{n-2}{d-2}$ ordinary hyperplanes through $p$. By counting incident point-ordinary-hyperplane pairs, we obtain \[dK\binom{n-1}{d-1} > (n-|P'|)\frac{d-1}{d-2}K\binom{n-2}{d-2},\] which gives $|P'| > n/(d-1)^2$. For any $p \in P'$, the projected set $\pi_p(P \setminus \{p\})$ has $n-1$ points and spans at most $\frac{d-1}{d-2}K\binom{n-2}{d-2}$ ordinary $(d-2)$-flats in $\mathbb{R}\mathbb{P}^{d-1}$, and any $d-1$ points of $\pi_p(P \setminus \{p\})$ span a $(d-2)$-flat. To apply the induction hypothesis, we need \[f(d,K) \geqslant 1+ f(d-1,\tfrac{d-1}{d-2}K),\] as well as $f(3,K)\geqslant C\max\{K^8,1\}$, both of which easily follow from the definition of $f(d,K)$. Then all except $g(d-1,\frac{d-1}{d-2}K)$ points of $\pi_p(P \setminus \{p\})$ are contained in a $(d-2)$-flat or a non-degenerate curve $\gamma_p$ of degree $d$ in $\mathbb{R}\mathbb{P}^{d-1}$, which is either irreducible or possibly two conics with $\frac{n}{2} \pm O(K)$ points on each when $d=4$. If there exists a $p \in P'$ such that all but at most $g(d-1,\frac{d-1}{d-2}K)$ points of $\pi_p(P \setminus \{p\})$ are contained in a $(d-2)$-flat, then we are done, since $g(d,K) > g(d-1,\frac{d-1}{d-2}K)$. Thus we may assume without loss of generality that for all $p\in P'$ we obtain a curve $\gamma_p$. Let $p$ and $p'$ be two distinct points of $P'$. Then all but at most $2g(d-1,\frac{d-1}{d-2}K)$ points of $P$ lie on the intersection $\delta$ of the two cones $\overline{\pi^{-1}_p(\gamma_p)}$ and $\overline{\pi^{-1}_{p'}(\gamma_{p'})}$. Since the curves $\gamma_p$ and $\gamma_{p'}$ are $1$-dimensional, the two cones are $2$-dimensional. Since their vertices $p$ and $p'$ are distinct, the cones do not have a common irreducible component, so their intersection is a variety of dimension at most~$1$. By B\'ezout's theorem (Theorem~\ref{thm:bezout}), $\delta$ has total degree at most $d^2$, so has to have at least one $1$-dimensional irreducible component. Let $\delta_1, \dotsc, \delta_k$ be the $1$-dimensional components of $\delta$, where $1\leqslant k \leqslant d^2$. Let $\delta_1$ be the component with the most points of $P'$ amongst all the $\delta_i$, so that \[|P' \cap \delta_1| \geqslant \frac{|P'|-2g(d-1,\frac{d-1}{d-2}K)}{d^2}.\] Choose a $q \in P' \cap \delta_1$ such that $\pi_q$ is generically one-to-one on $\delta_1$. By Lemma~\ref{lem:projection1} there are at most $O(\deg(\delta_1)^4)=O(d^8)$ exceptional points, so we need \begin{equation}\label{constraint1} |P'\cap\delta_1|> C_2 d^8. \end{equation} Since $|P'| > n/(d-1)^2$, we need \[ \frac{\frac{n}{(d-1)^2}-2g(d-1,\frac{d-1}{d-2}K)}{d^2} > C_2 d^8,\] or equivalently, $n > (d-1)^2(2g(d-1,\frac{d-1}{d-2}K)+C_2 d^{10})$. However, this follows from the definition of $f(d,K)$. If $\pi_q$ does not map $\delta_1 \setminus \{q\}$ into $\gamma_q$, then by B\'ezout's theorem (Theorem~\ref{thm:bezout}), $n-1-g(d-1,\binom{d-1}{d-2}K)\leqslant d^3$. However, this does not occur since $f(d,K) > g(d-1,\binom{d-1}{d-2}K) + d^3 + 1$. Thus, $\pi_q$ maps $\delta_1\setminus\{q\}$ into $\gamma_q$, hence $\delta_1$ is an irreducible curve of degree $d+1$ (or, when $d=4$, possibly a twisted cubic containing at most $n/2+O(K)$ points of $P$). We first consider the case where $\delta_1$ has degree $d+1$. We apply Lemma~\ref{lem:projection3} to $\delta_1$ and each $\delta_i$, $i=2,\dots,k$, and for this we need $|P'\cap\delta_1| > C'' d^4$, since $\deg(\delta_1)\leqslant d^2$ and $\sum_{i=2}^d\deg(\delta_i)\leqslant d^2$. However, this condition is implied by \eqref{constraint1}. Thus we find a $q' \in P' \cap \delta_1$ such that $\overline{\pi_{q'}(\delta_1\setminus\{q'\})}=\gamma_{q'}$ as before, and in addition, the cone $\overline{\pi_{q'}^{-1}(\gamma_{q'})}$ does not contain any other $\delta_i$, $i=2,\dots,k$. Since all points of $P$ except $2g(d-1,\frac{d-1}{d-2}K)+d^2$ lie on $\delta_1\cup\dots\cup\delta_k$, we obtain by B\'ezout's theorem (Theorem~\ref{thm:bezout}) that \[|P\setminus{\delta_1}| \leqslant d(d^2-d-1) + d^2 + 2g(d-1,\tfrac{d-1}{d-2}K) < g(d,K).\] We next dismiss the case where $d=4$ and $\delta_1$ is a twisted cubic. We redefine $P'$ to be the set of points $p\in P$ such that there are at most $12Kn^2$ ordinary hyperplanes through $p$. Then $|P'|\geqslant 2n/3$. Since we have $|P\cap\delta_1|\leqslant n/2 +O(K)$, by Lemma~\ref{lem:projection2} there exists $q'\in P'\setminus\delta_1$ such that the projection from $q'$ will map $\delta_1$ onto a twisted cubic in $\mathbb{R}\mathbb{P}^3$. However, by B\'ezout's theorem (Theorem~\ref{thm:bezout}) and Theorem~\ref{thm:plane}, $\pi_{q'}(\delta_1\setminus\{q'\})$ has to be mapped onto a conic, which gives a contradiction. Note that $g(d,K)=O(d 2^d K)$ since $K = \Omega(1/d)$ by \cite{BM17}*{Theorem 2.4}. We have shown that all but $O(d2^dK)$ points of $P$ are contained in a hyperplane or an irreducible non-degenerate curve $\delta$ of degree $d+1$. By Proposition~\ref{prop:curves}, this curve is either elliptic or rational. It remains to show that if $\delta$ is rational, then it has to be singular. Similar to what was shown above, we can find more than $3$ points $p\in\delta$ for which the projection $\overline{\pi_p(\delta\setminus\{p\})}$ is a rational curve of degree $d$ that is singular by the induction hypothesis. Lemma~\ref{lemma:singular_projection} now implies that $\delta$ is singular. \end{proof} To get the coset structure on the curves as stated in Theorem~\ref{thm:main1}, we use a simple generalisation of an additive combinatorial result used by Green and Tao \cite{GT13}*{Proposition A.5}. This captures the principle that if a finite subset of a group is almost closed, then it is close to a subgroup. The case $d=3$ was shown in~\cite{LMMSSZ18}. \begin{lemma}\label{cor:a5} Let $d \geqslant 2$. Let $A_1, A_2, \dotsc, A_{d+1}$ be $d+1$ subsets of some abelian group $(G,\oplus)$, all of size within $K$ of $n$, where $K \leqslant cn/d^2$ for some sufficiently small absolute constant $c > 0$. Suppose there are at most $Kn^{d-1}$ $d$-tuples $(a_1,a_2,\dotsc,a_d) \in A_1 \times A_2 \times \dotsb \times A_d$ for which $a_1 \oplus a_2 \oplus \dotsb \oplus a_d \notin A_{d+1}$. Then there is a subgroup $H$ of $G$ and cosets $H \oplus x_i$ for $i = 1, \dotsc, d$ such that \begin{equation*} |A_i \mathbin{\triangle} (H \oplus x_i)|, \left| A_{d+1} \mathbin{\triangle} \left( H \oplus \bigoplus_{i=1}^d x_i \right) \right| = O(K). \end{equation*} \end{lemma} \begin{proof} We use induction on $d \geqslant 2$ to show that the symmetric differences in the conclusion of the lemma have size at most $C \prod_{i=1}^d (1+\frac{1}{i^2})K$ for some sufficiently large absolute constant $C > 0$. The base case $d=2$ is \cite{GT13}*{Proposition A.5}. Fix a $d \geqslant 3$. By the pigeonhole principle, there exists $b_1 \in A_1$ such that there are at most \[ \frac{1}{n-K}Kn^{d-1} \leqslant \frac{1}{1-\frac{c}{d^2}} Kn^{d-2} \] $(d-1)$-tuples $(a_2, \dotsc, a_d) \in A_2 \times \dotsb \times A_d$ for which $b_1 \oplus a_2 \oplus \dotsb \oplus a_d \notin A_{d+1}$, or equivalently $a_2 \oplus \dotsb \oplus a_d \notin A_{d+1} \ominus b_1$. Since \[ \frac{1}{1-\frac{c}{d^2}} K \leqslant \frac{c}{d^2-c}n \leqslant \frac{c}{(d-1)^2}n, \] we can use induction to get a subgroup $H$ of $G$ and $x_2, \dotsc, x_d\in G$ such that for $j = 2, \dotsc, d$ we have \[ |A_j \mathbin{\triangle} (H \oplus x_j)|, \left|(A_{d+1} \ominus b_1) \mathbin{\triangle} \left(H \oplus \bigoplus_{j=2}^d x_j \right) \right| \leqslant C\prod_{i=1}^{d-1}\left(1+\frac{1}{i^2}\right)\frac{1}{1-\frac{c}{d^2}}K. \] Since $|A_d \cap (H \oplus x_d)| \geqslant n - K - C\prod_{i=1}^{d-1}(1+\frac{1}{i^2})\frac{1}{1-\frac{c}{d^2}}K$, we repeat the same pigeonhole argument on $A_d\cap (H \oplus x_d)$ to find a $b_d \in A_d \cap (H \oplus x_d)$ such that there are at most \begin{align*} \frac{1}{n - K - C\prod_{i=1}^{d-1}\left(1+\frac{1}{i^2}\right)\frac{1}{1-\frac{c}{d^2}}K} Kn^{d-1} &\leqslant \frac{1}{1-\frac{c}{d^2}-C\prod_{i=1}^{d-1}\left(1+\frac{1}{i^2}\right) \frac{c}{d^2-c}} Kn^{d-2}\\ &\leqslant \frac{1}{1-C_1\frac{c}{d^2-c}}Kn^{d-2} \\ &\leqslant \left(1 + \frac{C_2c}{d^2-c}\right)Kn^{d-2}\\ &\leqslant \left(1 + \frac{1}{d^2}\right)Kn^{d-2} \end{align*} $(d-1)$-tuples $(a_1, \dotsc, a_{d-1}) \in A_1 \times \dotsb A_{d-1}$ with $a_1 \oplus \dotsb \oplus a_{d-1} \oplus b_d \notin A_{d+1}$, for some absolute constants $C_1,C_2>0$ depending on $C$, by making $c$ sufficiently small. Now $(1+\frac{1}{d^2})K \leqslant cn/(d-1)^2$, so by induction again, there exist a subgroup $H'$ of $G$ and elements $x_1, x_2', \dotsc, x_{d-1}' \in G$ such that for $k = 2, \dotsc, d-1$ we have \begin{equation*} |A_1 \mathbin{\triangle} (H' \oplus x_1)|, |A_k \mathbin{\triangle} (H' \oplus x_k')|, \left|(A_{d+1} \ominus b_d) \mathbin{\triangle} \left(H' \oplus x_1 \oplus \bigoplus_{k=2}^{d-1} x_k' \right) \right| \leqslant C\prod_{i=1}^{d-1}\left(1+\frac{1}{i^2}\right) \left(1 + \frac{1}{d^2}\right) K. \end{equation*} From this, it follows that $|(H \oplus x_k) \cap (H' \oplus x_k')| \geqslant n - K - 2C\prod_{i=1}^d (1 + \frac{1}{i^2}) K = n - O(K)$. Since $(H \oplus x_k) \cap (H' \oplus x_k')$ is non-empty, it has to be a coset of $H' \cap H$. If $H' \neq H$, then $|H' \cap H| \leqslant n/2 + O(K)$, a contradiction since $c$ is sufficiently small. Therefore, $H=H'$, and $H \oplus x_k = H' \oplus x_k'$. So we have \[ |A_i \mathbin{\triangle} (H \oplus x_i)|, \left|A_{d+1} \mathbin{\triangle} \left(H \oplus \bigoplus_{\ell=1}^{d-1} x_\ell \oplus b_d \right) \right| \leqslant C\prod_{i=1}^d\left(1+\frac{1}{i^2}\right)K. \] Since $b_d \in H \oplus x_d$, we also obtain \[ \left|A_{d+1} \mathbin{\triangle} \left(H \oplus \bigoplus_{i=1}^d x_i \right) \right| \leqslant C\prod_{i=1}^d\left(1+\frac{1}{i^2}\right)K. \qedhere \] \end{proof} To apply Lemma~\ref{cor:a5}, we first need to know that removing $K$ points from a set does not change the number of ordinary hyperplanes it spans by too much. \begin{lemma}\label{lem:stability} Let $P$ be a set of $n$ points in $\mathbb{R}\mathbb{P}^d$, $d \geqslant 2$, where every $d$ points span a hyperplane. Let $P'$ be a subset that is obtained from $P$ by removing at most $K$ points. If $P$ spans $m$ ordinary hyperplanes, then $P'$ spans at most $m + \frac{1}{d}K\binom{n-1}{d-1}$ ordinary hyperplanes. \end{lemma} \begin{proof} Fix a point $p\in P$. Since every $d$ points span a hyperplane, there are at most $\binom{n-1}{d-1}$ sets of $d$ points from $P$ containing $p$ that span a hyperplane through $p$. Thus, the number of $(d+1)$-point hyperplanes through $p$ is at most $\frac{1}{d}\binom{n-1}{d-1}$, since a set of $d+1$ points that contains $p$ has $d$ subsets of size $d$ that contain $p$. If we remove points of $P$ one-by-one to obtain $P'$, we thus create at most $\frac{1}{d}K\binom{n-1}{d-1}$ ordinary hyperplanes. \end{proof} The following lemma then translates the additive combinatorial Lemma~\ref{cor:a5} to our geometric setting. \begin{lemma}\label{lem:curve} Let $d \geqslant 4$, $K>0$, and suppose $n \geqslant C(d^3K + d^4)$ for some sufficiently large absolute constant $C>0$. Let $P$ be a set of $n$ points in $\mathbb{R}\mathbb{P}^d$ where every $d$ points span a hyperplane. Suppose $P$ spans at most $K\binom{n-1}{d-1}$ ordinary hyperplanes, and all but at most $dK$ points of $P$ lie on an elliptic normal curve or a rational singular curve $\delta$. Then $P$ differs in at most $O(dK+d^2)$ points from a coset $H \oplus x$ of a subgroup $H$ of $\delta^*$, the smooth points of $\delta$, for some $x$ such that $(d+1)x \in H$. In particular, $\delta$ is either an elliptic normal curve or a rational acnodal curve. \end{lemma} \begin{proof} Let $P' = P \cap \delta^*$. Then by Lemma~\ref{lem:stability}, $P'$ spans at most $K\binom{n-1}{d-1}+d\frac{1}{d}K\binom{n-1}{d-1} = 2K\binom{n-1}{d-1}$ ordinary hyperplanes. First suppose $\delta$ is an elliptic normal curve or a rational cuspidal or acnodal curve. If $a_1, \dotsc, a_d \in \delta^*$ are distinct, then by Propositions~\ref{prop:elliptic_group} and~\ref{prop:rational_group}, the hyperplane through $a_1, \dotsc, a_d$ meets $\delta$ again in the unique point $a_{d+1} = \ominus(a_1 \oplus \dotsb \oplus a_d)$. This implies that $a_{d+1} \in P'$ for all but at most $d!O(K\binom{n-1}{d-1})$ $d$-tuples $(a_1, \dotsc, a_d) \in (P')^d$ with all $a_i$ distinct. There are also at most $\binom{d}{2}n^{d-1}$ $d$-tuples $(a_1, \dotsc, a_d) \in (P')^d$ for which the $a_i$ are not all distinct. Thus, $a_1 \oplus \dotsb \oplus a_d \in \ominus P'$ for all but at most $O((dK+d^2)n^{d-1})$ $d$-tuples $(a_1, \dotsc, a_d) \in (P')^d$. Applying Lemma~\ref{cor:a5} with $A_1 = \dotsb = A_d = P'$ and $A_{d+1} = \ominus P'$, we obtain a finite subgroup $H$ of $\delta^*$ and a coset $H \oplus x$ such that $|P' \mathbin{\triangle} (H \oplus x)| = O(dK+d^2)$ and $|\ominus P' \mathbin{\triangle} (H \oplus dx)| = O(dK+d^2)$, the latter being equivalent to $|P' \mathbin{\triangle} (H \ominus dx)| = O(dK+d^2)$. Thus we have $|(H \oplus x) \mathbin{\triangle} (H \ominus dx)| = O(dK+d^2)$, which implies $(d+1)x \in H$. Also, $\delta$ cannot be cuspidal, otherwise by Proposition~\ref{prop:rational_group} we have $\delta^* \cong (\mathbb{R}, +)$, which has no finite subgroup of order greater than~$1$. Now suppose $\delta$ is a rational crunodal curve. By Proposition~\ref{prop:rational_group}, there is a bijective map $\varphi: (\mathbb{R},+) \times \mathbb{Z}_2 \rightarrow \delta^*$ such that $d+1$ points in $\delta^*$ lie in a hyperplane if and only if they sum to $h$, where $h=\varphi(0,0)$ or $\varphi(0,1)$ depending on the curve $\delta$. If $h=\varphi(0,0)$ then the above argument follows through, and we obtain a contradiction as we have by Proposition~\ref{prop:rational_group} that $\delta^* \cong (\mathbb{R},+) \times \mathbb{Z}_2$, which has no finite subgroup of order greater than~$2$. Otherwise, the hyperplane through distinct $a_1, \dotsc, a_d \in \delta^*$ meets $\delta$ again in the unique point $a_{d+1} = \varphi(0,1) \ominus(a_1 \oplus \dotsb \oplus a_d)$. As before, this implies that $a_{d+1} \in P'$ for all but at most $O((dK+d^2)n^{d-1})$ $d$-tuples $(a_1, \dotsc, a_d) \in (P')^d$, or equivalently $a_1 \oplus \dotsb \oplus a_d \in \varphi(0,1) \ominus P'$. Applying Lemma~\ref{cor:a5} with $A_1 = \dotsb = A_d = P'$ and $A_{d+1} = \varphi(0,1) \ominus P'$, we obtain a finite subgroup $H$ of $\delta^*$, giving a contradiction as before. \end{proof} We can now prove Theorem~\ref{thm:main1}. \begin{proof}[Proof of Theorem~\ref{thm:main1}] By Lemma~\ref{lem:intermediate}, all but at most $O(d2^dK)$ points of $P$ are contained in a hyperplane or an irreducible curve $\delta$ of degree $d+1$ that is either elliptic or rational and singular. In the prior case, we get Case~\ref{case:hyperplane} of the theorem, so suppose we are in the latter case. We then apply Lemma~\ref{lem:curve} to obtain Case~\ref{case:curve} of the theorem, completing the proof. \end{proof} \section{Extremal configurations}\label{sec:extremal} We prove Theorems~\ref{thm:main2} and~\ref{thm:main3} in this section. It will turn out that minimising the number of ordinary hyperplanes spanned by a set is equivalent to maximising the number of $(d+1)$-point planes, thus we can apply Theorem~\ref{thm:main1} in both theorems. Then we only have two cases to consider, where most of our point set is contained either in a hyperplane or a coset of a subgroup of an elliptic normal curve or the smooth points of a rational acnodal curve. The first case is easy, and we get the following lower bound. \begin{lemma}\label{lem:hyperplane} Let $d \geqslant 4$, $K \geqslant 1$, and let $n \geqslant 2dK$. Let $P$ be a set of $n$ points in $\mathbb{R}\mathbb{P}^d$ where every $d$ points span a hyperplane. If all but $K$ points of $P$ lie on a hyperplane, then $P$ spans at least $\binom{n-1}{d-1}$ ordinary hyperplanes, with equality if and only if $K = 1$. \end{lemma} \begin{proof} Let $\Pi$ be a hyperplane with $|P \cap \Pi| = n - K$. Since $n-K>d$, any ordinary hyperplane spanned by $P$ must contain at least one point not in $\Pi$. Let $m_i$ be the number of hyperplanes containing exactly $d-1$ points of $P\cap\Pi$ and exactly $i$ points of $P\setminus\Pi$, $i=1,\dots,K$. Then the number of unordered $d$-tuples of elements from $P$ with exactly $d-1$ elements in $\Pi$ is \[ K\binom{n-K}{d-1} = m_1 + 2m_2 + 3m_3 + \dots + Km_K.\] Now consider the number of unordered $d$-tuples of elements from $P$ with exactly $d-2$ elements in $\Pi$, which equals $\binom{K}{2}\binom{n-K}{d-2}$. One way to generate such a $d$-tuple is to take one of the $m_i$ hyperplanes containing $i$ points of $P\setminus\Pi$ and $d-1$ points of $P\cap\Pi$, choose two of the $i$ points, and remove one of the $d-1$ points. Since any $d$ points span a hyperplane, there is no overcounting. This gives \begin{align*} \binom{K}{2}\binom{n-K}{d-2} &\geqslant (d-1)\left(\binom{2}{2}m_2+\binom{3}{2}m_3+\binom{4}{2}m_4 + \dotsb\right)\\ &\geqslant \frac{d-1}{2} (2m_2+3m_3+4m_4+\dotsb). \end{align*} Hence the number of ordinary hyperplanes is at least \[ m_1\geqslant K\binom{n-K}{d-1}-\frac{K(K-1)}{d-1}\binom{n-K}{d-2} = K\binom{n-K}{d-1}\frac{n-2K-d+3}{n-K-d+2}.\] We next show that for all $K\geqslant 2$, if $n \geqslant 2dK$ then \[ K\binom{n-K}{d-1}\frac{n-2K-d+3}{n-K-d+2} > \binom{n-1}{d-1}.\] This is equivalent to \begin{equation}\label{ineq1} K > \frac{n-K+1}{n-2K-d+3}\prod_{i=1}^{K-2}\frac{n-i}{n-d-i+1}. \end{equation} Note that \begin{equation}\label{ineq2} \frac{n-K+1}{n-2K-d+3} < 2 \end{equation} if $n > 3K+2d-5$ and \begin{equation}\label{ineq3} \frac{n-i}{n-d-i+1} <\frac{i+2}{i+1} \end{equation} if $n\geqslant (i+2)d$ for each $i=1,\dots,K-2$. However, since $2dK > (i+2)d$ and also $2dK > 4K+2d-5$, the inequality \eqref{ineq1} now follows from \eqref{ineq2} and \eqref{ineq3}. \end{proof} The second case needs more work. We first consider the number of ordinary hyperplanes spanned by a coset of a subgroup of the smooth points $\delta^*$ of an elliptic normal curve or a rational acnodal curve. By Propositions~\ref{prop:elliptic_group} and~\ref{prop:rational_group}, we can consider $\delta^*$ as a group isomorphic to either $\mathbb{R}/\mathbb{Z}$ or $\mathbb{R}/\mathbb{Z} \times \mathbb{Z}_2$. Let $H \oplus x$ be a coset of a subgroup $H$ of $\delta^*$ of order $n$ where $(d+1)x = \ominus c \in H$. Since $H$ is a subgroup of order $n$ of $\mathbb{R}/\mathbb{Z}$ or $\mathbb{R}/\mathbb{Z} \times \mathbb{Z}_2$, we have that either $H$ is cyclic, or $\mathbb{Z}_{n/2}\times\mathbb{Z}_2$ when $n$ is divisible by $4$. The exact group will matter only when we make exact calculations. Note that it follows from the group property that any $d$ points on $\delta^*$ span a hyperplane. Also, since any hyperplane intersects $\delta^*$ in $d+1$ points, counting multiplicity, it follows that an ordinary hyperplane of $H\oplus x$ intersects $\delta^*$ in $d$ points, of which exactly one of them has multiplicity $2$, and the others multiplicity $1$. Denote the number of ordered $k$-tuples $(a_1, \dotsc, a_k)$ with distinct $a_i \in H$ that satisfy $m_1 a_1 \oplus \dotsb \oplus m_k a_k = c$ by $[m_1, \dotsc, m_k; c]$. Then the number of ordinary hyperplanes spanned by $H \oplus x$ is \begin{equation}\label{expr1} \frac{1}{(d-1)!} [2, \!\!\underbrace{1, \dotsc, 1}_\text{$d-1$ times}\!; c]. \end{equation} We show that we can always find a value of $c$ for which \eqref{expr1} is at most $\binom{n-1}{d-1}$. \begin{lemma}\label{lem:coset1} Let $\delta^*$ be an elliptic normal curve or the smooth points of a rational acnodal curve in $\mathbb{R}\mathbb{P}^d$, $d \geqslant 2$. Then any finite subgroup $H$ of $\delta^*$ of order $n$ has a coset $H \oplus x$ with $(d+1)x \in H$, that spans at most $\binom{n-1}{d-1}$ ordinary hyperplanes. Furthermore, if $d+1$ and $n$ are coprime, then any such coset spans exactly $\binom{n-1}{d-1}$ ordinary hyperplanes. \end{lemma} \begin{proof} It suffices to show that there exists $c \in H$ such that the number of solutions $(a_1, \dotsc, a_d)\in H^d$ of the equation $2a_1 \oplus a_2 \oplus \dotsb \oplus a_d = c$, where $c = \ominus(d+1)x$, is at most $(d-1)!\binom{n-1}{d-1}$. Fix $a_1$ and consider the substitution $b_i = a_i - a_1$ for $i = 2, \dotsc, d$. Note that $2a_1 \oplus \dotsb \oplus a_d = c$ and $a_1,\dots,a_d$ are distinct if and only if $b_2 \oplus \dotsb \oplus b_d = c \ominus (d+1)a_1$ and $b_2,\dots,b_d$ are distinct and non-zero. Let \[ A_{c,j} = \setbuilder{(j, a_2, \dotsc, a_d)}{2j \oplus a_2 \oplus \dotsb \oplus a_d = c, \text{$a_2, \dotsc, a_d \in H \setminus \{j\}$ distinct}}, \] and let \[ B_k = \setbuilder{(b_2, \dotsc, b_d)}{b_2 \oplus \dotsb \oplus b_d = k, \text{$b_2, \dotsc, b_d \in H \setminus \{0\}$ distinct}}. \] Then $|A_{c,j}| = |B_{c \ominus (d+1)j}|$, and the number of ordinary hyperplanes spanned by $H \oplus x$ is \[ \frac{1}{(d-1)!} \sum_{j\in H} |A_{c,j}|. \] If $d+1$ is coprime to $n$, then $c \ominus (d+1)j$ runs through all elements of $H$ as $j$ varies. So we have $\sum_j |B_{c \ominus (d+1)j}| = (n-1)\dotsb (n-d+1)$, hence for all $c$, \[ \frac{1}{(d-1)!} \sum_{j\in H} |A_{c,j}| = \binom{n-1}{d-1}. \] If $d+1$ is not coprime to $n$, then $c \ominus (d+1)j$ runs through a coset of a subgroup of $H$ of size $n/\gcd(d+1,n)$ as $j$ varies. We now have \[ \sum_{j \in H} |B_{c \ominus (d+1)j}| = \gcd(d+1,n) \sum_{k \in c \ominus (d+1)H} |B_k|. \] Summing over $c$ gives \begin{align*} \sum_{c \in H} \sum_{j \in H} |A_{c,j}| &= \gcd(d+1,n) \sum_{c \in H} \sum_{k \in c \ominus (d+1)H} |B_k|\\ &= \gcd(d+1,n) \frac{n}{\gcd(d+1,n)} (n-1)\dotsb (n-d+1)\\ & = n (n-1)\dotsb (n-d+1). \end{align*} By the pigeonhole principle, there must then exist a $c$ such that \[ \frac{1}{(d-1)!} \sum_{j\in H} |A_{c,j}| \leqslant \binom{n-1}{d-1}. \qedhere \] \end{proof} We next want to show that $[2, \!\!\overbrace{1, \dotsc, 1}^\text{$d-1$ times}\!\!; c]$ is always very close to $(d-1)!\binom{n-1}{d-1}$, independent of $c$ or the group $H$. Before that, we prove two simple properties of $[m_1, \dotsc, m_k; c]$. \begin{lemma}\label{lem:upper} $[m_1,\dots,m_k;c]\leqslant 2m_k(k-1)!\binom{n}{k-1}$. \end{lemma} \begin{proof} Consider a solution $(a_1,\dotsc,a_k)$ of $m_1a_1 \oplus \dotsb \oplus m_ka_k=c$ where all the $a_i$ are distinct. We can choose $a_1,\dotsc,a_{k-1}$ arbitrarily in $(k-1)!\binom{n}{k-1}$ ways, and $a_k$ satisfies the equation $m_ka_k = c \ominus m_1a_1 \ominus \dotsb \ominus m_{k-1}a_{k-1}$, which has at most $m_k$ solutions if $H=\mathbb{Z}_n$ and at most $2m_k$ solutions if $H=\mathbb{Z}_2\times\mathbb{Z}_{n/2}$. \end{proof} \begin{lemma}\label{lem:recurrence} We have the recurrence relation \begin{align} [m_1,\dots,m_{k-1},1;c] = (k-1)!\binom{n}{k-1} &- [m_1 +1,m_2,\dots,m_{k-1};c]\notag\\ &- [m_1,m_2 +1,m_3,\dots,m_{k-1};c]\notag\\ &- \dotsb\notag\\ &- [m_1,\dots,m_{k-2},m_{k-1}+1;c]. \notag \end{align} \end{lemma} \begin{proof} We can arbitrarily choose distinct values from $H$ for $a_1,\dots,a_{k-1}$, which determines $a_k$, and then we have to subtract the number of $k$-tuples where $a_k$ is equal to one of the other $a_i$, $i=1,\dots,k-1$. \end{proof} \begin{lemma}\label{lem:2111} \[ [2, \!\!\underbrace{1, \dotsc, 1}_\text{$d-1$ times}\!\!; c] = (d-1)! \left( \binom{n-1}{d-1} + \varepsilon(d,n)\right),\] where \[ |\varepsilon(d,n)| = \begin{cases} O\left(2^{-d/2}\binom{n}{(d-1)/2}+\binom{n}{(d-3)/2}\right) & \text{if $d$ is odd,}\\ O\left(d 2^{-d/2}\binom{n}{d/2-1}+\binom{n}{d/2-2}\right) & \text{if $d$ is even.} \end{cases} \] \end{lemma} \begin{proof} Applying Lemma~\ref{lem:recurrence} once, we obtain \[ [2, \!\!\underbrace{1, \dotsc, 1}_\text{$d-1$ times}\!\!; c] = (d-1)!\binom{n}{d-1} - [3, \!\!\underbrace{1, \dotsc, 1}_\text{$d-2$ times}\!\!; c] - (d-2)[2, 2, \!\!\underbrace{1, \dotsc, 1}_\text{$d-3$ times}\!\!; c]. \] Note that at each stage of the recurrence in Lemma~\ref{lem:recurrence} (as long as it applies), there are $(d-1)(d-2)\dotsb(d-k)$ terms of length $d-k$, where we define the \emph{length} of $[m_1, \dotsc, m_k; c]$ to be $k$. If $d$ is odd, we can continue this recurrence until we reach \begin{align*} [2, \!\!\underbrace{1, \dotsc, 1}_\text{$d-1$ times}\!\!; c] &= (d-1)! \left( \binom{n}{d-1} - \binom{n}{d-2} + \dotsb + (-1)^{(d+1)/2} \binom{n}{(d+1)/2} \right)\\ &\qquad + (-1)^{(d-1)/2}R, \end{align*} where $R$ is the sum of $(d-1)(d-2)\dotsb(d-(d-1)/2)$ terms of length $(d+1)/2$. Among these there are \[\frac{\binom{d-1}{2}\binom{d-3}{2}\dotsb\binom{2}{2}}{(\frac{d-1}{2})!} = (d-2)(d-4)\dotsb 3 \cdot1\] terms of the form $[2, \dotsc, 2; c]$. We now write $R=A+B$, where $A$ is the same sum as $R$, except that we replace each occurrence of $[2,\dots,2;c]$ by $[1,\dots,1;c]$, and \[ B := (d-2)(d-4)\dotsb 3\cdot 1 ([\underbrace{2,\dotsc,2}_\text{$\frac{d+1}{2}$ times};c] - [\!\underbrace{1,\dotsc,1}_\text{$\frac{d+1}{2}$ times}\!;c]).\] We next bound $A$ and $B$. We apply Lemma~\ref{lem:recurrence} to each term in $A$, after which we obtain $(d-1)(d-2)\dotsb(d-(d+1)/2)$ terms of length $(d-1)/2$. Then using the bound in Lemma~\ref{lem:upper}, we obtain \begin{align*} A &= (d-1)!\binom{n}{(d-1)/2} - O\left((d-1)(d-2)\dotsb(d-(d+1)/2)\left(\tfrac{d-3}{2}\right)!\binom{n}{(d-3)/2}\right)\\ &= (d-1)!\left(\binom{n}{(d-1)/2} - O\left(\binom{n}{(d-3)/2}\right) \right). \end{align*} For $B$, we again use Lemma~\ref{lem:upper} to get \begin{align*} |B| &= O\left((d-2)(d-4)\dotsb 3\cdot 1 \left(\frac{d-1}{2}\right)! \binom{n}{(d-1)/2} \right)\\ &= O\left((d-2)(d-4)\dotsb 3\cdot 1 \cdot 2^{-\frac{d-1}{2}}(d-1)(d-3)\dotsb 4 \cdot 2 \binom{n}{(d-1)/2} \right)\\ &= O\left((d-1)!2^{-\frac{d-1}{2}}\binom{n}{(d-1)/2}\right). \end{align*} Thus we obtain \begin{multline*} [2, \!\!\underbrace{1, \dotsc, 1}_\text{$d-1$ times}\!\!; c] = (d-1)! \left( \binom{n}{d-1} - \binom{n}{d-2} + \dotsb +(-1)^{\frac{d+1}{2}} \binom{n}{(d+1)/2} \right)\\ + (-1)^{\frac{d-1}{2}}(d-1)!\left(\binom{n}{(d-1)/2} - O\left(\binom{n}{(d-3)/2}\right) \right) + (-1)^{\frac{d-1}{2}}B\\ = (d-1)!\left( \binom{n-1}{d-1} + (-1)^{\frac{d+1}{2}} O\left(\binom{n}{(d-3)/2}\right)\pm O\left(2^{-\frac{d-1}{2}}\binom{n}{(d-1)/2}\right)\right), \end{multline*} which finishes the proof for odd $d$. If $d$ is even, we obtain \begin{equation*} [2, \!\!\underbrace{1, \dotsc, 1}_\text{$d-1$ times}\!\!; c] = (d-1)! \left( \binom{n}{d-1} - \binom{n}{d-2} + \dotsb + (-1)^{\frac{d}{2}+1} \binom{n}{d/2} \right) + (-1)^{d/2}R, \end{equation*} where $R$ now is the sum of $(d-1)(d-2)\dotsb(d-d/2)$ terms of length $d/2$. Among these there are \[ \frac{(d-1)\binom{d-2}{2}\binom{d-4}{2}\dotsb\binom{2}{2}}{(\frac{d-2}{2})!} + \frac{2\binom{d-1}{3}\binom{d-4}{2}\dotsb\binom{2}{2}}{(\frac{d-4}{2})!} = (d+1)(d-1)\dotsb7\cdot5\] terms of the form $[3,2,\dots,2;c]$. Again we write $R=A+B$, where $A$ is the same sum as $R$, except that each occurrence of $[3,2,\dots,2;c]$ is replaced by $[1,\dots,1;c]$, and \[ B := (d+1)(d-1)\dotsb7\cdot5([3,\!\!\underbrace{2,\dotsc,2}_\text{$\frac{d}{2}-1$ times}\!\!;c] - [\underbrace{1,\dotsc,1}_\text{$\frac{d}{2}$ times};c]).\] Similar to the previous case, we obtain \[ A = (d-1)!\left(\binom{n}{d/2-1}-O\left(\binom{n}{d/2-2}\right)\right)\] and \[ |B| = O\left((d+1)(d-1)\dotsb7\cdot5(\tfrac{d}{2}-1)!\binom{n}{d/2-1}\right) = O\left(2^{-d/2}d!\binom{n}{d/2-1}\right),\] which finishes the proof for even $d$. \end{proof} Computing $[2, \dotsc, 2; c]$ and $[3, 2, \dotsc, 2; c]$ exactly is more subtle and depends on $c$ and the group $H$. We do not need this for the asymptotic Theorems~\ref{thm:main2} and~\ref{thm:main3}, and will only need to do so when computing exact extremal values. To show that a coset is indeed extremal, we first consider the effect of adding a single point. The case where the point is on the curve is done in Lemma~\ref{lem:7.7-}, while Lemma~\ref{lem:7.7} covers the case where the point is off the curve. We then obtain a more general lower bound in Lemma~\ref{lem:coset2}. \begin{lemma}\label{lem:7.7-} Let $\delta^*$ be an elliptic normal curve or the smooth points of a rational acnodal curve in $\mathbb{R}\mathbb{P}^d$, $d \geqslant 2$. Suppose $H \oplus x$ is a coset of a finite subgroup $H$ of $\delta^*$ of order $n$, with $(d+1)x \in H$. Let $p\in\delta^*\setminus (H\oplus x)$. Then there are at least $\binom{n}{d-1}$ hyperplanes through $p$ that meet $H \oplus x$ in exactly $d-1$ points. \end{lemma} \begin{proof} Take any $d-1$ points $p_1, \dotsc, p_{d-1} \in H \oplus x$. Suppose that the (unique) hyperplane through $p,p_1,\dots,p_{d-1}$ contains another point $p'\in H\oplus x$. Since $p\oplus p_1\oplus \dots \oplus p_{d-1}\oplus p' = 0$ by Propositions~\ref{prop:elliptic_group} and~\ref{prop:rational_group}, we obtain that $p\in H\ominus dx$. Since $(d+1)x\in H$, we obtain $p\in H\oplus x$, a contradiction. Therefore, the hyperplane through $p,p_1,\dots,p_{d-1}$ does not contain any other point of $H\oplus x$. It remains to show that if $\{p_1,\dots,p_{d-1}\}\neq\{p_1',\dots,p_{d-1}'\}$ where also $p_1',\dots,p_{d-1}'\in H\oplus x$, then the two sets span different hyperplanes with $p$. Suppose they span the same hyperplane. Then $\ominus(p \oplus p_1 \oplus \dotsb \oplus p_{d-1})$ also lies on this hyperplane, but not in $H\oplus x$, as shown above. Also, $p_i'\notin\{p_1,\dots,p_{d-1}\}$ for some $i$, and then $p_1,\dots,p_{d-1},p_i'$, and $\ominus(p \oplus p_1 \oplus \dotsb \oplus p_{d-1})$ are $d+1$ distinct points on a hyperplane, so their sum is $0$, which implies $p=p_i'$, a contradiction. So there are $\binom{n}{d-1}$ hyperplanes through $p$ meeting $H \oplus x$ in exactly $d-1$ points. \end{proof} The following Lemma generalises \cite{GT13}*{Lemma~7.7}, which states that if $\delta^*$ is an elliptic curve or the smooth points of an acnodal cubic curve in the plane, $H\oplus x$ is a coset of a finite subgroup of order $n>10^4$, and if $p\notin\delta^*$, then there are at least $n/1000$ lines through $p$ that pass through exactly one element of $H\oplus x$. A naive generalisation to dimension $3$ would state that if $\delta^*$ is an elliptic or acnodal space quartic curve with a finite subgroup $H$ of sufficiently large order $n$, and $x\in\delta^*$ and $p\notin\delta^*$, then there are $\Omega(n^2)$ planes through $p$ and exactly two elements of $H\oplus x$. This statement is false, even if we assume that $4x\in H$ (the analogous assumption $3x\in H$ is not made in \cite{GT13}), as can be seen from the following example. Let $\delta$ be an elliptic quartic curve obtained from the intersection of a circular cylinder in $\mathbb{R}^3$ with a sphere which has centre $c$ on the axis $\ell$ of the cylinder. Then $\delta$ is symmetric in the plane through $c$ perpendicular to $\ell$, and we can find a finite subgroup $H$ of any even order $n$ such that the line through any element of $H$ parallel to $\ell$ intersects $H$ in two points. If we now choose $p$ to be the point at infinity on $\ell$, then we obtain that any plane spanned by $p$ and two points of $H$ not collinear with $p$, intersects $H$ in two more points. Note that the projection $\pi_p$ maps $\delta$ to a conic, so is not generically one-to-one. The number of such $p$ is bounded by the trisecant lemma (Lemma~\ref{lem:projection2}). However, as the next lemma shows, a generalisation of \cite{GT13}*{Lemma~7.7} holds except that in dimension~3 we have to exclude such points $p$. \begin{lemma}\label{lem:7.7} Let $\delta$ be an elliptic normal curve or a rational acnodal curve in $\mathbb{R}\mathbb{P}^d$, $d \geqslant 2$, and let $\delta^*$ be its set of smooth points. Let $H$ be a finite subgroup of $\delta^*$ of order $n$, where $n\geqslant Cd^4$ for some sufficiently large absolute constant $C>0$. Let $x\in\delta^*$ satisfy $(d+1)x\in H$. Let $p\in\mathbb{R}\mathbb{P}^d\setminus\delta^*$. If $d=3$, assume furthermore that $\delta$ is not contained in a quadric cone with vertex $p$. Then there are at least $c\binom{n}{d-1}$ hyperplanes through $p$ that meet the coset $H \oplus x$ in exactly $d-1$ points, for some sufficiently small absolute constant $c>0$. \end{lemma} \begin{proof} We prove by induction on $d$ that under the given hypotheses there are at least $c'\prod_{i=2}^d(1-\frac{1}{i^2})\binom{n}{d-1}$ such hyperplanes for some sufficiently small absolute constant $c'>0$. The base case $d = 2$ is given by \cite{GT13}*{Lemma~7.7}. Next assume that $d\geqslant 3$, and that the statement holds for $d-1$. Fix a $q\in H\oplus x$, and consider the projection $\pi_q$. Since $q$ is a smooth point of $\delta$, $\overline{\pi_q(\delta\setminus\{q\})}$ is a non-degenerate curve of degree $d$ in $\mathbb{R}\mathbb{P}^{d-1}$ (otherwise its degree would be at most $d/2$, but a non-degenerate curve has degree at least $d-1$). The projection $\pi_q$ can be naturally extended to have a value at $q$, by setting $\pi_q(q)$ to be the point where the tangent line of $\delta$ at $q$ intersects the hyperplane onto which $\delta$ is projected. (This point is the single point in $\overline{\pi_q(\delta\setminus\{q\})}\setminus\pi_q(\delta\setminus\{q\})$.) The curve $\pi_q(\delta)$ has degree $d$ and is either elliptic or rational and acnodal, hence it has a group operation $\boxplus$ such that $d$ points are on a hyperplane in $\mathbb{R}\mathbb{P}^{d-1}$ if and only if they sum to the identity. Observe that any $d$ points $\pi_q(p_1),\dots,\pi_q(p_d)\in\pi_q(\delta^*)$ lie on a hyperplane in $\mathbb{R}\mathbb{P}^{d-1}$ if and only if $p_1\oplus\dots\oplus p_d \oplus q = 0$. By Proposition~\ref{prop:unique} it follows that the group on $\pi_q(\delta^*)$ obtained by transferring the group $(\delta^*,\oplus)$ by $\pi_q$ is a translation of $(\pi_q(\delta^*),\boxplus)$. In particular, $\pi_q(H\oplus x) = H'\boxplus x'$ for some subgroup $H'$ of $(\pi_q(\delta^*),\boxplus)$ of order $n$, and $(d+1)x'\in H'$. We would like to apply the induction hypothesis, but we can only do that if $\pi_q(p)\notin\pi_q(\delta^*)$, and when $d=4$, if $\pi_q(p)$ is not the vertex of a quadric cone containing $\pi_q(\delta)$. We next show that there are only $O(d^2)$ exceptional points $q$ to which we cannot apply induction. Note that $\pi_q(p)\in\pi_q(\delta^*)$ if and only if the line $pq$ intersects $\delta$ with multiplicity $2$, which means we have to bound the number of these lines through $p$. To this end, we consider the projection of $\delta$ from the point $p$. Suppose that $\pi_p$ does not project $\delta$ generically one-to-one to a degree $d+1$ curve in $\mathbb{R}\mathbb{P}^{d-1}$. Then $\pi_p(\delta)$ has degree at most $(d+1)/2$. However, its degree is at least $d-1$ because it is non-degenerate. It follows that $d=3$, and that $\pi_p(\delta)$ has degree $2$ and is irreducible, so $\delta$ is contained in a quadric cone with vertex $p$, which we ruled out by assumption. Therefore, $\pi_p$ projects $\delta$ generically one-to-one onto the curve $\pi_p(\delta)$, which has degree $d+1$ and has at most $\binom{d}{2}$ double points (this follows from the Pl\"ucker formulas after projecting to the plane \cite{W78}*{Chapter~III, Theorem~4.4}). We thus have that an arbitrary point $p \in \mathbb{R}\mathbb{P}^d \setminus \delta$ lies on at most $O(d^2)$ secants or tangents of $\delta$ (or lines through two points of $\delta^*$ if $p$ is the acnode of $\delta$). If $d=4$, we also have to avoid $q$ such that $\pi_q(p)$ is the vertex of a cone on which $\pi_q(\delta)$ lies. Such $q$ have the property that if we first project $\delta$ from $q$ and then $\pi_q(\delta)$ from $\pi_q(p)$, then the composition of these two projections is not generically one-to-one. Another way to do these to successive projections is to first project $\delta$ from $p$ and then $\pi_p(\delta)$ from $\pi_p(q)$. Thus, we have that $\pi_p(q)$ is a point on the quintic $\pi_p(\delta)$ in $\mathbb{R}\mathbb{P}^3$ such that the projection of $\pi_p(\delta)$ from $\pi_p(q)$ onto $\mathbb{R}\mathbb{P}^2$ is not generically one-to-one. However, there are only $O(1)$ such points by Lemma~\ref{lem:projection2}. Thus there are at most $Cd^2$ points $q\in H\oplus x$ to which we cannot apply the induction hypothesis. For all remaining $q\in H\oplus x$, we obtain by the induction hypothesis that there are at least $c'\prod_{i=2}^{d-1}(1-\frac{1}{i^2})\binom{n}{d-2}$ hyperplanes $\Pi$ in $\mathbb{R}\mathbb{P}^{d-1}$ through $\pi_q(p)$ and exactly $d-2$ points of $H'\boxplus x'$. If none of these $d-2$ points equal $\pi_q(q)$, then $\pi_q^{-1}(\Pi)$ is a hyperplane in $\mathbb{R}\mathbb{P}^d$ through $p$ and $d-1$ points of $H\oplus x$, one of which is $q$. There are at most $\binom{n-1}{d-3}$ such hyperplanes in $\mathbb{R}\mathbb{P}^{d-1}$ through $\pi_q(q)$. Therefore, there are at least $c'\prod_{i=2}^{d-1}(1-\frac{1}{i^2})\binom{n}{d-2} - \binom{n-1}{d-3}$ hyperplanes in $\mathbb{R}\mathbb{P}^d$ that pass through $p$ and exactly $d-1$ points of $H\oplus x$, one of them being $q$. If we sum over all $n-Cd^2$ points $q$, we count each hyperplane $d-1$ times, and we obtain that the total number of such hyperplanes is at least \begin{equation}\label{eq1} \frac{n-Cd^2}{d-1}\left(c'\prod_{i=2}^{d-1}\left(1-\frac{1}{i^2}\right)\binom{n}{d-2} - \binom{n-1}{d-3}\right). \end{equation} It can easily be checked that \begin{equation}\label{eq2} \frac{n-Cd^2}{d-1}\binom{n}{d-2} \geqslant \left(1 - \frac{1}{2d^2}\right)\binom{n}{d-1} \end{equation} if $n >2Cd^4$, and that \begin{equation}\label{eq3} c'\prod_{i=2}^{d-1}\left(1-\frac{1}{i^2}\right)\frac{1}{2d^2}\binom{n}{d-1} \geqslant \frac{n-Cd^2}{d-1}\binom{n-1}{d-3} \end{equation} if $n > 4d^3/c'$. It now follows from \eqref{eq2} and \eqref{eq3} that the expression \eqref{eq1} is at least \[ c'\prod_{i=2}^{d}\left(1-\frac{1}{i^2}\right)\binom{n}{d-1},\] which finishes the induction. \end{proof} \begin{lemma}\label{lem:coset2} Let $\delta^*$ be an elliptic normal curve or the smooth points of a rational acnodal curve in $\mathbb{R}\mathbb{P}^d$, $d \geqslant 4$, and let $H \oplus x$ be a coset of a finite subgroup $H$ of $\delta^*$, with $(d+1)x\in H$. Let $A\subseteq H\oplus x$ and $B\subset\mathbb{R}\mathbb{P}^d\setminus(H\oplus x)$ with $|A|=a$ and $|B|=b$. Let $P = (H \oplus x \setminus A) \cup B$ with $|P|=n$ be such that every $d$ points of $P$ span a hyperplane. If $A$ and $B$ are not both empty and $n\geqslant C(a+b+d^2)d$ for some sufficiently large absolute constant $C>0$, then $P$ spans at least $(1+c)\binom{n-1}{d-1}$ ordinary hyperplanes for some sufficiently small absolute constant $c>0$. \end{lemma} \begin{proof} We first bound from below the number of ordinary hyperplanes of $(H\oplus x)\setminus A$ that do not pass through a point of $B$. The number of ordinary hyperplanes of $(H\oplus x)\setminus A$ that are disjoint from $A$ is \[ \frac{1}{(d-1)!}\left|\setbuilder{(a_1,\dots,a_d)\in(H\setminus(A\ominus x))^d}{\begin{array}{c}2a_1\oplus a_2 \oplus\dotsb \oplus a_d=\ominus (d+1)x,\\ \text{$a_1,\dots,a_d$ are distinct}\end{array}}\right|.\] If we denote by by $[m_1, \dotsc, m_k]'$ the number of ordered $k$-tuples $(a_1, \dotsc, a_k)$ with distinct $a_i \in H\setminus(A\ominus x)$ that satisfy $m_1 a_1 \oplus \dotsb \oplus m_k a_k = \ominus (d+1)x$, then we obtain, similar to the proofs of Lemmas~\ref{lem:upper} and \ref{lem:recurrence}, that \begin{align*} [2, \!\!\underbrace{1, \dotsc, 1}_\text{$d-1$ times}\!]' &= (d-1)!\binom{n-b}{d-1} - [3, \!\!\underbrace{1, \dotsc, 1}_\text{$d-2$ times}\!]' - (d-2)[2, 2, \!\!\underbrace{1, \dotsc, 1}_\text{$d-3$ times}\!]'\\ &\geqslant (d-1)!\binom{n-b}{d-1} - 2(d-2)!\binom{n-b}{d-2}-2(d-2)(d-2)!\binom{n-b}{d-2}\\ &= (d-1)!\binom{n-b}{d-1} - 2(d-1)!\binom{n-b}{d-2}, \end{align*} and it follows that the number of ordinary hyperplanes of $(H\oplus x)\setminus A$ disjoint from $A$ is at least $\binom{n-b}{d-1}-2\binom{n-b}{2}$. Next, we obtain an upper bound on the number of these hyperplanes that pass through a point $q\in B$. Let the ordinary hyperplane $\Pi$ pass through $p_1,p_2,\dots,p_d\in (H\oplus x)\setminus A$, with $p_1$ being the double point. Since $q\in\Pi$ and any $d$ points determine a hyperplane, $\Pi$ is still spanned by $q,p_1,\dots,p_{d-1}$, after a relabelling of $p_2,\dots,p_d$. Let $S$ be a minimal subset of $\{p_2,\dots,p_{d-1}\}$ such that the tangent line $\ell$ of $\delta$ at $p_1$ lies in the flat spanned by $S\cup\{q,p_1\}$. If $S$ is empty, then $\ell$ is a tangent from $q$ to $\delta$, of which there are at most $d(d+1)$ (this follows again from projection and the Pl\"ucker formulas \citelist{\cite{W78}*{Chapter~IV, p.~117}\cite{NZ}*{Corollary~2.5}}). Therefore, the number of ordinary hyperplanes through $p_1,p_2,\dots,p_d\in (H\oplus x)\setminus A$ with the tangent of $\delta$ at $p_1$ passing through $q$ is at most $d(d+1)\binom{n-b}{d-2}$. If on the other hand $S$ is non-empty, then there is some $p_i$, say $p_{d-1}$, such that $q,p_1,\dots,p_{d-2}$ together with $\ell$ generate $\Pi$. Therefore, $\Pi$ is determined by $p_1$, the tangent through $p_1$, and some $d-3$ more points $p_i$. There are at most $(n-b)\binom{n-b-1}{d-3} = (d-2)\binom{n-b}{d-2}$ ordinary hyperplanes through $q$ in this case. The number of ordinary hyperplanes of $(H\oplus x)\setminus A$ that contain a point from $A$ is at least \[a\left(\binom{n-b}{d-1}-a\binom{n-b}{d-2}-(n-b)\binom{n-b-1}{d-3}\right) = a\binom{n-b}{d-1}-(a^2+a(d-2))\binom{n-b}{d-2},\] since we can find such a hyperplane by choosing a point $p\in A$ and $d-1$ points $p_1,\dots,p_{d-1}\in(H\oplus x)\setminus A$, and then the remaining point $\ominus(p\oplus p_1\oplus\dots\oplus p_{d-1})$ might not be a new point in $(H\oplus x)\setminus A$ by either being in $A$ (possibly equal to $p$) or being equal to one of the $p_i$. The number of these hyperplanes that also pass through some point of $B$ is at most $ab\binom{n-b}{d-2}$. Therefore, the number of ordinary hyperplanes of $(H\oplus x)\setminus A$ that miss $B$ is at least \begin{equation}\label{lower1} (1+a)\binom{n-b}{d-1}-\left(2 + b(d(d+1)+d-2) + a^2+a(d-2) + ab\right)\binom{n-b}{d-2}. \end{equation} Next, assuming that $B\neq\emptyset$, we find a lower bound to the number of ordinary hyperplanes through exactly one point of $B$ and exactly $d-1$ points of $(H\oplus x)\setminus A$. The number of hyperplanes through at least one point of $B$ and exactly $d-1$ points of $(H\oplus x)\setminus A$ is at least $bc'\binom{n-b}{d-1}-ab\binom{n-b}{d-2}$ by Lemmas~\ref{lem:7.7-} and~\ref{lem:7.7} for some sufficiently small absolute constant $c'>0$. The number of hyperplanes through at least two points of $B$ and exactly $d-1$ points of $(H\oplus x)\setminus A$ is at most $\binom{b}{2}\binom{n-b}{d-2}$. It follows that there are at least $bc'\binom{n-b}{d-1}-\bigl(ab+\binom{b}{2}\bigr)\binom{n-b}{d-2}$ ordinary hyperplanes passing though a point of~$B$. Combining this with \eqref{lower1}, $P$ spans at least \begin{equation*} (1+a+bc')\binom{n-b}{d-1}-\left(2 + b(d(d+1)+d-2) + a^2+a(d-2) + 2ab + \binom{b}{2}\right)\binom{n-b}{d-2} =: f(a,b) \end{equation*} ordinary hyperplanes. Since \[f(a+1,b) - f(a,b) = \binom{n-b}{d-1}-(2a+2b+d-1)\binom{n-b}{d-2}\] is easily seen to be positive for all $a\geqslant 0$ as long as $n > (2a+2b+d-1)(d-1)+b+d-2$, we have without loss of generality that $a=0$ in the case that $b\geqslant 1$. Then $f(0,b+1)-f(0,b)$ is easily seen to be at least \[ c'\binom{n-b-1}{d-1} - (d^2+d-2+b)\binom{n-b-1}{d-2},\] which is positive for all $b\geqslant 1$ if $n \geqslant C(b+d^2)d$ for $C$ sufficiently large. Also, $f(0,1) = (1+c')\binom{n-1}{d-1} - (d^2+2d)\binom{n-1}{d-2}) \geqslant (1+c)\binom{n-1}{d-1}$ if $n\geqslant Cd^3$. This completes the proof in the case where $B$ is non-empty. If $B$ is empty, then we can bound the number of ordinary hyperplanes from below by setting $b=0$ in \eqref{lower1}, and checking that the resulting expression \[ (1+a)\binom{n}{d-1} - \left(d+a^2+a(d-2)\right)\binom{n}{d-2}\] is increasing in $a$ if $n > (2a+d-1)(d-1)+d-2$, and larger than $\frac32\binom{n-1}{d-1}$ if $n > Cd^3$. \end{proof} We are now ready to prove Theorems~\ref{thm:main2} and~\ref{thm:main3}. \begin{proof}[Proof of Theorem~\ref{thm:main2}] Let $P$ be the set of $n$ points. By Lemma~\ref{lem:coset1}, we may assume that $P$ has at most $\binom{n-1}{d-1}$ ordinary hyperplanes. Since $n \geqslant C d^3 2^d$, we may apply Theorem~\ref{thm:main1} to obtain that up to $O(d2^d)$ points, $P$ lies in a hyperplane or is a coset of a subgroup of an elliptic normal curve or the smooth points of a rational acnodal curve. In the first case, by Lemma~\ref{lem:hyperplane}, since $n \geqslant C d^3 2^d$, the minimum number of ordinary hyperplanes is attained when all but one point is contained in a hyperplane and we get exactly $\binom{n-1}{d-1}$ ordinary hyperplanes. In the second case, by Lemma~\ref{lem:coset2}, again since $n \geqslant C d^3 2^d$, the minimum number of ordinary hyperplanes is attained by a coset of an elliptic normal curve or the smooth points of a rational acnodal curve. Lemmas~\ref{lem:coset1} and \ref{lem:2111} then complete the proof. Note that the second term in the error term of Lemma~\ref{lem:2111} is dominated by the first term because of the lower bound on $n$, and that the error term here is negative by Lemma~\ref{lem:coset1}. \end{proof} Note that if we want to find the exact minimum number of ordinary hyperplanes spanned by a set of $n$ points in $\mathbb{R}\mathbb{P}^d$, $d \geqslant 4$, not contained in a hyperplane and where every $d$ points span a hyperplane, we can continue with the calculation of $[2, 1, \dotsc, 1; c]$ in the proof of Lemma~\ref{lem:2111}. As seen in the proof of Lemma~\ref{lem:coset1}, this depends on $\gcd(d+1, n)$. We also have to minimise over different values of $c \in H$, and if $n \equiv 0 \pmod{4}$, consider both cases $H \cong \mathbb{Z}_n$ and $H \cong \mathbb{Z}_{n/2} \times \mathbb{Z}_2$. For example, it can be shown that if $d=4$, the minimum number is \[ \begin{cases} \binom{n-1}{3} - 4 & \text{if } n \equiv 0 \pmod{5},\\ \binom{n-1}{3} & \text{otherwise}, \end{cases} \] if $d=5$, the minimum number is \[ \begin{cases} \binom{n-1}{4} - \frac{1}{8}n^2 + \frac{1}{12} n - 1 & \text{if } n \equiv 0 \pmod{6},\\ \binom{n-1}{4} & \text{if } n \equiv 1, 5 \pmod{6},\\ \binom{n-1}{4} -\frac{1}{8}n^2 + \frac{3}{4}n - 1 & \text{if } n \equiv 2, 4 \pmod{6},\\ \binom{n-1}{4} - \frac{2}{3}n + 2 & \text{if } n \equiv 3 \pmod{6}, \end{cases} \] and if $d=6$, the minimum number is \[ \begin{cases} \binom{n-1}{5} - 6 & \text{if } n \equiv 0 \pmod{7},\\ \binom{n-1}{5} & \text{otherwise.} \end{cases} \] \begin{proof}[Proof of Theorem~\ref{thm:main3}] We first show that there exist sets of $n$ points, with every $d$ points spanning a hyperplane, spanning at least $\frac{1}{d+1} \binom{n-1}{d} + O\left(2^{-d/2}\binom{n}{\lfloor \frac{d-1}{2} \rfloor}\right)$ $(d+1)$-point hyperplanes. Let $\delta^*$ be an elliptic normal curve or the smooth points of a rational acnodal curve. By Propositions~\ref{prop:elliptic_group} and~\ref{prop:rational_group}, the number of $(d+1)$-point hyperplanes spanned by a coset $H \oplus x$ of $\delta^*$ is \[ \frac{1}{(d+1)!}[\!\underbrace{1, \dotsc, 1}_\text{$d+1$ times}\!; c] \] for some $c \in \delta^*$. Note that \[ [\!\underbrace{1, \dotsc, 1}_\text{$d+1$ times}\!; c] = d!\binom{n}{d} - d[2, \!\!\underbrace{1, \dotsc, 1}_\text{$d-1$ times}\!\!; c], \] so if we take $H \oplus x$ to be a coset minimising the number of ordinary hyperplanes, then by Theorem~\ref{thm:main2}, there are \begin{align} &\mathrel{\phantom{=}} \frac{1}{d+1} \left( \binom{n}{d} - \binom{n-1}{d-1} \right) + O\left(2^{-\frac{d}{2}}\binom{n}{\lfloor \frac{d-1}{2} \rfloor}\right) \notag \\ &= \frac{1}{d+1} \binom{n-1}{d} + O\left(2^{-\frac{d}{2}}\binom{n}{\lfloor \frac{d-1}{2} \rfloor}\right)\label{eqn:d+1} \end{align} $(d+1)$-point hyperplanes. Next let $P$ be an arbitrary set of $n$ points in $\mathbb{R}\mathbb{P}^d$, $d \geqslant 4$, where every $d$ points span a hyperplane. Suppose $P$ spans the maximum number of $(d+1)$-point hyperplanes. Without loss of generality, we can thus assume $P$ spans at least $\frac{1}{d+1}\binom{n-1}{d} + O\left(2^{-d/2}\binom{n}{\lfloor \frac{d-1}{2} \rfloor}\right)$ $(d+1)$-point hyperplanes. Let $m_i$ denote the number of $i$-point hyperplanes spanned by $P$. Counting the number of unordered $d$-tuples, we get \[ \binom{n}{d} = \sum_{i \geqslant d} \binom{i}{d} m_i \geqslant m_d + (d+1)m_{d+1}, \] hence we have \[ m_d \leqslant \binom{n}{d} - \binom{n-1}{d} - O\left(d2^{-\frac{d}{2}}\binom{n}{\lfloor \frac{d-1}{2} \rfloor}\right) = O\left(\binom{n-1}{d-1}\right), \] and we can apply Theorem~\ref{thm:main1}. In the case where all but $O(d2^d)$ points of $P$ are contained in a hyperplane, it is easy to see that $P$ spans $O(d2^d\binom{n}{d-1})$ $(d+1)$-point planes, contradicting the assumption. So all but $O(d2^d)$ points of $P$ are contained in a coset $H \oplus x$ of a subgroup $H$ of $\delta^*$. Consider the identity \[ (d+1)m_{d+1} = \binom{n}{d} - m_d - \sum_{i \geqslant d+2} \binom{i}{d} m_i. \] By Theorem~\ref{thm:main2} and Lemma~\ref{lem:coset2}, we know that $m_d \geqslant \binom{n-1}{d-1} - O\left(d2^{-d/2}\binom{n}{\lfloor \frac{d-1}{2} \rfloor}\right)$ and any deviation of $P$ from the coset $H \oplus x$ adds at least $c\binom{n-1}{d-1}$ ordinary hyperplanes for some sufficiently small absolute constant $c>0$. Since we also have \begin{align*} \sum_{i \geqslant d+2} \binom{i}{d} m_i &= \binom{n}{d} - m_d - (d+1)m_{d+1}\\ &= \binom{n}{d} - \binom{n-1}{d-1} - \binom{n-1}{d} + O\left(d2^{-\frac{d}{2}}\binom{n}{\lfloor \frac{d-1}{2} \rfloor}\right)\\ &= O\left(d2^{-\frac{d}{2}}\binom{n}{\lfloor \frac{d-1}{2} \rfloor}\right), \end{align*} we can conclude that $m_{d+1}$ is maximised when $P$ is exactly a coset of a subgroup of $\delta^*$, in which case \eqref{eqn:d+1} completes the proof. \end{proof} Knowing the exact minimum number of ordinary hyperplanes spanned by a set of $n$ points in $\mathbb{R}\mathbb{P}^d$, $d \geqslant 4$, not contained in a hyperplane and where every $d$ points span a hyperplane then also gives the exact maximum number of $(d+1)$-point hyperplanes. Continuing the above examples, for $d = 4$, the maximum number is \[ \begin{cases} \frac15\binom{n-1}{4} +\frac45 & \text{if } n \equiv 0 \pmod{5},\\ \frac15\binom{n-1}{4} & \text{otherwise}, \end{cases} \] for $d=5$, the maximum number is \[ \begin{cases} \frac{1}{6}\binom{n-1}{5} + \frac{1}{48}n^2 - \frac{1}{72}n + \frac16 & \text{if } n \equiv 0 \pmod{6},\\ \frac{1}{6}\binom{n-1}{5} & \text{if } n \equiv 1, 5 \pmod{6},\\ \frac{1}{6}\binom{n-1}{5} + \frac{1}{48}n^2 - \frac{1}{8}n +\frac16 & \text{if } n \equiv 2, 4 \pmod{6},\\ \frac{1}{6}\binom{n-1}{5} +\frac{1}{9}n -\frac{1}{3} & \text{if } n \equiv 3 \pmod{6}, \end{cases} \] and for $d=6$, the maximum number is \[ \begin{cases} \frac17\binom{n-1}{6} +\frac67 & \text{if } n \equiv 0 \pmod{7},\\ \frac17\binom{n-1}{6} & \text{otherwise}. \end{cases} \] \section*{Acknowledgments} We thank Peter Allen, Alex Fink, Misha Rudnev, and an anonymous referee for helpful remarks and for pointing out errors in a previous version. \begin{bibdiv} \begin{biblist} \bib{B18}{article}{ author={Ball, Simeon}, title={On sets defining few ordinary planes}, journal={Discrete Comput.\ Geom.}, volume={60}, date={2018}, number={1}, pages={220--253}, } \bib{BJ18}{article}{ author={Ball, Simeon}, author={Jimenez, Enrique}, title={On sets defining few ordinary solids}, note={arXiv:1808.06388}, } \bib{BM17}{article}{ author={Ball, Simeon}, author={Monserrat, Joaquim}, title={A generalisation of {S}ylvester's problem to higher dimensions}, journal={J. Geom.}, volume={108}, date={2017}, number={2}, pages={529--543}, } \bib{Clifford}{article}{ author={Clifford, William Kingdon}, title={On the classification of loci}, journal={Philosophical Transactions of the Royal Society of London}, volume={169}, date={1878}, pages={663--681}, } \bib{D03}{book}{ author={Dolgachev, Igor}, title={Lectures on Invariant Theory}, publisher={Cambridge University Press}, date={2003}, } \bib{Fi08}{article}{ author={Fisher, Tom}, title={The invariants of a genus one curve}, journal={Proc. Lond. Math. Soc.}, volume={97}, date={2008}, number={3}, pages={753--782}, } \bib{Fu84}{book}{ author={Fulton, William}, title={Introduction to intersection theory in algebraic geometry}, series={CBMS Regional Conference Series in Mathematics}, volume={54}, publisher={American Mathematical Society}, date={1984}, } \bib{Fu11}{article}{ author={Furukawa, Katsuhisa}, title={Defining ideal of the Segre locus in arbitrary characteristic}, journal={J. Algebra}, volume={336}, date={2011}, number={1}, pages={84--98}, } \bib{GT13}{article}{ author={Green, Ben}, author={Tao, Terence}, title={On sets defining few ordinary lines}, journal={Discrete Comput.\ Geom.}, volume={50}, date={2013}, number={2}, pages={409--468}, } \bib{H65}{article}{ author={Hansen, Sten}, title={A generalization of a theorem of Sylvester on the lines determined by a finite point set}, journal={Math. Scand.}, volume={16}, date={1965}, pages={175--180}, } \bib{H92}{book}{ author={Harris, J.}, title={Algebraic Geometry: A First Course}, publisher={Springer}, date={1992}, } \bib{H77}{book}{ author={Hartshorne, R.}, title={Algebraic Geometry}, publisher={Springer}, date={1977}, } \bib{IK99}{book}{ author={Iarrobino, Anthony}, author={Kanev, Vassil}, title={Power Sums, Gorenstein Algebras, and Determinantal Loci}, series={Lecture Notes in Mathematics}, volume={1721}, publisher={Springer}, date={1999}, } \bib{J18}{thesis}{ author={Jimenez Izquierdo, Enrique}, title={On sets of points with few ordinary hyperplanes}, type={Master's Thesis}, address={Universitat Polit\`ecnica de Catalunya}, date={2018}, } \bib{KKT08}{article}{ author={Kaminski, J. Y.}, author={Kanel-Belov, A.}, author={Teicher, M.}, title={Trisecant lemma for nonequidimensional varieties}, journal={J. Math. Sci.}, volume={149}, number={2}, year={2008}, pages={1087--1097}, } \bib{K99}{article}{ author={Kanev, Vassil}, title={Chordal varieties of {V}eronese varieties and catalecticant matrices}, journal={J. Math. Sci.}, volume={94}, date={1999}, number={1}, pages={1114--1125}, } \bib{Klein}{article}{ author={Klein, Felix}, title={\"Uber die elliptischen Normalcurven der $N$ten Ordnung und zugeh\"orige Modulfunctionen der $N$ten Stufe}, journal={Abhandlungen der mathematisch-physischen Classe der K\"oniglich S\"achsischen Gesellschaft der Wissenschaften}, volume={13}, date={1885}, number={4}, pages={337--399}, } \bib{Kollar}{book}{ author={Koll\'ar, J\'anos}, title={Lectures on Resolution of Singularities}, series={Annals of Mathematics Studies}, volume={166}, publisher={Princeton University Press}, date={2007}, } \bib{LMMSSZ18}{article}{ author={Lin, Aaron}, author={Makhul, Mehdi}, author={Nassajian Mojarrad, Hossein}, author={Schicho, Josef}, author={Swanepoel, Konrad}, author={de Zeeuw, Frank}, title={On sets defining few ordinary circles}, journal={Discrete Comput. Geom.}, volume={59}, date={2018}, number={1}, pages={59--87}, } \bib{LS18}{article}{ author={Lin, Aaron}, author={Swanepoel, Konrad}, title={Ordinary planes, coplanar quadruples, and space quartics}, journal={J. Lond. Math. Soc. (2)}, volume={100}, date={2019}, pages={937--956}, } \bib{M15}{thesis}{ author={Monserrat, Joaquim}, title={Generalisation of {S}ylvester's problem}, type={Bachelor's Degree Thesis}, address={Universitat Polit\`ecnica de Catalunya}, date={2015}, } \bib{M51}{article}{ author={Motzkin, T.}, title={The lines and planes connecting the points of a finite set}, journal={Trans. Amer. Math. Soc.}, volume={70}, date={1951}, number={3}, pages={451--464}, } \bib{Muntingh}{thesis}{ author={Muntingh, Georg}, title={Topics in polynomial interpolation theory}, type={Ph.D. Dissertation}, address={University of Oslo}, date={2010}, } \bib{NZ}{unpublished}{ author={{Nassajian Mojarrad}, Hossein}, author={de~Zeeuw, Frank}, title={On the number of ordinary circles}, note={arXiv:1412.8314}, } \bib{PS10}{article}{ author={Purdy, George B.}, author={Smith, Justin W.}, title={Lines, circles, planes and spheres}, journal={Discrete Comput. Geom.}, volume={44}, date={2010}, number={4}, pages={860--882}, } \bib{Rez2013}{article}{ author={Reznick, Bruce}, title={On the length of binary forms}, conference={ title={Quadratic and higher degree forms}, }, book={ series={Dev. Math.}, volume={31}, publisher={Springer}, }, date={2013}, pages={207--232}, } \bib{SR85}{book}{ author={Semple, J. G.}, author={Roth, L.}, title={Introduction to Algebraic Geometry}, publisher={The Clarendon Press}, date={1985}, note={Reprint of the 1949 original}, } \bib{S09}{book}{ author={Silverman, J.~H.}, title={The Arithmetic of Elliptic Curves}, edition={Second Edition}, publisher={Springer}, date={2009}, } \bib{S94}{book}{ author={Silverman, J.~H.}, title={Advanced Topics in the Arithmetic of Elliptic Curves}, publisher={Springer}, date={1994}, } \bib{S51}{article}{ author={Sylvester, J. J.}, title={On a remarkable discovery in the theory of canonical forms and of hyperdeterminants}, journal={Philosophical Magazine}, volume={2}, date={1851}, pages={391--410}, note={Paper 41 in The Collected Mathematical Papers of James Joseph Sylvester, Cambridge University Press, 1904}, } \bib{W78}{book}{ author={Walker, R. J.}, title={Algebraic Curves}, publisher={Springer}, date={1978}, } \end{biblist} \end{bibdiv} \newpage \begin{dajauthors} \begin{authorinfo}[AL] Aaron Lin\\ Department of Mathematics\\ London School of Economics and Political Science\\ United Kingdom\\ aaronlinhk\imageat{}gmail\imagedot{}com \end{authorinfo} \begin{authorinfo}[KS] Konrad Swanepoel\\ Department of Mathematics\\ London School of Economics and Political Science\\ United Kingdom\\ k\imagedot{}swanepoel\imageat{}lse\imagedot{}ac\imagedot{}uk \\ \url{http://personal.lse.ac.uk/swanepoe/} \end{authorinfo} \end{dajauthors} \end{document}
\section{Introduction} The scientific and engineering community is devoting a major effort towards the identification and fabrication of novel 2D materials\cite{Efetov2010,Radisavljevic2011,Lebegue2013,Hanlon2015,Yasaei2015,Gibaja2016,Ares2016,Bandurin2016, Ashton2017,Cheon2017,Mounet2018} and their application in electronic devices\cite{Wang2012,Chhowalla2016}. To accelerate the discovery of the best candidates for electronic transport, systematic and accurate methods to compute phonon-limited resistivity and mobility from first principles would be very beneficial. Nevertheless, these quantities are not straightforward to compute and various degrees of approximations are often needed. A very successful approach relies on the solution of the Boltzmann transport equation\cite{Ziman,Allen1978} (BTE), in which the electron-phonon coupling (EPC) enters the expression for the scattering rates\cite{Grimvall,Giustino2017} and can be computed from first principles within density-functional perturbation theory (DFPT)\cite{Savrasov1994,Liu1996,Mauri1996,Bauer1998,Baroni2001} or with finite-differences schemes\cite{Dacorogna1985,Gunst2016a}. Although both methods proved to be very successful, DFPT is more efficient in dealing with long-wavelength effects since it does not need large supercells to accommodate the perturbation, and will thus be the method of choice in the following. Either way, the computation of EPC in 2D materials from first principles presents some challenges. Being ruled by long-range Coulomb interactions, the long-wavelength electron-phonon dynamics are highly dependent on dimensionality. The most obvious example is the Fr\"ohlich interaction in polar materials, which diverges in the long-wavelength limit in 3D while remains finite in 2D \cite{Sohier2016}. This fundamentally different behaviour is difficult to capture in standard electronic-structure codes based on plane-wave basis sets because of the spurious interaction with artificial periodic images, which leads to erroneous results when ${\bm q}\to0$. Thus, special care must be adopted when computing the response of a 2D system to long-wavelength perturbations\cite{Kozinsky2006,Sohier2015,Sohier2016,Sohier2017nl}. An appropriate treatment of doping is an additional challenge. While field-effect charging is omnipresent in experimental setups, it is usually not included in first-principles simulations. Often, calculations are performed for the neutral case, and the Fermi level is shifted within a frozen-band approximation when integrating the EPC matrix elements to obtain a certain scattering-related quantity. This is approximate because the EPC itself depends on doping, most notably via screening, but also via other mechanisms that will be discussed later. A more realistic description is now possible thanks to a recent development of DFPT for gated 2D materials\cite{Sohier2017}, where the doping charge is neutralized by adding planar distributions of counter-charges, mimicking experimental conditions where 2D materials are doped electrostatically through gates. Another source of challenge is that, in general, a very large number of EPC matrix elements must be computed to obtain a fine enough sampling of the electron-phonon dynamics over the Brillouin zone, which is computationally very expensive. To boost efficiency, one may use Wannier interpolations \cite{Lee2005,Yates2007,Giustino2007,Calandra2010,Marzari2012,Ponce2016} to obtain inexpensively the EPC over a dense mesh. However, interpolations work seamlessly only with short-range interactions. Long-range effects, such as Fr\"ohlich or piezo-electric coupling, need to be modeled and treated separately; this has been solved for three-dimensional systems\cite{Sjakste2015,Verdi2015}, while in 2D, Fr\"ohlich coupling has been modeled\cite{Sohier2016} and efficient ways to interpolate the phonon dispersions have been put forward\cite{Sohier2017nl}, but a thorough description of EPC interpolation is still missing. Nonetheless, the absence of interpolation techniques might not be, in the long run, a major constraint. Indeed, the reduced dimensionality entails one less dimension to sample, with a drastic reduction of electronic states and phonons to consider. Thus, it can be argued that for 2D materials, one should focus on addressing dimensionality and charging first, rather than interpolation. Here, we thus choose a direct approach and compute all EPC matrix elements from DFPT in the appropriate boundary and charging conditions\cite{Sohier2017}. The use of symmetries and energy selection rules, in addition to the momenta being restricted to two dimensions, makes the process computationally feasible. For the solution to the Boltzmann transport equation for electrons and holes, different approaches involving various degrees of approximation have been put forward. In the case of metals, Allen derived an approximate solution\cite{Allen1978} by suitably modifying Eliashberg theory\cite{Grimvall} to transport. This approach has been successfully applied in the early efforts to compute mobilities from first principles\cite{Savrasov1996,Bauer1998} and it is now customary in many available transport codes such as EPW\cite{Ponce2016}. In the general case, including semiconductors, the major challenge is that the integrodifferential BTE does not have a closed-form solution. Most approaches use then some form of relaxation-time approximation\cite{Restrepo2009,Shishir2009,Borysenko2010,Jin2014,Restrepo2014,Park2014, Gunst2016a,Jin2016,Rudenko2016,Trushkov2017,Gaddemane2018,Ponce2018} to obtain a closed-form result. Still, the errors associated with the various approximate solutions to the BTE in the literature are often difficult to quantify. An iterative scheme inspired by the original Rode's method~\cite{Rode1970a,Rode1970b} to solve the inelastic part of the BTE has been recently proposed\cite{Kaasbjerg2012a,Kaasbjerg2013,Li2015,Ma2018}, while a very efficient preconditioned conjugate-gradient approach has been reported in Ref.~\onlinecite{Fiorentini2016} following a recipe introduced in the context of the phonon Boltzmann equation for thermal transport\cite{Fugallo2013,Fugallo2014,Cepellotti2015}. Ref.~\onlinecite{Li2015} also offers an interesting comparison of the different methods to solve the BTE and shows a broad agreement between these for the case of MoS\2; still, this might not be the case for all materials. A full numerical solution of the BTE beyond the relaxation-time approximation was introduced in Ref.~\onlinecite{Sohier2014a} for graphene. An advantage of this latter method is that it does not require a broadening of the $\delta$ functions enforcing energy selection rules, contrary to the other methods mentioned above. It was, however, tailored specifically for graphene. Here, we propose a more general approach with iterative scheme combined with the use of the triangles method\cite{Ashraff1987,Pedersen2008} for accurate integrations of the $\delta$ functions. Relatively few 2D materials have had mobilities theoretically investigated up to now. Graphene has been studied extensively\cite{Ando2006,Hwang2007,Manes2007,Samsonidze2007,Stauber2007,Fratini2008,Hwang2008a,Shishir2009,Hwang2009,Borysenko2010,Mariani2010,DasSarma2011,DasSarma2011,Kaasbjerg2012,Hwang,Restrepo2014,Park2014,Sohier2014a,Gunst2016a,Gunst2017}, showing excellent agreement\cite{Park2014} with experiments\cite{Efetov2010} and a detailed understanding of the main processes limiting mobility\cite{Borysenko2010}, including the effects of dimensionality and charging by field effect\cite{Gunst2017,Sohier2017}. MoS\2, another prototypical 2D material, has also been studied in several works \cite{Gunst2016a,Kaasbjerg2012a,Kaasbjerg2013,Li2015,Jin2014,Restrepo2014}, as well as phosphorene \cite{Gaddemane2018,Qiao2014,Jin2016,Trushkov2017,Rudenko2016,Liao2015}, arsenene \cite{Wang2015,Pizzi2016nc,Wang2017}, silicene \cite{Gunst2016a}, and other TMDs \cite{Jin2014}. On the other hand, the effects of periodic images and dimensionality are explicitly treated only in some of the first-principles efforts\cite{Gunst2016a,Kaasbjerg2012a,Kaasbjerg2013}. Charging is most often treated as a rigid shift of the Fermi energy in the computation of the transport properties, but not included in the computation of the matrix elements themselves. Consequently, the influence of doping on the EPC is generally neglected. In some instances, electronic screening is accounted for analytically\cite{Kaasbjerg2012a,Kaasbjerg2013}, but this necessarily entails the use of models and approximations (not obvious in 2D). Also, as will be shown here, screening is not the only effect of doping on EPC matrix elements. Last, computational accuracy is often limited by the very expensive nature of the Brillouin zone (BZ) integrals. For all these reasons, a full treatment of doping and periodicity is necessary, together with an efficient and automatic implementation of all BZ sums. All these points are addressed in this paper, that is structured as follows. In the first section, we describe the formal framework of the BTE and identify the quantities needed to solve it. In the second section, we present the workflow of first-principles calculations used to compute the physical quantities associated with phonon-limited transport. Then, we discuss the results of this workflow applied to a set of known prototypical materials, i.e., three electron-doped TMDs in their 2H form (MoS\2, WS\2, WSe\2), as well as electron-doped (gray) arsenene, and both hole- and electron-doped (black) phosphorene. \section{Boltzmann Transport Equation} \label{sec:theory} In this first section, we review the framework of the Boltzmann transport equation for electrons in an effort to settle the context and introduce the various quantities used in the rest of the paper. Similar derivations can be found in the literature, e.g. in Ref.~\onlinecite{Ziman,Ashcroft1976,Nag1980}. We consider any 2D material to lie in the $x-y$ plane with an applied electric field in the same plane, in the $-\boldsymbol{u}_{\boldsymbol{E}}$ direction. The electric field favors states with wavevectors $\mathbf{k}$ in the opposite direction, $\boldsymbol{u}_{\boldsymbol{E}}$, thus taking the electronic distribution $f$ out of its equilibrium Fermi-Dirac ground-state $f^0$. Phonon scattering acts to bring the system back towards its unperturbed equilibrium state; then, a steady-state regime is reached and a net electric current $\boldsymbol{j}$ emerges. The conductivity, or the inverse of the resistivity, is then defined as\cite{Ziman,Ashcroft1976,Nag1980}: \begin{align} \label{eq:conductivity} \sigma=\frac{1}{\rho}= \sum_{\alpha} \frac{2e}{|\boldsymbol{E}|} \int_{k \in \alpha} \frac{d\mathbf{k}}{(2\pi)^2} f(\mathbf{k}) \boldsymbol{v}(\mathbf{k}) \cdot \boldsymbol{u}_{\boldsymbol{E}} \end{align} where the factor 2 accounts for spin degeneracy, $e>0$ is the Coulomb charge, $\boldsymbol{E}$ the electric field, $\alpha$ is an index representing the different valleys in the Brillouin zone, $f(\mathbf{k})$ is the steady-state occupation function, and $\boldsymbol{v}(\mathbf{k})$ the band velocity of the electronic state. Here, rather than integrating over all the Brillouin zone, we limit ourselves to the relevant electron or hole pockets that are occupied by temperature or doping. In semiconductors, these pockets form valleys which we will further define later, and wavevectors $\mathbf{k}$ are taken from these valleys. Mobilities can then be obtained from the Drude model as $\mu=\sigma/n$, where $n$ is the electron density (replace with hole density $p$ in the case of hole doping). The central quantity to obtain is thus the occupation distribution $f(\mathbf{k})$. Assuming this to be spatially uniform and time-independent (steady-state), the Boltzmann transport equation states that the change of the occupation distribution driven by the electric field must be compensated by scattering\cite{Ziman,Ashcroft1976,Nag1980}: \begin{align} \label{eq:BTE0} -\frac{e\boldsymbol{E}}{\hbar} \cdot \frac{\partial f}{\partial \mathbf{k}}= \left( \frac{\partial f}{\partial t} \right)_{\rm{scatt}}(\mathbf{k}) \end{align} The collision integral (right-hand side) can be found using Fermi's golden rule: \begin{align} \label{eq:coll} \begin{split} \left( \frac{\partial f}{\partial t} \right)_{\rm{scatt}}(\mathbf{k}) = \sum_{\mathbf{k}'} & P_{\mathbf{k}'\mathbf{k}} f(\mathbf{k}') \left(1-f(\mathbf{k})\right) \\ & - P_{\mathbf{k}\bok'} f(\mathbf{k}) \left(1-f(\mathbf{k}')\right), \end{split} \end{align} where $P_{\mathbf{k}\bok'}$ is the scattering probability from state $\mathbf{k}$ to state $\mathbf{k}'$; $P_{\mathbf{k}\bok'}$ should include in general all relevant scattering processes. Here, we sum over all electron-phonon scattering probabilities associated with the phonons modes of the system, i.e. $P_{\mathbf{k}\bok'}=\sum_{\nu} P_{\mathbf{k}\bok', \nu}$, where $P_{\mathbf{k}\bok', \nu}$ is the sum of phonon emission and absorption terms\cite{Grimvall} for phonon mode $\nu$ of momentum $\mathbf{q}=\mathbf{k}'-\mathbf{k}$: \begin{align}\label{eq:Pkkp} \begin{split} P_{\mathbf{k} \mathbf{k}+\mathbf{q}, \nu}= \frac{2\pi}{\hbar} \frac{1}{N} & |g_{\mathbf{k} \mathbf{k}+\mathbf{q}, \nu}|^2 \{ n_{\mathbf{q}, \nu} \delta(\varepsilon_{\mathbf{k}+\mathbf{q}}-\varepsilon_{\mathbf{k}}-\hbar \omega_{\mathbf{q}, \nu}) \\ +&(n_{\mathbf{q}, \nu}+1) \delta(\varepsilon_{\mathbf{k}+\mathbf{q}}-\varepsilon_{\mathbf{k}}+\hbar \omega_{\mathbf{q}, \nu}) \}. \end{split} \end{align} In the expression above, $g_{\mathbf{k} \mathbf{k}+\mathbf{q}, \nu}$ is the electron-phonon coupling (EPC) matrix element and $n_{\mathbf{q}, \nu}$ is the phonon occupation, which we assume to be the equilibrium Bose-Einstein distribution. The $\delta$ functions stem from the energy selection rules involved in scattering, forcing the need to evaluate the EPC on very fine momentum grids, making the calculations challenging. Phonon scattering as described in Eq. \ref{eq:Pkkp} involves three quasi-particles: an initial electronic state, a final electronic sate, and a phonon. The EPC matrix element connecting the initial and final states can be computed within DFPT\cite{Baroni2001,Giustino2017} and reads: \begin{align} \label{eq:EPC} g_{\mathbf{k}, \mathbf{k}+\mathbf{q},\nu}= \sum_{a,i} \boldsymbol{e}^{a,i}_{\mathbf{q},\nu} \sqrt{\frac{\hbar}{2M_a \omega_{\mathbf{q},\nu}}} \langle \mathbf{k}+\mathbf{q} | \frac{\partial V_{\rm{KS}}(\mathbf{r}) }{\partial \boldsymbol{u}_{a,i}(\mathbf{q})} |\mathbf{k}\rangle \end{align} where $a$ is an atomic index, $i$ a cartesian index, $\boldsymbol{e}^{a,i}_{\mathbf{q},\nu}$ is the phonon eigenvector, $M_a$ is the mass of atom $a$, $|\mathbf{k}\rangle ,|\mathbf{k}+\mathbf{q}\rangle $ are the initial and final electronic states, and $ \frac{\partial V_{\rm{KS}}(\mathbf{r}) }{\partial \boldsymbol{u}_{a,i}(\mathbf{q})}$ is the derivative of the Kohn-Sham potential with respect to a periodic displacement of atom $a$ in direction $i$. We adopt a perturbation approach at first order in electric field and write : \begin{align} \label{eq:f0f1} f(\mathbf{k})=f^0(\mathbf{k})+f^1(\mathbf{k}) \end{align} where $f^0(\mathbf{k})$ is the Fermi-Dirac function and $f^1(\mathbf{k})$ is the linear perturbation proportional to the electric field, for which it is convenient to make the following general ansatz \begin{align} \label{eq:ansatz} f^1(\mathbf{k})= e|\boldsymbol{E}|\boldsymbol{u}_{\boldsymbol{E}} \cdot\boldsymbol{F}(\mathbf{k})\frac{\partial f^0(\mathbf{k})}{\partial \varepsilon} \end{align} where $\boldsymbol{F}(\mathbf{k})$ is a vectorial quantity with units of length that can be understood as a mean free displacement\cite{Li2015}. In the following the only approximation we make is to assume that this mean free displacement is along the band velocity, that is we write: \begin{align}\label{eq:approx} \boldsymbol{F}(\mathbf{k}) = \boldsymbol{v}(\mathbf{k}) \tau(\mathbf{k}) \end{align} where $\tau(\mathbf{k})$ is unknown and has the dimension of time. We will call it scattering time, although it is {\it not} the scattering time as often understood in the context of the relaxation-time approximation. This is similar to what has been proposed by Rode~\cite{Rode1970a,Rode1970b}, and reduces to his trial solution when $\boldsymbol{v}(\mathbf{k})\propto \mathbf{k}$. By replacing the occupation distribution of Eq.~\ref{eq:f0f1} with the ansatz Eq. \ref{eq:ansatz} and \ref{eq:approx} in Eq.~\ref{eq:BTE}, and keeping only first-order terms in the electric field, we get to what we will refer to as the linearized BTE: \begin{align} \label{eq:BTE} \begin{split} (1-f^0(\mathbf{k})) \boldsymbol{v}(\mathbf{k}) \cdot \boldsymbol{u}_{\boldsymbol{E}} = & \sum_{\mathbf{k}'} P_{\mathbf{k}\bok'} (1-f^0(\mathbf{k}')) \times \\ & \left\{ \boldsymbol{v}(\mathbf{k}) \cdot \boldsymbol{u}_{\boldsymbol{E}} \tau(\mathbf{k}) - \boldsymbol{v}(\mathbf{k}') \cdot \boldsymbol{u}_{\boldsymbol{E}} \tau(\mathbf{k}') \right\} \end{split} \end{align} where we have used the detailed balance condition $P_{\mathbf{k}'\mathbf{k}}f^0(\mathbf{k}') (1-f^0(\mathbf{k}))=P_{\mathbf{k}\bok'}f^0(\mathbf{k}) (1-f^0(\mathbf{k}'))$ and the fact that $\frac{\partial f^0(\varepsilon_{\mathbf{k}})}{\partial \varepsilon}=-\frac{f^0(\mathbf{k})\left(1-f^0(\mathbf{k})\right)}{kT}$. In Eq.~\ref{eq:BTE} we keep the term $(1-f^0(\mathbf{k})) \boldsymbol{v}(\mathbf{k})$ on the left-hand side to avoid having it on the right-hand side as a denominator, which would bring some numerical instability in the process of solving the equation numerically. Putting back the distribution Eq. \ref{eq:f0f1} in the expression for the conductivity Eq. \ref{eq:conductivity} we get: \begin{align} \label{eq:conductivity2} \sigma=\frac{1}{\rho}= \sum_p 2e^2 \int_{k \in \alpha} \frac{d\mathbf{k}}{(2\pi)^2} \left( \boldsymbol{v}(\mathbf{k}) \cdot \boldsymbol{u}_{\boldsymbol{E}}\right)^2 \tau(\mathbf{k}) \frac{\partial f^0}{\partial \varepsilon} \end{align} A very minimal set of approximations have been made to get to Eq. \ref{eq:BTE} and \ref{eq:conductivity2} (linear order in electric field, steady state, equilibrium phonon distribution, mean free displacement along band velocity). We will compute the conductivity at this level of approximation. This goes beyond the relaxation time approximation, which would correspond to neglecting the second term in brackets on the right-hand side of Eq.~\ref{eq:BTE}, and differs from the approaches in Ref.~\onlinecite{Li2015} and \onlinecite{Fiorentini2016} only in the assumption of Eq.~\ref{eq:approx}. In our approach we solve the linearized BTE (Eq. \ref{eq:BTE}) iteratively starting from a guess inspired by the relaxation-time approximation (see App. \ref{app:closed_form}), as suggested initially by Rode\cite{Rode1970a,Rode1970b}. In addition to some differences in the formulation of the BTE and the sampling of electronic and phonon momenta, our improvement with respect to the existing literature is the use of the triangles method \cite{Ashraff1987,Pedersen2008} to integrate the delta functions of Eq. \ref{eq:Pkkp}. \section{Workflow / Calculations} In this section we describe the computational workflow developed to calculate the transport properties of 2D materials. Electron-doped WS$_2$ ($n = 5\times10^{13}$ cm$^{-2}$) is used as a case study; this is a relatively complex system due to its multi-valley nature. As illustrated in Fig. \ref{fig:WF}a), the process can be separated into the two following steps: \begin{itemize} \item EPC: We compute the linear response of the system with respect to a set of phonon momenta $\mathcal{Q}$ (defined in the following section, along with all other sets of wave vectors, $\mathcal{I}$ and $\mathcal{F}$). The resulting EPC matrix elements $g^2_{\mathbf{k}, \mathbf{k}'}$ are then projected on a set $\mathcal{I}$ of relevant initial states $\mathbf{k} \in \mathcal{I}$ and interpolated on a set $\mathcal{F}$ of final states $\mathbf{k}' \in \mathcal{F}$. The initial states are where we want to evaluate the scattering time. Final states are all the states accessible from the initial states via phonon scattering. \item Transport: The matrix elements are then used to compute the scattering probabilities $P_{\mathbf{k}, \mathbf{k}'}$ and solve the BTE, which yields the scattering time for each initial state in $\mathcal{I}$. The scattering time is then interpolated for all states in $\mathcal{F}$, as shown in Fig.~\ref{fig:WF}c). The integration of the scattering times gives the transport quantities, like the temperature-dependent mobilities and resistivities shown in Fig. \ref{fig:WF} d). \end{itemize} In the following we first detail and justify the sampling choices for the momentum sets $\mathcal{I}$, $\mathcal{F}$ and $\mathcal{Q}$. Then we describe each of the two steps outlined above. \begin{figure*}[h] \includegraphics[width=0.97\textwidth]{transpWF.pdf} \caption{a) Schematic description of the first-principles workflow for electronic transport b) Interpolated electron-phonon couplings $g_{\mathbf{k}, \mathbf{k}'}$ for electron-doped WS$_2$. The initial state $\mathbf{k}$ considered here is indicated by a white star; the other points are the possible final states in the finely sampled pockets, where the color of the point indicates the strength of the electron-phonon coupling matrix element. The index of the phonon mode indicated at the top of each subplot refers to a purely energetic ordering of the phonon modes associated with each transition. This implies that crossings in phonon dispersions may lead to discontinuities in the plots. This explains the set of seemingly out-of-place EPC matrix elements in the K' valley for modes 5 and 6, and in lesser measure in the Q valleys for modes 2 and 3. c) Scattering times interpolated on the fine grid of electronic states $\mathcal{F}$, shown using a color scale for each electronic state in the valleys of WS$_2$. d) Temperature-dependent resistivity and mobility of electron-doped WS\2 ($n=5 \ 10^{13}$ cm$^{-2}$).} \label{fig:WF} \end{figure*} \subsection{Sampling} Phonon scattering involves three quasiparticles: an initial electronic state, a final electronic state and a phonon. We use a different momentum sampling over the Brillouin zone (BZ) for each of those quasiparticles, according to their use in the workflow and the cost of the associated calculations. Only a subset of the electronic states are relevant for transport. We see from the expression of conductivity (Eq. \ref{eq:conductivity2}) that one needs to find the dependency of the perturbed distribution only for electronic states for which $\frac{\partial f^0(\varepsilon_\mathbf{k})}{\partial \varepsilon}$ is significantly different from zero: this represents a set of electronic states with energies in a range of a few $kT$ around the Fermi level. Furthermore, we see in the collision integral that the scattering time at $\mathbf{k}$ depends on the scattering time of possible final states at $\mathbf{k}'$. This means that the energy range where we need to evaluate $\tau(\mathbf{k})$ must be extended by the maximum phonon energy $ \hbar \omega_{\rm{max}}$ above and below. Such constraints define pockets or valleys in the BZ, and in WS$_2$ we keep all electronic states up to an energy $0.24$ eV above the bottom of the conduction band. Panel c) of Fig.\ \ref{fig:WF} shows these valleys in the Brillouin zone for WS$_2$. We distinguish two kinds of valleys: two K-valleys around the high-symmetry points K and K', and six valleys around the Q points, situated approximately halfway between $\Gamma$ and K. We define a fine grid $\mathcal{F}$ on the pockets, see Fig. \ref{fig:kpoints}, on which quantities related to the band structure, i.e. energies and velocities, are computed. A fine grid is needed to evaluate the velocities (as gradients of the energies) properly and to converge the integrals in Eq. \ref{eq:BTE} and Eq. \ref{eq:conductivity2}. To compute the eigenenergies on a fine grid, the ground-state electronic density is first computed on a relatively coarse grid ($32 \times 32 \times 1$); then, non self-consistent calculations are performed on a finer grid. Since the second step is relatively inexpensive, one can afford very fine sampling. We always define the grid such that the distance between two consecutive k-points is $0.01$ \AA$^{-1}$ (or as close as possible to this value using a Monkhorst-Pack mesh). For example, in WS\2, this corresponds to 226$\times$226 k-points. The scattering times are interpolated on this grid and integrated to get the conductivity, resistivity, or mobility, as shown in Fig.\ \ref{fig:WF}c-d). In this work, more focused on accurate linear response, band structures are computed within DFT. However, the same approach could use bands computed at a higher level of theory, such as hybrid functionals, many-body perturbation theory (e.g. GW associated with a Wannier interpolation technique \cite{Marzari2012}), or applying a correction to the fundamental band-gap obtained from an evaluation of the derivative discontinuity as in GLLBsc functionals\cite{gllb1,gllb2}, or even bands fitted to experiments \cite{Cohen1966,Wang1995}. \begin{figure}[h] \includegraphics[width=0.47\textwidth]{grids.pdf} \caption{Representation of the different sampling grids. $\mathcal{F}$ is the fine grid used for the final integration of the conductivity and the sum over final states in the BTE. $\mathcal{I}$ is a coarser grid of irreducible states on which we solve the BTE and compute the scattering times. The grid $\mathcal{Q}$ of phonon momenta on which the linear response is computed is obtained by finding the irreducible set of momenta linking the electronic states from an even coarser grid, represented here in lime green.} \label{fig:kpoints} \end{figure} As written in Eq. \ref{eq:BTE}, the linearized BTE gives the value of $\tau(\mathbf{k})$ at an initial state $\mathbf{k}$ as a function of $\tau(\mathbf{k}')$ at all possible final states $\mathbf{k}'$ linked to the initial state by a phonon-scattering event. As will be explained in Sec.\ \ref{sec:transport}, the sampling of initial and final states needs not be the same, and we simply need a map from the final states to their closest symmetry-equivalent initial state. The set of final states ultimately defines the set of scattering events we account for, represented by the scattering probability $P_{\mathbf{k}\bok'}$. These quantities have low symmetry since they combine the initial and final states with the phonon that links them. Thus, the final states of the BTE need to cover the full extent of the valleys. Furthermore, one needs to account for the sharp variations of $P_{\mathbf{k}\bok'}$ due to the energy selection rules in Eq. \ref{eq:Pkkp}. We thus use the fine sampling of the pockets $\mathcal{F}$ for the final states in the BTE. This simply means that the EPC eventually needs to be interpolated on this grid. The set of momenta $\mathcal{I}$ is where we want to compute the scattering times by solving the BTE, and it is convenient to note that the scattering times $\tau(\mathbf{k})$ have the symmetry of the electronic eigenenergies $\varepsilon_{\mathbf{k}}$. This is not obvious because the computation of the resistivity involves the electric field and phonons which break the symmetries of the band structure. The integrand in Eq. \ref{eq:conductivity2}, for example, has the symmetry of the band structure plus the electric field. This quantity and the aforementioned $P_{\mathbf{k}\bok'}$ have thus lower symmetry than the electronic states. On the other hand, the form of the ansatz for the perturbed distribution (Eqs. \ref{eq:ansatz} and \ref{eq:approx}) is such that the effect of the electric field is separated out and $\tau(\mathbf{k})$ essentially represents the dependency of the perturbed distribution on the electronic states only. Further analysis of the BTE (Eq. \ref{eq:BTE}) shows that $\tau(\mathbf{k})$ depends on a sum over all possible final states. While each term of the sum might not have the symmetries of the band structure ($P_{\mathbf{k}\bok'}$, e.g., does not), the sum is invariant under the symmetry transformations associated with the BZ. So, since $\tau(\mathbf{k})$ has the symmetry of the band structure, the initial states $\mathcal{I}$ are sampled from an irreducible representation of the valleys. This sampling should be chosen fine enough to capture the variations of the scattering time; however, the size of $\mathcal{I}$ defines the size of the linear system to solve for the BTE and it is a factor in the total number of EPC matrix elements to compute. Those calculations have a non-negligible computational cost, and using the irreducible states in the fine grid of the pockets would be unnecessarily expensive. As shown in Fig. \ref{fig:kpoints}, we use a coarser grid: for all materials in this work we found that a grid with a k-points spacing approximatively $2.6$ times larger than the fine grid $\mathcal{F}$ leads to a converged solution to the Boltzmann transport equation at a reasonable computational cost. For example, in WS2, this leads to 126 irreducible initial states, while using the fine pockets grid would have led to more than 800 initial states. The electronic wave functions in Eq. \ref{eq:EPC} can be easily recomputed from the ground-state charge density, while the rest is associated with a given phonon perturbation, and is the bottleneck in terms of computational cost (in particular the calculation of $\frac{\partial V_{\rm{KS}}(\mathbf{r}) }{\partial \boldsymbol{u}_{a,i}(\mathbf{q})} $). There are methods\cite{Giustino2007,Calandra2010,Ponce2016,Sjakste2015} to interpolate the perturbation $\frac{\partial V_{\rm{KS}}(\mathbf{r}) }{\partial \boldsymbol{u}_{a,i}(\mathbf{q})} $ to the Kohn-Sham potential, but the spirit of the current approach is to compute this quantity directly in DFPT. We will, however, take full advantage of symmetries and use a reasonable sampling of phonon momenta. Each scattering event from an initial to a final states defines a phonon momentum $\mathbf{q}=\mathbf{k}_F-\mathbf{k}_I$, where $\mathbf{k}_F$ spans the pockets $\{\alpha\}$, and $\mathbf{k}_I$ spans the irreducible states in the pockets. We use the same support as for $\mathcal{I}$ and $\mathcal{F}$, but define a coarser grid, as shown in Fig. \ref{fig:kpoints}. We then obtain the set of phonons momenta $\mathcal{Q}$, where we actually compute the linear response to the phonon perturbation, by the following process: first, we find all possible $\mathbf{q}$ vectors connecting all final states and initial states in the coarse grid. For these, there are many duplicates, since a single momentum can link several pairs of initial and final states, and so we remove those duplicates. The $\mathbf{q}$ points are then reduced by symmetry. Indeed, from one $\mathbf{q}$-point, the linear response code (as implemented in Quantum ESPRESSO) allows, as a post-process, the computation of $\frac{\partial V_{\rm{KS}}(\mathbf{r}) }{\partial \boldsymbol{u}_{a,i}(\mathbf{q}^*)} $ for all $\mathbf{q}^*$ points in the set $\mathcal{Q}^*$ defined as all $\mathbf{q}^*=S(\mathbf{q})$ where $S$ is a symmetry operation of the crystal. The symmetry reduction is done with a tolerance of about the grid step, since the momenta in $\mathcal{Q}^*$ do not always fall exactly on the grid. The number of phonons to compute thus depends on the initial grid chosen for the electronic states in a non-straightforward way. We go through the above process several times until we reach a number of phonons that is largely sufficient to capture the variations of EPC while staying reasonable in terms of computational cost. For example, in WS$_2$, this results in 200 q-points where to compute the linear response $\frac{\partial V_{\rm{KS}}(\mathbf{r}) }{\partial \boldsymbol{u}_{a,i}(\mathbf{q})}$. For materials with less valleys (such as phosphorene studied in Section \ref{sec:Results}), less than 100 phonons are needed. In Fig \ref{fig:qpoints} we show both the set of irreducible phonon momenta $\mathcal{Q}$ and the relevant phonon momenta in $\mathcal{Q}^*$ that lead to final states in the BZ for at least one of the initial states. \begin{figure}[h] \includegraphics[width=0.47\textwidth]{qpoints.pdf} \caption{Irreducible phonon momenta $\mathbf{q} \in \mathcal{Q}$ (in red, those actually computed via DFPT), and all relevant phonons (in light blue) that can be obtained from the latter by symmetry transformations. To help visualizing the corresponding pairs of initial and final electronic states, the dashed lines correspond to a BZ centered either the high-symmetry K point (green) or the bottom of the Q valley (orange) at the origin, the Q valley being approximately halfway between $\Gamma$ and Q.} \label{fig:qpoints} \end{figure} \subsection{Phonons and EPC calculations} Phonons are computed using the recent implementation of DFPT for gated 2D heterostructures \cite{Sohier2017} in Quantum ESPRESSO\cite{Giannozzi2017,Giannozzi2009} (QE). This development includes two important modifications: i) a cutoff of the Coulomb interactions in the non-periodic direction\cite{Rozzi2006,IsmailBeigi2006} and ii) the inclusion of gates to simulate charging of the material in a field-effect setup (FET). The cutoff is necessary to properly account for dimensionality effects \cite{Sohier2016,Sohier2017nl}: as QE relies on 3D periodic-boundary conditions, there would always be artificial periodic images of the 2D system, and the Coulomb cutoff suppresses spurious interactions between them. The FET setup allows the simulation of the charging of the material in an electrostatic environment that aims to be more realistic than the standard approach of introducing a compensating background of charge uniformly distributed over the full simulation cell (vacuum included). So, we compute the linear response to the phonon perturbations $ \frac{\partial V_{\rm{KS}}(\mathbf{r}) }{\partial \boldsymbol{u}_{a,i}(\mathbf{q})}$ and the dynamical matrices for $\mathbf{q} \in \mathcal{Q}$ using these two unique features. These quantities are obtained for all $\mathbf{q}$ in $\mathcal{Q}^*$ by applying symmetry transformations. Then, we compute the EPC matrix elements in Eq. \ref{eq:EPC} for the $|\mathbf{k}\rangle$ states that are in the irreducible initial states $\mathcal{I}$. This process is automatized via the AiiDA materials' informatics infrastructure\cite{Pizzi2016} to manage the calculations and store the data. Each symmetry transformation of $\frac{\partial V_{\rm{KS}}(\mathbf{r}) }{\partial \boldsymbol{u}_{a,i}(\mathbf{q})}$ and its application to the initial states represents a relatively fast run of the Phonon code of QE. Thanks to AiiDA, such operations can be performed in a highly parallelized fashion. For each initial state, a list of the $\mathbf{q}$ vectors and the corresponding values of $g_{\mathbf{k}, \mathbf{k}+\mathbf{q},\nu}$ for each mode is stored; the $g_{\mathbf{k}, \mathbf{k}+\mathbf{q},\nu}$ are then interpolated linearly to obtain $g_{\mathbf{k}, \mathbf{k}',\nu}$ for $\mathbf{k}'$ on the finer grid of the pockets $\mathcal{F}$. Fig. \ref{fig:WF}b) shows the result of this procedure for electron-doped WS$_2$. The data storage and provenance provided by AiiDA ensure that all the information collected from the computationally demanding phonon calculations is safely kept and easily re-used for multiple applications (e.g. one can study phonon-mediated superconductivity starting from the same electron-phonon matrix elements). \subsection{Transport} \label{sec:transport} Suppose sampling $\mathcal{I}$ yields $N_i$ irreducible initial states, while sampling $\mathcal{F}$ yields $N_f$ final states. Writing the BTE for the irreducible states yields $N_i$ equations relating $\tau(\tilde{k})$ for $\tilde{k}\in \mathcal{I}$ to $\tau(\mathbf{k}')$ for $N_f$ $\mathbf{k}'\in \mathcal{F}$. \begin{align}\label{eq:iter} \begin{split} \forall \tilde{\mathbf{k}} \in \mathcal{I}, & \ \\ \tau(\tilde{\mathbf{k}}) \times & \sum_{\mathbf{k}'} P_{\tilde{\mathbf{k}}\mathbf{k}'} \left( 1-f^0(\mathbf{k}')\right) \boldsymbol{v}(\tilde{\mathbf{k}}) \cdot \boldsymbol{u}_{\boldsymbol{E}} = \\ & \left( 1-f^0(\tilde{\mathbf{k}})\right) \boldsymbol{v}(\tilde{\mathbf{k}}) \cdot \boldsymbol{u}_{\boldsymbol{E}} \\ & + \sum_{\mathbf{k}'} P_{\tilde{\mathbf{k}}\mathbf{k}'} \left( 1-f^0(\mathbf{k}')\right) ( \boldsymbol{v}(\mathbf{k}') \cdot \boldsymbol{u}_{\boldsymbol{E}}) \tau(\mathbf{k}'). \end{split} \end{align} This system can be solved iteratively, using the the closed-form solution in \ref{app:closed_form} as a starting point. Each iteration gives us the values of $\tau$ for $\tilde{\mathbf{k}} \in \mathcal{I}$ grid. It is then rotated according to the symmetries of the band structure, interpolated linearly on the fine grid of the pockets $\mathbf{k}' \in \mathcal{F}$, and put back into the next cycle, until self-consistency. We address below a couple of technical issues that prove important if one wants to have an accurate and robust numerical solution. To arrive at the final form of the BTE, we address the fact that its solution $\tau(\mathbf{k})$ is ill-defined when $\boldsymbol{v}(\tilde{\mathbf{k}}) \cdot \boldsymbol{u}_{\boldsymbol{E}}$ approaches zero. Indeed, considering $\boldsymbol{v}(\tilde{\mathbf{k}}) \cdot \boldsymbol{u}_{\boldsymbol{E}} = 0$, any $\tau(\tilde{\mathbf{k}})$ satisfies Eq. \ref{eq:iter}. In practice, this brings numerical noise. This situation can happen: i) if $\boldsymbol{v}(\tilde{\mathbf{k}})\approx 0$, which is relatively rare in practice (e.g. only when $\tilde{\mathbf{k}}$ is very close to the extremum of a valley); ii) if $\boldsymbol{v}(\tilde{\mathbf{k}}) \perp \boldsymbol{u}_{\boldsymbol{E}} $, where $\boldsymbol{u}_{\boldsymbol{E}}$ is the direction of the electric field. Situation i) can be treated approximately, without much consequences on the transport results (indeed, states with zero velocity do not contribute to transport), and we compute the scattering time using the closed form of the BTE reported in the App. \ref{app:closed_form}. In situation ii), we do need a consistent evaluation of $\tau(\mathbf{k})$. Indeed, even though $\tilde{\mathbf{k}} \in \mathcal{I}$ does not contribute to the conductivity because its velocity is perpendicular to the field, this is not necessarily true for all $\mathbf{k} \in \mathcal{F}$ that are equivalent to $\tilde{\mathbf{k}}$ according to the symmetries of the BZ. We thus use the following technique: since $\tau(\tilde{\mathbf{k}})$ has the symmetry of the band structure, it does not depend on the direction of the electric field. In other words, any choice for the direction of the electric field gives the same $\tau$'s. Thus, we are free to use any direction for the electric field to solve the BTE, and we can choose different directions for each of the $N_i$ equations corresponding to the $N_i$ $\tilde{\mathbf{k}}$ points. For each $\tilde{\mathbf{k}}$, we choose the direction $\boldsymbol{u}_{\tilde{\mathbf{k}}}=\frac{\bar{\mathbf{k}}}{|\bar{\mathbf{k}}|}$, where $\bar{\mathbf{k}}$ is $\tilde{\mathbf{k}}$ taken from the extremum of its valley, since $\boldsymbol{v}(\tilde{\mathbf{k}}) \perp \boldsymbol{u}_{\tilde{\mathbf{k}}} $ virtually never happens. We then have a well-behaved set of equations. The other numerical issue is the treatment of the $\delta$ functions in Eq. \ref{eq:Pkkp}. The standard numerical procedure is to replace them by Gaussian functions and test the convergence of the solution with respect to the corresponding broadening. However, convergence is very slow, and even with the relatively fine grids used for here, the corresponding errors on the mobilities can reach a few percents. In addition, the automation of these convergence tests can be challenging. An alternative is to use more sophisticated integration techniques like the so-called triangles method \cite{Ashraff1987,Pedersen2008} (two-dimensional equivalent of the tetrahedron method\cite{Blochl1994}), which amounts to performing the sum analytically as an integral by interpolating the functions involved linearly within three points that form a triangle. Although slower, it gives more accurate results and this is what we implemented here. To the best of our knowledge, it is the first application of this method to the BTE. As a final remark, note that an iterative procedure is not needed in principle. The above system of equations can be solved algebraically. As discussed in App. \ref{app:matrix_sol}, however, the use of Gaussians and the associated choice of broadening parameter becomes necessary. Once we have the angular and energy dependent $\tau(\mathbf{k})$, which does not depend on the electric field in itself, we can compute the conduction integral for an arbitrary direction of the electric field, thus probing any diagonal element of the conductivity tensor. \section{Results} \label{sec:Results} We have applied our approach to a set of six different cases: five electron-doped materials (WS$_2$, MoS$_2$ WSe$_2$, arsenene, and phosphorene), as well as hole-doped phosphorene. These are common 2D systems often praised for their potential for transport applications. Also, this set leads to an interesting diversity of band structures, in terms of valleys, their symmetries and their energetic accessibility. Let us stress that we are working here in the framework of DFT, rather than higher levels of theory, and without spin-orbit coupling (SOC). Both approximations can of course affect the bands of the materials studied here and have an impact on mobility\cite{Ponce2018,Ma2018}. In particular, inclusion of many-body corrections within, e.g., the GW approximation, would not only correct quasiparticle energies of the pristine, undoped materials, but would also improve the description of band renormalization effects associated with free carriers, especially at high doping. For SOC, we expect the variations to be relatively small for electron-doped arsenene and phosphorene\cite{Qiao2014}. The case of TMDs is a more delicate one: the relative positions of the K and Q valleys seems to be sensitive to many aspects of the calculations, like the inclusion of SOC\cite{Brumme2015}, choice of pseudo potentials, lattice parameters, level of theory\cite{Shi2013a} (DFT versus GW) or doping\cite{Brumme2015}. Thus, while we will be able to compare between the three TMDs and discuss qualitative trends, we do not claim to be quantitative with respect to experiments. That being said, the methodological approach presented in this work is very flexible. One can combine the electron-phonon coupling matrix elements found in DFPT with the band structure found by any mean; e.g., one can use a band structure computed at the highest level of theory, and/or correct it to better fit experiments, before inserting it in the workflow. Regarding SOC, it can be easily included in the band structure calculations and EPC calculations; further development is planned to include it in the solution to the BTE. Another important approximation we make, common to most DFT/DFPT approaches to compute phonons and EPC from first principles\cite{Giustino2017}, is the adiabatic approximation. This means that electrons are assumed to be able to relax to their ground state during phonon perturbations, either as a result of their motion being faster than phonon oscillations (Fermi velocity higher than the phonon phase velocity) or because the electronic scattering times due to other momentum-changing sources of disorder are short enough to establish equilibrium\cite{Maksimov1996,Saitta2008}. This amounts to taking the zero-frequency limit -- allowing intraband transitions -- in the phonon self-energy\cite{Giustino2017,Grimvall}, which, among other things, results in discarding non-adiabatic screening effects\cite{Mahan}. The former approximation can sometimes break down, especially in metals, as is the case for the non-adiabatic Kohn anomalies in graphene\cite{Lazzeri2006,Pisana2007}. Although these effects can be predicted from first principles\cite{Lazzeri2006,Saitta2008,Calandra2010}, even accounting for correlations beyond DFT\cite{Lazzeri2008}, their inclusion in the solution of the BTE has never been performed in first-principles approaches and will not be considered here. Dynamical screening of electron-phonon interactions seems even more challenging, and it's typically overlooked in first-principles investigations\cite{Giustino2017} or at most introduced via model dielectric functions\cite{Verdi2017}. In the calculations, we chose an electrostatic doping of $5\times10^{13}$ cm$^{-2}$. While undoubtedly high, this doping is experimentally achievable, at least with the use of ionic liquid gates \cite{Efetov2010,Bisri2017}. In addition, this regime is interesting from a fundamental point of view, because it allows to suppress extrinsic contributions, like charge impurities via screening, thus getting closer experimentally to phonon-limited transport. This high doping regime is poorly studied from first principles, and accessible thanks to our implementation of DFPT for gated materials without any analytical corrections. Nonetheless, it also poses some additional challenges, such as the emergence of band-renormalization effects, electron-electron and electron-plasmon scattering, which has been posited to be relevant at high doping\cite{Hu1996,Caruso2016}; these are beyond the scope of the present manuscript. As far as applications are concerned, the relevant doping regime varies. High doping is relevant for several possible application, such as high frequency electronics. For logic-gate transistors operating at very low densities, the zero doping limit is more relevant. The method presented here could be applied also in this case, but we chose to propose a new perspective with respect to the theoretical literature already treating this limit. As a consequence, in the following, comparisons with theoretical works in the zero doping limit must be taken carefully. More generally, many devices might operate at moderate doping densities ($\sim10^{12}$ cm$^{-2}$). In this regime, the application of our approach would still be possible, although it would require the use of finer k-point sampling for the phonon calculations, which we chose to avoid here given the number of systems studied. Nevertheless, for moderate doping, the high doping results presented here might be more relevant than undoped results. As previously mentioned, first-principles calculations are performed with the Quantum ESPRESSO distribution \cite{Giannozzi2017,Giannozzi2009} including a 2D Coulomb cutoff and the possibility to charge the material with gates \cite{Sohier2017}, and using the SSSP Accuracy (version 0.7) library\cite{Prandini2018a,Hamann2013,Vanderbilt1990,DalCorso2014}. Structures are taken from the database described in Ref.\ \onlinecite{Mounet2018}. To build this database, structural relaxations were performed in the neutral material, using the SSSP library as well and a k-point sampling corresponding to a spacing of 0.2 \AA$^{-1}$ in each direction. We use a symmetric double-gate setup to charge the materials with a density of $5\times10^{13}$ cm$^{-2}$ electrons or holes for all systems except for electron-doped phosphorene, where we choose a lower density of $5/3 \times10^{13}$ cm$^{-2}$ to avoid raising the Fermi level too high in the conduction band, where additional valleys appear. Each gate carries half the opposite charge of the material, such that the electric field has equal norm but opposite direction on each side of the material. We could also have used a single-gate setup, with an electric field only on one side, but no large difference is expected since the impact of the electric field setup should come mainly from its effect on spin-orbit coupling, which is not included here. Barrier potentials are added to avoid leakage of electrons towards the gates. These also lead to a hardening of the ZA phonons in the long-wavelength limit, with a non-zero frequency at $\Gamma$ around $10 - 25$ cm$^{-1}$ for the materials considered. This emulates a relatively soft out-of-plane mechanical interaction with gate dielectrics or substrate compared to interlayer interactions in the layered parent 3D material, since breathing ZA modes are usually in the 20-50 cm$^{-1}$ range. Ground state and linear-response calculations on the charged materials are performed with a $32 \times 32 \times 1$ k-point grid and $0.02$ Ry Methfessel-Paxton smearing to sample the Fermi surface. Note that we are working at relatively high doping, such that the Fermi surface is large enough to be sampled correctly. Non self-consistent calculations are performed to obtain the band structure on the fine grid $\mathcal{F}$. Band structures and phonon dispersions are reported in the App. \ref{app:bands_phonons}. The interpolated EPC matrix elements for electron-doped WS\2 are shown in Fig.\ \ref{fig:WF}; for electron-doped arsenene in Fig.\ \ref{fig:EPC_As}; and for hole-doped phosphorene in Fig.\ \ref{fig:EPC_P4h}. Equivalent plots for electron-doped MoS$_2$ and WSe$_2$ can be found in the App. \ref{app:EPC}; they are very similar to WS$_2$. The angular dependencies of the EPC are non-trivial: the EPC can undergo some rather sharp variations, most often for intravalley transitions via acoustic modes. For intervalley transitions, we observe overall smoother variations if we ignore the discontinuities coming from phonon crossings. However, intervalley scattering is activated or not depending on the valleys and the mode in rather non-trivial ways. These plots also serve to give a visual confirmation that we use sufficient sampling to capture the variations of the EPC. One important aspect to keep in mind when interpreting these plots and the transport properties of the system is that energy and momentum conservation conditions drastically reduce the final states effectively relevant for a given initial state. \begin{figure*}[h] \includegraphics[width=0.85\textwidth]{EPC_As_elec.pdf} \caption{Interpolated $g_{\mathbf{k} \mathbf{k}'}$ for electron-doped arsenene. The initial state considered is indicated by a white star. The rest of the points are the possible final states in the finely sampled pockets and the color of the point indicates the strength of the electron-phonon coupling matrix element. The index of the phonon mode indicated at the top of each subplot refers to a purely energetic ordering of the phonon modes associated with each transition.} \label{fig:EPC_As} \end{figure*} \begin{figure*}[h] \includegraphics[width=0.85\textwidth]{EPC_P4_holes.pdf} \caption{Interpolated $g_{\mathbf{k} \mathbf{k}'}$ for hole-doped phosphorene. The initial state considered is indicated by a white star. The rest of the points are the possible final states in the finely sampled pockets and the color of the point indicates the strength of the electron-phonon coupling matrix element. The index of the phonon mode indicated at the top of each subplot refers to a purely energetic ordering of the phonon modes associated with each transition.} \label{fig:EPC_P4h} \end{figure*} \begin{figure}[h] \includegraphics[width=0.45\textwidth]{mobilities.pdf} \caption{Mobilities as a function of temperature for electron-doped of MoS$_2$, WS$_2$, WSe$_2$, arsenene and phosphorene, as well as for the hole side of phosphorene. The carrier density is $5\times10^{13}$ cm$^{-2}$ for all systems except electron-doped phosphorene where it is $5/3\times10^{13}$ cm$^{-2}$.} \label{fig:mobs} \end{figure} The linearized BTE is solved in all these systems, giving the mobilities shown in Fig.\ \ref{fig:mobs}. These cover three orders of magnitude, and the hole side of phosphorene shows mobilities ten times larger than the rest, almost reaching $10^3$ cm$^2$/Vs at room temperature. For comparison, electron-doped graphene has mobilities on the order of $10^4$ to $10^5$ cm$^2$/Vs depending on the density. Table \ref{tab:mobilities} summarizes our findings, focusing on room-temperature results, and compares them with some values available in the literature. To characterize the temperature dependence of mobilities, we report the parameter $\gamma$ in Table \ref{tab:Tdep}, defined as $\mu\propto T^{-\gamma}$. Below, we identify the general trends and discuss three important factors in the prediction of transport properties in 2D materials. Finally, we argue that those three factors might account for the discrepancies observed in Table \ref{tab:mobilities}. \begin{table*}[h] \caption{Room-temperature mobilities of the 6 systems considered (at the DFT/DFPT level without SOC). Mobilities are given in cm$^2$/Vs, doping densities are indicated in parentheses, in units of 10$^{13}$ cm$^{-2}$. Question marks for densities of experimental works indicate that the information was not provided. For theoretical works, "0" means that the mobility was derived in the zero doping limit (this includes calculations based on the density-independent formulaes). Note that SOC is not included in any of those works. Results on phosphorene are reported in both the armchair (ac) and zig-zag (zz) directions. } \label{tab:mobilities} \begin{tabular}{ c c L L } \hline Material (e or h doped) & Present result $\mu$($n$) & Other first-principles results $\mu$($n$) & Experimental $\mu$($n$) \\ \hline \hline MoS$_2 (e)$ & 144 (5) & 265 (5)\cite{Gunst2016a}, 150 (0) \cite{Li2015} , 130 (0) \cite{Li2013}, 320 (0.01) \cite{Kaasbjerg2013}, 410(0.01)-340(1) \cite{Kaasbjerg2012a}, 340 (0) \cite{Zhang2014} & 217 (0.46)\cite{Radisavljevic2011}, 150 (0.7) \cite{Yu2016}, 81 (0.7) \cite{Yu2014}, 63 (1.35) \cite{Radisavljevic2013}, \\ \hline WS$_2$ (e) & 60 (5) & 320 (0) \cite{Jin2014}, 1103 (0) \cite{Zhang2014} & 44 (10) \cite{Jo2014}, 44 (?) \cite{Ovchinnikov2014}, 45 (0.6) \cite{Aji2017}, 25-83 (0.7) \cite{Cui2015}, 214 (?)\cite{Iqbal2015} \\ \hline WSe$_2$ (e) & 25 (5) & 30 (0) \cite{Jin2014}, 705 (0) \cite{Zhang2014} & 7 (0) \cite{Huang2014}, 30 (1-1.5?) \cite{Allein2014} \\ \hline As (e) & 41 (5) & 21 (-) \cite{Wang2017}, 1700 (0) \cite{Pizzi2016nc} & - \\ \hline P (h-ac) & 586 (5) & 640-700 (0) \cite{Qiao2014}, 460 (0) \cite{Jin2016}, 292 (5) \cite{Rudenko2016}, 140 (1) \cite{Liao2015}, 19 (0) \cite{Gaddemane2018} \\ \hline P (h-zz) & 44 (5) & 10000-26000 (0) \cite{Qiao2014}, 90 (0) \cite{Jin2016}, 157 (5) \cite{Rudenko2016}, 15 (1) \cite{Liao2015}, 3 (0) \cite{Gaddemane2018} \\ \hline P (e-ac) & 302 (5/3) & 1100-1140 (0) \cite{Qiao2014}, 210 (0) \cite{Jin2016}, 738 (5) \cite{Rudenko2016}, 430 (5) \cite{Trushkov2017}, 140 (1) \cite{Liao2015}, 20 (0) \cite{Gaddemane2018} \\ \hline P (e-zz) & 35 (5/3) & 80 (0) \cite{Qiao2014}, 40 (0) \cite{Jin2016}, 114 (5) \cite{Rudenko2016}, 80 (5) \cite{Trushkov2017}, 25 (1) \cite{Liao2015}, 10 (0) \cite{Gaddemane2018} \\ \hline \hline \end{tabular} \end{table*} \begin{table}[h] \caption{Temperature dependence of the mobility, represented by the factor $\gamma$ such that $\mu \propto T^{-\gamma}$.} \begin{tabular}{ c c c } \hline Material (e or h doped) & $\gamma$ ($T \leq 150$ K) & $\gamma$ ($T > 150$ K) \\ \hline \hline MoS2(e) & 1.33 & 1.34 \\ WS2(e) & 1.28 & 0.99 \\ WSe2(e) & 1.28 & 0.79 \\ As(e) & 1.49 & 1.04 \\ P (h-ac) & 1.14 & 1.36 \\ P (e-ac) & 1.96 & 1.60 \\ \hline \hline \end{tabular} \label{tab:Tdep} \end{table} \subsection{Intervalley scattering} The ranking of the above materials in terms of mobility reflects the importance of intervalley scattering. This is clearly demonstrated by considering the three TMDs: these have essentially the same type of electronic and phonon band structures, as well as similar EPC matrix elements. Yet, we obtain an order of magnitude variation in the mobilities. This stems from the position of the Q valley: indeed, as the Q valley approaches the Fermi level, it offers an additional scattering channel for the electrons. As shown in Fig.\ \ref{fig:taus}, the scattering time gets shorter (more scattering) at energies close to the bottom of the Q valleys. \begin{figure*}[h] \includegraphics[width=0.97\textwidth]{tausTMDs.pdf} \caption{Scattering times in MoS$_2$, WS$_2$, and WSe$_2$ (from left to right). The color scale is the same for all subplots. The scattering rate ($\hbar/\tau$) clearly increases for states with energy high enough for the Q valley to be accessible. The Fermi levels are : $-2.83$, $-2.46$, and $-2.13$ eV, respectively.} \label{fig:taus} \end{figure*} The largest contributions to the resistivity of TMDs ($\approx 80\%$\footnote{This number is estimated by solving the BTE for each mode successively, setting the coupling to the other modes to zero. This is simply an educated estimation. Indeed, the process is not strictly valid quantitatively since the solution to the BTE including all phonon modes is not the sum of the contributions from each mode.}) comes from the scattering with the LA and TA modes: LA at $\Gamma$ (intravalley scattering) and M (K$\leftrightarrow$Q scattering) and TA at K (K$\leftrightarrow$K' scattering). This is not obvious from the plots of the electron-phonon matrix elements, because the dispersions of the three acoustic modes cross each other between $\Gamma$ and K, and between $\Gamma$ and Q. However, looking at the phonon displacements, it is quite clear that in-plane acoustic modes are associated with the regions of strong electron-phonon coupling in the first three sub-plots of Fig.~\ref{fig:WF}b, and in Figs. \ref{fig:EPC_MoS2}, \ref{fig:EPC_WSe2} and \ref{fig:EPC_WS2} of App. \ref{app:EPC}. The multi-valley nature of a material does not necessarily deteriorate the mobility in itself. The presence of multiple valleys increases both the accessible phase space for scattered states and the density of states, and the corresponding effects on the mobility cancel each other. Rather, it is the existence of a strong EPC between the valleys that increases scattering and lowers the mobility. For the small subset studied here, all multi-valley materials showcase strong intervalley EPC. It may be argued, in general, that intervalley EPC is often strong compared to intravalley EPC. This could first be explained by the fact that intervalley EPC is not bound to vanish at long wavelengths, contrary to the coupling to acoustic phonons. Second, it involves larger phonon momenta and the EPC tends to be less screened, since the dielectric function goes to one in the short-wavelength limit. \subsection{Symmetries of the valleys} Effective masses are among the most influential features to consider when studying mobilities, and anisotropic effective masses can be very beneficial. Indeed, small effective masses have the benefit of bringing large carrier velocities while large effective masses have the benefit of bringing high carrier densities. Thus, one might combine those benefits having a small effective mass in the transport direction and a large one in the perpendicular direction. This contributes to phosphorene's good transport performance. In fact, phosphorene is the only material in the present study showing significant transport anisotropy. The transport properties of TMDs are isotropic because the bottom of the K and Q valleys are roughly isotropic. In the case of arsenene, each single valley is quite anisotropic, but when summing up the six equivalent valleys the angular dependency of the transport averages out and vanishes\cite{Pizzi2016nc}. Fig. \ref{fig:ang_mobs} shows the mobility of P (h), As (e) and WS$_2$ (e) as a function of the direction of the electric field. The mobility of phosphorene is highly directional, while all others are isotropic. \begin{figure}[h] \includegraphics[width=0.47\textwidth]{ang_mob.pdf} \caption{Angle-dependent mobilities at room temperature for hole-doped and electron-doped phosphorene, and electron-doped arsenene and WS$_2$. The angle corresponding to the transport direction refers to the direction of the in-plane electric field driving the current with respect to the $\boldsymbol{x}$ direction indicated in the plots of EPC. For phosphorene, $0$ ($\pi/2$) corresponds to the zig-zag (armchair) direction. While phosphorene shows highly anisotropic transport, only very small variations ($\approx 10^{-2}$ cm$^{2}/$(Vs), below numerical accuracy) can be observed in WS$_2$ and arsenene.} \label{fig:ang_mobs} \end{figure} \subsection{Doping effects on electron-phonon interactions} The effects of doping on electron-phonon scattering are many. The first one is to move the Fermi surface within the electronic landscape. This leads to variations of the density of states and determines whether certain valleys are accessible via phonon scattering or not. As we saw in TMDs, the activation of intervalley scattering can have drastic consequences on transport. Those effects come from the energy selection rules of Eq. \ref{eq:Pkkp}. Doping also has consequences on the strength of EPC matrix elements themselves (Eq. \ref{eq:EPC}). A well-known and important effect is the additional screening coming from the electrons added in the conduction band or holes in the valence band. In our computational framework, this is inherently accounted for since we compute the linear-response of the charged system. Any EPC related to a periodic variation of the effective scalar potential in which the electrons move will be screened. This includes: i) a variation of the charge state via a variation of the area of the unit cell, as induced by longitudinal acoustic phonons; ii) any EPC related to dipole or Born effective charges, like Fr\"ohlich or piezo-electric EPC, in which phonons interact with electrons via the generation of electric fields; iii) other less straightforward mechanisms, like the gate-induced coupling to flexural phonons in graphene \cite{Gunst2017,Sohier2017}. In general, considering only the above types of EPC is largely insufficient in doped materials, as electronic screening strongly reduces their contribution, and bare interactions or weakly screened intervalley couplings dominate. Doping also affects EPC beyond screening: as the occupations of the valleys vary, certain orbitals/bands in the material get populated or depleted, which can directly change the amplitude of the coupling. This happens in TMDs, as shown in Fig.~\ref{fig:g_dop_WS2} in which we computed intravalley scattering for several doping levels. In particular, we compute the average of the long-wavelength coupling $\langle g^2 \rangle$ along a fixed iso-energetic line at $\varepsilon=E$, by taking a few initial states on the iso-energetic section of each the K and Q valleys, and six phonon momenta with a fixed small norm. Linear-response calculations are then performed for each doping to capture non-trivial dependencies of the EPC matrix elements. We average on the phonon momenta and on the initial states to get $\langle g_{\alpha}^2 \rangle$ for each valley $\alpha = K,Q$. We sum the contributions from acoustic and optical phonon modes separately. Fig.~\ref{fig:g_dop_WS2} shows that as doping increases in WS$_2$, the intravalley coupling in K increases while it decreases in Q. The couplings to both acoustic and optical phonons show variations of $50\sim 60 \%$. Similar trends where observed in the literature\cite{Chakraborty2012}, but this kind of effect is poorly understood and difficult to predict, highlighting the importance of explicitly including doping in the linear-response calculations. \begin{figure}[h] \includegraphics[width=0.47\textwidth]{g_dop_WS2.pdf} \caption{Doping dependency of intravalley scattering in both electron valleys of WS$_2$. The EPC is measured by the quantity $\langle g_{\alpha}^2 \rangle$, described in the text.} \label{fig:g_dop_WS2} \end{figure} We note that the way doping is induced can be important. An example is the gate-induced coupling to flexural phonons in graphene \cite{Gunst2017,Sohier2017}, related to a broken mirror symmetry with respect to the graphene plane. However, we do not expect such effects to be significant for the subset of materials studied here. Last, we mention that doping obviously leads to a finite density of free carriers. This can give rise to additional loss mechanisms such as electron-electron and electron-plasmon scattering, which can in principle affect the transport properties of a material\cite{Hu1996,Caruso2016} but are not included here. \subsection{Comparison with literature} We first discuss the comparison with the other theoretical works reported in Table \ref{tab:mobilities}. Due to the diversity of the techniques employed, both at the BTE and EPC level, discrepancies between different first-principles results can have many different explanations. However, comparison with the literature points to the three factors discussed above being quite relevant. Indeed, intervalley scattering, doping and anisotropy, which we identified to be essential in determining the transport properties of 2D materials, also turn out to be treated quite differently in different works. First and foremost, let us note that in general the mobility $\mu = \sigma / n$ depends strongly on carrier density $n$. In the context of doped semiconductors, the conductivity $\sigma$ tends to increase (or possibly decrease in more peculiar cases, like TMDs, where intervalley scattering can be activated above a certain doping) rather slowly as a function of $n$, so the mobility tends to decrease. Thus, direct comparison of mobilities calculated or measured at different carrier densities has limited meaning. One must keep in mind that in the small doping limit, the mobility might be increased by a factor $3 \sim 5$ with respect to the present high-doping results. In the references mentioned in Table \ref{tab:mobilities}, first-principles calculations are done in neutral materials. The calculated mobilities marked by a "0" in Table \ref{tab:mobilities} apply to the undoped limit, as clearly stated in the references using Boltzmann transport\cite{Gaddemane2018,Li2015}, and implied in references based on Monte-Carlo transport\cite{Jin2014,Jin2016,Li2013}, and Takagi's formula\cite{Takagi,Qiao2014,Pizzi2016nc,Wang2017,Zhang2014}. For those works, the comparison with the high-doping mobilities presented here should be taken with caution. We report them nonetheless to highlight the importance of doping and the ambiguity surrounding it, given that those values are sometimes compared with experimental measurements at finite doping. For the theoretical works where a finite carrier density is indicated, doping is sometimes included only a posteriori as a shift of the Fermi level in the computation of transport properties. In some instances, analytical models of screening are used, but those are not well established in 2D materials. In any case, we have seen that the effect of doping goes beyond shifting the Fermi level and electronic screening. Thus, performing EPC calculations with doping explicitly included is important to evaluate the transport properties of doped materials. This appears to be particularly important in phosphorene, where we find a larger mobility compared to most of the results in literature\cite{Jin2016,Rudenko2016,Liao2015,Gaddemane2018}. In particular we find that, due to the doping induced screening, the LA mode is less effective in scattering electrons than what previously reported and only contributes for approximately 50\% of the total scattering processes. Screening effects might be large enough to compensate the $1/n$ dependency of the mobility and the small doping mobility could be smaller or of the same order of magnitude as the high doping mobility. Many models include intravalley coupling only (e.g.\ ``deformation potential" models), thus neglecting intervalley transitions. Furthermore, given the complexity of EPC in multivalley materials, most analytical models of EPC with fitted parameters from first-principles are likely to be incomplete. It is no coincidence that works employing such approaches show the greatest differences with the current results (even assuming a factor 10 increase of the mobility with respect to our result in the low doping limit), often largely overestimating mobility, like the results on TMDs reported in Ref.~\onlinecite{Zhang2014} or on arsenene in Ref.~\onlinecite{Pizzi2016nc}. When intervalley scattering is accounted for, it can still be a source of discrepancy depending on the relative positions of the valleys. This is similar to what happens in GaAs, where the value of mobility at high-temperature crucially depends on the relative energy between the $\Gamma$ and L valley\cite{Rode1971,Zhou2016,Ma2018}. In 2D, this is relevant for TMDs, in which the position of the Q valley with respect to the bottom of the K valley is difficult to determine, as mentioned before, from first-principles. For example, the energy separation between the two extrema in MoS$_2$ ranges between 70\cite{Li2013} and 260 meV\cite{Li2015,Kaasbjerg2012a} with the latter results closer to our calculations. This difference brings a large intervalley contribution for MoS$_2$ in Ref.~\onlinecite{Li2013} that we don't observe, and that we find instead in the W-based TMDs. The relative energy separation of the K and Q valley affects also our ranking in terms of electron mobility among the TMDs, with MoS$_2$ performing better than WS$_2$, contrary to the findings in Ref.~\onlinecite{Jin2014}. In Ref.~\onlinecite{Jin2014} the energy separation between K and Q is 80 meV in MoS$_2$ and 67 meV in WS$_2$ resulting in a similar intervalley scattering between the two materials and a better mobility for WS$_2$ on the basis of its lighter effective mass. In our case instead the K-Q energy separation shows a larger variation, from 257 meV in MoS$_2$ to only 178 meV in WS$_2$ resulting in an increased intervally scattering that undermines the advantage of a lighter effective mass. The anisotropy of the valleys affects the validity of approximated solutions to the Boltzmann transport equation. In particular, for anisotropic phosphorene, the energy relaxation time approximation (see App. \ref{app:closed_form}) gives results with up to $30\%$ errors with respect to the full solution. For the other materials studied here, with isotropic transport properties, this error reduces to a few percents. Although these errors can be acceptable in most cases, a full solution to the BTE beyond the relaxation-time approximation is valuable for quantitative comparison with experiments. In any case, given that the errors associated to different approximate solutions to the BTE are not obvious to determine a priori, and that the numerical solution to the full linearized BTE is comparable in terms of computational cost, we consider it a useful in general. We now discuss the comparison with experimental work, which concerns only the TMDs reported in Table \ref{tab:mobilities}. As already discussed, the positions of the valleys with respect to the Fermi level play a very important role, and since our bands are computed within DFT without SOC, we do not claim quantitative agreement with experiments. In practice, one could measure both higher or lower mobilities. For example, one could measure a lower mobility if the Q valley is lower, and a higher one if spin conservation restricts available scattered states. Nevertheless, experimental mobilities for TMDs are relatively close to our predictions, whereas one would expect additional extrinsic scattering processes to give significantly lower values. This can be explained in several ways. First, since mobility goes as $1/n$ and intervalley scattering is activated as the Fermi level increases and crosses more valleys, we can expect the high-density intrinsic mobilities computed here to be lower than experiments performed at lower densitites. Second, one could conclude that the importance of extrinsic contributions, like remote phonons, might have been overestimated in the past. Conversely, extrinsic mechanisms leading to an enhanced mobility, such as the phonon mode quenching mentioned in Ref. \onlinecite{Radisavljevic2013}, could be more effective than expected. Undoubtedly, the complexity of electron and phonon dynamics in TMDs calls for further work before reaching numerical agreement between simulations and experimental measurements. \section{Conclusions} We have developed an automated procedure to determine the transport properties of 2D materials from first-principles. We aim for the highest accuracy achievable within the framework of density-functional perturbation theory, with as few assumptions and simplifications as possible. The method includes several strengths and improvements with respect to existing approaches. Electron-phonon coupling matrix elements are directly computed from density functional-perturbation theory in the correct dimensionality framework and with the correct electrostatics of field-effect doping. The linearized Boltzmann transport equation is solved numerically in full, beyond relaxation-time approximation or any other closed-form expressions for the scattering time. The implementation of this entire transport workflow within the AiiDA infrastructure provides great flexibility to improve or adapt the method to different applications, as well as the data storage and provenance necessary to build and disseminate databases. Here, we studied in detail a small test set of six systems (electron-doped MoS$_2$, WS$_2$, WSe$_2$, arsenene and phosphorene as well as hole-doped phosphorene) presenting different characteristics. Our results point out the crucial role of intervalley scattering, band anisotropy and doping to the transport properties of 2D materials, in turn underscoring the importance of an accurate treatment of these aspects in first-principles simulations. Hole-doped phosphorene is found to yield the highest mobility, thanks to its mono-valley and anisotropic nature. Electron-doped arsenene shows a lower mobility than could be expected, due to the importance of intervalley scattering. The transport properties of electron-doped TMDs are found to be very sensitive to the relative positions of the K and Q valleys: these quantities are still subject of study at the highest levels of theory and experimentally. While this work is based on DFT band structures, more accurate predictions would be reached by including spin-orbit interactions, GW corrections and by fitting at least the most important features of the valleys to experimental data. \section*{Acknowledgements:} This work has been in part supported by NCCR MARVEL (N.M. and D.C.). Calculations were performed on the Marconi - KNL supercomputer in Cineca under PRACE project PRA15\_3963. D.C.\ acknowledges support from the ‘EPFL Fellows’ fellowship programme co-funded by Marie Sklodowska-Curie, Horizon 2020 grant agreement no. 665667. M.G.\ acknowledges support from the Swiss National Science Foundation through the Ambizione career programme. \newpage \onecolumngrid \newpage \renewcommand\theequation{A\arabic{equation}} \renewcommand\thefigure{A\arabic{figure}} \setcounter{equation}{0} \setcounter{figure}{0} \setcounter{table}{0} \setcounter{section}{0} \section*{Appendix} \section{Closed Form of BTE} \label{app:closed_form} Re-writing Eq. \ref{eq:BTE} as \begin{align} 1 &= \sum_{\mathbf{k}'} P_{\mathbf{k}\bok'} \frac{1-f^0(\mathbf{k}')}{1-f^0(\mathbf{k})} \times \left\{\tau(\mathbf{k})- \tau(\mathbf{k}') \frac{\boldsymbol{v}(\mathbf{k}') \cdot \boldsymbol{u}_{\boldsymbol{E}} }{\boldsymbol{v}(\mathbf{k})\cdot\boldsymbol{u}_{\boldsymbol{E}}} \right\}, \end{align} we see that a closed form can be obtained by assuming $\tau(\mathbf{k}) \approx \tau(\mathbf{k}')$: \begin{align} \frac{1}{\tau(\mathbf{k})} &= \sum_{\mathbf{k}'} P_{\mathbf{k}\bok'} \frac{1-f^0(\mathbf{k}')}{1-f^0(\mathbf{k})} \times \left\{1- \frac{\boldsymbol{v}(\mathbf{k}') \cdot \boldsymbol{u}_{\boldsymbol{E}} }{\boldsymbol{v}(\mathbf{k})\cdot\boldsymbol{u}_{\boldsymbol{E}}} \right\}, \end{align} To obtain the closed form used in this work to initialize the iterative solution to the BTE, we replace $\boldsymbol{u}_{\boldsymbol{E}}$ by the direction of $\mathbf{k}$ with respect to the bottom of the corresponding valley, as explained in the main text. One may also replace $\boldsymbol{u}_{\boldsymbol{E}}$ with $\boldsymbol{v}(\mathbf{k})$ to obtain the so-called momentum relaxation-time approximation (mRTA) for the scattering time: \begin{align} \frac{1}{\tau_{\rm \footnotesize mRTA}(\mathbf{k})} &= \sum_{\mathbf{k}'} P_{\mathbf{k}\bok'} \frac{1-f^0(\mathbf{k}')}{1-f^0(\mathbf{k})} \times \left\{1- \frac{\boldsymbol{v}(\mathbf{k}') \cdot \boldsymbol{v}(\mathbf{k}) }{\boldsymbol{v}(\mathbf{k})^2} \right\}, \end{align} which gives very similar results. If the second term in brackets on the right-hand side is neglected, we finally obtain the scattering time within the energy relaxation-time approximation (eRTA): \begin{align} \frac{1}{\tau_{\rm\footnotesize eRTA}(\mathbf{k})} &= \sum_{\mathbf{k}'} P_{\mathbf{k}\bok'} \frac{1-f^0(\mathbf{k}')}{1-f^0(\mathbf{k})} \end{align} \section{Alternative algebraic solution to the BTE} \label{app:matrix_sol} We give here an other method to solve the BTE, relying on a direct algebraic solution of the system. Writing the BTE for the $N_i$ irreducible states yields $N_i$ equations and $N_f$ unknown variables $\tau(\mathbf{k}')$. To solve the corresponding system, we first need to fold it back on the irreducible states, using the fact that $\tau(\mathbf{k}') \approx \tau(\tilde{\mathbf{k}}')$ where $\tilde{\mathbf{k}}' \in \mathcal{I}$ is the symmetry equivalent of $\mathbf{k}'\in \mathcal{F}$: \begin{align} \begin{split} & \left( 1-f^0(\tilde{\mathbf{k}})\right) \boldsymbol{v}(\tilde{\mathbf{k}}) \cdot \boldsymbol{u}_{\boldsymbol{E}} = \\ & \sum_{\mathbf{k}'} P_{\tilde{\mathbf{k}}\mathbf{k}'} \left( 1-f^0(\mathbf{k}')\right) \boldsymbol{v}(\tilde{\mathbf{k}}) \cdot \boldsymbol{u}_{\boldsymbol{E}} \times \tau(\tilde{\mathbf{k}}) \\ & - \sum_{\tilde{\mathbf{k}}'} \left( \sum_{\mathbf{k}'\equiv\tilde{\mathbf{k}}'} P_{\tilde{\mathbf{k}}\mathbf{k}'} \left( 1-f^0(\mathbf{k}')\right) \times \boldsymbol{v}(\mathbf{k}') \cdot \boldsymbol{u}_{\boldsymbol{E}} \right) \tau(\tilde{\mathbf{k}}'). \end{split} \end{align} From there we use the same techniques mentionned in the main text to have a well-behaved set of $N_i$ equations with $N_i$ unknowns. Written as a matrix-vector product, it reads: \begin{align} \forall \tilde{\mathbf{k}} \in \mathcal{I}, \ F_{\tilde{\mathbf{k}}} = \sum_{\tilde{\mathbf{k}}'} \mathcal{S}_{\tilde{\mathbf{k}}, \tilde{\mathbf{k}}'} \tau_{\tilde{\mathbf{k}}'}, \end{align} where \begin{align}\label{eq:ScatMat} F_{\tilde{\mathbf{k}}} &= \left( 1-f^0(\tilde{\mathbf{k}})\right) \boldsymbol{v}(\tilde{\mathbf{k}}) \cdot \boldsymbol{u}_{\tilde{\mathbf{k}}} \\ \begin{split} \mathcal{S}_{\tilde{\mathbf{k}}, \tilde{\mathbf{k}}'} & = \left(\sum_{\mathbf{k}''} P_{\tilde{\mathbf{k}}\mathbf{k}''} \left( 1-f^0(\mathbf{k}'')\right) \boldsymbol{v}(\tilde{\mathbf{k}}) \cdot \boldsymbol{u}_{\tilde{\mathbf{k}}} \right) \delta_{\tilde{\mathbf{k}}, \tilde{\mathbf{k}}'} \\ & \ - \left( \sum_{\mathbf{k}'\equiv\tilde{\mathbf{k}}'} P_{\tilde{\mathbf{k}}\mathbf{k}'} \left( 1-f^0(\mathbf{k}')\right) \times \boldsymbol{v}(\mathbf{k}') \cdot \boldsymbol{u}_{\tilde{\mathbf{k}}} \right) \end{split} \end{align} Solving the BTE then boils down to a matrix inversion, and this gives us the values of $\tau$ on the $\mathcal{I}$ grid. It is then rotated according to the symmetries of the band structure, and interpolated linearly on the fine grid of the pockets $\mathcal{F}$. In this approach, the $\delta$ functions in Eq. \ref{eq:Pkkp} are replaced by Gaussians, and a convergence test is performed on the associated broadening. This way, one associates a weight to each contribution from each $\mathbf{k}$ point, and the contributions can then be organized as a matrix. In the triangles method, one does not associate a contribution to each $\mathbf{k}$ point of the grid. For the integral to be computed, the integrand must be known a priori. This is not the case here since the integrals involve the scattering times at all $\mathbf{k}$. The approach discussed here and the one in the main text give the same results within a $5\%$ error, provided the broadening parameter is chosen properly. \section{Bands structures and phonon dispersions} \label{app:bands_phonons} For the materials studied here, we report the band structures in Fig. \ref{fig:bands}, phonon dispersions in Fig. \ref{fig:phonons} and some interesting quantities related to the band structures in Table \ref{tab:effmass}. \begin{figure*}[h] \includegraphics[width=0.32\textwidth]{MoS2_bands.pdf} \includegraphics[width=0.32\textwidth]{WS2_bands.pdf} \includegraphics[width=0.32\textwidth]{WSe2_bands.pdf} \includegraphics[width=0.32\textwidth]{As2_bands.pdf} \includegraphics[width=0.32\textwidth]{P4_h_bands.pdf} \includegraphics[width=0.32\textwidth]{P4_e_bands.pdf} \caption{From left to right, top to bottom: band structure along high symmetry path for electron-doped MoS\2 , WS\2, and WSe\2, As, P\4, and hole-doped P\4 (black solid lines) compared with the undoped case (red dashed lines). In each case the two band structures are aligned with respect to the top of the valence band. The zero is at the Fermi level of the doped case. } \label{fig:bands} \end{figure*} \begin{table*}[h!] \caption{Extracted quantitative characteristics of the band structures. The first column shows effective masses at the band edges relevant for transport, obtained from finite-differences differentiation. If the effective mass is anisotripic the lighter effective mass is indicated as transport effective mass (T) while the mass in the perpendicular direction is referred to as longitudinal mass (L). The second column shows the absolute energy difference between the bottom of the conduction band (top of the valence band) and the Fermi level. The third column shows the absolute energy difference between the bottom of the K valley and the bottom of the Q valley in TMDs.} \begin{tabular}{ c c c c } \hline Material (e or h doped) & Effective masses (m$_0$) & $\Delta(E_{Fermi} - E_{max,min}) (meV) $ & $\Delta(E_{K} - E_{Q}) (meV)$ \\ \hline \hline MoS2(e) & m$^{*}_{K}$=0.417 & 153.3 & 257.4 \\ WS2(e) & m$^{*}_{K}$=0.314 & 118.1 & 178.0\\ WSe2(e) & m$^{*}_{K}$=0.330 & 50.2 & 92.0\\ As(e) & m$^{*}_{Q}$(T)=0.145,m$^{*}_{Q}$(L)=0.517 & 42.8 & - \\ P (h) & m$^{*}_{\Gamma}$(T)=0.172,m$^{*}_{\Gamma}$(L)=8.872 & 28.9 & -\\ P (e) & m$^{*}_{\Gamma}$(T)=0.139,m$^{*}_{\Gamma}$(L)=1.237 & 18.9 & - \\ \hline \hline \end{tabular} \label{tab:effmass} \end{table*} \begin{figure*}[h] \includegraphics[width=0.32\textwidth]{MoS2_phonons.pdf} \includegraphics[width=0.32\textwidth]{WS2_phonons.pdf} \includegraphics[width=0.32\textwidth]{WSe2_phonons.pdf} \includegraphics[width=0.32\textwidth]{As2_phonons.pdf} \includegraphics[width=0.32\textwidth]{P4_h_phonons.pdf} \includegraphics[width=0.32\textwidth]{P4_e_phonons.pdf} \caption{From left to right, top to bottom: phonon dispersion along high symmetry path for electron-doped MoS\2 , WS\2, and WSe\2, As, P\4, and hole-doped P\4 (black solid lines) compared with the undoped case (red dashed lines). Phonon softenings can be observed for phonons corresponding to possible electronic transitions with strong electron-phonon coupling. For example, in arsenene, the softenning at K corresponds to the strong intervalley coupling ($g \approx 140$ meV) with mode number $4$ observed in Fig. \ref{fig:EPC_As}.} \label{fig:phonons} \end{figure*} \section{additional EPC plots:} \label{app:EPC} Here we show additional plots for the EPC matrix elements of MoS$_2$, WS$_2$, WSe$_2$ and phosphorene. \begin{figure*}[h] \includegraphics[width=0.85\textwidth]{EPC_MoS2_elec.pdf} \caption{Interpolated $g_{\mathbf{k} \mathbf{k}'}$ for electron-doped MoS$_2$. The initial state considered is indicated by a white star. The rest of the points are the possible final states in the finely sampled pockets and the color of the point indicates the strength of the electron-phonon coupling matrix element. The index of the phonon mode indicated at the top of each subplot refers to a purely energetic ordering of the phonon modes associated with each transition.} \label{fig:EPC_MoS2} \end{figure*} \begin{figure*}[h] \includegraphics[width=0.85\textwidth]{EPC_Qbot_WS2_elec.pdf} \caption{Interpolated $g_{\mathbf{k} \mathbf{k}'}$ for electron-doped WS$_2$, with the initial state at the bottom of the Q valley.} \label{fig:EPC_WS2} \end{figure*} \begin{figure*}[h] \includegraphics[width=0.85\textwidth]{EPC_WSe2_elec.pdf} \caption{Interpolated $g_{\mathbf{k} \mathbf{k}'}$ for electron-doped WSe$_2$, with the initial state at the bottom of the K valley.} \label{fig:EPC_WSe2} \end{figure*} \begin{figure*}[h] \includegraphics[width=0.85\textwidth]{EPC_P4_less_elec.pdf} \caption{Interpolated $g_{\mathbf{k} \mathbf{k}'}$ for electron-doped phosphorene, with the initial state at the bottom of the $\Gamma$ valley.} \label{fig:EPC_P4e} \end{figure*} \newpage \twocolumngrid \bibliographystyle{myapsrev}
\section{Introduction} \label{introduction} One of the main scenarios of planet formation is the core accretion model, which aims to explain, among other things, the formation of gas giants, believed to be the first object to form. These planets are massive and thus can have a huge impact on the formation of other planets in the system. The idea of the core accretion model is that a massive core forms first and then accretes a gaseous envelope. A key constraint in this model is that the accretion of gas must proceed before the dissipation of the gas disc. This implies that the core must become massive enough to accrete gas in a few Myr (Haisch et al., 2001, Li \& Xiao, 2016). In the classical accretion scenarios the core grows by accreting planetesimals, which are kilometer-sized objects and the time needed to form a giant planet's core is much longer than the lifetime of the disc (Pollack et al. 1996). This difficulty led to the development of another accretion scenario, in which cores grow by accretion of pebbles, which are centimeter-sized bodies (Birnstiel et al. 2012). Pebbles themselves form by collisions of micro-meter sized dust embedded in the disc (Lambrechts \& Johansen 2014). Due to their small size, pebbles are more affected by gas drag and thus can be more easily accreted by the core (Lambrechts \& Johansen 2012), resulting in a more rapid formation. While an appealing idea, this scenario needs to be confronted to observations to check wether it reproduces the trends seen in the data. We use the well studied metallicity effect which is fully established observationally for exoplanets and is reproduced by planetesimal-based formation models (Mordasini et al. 2009; Coleman \& Nelson, 2016a) to aim at testing this model, and present an updated pebble-based planet formation model which outcomes are comparable to observations.\\ This work is structured as follows: in section \ref{model} we set the theoretical basis that is used to perform our simulations. We present the disc model and its evolution, core growth by pebble and gas accretion, and the migration of the bodies. In section \ref{Formation_tracks} we compute formation tracks to disentangle the effects of growth and migration. In section \ref{population_synth} we present the impact of different initial conditions on the formation of planets, such as the starting time for the embryo and the metallicity of the disc, using a population synthesis approach. Considering a single planet per disc we then compare the results of our model with observations of exoplanets through mass functions. In section \ref{Differentinternalstructure} we show the impact of having an internal structure for the planet's atmosphere and, adjusting some parameters, compare this updated model with observations. Finally, section \ref{metallicity} discuss the metallicity effect and section \ref{conclusion} is devoted to discussion and conclusions. \section{Theoretical model} \label{model} We present here the theoretical aspects behind our simulations. We define our disc model, its evolution and the core formation by pebble accretion. Migration is discussed and a comparison with previous work is provided as well. \subsection{Protoplanetary disc model and evolution} \label{discmodelevol} We use the disc model of Bitsch et al. (2015a) (hereafter B15a). In this model the disc structure depends on the accretion rate in the disc (assumed to be uniform) evolving with time as follows (Hartmann et al. 1998): \begin{equation} \log \left( \frac{\dot{M}}{M_{\odot} /yr} \right) = -8.00 - 1.40 \cdot \log \left( \frac{t + 10^5 yr}{10^6 yr} \right), \label{discevolution} \end{equation} where $\dot{M}$ is related to the viscosity $\nu$ and the gas surface density $\Sigma_g$ via: \begin{equation} \dot{M} = 3 \pi \nu \Sigma_g = 3 \pi \alpha H^2 \Omega_k \Sigma_g, \label{Mdotdisc} \end{equation} with $t$ being the time in years, $H$ the scale height of the disc, $\Omega_k$ the Keplerian frequency and $\alpha$ the viscosity parameter. The latter parameter influences the heating by viscous dissipation, and is set to $0.0054$ (B15a).\\ In order to compute the disc temperature, three different regimes are identified. In the inner disc (radial direction) the temperature is dominated by viscous heating, in the outer disc by stellar irradiation. Between the two regimes stands a cooler region that is heated by diffusion from the hotter inner part and the hotter outer part. This leads to three different power-law fits (see Appendix A of Bitsch et al. (2015a)). Once the temperature is determined it can be linked to the different properties of the disc e.g $\Sigma$, P, H. For exemple the disc aspect ratio $\rm H/ \rm r$ is linked to the temperature via \begin{equation} T = \left( \frac{H}{r} \right)^2 \frac{GM_{*}}{r} \frac{\mu}{R}, \label{eqTdisc} \end{equation} where $G$ is the gravitational constant, $M_{*}$ is the mass of the central star, $r$ the location in the disc, $R$ is the gas constant and $\mu$ is the mean molecular weight. \\ For a given $\dot{M}$ and a specified temperature all quantities of the disc can be derived. \subsection{Growth by pebble accretion} \label{pebble_accretion} During the evolution of the disc, embryos grow through the accretion of pebbles. We use the pebble accretion model presented in Lambrechts \& Johansen (2012, 2014). In our simulations we assume that the embryos have already formed through the streaming instability, at a time that is a free parameter of the model. This means that we model the growth only above a certain mass which is given by the so-called pebble transition mass: \begin{equation} M_t = \sqrt{\frac{1}{3}} \frac{(\eta v_k)^3}{G \Omega_k}, \label{Mtransition} \end{equation} where $\eta = - \frac{1}{2} \left(\frac{H}{r} \right)^2 \frac{\partial ln P}{\partial ln r}$ and $v_k = \Omega_k r$, with $\Omega_k = \sqrt{\frac{GM_*}{r^3}}$. This mass corresponds to the mass at which pebble accretion occurs within the Hill radius $r_H = r[M_c/(3M_*)]^{1/3}$ rather than within the Bondi radius (Lambrechts \& Johansen 2012). When $M_t$ is reached, the body starts to accrete efficiently with the 2D accretion rate (see Eq. \ref{dotM2D}). As mentioned above, since we do not model the formation and growth until $M_t$, we assume a given starting time $t_{\rm ini}$ for the embryo. \\ In the outer regions of the disc a large reservoir of small dust slowly grows into larger inward-drifting pebbles (Lambrechts \& Johansen 2014). The location in the disc where the particles have just grown to pebble size is the pebble production line $r_g$, which is given by $t_{\rm growth}(r_g) = t_{\rm drift}(r_g)$ (outside the ice line). At this location the particles have reached the size for which their drift is more rapid than growth. As $r_g$ moves outwards with time, pebbles drift inward inducing a flux: \begin{equation} \dot M_{\rm pebbles} (r) = 2 \pi r_{\rm g} {d r_{\rm g} \over d t } \Sigma_{\rm dust} ( r_{\rm g} ) = 2 \pi r_{\rm g} {d r_{\rm g} \over d t } Z_{\rm peb} ( r_{\rm g} ) \Sigma_{\rm gas} ( r_{\rm g} ), \label{eq_flux} \end{equation} where $\Sigma_{\rm dust}$ and $\Sigma_{\rm gas}$ are the surface densities of dust and gas respectively at $r_{\rm g}$, and $Z_{\rm peb}$ denotes the fraction of solids (with respect to the amount of gas) that can turn into pebbles. $Z_{\rm peb}$ is smaller than $Z_{\rm tot}$, the total fraction of solids (with respect to the amount of gas). From this total fraction of solids $Z_{\rm tot}$, initially all in the form of dust, we assume that only a fraction forms pebbles (denoted $Z_{\rm peb}$) and the rest remains as dust (denoted $Z_{\rm dust}$). The latter influences the disc structure, the opacity of the disc and has an impact on migration via the surface density of the disc. On the other hand $Z_{\rm peb}$ regulates the amount of pebbles in the disc and thus the pebble surface density which impacts planet growth. $Z_{\rm tot}$ is assumed to be proportional to the metallicity of the star $\rm[Fe/H]$ through: \begin{equation} \rm[Fe/H] = \log_{10} \left( \frac{Z_{\rm tot}}{Z_\odot} \right), \end{equation} with $Z_\odot = 0.02$ (Anders \& Grevesse, 1989).\\ As the growth radius $r_{\rm g}$ moves outwards, the newly formed pebbles drift from the outer disc towards the star. At some point they cross the water ice line, which is the place in the disc where the temperature is equal to 170 K (see however Burn et al. in prep). Since pebbles are mainly composed of ices and silicates, when they reach the ice line, the ice sublimates releasing the trapped silicates causing their destruction (Morbidelli et al. 2015). In our model, a reduction of the flux of pebbles (50\%) is included at the water ice line. However $\rm Z_{tot}$ and $\rm Z_{peb}$ are assumed to be independant of the semi-major axis throughout the disc evolution because the pebble production line moves quickly outwards far from the snow lines of volatile molecules such as $\rm H_2O$ , $\rm NH_3$ and $\rm CO_2$. Since we do not model the early stages of the disc evolution (assuming a starting time $\rm t_{ini}$ for the planets), the accreted pebbles are already beyond the snow lines when the embryo is inserted. By reducing the flux by 10\% at the $\rm CO_2$ line and 5\% at the $\rm NH_3$ line (based on Marboeuf et al. 2014b and Thiabaud et al. 2014), our results are unchanged.\\ The accretion rate of the pebbles onto the core is separated into two modes depending on the mass of the planet. If the planet is small and its Hill radius is smaller than the scale height of pebbles $H_{\rm peb}$ then pebble accretion proceeds in the 3D mode (Bitsch et al. 2015b, hereafter B15b) : \begin{equation} \dot{M}_{c,3D} = \dot{M}_{c,2D} \left( \frac{\pi (\tau_f / 0.1)^{1/3} r_H}{2 \sqrt{2 \pi} H_{\rm peb}} \right). \label{dotM3D} \end{equation} Then if $r_H$ becomes larger than $H_{\rm peb}$, the accretion proceeds in 2D mode (Morbidelli et al. 2015): \begin{equation} \dot{M}_{c,2D} = 2 \left( \frac{\tau_f}{0.1} \right)^{2/3} r_H v_H \Sigma_{\rm peb}, \label{dotM2D} \end{equation} where $\tau_f$ is the Stokes number depending on the size of the pebbles, $v_H= \Omega_k \times r_H$ is the Hill speed and $\Sigma_{\rm peb}$ is the pebble surface density given by \begin{equation} \Sigma_{\rm peb} = \sqrt{\frac{2 \dot{M}_{\rm pebble} \Sigma_{\rm gas}}{\sqrt{3} \pi \epsilon_p a_p v_K}}. \label{Sigmapeb} \end{equation} $\dot{M}_{\rm pebble}$ is given by Eq. \ref{eq_flux}, $\epsilon_p$ is the coagulation efficiency between pebbles and is assumed to be $0.5$ (Lambrechts \& Johansen 2014) and $a_p$ is the semi-major axis of the planet.\\ The transition between 3D and 2D mode occurs when $H_{\rm peb} < \left( \frac{\pi (\tau_f / 0.1)^{1/3} r_H}{2 \sqrt{2 \pi}} \right)$ (B15b).\\ Outside the ice line, the pebble size is given by $t_{\rm growth}(r_g) = t_{\rm drift}(r_g)$, as explained above. However, inside the ice line, this assumption does not hold anymore. The size of the accreted pebbles inside the ice line is indeed much smaller ($\sim$ chondrule size (Morbidelli et al. 2015, Shibaike et al, in prep.)) than the one outside because of sublimation (Ida \& Guillot 2016). Therefore, if a planet crossing the ice line has not reached the isolation mass, the accreted pebbles have a much lower Stokes number. The surface density of pebbles should consequently be given by (Ormel \& Klahr 2010): \begin{equation} \Sigma_{\rm peb} = \frac{\dot{M}_{\rm peb}}{2 \pi r v_r}, \label{Sigmapeb_insideiceline} \end{equation} instead of Eq. (\ref{Sigmapeb}), which will influence the accretion rate. In Eq. \ref{Sigmapeb_insideiceline} the drift velocity $v_r$ is defined as (Weidenschilling 1977): \begin{equation} v_r = -2 \frac{\tau_f}{\tau_f^2 + 1} \eta v_K, \end{equation} where $\tau$ is given by the chondrule size.\\ Computing this reduction of the pebble size at the ice line we compare our accretion rate with formula 59 of Ida et al. 2016. They derive a general formula for the accretion rate of pebbles that is strongly influenced by the boundaries, such as the ice line or the transition from Epstein to Stokes drag regime. Using Ida et al. 2016 formula we obtain a slightly smaller initial accretion rate, leading to a slower growth and therefore smaller planets. Accreting pebbles, the core grows until it reaches what is called the isolation mass. This mass is defined as the mass required to perturb the gas pressure gradient in the disc, modifying the gas rotation velocity and thus halting the drift of pebbles (Ataiee et al. 2018, Bitsch et al. 2018): \begin{equation} M_{\rm iso} \propto 20 \left(\frac{H/R}{0.05}\right)^{3} \cdot M_{\oplus}, \label{Miso} \end{equation} where $M_{\oplus}$ is the mass of the Earth. When $M_{\rm iso}$ is reached the envelope of the planet contracts as long as $M_{\rm env} < M_{\rm core}$ and accretes gas following the accretion rate given by Piso \& Youdin 2014. Once $M_{\rm env} > M_{\rm core}$ a phase of rapid gas accretion starts (Lambrechts and Johansen 2014), leading possibly to a gas giant. The accretion rate at this stage is given by Machida et al. 2010. \subsection{Planet migration} \label{planet_migration} During the whole growth process forming planets migrate through the disc due to torques resulting from non-axisymmetric features in the gas induced by the presence of the planet. For low-mass planets that are still embedded in the disc, type I migration is described by Paardekooper et al. 2011: \begin{equation} \Gamma_{\rm tot} = \Gamma_L + \Gamma_c, \end{equation} where $\Gamma_L$ is the Lindblad torque and $\Gamma_c$ the corotation torque. In some regions where the corotation torque is bigger than the Lindblad one (i.e. $\Gamma_{\rm tot} > 0$), outward migration is possible. The sign and magnitude of the two torques arise from an asymmetry in the perturbed density distribution around the planet and wakes (Baruteau et al. 2014).\\ Planets that have reached their isolation mass start to accrete gas and grow rapidly until they finally open a gap in the disc. The criterion for gap opening is the one of Crida et al. 2006: \begin{equation} \frac{3}{4} \frac{H}{r_H} + \frac{50}{q \Re} \leq 1, \end{equation} where $q = M_{\rm planet} / M_{\rm star}$ is the mass ratio of the planet relative to the central star, $r_H$ is the Hill radius and $\Re$ is the Reynolds number defined by $\Re = \frac{r_p^2 \Omega_K}{\nu}$, with $r_p$ being the location of the planet in the disc and $\nu$ the viscosity. If the criterion is fulfilled, the planet is massive enough to open a gap and migrates in type II regime. Type II migration is slower than type I, which potentially saves giant planets from ending up in the central star (Baruteau et al. 2014). We assume that the type II migration timescale of the planet is a function of the viscous timescale of the disc (Mordasini et al. 2009a) : $\tau_{II} = \frac{r_p^2}{\nu_{\rm visc}} \times \rm max(1, \frac{M_p}{4 \pi \Sigma_{\rm gas} r_p^2})$. \subsection{Comparison with previous work} \label{thebug} In order to test our implementation of the equations presented in B15b, we attempted to reproduce their results. First we compared the gas disc model with the results of Bitsch et al. 2015a, and found very good agreement\footnote{Note that there is a typo in the formula of Bitsch et al. 2015a, and the formulas A17 of their annexe must be corrected, the term in the second line multiplying the two terms of the first line, and not only the second one.}. We then aimed at reproducing the growth of planets by pebble accretion. For this, we considered the same parameters as those quoted in B15b, and computed the formation of planets starting at different locations in the disc, and at a time of 2 Myr (their Fig. 2). As explained in section \ref{pebble_accretion}, the amount of solids is split into the solids forming pebbles $Z_{\rm peb}$ and the ones remaining as dust $Z_{\rm dust}$. B15b uses $Z_{\rm peb} = 2/3 * Z_{\rm tot}$ and $Z_{\rm dust} = 1/3 * Z_{\rm tot}$. The results of our model are shown in Fig \ref{withoutbug}, and it is immediately clear from this that our model (thick lines) \textit{does not} reproduce the results of B15b (thin lines). An interesting comparison can also be made using the surface density of pebbles at 2 Myr, also shown in Fig. 2 of B15b. Comparing to that obtained in our case (see the yellow line in Fig. \ref{withoutbug}) and the one of B15b, we see that the surface density of pebbles is much smaller in our simulation compared to the one of B15b. \begin{figure} \hspace{0cm} \includegraphics[height=0.35\textheight,angle=0,width=0.35\textheight]{Fig1.pdf} \caption{Comparison between the results of B15b (thin lines) and our results (thick lines). The lines starting vertically are the formation tracks of planets starting at 5, 10, 15, 25, 40, and 50 AU. The orange lines are the surface density of pebbles at 2 Myr in the two models. As in B15b, the planets are assumed to start their formation at 2 Myr.} \label{withoutbug} \end{figure} We then compute the same model, but now changing Eq. \ref{eq_flux} to the following equation: \begin{equation} \dot M_{\rm pebbles} (r) = 2 \pi r_{\rm g} {d r_{\rm g} \over d t } Z_{\rm peb} ( r_{\rm g} ) \Sigma_{\rm gas} ( r ) \label{eq_flux_bug} \end{equation} This equation is obviously incorrect because $\Sigma_{\rm gas}$ is taken at the local position in the disc $r$ and not at $r_g$. Surprisingly, in this case, the results were much closer to the ones of B15b. We show this comparison in Fig. \ref{withbug}. \begin{figure} \hspace{0cm} \includegraphics[height=0.35\textheight,angle=0,width=0.35\textheight ]{Fig2.pdf} \caption{Same as Fig. \ref{withoutbug} but using Eq. \ref{eq_flux_bug} to compute the flux of pebbles. The match with the results of B15b is much better (the thin lines are barely visible but there is one such line below each of the thick lines).} \label{withbug} \end{figure} In order to further check our results and compare them to B15b, we compute the core mass, envelope mass, total mass, and final location of planets, as a function of their initial location, and compare our results with Fig. 3 of B15b. Using Eq. \ref{eq_flux_bug} to compute the pebble flux, we obtain results very similar to those of B15b (see Fig. \ref{fig3_withbug}), whereas using the correct version of the equation (Eq. \ref{eq_flux}), the final planet mass is much smaller for all the starting locations. We then contacted B. Bitsch who confirmed to us that Eq. \ref{eq_flux_bug} instead of Eq. \ref{eq_flux} was indeed used in their code (private communication, Bitsch et al. 2017). \begin{figure} \hspace{0cm} \includegraphics[height=0.35\textheight,angle=0,width=0.35\textheight]{Fig3.pdf} \caption{Final core mass (blue), final envelope mass (green), final total mass (magenta), and final location (red) of planets as a function of their initial location. The lines are the results of B15b, whereas the points with different symbols are our results. The cyan symbols are the initial location of planets. The pebble flux is given by Eq. \ref{eq_flux_bug}.} \label{fig3_withbug} \end{figure} As can be seen by comparing Figs. \ref{withoutbug} and \ref{withbug}, the effect on the growth of planets is dramatic: no planets grow when the pebble flux is computed with the correct equation, at least for the parameters assumed in B15b. \section{Formation tracks} \label{Formation_tracks} As explained in the previous section, using B15b parameters and the correct equation for the accretion rate (Eq. \ref{eq_flux}), do not result in planet formation. We thus have to adjust our model. We changed the amount of solids used to form pebbles ($\rm Z_{\rm peb}$) and dust ($\rm Z_{\rm dust}$). This section shows the influences of both of them. Several starting times for the embryos were tested (see section \ref{population_synth}) and since the conclusions were unchanged we only present in this chapter results for $\rm t_{\rm ini} = 1.5$ Myr. \subsection{Changing $ Z_{\rm peb}$ and $ Z_{\rm dust}$ while keeping $ Z_{\rm tot}$ constant} \label{ChangeZpebZdust_keepZtotconst} From the total amount of solids $\rm Z_{\rm tot}$, we vary the amount we consider to form pebbles and the one that remains as dust, as explained in section \ref{thebug}. In B15b this ratio was $2/3$ of $Z_{\rm tot}$ into pebbles and $1/3$ of $Z_{\rm tot}$ into dust. To test the influence of this ratio we take the constant value $\rm Z_{\rm tot} = 0.055$ and split this amount between dust and pebbles with different percentages\footnote{We choose $Z_{\rm tot} = 0.055$, which is almost three times the solar value of $Z_{\rm sun} = 0.02$ (Anders \& Grevesse, 1989), because it is an average value compared to the ones we test (see section \ref{population_synth}).}. Fig. \ref{Mvsa_for_fixedZtot} represents the mass of the formed planets as a function of their final location for this test. The colour code expresses the percentage of solids that have been considered to form pebbles. For example black dots represent the final properties of planets assuming that $10 \%$ of $\rm Z_{\rm tot}$ form pebbles and the other $90 \%$ remains as dust. In this case the formed planets are very small ($\sim 10^{-2}M_{\oplus}$) and no massive planet forms. More generally, Fig. \ref{Mvsa_for_fixedZtot} shows that the more material we use to form pebbles, the bigger the planets. Indeed most of the planets of $ \sim 1000$ $M_{\oplus}$ are represented by light orange or yellow points, corresponding to $\rm Z_{\rm peb} \sim 80 - 90 \%$ of $Z_{\rm tot}$.\\ \begin{figure} \hspace{0cm} \includegraphics[height=0.35\textheight,angle=0,width=0.35\textheight]{Mvsa_1_5Myr_diffZpeb.pdf} \caption{Mass of the planets as a function of their final location for a fixed value of $Z_{\rm tot} = 0.055$. The starting time of the embryos is $\rm t= 1.5$ Myr with a linear distribution of their initial location (see discussion in section \ref{Initialconditions}). The color code gives the percentage of solids that is used to form pebbles ($Z_{\rm peb}$). The remaining percents of the solids is the dust in the disc ($Z_{\rm dust}$).} \label{Mvsa_for_fixedZtot} \end{figure} Fig. \ref{Zpeb_percentage_for_fixedZtot} shows the percentage of planets with a radial velocity higher than 20 m/s depending on the amount of pebbles. Again here the total amount of solids is fixed: $Z_{\rm tot} = 0.055$. The percentage of planets is given for a radial velocity higher than 20 m/s to be consistent with Fig. \ref{KrvIS} and \ref{KrvB15} where we compare our results with those of Johnson et al. 2010. The red curve in Fig. \ref{Zpeb_percentage_for_fixedZtot} represents all the planets, including those piling up at $\rm r = 0.06$ AU which means that they are potentially lost into the star because they migrated to the inner edge of the disc (0.1 AU). The choice of piling the planet at $\rm r = 0.06$ AU, like in Fig. \ref{Mvsa_for_fixedZtot}, is arbitrary and avoid having a blank space in the figure between the planets that are still in the disc and the ones that fall into the star. Taking the red curve into account the most efficient percentage to form giant planets is the highest one shown here, $Z_{\rm peb} = 0.9 \times Z_{\rm tot}$. On the other hand, the blue curve corresponds to all the planets beyond 0.1 AU, which is the inner edge of the disc. In this case the percentage of giant planets slightly decreases for $Z_{\rm peb} = 0.9 \times Z_{\rm tot}$ compared to the $Z_{\rm peb} = 0.8 \times Z_{\rm tot}$ case. This is due to too efficient migration if $Z_{\rm dust}$ is too small and thus planets fall into the star before accreting gas efficiently and possibly grow bigger. Therefore a smaller amount of $Z_{\rm dust}$, and thus a higher amount of $Z_{\rm peb}$, would not help the formation, nor the retention, of planets. Taking this into account and considering the two curves we conclude that the most efficient ratio to form giants is $Z_{\rm peb} = 0.9 \times Z_{\rm tot}$ even if some planets may migrate into the star. \begin{figure} \hspace{0cm} \includegraphics[height=0.35\textheight,angle=0,width=0.35\textheight]{percentage_Krv20ms_allplanets_diffZpeb.pdf} \caption{Fraction of planets with a radial velocity higher than 20 m/s as a function of the percentage of solids considered to form pebbles. The red curve gives the total amount of formed planets and the blue one gives the amount of formed planets beyond 0.1 AU. $Z_{\rm tot}$ is fixed and equal to 0.055.} \label{Zpeb_percentage_for_fixedZtot} \end{figure} Another argument in favour of this partition is observed in the growth tracks of the planets. Fig. \ref{Tracks_for_fixedZtot} represents growth tracks for planets starting at 3.5, 21.5 and 25 AU. Each starting location has been tested with a different ratio of pebbles and dust. We observe that for a too small ratio of pebbles and dust, regardless of the location, the planet does not manage to grow bigger than 1 $M_{\oplus}$. This is expected since there is not a lot of mass to accrete. Focusing on the planet starting at $\rm a_{\rm ini} = 3.5$ AU we see that there is a threshold value for which planets grow bigger than 10 $\rm M_{\oplus}$: an amount of 60 \% of pebbles seems necessary to form giant planets for close-in locations. Focusing on the other tracks, a threshold is not clearly distinguishable. However a large amount of pebbles favors the formation of giant planets. A fraction of 90 \% of pebbles ($\rm Z_{\rm peb}$) and 10 \% of dust ($\rm Z_{\rm dust}$) is therefore used in the rest of the paper (except in sections \ref{varyingZdustkeepingZpebcte} and \ref{varyingZpebkeepingZdustcte} which aim to show the influence of $\rm Z_{\rm peb}$ and $\rm Z_{\rm dust}$). \begin{figure} \hspace{0cm} \includegraphics[height=0.35\textheight,angle=0,width=0.35\textheight]{tracks_comparison_SANS10AU.pdf} \caption{Growth tracks of planets for different starting locations. The colour code is the percentage of solids that is used to form pebbles. The remaining percents of the solids is the dust in the disc.} \label{Tracks_for_fixedZtot} \end{figure} \subsection{Varying $ Z_{\rm dust}$ while keeping $ Z_{\rm peb}$ contant} \label{varyingZdustkeepingZpebcte} The amount of dust is then varied keeping the amount of pebbles constant to test the impact of the disc structure on the formed planets. Indeed $\rm Z_{ \rm dust}$ influences the disc structure which will have consequences not only for the migration of planets but also for the isolation mass (Eq. \ref{Miso}): the disc aspect ratio H (which appears in the $\rm M_{\rm iso}$ formula) is regulated by the temperature (as can be seen in Eq. \ref{eqTdisc}) which is influenced by the amount of dust $\rm Z_{\rm dust}$ (B15b).\\ The variation of $\rm Z_{\rm dust}$ modifies the total amount of solids ($\rm Z_{\rm tot}$) for each test. Table \ref{Tableau_Zpebconst_Zdustvary} labels the different cases we use. In order to compare the tracks for the different $\rm Z_{\rm dust}$ we choose a random initial location in the disc (here $a_{\rm ini} = 6.6$ AU) and look at the growth. \\ \begin{center} \begin{table} \centering \caption{Amount of pebbles, dust and solids in the test for a constant $\rm Z_{\rm peb}$.} \label{Tableau_Zpebconst_Zdustvary} \begin{tabular}{|c|c|c|c|c|} \hline \textbf{$\rm Z_{\rm peb}$} & \textbf{$\rm Z_{\rm dust}$} & \textbf{$\rm Z_{\rm tot}$} &\textbf{$a_{\rm final} / AU$} & \textbf{$M_p / M_{\oplus}$} \\ \hline 0.05 & 0.001 & 0.051 & 2.99 & 1.76 \\ \hline 0.05 & 0.003 & 0.053 & 3.02 & 4.46 \\ \hline 0.05 & 0.005 & 0.055 & 3.68 & 4.89 \\ \hline 0.05 & 0.008 & 0.058 & 3.20 & 4.98 \\ \hline 0.05 & 0.01 & 0.06 & 2.70 & 5.49 \\ \hline 0.05 & 0.02 & 0.07 & 0.05 & 10.09 \\ \hline 0.05 & 0.03 & 0.08 & 0.05 & 55.98 \\ \hline 0.05 & 0.04 & 0.09 & 0.22 & 226.77 \\ \hline 0.05 & 0.05 & 0.1 & 0.26 & 231.60 \\ \hline 0.05 & 0.07 & 0.12 & 0.27 & 233.67 \\ \hline \end{tabular} \end{table} \end{center} Analysing Fig. \ref{Zdust_change_for_fixedZpeb} allows us to distinguish three different regimes. The first one concerns the planets with $\rm Z_{\rm dust}$ between 0.001 and 0.01: they all reach their isolation mass but due to their small $\rm Z_{\rm dust}$ their $\rm M_{\rm iso}$ is too small to accrete gas efficiently (their $\rm M_{\rm iso}$ stands between $1.2$ $\rm M_{\oplus}$. and $3.1$ $\rm M_{\oplus}$). The planet with $\rm Z_{\rm dust} = 0.02$ also reaches its isolation mass but is big enough to accrete gas efficiently ($\rm M_{\rm iso} \sim 5.75$ $\rm M_{\oplus}$). However it does not succeed in opening a gap in the disc and thus undergoes type I migration until it falls into the star. The third regime contains the planets with $\rm Z_{\rm dust}$ between 0.03 and 0.05. They all reach their isolation mass and are big enough to accrete gas. The planet with $\rm Z_{\rm dust} = 0.03$ first migrates with type I migration and then becomes massive enough to open a gap in the disc and migrate with type II. The two other ones reach $\rm M_{\rm iso} \sim 8$ $\rm M_{\oplus}$ and enter in the type II migration regime rapidly which prevents them from falling into the star. \\ These tests emphasise the fact that the effect of the dust fraction is important for not only the disc structure, but also the growth of the planet, mainly via the impact on the isolation mass. \begin{figure} \hspace{0cm} \includegraphics[height=0.35\textheight,angle=0,width=0.35\textheight]{Mvsa_tracks_Zpebcte.pdf} \caption{Growth tracks for planets starting at the same location for different $\rm Z_{\rm dust}$ and fixed $\rm Z_{\rm peb} = 0.05$. The colour code expresses the different $\rm Z_{\rm dust}$.} \label{Zdust_change_for_fixedZpeb} \end{figure} \subsection{Varying $ Z_{\rm peb}$ while keeping $ Z_{\rm dust}$ constant} \label{varyingZpebkeepingZdustcte} In order to test the influence of the amount of pebbles, keeping the disc structure constant, we run similar simulations, but now keeping a constant value of $Z_{\rm dust} = 0.005$, and varying $Z_{\rm peb}$ from 0.001 to 0.1 (see Table \ref{Tableau_Zdustconst_Zpebvary}). The major impact of the amount of pebbles $Z_{\rm peb}$ is on the surface density of pebbles and thus on the planet growth, as can be observed in Table \ref{Tableau_Zdustconst_Zpebvary}, which summarises the parameters used for each of these simulations.\\ We conclude that increasing the amount of pebbles, the larger the planets can grow. However, as already mentionned, the amount of dust should not be too small otherwise the migration of the planets becomes too efficient. \begin{table} \centering \caption{\label{Tableau_Zdustconst_Zpebvary} Amount of pebbles, dust and solids in the test for a constant $\rm Z_{\rm dust}$.} \begin{tabular}{|c|c|c|c|c|c|c|c|c|} \hline \textbf{$\rm Z_{\rm peb}$} & \textbf{$\rm Z_{\rm dust}$} & \textbf{$\rm Z_{\rm tot}$} &\textbf{$a_{\rm final} / AU$} & \textbf{$M_p / M_{\oplus}$} \\ \hline 0.001 & 0.005 & 0.006 & 6.65 & 0.00106 \\ \hline 0.003 & 0.005 & 0.008 & 6.65 & 0.00124 \\ \hline 0.007 & 0.005 & 0.012 & 6.65 & 0.00286 \\ \hline 0.01 & 0.005 & 0.015 & 6.64 & 0.00864 \\ \hline 0.03 & 0.005 & 0.035 & 3.61 & 3.91 \\ \hline 0.05 & 0.005 & 0.055 & 3.68 & 4.89 \\ \hline 0.08 & 0.005 & 0.085 & 3.51 & 5.74 \\ \hline 0.1 & 0.005 & 0.105 & 3.43 & 6.24 \\ \hline \end{tabular} \end{table} \section{Population synthesis} \label{population_synth} Based on the previous section's discussion we set our nominal model to be the B15b approach (with the correct equation for the accretion rate) and the pebble formation efficiency at 90 \% with the remaining 10 \% being dust.\\ In order to compare the results of our model with observations, we need to take into account the wide existing spectrum of disc properties. We compute the migration of the planets following the formulae of Paardekooper et al. 2011 instead of those given in B15b. These two migrations are quite similar except for the fact that B15b uses a smothing function for the transition between the type I and type II migration regimes. \subsection{Initial conditions} \label{Initialconditions} The initial conditions of our model can be split into two types of parameters: the ones set for a whole population and the ones varied in each simulation.\\ The former category includes the starting times of the planetary seeds and the total amount of solids. The seeds, each of them having a mass given by Eq. \ref{Mtransition}, are inserted at the beginning of the evolution (0 Myr), after 0.5, 1, 1.5 and 2 Myr. As can be seen in Table \ref{Tableau_pourcent}, if the seeds are introduced too early in the simulation most of the planets end up in the star. Therefore we only focus on starting times of 1.5 Myr and 2 Myr. For those two starting times, the total amount of solids is varied between 0.011 and 0.11.\\ Each simulation is modeling the growth of a single planet per disc with a random lifetime of this disc and initial location of the seed. The lifetime is important because it impacts the duration of the planet growth. In our model, it is randomly chosen between 2 and 5 Myr with a uniform distribution (Haisch et al. 2001b). The disc evolution stops when the lifetime is reached or when the planet has migrated into the star. Note that the evolution of the disc remains the same for the different liftetimes, only the final time changes. The initial location distribution is assumed to be linear between 0.1 and 50 AU. As can be seen in Fig. \ref{Massfunction_LOG_UNIFORM} the function of mass of the formed planets using a linear or a logarithmic distribution look very similar. However using a logarithmic distribution the model will form more planets in the inner disc where the isolation masses are smaller, resulting in planets that will not reach the runaway gas accretion phase and may fall quickly into the star (Bitsch \& Johansen 2017). We thus decide to use a linear distribution between 0.1 and 50 AU. \begin{table} \centering \caption{\label{Tableau_pourcent} Percentages of planets ending in the star (closer than 0.1 AU) according to the different starting times of the seed.} \begin{tabular}{|c|c|} \hline Starting times & \% of planets ending in the star \\ \hline 0 Myr & 91 \% \\ \hline 0.5 Myr & 86 \% \\ \hline 1 Myr & 55 \% \\ \hline 1.5 Myr & 40 \% \\ \hline 2 Myr & 29 \% \\ \hline \end{tabular} \end{table} \begin{figure} \hspace{0cm} \includegraphics[height=0.35\textheight,angle=0,width=0.35\textheight]{Massfunction_log_uniform.pdf} \caption{Mass function for planets starting with a uniform distribution of the initial locations compared to a logarithmic distribution.} \label{Massfunction_LOG_UNIFORM} \end{figure} \subsection{Mass- semi-major axis diagram} Fig. \ref{Mvsa_t1.5} and \ref{Mvsa_t2} show the mass of the formed planets as a function of their final semi-major axis for different metallicities. The pile up at $\rm r = 0.06$ AU that can be observed in both figures represents the planets that might be lost into the star because they migrated to the inner edge of the disc (0.1 AU). Focusing on the final locations and masses of the planets we observe a region with a lack of planets between 1 and 3 AU for masses around 0.01-0.1 $M_{\oplus}$. This is an effect caused by the ice line. The planets that reach 100 to 1000 $M_{\oplus}$ appearing between 0.1 and 1 AU are the ones that come from further out in the disc and that have migrated inwards. The smaller planets within this region are the ones with initial locations below 1 AU. They remain near their initial location since planets start migrating once they reach the isolation mass. We see some Earth-mass planets forming interior to 1 AU but since we only have one planet per system, we cannot really rely upon them (Alibert et al. 2013). We leave interactions between planets for future work. Note that the planet distribution near the inner edge of the disc could be largely changed due to new type II migration models (Kanagawa et al. 2018, Robert et al. 2018 and Ida et al. 2018). These models show that for low viscosity cases the migration towards the star would be slowed down. This is however not considered in the present paper but will be treated in future work.\\ In Fig. \ref{Mvsa_t1.5}, the seeds are placed in the disc after 1.5 Myr of evolution. A clear tendency emerges: an increased pebble density favors the formation of more massive planets. For a small amount of solids such as $Z_{\rm tot} = 0.011$ (meaning that $Z_{\rm peb} = 0.01$ and $Z_{\rm dust} = 0.001$) planets do not grow larger than 1 $\rm M_{\oplus}$. Most of them even remain below $0.1$ $\rm M_{\oplus}$ and beyond 10 AU due to a lack of material for those embryos to accrete and grow bigger. However, if they nevertheless manage to reach a certain mass, the amount of dust is very small and their migration is too efficient to prevent them from falling into the star (as discussed in section \ref{Formation_tracks}). These results are valid for $Z_{\rm tot} =0.033$ as well. However, for higher amounts, like $Z_{\rm tot} = 0.055$, $Z_{\rm tot} = 0.077$ and $Z_{\rm tot} = 0.11$, 100 to 1000 $M_{\oplus}$ planets appear, mostly between 0.2 AU and 5 AU. \\ For seeds starting after 2 Myr, the distribution of planets is not too dissimilar to the one with $ \rm t_{ \rm ini} = 1.5$ Myr. We still observe that with more solids in the disc (i.e. higher $Z_{\rm tot}$), planets are more massive. However the distinction between the different amounts of solids is less obvious than in Fig. \ref{Mvsa_t1.5}. \begin{figure} \hspace{0cm} \includegraphics[height=0.35\textheight,angle=0,width=0.35\textheight]{Mvsa_allZ_1_5Myr.pdf} \caption{Mass of planets as a function of their final semi-major axis for seeds starting after 1.5 Myr of disc evolution. The color code represents the different amount of solids $Z_{\rm tot}$ (from which 90 \% will form pebbles and 10 \% will remain as dust.). The spacing between the black dots and the purple ones comes from the fact that we use discrete values of $\rm Z_{\rm tot}$.} \label{Mvsa_t1.5} \end{figure} \begin{figure} \hspace{0cm} \includegraphics[height=0.35\textheight,angle=0,width=0.35\textheight]{Mvsa_allZ_2Myr.pdf} \caption{Mass of planets as a function of their final semi-major axis for seeds starting after 2 Myr of disc evolution (same as Fig. \ref{Mvsa_t1.5} but for $\rm t_{\rm ini} = 2$ Myr). The color code represents the different amount of solids $Z_{\rm tot}$.} \label{Mvsa_t2} \end{figure} \subsection{Comparison of mass functions} \label{Massfunction} In order to further compare our results with observations, we apply on our sample of planets the detection probability given by Mayor et al. 2011 in their Fig. 6. To proceed, the masses of the formed planets are first represented as a function of their period (see Fig. \ref{multiplot_MvsP_1.5} (top graph) and \ref{multiplot_MvsP_2}). To be consistent with Mayor et al. 2011, we limit the period (in days) to $10'000$. We then apply their detection propability and determine which planet would be statistically detected and considered as observed (see Fig. \ref{multiplot_MvsP_1.5} bottom graph). We note that for $Z_{\rm tot} = 0.011$ (meaning $Z_{\rm peb} = 0.01$ and $Z_{\rm dust} = 0.001$ and represented by black dots) the planets are too small in mass to be detected. Since we observe planets with radial velocity higher than 20 m/s to compare with Johnson et al. 2010, we do not detect the small planets interior to 1 AU as well. The pile up we see in both figures on the left side represents the planets that might have migrated into the star and therefore, that are not observable. We compare the mass distribution from our models and Mayor et al. 2011 observations in Fig. \ref{Massfunction_multiplot}. We only take into account the data of Mayor et al. 2011 for planets with final location beyond 0.1 AU to be consistant with the inner edge of the disc in our model. \begin{figure} \hspace{0cm} \includegraphics[height=0.35\textheight,angle=0,width=0.35\textheight]{multiplot_1_5Myr.pdf} \caption{Mass of the planets as a function of their period for starting time of the embryos of $\rm t = 1.5$ Myr. The plot on the top represents all planets formed and the bottom one the planets that are considered to be observed once the detection probability of Mayor et al. 2011 is applied. The color code expresses the total amount of solids.} \label{multiplot_MvsP_1.5} \end{figure} \begin{figure} \hspace{0cm} \includegraphics[height=0.35\textheight,angle=0,width=0.35\textheight]{multiplot_2Myr.pdf} \caption{Mass of all the formed planets as a function of their period for starting time of the embryos of $\rm t = 2 $ Myr.} \label{multiplot_MvsP_2} \end{figure} Observations (green line) show a high fraction of planets with masses around $10$ $\rm M_{\oplus}$ that our simulations (black line and purple line) do not reproduce. The black line takes all the planets beyond 0.1 AU into account. It shows a high fraction of Earth mass planets. However, essentially all of them are not observable (purple line) as their mass is too small given their location for them to be detected. Regardless of the starting time applied, only giant planets are detected. However the masses of these planets differ between the two starting times: more massive planets form when embryos are placed after 1.5 Myr and less massive planets form when starting after 2 Myr. This can be explained by the fact that planets starting at 1.5 Myr have more time to grow.\\ \begin{figure} \hspace{0cm} \includegraphics[height=0.35\textheight,angle=0,width=0.35\textheight]{multilpot_Massfunction_with_allplanets.pdf} \caption{Mass function of our simulations using the B15b approach compared with the results presented in Mayor et al. 2011 (for planets with $a_{\rm final} > 0.1$ AU). The upper graph represents the simulations with embryos starting at $\rm t = 1.5 $ Myr of the evolution of the disc and the lower one the embryos starting after $\rm t = 2$ Myr. The green line represents the results presented in Mayor et al. 2011, the black line shows all the planets we form beyond 0.1 AU and the purple one indicates the planets considered as observed once the detection probability is applied.} \label{Massfunction_multiplot} \end{figure} \section{Internal structure for the planetary atmosphere} \label{Differentinternalstructure} In the B15b model the internal structure is not computed: once the planet has reached $\rm M_{\rm iso}$, a contraction phase begins as long as $M_{\rm env}$ is smaller as $M_{\rm core}$. Then a rapid gas accretion phase starts following Machida et al. 2010 (see section \ref{pebble_accretion}). Therefore the accretion rate onto a small mass planet can be very large. In reality, if $\rm M_{\rm iso}$ is small, once it is reached, the contraction of the envelope produces some luminosity that needs to be taken into account and that slows down gas accretion. We thus decided to compute the internal structure of the planet to assess its importance. Instead of using the values given in B15b, we now solve the following equations: \begin{equation} \frac{dm}{dr}= 4 \pi r^2 \rho, \label{massconservation} \end{equation} \begin{equation} \frac{dP}{dr} = - \frac{Gm}{r^2} \rho, \label{evolutionofpressurewithdepth} \end{equation} and \begin{equation} \frac{dT}{dr}= \frac{T}{P} \frac{dP}{dr} \nabla, \label{energytransfer} \end{equation} which represent the mass conservation, the equation of hydro-equilibrium and energy transfer respectively (Alibert 2016). $\nabla = \frac{d \rm ln(T)}{d \rm ln(P)} = \rm min(\nabla_{\rm ad}, \nabla_{\rm rad})$ where \begin{equation} \nabla_{\rm ad} = \frac{\partial \rm ln(T)}{\partial \rm ln(P)} , \end{equation} \begin{equation} \nabla_{\rm rad} = \frac{3}{64 \pi \sigma G} \frac{\kappa l P}{T^4 m}, \end{equation} with $l$ being the luminosity of the planet computed by energy conservation and including the solid accretion luminosity, the gas contraction luminosity and the gas and core accretion luminosity (Mordasini et al. 2012, Alibert et al. 2013). $\kappa$ is the full interstellar opacity\footnote{A discussion on the opacity is provided in section \ref{effectofopacity}}. Computing the internal structure at each timestep by solving the previous equations, the accretion rate onto the planet is automatically determined by the difference in the envelope mass at two consecutive timesteps (Alibert et al. 2005).\\ The influence of the internal structure can be seen in Fig. \ref{Tracks_2internalstruc_comparison} which shows growth tracks for different starting locations. These tracks are similar for both approaches (B15b approach and solving the internal structure equations for the atmosphere) until the planets reach the isolation mass. Below $\rm M_{\rm iso}$ the accretion rate of solids is very high, therefore there is little gas. Thus how this little amount of gas is computed has no real influence when we look at the total planetary mass. Planets starting at large distances don't grow massive enough for internal structure to affect the formation tracks. Finally, it is for the planets starting between 5 and 15 AU that the internal structure effects are the most noticeable. This comes from the fact that B15b assumes a rapid gas accretion once the isolation mass is reached, independently of the mass. Focusing on the planet starting at 5 AU, the isolation mass is $\sim 2.5$ $\rm M_{\oplus}$. Using B15b approach, once $M_{\rm iso}$ is reached, the accretion is huge and a final mass of $\sim 95$ $\rm M_{\oplus}$ is obtained, while computing the internal structure produces a planet with a mass of $\sim 2.5$ $\rm M_{\oplus}$. \begin{figure} \hspace{0cm} \includegraphics[height=0.35\textheight,angle=0,width=0.35\textheight]{tracks_2structures_withenvelopemass.pdf} \caption{Growth tracks for planet starting at different locations. The purple curves show the growth of the planets using B15b approach and the green curves express the results solving the internal structure equations given in section \ref{Differentinternalstructure}. The dotted lines represent the envelope mass of each planet for both cases.} \label{Tracks_2internalstruc_comparison} \end{figure} \subsection{Comparison with observations} \label{Differentinternalstructure_comparisonwithobs} A whole new set of simulations is computed with the solving of the internal structure equations while keeping all other parameters constant. \\ The mass of the formed planets is given as a function of orbital period for starting times of the embryos of 1.5 and 2 Myr (see Fig. \ref{multiplot_MvsP_1.5_otherint_struc} and \ref{multiplot_MvsP_2_otherint_struc}) and it can again be observed that the higher the amount of solids, the bigger the planets, like we concluded with the B15b approach (Fig. \ref{multiplot_MvsP_1.5} and \ref{multiplot_MvsP_2}). Comparing Fig. \ref{multiplot_MvsP_1.5_otherint_struc} and \ref{multiplot_MvsP_2_otherint_struc} with the two former plots, we see that the masses of the planets are much smaller. This is due to the fact that solving the equations for the internal structure results is an additional energy source related to envelope contraction which will slow down gas accretion. Therefore small cores that have reached the isolation mass cannot accrete a huge amount of gas efficiently.\\ The internal structure also decreases the amount of planets remaining beyond 0.1 AU from the star. The formed planets are not big enough to open a gap in the disc and to migrate in type II. They thus migrate with type I migration which is rapid and makes most of them fall into the star. \\ Focusing on the mass of the formed planets, the difference with the B15b approach is not negligible. This is highlighted in Fig. \ref{Massfunction_multiplot_otherinternalstructure} which shows the fraction of observable planets as a fonction of their mass, for final semi-major axis beyond 0.1 AU. A high amount of Neptune mass planets and a total absence of giants are seen here. This result is completely opposite to the one obtained using B15b approach (see Fig. \ref{Massfunction_multiplot}). \begin{figure} \hspace{0cm} \includegraphics[height=0.35\textheight,angle=0,width=0.35\textheight]{multiplot_1_5Myr_otherintstruc.pdf} \caption{Mass of the planets as a function of their period for starting time of the embryos of $\rm t = 1.5$ Myr. These results include the internal structure as presented in section \ref{Differentinternalstructure}.} \label{multiplot_MvsP_1.5_otherint_struc} \end{figure} \begin{figure} \hspace{0cm} \includegraphics[height=0.35\textheight,angle=0,width=0.35\textheight]{multiplot_2Myr_otherintstruc.pdf} \caption{Same as Fig. \ref{multiplot_MvsP_1.5_otherint_struc} but for starting time of the embryos of $\rm t = 2$ Myr. The internal structure equations are computed here as well.} \label{multiplot_MvsP_2_otherint_struc} \end{figure} \begin{figure} \hspace{0cm} \includegraphics[height=0.35\textheight,angle=0,width=0.35\textheight]{multilpot_Massfunction_with_allplanets_otherinternalstructure.pdf} \caption{Mass function of the planets having an internal structure compared with the results presented in Mayor et al. 2011 (for planets with $a_{\rm final} > 0.1$ AU). The upper graph represents the simulations with embryos starting at $\rm t = 1.5$ Myr of the evolution of the disc and the lower one the embryos starting after $\rm t = 2$ Myr.} \label{Massfunction_multiplot_otherinternalstructure} \end{figure} \subsection{Effect of the starting time of the embryo} As we said in section \ref{pebble_accretion}, we assume that the embryos in the disc have already formed through streaming instability, at a given time that is a free parameter of the model. This initial time has an impact on the type of formed planets but also on the amount of planets remaining beyond 0.1 AU (see Table \ref{Tableau_pourcent}). Even though the percentage of surviving planets is quite low when assuming early formation times for the embryos (0, 0.5 Myr), we decide to compare the type of formed planets for different starting times computing the internal structure and to compare those results with the ones for the B15b approach.\\ \begin{figure} \hspace{0cm} \includegraphics[height=0.35\textheight,angle=0,width=0.35\textheight]{multilpot_Massfunction_allstartingtimes.pdf} \caption{Comparison of mass functions for two different models and starting times (the detection probability of Mayor et al. 2011 is applied for both graphs). The upper plot represents the model computing the internal structure equations. It shows that decreasing the starting time of the embryos, for instance from 1.5 Myr to 1 Myr, allows the appearance of some giants. The bottom plot represents the B15b approach. We see here that decreasing the starting time of the embryos does not have a huge impact since mainly giant planets formed with this model.} \label{multiplot_massfunction_allstartingtimes} \end{figure} Fig. \ref{multiplot_massfunction_allstartingtimes} (upper plot) shows the mass distribution of planets formed as a function of the embryo starting time. We see that an early start favours the formation of more massive planets. We concluded in section \ref{Differentinternalstructure_comparisonwithobs} that solving the internal structure equations mainly formed Neptune mass planets and practically no giants. With the upper plot of Fig. \ref{multiplot_massfunction_allstartingtimes} we see that inserting our embryos earlier in the disc evolution, for instance at $\rm t_{\rm ini} = 1$ Myr, would give them more time to grow and thus allow to form giant planets. \\ For comparison, in the B15b approach the mass distribution of the planets remains quite similar for $\rm t_{\rm ini} = 1$ Myr or $1.5$ Myr (see Fig. \ref{multiplot_massfunction_allstartingtimes} (bottom plot)). \\ The results for $\rm t_{\rm ini} = 0.5$ Myr computing the internal structure need to be considered with caution due to the high amount of planets ending into the star (see Table \ref{Tableau_pourcent_WITH_IS}). The percentages shown in Table \ref{Tableau_pourcent_WITH_IS} can be compared with Table \ref{Tableau_pourcent} which labelled the amount of planets falling into the star for the B15b approach. We see that in both cases, the earlier the embryos are inserted, the more planets fall into the star.\\ \begin{table} \centering \caption{\label{Tableau_pourcent_WITH_IS} Percentages of planets lost in the star (closer than 0.1 AU) according to the different starting times of the seed for the model with an internal structure.} \begin{tabular}{|c|c|} \hline Starting times & \% of planets ending in the star \\ \hline 0.5 Myr & 78 \% \\ \hline 1 Myr & 67 \% \\ \hline 1.5 Myr & 53 \% \\ \hline 2 Myr & 32 \% \\ \hline \end{tabular} \end{table} \subsection{Effect of the opacity} \label{effectofopacity} Another alternative to form giants is by reducing the opacity of the planet atmosphere. This opacity can be separated into a gas and a grain component. The gas part remains unchanged. In our nominal case the grain part is provided by the full interstellar grain opacity (Lin \& Bell, 1994). We now apply a reduction factor $\rm f_{\rm opa}$ on the grain opacity which will influence the envelope mass and the planet formation timescale (Mordasini et al. 2014). The reason behind this reduction is that, once $M_{\rm iso}$ is reached, the velocity of the gas outside the planet's orbit becomes super-Keplerian, halting the drift of pebbles. Therefore the gas accreted by the planet will contain a reduced amount of solids (Bitsch \& Johansen 2016). The resulting consequence is that, if $\rm f_{\rm opa}$ is used, the grain opacity is then smaller leading to a shorter formation timescale (Ikoma et al. 2000) and a bigger envelope mass (Mordasini et al. 2014). Fig. \ref{massfunction_smalleropacity} confirms this tendency. It shows that using the model computing the internal structure and reducing the opacity will lead to a change in the mass distribution of planets. The fraction of planets with masses larger than 20 $M_{\oplus}$ is significant and a large amount of giant planets are observable for both starting times. This is in better agreement with observations (Mayor et al. 2011) and we therefore use this model for the following section (section \ref{metallicity}).\\ Reducing the opacity for the B15b approach we see (Fig. \ref{massfunction_B15_smalleropacity}) that the mass distribution of formed planets does not differ. This leads us to the conclusion that the main difference in the types of formed planets between the two models (B15b approach and computing the internal structure) comes from the internal structure and not the opacity. \begin{figure} \hspace{0cm} \includegraphics[height=0.35\textheight,angle=0,width=0.35\textheight]{multiplot_Massfunction_smalleropacity.pdf} \caption{We compare here the type of formed planets using the nominal case grain opacity (which is the full interstellar one) and a reduced one (by a factor $\rm f_{\rm opa} = 0.01$) for the model computing the internal structure. The upper plot is for a starting of $\rm t = 1.5$ Myr and the bottom one for $\rm t = 2 $ Myr. The green line represents the results of Mayor et al. 2011 for planets beyond 0.1 AU for comparison. } \label{massfunction_smalleropacity} \end{figure} \begin{figure} \hspace{0cm} \includegraphics[height=0.35\textheight,angle=0,width=0.35\textheight]{multiplot_Massfunction_B15smalleropacity.pdf} \caption{We compare here the B15b approach for the regular fixed opacity ($\kappa = 0.05$) given in their model and a reduced one by a factor $\rm f_{\rm opa} = 0.01$ leading to $\kappa = 0.0005$. The upper plot is for a starting of $\rm t = 1.5$ Myr and the bottom one for $\rm t = 2 $ Myr. } \label{massfunction_B15_smalleropacity} \end{figure} \section{Metallicity effect} \label{metallicity} We now want to discuss the well established metallicity effect for our internal structure model with a reduced opacity. We chose the solar value $ Z_{\rm tot} = 0.02$ to be the reference value for which $\rm[Fe/H] = 0$ (Anders \& Grevesse, 1989). We vary $Z_{\rm tot} = Z_{\rm peb} + Z_{\rm dust}$ and run simulations for each starting time of the seeds. In Fig. \ref{KrvIS} we plot the fraction of planets that have a radial velocity higher than 20 m/s as a function of the metallicity of the star. This radial velocity corresponds to the value used by Johnson et al. 2010, with which we compare our results. As given in Johnson et al. 2010 the fraction of stars with giant planets as a function of metallicity, based on their radial velocity measurements, follows: \begin{equation} f = (0.07 \pm 0.01) \cdot (M_{\rm star} / M_{\odot})^{(1.0 \pm 0.3)} \cdot 10^{(1.2 \pm 0.2) \rm[Fe/H]}, \label{Johnson} \end{equation} where, in our case, $M_{\rm star} = M_{\odot}$. In our figure, the red line takes all formed planets into account. The percentages are then higher than the blue curve, which represents the planets that are statistically observed, once the detection probability of Mayor et al. 2011 is applied. Eq. \ref{Johnson} (Johnson et al. 2010) is given by the black curve and matches well with our simulations.\\ The general tendency that can be observed in Fig. \ref{KrvIS} is that the amount of giant planets increases with metallicity. For metallicities up to $\rm[Fe/H] = 0.3$, no planet with radial velocity higher than 20 m/s remains beyond 0.1 AU, and thus can be observable. This is related, as mentionned in section \ref{Formation_tracks}, to the inverse correlation between dust amount and migration rate. Indeed, focusing on a smaller metallicity (for exemple $\rm [Fe/H] = 0.2$) and comparing the red and blue curves, we see that a fraction of formed planets (red curve) may be lost in the star (difference between red and blue).\\ Fig. \ref{KrvB15} is similar to Fig. \ref{KrvIS} but using the B15b approach. The general tendency already observed in Fig. \ref{KrvIS} that the higher the metallicity, the more massive the planets, is also verified with this model (see also Ndugu et al. 2017). The main difference comes from the fact that, when all the planets are taken into account, a huge fraction of them have a radial velocity higher than 20 m/s. Thus the blue curves (for observable planets) fit the curve given by Johnson et al. 2010 but the red one (all planets) shows much higher percentages. This indicates that, using the B15b approach, a lot of giants form (since gas accretion is huge once $\rm M_{\rm iso}$ is reached) but most of them are lost into the star. \\ The dotted line in the upper plot of Fig. \ref{KrvB15} includes the effect of the metallicity on the disc lifetime. Our model has a disc lifetime that is randomly chosen between 2 and 5 Myr (Haish et al. 2001b, see section \ref{Initialconditions}) and does not take the impact of the metallicity into account. Based on Yasui et al. 2010, a low disc metallicity may cause a rapid disc dispersal via photoevaporation. In order to test the impact of the metallicity on the disc lifetime we set the solar metallicity disc lifetime to 3 Myr and multiply by $10^{[Fe/H]}$ in order to get the other lifetimes. For high metallicites (from $\rm Z_{\rm tot}$ = 0.033 to 0.11) the disc lifetimes go from 4.95 Myr up to 16.5 Myr, leading to larger planets but more than 90\% of them migrate to the inner egde of the disc. The surviving planets are contained within 0.2 AU. For low metallicity ($\rm Z_{\rm tot}$ = 0.011), the disc lifetime is 1.65 Myr and planets don't grow much since they are inserted in the disc after 1.5 Myr. They therefore remain with masses of the order of $10^{-3}$ $\rm M_{\oplus}$, near their initial location. Despite this difference in the population, the amount of planets with a radial velocity higher than 20 m/s as a function of the metallicity looks similar to what we obtain with the nominal model (see Fig. \ref{KrvB15}, upper plot). The higher the metallicity, the higher the amount of planets with radial velocity larger than 20 m/s. The percentages for planets beyond 0.1 AU (dotted blue line) seems however less influenced by the increase in metallicity, but only a very few of the planets remain beyond the inner edge of the disc. We can conclude that both models show an impact of the metallicity. \begin{figure} \hspace{0cm} \includegraphics[height=0.35\textheight,angle=0,width=0.35\textheight]{multiplot_krv_smalleropacity.pdf} \caption{Fraction of planets with radial velocity higher than 20 m/s as a function of the metallicity for the model computing the internal structure with a reduced opacity. The top plot is for seeds starting after 1.5 Myr of the disc evolution and the bottom one for $\rm t_{\rm ini} = 2$ Myr. The red line shows the percentages of planets with a radial velocity higher than 20 m/s. The blue line is the percentages of planets that has a radial velocity higher than 20 m/s and that can be observable according to the detection probability of Mayor et al. 2011. The black line represents the observation fit given by Johnson et al. 2010 (Eq. \ref{Johnson}) and the grey area the uncertainty on this fit. } \label{KrvIS} \end{figure} \begin{figure} \hspace{0cm} \includegraphics[height=0.35\textheight,angle=0,width=0.35\textheight]{multiplot_krv_bitschopacity.pdf} \caption{Same as in Fig. \ref{KrvIS} but with the B15b approach. The dotted lines take the disc dispersal according to [Fe/H] into account.} \label{KrvB15} \end{figure} \section{Discussion and conclusion} \label{conclusion} In this work we provide an updated pebble-based planet formation model. We use the disc model given by Bitsch et al. 2015a and first test our computations by intending to reproduce their results. Aiming at this we noticed that the equation used to compute the flux of pebbles in B15b is not correct, as confirmed later on by B. Bitsch (private communication, Bitsch et al. 2017). Using the correct equation translates in the formation of very small mass planets, at least when the fraction of the total amount of solids taking part in the formation of pebbles is the same as in B15b ($Z_{\rm peb} = 2/3 \cdot Z_{\rm tot}$). Adopting the correct pebble flux equation therefore requires assuming that a larger fraction of the heavy elements takes part in the formation of pebbles ($Z_{\rm peb} / Z_{\rm tot} = 0.9$) in order to form massive enough planets.\\ Using this approach we study the impact of the amount of pebbles ($Z_{\rm peb}$) as well as the amount of dust ($Z_{\rm dust}$). The latter impacts not only the disc structure but also the growth of the planets through the isolation mass. $Z_{\rm peb}$ influences the surface density of pebbles and thus the planet growth. We show that increasing the density of pebbles favours the formation of massive planets. However the amount of dust should not be too small otherwise migration is too efficient and planets fall into the star. We therefore see that the changes in the disc properties (through $Z_{\rm tot}$ and thus $Z_{\rm dust}$) lead to a large diversity of outcomes. This is similar to Ida et al. 2016 where the boundaries in the disc (affected by the disc properties) have a strong influence on the results. \\ Using a population synthesis approach we then compute simulations and compare our results with observations (Mayor et al. 2011). The latter indicates a high fraction of Neptune mass planets that we do not reproduce. Indeed our mass distribution is such that most of the detectable planets are giant planets. This significant amount of giants come from the fact that in the B15b model, there is no internal structure. Indeed once the isolation mass is reached a huge amount of gas is accreted. In reality, once the planet reaches $\rm M_{\rm iso}$, the envelope contracts, producing some luminosity that will slow down gas accretion.\\ Computing the internal structure for the planetary atmosphere we produce another full set of simulations. We obtain a high amount of Neptune mass planets and a lack of giant planets. To recover an acceptable number of giant planets, we consider two different parameters: the starting time of the seeds and the opacity of the planetary atmosphere.\\ The starting time may indeed have a considerable impact on the outcome of the simulation, as shown by Chamber 2016. Studying the outcomes of planetary systems, they show that the embryos should have a mass between $10^{-3}$ to $10^{-2}$ $M_{\oplus}$ at 1.5 Myr and 2 Myr of their evolution to accrete efficiently and eventually grow to giant planets. In our model, we do not compute the growth of the embryos but insert them at later times (1.5 Myr and 2 Myr) with masses that are consistant with their results. Therefore the masses the embryos have at a given time influence the final planetary architecture for multiple-planets systems (Chambers 2016, Levison et al. 2015) as well as for single planet cases (this work). We highlight that inserting our embryos earlier in the disc evolution, for instance at $\rm t_{\rm ini} = 1$ Myr, would give them more time to grow and help forming giant planets. Reducing the opacity also increases the amount of giants and the resulting type of formed planets is in good agreement with observations (Fig. \ref{massfunction_smalleropacity}).\\ We thus use this last model to discuss the metallicity effect. We show that the amount of giant planets increases with the metallicity and that the B15b approach also reproduces this effect.\\ The main difference between the B15b approach and our model (with the internal structure and a reduced opacity) is the fact that we compute an internal structure for the planetary atmosphere. We conclude that computing the internal structure and reducing the opacity is more realistic and reproduces better the mass distribution of the observed planets (Mayor et al. 2011). However the replenishment of the envelope with the surrounding gas disc is not taken into account here which may lead to a more sophisticated model (Lambrechts \& Lega 2017, Brouwers et al. 2017).\\ Finally we should also keep in mind that our simulations are performed with one planet per disc and thus the eventual effects of several planets growing in the same disc are not taken into account, which we leave for future work (Coleman et al. in prep.), as well as long-term evolution, which is essential in order to compute the present day radius of planets. In addition, for planets close enough to the star, and of intermediate mass, evaporation needs to be taken into account (Mordasini et al. 2012). \acknowledgements This work has been carried out within the frame of the National Centre for Competence in Research PlanetS supported by the Swiss National Science Foundation. The authors acknowledge the financial support of the SNSF. We thank Gavin Coleman for helpful comments as well as Yuhito Shibaike. The authors also would like to thank B. Bitsch and the referee for their comments.
\section*{References} \end{small} \input{introduction} \input{implementation} \input{tracking} \input{example} \input{validation} \input{conclusions} \section{Acknowledgements} The development of BDSIM has received funding from the John Adams Institute at Royal Holloway. This work was supported by Science and Technology Research council grant ``The John Adams Institute for Accelerator Science'' ST/P00203X/1 and Impact Acceleration Account. It was also supported in part by EU FP7 EuCARD-2, Grant Agreement 312453 (WP13, ANAC2) and STFC, United Kingdom. Thank you to J.~Albrecht, S.~E.~Alden, D.~Brewer, A.~Cooper, W.~Parker, J.~Van~Oers, M. Porter and S.~Williams for their contributions and testing. \bibliographystyle{elsarticle-num} \section{Conclusions} \label{sec:conclusions} BDSIM is an open source C++ code that makes use of widely used and current high energy physics software to provide a mixed 3D and accelerator tracking simulation suitable for predicting the radiation in and around an accelerator. It provides a unique capability to accurately simulate radiation transport in an accelerator environment. It significantly simplifies the construction of a 3D Geant4 model by providing a library of generic but scalable accelerator components as well as the appropriate fields and numerical integrators for the most accurate particle tracking. Additional thin elements such as multipoles and magnet fringe elements ensure accurate magnetic tracking that matches the most commonly used accelerator tracking codes. Furthermore, the ability to track all particles through the accelerator with arbitrary step sizes is unique and allows prediction of the radiation transmitted through and around an accelerator. The data format and provided analysis tools are built on ROOT, software used commonly in particle physics, that is highly scalable and suitable for long term data storage and very large data quantities. The included Python utilities allow preparation of models in minutes that would normally take several weeks to prepare manually and are easily extendable with further user input and customisation. As BDSIM as well as all of its dependencies are open source, the program is highly transparent to the user with complete and regularly updated documentation. Furthermore, the software can be easily extended with user's C++ code. BDSIM has been engineered to be applicable to both the lowest and highest energy accelerators in use today. It provides a unique ability to perform a mixed accelerator and radiation transport simulation as well as remove many obstacles for developing a beam line model. The software was written in a way to support the widest set of simulations and beam lines. \section{Example} \label{sec:example} To demonstrate the capabilities and unique features of BDSIM, an example model is provided and illustrated here. The model is of a fictional accelerator that demonstrates many features found in a variety of real accelerators. The model consists of a 4\,km racetrack ring with two straight sections that include a low-$\beta$ collision point and a high beta collimation section. Each insertion has a 3-cell half-dipole-strength dispersion suppressor on each side. The most relevant parameters are shown in Table~\ref{tab:modelmodelparams}. The model and all materials required to prepare it are included with BDSIM as a worked example called `model-model'. A schematic layout is shown in Figure~\ref{fig:examplelayout}. \begin{figure} \centering \includegraphics[width=8.5cm]{figure6.pdf} \caption{\label{fig:examplelayout} Layout of the example model with race track design including two arc sections, and two insertion regions: `IR-collimation' and `IR-lowbeta'. Between each arc and an insertion region there is a dispersion suppressor `DS'. The interaction point `IP' is where the beam is focussed to a minimum size.} \end{figure} \begin{table} \centering \caption{\label{tab:modelmodelparams} Defining parameters of example model.} \begin{tabular}{l l} \hline \hline Parameter & Value \\ \hline Particle & proton \\ Energy & 100\,GeV \\ Length & 4\,km \\ Dipole bending radius & 221.5\,m \\ $\epsilon_{N\,x,y}$ & 1\,mm\,mrad \\ Collimators & 10 \\ Dipoles & 256 \\ Quadrupoles & 252 \\ $\beta^{\ast}_{x,y}\*$ & 2.517\,m \\ \hline \hline \end{tabular} \end{table} The model was created in {MAD\textendash X}{}~\cite{MADX-website} and optical functions as calculated by {MAD\textendash X}{} are shown in Figure~\ref{fig:modeloptics}. The low-$\beta$ straight section is designed to create a small symmetric focus of the beam suitable for a collision point with potentially another beam or gas target. The other insertion is designed to expand the beam suitable for collimation or scraping of the beam. \begin{figure*} \normalsize \centering \includegraphics[width=0.95\textwidth]{figure7.pdf} \caption{\label{fig:modeloptics}{MAD\textendash X}{} linear lattice functions of the example model. The two insertion regions can be seen with reduced horizontal dispersion (\emph{red dashed}). The first insertion creates a small symmetric beam suitable for collision with another beam or gas target. The second insertion produces a large beam size suitable for collimation. The schematic at the top of the plot depicts each magnet type in the accelerator (blue: dipoles; red: quadrupoles, yellow: sextupoles, black: collimator).} \end{figure*} To prepare a BDSIM model an output version is first made from {MAD\textendash X}{} using the TWISS command that produces a sequential one-to-one representation of the machine in an ASCII file. This is trivially converted to BDSIM input format GMAD using a provided Python converter \texttt{pybdsim}. Any additional information not specified in this file such as aperture or collimation settings can be included in this conversion with user-supplied Python dictionaries. There is no standard format of auxiliary information about an accelerator so loading this information is left to the user, however Python is a widely used language for which many data loading and processing libraries exist. The automatically converted model includes a Gaussian beam distribution as parameterised by the Twiss parameters from the first element in the sequence and beam information from the header. This fully functional BDSIM model created in minutes acts as a starting point that can then be customised. Figure~\ref{fig:modelvisualisation} shows the 3D visualisation of part of the model in BDSIM and Figure~\ref{fig:modelvisualisation2} shows the magnets from part of a unit cell in the arc. \begin{figure} \normalsize \centering \includegraphics[width=8.5cm]{figure8.png} \caption{\label{fig:modelvisualisation}Visualisation of the example model in BDSIM using the Geant4 Qt visualiser. Only part of the machine is visualised showing a single proton impact and secondaries (colour coded by charge). The optional tunnel is automatically built by BDSIM to follow the beam line.} \end{figure} \begin{figure} \normalsize \centering \includegraphics[width=8.5cm]{figure9.png} \caption{\label{fig:modelvisualisation2}Visualisation of four magnets from the unit cell in the arcs of the example model in BDSIM. From left to right, a sextupole, quadrupole and two sector bends (dipoles) can be seen using the generic geometry provided by BDSIM.} \end{figure} This {MAD\textendash X}{} model includes only basic information about the collimators such as their length and perhaps an aperture description, however excludes material definition. The extra required information is provided in an included text file that specifies collimator openings as a specific number of $\sigma$ in the beam distribution at that point as well as material definition. This is used as an example of including extra information into the model conversion and preparation process that could come from an external source. Table~\ref{tab:collimatorsigmas} illustrates the general settings used in the 3-stage collimation system that has `primary', `secondary' and `tertiary' collimators that are placed at successively greater distances from the beam. Each collimator consists of a rectangular aperture with a narrow opening in one dimension and a more open one in the other that is designed not to impede the beam. \begin{table} \centering \caption{\label{tab:collimatorsigmas} Collimator openings in beam $\sigma$. The `open' setting is used for the aperture in the non-collimating plane.} \begin{tabular}{l c} \hline \hline Collimator Type & $\sigma$ opening \\ \hline primary & 6 \\ secondary & 7 \\ tertiary & 8 \\ open & 40 \\ \hline \hline \end{tabular} \end{table} These conceptual settings are used in combination with the {MAD\textendash X}{} optical functions to calculate absolute collimator openings in millimetres using an included Python script. These are shown in Table~\ref{tab:collimatorgaps}. \begin{table} \centering \caption{\label{tab:collimatorgaps}Collimator half openings as calculated from a given beam $\sigma$ and the optical functions at each collimator location. Primary collimators are composed of carbon, secondary collimators copper and tertiary absorbers tungsten that are typical of high energy proton collimation systems with increasing atomic Z.} \begin{tabular}{l c c c} \hline \hline Name & Material & $\Delta_{x}$ (cm) & $\Delta_{y}$ (cm) \\ \hline COLPRIMY & C & 3.174 & 2.660 \\ COLSECY & Cu & 5.891 & 3.681 \\ COLPRIMX & C & 3.133 & 6.066 \\ COLSECX & Cu & 3.157 & 3.250 \\ COLTERT & W & 1.434 & 4.437 \\ COLTERT2 & W & 0.801 & 0.613 \\ COLTERT3 & W & 0.523 & 0.584 \\ \hline \hline \end{tabular} \end{table} The model is prepared using the included \texttt{pybdsim} converter. This allows the extra information for collimators to be included as a Python dictionary that is prepared from the text file. The converter also allows the inclusion of aperture information loaded from a {MAD\textendash X}{} TFS file using \texttt{pybdsim}. The classes for aperture loading in \texttt{pybdsim} also permit aperture filtering and substitution. The conversion is shown below where `cols' is a Python dictionary of collimator information by name. \begin{lstlisting}[language=Python] import pybdsim import pymadx ap = pymadx.Data.Aperture(`ring_aperture.tfs') ap = ap.RemoveBelowValue(0.005) cols = pybdsim.Data.Load(`collimatorSettings.dat') pybdsim.Convert.MadxTfs2Gmad(`ring.tfs', `bdsim-model', aperturedict=ap, collimatordict=cols) \end{lstlisting} The user may use the converted model immediately, edit it to their needs or include the automatically produced GMAD files in their own models. Including the files in a user-written model allows the model to be safely regenerated at any point without losing any user-defined input. After preparation of a model, the first step is to validate the optical functions of the BDSIM model to ensure correct preparation. To generate optical functions, the automatically provided Gaussian beam distribution according to the Twiss parameters at the start of the machine is used. The beam distribution is sampled after each element in the BDSIM model by including the sampler command in the input gmad: \begin{lstlisting} sample, all; \end{lstlisting} To estimate the optical functions, approximately 1\textendash{}10 thousand particles should be simulated. The model is run with the command: \begin{lstlisting} bdsim --file=bdsim-model.gmad --outfile=optics1 --batch --ngenerate=1000 --circular \end{lstlisting} The output ROOT format file `optics1.root' is analysed by an included tool \texttt{rebdsimOptics} that calculates the optical functions as well as the associated statistical uncertainty from the finite population at each sampler is also calculated. \begin{lstlisting} rebdsimOptics optics1.root opticalfunctions.root \end{lstlisting} These are calculated by accumulating 1\textendash{}4$^{th}$ order power sums and calculating various moments of the distribution. The statistical uncertainty reduces with the number of particles simulated and it is recommended to simulate at least 1000 for a meaningful comparison. \texttt{rebdsimOptics} produces another ROOT format file with the optical function data. The optical functions as calculated from BDSIM can be compared using \texttt{pybdsim}. In this case, we compare against the original {MAD\textendash X}{} optical functions the model was prepared from using the following command: \begin{lstlisting} pybdsim.Compare.MadxVsBDSIM(`ring.tfs', `opticalfunctions.root') \end{lstlisting} This produces a series of plots that compare $\bar{x}$, $\bar{y}$, $\sigma_{x, y}$, $\sigma_{x', y'}$, $D_{x,x'}$, $D_{y,y'}$, $\alpha_{x, y}$ and $\beta_{x, y}$, as well as the transmission. An example is shown in Figure~\ref{fig:opticscomparison}. \begin{figure*} \normalsize \centering \includegraphics[width=0.95\textwidth]{figure10.pdf} \caption{\label{fig:opticscomparison}Example machine optical comparison of beam size calculated from {MAD\textendash X}{} optical functions, emittance and energy spread with that simulated by BDSIM showing agreement. The beam size in the arc sections is dominated by the dispersion contribution. The schematic at the top of the plot depicts each magnet type in the accelerator and follows the sequence around the ring.} \end{figure*} When simulating the optical functions, ideally no particles are lost as this would affect the shape of the beam distribution and the validity of comparing $\sigma$ of the distribution. However, once validated and a physics study is desired, the lack of beam loss makes the simulation very inefficient. For example, to witness an event at 6\,$\sigma$, approximately 500 million events would be required on average to be simulated. Therefore, it is logical to select a distribution of primary particles that will collide with the accelerator or exhibit the desired interaction. BDSIM includes a variety of bunch distribution generators for this purpose. For this example, the intent is to evaluate the performance of the collimation system. Any beam that exists grossly outside the collimator aperture will be immediately lost within one revolution in a circular machine. Similarly, any particle largely inside the collimator aperture will not intercept the collimator. We therefore simulate a thin annulus in phase space that aligns with the edge of the collimator closest to the beam. Such a distribution is provided by the `halo' distribution in BDSIM. This generates particles uniformly in a given phase space volume and accepts or rejects the particle depending on its single particle emittance. Furthermore, spatial limits are provided that allow the phase space to be reduced. An example input distribution is shown in Figure~\ref{fig:phasespace}. \begin{figure*} \centering \includegraphics[width=0.95\textwidth]{figure11.pdf} \caption{\label{fig:phasespace}Example phase space distribution for a beam loss simulation using the `halo' distribution based on the Twiss parameters at the entrance to the primary horizontal collimator. The horizontal phase space (\textit{left}) is designed to intercept a horizontally orientated 2 jaw collimator, whereas the vertical phase space (\textit{centre}) is the unaltered distribution according to the Twiss parameters. The combination of the two spatially is shown (\textit{right}). The distribution is exaggerated here with a greater spread in $\sigma$ than is required to make the shape clear. The horizontal phase space is clipped such that only particles with $x > 5.7\sigma$ are produced.} \end{figure*} \iffalse \begin{figure*} \centering \begin{subfigure}[b]{0.28\textwidth} \includegraphics[height=4cm]{figures/phasespace-xxp.pdf} \caption{Horizontal phase space} \label{fig:phasespace:xxp} \end{subfigure} \begin{subfigure}[b]{0.28\textwidth} \includegraphics[height=4cm]{figures/phasespace-yyp.pdf} \caption{Vertical phase space} \label{fig:phasespace:yyp} \end{subfigure} \begin{subfigure}[b]{0.38\textwidth} \includegraphics[height=4cm]{figures/phasespace-xy.pdf} \caption{Horizontal and vertical} \label{fig:phasespace:xy} \end{subfigure} \caption{\label{fig:phasespace}Example phase space for a beam loss simulation using a halo distribution. The horizontal phase space in \ref{fig:phasespace:xxp} is designed to intercept a horizontal two-jaw collimator. The vertical phase space in \ref{fig:phasespace:yyp} is the normal Gaussian distribution given the optical functions at that point in the machine. The combined $x-y$ spatial distribution is shown in \ref{fig:phasespace:xy}.} \end{figure*} \fi In this example, the collimation system is designed to work independently in the horizontal and vertical planes. Therefore, each is simulated independently with the appropriate beam distribution for each dimension. These can later be combined for total beam loss information. Figure~\ref{fig:modellosses} shows the combined losses from the simulation of $2\times10^{5}$ protons with 100\,GeV energy in both the horizontal and vertical planes. By default, the user must choose the physics list or sets of processes they require (none were used for the optics validation as none were required). In this case, the Geant4 \emph{reference} physics list {``FTFP\_BERT''} was used that is a standard high energy physics list provided by Geant4 that BDSIM provides an interface to. This provides a wide variety of physics processes including electromagnetic, hadronic elastic, inelastic and diffractive processes. In BDSIM, it is accessed using the following command: \begin{lstlisting} option, physicsList="g4FTFP_BERT"; \end{lstlisting} Practically, the simulation was performed on the 500-core Royal Holloway Cluster in 2000 jobs that produced a total 60\,GB of ROOT format output. These were analysed individually using \texttt{rebdsim} with the same analysis configuration ASCII file. The resulting 2000 \texttt{rebdsim} histogram files were then combined using the provided \texttt{rebdsimCombine} tool. It should be noted that such large computational resources are not required and one can easily simulate millions of events on a personal computer depending on the size of the model and the physics used. \begin{figure*} \normalsize \centering \includegraphics[width=0.98\textwidth]{figure12.pdf} \caption{\label{fig:modellosses}Combined beam loss from a horizontal and vertical halo simulation with $4\times10^{5}$ primary protons at 100\,GeV as a function of distance, S along the axis of the machine. Blue triangles show the point of first contact of primary particles and red circles, their stopping location. The integrated energy deposition is also shown in black recorded by the accelerator geometry. The diagram on top shows the various magnets in order. The beam was started from collimators at $\mathrm{S}=3583$\,m (vertical halo) and $\mathrm{S}=3691$\,m (horizonal halo). The diagram follows the curvilinear coordinate frame of the machine and is integrated across all turns of all particles, i.e. the diagram wraps around.} \end{figure*} Figure~\ref{fig:modellosses} shows the proton impact and loss locations. The impact location is determined as the first point where a physics process is invoked along the step of the particle and the loss point is the end of the trajectory of the primary proton. This may be either due to an inelastic collision and subsequent fragmentation, or simply absorption. Additionally, the energy deposition in all material in the accelerator is shown. A clear maximum in losses and energy deposition can be seen in proximity to the collimation section between 3500\,m and 4000\,m. However, a clear decaying tail of energy deposition is seen throughout the subsequent arc (in the direction of the beam). For the first 1\,km of the machine there are very few particle losses but considerable energy deposition. Such energy deposition would not be shown from only tracking primary particles and is a unique feature of BDSIM. All histograms are made on a `per-event' basis and the histograms shown are the mean of the sampled number of events. The uncertainty for each bin is the standard error on the mean. This allows the statistical sample simulated to be scaled to a realistic rate accurately. Here, one event is one particle simulated. Any realistic rate scaling would take into account the chosen phase space for the input beam distribution that was used for increased simulation efficiency. This per-event analysis is only possible because of the event-by-event storage of the output format and this is crucial to calculate the correct statistical uncertainty associated with each bin in the histogram. \begin{figure} \centering \includegraphics[width=8.5cm]{figure13.pdf} \caption{\label{fig:modellossescollimation}Collimation section detail showing combined beam loss from a horizontal and vertical halo simulation with $4\times10^{5}$ primary protons at 100\,GeV.} \end{figure} Looking at the collimation insertion region in more detail as shown in Figure~\ref{fig:modellossescollimation}, the pattern of proton impacts and losses can be seen more clearly. The `hits' and `losses' are quite different indicating that primary protons can interact with a collimator and escape. Such information could be used to improve the efficiency of the simplistic collimation section in this model to better absorb the scattered or leaked protons. The information shown from the simulation is already a powerful guide to the operating radiation produced in the machine. However, further information is easily available that allows an even greater understanding of the machine behaviour. By using the `sample' command on each collimator, the complete distribution of particles after each element can be recorded. Figure~\ref{fig:modelspectrum} shows the energy spectrum of particles recorded in a sampler placed after the primary horizontal collimator for the horizontal halo simulation. For each particle species a separate histogram was prepared with \texttt{rebdsim} by defining a `selection' that acts as a filter. Here, the integer particle ID from the Monte Carlo Numbering scheme~\cite{PDG:2018} was matched. The spectra show significant fluxes of various high energy particles leaving the primary collimator and in particular a much broader spectrum of primary protons than were originally in the beam. These are of particular interest as they may travel some distance before being lost in a position that would not be immediately associated with the collimator in question. \begin{figure} \centering \includegraphics[width=8cm]{figure14.pdf} \caption{\label{fig:modelspectrum}Particle energy spectrum of all particles recorded after the primary horizontal collimator. The data is integrated for all 100 revolutions of the primary beam in the simulation.} \end{figure} Furthermore, for the purpose of damage and activation it is useful to look at the neutron distribution as an example. Shown in Figure~\ref{fig:modelneutronflux} is the 2D distribution of neutrons weighted by their total energy after the secondary horizontal collimator from the horizontal halo simulation only. Here, a clear shadow of the collimator can be seen. The \texttt{rebdsim} input syntax is shown below to highlight the simplicity of making per-particle-species rate normalised histograms from simulation data without the need for a complicated analysis. \begin{lstlisting} Histogram2D Event. COLPRIMXEWFluxProtSecZoom {100,100} {-0.5:0.5,-0.5:0.5} COLPRIMX.y:COLPRIMX.x COLPRIMX.energy*(COLPRIMX.partID==2112&&COLPRIMX.parentID>0) \end{lstlisting} \begin{figure} \centering \includegraphics[width=8cm]{figure15.pdf} \caption{\label{fig:modelneutronflux}The energy-weighted neutron flux after the secondary horizontal collimator per proton impact on the primary collimator. Although the collimators have an asymmetric aperture, their outer shape is a square. Here the shadow of the square 0.5\,m wide collimators can clearly be seen.} \end{figure} For circular models, the losses as a function of turn number are important. BDSIM records the turn number associated with all data in the output for circular models permitting turn-by-turn analysis. Figure~\ref{fig:modelsurviving} shows the surviving fraction of the simulated halo beam after each turn. The periodic steps are due to the tune of the circular machine and the figure illustrates the different performance of the collimation system in each plane. Should it be desired, the data presented in Figure~\ref{fig:modelspectrum} and Figure~\ref{fig:modelneutronflux} can easily be filtered by turn number to show the radiation on a particular turn or range of turns that may correspond to a sharp increase of losses. \begin{figure} \centering \includegraphics[width=8cm]{figure16.pdf} \caption{\label{fig:modelsurviving}Fraction of primary halo protons surviving per turn completed in the ring for both the horizontal and vertical halo simulations. The coloured band represents the statistical uncertainty from the simulation.} \end{figure} \iffalse \begin{itemize} \item will show model preparation / conversion, run, basic output analysis \item description of model / 20GeV ring \item insertions \item collimation \item preparation of model \item validating optics / model preparation \item appropriate beam distribution / what we want to look at \item run and output \item energy deposition from output \item basic analysis - fraction of particles undergoing X process \item process biasing in collimators \end{itemize} \fi \section{Implementation} \label{sec:implementation} Geant4 is a C++ class library that provides no standard program the developer or user can run. A developer must write their own C++ program to instantiate classes representing geometrical shapes, materials, placements of shapes in space as well as physics processes and the Geant4 kernel. As C++ is a compiled language, this would generally make any Geant4 model fixed in design. However, to simulate any accelerator, a more dynamic setup is required. BDSIM uses human readable text input files with a syntax called \emph{GMAD}. The GMAD syntax (Geant4 + MAD) is designed to be as similar as possible to that of MAD8 and {MAD\textendash X}{} that are common tools for accelerator design and therefore it will be immediately familiar to a large number of users in the accelerator community. This is significantly less labour intensive than writing and compiling C++ code. BDSIM uses GNU Flex~\cite{FLEX-website} and GNU Bison~\cite{BISON-website} to interpret the input text files and prepare the necessary C++ structures for BDSIM to create a Geant4 model. Use of a parser ensures strict compliance with the language and sensible user feedback to prevent unintended input or mistakes. The parser is easily extended by the developer allowing the possible introduction of new features in future. The most minimal input includes \begin{enumerate} \item At least one beam line element. \item A sequence (`line') of at least one element. \item Declaration of which sequence to build. \item The particle species. \item The particle total energy. \end{enumerate} \noindent and would be written as \begin{lstlisting} d1: drift, l=1*m; l1: line=(d1); use, l1; beam, particle="e-", energy=10*GeV; \end{lstlisting} This model defines a single beam pipe with no fields and an electron beam of 10\,GeV total energy. Additional options and sets of physics processes may also be specified. After parsing the input text files, the Geant4 model is constructed by instantiating various construction classes that are registered with the Geant4 kernel class \texttt{G4RunManager}. The various aspects of the model construction are described in subsections~\ref{ssec:geometryconstruction}\textendash\ref{ssec:control}. \subsection{Geometry Construction} \label{ssec:geometryconstruction} The model is built from a sequence of unique elements that may appear multiple times in a varied order. As there are 26 different elements defined in BDSIM including 12 types of magnets with 8 different styles that can be combined with any one of 8 aperture cross sections, there is a large number of possible geometry combinations. It would be impractical to have one C++ class for each combination and it would not be trivial to extend the code to include new aperture cross sections or magnet styles. BDSIM is therefore designed in such a way that independent pieces of geometry can be constructed and then placed safely either alongside each other or in a hierarchy. This allows beam pipes and magnets to be constructed independently and assembled. Furthermore, it makes extension to include new aperture shapes or magnets trivial. Independent factory pattern classes for magnet yokes and beam pipes allow any combination of aperture and magnet style to be created. Therefore, only one class is required for a magnet that uses the factories to create the yoke and beam pipe in the desired combination. Geometry in Geant4 is constructed using the constructive solid geometry (CSG) technique, where primitive shapes (e.g. a cube, sphere, cylinder, etc.) can be combined through Boolean operations (union, subtraction, intersection) to create more complex shapes. The program developer instantiates classes with the relevant parameters and places them together inside a parent volume. With the Geant4 geometry system, it is entirely possible to construct a nonphysical geometry where a volume overlaps with other volumes at the same hierarchy level, or protrudes outside the containing volume. When tracking a particle through the geometry, only other volumes at the current level of the geometry hierarchy are searched for where the track will enter them. If, through a combination of bad placement and shape parameters, the particle wrongfully appears already inside an overlapping volume, the volume will not be detected as the particle has not \emph{entered} it. Such errors are only highlighted to the user if they purposefully scan the geometry for errors or worse, during a simulation when the tracking routines fail to navigate the geometry hierarchy correctly resulting in material being skipped or the particle jumping through the geometry. This may proceed without any error and simply produce an incorrect result. When creating a Geant4 model, we must therefore be careful to ensure no overlaps exist, which is especially necessary with a parameterised model defined by user input. BDSIM ensures that any user input using BDSIM's standard components will result in a safe Geant4 model without overlaps, including any combination of the available geometries (e.g. aperture shapes and magnets). Once one of the Geant4 CSG primitive classes is instantiated, it is not possible to know its extent without querying a tracking point as to whether it lies inside or outside the volume. To circumvent this as well as prevent construction of invalid geometry, BDSIM records the asymmetric extents in three dimensions of every piece of geometry created. Whilst the cuboid denoted by these extents does not represent the surface of the volume, it is sufficient for ensuring that no overlaps will occur. Any piece of geometry in BDSIM is therefore represented by the base class \texttt{BDSGeometryComponent} that handles the extents. Furthermore, to correctly navigate the geometry hierarchy, Geant4 must be able to numerically determine whether a point in 3D Cartesian coordinates lies inside or outside of a volume. Therefore, two volumes placed adjacent to each other at the same level in the geometry hierarchy must have a non-zero space between them. Geant4 defines a geometry tolerance that is the minimum resolvable distance in the geometry and therefore the tolerance when estimating the intersection with a surface of a trajectory. The tolerance is set explicitly in BDSIM to 1\,nm and this is defined as a constant throughout the code called `length safety' that is used to pad all geometry hierarchy. The geometry is constructed by the \linebreak \texttt{BDSDetectorConstruction} class that uses a component factory (\texttt{BDSComponentFactory}) to create the individual components required. A component registry is used to reuse previously constructed components saving a considerable amount of memory for large models. Components whose field is time dependent and therefore depends on the position in the beam line are created uniquely to ensure correct tracking. Each component is appended to an instance of \texttt{BDSBeamline}, which interrogates each element and prepares the 3D transformations (rotation and translation) required to place that element on the end of the beam line in 3D Cartesian coordinates. When the construction of the beam line elements is complete, they are placed in a single container `world' volume. Between construction and placement, the physical extent of the beam line is determined and these are used to dynamically construct a world volume of the appropriate size for the model. Some elements may make use of geometry provided in external files. Such geometry is constructed again through a factory interface with a different loader for each format supported. The primary format is Geometry Description Markup Language (GDML)~\cite{GDML:2006}, which is the geometry persistency format of Geant4. External geometry can either be placed in sequence in the beam line, wrapped around a beam pipe as part of a magnet or irrespective of the beam line in the world volume at an arbitrary location. For increased physical accuracy, BDSIM is capable of building a tunnel around the beam line. Accelerators are typically placed in a shielded environment to contain any radiation and high energy accelerators are typically placed in tunnels underground. The tunnel built by BDSIM can be customised by the user to be one of 5 different cross sections and offset with respect to the beam line. The algorithm used to generate the tunnel geometry is capable of following complex beam lines unique to the user input model. The tunnel is highly suited to prevent cross-talk between parts of the model in a circular model that would otherwise be an artefact of simplified geometry of the simulation. Options allow particles to be removed from the simulation when they impact the tunnel for computational efficiency. Due to the Geant4 interface, the fields for each element are not constructed at the same point as the geometry. Geant4 requires all fields to be constructed and attached to volumes at one point in the program. When the geometry for an element is constructed, a field \emph{recipe} and logical volume to attach it to are registered to a field factory. The factory is then used by the Geant4 interface to construct and attach all fields at once. \subsection{Coordinate Systems \& Parallel Worlds} \label{ssec:parallelworlds} The majority of accelerator magnetic fields as well as externally provided field maps are usually defined with respect to the local coordinate frame of the element they are attached to. Similarly, accelerator-specific numerical integration algorithms for calculating a particle trajectory through an element are typically defined in a curvilinear coordinate frame that follows the trajectory of a particle with no transverse position or momentum and with the design energy through that element\textemdash{}the Frenet-Serret coordinate system. However, contrary to this, Geant4 uses the 3D Cartesian coordinates described by the outermost volume in the geometry, i.e. the world volume. BDSIM provides the necessary coordinate transforms between these systems to permit the use of accelerator tracking routines and field maps attached to individual elements. \begin{figure} \centering \includegraphics[width=9cm]{figure1.pdf} \caption{\label{fig:curvilinearcylinder}Comparison view of quadrupole in the mass world and the accompanying cylinder used for curvilinear coordinate frame transforms in a parallel world. The curvilinear cylinder has been reduced in size for comparison, but is usually several times bigger to overlap all of the beam line.} \end{figure} \iffalse \begin{tikzpicture}[% grow via three points={one child at (0.5,-0.7) and two children at (0.5,-0.7) and (0.5,-1.4)}, edge from parent path={(\tikzparentnode.south) |- (\tikzchildnode.west)}] \node {world} child {node {quadrupole 1} child {node {beam pipe} child {node {pipe}} child {node {vacuum}} } child [missing] {} child [missing] {} child {node {outer} child {node {yoke}} child {node {pole1}} child {node {pole2}} child {node {pole3}} child {node {pole4}} } }; \end{tikzpicture} \fi For a given global Cartesian position, Geant4 can provide the transform from the volume that point lies within to the world volume and vice-versa irrespective of the depth of the geometry hierarchy. A transform for $N$ levels higher in the geometry hierarchy can also be requested. As the depth of the geometry hierarchy may vary from component to component, this facility cannot be used generally. The local coordinate frame of any given volume is also not necessarily the required curvilinear frame. To provide the correct transforms into the curvilinear frame, BDSIM constructs a separate 3D model (a `parallel world' in Geant4 terminology) with different geometry than that of the beam line. In this parallel world, a simple cylinder of the same length as the accelerator component is placed at the same position as shown in Figure~\ref{fig:curvilinearcylinder}. Any point in the world can then be queried in the parallel world and the transform used from the volume found at that location to the world volume. This will be a transform from the world volume to the local coordinate system of the cylinder whose axis is degenerate with the curvilinear system required. In the case of a component that bends the beam line, many small straight cylinders with angled faces are constructed. This is not exactly the same as the true curvilinear frame, so a dedicated transform is provided. As already discussed, all Geant4 geometry must have a numerically resolvable gap between adjacent solids and so each parallel world cylinder is placed with a small gap between it and the next one in the beam line. However, if a point is queried in this gap, an incorrect transform will be found. This occurs regularly as the particle enters or exits a volume. The gap between volumes is kept to a minimum to avoid integrating the field over a shorter length. To overcome this problem, a third parallel world is built with bridging cylinders. While searching the curvilinear world for a volume, the world volume itself is found, then the bridging world is subsequently searched. This ensures a continuous coordinate system irrespective of the limits of the geometry system. A quadrupole with curvilinear cylinders and bridging cylinders are shown in Figure~\ref{fig:bridgingworld}. \begin{figure} \centering \includegraphics[width=8cm]{figure2.pdf} \caption{\label{fig:bridgingworld} Side view showing the geometry in three different worlds separated by a dashed line. The top-most is the mass world with a beam pipe, quadrupole (red), and beam pipe. The middle world shows three curvilinear cylinders (green) with non-zero gaps between each. These are used for the curvilinear transforms. At the bottom, the third world shows curvilinear bridging sections (green) designed to overlap the above curvilinear cylinders but also have a non-zero gap between them. The bridging cylinder length has been exaggerated for visualisation purposes.} \end{figure} \subsection{Fields} \label{ssec:fields} Along with the geometry of each beam line element, the required fields are provided. The field strengths are calculated from the rigidity-normalised strength parameters most commonly used to specify accelerator magnets and used in accelerator modelling tools such as {MAD\textendash X}{}. For example, in the case of a quadrupole, the normalised strength $k_1$ is typically used, which is defined by \begin{equation} \label{eq:k1} k_1 = \frac{1}{B\rho} \frac{\partial B_{y}}{\partial x} \end{equation} \noindent where $B\rho$ is the magnetic rigidity of the particle and $B_y$ is the vertical component of the magnetic field. The magnetic rigidity is given by \begin{equation} B\rho = \frac{p}{e} \end{equation} \noindent where $p$ is the momentum of the particle and $e$ is the elementary charge. $B\rho$ is calculated for the beam particle the accelerator is designed for and this is used to calculate the magnetic field gradient for a given $k_1$. The gradient is evaluated by rearranging Equation~\ref{eq:k1} and then evaluating it at the coordinates of the particle with \begin{equation} \begin{aligned} B_x &= x \, \frac{\partial B_{y}}{\partial x}, \\ B_y &= y \, \frac{\partial B_{y}}{\partial x}, \\ B_z &= 0 \end{aligned} \end{equation} This is valid close to the axis of the magnet as it neglects any description of the field close to the magnet poles. The \emph{pure} field like this is used for the vacuum and beam pipe volumes. For the magnet yoke and air in between the poles, a different description is used. Here, a 2D field, invariant along the length of the magnet, is used that is the sum of point current sources located at the point half way between each pole, where the coils would be. The location of each wire is given by \begin{equation} \mathbf{c}_i = \begin{bmatrix} x \\ y \\ \end{bmatrix}_i = \begin{bmatrix} 0 \\ r_{\mathrm{pole tip}} \\ \end{bmatrix} \begin{bmatrix} \cos \theta_i & - \sin \theta_i \\ \sin \theta_i & \cos \theta_i \\ \end{bmatrix} \end{equation} \begin{equation} \theta_i = \left \{ \frac{i\,2\pi}{n_{\mathrm{poles}}} \right \} \quad \mathrm{for} \quad i = \{0 \ldots n_{\mathrm{poles}} \} \end{equation} \noindent where $r_{\mathrm{poletip}}$ is the radius at the pole tip and $\theta_i$ the angle in polar coordinates of the $i^{th}$ wire current source. The magnetic field value $\mathbf{B}$ as a function of position $\mathbf{r} = (x,y)$ is \begin{equation} \mathbf{B}(\mathbf{r}) = \sum_{i = 1}^{n_{\mathrm{poles}}} (-1)^{i} \, \frac{(\mathbf{r} - \mathbf{c}_i)_{\perp}}{\|\mathbf{r} - \mathbf{c}_i\|} \end{equation} The field is normalised to the pure field at the pole tip radius. This approximate field neglects the permeability of the yoke material, but is sufficient for the purpose as only secondary particles are expected to be transported outside the beam pipe. Should the user wish, they may overlay their own field map for a more accurate description. An example field of this form for a quadrupole is shown in Figure~\ref{fig:multipolefield}. \begin{figure} \centering \includegraphics[width=9cm]{figure3.pdf} \caption{\label{fig:multipolefield}Field for a quadrupole yoke with a pole tip radius of 40\,mm as a function of local transverse coordinates. The direction of the current is shown by the grey cross and points at each current source location.} \end{figure} \subsection{Physics Processes} \label{ssec:physicsconstruction} Geant4 provides a large library of physics processes. A Geant4 application must instantiate the required particles and then instantiate the required physics process classes and attach them to the applicable particles. Geant4 includes a more convenient general set of `physics lists' that provide commonly used sets of physics processes applicable to many particles for a given application and energy range. These modular lists can be selected by the user in BDSIM and it is left to them to select the most relevant physics processes for the simulation. Using all of the physics processes by default would result in an extremely computationally expensive simulation. Additionally, there may be more than one physics model relevant that the user may wish to choose from. BDSIM provides simple names that map to the most common physics lists constructors in Geant4 as described in Table~\ref{tab:physicslists}. \begin{table} \centering \caption{\label{tab:physicslists} Examples of name mapping of Geant4 physics lists in BDSIM.} \begin{tabular}{l l} \hline \hline BDSIM Name & Geant4 Class \\ \hline em & G4EmStandardPhysics \\ em\_livermore & G4EmLivermorePhysics \\ decay & G4DecayPhysics \\ ftfp\_bert & G4HadronPhysicsFTFP\_BERT \\ ftfp\_bert\_hp & G4HadronPhysicsFTFP\_BERT\_HP \\ hadronic\_elasitc & G4HadronElasticPhysics \\ ion & G4IonPhysics \\ shielding & G4ShieldingPhysics \\ stopping & G4StoppingPhysics \\ synch\_rad & G4SynchrotronRadiation \\ \hline \hline \end{tabular} \end{table} If no processes are selected, only tracking in magnetic fields will be present, i.e. particles will pass unimpeded through matter. Such process-less models are useful for validating particle tracking and beam distributions as well as comparisons to other codes that lack such interactions. \subsection{Run and Event} \label{ssec:runandevent} A BDSIM simulation progresses at two levels; a \emph{Run} and an \emph{Event}. An event is the smallest unit of simulation where one initial particle or set of particles is tracked through the model. All information may be collected on an event level basis and all events are entirely independent of each other. A run is a unit of simulation containing $N$ events where the geometry and physics processes do not change. BDSIM can be run in two ways; interactively with a visualiser; or in batch mode without visualisation. The latter is considerably faster and used for large scale simulation, whereas interactive visualisation is typically used in the preliminary stages to verify the model and typical outcome of an event. In the case of batch mode, BDSIM performs one run with the desired number of events. Interactively, the user may issue the following command on the interactive terminal \begin{lstlisting} /run/beamOn N \end{lstlisting} \noindent where \texttt{N} is the number of desired events. In this case, BDSIM creates 1 run with \texttt{N} events for each time the command is issued. Geant4 provides several places in the framework where the developer can insert their own code and gain access to simulation information. BDSIM implements actions at both the beginning and end of each event and run where information is collected, histograms prepared and data written to the output. \subsection{Output} \label{ssec:output} A Geant4 simulation produces no output information by default as the total possible information is unmanageable for storage or analysis. Therefore, it is left to the developer to provide classes that process the information available during the simulation from the Geant4 kernel to create the desired reduced output information. BDSIM uses the Geant4 interfaces and records information from the simulation in two ways. Firstly, several sensitive detector classes (inheriting \linebreak \texttt{G4VSensitiveDetector}) are provided and automatically attached to various volumes. These are registered with Geant4 and are provided with access to all particle tracks through the volumes they are attached to. BDSIM includes such a class to record the energy deposition in all volumes in both 3D Cartesian and curvilinear coordinates. Secondly, BDSIM records trajectory information independently of volumes at an event level. As the full set of trajectories for all particles in an event could reach several gigabytes per event, there are several user options in BDSIM to downselect which trajectories are desired. Each trajectory consists of a series of trajectory points that each contain the spatial coordinates of that point, particle species, total energy and the physics process identification number associated with the last step. Even though a user may filter to select only a certain type of particle, the trajectories are stored in a linked manner so that any individual trajectory point stored can be fully traced back to the primary particle in the event. In a conventional tracking simulation the coordinates of each particle are updated after passing through each element in the accelerator. Therefore, the most common output is a list of all the particle coordinates after each element. To be able to compare BDSIM to tracking simulations, a similar functionality is provided. BDSIM has a \texttt{sample} command that inserts a `sampler' after either a single specified element or all elements in the beam line. A sampler is a 1\,nm thick plane that is 5\,m\,$\times$\,5\,m transversely made of vacuum in a parallel world so as not to interfere with the physical interactions. There is no ability to record particles on an arbitrary plane or surface of a volume in Geant4, so a volume must be created and a sensitive detector attached to it. The box is made as thin as possible to minimise artificially increasing the length of the beam line. The sampler plane records any particles passing through it. Output information is stored in the ROOT data format~\cite{ROOT:1997, ROOT:2009}. This is a well-documented, compressed binary format that is widely used in the high energy physics community. The ROOT data storage facilities are highly suited to storing information on an event by event basis and allow direct serialisation of the developer's C++ classes as well as provision for data schema evolution. These can be loaded using the compiled software, but the file also contains a complete template of all classes used such that this is not required and the data can always be loaded even if the original software is lost. Although written in compiled C++, the ROOT framework provides reflection for the classes stored that allows the compiled code to be easily loaded and used interactively in the ROOT interpreter as well as in Python with the exact same functionality allowing users to explore the data interactively with ease. Aside from raw information, histograms of energy deposition and primary particle impact and loss points are recorded with each event. These can be averaged in analysis to produce the mean energy deposition across all events, but with the correct statistical uncertainty. This treatment is only possible with event by event data storage. Each data file includes information about the BDSIM options used, random number generator seed states and software identification numbers for BDSIM and its main dependencies to allow any simulation to be strongly recreated. Such information allows reproduction of any simulation immediately or even years later. \subsection{Primary Particle Generation} \label{ssec:primarygenerator} Generally an event may start with several initial particles (`primaries'), however, in the case of an accelerator it is more typical to simulate a single particle sampled from a beam distribution. To begin each event, BDSIM draws randomly a set of coordinates ($x$, $x^{\prime}$, $y$, $y^{\prime}$, $\delta t$, $E$) from a distribution chosen by the user. BDSIM provides 12 possible distributions. The most basic is the `reference' distribution where each particle is the same for each event with a fixed set of coordinates as chosen by the user. These are by default aligned to the axis of the accelerator with no transverse position or momentum. This distribution is used to validate the reference or design trajectory. A 6D Gaussian distribution is provided where the user may specify the standard deviation $\sigma$ in each dimension as well as the off-diagonal correlation terms in a 6\,$\times$\,6 matrix. The Twiss parameterisation common to accelerator beam descriptions is provided, which in turn uses the 6D Gaussian generator. As one of the purposes of BDSIM is to simulate lost particles interacting with the accelerator, which usually occurs with a low frequency, several distributions are provided that make the simulation more efficient. One such distribution is the `halo' distribution that provides a particle distribution according to the nominal Gaussian beam, but at a large number of $\sigma$. In all cases, the generator uses a single instance of the pseudo-random number generator from the CLHEP library. The user may specify a starting seed value or one is automatically generated from the computer clock. \begin{figure*} \normalsize \centering \includegraphics[width=0.9\textwidth]{figure4.pdf} \caption{\label{fig:workflow}Diagram showing the workflow using the extended tools included with BDSIM. The dashed arrows represent optional steps. From left to right: a) \texttt{pybdsim} is used in combination with other Python packages to prepare an input model including optional input user-provided information in Python dictionaries, b) \texttt{pyg4ometry} can optionally be used to help prepare input geometry, c) BDSIM is used to generate data, d) BDSIM is used many times with multiple seeds on a computer cluster to generate many output files for a study, e) \texttt{rebdsim} is used to analysed one or multiple output files at once using an analysis configuration text file, f) optionally, \texttt{rebdsim} is used one-to-one on output files directly producing one \texttt{rebdsim} file per BDSIM file, in which case g) \texttt{rebdsimCombine} is used to combine these into one result.} \end{figure*} \subsection{Simulation Control} \label{ssec:control} In each event, particles are tracked until they reach zero kinetic energy or they leave the world (outermost) volume. With high energy primary particles, a very large number of secondaries can be produced and as the particles decrease in energy the number of secondaries can grow, which is known as infrared divergence. Such detail at low energy may not be necessary and may dominate computation time. To avoid this, it is necessary to have some control over the physics processes other than including only those relevant in the physics list. Geant4 provides the ability to provide tracking cuts in a volume. Here, a minimum energy and maximum time can be specified. If a particle has an energy under or a time greater than these limits, the particle will be removed from tracking. BDSIM provides a method to set limits that will be attached to all volumes and also records the final energy of the particles to conserve energy per event. In addition to the tracking cuts, Geant4's primary mechanism is a range cut. A range cut is a distance assigned to a particle species that a secondary of that species would be required to travel. If the secondary would not travel at least that range, the energy deposition is recorded but the secondary particle is not produced. The range is internally converted in Geant4 to a material and particle specific energy cut. This strategy provides the greatest accuracy with the least computation~\cite{GEANT4:2003}. BDSIM provides an interface to set the range cut for protons, electrons and positrons, photons as well as a default. Such limits are often necessary as a simulation may not include physics processes that would lead to the natural termination of a particle. For example, synchrotron radiation can produce a very large number of photons making it computationally expensive to track all the secondary particles. The rate scales $\sim\,E^4$, so it can dominate when simulating high energy events and therefore is often omitted. This omission however, may lead to low energy particles spiralling in a magnetic field, such as that of a dipole, indefinitely. BDSIM's numerical integrators have special treatment of spiralling particles, but the user limits provide a convenient method to avoid such scenarios that may lead to long running events with no gain in information. \begin{sloppypar} One further consideration is a circular accelerator. With a circular accelerator and no synchrotron radiation, the particle energy will not decay as the magnetic field does no work. BDSIM therefore provides a \texttt{circular} option to limit the number of turns any primary particle can complete. A 5\,m\,$\times$\,5\,m\,$\times$\,0.1\,$\mathrm{\mu}$m cubical volume is inserted between the beginning and end of the lattice that is orientated to make a large transverse plane to the beam. A dynamic set of user limits is attached as well as a special Geant4 sensitive detector class. The sensitive detector class records the number of turns completed by the primary particle and when this has reached the specified number of turns, the user limits are dynamically changed to reject any particle over 0\,eV. This makes the box an infinite absorber, stopping any particle that hits it. \end{sloppypar} \subsection{Variance Reduction} \label{ssec:variancereduction} With the large number of physics processes included in each physics list as well as the large number of possible outcomes from each interaction, the outcome or process of interest may occur at a low frequency per event. An efficient simulation would simulate the outcome one wishes to characterise for each event, i.e. it is impractical to simulate tens of millions of events to observe only a few occurrences of the desired outcome. When analysing a data set, this effect leads to a large variance of results when in certain areas of parameter space. Biasing is a form of variance reduction where a process or outcome is made artificially more frequent, but recorded with a corresponding statistical weight. Multiplying the simulated frequency by the weight gives the correct physical result but, due to the more frequent occurrence, with a reduced variance. Traditionally, the developer had to write their own C++ wrapper for a given process they wish to study, but recent developments of Geant4 have introduced a more generic biasing interface~\cite{GEANT4:2016}. Geant4's generic biasing interface provides both physics based (process cross-section) and non physics based (splitting and killing) such as geometrical importance biasing or importance sampling. An interface to process biasing is provided in BDSIM that allows the user to scale the process cross-section by a given factor for a given particle. The biasing can be applied globally, or to specific \emph{vacuum} volumes (inside the beam pipe) or the general material (anything outside the beam pipe) of specific beam line elements. For example, this can allow simulation of elastic or inelastic interaction of particles with residual gas molecules in the `vacuum' of the beam pipe. \subsection{Visualisation} \label{ssec:visualisation} At the initial stages of a study, it is crucial to visualise a model to validate its preparation as well as the expected outcome of a typical event. Visualisation is accomplished through an interface to the Geant4 visualisation system that provides a variety of different visualisation programs depending on the software environment. The default and recommended visualiser is the Geant4 Qt visualiser. This provides a rich interface with an interactive 3D visualisation where the model can be viewed with solid surfaces or as a wire-frame, both with and without perspective. A built in command prompt allows extensive control of the simulation and the visualisation, such as geometry overlap checking and particle track colour schemes. To visualise an event, all trajectories must be stored. Additionally, the model and all trajectories must be converted to polygon meshes and rendered on screen. Whilst this is handled by the Geant4 visualisation system, this overhead leads to the interactive visualisation system running events approximately an order of magnitude slower than they would without visualisation. The visualisation is crucial in the first stages of a simulation for validation but beyond that it is more desirable to generate as many events as possible in a given time. BDSIM by default will run interactively, but if executed with the \texttt{--batch} option, it will not use the visualiser and complete the simulation with only textual diagnostic and informative output to the terminal. Batch mode is much faster and suitable for simulations that may be run on a computing farm where no graphics systems are available. \subsection{Analysis} \label{ssec:analysis} Once BDSIM has produced output, this may be analysed using an included analysis suite. This covers the most common basic analysis but also includes an interface for the user to include more complicated analyses. The main analysis tool is \texttt{rebdsim} (`ROOT event BDSIM'). This uses a simple text file as input that defines histograms to make from the output structures contained in output files. These can be one to three dimensional histograms made on an event by event basis or as a simple integration across all events. Any histograms stored in the raw output that were produced in BDSIM, such as energy deposition and primary impact location, are combined to produce a mean histogram across all events. The histogram definition in \texttt{rebdsim} specifies which variables in which `Tree' in the output to make the histogram from as well as binning and a `selection'. The binning can also be chosen to be logarithmic to cover a large range in values. The selection is an optional weighting that can be a numerical factor, another variable in the data, a Boolean expression based on data variables or a combination of all. This is an interface to that of \texttt{TTree:Draw} in ROOT. The event level structure in the output is paramount to the analysis for two reasons \begin{enumerate} \item To calculate the correct statistical uncertainties. \item To filter independent events on any variable. \end{enumerate} To correctly calculate the variance and therefore the statistical uncertainties of any mean histograms, the data must be structured in a per event manner. Conventional tracking programs only simulate one particle per `event' so there is no need to structure data in this way and the uncertainties are trivially calculated. However, with the complex tree of particles and physics processes that can happen per event in a radiation simulation, it is absolutely crucial to structure the data in this way. The default histograms made by \texttt{rebdsim} are made event-by-event and so have the correct statistical uncertainties. The ability to use a selection and filter events based on any variable permits any user analysis to be performed without prior knowledge of the beam line or physical origin of particular information and is highly powerful. Other attempts at similar simulations typically keep track of very specific information for that application limiting the usefullness of the code. None of the comparable codes already described preserve a per event structure in data and deal only with simple integral histograms and therefore lack the correct treatment of statistical uncertainties. \begin{sloppypar} Using the `chain' feature of ROOT many files can be analysed together behaving as one. Furthermore, a tool \linebreak \texttt{rebdsimCombine} is provided to combine the output from several instances of \texttt{rebdsim}. For large data sets it would be prohibitive to analyse the whole data set serially, so it is preferable to analyse small chunks in parallel and then combine the resultant histograms. This strategy results in the exact same numerical answer but in a fraction of the time. \end{sloppypar} The ROOT output format and included analysis tools provide great flexibility in the storage and analysis of simulation data. They also ensure the process is scalable to the very largest data sets dealt with today on the multi-terabyte level. \subsection{Workflow} \label{ssec:workflow} Apart from the main program, BDSIM, a suite of associated tools is included to facilitate a smooth workflow. These aid in input automatic input preparation and analysis and combination of results as shown in Figure~\ref{fig:workflow}. To aid input preparation, several Python packages are included that aid with different input formats as described in Table~\ref{tab:pythonutils}. There are individual packages for common output formats from accelerator design software such as {MAD\textendash X}{}~\cite{MADX-website}, MAD8~\cite{MAD8}, and TRANSPORT~\cite{TRANSPORT, TRANSPORT-modern} (\texttt{pymadx}, \texttt{pymad8}, and \linebreak \texttt{pytransport} respectively). These can be used individually to load, inspect and plot information, but are also tied together by the more general package \texttt{pybdsim} that allows conversion from these formats to a BDSIM model. The conversion includes the ability to include extra information (via user-provided Python dictionaries) in the converted model that may come from other sources, such as aperture or collimator information. A further tool, \texttt{pyg4ometry}~\cite{pyg4ometry-website, pyg4ometry-manual-website}, can be used to prepare GDML geometry files for use in BDSIM or any Geant4 simulation. It can also be used to aid in the conversion from other geometry formats. Python scripts can be used to make simple components that can be easily included in a beam line in BDSIM. \begin{table} \centering \caption{\label{tab:pythonutils} Included Python packages with BDSIM.} \begin{tabular}{l p{6cm}} \hline \hline Package & Description \\ \hline \texttt{pymadx} & Load MAD-X output and create MAD-X models \\ \texttt{pymad8} & Load MAD8 output and create MAD8 models \\ \texttt{pytransport} & Parse TRANSPORT input \\ \texttt{pybdsim} & Convert model using above packages, load and plot raw and analysed BDSIM data \\ \hline \hline \end{tabular} \end{table} After running BDSIM, the output is a ROOT file with per-event data. This requires analysis as defined by the user to reach a result. Accompanying BDSIM are several other programs that aid with analysis and post-processing of data and are described in Table~\ref{tab:otherprograms}. \begin{table} \centering \caption{\label{tab:otherprograms} Included programs other than BDSIM.} \begin{tabular}{l p{4.7cm}} \hline \hline Program & Description \\ \hline \texttt{rebdsim} & Analyse raw BDSIM data files producing a histogram file \\ \texttt{rebdsimCombine} & Combine multiple histogram files from \texttt{rebdsim} \\ \texttt{rebdsimHistoMerge} & Combine only pre-made energy deposition histograms from a set of BDSIM data files \\ \texttt{rebdsimOrbit} & Extract the first hit in each sampler to easily access the primary particle at each sampler \\ \texttt{bdsinterpolator} & Load BDSIM format field maps, interpolate and export \\ \texttt{comparator} & Regression testing tool for comparison of data \\ \texttt{ptc2bdsim} & Convert MAD-X PTC ASCII output to a BDSIM data file for easier comparison with BDSIM data \\ \hline \hline \end{tabular} \end{table} \iffalse \tikzstyle{boxy} = [rectangle, rounded corners, draw=black, fill=white] \begin{tikzpicture}[>=stealth'] \node[boxy] (pymadx) at (0,0) {pymadx}; \node[boxy] [below of = pymadx] (pymad8) {pymad8}; \node[boxy] [below of = pymad8] (pytransport) {pytransport}; \node[boxy] [right = 2cm of pymad8] (pybdsim) {pybdsim}; \draw [->] (pymadx) to (pybdsim); \draw [-Stealth] (pymad8) to (pybdsim); \draw [-Stealth] (pytransport) to (pybdsim); \end{tikzpicture} \fi \section{Introduction} \label{sec:introduction} Particle accelerators are the primary tool to handle and study subatomic particles. Originally developed to study particle physics, their applications are now widespread ranging from material treatment in manufacturing to radio-nuclide production for medical imaging~\cite{Barbalat:260280}. They are increasingly being used for the electromagnetic radiation they produce in life-sciences to characterise biological samples~\cite{Arthur:2002ap, Balewski:2004iz, MAXIV}. In every particle accelerator there are inevitable beam losses where some small fraction of the particles transported are not contained, whether by design or otherwise. These may be lost due to the initial momentum distribution of the source particles and the finite extent of the accelerator components and their fields. Non-linear or time-varying fields may also lead to a `dynamic aperture' that is typically smaller than the physical aperture that results in further losses. Any losses, no matter how small, can lead to detrimental effects such as heat load in components, experimental backgrounds, reduced machine availability and long term radioactivation and damage. In the case of high energy accelerators, even minute losses can lead to problematic radiation or heat loads. As the energy per particle increases, so does the distance the particle can penetrate in material. In the case of the very highest energy accelerators such as the Large Hadron Collider (LHC) at CERN~\cite{LHCDesignReport} with 6.5\,TeV protons, particles may penetrate tens of metres of rock or concrete. Particles may also quasi-elastically scatter with low momentum transfer on the edge of part of the accelerator such as a collimator and continue to a distant part of the accelerator. Therefore, the locations of energy deposits and particle losses are not always directly correlated with the scattering point. Many modern accelerators including the LHC make use of cryogenic equipment such as superconducting magnets or radio frequency cavities to achieve the required high magnetic or electro-magnetic fields~\cite{Lebrun_2017}. Such cryogenic equipment must be kept below a certain temperature limit as well as within a narrow range to remain superconducting otherwise they will quench. Accelerators that make use of cryogenic equipment will have systems to safely cope with a quench, however, it will take many hours to recover to an operating state, primarily due to the inefficiency of cooling at cryogenic temperatures as well as low thermal conductivity. Such events reduce the accelerator availability and can limit its utility, such as integrated luminosity and data collected. For these reasons, losses must be precisely predicted as well as the location of the subsequent energy deposition. When a particle beam is stored for minutes to hours in a storage ring collider, various effects lead to the formation of a beam halo\textemdash{}particles that follow the main beam but with a large amplitude~\cite{Valentino:2013}. Beam halo must be continuously removed to avoid increased energy deposition and to protect both the accelerator and any detector close to the beam. In high energy accelerators it is often not possible to remove the halo with one stage collimation as the required length of material is prohibitively long to be put in one location. Single and multi-stage collimation systems require a simulation involving the interaction with matter to accurately predict their efficiency as well as any leakage of collimation products~\cite{Bruce:2014}. A further consideration is the interface between the accelerator and a possible detector or experiment, commonly referred to as the Machine Detector Interface (MDI). The beam size is often strongly focussed to create a small transverse beam size at the centre of the target area to increase the collision rate between the two crossing beams. This manipulation can lead to increased losses around a collision point and therefore background radiation that may penetrate the detector\textemdash`non-collision background'. Particles in the beam may also collide with any residual gas molecules in the vacuum of the accelerator beam pipe leading to similar background through the machine and into the detector. Such backgrounds may give the appearance of potential new physics if not accurately accounted for. Although the direction or timing of such signals can be used to help discriminate against genuine collisions, overall the background should be minimised as much as possible to avoid degradation in the ability of the detector to correctly identify the collision events. In each of the aforementioned scenarios, a simulation is required that includes both tracking of particles through magnetic and electro-magnetic fields of accelerators as well as the interaction with the material of the accelerator including the production and transport of secondary radiation. Simulations of these two features have historically been separate simulations each with their own specialised tools. To predict the losses throughout a machine, a trivial estimate can be made by comparing the aperture to nominal beam size throughout the machine. However, the nominal beam size is typically derived from the linear lattice functions and does not account for the variation in particle momentum, any nonlinear fields, nor a non-Gaussian beam. Therefore, to accurately predict the losses, a particle tracking simulation is performed. A particle distribution is sampled and a Monte Carlo simulation performed by calculating the individual trajectories of particles until a termination condition is reached. Such a condition may be a single passage through a model or a certain number of revolutions of a circular accelerator. If the aperture is included in the simulation, particle tracking may be stopped when the particle position exceeds that of the aperture boundary. A common tool for accelerator design is {MAD\textendash X}{}~\cite{MADX-website}. This provides the ability to define a sequence of magnets, calculate the linear lattice functions as well as track particles using the Polymorphic Tracking Code (PTC)~\cite{Schmidt:2002vp}. {MAD\textendash X}{} is commonly used to prepare an input model for the SixTrack tracking code~\cite{Schmidt:1994kc} for long-term symplectic tracking and dynamic aperture studies for the LHC. In both the case of {MAD\textendash X}{} PTC and SixTrack, the particles are tracked throughout the complete model irrespective of aperture information. To estimate losses, the output trajectories can then be filtered by an independent program to apply the aperture model and terminate the trajectories at the appropriate point. The termination points of all the trajectories can then be collated to form a loss map~\cite{Bruce:2014}. However, this is a specialised workflow rather than a publicly available tool. Whilst such a strategy is a demonstrably successful one, the simulation stops at the point where the particle touches the aperture. However, upon impact with material high energy particles will disintegrate or create particles, creating large amounts of radiation on a length scale that increases logarithmically with the energy of the incident particle. For a given kinetic energy of a particle travelling in a material, a stopping distance can be calculated and it could be assumed that although the impact is not simulated, any subsequent radiation would occur on this length scale. However, as the particles are relativistic, they impact and scatter at very low angles and so it's possible for a particle to re-enter the vacuum pipe. In this case the particle may travel quite some distance before again impacting the aperture. In the case of nuclei, fragmentation may occur producing nuclear fragments or protons with a momentum inside the acceptance of the accelerator and therefore travel a great distance. It is therefore crucial to simulate the interaction of losses with the accelerator as well as their subsequent propagation and secondary radiation to make an accurate prediction. For charged particle background in a detector it is also crucial to simulate the interaction with the accelerator as the background is predominantly composed of secondary particles produced by the accelerator. Two further unique scenarios that require combined accelerator and particle matter interactions are muon backgrounds for detectors and secondary beam production and transport. In the first case, with the impact of high energy particles, secondary muons can be produced. These can penetrate large distances through material and may pass through the magnets and vacuum pipe including their magnetic fields. Being so penetrating and charged, they often contribute strongly to detector background. Secondly, the production of exotic secondary beams, is typically achieved by colliding a beam with a fixed target. To accurately understand the spectrum of transported particles it is vital to simulate the particle-matter interactions as well as the transportation through electromagnetic fields. Simulations that handle the interaction with matter are commonly made to predict particle detector response and accuracy. A 3D model with material specification is required as well as a library of particles and physics processes. If a magnetic or electric field is present, support for this is also required. Geant4~\cite{GEANT4:2003} and FLUKA~\cite{FLUKA:2015} are two software packages that provide the capability to simulate the passage of particles in matter. Geant4 provides an open source C++ class library where the user must write their own program to construct the geometry and run the simulation. The open source nature allows users to introduce their own functionality through many interfaces. Geant4 also includes an easy-to-use visualisation engine and interactive interpreter to drive the simulation. FLUKA is a closed-source Fortran code where the user describes their model through input text files. In both cases, significant effort is required to describe the geometry and materials particular to a given experiment or accelerator to be simulated. Furthermore, the user must supply a numerical or functional field map for each volume they require to have a magnetic or electric field. Numerical integration is used to calculate the particle motion in an arbitrary field, which while flexible, can suffer from the accrual of small numerical errors that can eventually lead to gross inaccuracies if used repeatedly. Limiting these effects by permitting only small steps in the field may make the simulation prohibitively computationally expensive as each high energy `primary' particle may lead to thousands of `secondary' particles that all must be tracked through the field. For the purpose of motion in an accelerator, numerical integration is often not suitable as it is not sufficiently accurate after the many steps required through the large number of different magnetic fields, hence the use of dedicated accelerator tracking codes. However, accelerator tracking codes do not provide the physical processes or the 3D geometry required for the required simulation. In the past, attempts have been made to solve this problem. One such historical example is TURTLE~\cite{Brown:1974ns}, which was originally an optical transport code with the inclusion of some in-flight decay physics processes that was subsequently modified to include duplicated parts of REVMOC~\cite{Kost:1983fy}, a Monte Carlo tool for particle matter interaction, to include a limited set of physics processes most relevant to scattering in collimators. However, this legacy Fortran code was developed by many groups around the world resulting in several versions. With the availability of more modern programming languages and parser generators for input syntax, legacy Fortran input cards are not easily understood nor used. Geant4 includes a few example applications that demonstrate a beam line simulation. However, these do not include accelerator tracking routines and use only numerical integration for particle motion; have typically less than 10 components; and are hard-coded to that beam line experiment in C++. Beam Delivery Simulation (BDSIM)~\cite{BDSIM-website,BDSIM-manual} is a program that solves this general problem of mixed accelerator and particle matter interaction simulations by creating a 3D model using the Geant4 library with the addition of accelerator tracking routines. Geant4 was chosen as it is open source and so permits the extension of tracking routines as well as being written in a more modern flexible language. The code described in this letter, BDSIM, is in fact a completely rewritten version of BDSIM described in~\cite{Agapov:2009zz}, which commenced in 2013. The core implementation has been entirely revised and validated and whilst the premise is the same, they cannot be considered equivalent. A comparable code is G4beamline~\cite{g4beamline-website}, which allows creation of a Geant4 model of beam lines. However, this was first started after the original version of BDSIM. G4beamline has more simplistic geometry in comparison to BDSIM with only simple cylinders for each magnet, and also cannot simulate circular machines. BDSIM is also set apart with its advanced scalable output and per-event analysis described in later sections permitting complicated analyses. Accelerators are typically constructed with as few classes of magnet as possible and feature repetitive patterns of sets of magnets. Whilst the aperture of the vacuum pipe may vary in size, most designs fall into a small set of cross sections. BDSIM provides a library of scalable and customisable 3D components that provide the most commonly used magnets and apertures for an accelerator. BDSIM constructs a 3D model using this library from an optical description of an accelerator, i.e. one that describes the length, type and strength of each magnet in a sequence. Along with each 3D model of the different types of magnets, appropriate fields are provided that are calculated from the rigidity-normalised strength parameters mostly commonly used to specify accelerator magnets. With BDSIM, the user may progress from a generic model to a more specific one by adding externally provided geometry for particular elements, or by placing such geometry beside the accelerator in the model. Users can overlay their own field map on top of parts or all of components and choose between provided numerical interpolators for the discrete map. A human-readable input syntax is used so the user may provide input text files to describe the model and need not write code nor compile it. BDSIM provides a unique simulation capability that can also be accessed in a very short timescale from an optical accelerator description. The distinctive capabilities allow both energy deposition throughout an accelerator to be simulated as well as interfaces between accelerators and detectors. The implementation and a worked example highlighting the features are described in the following sections. \iffalse \begin{itemize} \item \st{Accelerators \& their uses} \item \st{perfect containment?} \item \st{beam loss; radiation; radioactivation; energy deposition; charged particle background} \item \st{energy forefront machines} \item \st{LHC} \item \st{cryogenic magnets} \item collimation efficacy \item energy deposition \item linear collider ILC / CLIC \item \st{non-collision backgrounds} \item \st{current simulation tools} \item \st{MAD-X, PTC, sixtrack, SAD} \item \st{optical code; uses} \item \st{particle tracking code} \item \st{more 3d model required} \item \st{interaction with material} \item \st{building 3d model - work involved} \item \st{tools - Geant4 / FLUKA} \item \st{field maps, numerical integration, tracking accuracy, CPU efficiency} \item \st{BDSIM solution} \item \st{library of generic 3d models} \item \st{library of apertures} \item \st{ability to overlay geometry} \item \st{accelerator tracking routines / coordinate system transforms} \item Discuss previous implementation / reference previous paper a while back \end{itemize} \fi \section{Accelerator Tracking} \label{sec:accelerator-tracking} The Geant4 model constructed by BDSIM provides all the required fields for an accelerator, however, the commonly used numerical integration algorithms provided with Geant4 such as a 4$^{th}$ order Runge-Kutta integrator will not provide sufficient accuracy for tracking particles through an accelerator. Whilst these numerical integrators are suitable for arbitrary spatially and time varying magnetic and electric fields, the small errors from the numerical integration can accumulate with many successive uses leading to inaccurate results, hence these are rarely used for accelerator tracking. For the specific static magnetic fields of an accelerator, such as a pure dipole or quadrupole field, there are exact solutions that provide more accurate tracking. However, these typically use a coordinate system that follows the accelerator. Algorithms for these tracking routines as well as coordinate system transforms are included with BDSIM and used by default. The majority of accelerator tracking algorithms use a coordinate system that follows the path of the reference particle (no transverse momentum and exactly the design energy) as opposed to 3D Cartesian coordinates~\cite{Wiedemann:2007}. The Frenet-Serret is such a curvilinear coordinate system as shown in Figure~\ref{fig:frenet-serret}. \begin{figure}[htb!] \centering \includegraphics[width=7cm]{figure5.pdf} \caption{\label{fig:frenet-serret}The curvilinear Frenet-Serret coordinate system ($x$, $y$, $s$) shown following the trajectory of the reference particle. The global Cartesian system is shown (X, Y, Z).} \end{figure} With the Frenet-Serret coordinate system each element's numerical accuracy is independent from its location and there are no repeated transformations into and out of the system the algorithms are specified in. Accelerator tracking algorithms can broadly be classed in two categories: thick, and thin. In the thick regime, elements are as long as they are in reality. In the thin regime, a series of instantaneous `kicks', i.e momentum changes, interspersed with drifts are applied to the trajectory. The kicks affect only the transverse momentum and not the position of the particle. As expected, a single kick is not a physically accurate representation of the passage of a particle through a magnetic field, however, the weighted combination of many small kicks in combination with drifts does~\cite{Schachinger}. The thin regime is often used as it is more computationally performant for a solution that conserves area or volume in phase space. A solution that conserves phase space volume (i.e. \emph{symplectic}) is required as the tracking algorithms may be applied many times and any small errors will accumulate until the result is no longer physically correct. General symplectic thick solutions exist, but are often more computationally expensive. An accelerator `lattice' is typically first described by a thick lattice that matches the physical accelerator and then potentially converted to a thin lattice. Geant4 provides a series of numerical integrators that are supplied with spatial coordinates and the field values at that location and are required to predict the particle motion. These must be able to handle a variety of situations that are not encountered in an accelerator tracking program: \begin{itemize} \item An arbitrary step length. \item Particles with different masses. \item Particles with different charge or that are neutral. \item Backwards travelling particles. \item Particles travelling parallel to a magnetic field. \end{itemize} To introduce accurate and robust accelerator tracking to a Geant4 model, any new integrator must be able to handle these situations. Furthermore, the 3D nature of the model prevents the representation of the accelerator as thin lenses. As Geant4 assumes numerical integration, any new integrator must also estimate a numerical uncertainty associated with the calculation. BDSIM includes a set of integrators that encapsulate thick tracking algorithms that use the Frenet-Serret coordinate system with special provision for the aforementioned tracking scenarios that may occur in a Geant4 model. These integrators ignore the supplied field from Geant and make use of the normalised strength they are constructed with (e.g. $k_1$ for a quadrupole). For dipole and quadrupole fields, an exact analytical solution is possible for the particle motion and numerical integration is not required. For higher order magnets such as sextupoles or octupoles, 2$^{nd}$ order Euler integrators are provided. The required coordinate transforms between 3D Cartesian and the Frenet-Serret system make use of the parallel geometry constructed by BDSIM. For scenarios where these algorithms cannot be used, a 4$^{th}$ order Runge-Kutta integrator is used. It is foreseen that no one set of algorithms may be applicable to all situations, or they may be extended in future, so sets of integrators are used. The user may select from different predefined sets depending on the application. The default set is designed to be both physically accurate and match optical design tools such as {MAD\textendash X}{}. A full mathematical description of all BDSIM integrators is given in the provided documentation~\cite{BDSIM-manual}. For the most accurate model, the user may choose to use an electromagnetic field map from simulation or measurement. Such field maps can be loaded by BDSIM and overlaid on to both BDSIM and user-provided geometry replacing default fields. The supplied field maps can be easily converted from other formats using the included \texttt{pybdsim} Python utility and can be compressed using gzip. The gzstream library~\cite{gzstream-website} is used to dynamically decompress the text files as they are loaded. BDSIM includes a variety of interpolators to provide the continuous field values in 3D coordinates required by the simulation from the field specified at discrete points in the field map. The user may choose any of the Geant4 numerical integrators ranging from low order Euler to 8$^{th}$ order Runge-Kutta ones. This approach allows a user to start with a generic model that will match the design optical description and then further customise with specific field maps. \section{Validation} \label{sec:validation} \subsection{Tracking Validation} \label{ssec:trackingvalidation} Tracking accuracy is crucial for physics studies to correctly describe the machines being simulated. Imprecise tracking in any single component would result in incorrect subsequent tracking in the machine. This is particularly relevant to circular machines that would suffer immensely from cumulative errors due to the high number of components and repeated passage of particles. Individual components in BDSIM as well as the optical functions of many large current accelerators have been tested extensively in BDSIM over many years and optical agreement is expected out-of-the-box. To demonstrate tracking validation, the most obvious route is to compare with existing particle tracking software. However, care must be taken to make such a comparison correctly and accurately. In particular, most accelerator codes output data in ASCII format and the transfer of numerical coordinates via such files can lead to truncation and severe loss of precision. Furthermore, many tracking programs operate with an assumed range of validity, such as the paraxial approximation, or can be used with different integrators. {MAD\textendash X}{} PTC for example, can be used with the expanded or exact Hamiltonian, which can lead to vastly different results. Several tracking programs have implicit assumptions such as the primary particle being assumed to be fully relativistic. Particle tracking codes often allow the user to choose between computational performance and increased physical accuracy depending on their needs. With this knowledge in mind, any comparisons between codes must be carefully performed with knowledge and understanding of the limitations of particular software. The validation of BDSIM tracking has been performed and ensures that: \begin{enumerate} \item The output of the implementation of an individual integrator matches that of the mathematical description as documented in the manual. \item The automatic preparation and conversion of a model is correct and accounts for the often inconsistent output of the supported optical descriptions. \item A converted model reproduces the expected optical functions throughout a lattice. \end{enumerate} In addition, to the caveats of using other tracking software, we must consider also how information is recorded in BDSIM. In particle tracking software, an algorithm is applied to a set of coordinates representing the traversal through an accelerator component. The coordinates reported after this single traversal represent the particle precisely at the end of the element. However, in BDSIM, we make a 3D model where no 2D shapes can exist. It is not possible through the interfaces in Geant4 to record particles at only one surface of a multi-faceted solid (e.g. one face of a cube). We must also avoid coplanar faces or geometrical overlaps with a numerically resolvable gap in-between each element for robust geometry navigation and tracking. In BDSIM, the particle coordinates are recorded on the one step taken through the 1\,nm thin sampler, which is placed after the element with a 1\,nm gap between each surface. This difference in distance may introduce a very small difference in coordinates and agreement is expected only to this degree. The distance between surfaces in BDSIM was carefully chosen and the spacing of faces around the end of each element in both the mass world and the several parallel worlds chosen so as to avoid coplanar faces between worlds wherein Geant4 would incorrectly navigate through the geometry. Particle to particle comparisons show residuals at the level of $10^{-9}$ in both position (m) and transverse (normalised) momentum for particles in the paraxial approximation for the most common design of magnets (length and strength) found in a large variety of accelerators. The comparison was made by specially compiling BDSIM with double precision floating point output and increasing the precision of the output from {MAD\textendash X}{} PTC. Optical comparisons for a variety of accelerators including the LHC, the Accelerator Test Facility 2 (ATF2) at KEK, Japan, the Diamond Light Source (DLS), UK, show excellent agreement with both {MAD\textendash X}{} PTC and the optical functions from {MAD\textendash X}{}. The LHC demonstrates accuracy through a large number of components. The ATF2 demonstrates correct transport through a highly non-linear lattice where pole face rotations and dipole fringe fields are important. The ATF2 magnifies a beam before creating a nanometre-level focus, so any small deviations are readily observable. The DLS demonstrates a machine whose performance is highly dependent on chromatic and dispersive effects. When testing large lattices it is common to witness a deviation in the mean in several parameters. This is due to the finite sample of particles used, where the initial sample-based mean is non-zero. Such a non-zero offset is then witnessed as it propagates. BDSIM includes an advanced option where the sample deviation may be subtracted by pre-generating the full distribution and calculating the sample mean from it. This is only valid for large sample sizes and is used for developer optical comparisons. \begin{figure*} \normalsize \centering \includegraphics[width=0.97\textwidth]{figure17.pdf} \caption{\label{fig:validationatf2} Comparison of beam size (top) and angular size (bottom) between tracking in BDSIM (points) and the {MAD\textendash X}{} model (solid line) throughout the Accelerator Test Facility 2 (ATF2) extraction line at KEK, Japan. After extraction from a damping ring, the beam progresses left to right along a single pass extraction line. The comparison shows excellent agreement throughout as the beam size is strongly manipulated. The effect of dipole pole face rotations is not visible directly but is evident in the agreement that would be coarsely wrong if this minuscule effect was omitted.} \end{figure*} Although the tracking routines provided are demonstrably accurate, as already mentioned, the 3D model must include a small numerically resolvable gap between each volume. For long term tracking in circular accelerators, such geometrical effects accrue and can result in inaccurate tracking. However, the purpose of BDSIM is not to perform long-term tracking studies, but to simulate losses and subsequent radiation. As shown in Section~\ref{sec:example}, a collimation simulation typically starts only with particles that impact a collimator. For a typical LHC collimation study, up to 200 turns of tracking are permitted~\cite{Bruce:2014}. For a particle at approximately one sigma of the nominal distribution, an offset of 3\,$\mathrm{\mu}$m is accrued after 200 turns which is acceptable. As tracking in a BDSIM model is ultimately performed in Cartesian coordinates, BDSIM cannot be used for arbitrarily large circular machines. This is because the numbers for each coordinate are stored as double precision floating point numbers. When a particle makes an excursion to the furtherst part of the ring where there maybe an offset of tens of kilometres, the $\sim$15 significant figures will lead to a lack of precision in curvilinear coordinates. This is not foreseen as a problem as the largest existing machine is the LHC, where the tracking has been shown to be acceptable for radiation simulations. A common concern in particle tracking software is whether the tracking is symplectic. This is equivalent to precisely conserving energy and phase space volume after both a single and multiple applications of a transfer map or algorithm. The integrators of the linear elements in BDSIM are thick lens solutions and are symplectic. The higher order integrators are low-order semi-implicit Euler integrators that are symplectic. These conserve energy but cannot be used accurately for large step sizes and be physically accurate. In practice, the numerical integration error is estimated and returned to Geant4 that limits the step size in strongly varying magnetic fields. In validation testing, it was found that the accrued geometrical errors dominate in larger circular models. In linear models, the tracking is sufficiently accurate and symplecticity is not of concern. In the case of circular machines, it is possible to use a one-turn-map with BDSIM. This is an externally provided transfer map representing a single turn of the circular machine that can be used to correct the particle coordinates on each turn. If the particle completes a turn of the circular machine without any physics process being invoked, the coordinates after the turn are calculated independently for that turn using the map and the particle coordinates updated. This approach allows a maximum error of approximately $1\,\mathrm{\mu}$m to be achieved for up to 10,000 turns of the LHC using a 14th order map calculated by {MAD\textendash X}{} PTC. It should be noted however, that if the lattice contains non-linear elements, the map will typically be non-symplectic. However, with a high order map, it would take a high number of turns outside the applicability of BDSIM to reach this limitation. For the purpose of simulating accelerators smaller than the LHC and linear or single pass sections, the tracking is highly accurate. \subsection{Quality Assurance} \label{ssec:qualityassurance} To be used in a predictive capacity, aside from validation there must be assurance that any changes or modifications to the software do not affect any known outcome. Any new additions must also be demonstrated to work reliably with a variety of input. BDSIM uses two main types of tests to ensure the quality and stability of the software, namely unit and regression tests. Unit tests are minimal input examples that exploit a particular feature. Running such an example in BDSIM forces use of the feature in the BDSIM code and tests it executes without problem. For every test of correct input there are matching tests of incorrect input that BDSIM should reject. The condition for the test to pass in this case is that BDSIM should exit. At the time of writing there are 689 unit tests that cover 87.61\% of the C++ code in BDSIM. The parts not covered are identified as parts that are for external interfaces and are tested elsewhere or for interactive visualisation that cannot be tested automatically, but are however covered by regular use. The tests are defined in CMake~\cite{CMAKE-website} as part of the build system throughout the examples directory and are run with CTest, which is part of CMake. Every example also forms a unit test. The majority of tests are run single-threaded within 1hr and are automatically run at the Royal Holloway Faraday Cluster up to every hour if the code is updated in the public-facing git repository. The results are reported to a CDash website hosted at Royal Holloway, where code coverage and test results and output can be inspected. Developers are automatically notified of newly failing tests due to commits they have made. Several builds for Scientific Linux 6 and 7 and Ubuntu operating systems are made. In addition, separate builds for Geant 4.10.1 through to 4.10.5 are made and all tests running for each. This variety gives very good coverage of operating systems and environments that are expected to be used for BDSIM. In addition to unit tests, regression test are used. Unit tests ensure that there is no syntactic or logical problem with the code, but not that it achieves the correct result. Regression tests are used to compare the output of a fresh simulation with a manually validated result. To make the comparison, a special tool, the \texttt{comparator}, is included with BDSIM. This is capable of dynamically inspecting all the data structures found in a BDSIM output file and comparing them. In the case of coordinates at a sampler plane, individual entries can be compared within the numerical precision of the output. In these cases, tests are conducted with the same random number generator seed, so the output should be identical. In the case where two histograms are compared, the contents can be compared statistically using the Student's T-Test. Several reference output files are created for large accelerators such as the ATF2, DLS and the LHC included in the examples. These contain a large variety of elements with a large variety of settings, so provide a high level of coverage over tracking algorithms. Any change in these will be shown by the single-turn or pass coordinates being different. The developers can then investigate to identify the precise cause of the discrepancy. Aside from complete lattices, many references files are included for key features of BDSIM as well as several examples that use a combination of many options. Aside from developer-side testing, BDSIM uses a publicly visible software repository using the git software versioning software~\cite{GIT-website}. The BDSIM website, (\url{http://bitbucket.org/jairhul/bdsim}), also hosts a public issue tracker where anyone can report an issue and is regularly updated by the developers. The use of the git software versioning system in a public repository allows users to review and understand both how BDSIM works as well as possibly contribute. The authors have found the open-source nature to be invaluable in fostering a community that understands and contributes to the code. Usage of the code is documented in an included manual prepared using the commonly used Sphinx documentation system~\cite{Sphinx-website}. This allows export of the manual as both an HTML website and \LaTeX{} document that is rendered as a PDF, ensuring both are consistent. The classes and structure of the code is documented using Doxygen~\cite{Doxygen-website} that parses comments in the source files. The code is fully documented using this system and the output Doxygen website is publicly hosted.
\section{Introduction}\label{s1} Recently there has been an increasing interest in distribution dependent stochastic differential equations (DDSDE for short) of type \begin{equation}\label{1.1} \barr{l} dX(t)=b(t,X(t),\call_{X(t)})dt+ \sigma(t,X(t),\call_{X(t)})dW(t)\vsp X(0)=\xi_0,\earr \end{equation} on $\rr^d$, where $W(t),\ t\ge0$, is an $(\calf_t)$-Brownian motion on a probability space $(\ooo,\calf,P)$ with normal filtration $(\calf_t)_{t\ge0}$. The coefficients $b,$ $\sigma$ are defined on $[0,\9)\times\rr^d\times\mathcal{P}(\rr^d)$ are $\rr^d$ and $d\times d$-matrix valued, respectively (sa\-tis\-fying conditions to be specified below). Here $\mathcal{P}(\rr^d)$ denotes the set of all probability measures on $\rr^d$. In \eqref{1.1}, $\call_{X(t)}$ denotes the law of $X(t)$ under $P$ and $\xi_0$ is an $\calf_0$-measurable $\rr^d$-valued map. Equations as in \eqref{1.1} are also referred to as McKean-Vlasov SDEs. Here we refer to the classical papers \cite{4*}, \cite{1*}, \cite{2*}, \cite{5*}, \cite{3*}, and, e.g., the more recent papers \cite{9*}, \cite{8*}, \cite{11*}, \cite{10*}, \cite{12*}, \cite{7*} and \cite{6*}. By It\^o's formula, under quite general conditions on the coefficients, the time marginal laws $\mu_t:=\call_{X(t)},$ $t\ge0$, with $\mu_0:=\mbox{law of }\xi_0$, of the solution $X(t),\ t\ge0$, to \eqref{1.1} satisfy a {\it nonlinear} Fokker-Planck equation (FPE for short). More precisely, for all $\vf\in C^2_0(\rr^d)$ (=~all twice differentiable real-valued functions of compact support) and, for all $t\ge0$, \begin{equation}\label{1.2} \int_{\rr^d}\vf(x)\mu_t(dx)=\int_{\rr^d}\vf(x)\mu_0(dx)+\int^t_0\int_{\rr^d}L_{\mu_s}\vf(s,x)\mu_s(dx)ds,\end{equation}where, for $x\in\rr^d,\ t\ge0,\ a_{ij}:=(\sigma\sigma^T)_{i,j},$ $1\le i,j\le d,$ \begin{equation}\label{1.3} \dd L_{\mu_t}\vf(t,x):=\dd\frac12\sum\limits^d_{i,j=1}\!a_{ij}(t,x,\mu_t)\,\frac{\pp^2}{\pp x_i\pp x_j}\,\vf(x) \dd+\!\!\sum\limits^d_{i=1}\!b_i(t,x,\mu_t)\,\frac\pp{\pp x_i}\,\vf(x), \end{equation} is the corresponding Kolmogorov operator. For equations of type \eqref{1.2}, we refer the reader, e.g., to \cite{13*}. We note that \eqref{1.2} is also shortly written as \begin{equation}\label{1.3prim} \pp_t\mu_t=L^*_{\mu_t}\mu_t\mbox{ with }\mu_0\mbox{ given}.\end{equation} Hence, if one can solve \eqref{1.1}, one obtains a solution to \eqref{1.2} this way. In the special case where the solutions $\mu_t$, $t\ge0$, to \eqref{1.2} have densities with respect to the Lebesgue measure $dx$, i.e., $\mu_t(dx)=u(t,x)dx,$ $t\ge0$, \eqref{1.2} can be rewritten (in the sense of Schwartz distributions) as (cf.\cite{8a}) \begin{equation}\label{1.4} \barr{rl} \dd\frac\pp{\pp t}\,u(t,x)=\!\!\! &\dd\frac12\sum^d_{i,j=1}\frac{\pp^2}{\pp x_i\pp x_j}\,[a_{ij}(t,x,u(t,\cdot)dx)u(t,x)]\vsp &-\dd\sum^d_{i=1}\frac\pp{\pp x_i}[b_i(t,x,u(t,\cdot)dx)u(t,x)]\vsp u(0,x)=\!\!\!&u_0(x)\ \(=\dd\frac{d\mu_0}{dx}\,(x)\),\earr\end{equation}$x\in\rr^d,\ t\ge0,$ or, shortly, \begin{equation}\label{1.5} \pp_tu=\frac12\,\pp_i\pp_j(a_{ij}(u)u)-\pp_i(b_i(u)u),\ u(0,\cdot)=u_0.\end{equation} In this paper, we want to go in the opposite direction, that is, we first want to solve \eqref{1.2} and, using the obtained $\mu_t$, $t\ge0,$ we shall obtain a (probabilistically) weak solution to \eqref{1.1} with the time marginal laws of $X(t), t\ge0$, given by these $\mu_t,\ t\ge0$. It turns out that, once one has solved \eqref{1.2}, which is in general a hard task, and if one can prove some mild integrability properties for the solutions, a recent version of the so-called {\it superposition principle} by Trevisan in \cite{8} (generalizing earlier work by Figalli \cite{14*}), in connection with a classical result by Stroock and Varadhan (see, e.g., \cite{15*}) yields the desired weak solution of \eqref{1.1} (see Section \ref{s2} below for details). We would like to mention at this point that, by the very same result from \cite{8}, one can also easily prove that, if \eqref{1.1} has a unique solution in law, then the solution to \eqref{1.2} does not only exist as described above, but is also unique. In this paper, however, we concentrate on existence of weak solutions to \eqref{1.1}. We shall do this in the singular case, where the coefficients in \eqref{1.1} are of {\it Nemytskii-type}, that is, we consider the following situation: $b_i,a_{ij}$ depend on $\mu $ in the following way: \begin{equation}\label{1.6} b_i(t,x,\mu ):=\bar b_i\(t,x,\dd\frac{d\mu}{dx}\,(x)\),\ \ \ a_{ij}(t,x,\mu ):=\bar a_{ij}\(t,x,\dd\frac{d\mu}{dx}\,(x)\), \end{equation}for $t\ge0,\ x\in\rr^d,\ 1\le i,j\le d,$ where $\bar b_i,\bar a_{ij}:[0,\9)\times\rr^d\times\rr\to\rr$, are measurable functions. Then, under the conditions on $\bar b_i$ and $\bar a_{ij}$, $1\le i,j\le d$, specified in Section {\rm\ref{s3}}, we shall construct solutions $(\mu_t)_{t\ge0}$ to \eqref{1.1} which are absolutely continuous with respect to the Lebesgue $dx$, i.e., $\mu_t(dx)=u(t,x)dx,$ $t\ge0$. So, as indicated above, by the superposition principle, we obtain weak solutions to DDSDEs of type \begin{equation}\label{1.7} \barr{rl} dX(t)=\!\!\! &\bar b\(t,X(t),\dd\frac{d\call_{X(t)}}{dx}\,(X(t))\)dt\vsp &+\bar\sigma\(t,X(t),\dd\frac{d\call_{X(t)}}{dx}\,(X(t))\)dW(t),\vsp X(0)=\!\!\!&\xi_0,\earr\end{equation}with $(\bar\sigma\bar\sigma^T)_{i,j}=\bar a_{ij}$. In particular, we obtain a probabilistic representation of the solution $\mu_t$, $t\ge0$, of the nonlinear FPE \eqref{1.2} (or \eqref{1.4}) as the time marginal laws of a stochastic process, namely the solution of the DDSDE \eqref{1.7}. We would like to emphasize that the coefficients as in \eqref{1.7}, which we consider below, have no continuity properties with respect to their dependence on the law $\call_{X(t)}$ of $X(t)$, such as those imposed in the existing literature on the subject. Nevertheless, such {\it Nemytskii-type}-dependence is very natural and, of course, independent of the $dx$-version of the Lebesgue density of $\call_{X(t)}$ we choose in \eqref{1.7}, since we are looking only for solutions of \eqref{1.7} in the class with $\call_{X(t)}$ being absolutely continuous with respect to $dx$. Precise conditions on the coefficients $\bar b_i,\bar a_{ij}$ are formulated in Section \ref{s3} (there, for simplicity, denoted by $b_i,a_{ij}$). Our main existence results for solutions of the nonlinear FPE \eqref{1.2} are Theo\-rems \ref{t1} and \ref{t2} below. Our main result on solutions to \eqref{1.1} (more precisely, \eqref{1.7}) is Theorem \ref{t4.1}. Subsequently, in Remark \ref{r4.1} we discuss connections with previous related, but much more special, results from \cite{3}--\cite{5}. A class of cases where we also have uniqueness in law results for solutions to \eqref{1.7} is described in Remark \ref{r4.2}. \medskip\noindent{\bf Notations.}~Given an open subset $\calo\subset\rr^d$, we denote by $L^p(\calo)$, \mbox{$1\le p\le\9$,}\break the standard Lebesgue $p$-integrable functions on $\calo$, and by $H^1(\calo)$, the Sobolev space $\{u\in L^2(\calo);\nabla u\in L^2(\calo)\}.$ We set $H^1_0(\calo)=\{u\in H^1(\calo);$ $ u=0\mbox{ on }\pp\calo\}$ and denote by $H\1(\calo)$ the dual space of $H^1_0(\calo)$. By $C^\9_0(\calo)$ we denote the space of infinitely differentiable functions with compact support in $\calo$. We set $H^1=H^1(\rr^d)$, $H\1=H\1(\rr^d)$ and denote by $H^1_{\rm loc}$ the corresponding local space. We also set $L^p=L^p(\rr^d)$ with the norm denoted $|\cdot|_p$ and $L^p_{\rm loc}=L^p_{\rm loc}(\rr^d)$, $1\le p\le\9.$ By $\cald'(\rr^d)$ and $\cald'((0,\9)\times\rr^d)$, we denote the space of distributions on $\rr^d$ and $(0,\9)\times\rr^d$, respectively. We shall denote either by $\frac{\partial u}{\partial x_j}$ or by $u_{x_j},D_j$, $u$ the partial derivative of the function $u=u(x_1,...,x_d)$ with respect to $x_j,$ $1\le j\le d.$ By $D^2_{ij},$ $i,j=1,...,d,$ we shall denote the second order derivatives $\frac{\partial^2u}{\partial x_i\partial x_j}$. We denote by $C(\rr^d\times\rr)$ and $C(\rr^d)$ the space of continuous functions on $\rr^d\times\rr$ and $\rr$, respectively, and by $C_b(\rr^d\times\rr)$ and $C_b(\rr)$ the corresponding subspaces of continuous and bounded functions. By $C^1(\rr^d\times\rr)$ and $C^1(\rr)$ we denote the spaces of continuously differentiable functions on $\rr^d\times\rr$ and $\rr$, respectively. Finally, $C^1_b$ is the space of bounded continuously differentiable functions with bounded derivatives. If $\calx$ is a real Banach space and $0<T<\9$, we denote by $L^p(0,T;\calx)$ the space of Bochner $p$-integrable functions $u:(0,T)\to\calx$ and by $C([0,T];\calx)$ the space of of $\calx$-valued continuous functions on $[0,T]$. \section{From nonlinear FPEs to DDSDEs:\\ general scheme}\label{s2} \setcounter{equation}{0} Let $a_{ij},b_i:[0,\9)\times\rr^d\times\calp(\rr^d)\to\rr,$ $1\le i,j\le d$, be measurable. \begin{hypothesis}\label{h2.1} There exists a solution $(\mu_t)_{t\ge0}$ to \eqref{1.2} such that \begin{itemize} \item[\rm(i)] $\mu_t\in\calp(\rr^d)$ for all $t\ge0$. \item[\rm(ii)] $(t,x)\mapsto a_{ij}(t,x,\mu_t)$ and $(t,x)\mapsto b_i(t,x,\mu_t)$ are measurable and $$\int^T_0\int_{\rr^d}[|a_{ij}(t,x,\mu_t)|+|b_i(t,x,\mu_t)|]\mu_t(dx)dt<\9,$$for all $T\in(0,\9).$ \item[\rm(iii)] $[0,\9)\ni t\mapsto\mu_t$ is weakly continuous. \end{itemize} \end{hypothesis} Under Hypothesis \ref{h2.1}, we can apply the superposition principle (see Theorem 2.5 in \cite{8}) for {\it linear} FPEs applied to the ({\it linear}) Kolmogorov operator \begin{equation}\label{e2.1z} L_{\mu_t}:=\frac12\sum^d_{i,j=1}a_{ij}(t,x,\mu_t)\frac{\pp^2}{\pp x_i\pp x_j}+\sum^d_{i=1}b_i(t,x,\mu_t)\frac\pp{\pp x_i}, \end{equation}with $(\mu_t)_{t\ge0}$ from Hypothesis \ref{h2.1} fixed. More precisely, by Theorem 2.5 in \cite{8}, there exists a probability measure $P$ on $C([0,T];\rr^d)$ equipped with its Borel $\sigma$-algebra and its natural normal filtration obtained by the evaluation maps $\pi_t$, $t\in[0,T]$, defined by $$\pi_t(w):=w(t),\ w\in C([0,T],\rr^d),$$solving the martingale problem (see \cite{8}, Definition 2.4) for the time-dependent ({\it linear}) Kolmogorov ope\-ra\-tor $\frac\pp{\pp t}+L_{\mu_t}$ (with $(\mu_t)_{t\ge0}$ as above fixed) with time marginal laws $$P\circ\pi^{-1}_t=\mu_t,\ t\ge0.$$ Then, a standarad result (see Theorem 4.5.2 in \cite{15*}) implies that there exists a $d$-dimensional $(\calf_t)$-Brownian motion $W(t)$, $t\ge0$, on a stochastic basis $(\ooo,\calf,(\calf_t)_{t\ge0},Q)$ and a continuous $(\calf_t)$-progressively measurable map $X:[0,\9)\times\ooo\to\rr^d$ satisfying the following (DD)SDE \begin{equation}\label{e2.2z} dX(t)=b(t,X(t),\mu_t)dt+\sigma(t,X(t),\mu_t)dW(t),\end{equation} with the law $$Q\circ X\1=P,$$ where $\sigma=((a_{ij})_{1\le i,j\le d})^{\frac12}.$ In particular, we have, for the marginal laws, \begin{equation}\label{e2.3z} \call_{X(t)}:=Q\circ X(t)\1=\mu_t,\ t\ge0.\end{equation} \begin{remark}\label{r2.1}\rm Because of \eqref{e2.3z}, the process $X(t),\ t\ge0$, is also called a {\it probabilistic representation} of the solution $(\mu_t)_{t\ge0}$ for the nonlinear FPE \eqref{1.2}.\end{remark} \begin{remark}\label{r2.2} \rm It is much harder to prove that the solution to SDE (\ref{e2.2z}) for fixed $(\mu_t)_{t\ge0}$ is unique in law, provided its initial distribution is $\mu_0$, which would, of course, be very desirable. For this, one has to prove the uniqueness of the solutions to the {\it linear} Fokker-Planck equation $$\pp_t\nu_t=L^*_{\mu_t}\nu_t,\ \nu_0=\mu_0$$for all initial condition of the type $\mu_0=\delta_x$, $x\in\rr^d$ (see \cite{15*}, Theorem 6.2.3). For a large class of initial conditions $\mu_0$, this was achieved in certain cases where $d=1$ (see \cite{4}, \cite{5}, \cite{13*a}). \end{remark} \paragraph{\it Conclusion.} To weakly solve DDSDE \eqref{1.1}, we have to solve the corres\-pon\-ding nonlinear FPE \eqref{1.2} (hard!) and then check Hypothesis \ref{h2.1} above. \section{Existence of solutions to the nonlinear~FPEs} \label{s3} \setcounter{equation}{0} Consider the following time-independent special case of \eqref{1.4} with Nemytskii-type dependence of the coefficients on $u(t,x)dx,$ $t\ge0$, i.e., the nonlinear Fokker-Planck equation \begin{equation}\label{e1.1} \barr{l} \dd\frac{\pp u}{\pp t}-\sum^d_{i,j=1}D^2_{ij}(a_{ij}(x,u)u)+{\rm div}(b(x,u)u)=0\mbox{ in }\cald'((0,\9)\times\rr^d),\vsp u(0,x)=u_0(x),\ x\in\rr^d,\earr\end{equation}where $b(x,u)=\{b_i(x,u)\}^d_{i=1}$.\medskip We shall study this equation under two different sets of hypotheses spe\-ci\-fied in the following. \begin{itemize} \item[(H1)] $a_{ij}\in C^2(\rr^d\times\rr)\cap C_b(\rr^d\times\rr^d),\ (a_{ij})_{x}\in C_b(\rr^d\times\rr;\rr^d),\ \mbox{$\ff a_{ij}=a_{ji},$} $ $ i,j=1,...,d.$ \item[(H2)] $\sum\limits^d_{i,j=1}(a_{ij}(x,u)+(a_{ij}(x,u))_uu)\xi_i\xi_j\ge\g|\xi|^2,\ \ff\xi\in\rr^d,\ x\in\rr^d,\ u\in\rr,$ where $\g>0.$ \item[(H3)] $b_i\in C_b(\rr^d\times\rr)\cap C^1(\rr^d\times\rr),$ $b_i(x,0)\equiv0,$ $\ff x\in\rr^d,\ i=1,...,d.$ \item[(H1)$'$] $a_{ij}(x,u)\equiv a_{ij}(u),\ a_{ij}\in C^2(\rr)\cap C_b(\rr),$ $a_{ij}=a_{ji},$ $\ff i,j=1,...,d.$ \item[(H2)$'$] $\sum\limits^d_{i,j=1}(a_{ij}(u)+u(a_{ij}(u))_u)\xi_i\xi_j\ge0,\ \ff\xi\in\rr^d,\ u\in\rr.$ \item[(H3)$'$] $b_i\in C_b(\rr)\cap C^1(\rr^d),\ b_i(0)=0,\ i=1,...,d.$ \end{itemize}Here $(a_{ij}(x,u))_u=\frac\pp{\pp u}\,a_{ij}(x,u),\ \ff u\in\rr,$ and $(a_{ij})_x(x,u)=(\nabla_x a_{ij})(x,u)$, $x=\{x_i\}^d_{i=1}$. The first set of hypotheses, that is (H1)--(H3), allows for nonlinear non\-de\-ge\-nerate FPEs with $x$-dependent coefficients, while the se\-cond set (H1)$'$--(H3)$'$ allows for degenerate nonlinear FPEs, however, with $x$-independent coefficients. Nonlinear FPEs of the form \eqref{e1.1} describe in the mean field theory the dynamics of a set of interacting particles or many body systems. The function $u=u(t,x)$ is associated with the probability to find a certain subsystem or particle at time $t$ in the state $x$. Equation \eqref{e1.1} arises also as a closed loop system corresponding to a velocity field system $$\frac{\pp v}{\pp t}=F(x,u)v=\sum^d_{i,j=1}D^2_{ij}(a_{ij}(x,u)v)-{\rm div}(b(x,u)v)$$ with coefficients depending on the probability density $u$. If $v=u$, one may view this system as a statistical feedback (see \cite{8a}). The first part of this section is concerned with the existence of a weak (mild) solution to equation \eqref{e1.1} in the space $L^1(\rr^d)$. This result is obtained via the Crandall and Liggett existence theorem for the nonlinear Cauchy problem \begin{equation} \barr{l} \dd\frac{du}{dt}\,(t)+Au(t)=0,\ t\ge0,\vsp u(0)=u_0,\earr\label{e1.2} \end{equation} in a Banach space $\calx.$ An operator $A:D(A)\subset\calx\to\calx$ (possibly multivalued) is said to be $m$-accretive if, for each $\lbb>0$, the range $R(I+\lbb A)$ of the operator $I+\lbb A$ is all of $\calx$ and \begin{equation}\label{e1.3} \|(I+\lbb A)\1u-(I+\lbb A)\1v\|_\calx\le\|u-v\|_\calx,\ \ff u,v\in\calx,\ \lbb>0.\end{equation} The continuous function $u:[0,\9)\to\calx$ is said to be a mild solution to \eqref{e1.2} if, for each $0<T<\9,$ \begin{eqnarray} &&u(t)=\lim\limits_{h\to0} u_h(t)\mbox{ strongly in $\calx$, uniformly in $t\in[0,T]$}\hspace*{18mm}\label{e1.4}\\ &&\mbox{where $u_h:[0,T]\to\calx$ is defined by}\nonumber\\ &&u_h(t)=u^i_h,\ t\in[ih,(i+1)h),\ i=0,1,...,N=\left[\frac Th\right].\label{e1.5}\\ &&u^i_h+hAu^i_h=u^{i-1}_h,\ i=1,...,N;\ u^0_h=u_0.\label{e1.6} \end{eqnarray} By the Crandall and Liggett theorem (see, e.g., \cite{1}, p.~99), if $A$ is $m$-accretive, then for each $u_0\in\overline{D(A)}$ (the closure of $D(A)$ in $\calx)$ there is a unique mild solution $u\in C([0,\9);\calx)$ to \eqref{e1.2}. Moreover, the map $u_0\to u(t)$ is a continuous semigroup of contractions on $\overline{D(A)}$ equipped with $\|\cdot\|_\calx$. The first main existence result of this section, Theorem \ref{t1}, is obtained by \mbox{writing} equation \eqref{e1.1} in the form \eqref{e1.2} with a suitable $m$-accretive operator $A$ in the space $\calx=L^1(\rr^d)$. It should be said that the space $L^1(\rr^d)$ is not only appropriate to re\-pre\-sent equation \eqref{e1.1} in the form \eqref{e1.2}, but it is the unique $L^p(\rr^d)$-space in which the operator defined by equation \eqref{e1.1} is $m$-accretive, that is, which gives the parabolic character of this equation. Only in the particular case of porous media equations (i.e., \eqref{e1.1} with $b\equiv0$), an alternative is the Sobolev space $H\1(\rr^d)$, but this does not work for the more general case \eqref{e1.1}. On the other hand, taking into account the significance of the solution $u$ as probability density, the space $L^1$ is very convenient for the treatment of equation \eqref{1.1}. Our work \cite{3} contains the following special case of \eqref{e1.1}: \begin{equation}\label{e1.7} \frac{\pp u}{\pp t}-\D\beta(u)+{\rm div}(b(u)u)=0\mbox{ in }(0,T)\times\rr^d, \end{equation}where $\beta:\rr\to2^\rr$ is a maximal monotone (multivalued) function with $\sup\{|s|:s\in\beta(r)\}\le C|r|^m,\ r\in\rr,$ for some $C,m\in[0,\9)$. (See also~\cite{2}.) In the special case $b\equiv0$ and $d=1$, related results were obtained in \cite{4}, \cite{5}. However, the present case is much more difficult and the arguments of \cite{3} are not applicable here. \subsection{Existence for FPEs in the nondegenerate,\\ $x$-dependent case} Define in the space $\calx=L^1$ the operator $A:D(A)\subset L^1\to L^1$, \begin{eqnarray} Au&=&-\sum^d_{i,j=1}D^2_{ij}(a_{ij}(x,u)u)+{\rm div}(b(x,u)u),\ \ff u\in D(A),\label{e2.1}\\ D(A)&=&\left\{u\in L^1;-\sum^d_{i,j=1}D^2_{ij}(a_{ij}(x,u)u)+{\rm div}(b(x,u)u)\in L^1\right\},\label{e2.2} \end{eqnarray}where $D^2_{ij}$ and div are taken in the sense of Schwartz distributions on $\rr^d$, i.e., in $\cald'(\rr^d)$. We note that, since by (H1), (H3), $a_{ij}(x,u)u$, $b_i(x,u)u\in L^1$, $\ff i,j=1,...,d$, $\ff u\in L^1$, $Au$ is well defined in $\cald'(\rr^d)$. Moreover, since $C^\infty_0(\rr^d)\subset D(A)$, it follows that $D(A)$ is dense in $L^1$. Since we are going to represent equation \eqref{e1.1} as \eqref{e1.2} with $A$ defined by \eqref{e2.1}--\eqref{e2.2}, we must prove that $A$ is $m$-accretive, that is, $R(I+\lbb A)=L^1$ and \eqref{e1.3} holds in $\calx=L^1$ for all $\lbb>0.$ For this purpose, we shall prove the following result. \begin{proposition}\label{p1} Let {\rm(H1)--(H3)} hold. Then, for each $f\in L^1$ and $\lbb>0$, the equation \begin{equation}\label{e2.3} u-\lbb\sum^d_{i,j=1}D^2_{ij}(a_{ij}(x,u)u)+\lbb\ {\rm div}(b(x,u)u)=f\mbox{ in }\cald'(\rr^d)\end{equation}has a unique solution $u=u(\lbb,f)\in D(A).$ Moreover, we have, for all $\lbb>0,$ \begin{eqnarray} &&|u(\lbb,f_1)-u(\lbb,f_2)|_1\le|f_1-f_2|_1,\ \ff f_1,f_2\in L^1,\label{e2.5}\\ &&(I+\lbb A)\1f\ge0,\mbox{ a.e. in }\rr^d,\mbox{ if }f\in L^1,\ f\ge0,\ \mbox{ a.e. in }\rr^d,\label{e2.7}\\ &&\int_{\rr^d}(I+\lbb A)\1f(x)dx=\int_{\rr^d}f(x)dx,\ \ff f\in L^1,\ \lbb>0.\label{e2.8} \end{eqnarray} \end{proposition} \noindent{\bf Proof.} In the following, we shall simply write $$a_{ij}(u)=a_{ij}(x,u),\ x\in\rr^d,\ u\in\rr,\ i,j=1,...,d.$$ We set $$\barr{c} a^*_{ij}(u)\equiv a_{ij}(x,u)u,\ x\in\rr^d,\ u\in\rr,\ \ff i,j=1,...,d,\vsp b(x,u)=\{b_i(x,u)\}^d_{i=1},\ b^*(x,u)=b(x,u)u,\ x\in\rr^d,\ u\in\rr.\earr$$We note that, by (H2), we have \begin{equation} \sum^d_{i,j=1}(a^*_{ij})_u(x,u)\xi_i\xi_j\ge\g|\xi|^2,\ \ff\xi\in\rr^d,\ x\in\rr^d,\ u\in\rr,\label{e2.11} \end{equation}where $\gamma>0.$ We shall first prove Proposition \ref{p1} under the additional hypotheses \begin{itemize} \item[\rm(K)] $(a^*_{ij})_u\in C_b(\rr^d\times\rr), b_i\in C^1_b(\rr^d\times\rr)$, and\end{itemize} \begin{equation}\label{e3.16az} \barr{r} |(a^*_{ij})_u(x,u)-(a^*_{ij})_u(x,\bar u)| + |\nabla_x(a^*_{ij})(x,u)-\nabla_x(a^*_{ij})(x,\bar u)|_d\vsp \le C|u-\bar u|,\ \ff u,\bar u\in\rr,\ x\in\rr^d,\earr\end{equation} \begin{itemize}\item[\ ]for $i,j=1,...,d.$\end{itemize} We rewrite \eqref{e2.3} as $$u-\lbb\sum^d_{i,j=1}D^2_{ij}(a^*_{ij}(u))+\lbb\ {\rm div}(b^*(x,u))=f\mbox{ in }\cald'(\rr^d).\leqno\eqref{e2.3}'$$ Equivalently, if $Du\in L^1_{\rm loc},$ then $$\begin{array}{r} u-\lbb\sum\limits^d_{i,j=1}D_{i} ((a^*_{ij})_u(u)D_ju+(a^*_{ij})_{x_j}(x,u)u)+\lbb\ {\rm div}(b^*(x,u))=f\\\mbox{ in }\cald'(\rr^d).\end{array}\leqno\eqref{e2.3}''$$ We also set $$\barr{rcl} b_\9&=&\sup\{|b_i(x,u)|;\ (x,u)\in\rr^d\times\rr,\ i=1,...,d\},\vsp c_\9&=&\sup\{|(a_{ij})_{x_j}(x,u)|;\ (x,u)\in\rr^d\times\rr,\ i,j=1,...,d\}.\earr$$ (By virtue of (K), the formulation $\eqref{e2.3}''$ of $\eqref{e2.3}'$ makes sense only if $D_ju\in L^1_{\rm loc}.)$ For each $N>0$, we set $B_N=\{\xi\in\rr^d;\ |\xi|< N\}$. We have \begin{lemma}\label{l1} Let $f\in L^2$ and $0<\lbb<\lbb_0=\g(b^2_\9+c^2_\9)\1.$ Then, for each $N$ there is at least one solution $u_N\in H^1_0(B_N)$ to the equation \begin{equation}\label{e2.12} \barr{l} u-\lbb\dd\sum^d_{i,j=1}D^2_{ij}(a^*_{ij}(u))+\lbb\ {\rm div}(b^*(x,u))=f\mbox{ in }B_N,\vsp u=0\mbox{ on }\pp B_N,\earr\end{equation} which satisfies the estimate \begin{equation}\label{e2.13} \|u_N\|^2_{L^2(B_N)}+\lbb\g\|\nabla u_N\|^2_{L^2(B_N)}\le C\|f\|^2_{L^2(B_N)},\end{equation}where $C$ is independent of $N$ and $\lbb.$\end{lemma} \noindent{\bf Proof.} For $\rho>0$, we set $\calm_\rho=\{v\in L^2(B_N);\ \|v\|_{L^2(B_N)}\le\rho\}$ and consider the operator $F:\calm_\rho\to L^2(B_N)$ defined by $F(v)=u\in H^1_0(B_N)$, where $u$ is the solution to the linear elliptic problem \begin{equation}\label{e2.14} \barr{l} u{-}\lbb\dd\sum^d_{i,j=1}D_i((a^*_{ij})_v(x,v)D_ju {+}(a_{ij})_{x_j}(x,v)u) {+}\lbb\ {\rm div}(b(x,v)u)=f\vspace*{-3mm}\\\hfill\mbox{ in }\cald'(B_N),\\ u=0\mbox{ on }\pp B_N.\earr\end{equation} By \eqref{e2.11} and (H2), it follows via the Lax-Milgram lemma that, for each \mbox{$v\in\calm_\rho$} and $\lbb\in(0,\lbb_0)$, problem \eqref{e2.14} has a unique solution $u=F(v)$. Moreover, by \eqref{e2.14} and (H1), we see that \begin{equation} \barr{lcl} \|u\|^2_{L^2(B_N)}+\g\lbb\|\nabla u\|^2_{L^2(B_N)}\vsp \qquad\le \lbb b_\9\|\nabla u\|_{L^2(B_N)} \|u\|_{L^2(B_N)}{+}c_\9\lbb\|u\|_{L^2(B_N)}\|\nabla u\|_{L^2(B_N)} \vsp \qquad+ \|f\|_{L^2(B_N)}\|u\|_{L^2(B_N)}\label{e2.15}\vsp \qquad \le \lbb b_\9\|\nabla u\|_{L^2(B_N)}\rho+\rho\|f\|_{L^2(B_N)} +c_\9\lbb\rho\|\nabla u\|_{L^2(B_N)}.\earr\hspace*{-5mm}\end{equation}Hence, for $\lbb\in(0,\lbb_0)$ and $\rho$ suitably chosen, independent of $N$, \mbox{$F(\calm_\rho){\subset}\calm_\rho.$} Indeed, if $v_n\to v$ in $L^2(B_N)$ and $u_n=Fv_n$, we have $b(x,v_n)\to b(x,v),$ $$(a^*_{ij})_v(x,v_n)\to (a^*_{ij})_v(x,v),\ (a_{ij})_{x_j}(x,v_n)\to (a_{ij})_{x_j}(x,v)$$ strongly in $L^2(B_N)$. Along a subsequence we have, by \eqref{e2.15}, $$u_n\to u\mbox{ weakly in }H^1(B_N),\mbox {strongly in }L^2(B_N).$$Now, letting $n\to\9$ in equation \eqref{e2.14}, where $v=v_n$ and $u=u_n$, that is, $$\barr{r} \dd\int_{B_N}\Big(u_n\psi+\lbb\sum\limits^d_{i,j=1}(a^*_{ij})_v(x,v_n) -D_ju_n+(a_{ij})_{x_j}(x,v_n),u_n\Big)D_i\psi dx\vsp-\lbb\dd\int_{B_N}u_nb^*(x,v_n)\cdot\nabla\psi dx =\dd\int_{B_N}f\psi dx,\ \ff\psi\in C^\9_0(B_N),\earr$$we see that $u=Fv$ and, therefore, $F$ is continuous on $L^2(B_N)$. Moreover, since the Sobolev space $H^1(B_N)$ is compactly embedded in $L^2(B_N)$, by \eqref{e2.15} we see that $F(\calm_\rho)$ is relatively compact in $L^2(B_N)$. Then, by the Schauder theorem, $F$ has a fixed point $u_N\in\calm{_\rho}$ which, clearly, is a solution to \eqref{e2.12}. Also, by \eqref{e2.15}, it follows that estimate \eqref{e2.13} holds. \begin{lemma}\label{l2} Let $f\in L^2(\rr^d)$ and $\lbb<\lbb_0$. Then equation \eqref{e2.3} has at least one solution $u\in H^1(\rr^d)$ which satisfies the estimate \begin{equation}\label{e2.16} |u|^2_2+\g\lbb |\nabla u|^2_2\le C (|f|^2_2+1). \end{equation} \end{lemma} \noindent{\bf Proof.} Consider a sequence $\{N\}\to\9$ and $u_N\in H^1_0(B_N)$ a solution to \eqref{e2.12} given by Lemma \ref{l1}. By \eqref{e2.13}, we have $$\|u_N\|_{H^1_0(B_N)}\le C,\ \ff N,$$and so, on a subsequence, again denoted $\{N\}$, we have \begin{equation}\label{e2.17} u_N\to u\mbox{ weakly in } H^1(\rr^d), \mbox{ strongly in }L^2_{\rm loc}(\rr^d).\end{equation} Then, letting $N\to\9$ in the equation $$u_N{-}\lbb\!\sum^d_{i,j=1}\!\!D_i ((a^*_{ij})_uu_N)D_ju_N{+}((a_{ij})_{x_j}(x,u_N)u_N) {+}\lbb\, {\rm div}(b(x,u_N)u_N){=}f\mbox{ in }B_N,$$or, more precisely, in its weak form\newpage $$\barr{ll} \dd\int_{\rr^d}u_N\psi\,dx\!\!\! &+\lbb\dd\sum^d_{i,j=1}\int_{\rr^d}(a^*_{ij}(u_N)D_ju_N +(a_{ij})_{x_j}(x,u_N)u_N) D_i \psi\,dx\\ &-\lbb\dd\sum^d_{i=1}\int_{\rr^d}b(x,u_N)u_N\cdot\nabla\psi\,dx=0,\ \ff\psi\in C^\9_0(\rr^d),\earr$$ we infer by (H1), (H3) and \eqref{e2.17} that $u\in H^1(\rr^d)$ is a solution to \eqref{e2.3}. Also, estimate \eqref{e2.16} follows by \eqref{e2.13}. This completes the proof of Lemma~\ref{l2}.\bk Now, we come back to the proof of Proposition \ref{p1}. We prove first that, for each $f\in L^2\cap L^1$ and $\lbb\in(0,\lbb_0)$, the solution $u=u(\lbb,f)\in H^1$ to equation \eqref{e2.3} is unique and we have \begin{equation}\label{e2.19} |u(\lbb,f_1)-u(\lbb,f_2)|_1\le|f_1-f_2|_1,\ \ff f_1,f_2\in L^2\cap L^1.\end{equation}Here is the argument. We set $u_i=u(\lbb,f_i)$, $i=1,2,$ and $f=f_1-f_2$, $u=u_1-u_2$. Then, we have \begin{equation}\label{e2.20} \barr{l}\dd u-\lbb\sum^d_{i,j=1}D^2_{ij}(a^*_{ij}(x,u_1)-a^*_{ij}(x,u_2))\\ \qquad\qquad\ +\lbb\ {\rm div}(b^*(x,u_1)-b^*(x,u_2))=f\mbox{ in }\cald'(\rr^d).\earr\end{equation} More precisely, since $u_i\in H^1(\rr^d)$, equation \eqref{e2.20} is taken in its weak form \begin{equation}\label{e3.24prim} \barr{ll} \dd\int_{\rr^d}\Big(u\psi+\lbb\sum^d_{i,j=1} D_i(a^*_{ij}(x,u_1) -a^*_{ij}(x,u_2))D_j\psi\\ \quad-\lbb\dd(b^*(x,u_1)-b^*(x,u_2)) \cdot\nabla\psi\Big)dx =\dd\int_{\rr^d}f\psi\,dx,\ \ff\psi\in H^1(\rr^d),\earr\end{equation} In order to fix the idea of the proof, we invoke first a heuristic argument. Namely, if we multiply \eqref{e2.20} by $\eta\in L^\9(\calo)$, $\eta(x)\in {\rm sign}(u(x))$, a.e. $x\in\rr^d$, and take into account that, by the monotonicity of the functions $a^*_{ij}$, $$\eta(x)\in{\rm sign}(a^*_{ij}(x,u_1(x))-a^*_{ij}(x,u_2(x))),\mbox{ a.e. }x\in\rr^d,$$we get $$\barr{c} \dd|u|_1+\lbb\int_{\rr^d}\sum^d_{i,j=1}D_i(a^*_{ij}(x,u_1(x))-a^*_{ij}(x,u_2(x)))D_j\eta(x)dx\\\dd +\lbb\int_{\rr^d}{\rm div}(b^*(x,u_1)-b^*(x,u_2))\eta\,dx=\int_{\rr^d}f\eta\,dx.\earr$$ \newpage Taking into account that, by the monotonicity of $u\to a^*_{ij}(x,u)$, we have (formally) $$ D_i(a^*_{ij}(x,u_1(x))-a^*_{ij}(x,u_2(x)))D_j\eta(x)\ge0\mbox{ in }\rr^d,$$ while $$((a^*_{ij})_{x_i}(x,u_1)-(a^*_{ij})_{x_i}(x,u_2))D_j\eta(x)=0,$$ $$ \int_{\rr^d}{\rm div}(b^*(x,u_1)-b^*(x,u_2))\eta\,dx{=} \int_{[|u|=0]}(b^*(x,u_1)-b^*(x,u_2))\cdot\nabla\eta\,dx=0,$$we get \eqref{e2.19}. This formal argument can be made rigorous by using a smooth approximation $\calx_\delta$ of the signum graph. Namely, let $\calx_\delta\in{\rm Lip}(\rr)$ be the function $$\calx_\delta(r)=\left\{\barr{rl} 1&\mbox{ for }r\ge\delta,\vsp\dd\frac r\delta&\mbox{ for }|r|<\delta,\vsp-1&\mbox{ for }r<-\delta,\earr\right.$$ where $\delta>0$. We note that, since $u\in L^2$, it follows $\calx_\delta(u)\in L^2$ and \begin{equation*}\label{e3.24az} \barr{ll} G_\vp=\!\!\!&-\calx_\delta(u) \Big(\dd\sum^d_{i,j=1}D_iD_j(a^*_{ij}(x,u_1){-}a^*_{ij}(x,u_2))\\ &+{\rm div}(b^*(x,u_1)-b^*(x,u_2))\Big)\!\in\! L^1,\earr\end{equation*} and, therefore, $$\barr{r} \dd\int_{\rr^d}G_\vp dx = \int_{\rr^d} \Big(\sum^d_{i,j=1}\!D_j(a^*_{ij}(x,u_1)-a^*_{ij}(x,u_2))D_i\calx_\delta(u)\\ +(b^*(x,u_1)-b^*(x,u_2))\cdot\nabla \calx_\delta(u)\Big)dx.\earr$$ Since $b^*(x,u_i)\in L^2$ and since, by (K), it follows that $a^*_{ij}(x,u_i)\in H^1(\rr^d)$, $i=1,2,$ taking in \eqref{e3.24prim} $\psi=\mathcal{X}_\delta(u)$ yields \begin{equation}\label{e2.21} \barr{l} \dd\int_{[|u(x)|\ge\delta]}|u(x)|dx+\frac1\delta\int_{[|u(x)|\le\delta]}|u(x)|dx\vsp \quad+\lbb\dd\sum^d_{i,j=1}\int_{\rr^d}D_j(a^*_{ij}(x,u_1)-a^*_{ij}(x,u_2))D_i(\calx_\delta(u))dx\vsp \quad=\lbb\dd\int_{\rr^d} (b^*(x,u_1)-b^*(x,u_2))\cdot\nabla(\calx_\delta(u))dx+\int_{\rr^d}f\calx_\delta(u)dx.\earr \end{equation} We set $$\barr{ll} I^1_{\delta}\!\!\!&=\dd\int_{\rr^d}(b^*(x,u_1)-b^*(x,u_2))\cdot\nabla(\calx_\delta(u))dx\vsp &=\dd\int_{\rr^d}(b^*(x,u_1)-b^*(x,u_2)) \cdot\nabla u \calx'_\delta(u)dx\vsp &=\dd\frac1\delta \int_{[|u|\le\delta]}(b^*(x,u_1)-b^*(x,u_2))\cdot\nabla u\,dx.\earr$$ Since, by hypothesis (K), $|b^*(x,u_1)-b^*(x,u_2)|\le C|u|(|u_1|+|u_2|)$, a.e. on $\rr^d$, and $u_i\in L^2$, it follows that $$\lim_{\delta\to0}\frac1\delta\int_{[|u|\le\delta]} |(b^*(x,u_1)-b^*(x,u_2))\cdot\nabla u|dx\le C \lim_{\delta\to0}\(\int_{[|u|\le\delta]} |\nabla u|^2dx\)^{\frac12}=0,$$because $u\in H^1(\rr^d)$ and $\nabla u=0$ on $[x;u(x)=0]$. This yields \begin{equation}\label{e2.22} \lim_{\delta\to0}I^1_{\delta}=0. \end{equation}On the other hand, taking into account that $u_i,a^*_{ij}(u_i)\in H^1(\rr^d)$, for $i=1,2,$ we have \begin{equation}\label{e2.22a} \barr{ll} I^2_{\delta}\!\!\!&=\dd\int_{\rr^d} \sum^d_{i,j=1}D_j(a^*_{ij}(x,u_1)-a^*_{ij}(x,u_2)) D_i(\calx_\delta(u))dx\vsp &=\dd\frac1\delta \dd\int_{E_\delta}\sum^d_{i,j=1} ((a^*_{ij})_u(x,u_1) D_ju_1- (a^*_{ij})_u(u_2) D_ju_2\vsp &\quad+(a^*_{ij})_{x_j}(x,u_1) - (a^*_{ij})_{x_j}(x,u_1))D_iu\,dx\vsp &=\dd\frac1\delta\dd\int_{E_\delta}\sum^d_{i,j=1} (a^*_{ij})_u(x,u_1) D_juD_iu\,dx\vsp &\quad+\dd\frac1\delta\dd\int_{E_\delta}\sum^d_{i,j=1} ((a^*_{ij})_u(x,u_1)-(a^*_{ij})_u(x,u_2)) D_ju_2 D_iu\,dx\vsp &\quad+\dd\frac1\delta\dd\int_{E_\delta}\sum^d_{i,j=1} ((a^*_{ij})_{x_j}(x,u_1)-(a^*_{ij})_{x_j}(x,u_2)) D_iu\,dx\vsp &=K^{\delta}_1 +K^{\delta}_2 +K^{\delta}_3. \earr\end{equation}Here, $E_\delta=\{x\in\rr^d;\ |u(x)|\le\delta\}.$ By (H2), it follows that $K^\delta_1\ge0$, while by \eqref{e3.16az} we have $$|(a^*_{ij})_u(x,u_1)-(a^*_{ij})_u(x,u_2)| +|(a^*_{ij})_{x_j}(x,u_1)-(a^*_{ij})_{x_j}(x,u_2)|\le C|u|.$$ Taking into account that $u_i\in H^1(\rr^d),\ i=1,2,$ and that \begin{equation}\label{e3.29ac} \lim_{\delta\to0}\int_{[|u|\le\delta]} |\nabla u(x)|^2dx=0,\end{equation}we infer that $\lim\limits_{\delta\to0}K^{\delta}_i=0,$ $i=2,3,$ and so, by \eqref{e2.22a} it follows that $$\lim_{\delta\to0}\inf I^2_{\delta}\ge0.$$ This yields $$ |u|_1\le|f|_1,\ \ff\lbb\in(0,\lbb_0).$$ To resume, we have shown so far that under assumptions (H1)--(H3) and (K), for each $f\in L^2$, equation \eqref{e2.3} has, for $\lbb\in (0,\lbb_0)$, a unique solution $u(\lbb,f)\in H^1(\rr^d)$ which satisfies \eqref{e2.16} and \eqref{e2.19}. Now, we assume that $a_{ij},b_i$ satisfy (H1)--(H3) only and consider, for $\vp>0$, the functions \begin{eqnarray} \quad(a^*_{ij})_\vp(x,u)&\!\!\!=\!\!\!&\int_{\rr}a^*_{ij}(x-\vp y,u-\vp v)\rho(y,v)dv\,dy,\ i,j=1,...,d,\label{e3.28a}\\ b^\vp_{i}(x,u)&\!\!\!=\!\!\!&\int_{\rr}b_{i}(x-\vp y,u-\vp v)\rho(y,v)dv\,dy,\ i,j=1,...,d,\label{e3.31az} \end{eqnarray} where $\rho\in C^\9_0(\rr^d\times\rr)$, $\int_{\rr^d\times\rr}\rho(y,v)dy\,dv=1,$ $\rho\ge0$, is a standard mollifier. Clearly, $(a^*_{ij})_\vp$, $b^\vp_i$ satisfy condition (K). We set $b^\vp=\{b^\vp_i\}^d_{i=1}$. Then, as shown above, the equation \begin{equation}\label{e3.31aaz} u_\vp-\lbb\dd\sum^d_{i,j=1}D^2_{ij}(a^*_{ij})_\vp(x,u_\vp)+\lbb\ {\rm div}(b^\vp(x,u_\vp)u_\vp)=f\end{equation} has, for each $\lbb\in(0,\lbb_0)$ and $f\in L^2\cap L^1$, a unique solution $u_\vp=u_\vp(\lbb,f)\in H^1(\rr^d)$ satisfying \eqref{e2.16} and \eqref{e2.19}. Hence \begin{eqnarray} \qquad|u_\vp(\lbb,f_1)-u_\vp(\lbb,f_2)|\le|f_1-f_2|_1,\ \ff\vp>0,\ f_1,f_2\in L^2\cap L^1.\label{e3.32z}\\[1mm] |u_\vp(\lbb,f)|^2_2+\gamma\lbb|\nabla u_\vp(\lbb,f)|^2_2\le C(|f|^2_2+1),\ \ff\vp>0,\ f\in L^2.\label{e3.32az} \end{eqnarray} (We note that, by Lemma \ref{l1}, $\lambda_0$ is independent of $\varepsilon$, because $$\sup\limits_\varepsilon\{|(a^\varepsilon_{ij})_{x_j}|_\infty+|b_i|_\infty;\ i,j=1,...,d\}<\infty.)$$ Now, for $\vp\to0$, it follows by the compactness of $H^1(\rr^d)$ in $L^2_{\rm loc}$ that along a subsequence, again denoted $\vp$, we have $$u_\vp(\lbb,f)\longrightarrow u\mbox{ strongly in }L^2_{\rm loc}$$ and so, by \eqref{e3.28a}, \eqref{e3.31az}, we have $$\barr{rcll} (a^*_{ij})_\vp(x,u_\vp(x))& \longrightarrow &a^*_{ij}(x,u(x)),&\mbox{ a.e. }x\in\rr^d,\vsp b^\vp_i(x,u_\vp(x))& \longrightarrow & b_i(x,u(x)),&\mbox{ a.e. }x\in\rr^d,\earr$$ as $\varepsilon\to0$. Hence, for $\varepsilon\to0$, $$\barr{rcll} D^2_{ij}((a^*_{ij})_\vp(x,u_\vp))&\longrightarrow&D^2_{ij}(a^*_{ij}(x,u))&\mbox{ in }\cald'(\rr^d),\vsp {\rm div}(b^\vp(x,u_\vp)u_\vp)&\longrightarrow&{\rm div}(b(x,u)u)&\mbox{ in }\cald'(\rr^d).\earr$$ and so $u=u(\lbb,f)$ is a solution to \eqref{e2.3}. Moreover, by \eqref{e3.32z} it follows that \begin{equation}\label{e3.33prim} |u(\lbb,f_1)-u(\lbb,f_2)|_1\le|f_1-f_2|_1,\ \ff f_1,f_2\in L^2.\end{equation} Now, we fix $f\in L^1$ and consider a sequence $\{f_n\}\subset L^2$ such that $f_n\to f$ in $L^1$ and consider the corresponding solution $u_n=u(\lbb,f_n)$ to \eqref{e2.3}. By \eqref{e3.33prim}, we see that $$|u_n-u_m|_1\le|f_n-f_m|_1,\ \ff n,m\in\nn.$$Hence, there is $u^*=\lim\limits_{n\to\9}u_n$ in $L^1$. Moreover, by (H1), we see that, for $n\to\infty$, $$a^*_{ij}(u_n)\to a_{ij}(u^*),\mbox{ a.e. in }\rr^d$$and, since $a_{ij}\in C_b(\rr^d\times\rr)$, we have $$D^2_{ij}a^*_{ij}(u_n)\to D^2_{ij}a^*_{ij}(u^*)\mbox{ in }\cald'(\rr^d),$$for all $i,j=1,2,...,d.$ Similarly, by (H3) we see that $${\rm div}(b(x,u_n)u_n)\to{\rm div}(b(x,u^*)u^*)\mbox{ in }\cald'(\rr^d).$$We have, therefore, \begin{equation}\label{e3.32azi} \barr{r} \dd\sum^d_{i,j=1}D^2_{ij}a^*_{ij}(u_n)-{\rm div}(b(x,u_n)u_n)\!\to\!\sum^d_{i,j=1}D^2_{ij}a^*_{ij}(u^*) -{\rm div}(b(x,u^*)u^*)\\\mbox{ strongly in }L^1.\earr\hspace*{-2mm}\end{equation}Then, letting $n\to\9$ in equation \eqref{e2.3}, where $f=f_n$, $u=u_n$, we see that $u^*=u(\lbb,f)$ is the solution to \eqref{e2.3}. Moreover, by \eqref{e3.33prim}, the inequality \eqref{e2.5} follows for all $\lbb\in(0,\lbb_0]$. This means that $$|(I+\lambda A)^{-1}f_1-(I+\lambda A)^{-1}|_1\le|f_1-f_2|_1,\ \forall f_1,f_2\in L^1,$$for all $\lambda\in[0,\lambda_0).$ By Proposition 3.1 in \cite{1}, this implies that the above inequality holds for all $\lambda>0.$ Hence, \eqref{e2.5} follows for all $\lambda>0$, as claimed. As regards \eqref{e2.8}, it first follows by equation \eqref{e2.3}, where $f\in L^2$ and $u\in H^1(\rr^d)$, by integrating over $\rr^d$. Then, by density, it extends to all of $f\in L^1$. Finally, \eqref{e2.7} for $f\in L^2$, $f\ge0$, follows by multiplying \eqref{e2.3} with ${\rm sign}(u^-)$ (or, more exactly, by $\calx_\delta(u^-)$ and letting $\delta\to0$) and integrating over $\rr^d$. This completes the proof of Proposition \ref{p1} under hypotheses (H1)--(H3). Now, we are ready to formulate the existence theorem for equation \eqref{e1.1}. As mentioned earlier, we shall represent equation \eqref{e1.1} as the evolution equation \eqref{e1.2} in $\calx=L^1$, where the operator $A$ is defined by \eqref{e2.1}-\eqref{e2.2}. By a {\it weak solution to equation \eqref{e1.1}}, we mean {\it a mild solution to equation \eqref{e1.2},} where $\mathcal{X}=L^1$ and $A$ is the operator defined by \eqref{e2.1}, \eqref{e2.2}. We have \begin{theorem}\label{t1} Assume that hypotheses {\rm(H1)--(H3)} hold. Then, for each $u_0\in L^1(\rr^d)$, there is a unique weak solution $u=u(\cdot,u_0)\in C([0,\9);L^1)$ to equation \eqref{e1.1}. Moreover, $u$ has the following properties \begin{eqnarray} &|u(t,u^1_0)-u(t,u^2_0)|_1\le|u^1_0-u^2_0|_1,\ \ff u^1_0,u^2_0\in L^1,\ t\ge0,\label{e2.24}\\[2mm] &u\ge0\mbox{ a.e. in }(0,\9)\times\rr^d\mbox{ if }u_0\ge0\mbox{ a.e. in }\rr^d,\label{e2.26}\\[1mm] &\dd\int_{\rr^d}u(t,x)dx=\int_{\rr^d}u_0(x)dx, \ff u_0\in L^1,\ t\ge0,\label{e2.27} \end{eqnarray} and $u$ is a solution to \eqref{e1.1} in the sense of Schwartz distributions on \mbox{$ (0,\9){\times}\rr^d,$} $($see~\eqref{1.2}$)$, that~is, \begin{equation}\label{e2.29a} \barr{l} \dd\int^\9_0\int_{\rr^d}(u(t,x)\vf_t(t,x)+\sum^d_{i,j=1} a_{ij}(x,u(t,x))u(t,x)D^2_{ij}\vf(t,x)\\ \qquad+b(x,u)\cdot\nabla_x\vf(t,x)u(t,x))dt\,dx=0,\ \ff\vf\in C^\9_0((0,\9)\times\rr^d).\earr\end{equation} \end{theorem} \noindent{\bf Proof.} As mentioned above, the existence of a mild solution $u$ for \eqref{e1.2}, which by our definition is a weak solution to \eqref{e1.1}, follows by the Crandall and Liggett theorem by virtue of Proposition \ref{p1}, which implies the $m$-accretivity of the operator $A$ defined by \eqref{e2.1}--\eqref{e2.2}. The solution can be equivalently expressed by the exponential formula \begin{equation}\label{e2.28} u(t,u_0)=\lim_{n\to\9}\(I+\frac tn\ A\)^{-n}u_0,\ \ff t\ge0,\ u_0\in\overline{D(A)}=L^1.\end{equation} Then, by \eqref{e2.5}-\eqref{e2.8}, we get for $u=u(t,u_0)$ the corresponding properties \eqref{e2.24}-\eqref{e2.27} and this completes the proof. In particular, it follows that, if $u_0$ is a probability density, that is, $u_0dx\in\calp(\rr^d)$, then so is $u(t,u_0)$ for all $t\ge0.$ Note also that $t\to u(t,u_0)$ is a continuous semigroup of nonexpansive operators in the space~$L^1$. As regards \eqref{e2.29a}, it follows by letting $h\to0$ in the equation $$\begin{array}{r} \displaystyle\int^\infty_0\int_{\rr^d} \Big(u_h(t,x)(\varphi(t+h,x)-\varphi(t,x)) +\sum^d_{i,j=1}a_{ij}(x,u_h(t,x))u_h(t,x)\vsp D^2_{ij}\varphi(t,x)+b(x,u_h(t,x))\cdot\nabla_x\varphi(t,x)u_h(t,x)\Big)dt\,dx=0,\vsp \hfill\forall\varphi\in C^\infty_0((0,\infty)\times\rr^d).\end{array}$$ \begin{remark}\label{r3.4}\rm Assumptions $a_{ij}\in C^2(\rr^d\times\rr)$ and $b_i\in C^1(\rr^d\times\rr)$ in (H1)--(H3) were necessary for the density of $D(A)$ in $L^1$. Otherwise, it suffices to take only $a_{ij}\in C^1(\rr^d\times\rr)$. In the special case $a_{ij}\equiv\beta\delta_{ij}$, the density of $D(A)$ follows, however, under the weaker condition $\beta\in C^1(\rr^d)$ (see \cite{6ab}).\end{remark} \subsection{Existence for degenerate FPEs} We consider here the equation \begin{equation}\label{e3.1} \barr{l} u_t-\dd\sum^d_{i,j=1} D^2_{ij}(a_{ij}(u)u)+\dd\sum^d_{i=1}D_i(b_i(u)u)=0\mbox{ in }\cald'((0,\9)\times\rr^d),\vsp u(0,x)=u_0(x), x\in\rr^d,\earr\end{equation} where $a_{ij}$ and $b_i$ satisfy hypotheses (H1)$'$--(H3)$'$. Consider the operator $A_1:D(A_1)\subset L^1\to L^1$ defined by \begin{equation}\label{e3.4} \barr{l} A_1u=-\dd\sum^d_{i,j=1}D^2_{ij}(a_{ij}(u)u) +\sum^d_{i=1}D_i(b_i(u)u)\mbox{ in }\cald'(\rr^d),\vsp D(A_1)=\left\{u\in L^1;-\dd\sum^d_{i,j=1}D^2_{ij}(a_{ij}(u)u)+ \sum^d_{i=1}D_i(b_i(u)u)\in L^1\right\}.\earr\end{equation} We have \begin{lemma}\label{l4} Assume that {\rm(H1)$'$--(H3)$'$} hold. Then the operator $A_1$ is $m$-accretive in $L^1$. \end{lemma} \n{\bf Proof.} One should prove that, for each $\lbb\in(0,\lbb_0)$ and $f\in L^1$, the equation \begin{equation}\label{e3.5} u-\lbb\sum^d_{i,j=1}D^2_{ij}(a_{ij}(u)u) +\lbb\sum^d_{i=1}D_i(b_i(u)u)=f\mbox{ in }\cald'(\rr^d)\end{equation}has a unique solution $u=u(\lbb,f)$ which satisfies the estimate \begin{equation}\label{e3.6a} |u(\lbb,f_1)-u(\lbb,f_2)|_1\le |f_1-f_2|_1,\ \ff f_1,f_2\in L^1.\end{equation} We set, for each $\vp>0$, \begin{equation} a^\vp_{ij}(r)=a_{ij}(r)+\vp\delta_{ij},\ i,j=1,...,d,\ r\in\rr, \label{e3.4a} \end{equation} where $\delta_{ij}$ is the Kronecker symbol. Then, we approximate \eqref{e3.5} by \begin{equation} \label{e3.4aaa} u-\lbb\sum^d_{i,j=1}D^2_{ij}(a^\vp_{ij}(u)u) +\lbb\sum^d_{i=1}D_i(b_i(u)u)=f\mbox{ in }\cald'(\rr^d). \end{equation} Equivalently, \begin{equation}\label{e3.42prim} u+\lbb A^\vp_1(u)=f,\end{equation}where $$\barr{rcl} A^\vp_1(u)&=&-\dd\sum^d_{i,j=1}D^2_{ij}(a^\vp_{ij}(u)u)+ \sum^d_{i=1}D_i(b_i(u)u),\ \ff u\in D(A^\vp_1),\vsp D(A^\vp_1)&=&\left\{u\in L^1;\ -\dd\sum^d_{i,j=1}D^2_{ij}(a^\vp_{ij}(u)u) +\dd\sum^d_{i=1}D_i(b_i(u)u)\in L^1\right\}.\earr$$ We shall prove that, for each $f\in L^1$, there is a solution $u=u_\vp(\lbb,f)$ satisfying \eqref{e3.6a} for $0<\lbb<\lbb_0.$ Since $a^\vp_{ij}$ and $b_i$ satisfy, for each $\vp>0$, hypotheses (H1)--(H3), Proposition \ref{p1} implies the existence of a solution $u_\vp=u_\vp(\lbb,f)$ to \eqref{e3.4aaa} in $L^1(\rr^d)$ for each $f\in L^2$ if $0<\lbb\le\lbb^\vp_0=\frac C\vp,$ with $C$ independent of $\vp$. Moreover, one has \begin{equation}\label{e3.42b} |u_\vp(\lbb,f_1)-u_\vp(\lbb,f_2)|_1\le|f_1-f_2|_1,\ \ff f_1,f_2\in L^2,\ \lbb\in(0,\lbb^\vp_0).\end{equation} Then, by density, $u_\vp(\lbb,f)$ extends as solution to \eqref{e3.4aaa} for all $f\in L^1$. Note also that, by \eqref{e2.5}--\eqref{e2.8}, we have, for all $\vp>0$ and $\lbb\in(0,\lbb^\vp_0)$, \begin{eqnarray} &\dd\int_{\rr^d}(I+\lbb A^\vp_1)\1 f\,dx=\int_{\rr^d}f\,dx,\ \ \ff f\in L^\9,\label{e3.7}\\[2mm] &(I+\lbb A^\vp_1)\1f\ge0,\mbox{ a.e. in }\rr^d\mbox{ if }f\ge0,\mbox{ a.e. in }\rr^d,\label{e3.8}\end{eqnarray}while \eqref{e3.42b} yields \begin{equation} |I{+}\lbb A^\vp_1)\1f_1{-}(I{+}\lbb A^\vp_1)\1f_2|_1\le|f_1{-}f_2|_1,\, \ff f_1,f_2\in L^1,\, \vp>0.\label{e3.7a} \end{equation} Though \eqref{e3.7}--\eqref{e3.7a} were proved only for $0<\lbb\le\lbb^\vp_0$, it can be shown, however, as mentioned earlier, that $(I+\lbb A^\vp_1)\1$ extends to all $\lbb>0$ by a well known argument based on the resolvent equation $$(I+\lbb A^\vp_1)\1 f=(I+\lbb_0A^\vp_1)\1\(\frac{\lbb^\vp_0}\lbb\,f+\(1-\frac{\lbb^\vp_0}\lbb\)(I+\lbb A^\vp_1)\1f\),\ \lbb>\lbb^\vp_0.$$(See \cite{1}, Proposition 3.3.) Now, we are going to let $\vp\to0$ in \eqref{e3.4aaa}. We set, for $f\in L^1$ and the solution $u_\vp$ to \eqref{e3.4aaa}, $$u^\vp_h(x)=u_\vp(x+h)-u_\vp(x),\ f_h(x)=f(x+h)-f(x),\ x,h\in\rr^d.$$ Since $a^\vp_{ij}$ and $b^\vp_i$ are independent of $x$, we see that $x\to u^\vp(x+h)$ is the solution to \eqref{e3.4aaa} for $f(x)=f(x+h)$. Then, by \eqref{e3.7a}, it follows that $$|u^\vp_h|_1\le |f_h|_1,\ \ff h\in\rr^d,\ \vp>0.$$ By the Kolmogorov compactness theorem (see, e.g., \cite{6a}, p.~111), it follows that $\{u^\vp\}$ is compact in $L^1_{\rm loc}(\rr^d)$ and so, along a subsequence, $$\mbox{$u_\vp\to u$ strongly in $L^1_{\rm loc}(\rr^d)$ for $\vp\to0$.}$$Since $|u_\vp|_1\le C,\ \ff\vp>0,$ it follows via Fatou's lemma that $u\in L^1$. Letting $\vp\to0$ in \eqref{e3.4aaa}, where $u=u_\vp$, and taking into account that $$a^\vp_{ij}(u_\vp)u_\vp\to a_{ij}(u)u,\ \ b_i(u_\vp)u_\vp\to b_i(u)u,\mbox{ a.e. in }\rr^d,$$ while by (H1)$'$, (H3)$'$, $$|a^\vp_{ij}(u_\vp)|+|b_{ij}(u_\vp)|\le C,\mbox{ a.e. in }\rr^d,$$where $C$ is independent of $\vp$, we see that $u$ is a solution to \eqref{e3.4aaa} and so $u=(I+\lbb A_1)\1f.$ Moreover, letting $\vp\to0$ in \eqref{e3.7}--\eqref{e3.7a}, we see that \begin{eqnarray} &\ |(I{+}\lbb A_1)\1f_1{-}(I{+}\lbb A_1)\1f_2|_1{\le}|f_1{-}f_2|_1,\, \ff\lbb>0,\, f_1,f_2\in L^1,\label{e3.10az}\\[2mm] &\dd\int_{\rr^d}(I+\lbb A_1)\1f\,dx=\int_{\rr^d}f\,dx,\ \ff f\in L^1,\ \lbb>0,\label{e3.10aaz}\\[2mm] &(I+\lbb A_1)\1f\ge0,\mbox{ a.e. in }\rr^d\mbox{ if }f\ge0,\mbox{ a.e. in }\rr^d.\label{e3.10aaaz} \end{eqnarray} Then, by the Crandall and Liggett existence theorem, for each $u_0{\in}\overline{D(A_1)}{=}L^1$, the differential equation \begin{equation}\label{e3.9} \barr{l} \dd\frac{du}{dt}+A_1u=0,\ t>0,\vsp u(0)=u_0,\earr\end{equation}{\it has a unique mild solution $u\in C([0,\9);L^1)$ in the sense of \eqref{e1.4}--\eqref{e1.6}.} As in the previous case, this mild solution is, in fact, a solution to the Fokker-Planck equation \eqref{e3.1} in the sense of Schwartz distributions (cf.~\eqref{e2.29a}). We have, therefore, the following existence result. \begin{theorem}\label{t2} Under hypotheses {\rm(H1)$'$--(H3)$'$}, for each $u_0\in L^1$, there is a unique weak solution $u=u(t,u_0)\in C([0,\9);L^1)$ to equation \eqref{e3.1}. Moreover, this solution satisfies \eqref{e2.24}--\eqref{e2.27} and is a solution to \eqref{e3.1} in the sense of Schwartz distributions on $(0,\9)\times\rr^d$, i.e., in the sense of \eqref{e2.29a} or \eqref{1.2}. \end{theorem} \begin{remark}\label{r1}\rm In particular, Theorems \ref{t1} and \ref{t2} imply the existence of a solution $u$ in the sense of Schwartz distributions on $(0,\9)\times\rr^d$ for equation \eqref{e1.1}. Moreover, $u:[0,\9)\to L^1$ is continuous. In some special cases, these two properties are sufficient to characterize such solutions to \eqref{e1.1}. In fact, this is the case if (see \cite{6}) $b\equiv0$ and $$a_{ij}(x,u)u=\delta_{ij}\beta(u)u,\ \ff u\in\rr,\ i,j=1,...,d,$$ where $\beta$ is a continuous monotonically nondecreasing function because, in this case, one has the uniqueness of distributional solutions \mbox{$u{\in} L^\9((0,\9){\times}\rr^d)$} $\cap C([0,\9);L^1)$. Such a result remains, however, open for general Fokker-Planck equations as in \eqref{e1.1}. \end{remark} \begin{remark}\label{r3} \rm In the special case $a_{ij}=\delta_{ij}$, the weak solution $u$ given by Theorem \ref{t2} is an entropic solution in sense of S. Kruzkov \cite{19a} for equation \eqref{e1.1}. In the present case, the solution $u$ given by Theorem \ref{t2} is a {\it mild} solution to \eqref{e1.1} defined, as in the previous case, by the finite difference scheme \eqref{e1.4}--\eqref{e1.6}. It is, of course, a continuous in $t$ distributional solution to \eqref{e1.1}, but we do not know if it is unique within this class. In fact, we should mention that the solutions $u$ given by Theorems \ref{t1} and \ref{t2} are unique in the class of mild solutions generated by the operator $A$ and not in the class of distributional or entropic solutions in the sense of Kruzkov.\end{remark} \section{Solution of the McKean-Vlasov SDE}\label{s4} \setcounter{equation}{0} Consider the following McKean-Vlasov SDE for $T\in(0,\9)$ \begin{equation}\label{e4.1} \barr{rcl} dX(t)&=&b\(X(t),\dd\frac{d\call_{X(t)}}{dx}\,(X(t))\)dt\vsp&& +\sqrt{2}\ \sigma\(X(t),\dd\frac{d\call_{X(t)}}{dx}\,(X(t))\)dW(t),\ 0\le t\le T,\vsp X(0)&=&\xi_0,\earr \end{equation}on $\rr^d$, where $W(t),\ t\ge0,$ is an $(\calf_t)_{t\ge0}$-Brownian motion on a probability space $(\ooo,\calf,P)$ with normal filtration $(\calf_t)_{t\ge0}$ and $\xi_0:\ooo\to\rr^d$ is $\calf_0$-measurable such that $$P\circ\xi^{-1}_0(dx)=u_0(x)dx.$$ Furthermore, $b=(b_1,...,b_d):\rr^d\times\rr\to\rr^d$ and $\sigma:\rr^d\times\rr\to L(\rr^d;\rr^d)$ are measurable. Let $a_{ij}:=2(\sigma\sigma^T)_{ij},\ 1\le i,j\le d.$ Then, as an immediate consequence of Section \ref{s2} and Theorems \ref{t1} and \ref{t2}, respectively, we obtain the following. \begin{theorem}\label{t4.1} Suppose that $a_{ij},b_i,$ $1\le i,j\le d,$ satisfy either {\rm(H1)--(H3)} or {\rm(H1)$'$--(H3)$'$}. Then there exists a $($in the probabilistic sense$)$ weak solution to DDSDE \eqref{e4.1}. Furthermore, for the solution $u$ in Theorem {\rm\ref{t1}} and {\rm\ref{t2}}, respectively, with $u(0,\cdot)=u_0$, we have the "probabilistic representation" $$u(t,x)dx=P\circ X(t)\1(dx),\ t\ge0.$$ \end{theorem} \begin{remark}\label{r4.1}\rm \vspace*{-2mm}\ \begin{itemize}\item[(i)] In the case where in \eqref{e4.1} we have $a_{ij}(x,u)=\delta_{ij}\beta(u),$ $ 1\le i,j\le d$, and $\beta:\rr\to2^\rr$ is maximal monotone with $\sup\{|s|:s\in\beta(r)\}\le C|r|^m,$ $r\in\rr$, for some $C,m\in[0,\9)$ and $b$ satisfies (H3)$'$, then the above theorem was already proved in \cite{3}. The special case where, in addition, $b\equiv0$, $d=1$ and $m=4$, was proved in \cite{5} if $\beta(r)/r$ is nondegenerate at $r=0$ and in \cite{13*} including the degenerate case.\vspace*{-2mm} \item[(ii)] The special case $d=1$, $b\equiv0$, $a_{ij}(x,u)=\delta_{ij}\beta(u),$ $1\le i,j\le d$, with $\beta(r):=r|r|^{m-1},$ $r\in\rr$, for some $m\in(1,\9)$, was proved in \cite{16*}.\vspace*{-2mm} \item[(iii)] \cite{5prim} contains an analogous result as in \cite{5}, \cite{13*} in the case where a linear multiplicative noise is added to the nonlinear FPE, which thus becomes a stochastic porous media equation. \end{itemize}\end{remark} Our final remark concerns the uniqueness of the time marginal of solutions to \eqref{e4.1}. \begin{remark}\label{r4.2}\rm If $b\equiv0$ and $a_{ij}(x,u)=\delta_{ij}\beta(u),$ $1\le i,j\le d$, and $\beta:\rr\to\rr$ is continuous, nondecreasing and $\beta(0)=0$, then \eqref{e1.1} has a unique solution among all the solutions in $(L^\9\cap L^1)((0,T)\times\rr^d)$ by the main result in \cite{6}. Hence, obviously, we have uniqueness of the time marginals for weak solutions to \eqref{e4.1} among all the solutions of \eqref{e4.1} whose time marginals have densities in $L^\9((0,T)\times\rr^d)$.\end{remark} \n{\bf Acknowledgements.} This work was supported by the DFG through CRC 1283. V. Barbu was partially supported by the CNCS-UEFISCDI project PN-III-P4-ID-PCE-2015-0011.
\section{Introduction} The understanding and description of energy conversion processes in nanoscale devices is crucial for the development of novel nanotechnologies. In particular, the manipulation of charge and energy fluxes, and the control of energy dissipation are strategic tasks for the design of energy-efficient circuits. Nanostructures working at low temperatures, as for example, quantum dots, are perfect candidates because the energy-filter effect is maximized by the discrete energy spectrum and their electronic and optical properties can be controlled through suitable changes of composition, size and shape \cite{benenti,Dwyer}. Previous studies have shown remarkable performances of quantum dots in thermoelectric devices \cite{beenakker, Rafael,jordan,karlstrom}, in which the conversion between electrical and thermal energy takes place due to the application of {\it{dc}}-drivings through both temperature and voltage biases. The thermoelectric properties and performance as heat-engines of quantum dots systems have been widely addressed \cite{david,kuo,thierschmann,roura3,roura,cosi,liu,rejec,muralidharan,rosadavid,taylor,andreev,sierra,erdman,rossello,liu2,sierra2,weymann,boese,scheibner,karki,roura2,dutt}. The small size of these setups makes quantum interference and Coulomb interaction important. The effect of the latter has been considered \cite{cosi,liu,rejec,muralidharan,rosadavid,taylor} either in the Coulomb-blockade \cite{andreev,sierra,erdman,rossello,liu2,sierra2} or Kondo regimes \cite{weymann,boese,scheibner,karki,roura2}, mostly within the linear response regime and, to a lesser extent, for heat engines operating in the nonlinear regime \cite{rosadavid,sierra,erdman,karki,roura2,dutt}. It has been indeed reported \cite{erdman,liu2,scheibner,karki} that the presence of Coulomb interactions leads to an improvement of the thermoelectric performance in quantum dots by enhancing the thermopower and decreasing the thermal conductance. Another route to boost the thermoelectric response is the application of time-dependent gate voltages. Refs. \cite{adeline,hanggi} report an enhancement of the thermopower during the transient regime following a sudden change of the gating potential. The thermoelectric response under {\it{ac}}-drivings (time-periodic) has been studied in \cite{ac1,ac2,lim}. All these studies have focused on quantum-dot-based devices converting heat into electricity, or vice versa. Nevertheless, when {\it{dc}} and {\it{ac}} drivings are applied at the same time, an exchange of energy between the different kinds of driving sources can occur. In this way, the system not only allows for thermoelectric effects, but it can also behave as a quantum machine that transforms electrical or thermal energy into another form of energy, that could be for example mechanical work \cite{bustos}. Consequently, regarding this latter kind of energy conversion, other operational modes appear: (i) {\it{Quantum motors}} and {\it{generators}}, when the system is driven by a bias voltage together with the application of {\it{ac}}-potentials; (ii) {\it{Heat engines}} and {\it{heat pumps}}, when the device involves a temperature gradient instead of a bias voltage. The response of nanostructures working in these last operational modes has been less studied in the literature, and therefore, the search for mechanisms boosting their efficiency is still an open field. Among the first works, Ref. \cite{juergens} considered a driven double quantum dot operating as a generator or a heat pump/heat engine, while in Refs. \cite{bustos,bruch} quantum motors based on Thouless pumps have been discussed. Furthermore, a cold-atom-based {\it{ac}}-driven quantum motor was explored in Ref. \cite{hanggi2}. The performance of such nanomotors and nanoengines is based on the quantum pumping effect \cite{thouless,brouwen}, that consists in the generation of a {\it{dc}} current at zero bias voltage, by merely applying local {\it{ac}}-drivings to a quantum coherent conductor. When the driving period is much larger than any other characteristic time scale of the system, the pumping is called {\it{adiabatic}}. The key for the operation of these machines is built on the relation between the output power $P_{out}$ and the charge (for a motor/generator) or heat (for heat engines/pumps) pumped through the system during one period of the {\it{ac}}-driving. In the case of an adiabatic quantum motor it reads \cite{bustos} \begin{equation}\label{power} P_{out}=Q_p\,V/\tau, \end{equation} where $Q_p$ is the pumped charge per period, $V$ is the applied bias voltage and $\tau$ is the period of the {\it{ac}}-driving. The above equation lays out the fact that nanomotors are realized by the simultaneous application of {\it{dc}} and {\it{ac}} drivings, since no output power is obtained either at zero bias voltage or without pumping of charge. On the other hand, an extension of the linear response theory of thermoelectrics to systems under adiabatic {\it{ac}}-driving has been recently presented in Ref. \cite{ludovico}. This theory describes the relation between heat and particle fluxes, and the energy flux exchanged between the electronic system and the {\it{ac}}-driving sources, through Onsager reciprocity relations. This theory also allows for the characterization of all the operational modes in (i) and (ii) in terms of efficiencies and figures of merit. The goal of the present work is to study the effects of the Coulomb interactions on the performance of an adiabatically {\it{ac}}-driven quantum dot operated as a {\it{motor}} within the framework of Ref. \cite{ludovico}. Fig. \ref{fig1} shows the setup we have in mind. The quantum dot is coupled to two non-interacting reservoirs at the same temperature, but with different chemical potentials. The time-periodic driving is introduced through the tunneling elements $w_\alpha (t)$, with $\alpha=L,R$, as well as by a modulation of the energy level of the dot $\varepsilon_d(t)$. The behavior of the device as a {\it{motor}} can be understood as follows: when the {\it{ac}}-driving pumps particles into the reservoir with lower chemical potential, the gain in electrical energy can be used to perform work on the {\it{ac}}-sources. This work can be later transformed in, e.g., mechanical energy. \begin{figure}[t] \includegraphics[width=0.4\textwidth]{fig1.pdf} \caption{Scheme of the device. We take a single-level quantum dot connected to two non-interacting electronic reservoirs at the same temperature $T<T_{Kondo}$. A constant bias voltage $V$ is applied between the reservoirs, so that the chemical potential is $\mu_L=\mu-eV$ on the left and $\mu_R=\mu$ on the right. The hopping elements between the dot and the reservoirs, $w_L(t)$ and $w_R(t)$, and the energy level of the dot $\varepsilon_d(t)$ are time-periodic functions. }\label{fig1} \end{figure} In order to describe the interacting quantum dot within the adiabatic regime, we develop a treatment that combines the time-dependent slave-boson mean-field approximation \cite{wu,citro,citro2} with a linear-response expansion in the small rate of change of the {\it{ac}}-parameters \cite{ludovico}. Within our approach we can describe the interacting dot at every instant of time in terms of frozen {\it{equilibrium}} solutions, as if we were taking a sequence of snapshots of the system. We note that this technique can be extended to a more generic setup and also beyond linear response in the adiabatic approximation. The paper is organized as follows. In Sec. \ref{sec2} we introduce the model and the time-dependent slave-boson mean-field. Sec. \ref{formalism} presents the solution of the slave-boson approximation within the adiabatic response regime. In Sec. \ref{nanomotors} we apply this formalism to study the performance of {\it{ac}}-driven quantum dots as nanomotors. In Sec. \ref{Results}, taking the case $\varepsilon_d(t)=0$ as an illustrative example, we analyze in detail the effects of the electron-electron interactions on the linear-response transport coefficients and on the efficiency at maximum power. Finally Section \ref{conclusions} is devoted to the summary and conclusions. \section{Model and formalism}\label{sec2} We consider a simple setup featuring all the necessary ingredients to analyze the effects of the electron-electron interaction in quantum dots-based motors. It consists in a single level quantum dot connected to two non-interacting electronic reservoirs at the same finite temperature $T$. The setup is shown in Fig. \ref{fig1}. Charge and energy fluxes in the system are driven by both an applied small bias voltage $V$ between the leads, and the time-periodic modulation of the energy level $\varepsilon_d(t)$ and the couplings $w_\alpha (t)$. The time-dependent driving can be implemented by the local application of three {\it{ac}}-gate voltages, one for shifting the energy of the level, while the other two for controlling the transparency of the tunneling barriers. We allow only the module of $w_\alpha$ to vary in time, but not its phase, since a time-dependent phase would correspond to a time-dependent bias voltage. We assume an adiabatic {\it{ac}}-driving, which corresponds to a driving period much larger than the typical dwell time for the electrons inside the driven structure. Being $\omega$ the typical frequency of the periodic drivings, and $\Gamma$ the hybridization with the reservoirs, the adiabatic condition requires $\hbar\omega\ll \Gamma$ \cite{brouwen}. The system is described by the Hamiltonian \begin{equation}\label{hamtot} H(t)= H_d(t)+H_\mathcal{T}(t)+H_{leads}, \end{equation} where the first term corresponds to the interacting quantum dot \begin{equation}\label{hamdot} H_d(t)=\sum_\sigma \varepsilon_d(t)\, d^\dagger_\sigma d_\sigma + U n_{\uparrow}n_{\downarrow}, \end{equation} with $d^\dagger_\sigma$ and $d_\sigma$ being, respectively, the creation and destruction operators of an electron with spin $\sigma=\uparrow, \downarrow$. The second term, that depends on the occupation number operator $n_\sigma=d^\dagger_\sigma d_\sigma$ describes the Coulomb repulsion between electrons, with an interaction energy $U$. The non-interacting leads are represented by the Hamiltonian \begin{equation}\label{hamres} H_{leads}=\sum_{\alpha=L, R}\sum_{k_\alpha,\sigma}\varepsilon_{k_\alpha} c^\dagger_{k_\alpha\sigma} c_{k_\alpha\sigma}, \end{equation} where $\varepsilon_{k_\alpha}$ is the energy band of the reservoir $\alpha$ and the operator $c^\dagger_{k_\alpha\sigma}$ ($c_{k_\alpha\sigma}$) creates (destroys) an electron with momentum $k_\alpha$ and spin $\sigma$ in the reservoir $\alpha$. Finally, the coupling between the dot and the reservoirs is represented by the following tunneling Hamiltonian \begin{equation}\label{hamtunneling} H_{\mathcal{T}}(t)=\sum_{\alpha,k_\alpha,\sigma}w_{\alpha}(t) c^\dagger_{k_\alpha\sigma}d_\sigma +h.c. \end{equation} \subsection{Time-dependent slave-boson approximation} In this work we focus on the strongly interacting limit $U\rightarrow \infty$, which we address by means of the time-dependent slave-boson mean-field theory \cite{wu,citro,citro2}, which extends Coleman slave-boson equilibrium approach \cite{coleman} to the case of {\it{ac}}-driven quantum dots. We choose the slave-boson mean-field approach as a minimal theoretical framework which captures the main effect of strong correlations but still allows for an analytical treatment which is easily combinable with our linear-response framework. The present studied can be seen as the basic brick for more advanced treatments employing accurate solutions of the quantum dot problem. An obvious extension would be the use of the Kotliar-Ruckenstein formalism to consider the system at finite values of $U$ \cite{KR}. Within the slave boson formalism the fermion in the strongly interacting limit can be represented in terms of a bosonic field $b$ and a pseudofermionic operators $f_\sigma$. Then, the operators of the quantum dot can be written in terms of the bosonic and quasi-fermionic operators as: $d_\sigma\rightarrow b^\dagger f_\sigma$, $d^\dagger_\sigma\rightarrow f^\dagger_\sigma b$. Plugging these expressions into Eq. (\ref{hamtot}), the slave-boson Hamiltonian of our system can be written as \begin{eqnarray} H_{SB}(t)&=& H_{leads}+\sum_\sigma (\varepsilon_d(t)+\lambda(t))f_\sigma^\dagger f_\sigma\nonumber\\ &&+\sum_{\alpha,k_\alpha,\sigma}w_{\alpha}(t)\,b^\dagger c^\dagger_{k_\alpha\sigma}f_\sigma +h.c\\ &&+\lambda(t)(b^\dagger b -1)\nonumber, \end{eqnarray} where $\lambda(t)$ is a Lagrange multiplier enforcing the constraint preventing double occupancy at any time \begin{equation}\label{constUinfty} N_d(t) +\langle b^\dagger b\rangle -1=0, \end{equation} where ${N}_d=\sum_\sigma\langle f^\dagger_\sigma f_\sigma\rangle$. For our problem the Lagrange multiplier $\lambda$ will be time-periodic due to the application of the external {\it{ac}}-potentials. The bosonic operator $b$ evolves according to the equation of motion \begin{equation} i\hbar\partial_t b=[b, H_{SB}]=\lambda(t) b +\sum_{\alpha,k_\alpha,\sigma} w_{\alpha}(t)\,c^\dagger_{k_\alpha\sigma}f_\sigma. \end{equation} As customary, we treat the slave-boson operator in the mean-field (MF) approximation replacing the salve-boson operator $b$ with its expectation value $\langle b\rangle=\mathcal{B}(t)$, while neglecting its fluctuations. This assumption is justified within the adiabatic regime, in which the evolution of the system is quasi-static, so that the slow variation of the {\it{ac}}-potentials do not significantly affect the condensation of the bosons. As a consequence of the MF approximation, the original problem turns out to be described by a constrained {\it{non-interacting}} theory with the time-dependent MF Hamiltonian \begin{eqnarray}\label{hammf} H_{SB}^{MF}(t)&=& H_{leads}+\sum_\sigma (\varepsilon_d(t)+\lambda(t))f_\sigma^\dagger f_\sigma\nonumber\\ &&+\sum_{\alpha,k_\alpha,\sigma}w_{\alpha}(t)\,\mathcal{B}^*(t) c^\dagger_{k_\alpha\sigma}f_\sigma +h.c\\ &&+\lambda(t)(\vert \mathcal{B}(t)\vert^2 -1)\nonumber, \end{eqnarray} and the following set of non-linear equations to be solved in order to find the unknown parameters $\lambda(t)$ and $\mathcal{B}(t)$ \begin{subequations}\label{constraints} \begin{eqnarray} \lambda(t)\mathcal{B}(t) +\sum_{k_\alpha,\alpha,\sigma}w_{\alpha}(t)\langle c^\dagger_{k_\alpha\sigma}f_\sigma\rangle &= & i\hbar\partial_t\mathcal{B} (t)\label{a}\\ N_d(t) +\vert\mathcal{B}(t)\vert^2-1 & = & 0.\label{num} \end{eqnarray} \end{subequations} \section{Dynamics within the adiabatic response regime}\label{formalism} We now develop a method to solve the non-linear set of equations in (\ref{constraints}) within the adiabatic approximation. In this regime, all the {\it{ac}}-potentials slowly evolve in time, being their rates of change very small (while their amplitude can be arbitrary) which allows us to keep only the contributions up to first order in the temporal variation of the {\it{ac}}-drivings. Within this linear-response approximation, the slave-boson field $\mathcal{B} (t)$ can be taken as a real number, as it is generally considered in the stationary case. Nevertheless, it is important to mention that the phase must be considered to work beyond linear response in the rate of change of the {\it{ac}}-potentials. We can start by multiplying the equation of motion in (\ref{a}) by $\mathcal{B}(t)$, and separating it into its real part \begin{equation}\label{realpart} \lambda(t)\mathcal{B}^2(t) +\sum_{\alpha,k_\alpha,\sigma}\mbox{Re}\left\{ w_{\alpha}(t)\mathcal{B}(t)\langle c^\dagger_{k_\alpha\sigma}f_\sigma\rangle\right\} =0, \end{equation} and imaginary part \begin{equation}\label{imaginarypart} \frac{1}{\hbar}\sum_{\alpha,k_\alpha,\sigma}2\,\mbox{Im}\left\{w_{\alpha}(t)\mathcal{B}(t)\langle c^\dagger_{k_\alpha\sigma}f_\sigma\rangle\right\}=\partial_t\mathcal{B}^2(t). \end{equation} This leaves us with three equations to be solved, (\ref{num}), (\ref{realpart}) and (\ref{imaginarypart}), and two unknown parameters. This means that the system of equations is overdetermined. In fact, we find that Eqs. (\ref{imaginarypart}) and (\ref{num}) are related. In order to show that, we notice that the left-hand side of the above equation is exactly the total flux of particles entering the leads $\dot{N}_{leads}(t)=\sum_{\alpha=L,R}\dot{N}_\alpha(t)$, with \begin{eqnarray}\label{particlecurrent} \dot{N}_{\alpha}(t)&=&\sum_{k_\alpha,\sigma} \frac{i}{\hbar}\langle[H_{SB}^{MF},c_{k_\alpha\sigma}^\dagger c_{k_\alpha\sigma}]\rangle\\ && = \frac{1}{\hbar}\sum_{k_\alpha,\sigma}2\,\mbox{Im}\left\{w_{\alpha}(t)\mathcal{B}(t)\langle c^\dagger_{k_\alpha\sigma}f_\sigma\rangle\right\}.\nonumber \end{eqnarray} Due to the conservation of the number of particles of the full system, the current entering the leads must be equal to the one leaving the dot, $\dot{N}_{leads}(t)=-\dot{N}_{d}(t)$. Therefore Eq.(\ref{imaginarypart}) can be written as $\dot{N}_{d}(t)+\partial_t\mathcal{B}^2(t)=0$, that is just the derivative in time of the constraint on the occupation of the dot in Eq. (\ref{num}). This means that within the adiabatic response regime, the set of equation in (\ref{constraints}), can be reduced to a $2\times 2$ system containing only Eqs. (\ref{num}) and (\ref{realpart}). In order to express this system in terms of the variables $\lambda(t)$ and $\mathcal{B}(t)$, we can follow the steps detailed in Appendix \ref{appendix1} for slow adiabatic drivings, and write the expectation value $\langle c^\dagger_{k_\alpha\sigma}f_\sigma\rangle(t,t)$ in terms of the Fourier transforms of the retarded Green function $G^r_\sigma(t,t')=-i\theta(t-t')\langle\{f_\sigma(t),f^\dagger_\sigma(t')\}\rangle$ and lesser Green function $G^<_\sigma(t,t')=i\langle f^\dagger_\sigma(t')f_\sigma(t)\rangle$ of the quantum dot \begin{equation}\label{greensdot} G^{r,<}_\sigma(t,t')=\int^{\infty}_{-\infty}\frac{d\varepsilon}{2\pi}e^{-i\frac{\varepsilon}{\hbar}(t-t')}G^{r,<}_\sigma(t,\varepsilon), \end{equation} which can be obtained by solving a Dyson equation \cite{dyson}. The lesser Green function is related to the occupation number of the dot through $N_d(t)=-i\sum_\sigma G^<_\sigma(t,t)$ . In this way the slave-boson equations read \begin{subequations}\label{greenset} \begin{eqnarray} \lambda(t)\mathcal{B}^2(t) & = & \!-\!\!\sum_{\alpha}\!\int\!\frac{d\varepsilon}{\pi}\!\left[\tilde{\Gamma}_\alpha(t) \mbox{Re}\!\left\{\!G^r(t, \varepsilon)f_\alpha(\varepsilon)+\frac{G^<(t,\varepsilon)}{2}\!\!\right\}\right.\nonumber\\ && \left.-\frac{\hbar}{2}\,\dot{\tilde{\Gamma}}_\alpha(t) \,\mbox{Im}\left\{\partial_\varepsilon G^r(t,\varepsilon)\right\}f_\alpha(\varepsilon)\right]\label{greenset1}\\ \mathcal{B}^2(t)-1&=&-\int\frac{d\varepsilon}{\pi}\mbox{Im}\left\{G^<(t,\varepsilon)\right\}, \end{eqnarray} \end{subequations} where we have assumed a spin-symmetric solution $G^{r,<}\equiv G^{r,<}_\uparrow=G^{r,<}_\downarrow$. The function $f_\alpha(\varepsilon)=[e^{(\varepsilon-\mu_\alpha)/(k_BT)}+1]^{-1}$ is the Fermi-Dirac distribution of the reservoir $\alpha$, with $k_B$ being the Boltzmann's constant. We have also defined $\tilde{\Gamma}_\alpha(t)=\mathcal{B}^2(t)\Gamma_\alpha(t)$ as the renormalized hybridization of the lead $\alpha$ due to the interactions, where $\Gamma_\alpha(t)=\vert w_\alpha(t)\vert^2\rho_\alpha$ is the hybridization in the non-interacting case and $\rho_\alpha$ is the density of states of the lead. We consider the wide-band limit, in which the densities $\rho_\alpha$, and therefore the hybridizations ${\Gamma}_\alpha$, are energy-independent. It is important to notice that the derivative $\dot{\tilde{\Gamma}}_\alpha$ involves not only the small rate of change of tunneling elements, inside $\dot{\Gamma}_\alpha$, but also the temporal variation of the bosonic field $\dot{\mathcal{B}}$. As a result of the slow evolution in time of the applied {\it{ac}}-drivings, the temporal variation of the parameters accounting for the interactions, $\dot{\lambda}$ and $\dot{\mathcal{B}}$, are also small. For this reason, in Eq. (\ref{greenset1}), we only keep the terms up to linear order in $\dot{\tilde{\Gamma}}_\alpha$. We can obtain exact results by expanding $G^r(t,\varepsilon)$ and $G^<(t,\varepsilon)$ up to first order in the temporal variation of all the {\it{ac}}-parameters of the MF Hamiltonian (\ref{hammf}) \cite{lowfreq1,lowfreq2} (see Appendix \ref{lowfreq} for details). Moreover, we can also evaluate the integrals of Eq. (\ref{greenset}) in linear response in the small bias voltage by expanding the Fermi distribution as $f_R\sim f+eV\partial_\varepsilon f$, with $f=f_L$. Then, \begin{subequations}\label{finalsetrho} \begin{eqnarray}\label{finallambda} \lambda(t)\mathcal{B}^2(t) & = & - \int\frac{d\varepsilon}{\pi}f(\varepsilon)\rho(t, \varepsilon)(\varepsilon-\tilde{\varepsilon}_d(t))\nonumber\\ &&-\int\frac{d\varepsilon}{\pi}\partial_\varepsilon f(\varepsilon)\rho(t, \varepsilon)(\varepsilon-\tilde{\varepsilon}_d(t))\times\\ &&\left[eV\frac{{{\Gamma}}_R(t)}{{\Gamma}(t)}+\frac{\hbar}{2}\rho(t, \varepsilon)\tilde{\Gamma}(t)\partial_t\!\!\left(\frac{(\varepsilon-\tilde{\varepsilon}_d(t))}{\tilde{\Gamma}(t)}\right)\right],\nonumber \end{eqnarray} and \begin{eqnarray}\label{finaln} \mathcal{B}^2(t)-1 & = & -\int\frac{d\varepsilon}{\pi}f(\varepsilon)\rho(t, \varepsilon)\nonumber\\ &&-\int\frac{d\varepsilon}{\pi}\partial_\varepsilon f(\varepsilon)\rho(t, \varepsilon)\times\\ &&\left[eV\frac{{\Gamma}_R(t)}{{\Gamma}(t)}+\frac{\hbar}{2}\rho(t, \varepsilon)\tilde{\Gamma}(t)\partial_t\!\left(\frac{(\varepsilon-\tilde{\varepsilon}_d(t))}{\tilde{\Gamma}(t)}\right)\right],\nonumber \end{eqnarray} \end{subequations} where $\tilde{\Gamma}(t)=\mathcal{B}^2(t)\Gamma(t)$, with $\Gamma(t)=\Gamma_L(t)+\Gamma_R(t)$, is the total hybridization, $\tilde{\varepsilon}_d(t)=\varepsilon_d(t)+\lambda(t)$ is the renormalized energy level of the quantum dot, and $\rho(t,\varepsilon)=\tilde{\Gamma}(t)[(\varepsilon-\tilde{\varepsilon}_d(t))^2+(\tilde{\Gamma}(t)/2)^2]^{-1}$ corresponds to the density of states describing the regime in which the electrons instantaneously adjust its potential to the {\it{ac}}-fields. The first terms on the right hand side in Eqs. (\ref{finallambda}) and (\ref{finaln}) describe the system as being at equilibrium \cite{dong} at every {\it{frozen}} time $t$, while the last ones represent the corrections due to the small {\it{dc}}-driving $V$ and the slow (but not necessarily weak or small) {\it{ac}}-drivings. \subsection{Leading-order solutions} For low driving frequencies $\omega$ and small bias voltages $V$, we propose the following solution for the non-linear system of equations in Eq. (\ref{finalsetrho}): \begin{equation}\label{sollambda} \lambda(t)=\lambda^f(t)+\Delta\lambda^{V}(t)+\Delta\lambda^\omega(t), \end{equation} and \begin{equation}\label{solb2} \mathcal{B}^2(t)={\mathcal{B}^f}^2(t)+{\Delta\mathcal{B}^2}^V(t)+{\Delta\mathcal{B}^2}^\omega(t), \end{equation} since Eqs. (\ref{finallambda}) and (\ref{finaln}) depend quadratically on the bosonic expectation value. Here, $\lambda^f(t)$ and ${\mathcal{B}^f}^2(t)$ are the {\it{frozen}} solutions considering that the system is at equilibrium at every time, as in a sequence of snapshots. They are obtained by solving numerically the following non-linear system of equations \begin{subequations}\label{setfrozen} \begin{equation} \lambda^f(t)\mathcal{B}^{f^2}(t)=- \int\frac{d\varepsilon}{\pi}f(\varepsilon)\rho^{f}(t, \varepsilon)(\varepsilon-\tilde{\varepsilon}_d^f(t)) \end{equation} \begin{equation} \mathcal{B}^{f^2}(t)-1=- \int\frac{d\varepsilon}{\pi}f(\varepsilon)\rho^{f}(t, \varepsilon), \end{equation} \end{subequations} where $\rho^f=\rho(\lambda=\lambda^f,\mathcal{B}^2=\mathcal{B}^{f^2})$ is the {\it{frozen}} density of states, and $\tilde{\varepsilon}_d^f=\varepsilon_d+\lambda^f$. $\Delta\lambda^{V,\omega}$ and ${\Delta\mathcal{B}^2}^{V,\omega}$ are the corrections due to the presence of the bias voltage $V$ and the {\it{ac}}-drivings with frequency $\omega$. Since the time derivative of the {\it{ac}}-potentials is proportional to the driving frequency, the first-order corrections are $\Delta\lambda^{\omega},\,{\Delta\mathcal{B}^2}^{\omega}\propto \omega$. Similarly, $\Delta\lambda^{V},\,{\Delta\mathcal{B}^2}^{V}\propto V$. To compute the corrections we have to plug Eqs. (\ref{sollambda}) and (\ref{solb2}) into (\ref{finalsetrho}), and perform an expansion up to first order in $\Delta\lambda^{V,\omega}$ and ${\Delta\mathcal{B}^2}^{V,\omega}$. After that, we find two independent $2\times 2$ systems of linear equations of the form \begin{equation}\label{systemcorrections} \sum_{j=1}^2 M_{ij}(t)X_j^{\beta}(t)=C_i^\beta(t)\,\,\,\,\text{for}\,\,\,\,i=1,2\ \end{equation} where $\beta=V, \omega$, as before, is an index indicating the nature of the correction, i.e. if it is due to the {\it{dc}}-driving or the {\it{ac}}-drivings. The vectors $\vec{X}^\beta$ collect the unknown corrections of both the Lagrange multiplier and the bosonic field, $\vec{X}^{V}=(\Delta\lambda^{V},{\Delta\mathcal{B}^2}^{V})$ and $\vec{X}^{\omega}=(\Delta\lambda^{\omega},{\Delta\mathcal{B}^2}^{\omega})$. The matrix $\hat{M}$ contains the coefficients of the system \begin{eqnarray}\label{m} M_{11}(t)&=&M_{22}(t)=1+\!\int\frac{d\varepsilon}{\pi}\partial_\varepsilon f \frac{\rho^f(t,\varepsilon)}{{\mathcal{B}^f}^2(t)}(\varepsilon-\tilde{\varepsilon}_d^f(t))\nonumber\\ M_{21}(t)&=&-M_{12}(t)\left(\frac{2}{\Gamma(t)}\right)^2=\int\frac{d\varepsilon}{\pi}\partial_\varepsilon f\,\rho^f(t,\varepsilon), \end{eqnarray} and, finally, the components $\vec{C}_i^{V,\omega}$ with $i=1,2$, are the independent terms \begin{eqnarray}\label{c} C_i^{V}(t)&=&-eV\frac{{\Gamma}_R(t)}{{{\Gamma}}(t)}\int\frac{d\varepsilon}{\pi}\partial_\varepsilon f\rho^f(t, \varepsilon)\left(\frac{(\varepsilon-\tilde{\varepsilon}^f_d(t))}{{\mathcal{B}^f}^2(t)}\right)^{(2-i)}\nonumber \\ C_i^{\omega}(t)&=& -\frac{\hbar}{2}\tilde{\Gamma}^f(t)\int\frac{d\varepsilon}{\pi}\partial_\varepsilon f{\rho^f}^2(t, \varepsilon)\times\\ &&\partial_t\!\!\left(\frac{(\varepsilon-\tilde{\varepsilon}^f_d(t))}{\tilde{\Gamma}^f(t)}\right)\left(\frac{(\varepsilon-\tilde{\varepsilon}^f_d(t))}{{\mathcal{B}^f}^2(t)}\right)^{(2-i)},\nonumber \end{eqnarray} where $\tilde{\Gamma}^f={\mathcal{B}^f}^2\Gamma$. The solutions of the systems of equation in (\ref{systemcorrections}) read \begin{equation}\label{correct1} \Delta\lambda^\beta(t) =\frac{C_1^{\beta}(t)M_{22}(t)-C^\beta_{2}(t)M_{12}(t)}{\mbox{det}[\hat{M}(t)]}, \end{equation} \begin{equation}\label{correct2} {\Delta\mathcal{B}^2}^\beta (t)=\frac{C_2^{\beta}(t)M_{11}(t)-C^\beta_{1}(t)M_{21}(t)}{\mbox{det}[\hat{M}(t)]}, \end{equation} and therefore we can see, from the expressions of the coefficients in Eqs. (\ref{m}) and (\ref{c}), that the dynamic of the system within the adiabatic regime is fully determined by the {\it{frozen equilibrium}} solutions of Eq. (\ref{setfrozen}), since the linear response corrections $\Delta\lambda^{V,\omega}(t)$ and ${\Delta\mathcal{B}^2}^{V,\omega}(t)$ are evaluated only with the frozen $\lambda^f(t)$ and ${\mathcal{B}^f}^2(t)$. \section{Nanomotors}\label{nanomotors} In this section we apply the formalism developed in Sec. \ref{formalism} to study the performance of {\it{ac}}-driven quantum dots as nanomotors that convert electrical energy into work through the exchange of energy between the {\it{dc}}-source (the battery maintaining the bias voltage $V$) and the {\it{ac}}-sources of the time-dependent driving. These processes of energy conversion are described by non-equilibrium thermodynamics in terms of generalized driving forces $X_i$, and the fluxes $J_i$ induced by those applied forces. More specifically, it was recently shown in Ref. \cite{ludovico} that in the case of nanomotors, the relevant forces are $X_1=eV/T$ and $X_2=\hbar\omega/T$, and their respective conjugated variables (or fluxes) are the particle current $J_1=I/e$ entering the reservoir at lower chemical potential, and $J_2=P^{ac}/\hbar\omega$, with $P^{ac}$ being the power (work per unit of time) performed by the {\it{ac}}-potentials. We stress that we are focusing on the performance of the system after a complete cycle of the machine, so that all the fluxes are averaged over one period of the {\it{ac}}-driving. \subsection{Linear response and conservation laws} In the adiabatic regime, and for a small bias voltage, the generalized forces are small and the relationship between fluxes and forces is linear \begin{equation}\label{linearresp} \begin{pmatrix}I/e \\ P^{ac}/\hbar\omega \end{pmatrix}=\hat{L}\begin{pmatrix}eV/T \\ \hbar\omega/T \end{pmatrix}, \end{equation} where the linear response coefficients collected in the matrix $\hat{L}$ are known as {\it{Onsager}} coefficients, each with a clear physical meaning. The coefficient $L_{11}$ is proportional to the electrical conductance $G$, $L_{12}$ describes the adiabatic quantum pumping of particles due to the {\it{ac}}-driving. On the other hand, the frequency-dependent part of the {\it{ac}}-power is described by $L_{22}$, whereas $L_{21}$ captures its modifications due to the applied bias voltage. The latter, is the coefficient related to the exchange of energy between {\it{dc}} and {\it{ac}} sources, and its sign depends on whether the machine is operating as a motor, or in reverse, as a generator. In this work, we are focusing on the performance as a motor, for which $L_{21}< 0$, meaning that the system is performing work on the {\it{ac}}-sources. Then, we will say that this off-diagonal coefficient is related to the output power $P_{out}$, in the sense that it corresponds to the energy flux that could be later transformed, in a proper setup, into another kind of energy, say mechanical energy. More precisely, the relations between the Onsager elements and the transport coefficients read \begin{eqnarray}\label{transport} G &=& e^2\frac{L_{11}}{T}, \,\,\,\,\,Q_p =he \frac{L_{12}}{T},\nonumber\\ P_{out} &=& -\frac{L_{21}}{T}\frac{heV}{\tau},\,\,\,\,P^{ac}_{diss}=\frac{L_{22}}{T}\left(\frac{h}{\tau}\right)^2, \end{eqnarray} where $Q_p$ is the pumped charge per driving period $\tau=2\pi/\omega$, and $P^{ac}_{diss}$, as it will be shown later, is the portion of the power developed by the {\it{ac}}-sources that is related to dissipation due to heating of the system. Within linear response, the rate of entropy production averaged over one period of the {\it{ac}}-drivings is $\dot{S}=\vec{J}\cdot\vec{X}$, which for a nanomotor reads \begin{equation}\label{entropy2} T\dot{S}=I\cdot V+P^{ac}, \end{equation} where we can identify $P^{dc}=I\cdot V$ as the power developed by the battery maintaining the bias voltage (i.e the power of the {\it{dc}}-source). From Eqs. (\ref{linearresp}) and (\ref{transport}), it can be seen that in terms of the transport coefficients the power developed by the driving sources are \begin{equation}\label{powerdc} P^{dc}=GV^2+Q_pV/\tau, \end{equation} and \begin{equation}\label{powerac} P^{ac}=-P_{out}+P^{ac}_{diss}. \end{equation} On the other hand, it was also shown in Ref. \cite{ludovico} that systems with time-reversal symmetry, thus without an applied magnetic field, satisfy the following Onsager reciprocal relation for the crossed coefficients: \begin{equation}\label{onsager} L_{12}=-L_{21}. \end{equation} Thus, we can notice from Eq. (\ref{transport}) that the above reciprocal relation leads to Eq. (\ref{power}), $P_{out}=Q_pV/\tau$. The latter is a positive quantity for a motor, and captures the physics of its operation: the conversion between electrical energy into work performed on the {\it{ac}}-sources. In irreversible processes, the entropy production is associated with the power dissipated within a cycle, $P_{diss}$, through $T\dot{S}=P_{diss}$, which corresponds to dissipation as heat inside the reservoirs \cite{lowfreq1}. Then, from Eqs. (\ref{entropy2}), (\ref{powerdc}) and (\ref{powerac}) \begin{equation}\label{diss} P_{diss}=P^{dc}+P^{ac}=P^{dc}_{diss}+P^{ac}_{diss}, \end{equation} where we have defined $P^{dc}_{diss}=GV^2$ as the power dissipated by the voltage source. The second law of thermodynamics, meaning that $\dot{S}\geq 0$, imposes some conditions on the linear response transport coefficients. In this case, since the conductance is positive defined, the positivity of the entropy production leads to $P^{ac}_{diss}\geq 0$. The above equation together with Eq. (\ref{power}) constitute the laws for the conservation of the energy in the system. Eq. (\ref{diss}) tells that the total power developed by the driving sources, both {\it{dc}} and {\it{ac}}, must be equal to the net dissipation in the system. Moreover, Eq. (\ref{power}), establishes that part of the power developed by the {\it{dc}} source is transfered to the {\it{ac}} sources through the adiabatic quantum pumping of charge. In each cycle, $Q_p$ changes are pumped into the reservoir at lower chemical potential, and the gain in electrical energy ($Q_pV$) is used to perform work on the {\it{ac}}-sources ($\tau P_{out}$). This is illustrated in Fig. {\ref{energysketch}}, as an electronic circuit. The system, which is composed by the quantum dot and the two reservoirs, is represented by a box. In the motor mode, both {\it{dc}} and {\it{ac}} sources drive an electric current $I$ flowing from left to right, in the same direction as the voltage drop. And, as a result of this charge flow, part of the energy injected by the sources is dissipated as heat (schematized as a cloud), while an amount $P_{out}$ is delivered by the system to the {\it{ac}}-sources. \vspace{1em} \begin{figure}[h] \includegraphics[width=0.4\textwidth]{energysketch} \caption{Schematic circuit of the system and the driving sources. The box represents the quantum dot together with the two reservoirs. $P^{dc}$ is the power developed by the battery maintaining the bias voltage $V$ between the reservoirs, while $P^{ac}$ corresponds to the power developed by the {\it{ac}}-sources. As a result of the driving a current $I$ flows through the system. The cloud represents the power that is dissipated as heat inside the reservoirs, $P_{diss}=P^{ac}+P^{dc}$. On the other hand, an energy flux $P_{out}$ is transfered from the {\it{dc}}-source to the {\it{ac}}-sources. }\label{energysketch} \end{figure} \subsection{Efficiency at maximum power}\label{secefi} The efficiency of a motor is defined as the ratio between the power performed by the system on the {\it{ac}}-sources, $P^{s\rightarrow ac}=-P^{ac}$, and the power injected by the voltage source $P^{dc}$, \begin{equation}\label{eff} \eta=\frac{P^{s\rightarrow ac}}{P^{dc}}. \end{equation} We are interested in analyzing the efficiency of the system at maximum power $P^{s\rightarrow ac}_{max}$. For that, we write the {\it{ac}} power in terms of the fluxes and forces \begin{equation} P^{s\rightarrow ac}=-TX_2J_2=-T(L_{21}X_1X_2+L_{22}X_2^2). \end{equation} Then we can see that, as a function of $X_2$, it is maximimum for \begin{equation}\label{xmax} X_2=-\frac{L_{21}}{2L_{22}}X_1, \end{equation} taking the value \begin{equation} P^{s\rightarrow ac}_{max}=\frac{L_{21}^2}{4L_{22}}X_1^2T=\frac{P_{out}^2}{4P^{ac}_{diss}}. \end{equation} Thus, the maximum power that can be performed on the {\it{ac}}-sources is dictated by the relation between the power $P_{out}$ transfered from the voltage source to the {\it{ac}}-sources, and the power $P_{diss}^{ac}$ that is dissipated by the {\it{ac}}-sources. The efficiency at maximum power can be obtained by evaluating Eq. (\ref{eff}) at the relation (\ref{xmax}). For systems obeying the Onsager's relation (\ref{onsager}), it reads \begin{equation}\label{efficiency} \eta(P_{max}^{s\rightarrow ac})=\frac{1}{2}\frac{\xi}{\xi+2}, \end{equation} with \begin{equation} \xi=\frac{L_{12}^2}{L_{11}L_{22}}=\frac{P_{out}^2}{P^{dc}_{diss}P^{ac}_{diss}}, \end{equation} being the figure of merit introduced in Ref. \cite{ludovico}. The efficiency in Eq. (\ref{efficiency}) is a monotonically increasing function of $\xi$, with $\eta(P^{s\rightarrow ac}_{max})=0$ when $\xi=0$ and $\eta(P^{s\rightarrow ac}_{max})\rightarrow 1/2$ for $\xi\rightarrow \infty$. In this way, large values of the figure of merit are needed to achieve high efficiencies, which in turn requires a large pumping of charge coefficient $L_{12}$ (high values for $P_{out}=Q_pV/\tau$) along with a small product $L_{11}L_{12}$ (low dissipation of the {\it{dc}}-source and/or the {\it{ac}}-sources). \subsection{Transport coefficients} The coefficients of the Onsager matrix $\hat{L}$ can be written, within the non-equilibrium Green's function formalism, in terms of the Green's functions of the central quantum dot \cite{ludovico, dyson} in Eq. (\ref{greensdot}). For that, we have to compute the fluxes $J_1=I/e$ and $J_2=P^{ac}/\hbar\omega$, and collect the terms which are first order in the small forces $X_1=eV/T$ and $X_2=\hbar\omega/T$. The charge flux $I$ flowing through the system can be computed in terms of the current of particles entering the reservoirs (see Eq. (\ref{particlecurrent})) as $I/e=\overline{\dot{N}_R(t)}=-\overline{\dot{N}_L(t)}$, where the line on top denotes the temporal average over a period $\tau$ of the {\it{ac}}-drivings: $\overline{O}=\int^\tau_0 O(t)/\tau$. We have also used the fact that the time-dependent MF Hamiltonian in Eq. (\ref{hammf}) conserves the charge (and the energy). In this way, the time-averaged particle flux leaving the left reservoir must be equal to the flux entering the right one, since no net charge can be stored in the quantum dot. Now, by following the steps detailed in Appendix \ref{appendix1} for slow driving, the resulting flux reads \begin{eqnarray}\label{charge1} I & = & \frac{2e}{\hbar}\!\int^\tau_0\!\!\frac{dt}{\tau}\!\!\int\frac{d\varepsilon}{\pi} \left[\tilde{\Gamma}_R(t) \mbox{Im}\left\{G^r(t, \varepsilon)f_R(\varepsilon)+\frac{G^<(t,\varepsilon)}{2}\right\}\right.\nonumber\\ &&\left. +\frac{\hbar}{2}\dot{\tilde{\Gamma}}_R(t) \mbox{Re}\left\{\partial_\varepsilon G^r(t,\varepsilon)\right\}f_R(\varepsilon)\right]. \end{eqnarray} On the other hand, the power developed by the {\it{ac}}-sources is defined as $P^{ac}=\overline{\langle\partial_t H^{MF}_{SB}\rangle }$. After using equations (\ref{num}) and (\ref{realpart}), it is easy to show that the derivative in time of the MF Hamiltonian in (\ref{hammf}) reads \begin{eqnarray} \langle\partial_t H^{MF}_{SB}\rangle & = & \dot{{\varepsilon}}_{d}(t) N_d(t)+\!\!\!\sum_{\alpha,k_\alpha ,\sigma}\!\!2\mbox{Re}\left\{\dot{{w}}_\alpha(t)\mathcal{B}(t)\langle c^\dagger _{k_\alpha ,\sigma} f_\sigma\rangle\right\},\nonumber\\ \end{eqnarray} from which we can see that, as expected, the work is performed on the system due to the change in time of the applied {\it{ac}}-potentials, $\dot{\varepsilon_d}(t)$ and $\dot{w}_\alpha(t)$, while the variation in time of the additional {\it{ac}}-parameters accounting for the interactions $\dot{\lambda}(t)$ and $\dot{\mathcal{B}}(t)$ indirectly contributes through the evolution of the expectation values $\dot{N}_d(t)$ and $\langle c^\dagger_{k_\alpha,\sigma}f_\sigma \rangle(t,t)$. Similarly as for the charge current $I$ (see Appendix \ref{appendix1} for details), we find that the power can be written in terms of the Green's functions of the dot as \begin{eqnarray}\label{poweracgreen} P^{ac} & = &\sum_\alpha\int^\tau_0\!\!\frac{dt}{\tau}\!\!\int\frac{d\varepsilon}{\pi} \left[\dot{{\Gamma}}_\alpha(t)\mathcal{B}^2(t) \mbox{Re}\left\{G^r(t, \varepsilon)\right\}f_\alpha(\varepsilon)\right.\nonumber\\ &&\left. -\frac{\hbar}{2}\frac{\dot{\Gamma}_\alpha(t)\dot{\tilde{\Gamma}}_\alpha(t)}{\Gamma_\alpha(t)}\mbox{Im}\left\{\partial_\varepsilon G^r(t,\varepsilon)\right\}f_\alpha(\varepsilon)\right.\\ &&+\left.\mbox{Im}\left\{\left(\dot{\varepsilon}_d(t)+i\frac{\dot{\Gamma}_\alpha(t)\mathcal{B}^2(t)}{2}\right)G^<(t,\varepsilon)\right\}\right].\nonumber \end{eqnarray} In order to find the linear-response Onsager coefficients $L_{11}$ and $L_{12}$, we need to collect the terms in the current $I$ which are first order in $eV$ and $\hbar\omega$. Nevertheless, in order to express $J_2=P^{ac}/\hbar\omega$ within linear response and compute $L_{21}$ and $L_{22}$, it is necessary to keep the second order terms in $P^{ac}$ that are proportional to $(eV\hbar\omega)$ and $(\hbar\omega)^2$. We note that $P^{ac}$ has no linear or quadratic terms in $eV$ since no {\it{ac}}-power can be generated in the static situation ($\omega=0$). Moreover, its linear term in $\hbar\omega$ is zero because it is related to the change of the entropy in reversible processes, which vanishes under a cycle that begins and ends at the same equilibrium state \cite{lowfreq1}. Similarly as in Section \ref{formalism}, we expand the retarded and lesser Green's functions in Eqs. (\ref{charge1}) and (\ref{poweracgreen}) up to first order in the change of the {\it{ac}}-parameters, $\dot{\tilde{\varepsilon}}_d(t)$ and $\dot{\tilde{\Gamma}}_\alpha(t)$ (see Appendix \ref{lowfreq}). Besides, we combine this treatment with an expansion of the Fermi functions of the reservoirs $f_\alpha(\varepsilon)$ in powers of $eV$. In this way, we find that \begin{equation}\label{l11} L_{11}=-\frac{T}{\hbar\pi}\!\!\int^{\tau}_0\!\!\frac{dt}{\tau}\!\!\int d\varepsilon\, \partial_\varepsilon f\frac{\tilde{\Gamma}_L^f(t)\tilde{\Gamma}_R^f(t)}{\tilde{\Gamma}^f(t)}\rho^f(t,\varepsilon), \end{equation} and \begin{equation}\label{l12} L_{12}=\frac{T}{h\pi}\!\!\int^{\tau}_{0}\!\!dt\!\!\int\!\!{d\varepsilon}\,\partial_\varepsilon f\rho^f(t,\varepsilon) \frac{{{\tilde{\Gamma}^{f^2}_R}}(t)}{\tilde{\Gamma}^f(t)}\partial_t\left(\frac{(\varepsilon-\tilde{\varepsilon}_{d}^f(t))}{\tilde{\Gamma}_R^f}\right). \end{equation} In the case of $P^{ac}$, since it is a second-order quantity, it has a contribution not only of the {\it{frozen}} solutions but also of the corrections $\Delta\lambda^{V,\omega}(t)$ and ${\Delta\mathcal{B}^2}^{V,\omega}(t)$. Explicit expressions of the Onsager coefficients $L_{21}$ and $L_{22}$ in terms of the frozen solutions and the corrections can be found in Appendix \ref{appendix3}, where we also show the validity of the Onsager reciprocal relation (\ref{onsager}), and that the dissipative coefficient reads \begin{eqnarray}\label{l22} L_{22}&=&-\frac{T}{h2\pi\omega}\!\!\int^\tau_0\!\!dt\!\!\int\!\!d\varepsilon\,\partial_\varepsilon f\!\!\left\{\!\!\left[\!{\tilde{\Gamma}}^f(t)\rho^f(t,\varepsilon)\partial_t\!\!\left(\frac{\varepsilon-\tilde{\varepsilon}_{d}^f(t)}{\tilde{\Gamma}^f(t)}\right)\!\!\right]^2\right.\nonumber\\ &&\left.+\rho^f(t,\varepsilon)\left(\sum_\alpha \frac{(\dot{\tilde{\Gamma}}^f_\alpha(t))^2}{2\tilde{\Gamma}^f_\alpha(t)}-\frac{(\dot{\tilde{\Gamma}}^f(t))^2}{2\tilde{\Gamma}^f(t)}\right)\right\}. \end{eqnarray} Therefore, by using the explicit expressions for the corrections in (\ref{correct1}) and (\ref{correct2}), we demonstrate that all the linear response coefficients are evaluated only at the {\it{frozen}} equilibrium solutions of Eq. (\ref{setfrozen}). Furthermore, we find that Eqs. (\ref{l11}), (\ref{l12}) and (\ref{l22}) are the same as those obtained for the non-interacting quantum dot (by evaluating the Hamiltonian (\ref{hamdot}) at $U=0$) with the substitutions $\Gamma_\alpha(t)\rightarrow \tilde{\Gamma}_\alpha^f(t)$ and $\varepsilon_d(t)\rightarrow \tilde{\varepsilon}_d^f(t)$. \section{Results}\label{Results} As an illustrative example, we consider the case $\varepsilon_d(t)=0$, with hybridizations $\Gamma_L(t)=\Gamma^{dc}+\Gamma^{ac}\cos(\omega t)$ and $\Gamma_R(t)=\Gamma^{dc}-\Gamma^{ac}\sin(\omega t)$. The hybridization with the reservoirs must oscillate with a relative phase lag, since at least two different time-dependent parameters are needed in order to have quantum pumping within the adiabatic regime \cite{brouwen}. We also focus on the situation in which the reservoirs are at the same temperature $T=0$. As was shown in the previous section, the Onsager coefficients describing the linear-response charge and energy transport through the driven interacting quantum dot (see Eqs. (\ref{l11}), (\ref{l12}) and (\ref{l22})), are evaluated only at the {\it{frozen}} parameters $\lambda^f(t)$ and $\mathcal{B}^{f^2}(t)$. The latter are found by solving the non-linear system of equations in (\ref{setfrozen}) at every {\it{frozen}} time $t$. We emphasize again that in this {\it{frozen picture}} the system is considered to be at equilibrium at every time $t$ as in a sequence of snapshots, so that the variable $t$ is treated as a parameter. In Fig. \ref{fig2} we show the average value over one driving period of the Lagrange multiplier $\overline{\lambda^f(t)}$, together with the bosonic field $\overline{\mathcal{B}^{f^2}(t)}$ as a function of the chemical potential $\mu$ of both of the reservoirs (since in Eq. (\ref{setfrozen}) the bias is $eV=0$). We can see that when the level of the dot is deep below the chemical potential ($\mu\gg0$), the average density of holes vanishes $\overline{\mathcal{B}^{f^2}(t)}\rightarrow 0$, which means that the level is occupied with only one electron. Moreover, in the same limit, the effective energy of the level is in resonance with the chemical potential $\overline{\tilde{\varepsilon}_d^f(t)}=\overline{\lambda^f(t)}\sim \mu$, as expected in the Kondo regime. In the opposite situation when the dot has an energy far above the Fermi level $\mu\ll 0$, the field $\overline{\mathcal{B}^{f^2}(t)}\sim 1$ so that the quantum dot is empty. \begin{figure}[h] \includegraphics[width=0.47\textwidth]{fig2b.pdf} \caption{Time average over one driving period of the frozen Lagrange multiplier $\overline{\lambda^f}(t)$ and density of holes $\overline{\mathcal{B}^{f^2}}(t)$, as a function of the chemical potential of the reservoirs $\mu$. The {\it{ac}}-parameters $\lambda^f(t)$ and $\mathcal{B}^{f^2}(t)$ are computed by solving the equilibrium-like non-linear system of equations in Eq. (\ref{setfrozen}) at every frozen time $t$, considering a zero bias voltage $eV=0$ applied between the reservoirs. Since in this example $\varepsilon_d=0$, then positive values of the chemical potential $\mu$ correspond to the energy level of the dot being below the Fermi energy, while the opposite situation occurs when $\mu<0$. The parameters of the driving are, $\Gamma^{dc}=\Gamma^{ac}=0.5$, and $\hbar\omega=0.001$. The temperature of the reservoirs is $T=0$. All the energies are in units of the {\it{dc}} component of the total hybridization, $\Gamma^0\equiv\overline{\Gamma(t)}=2\Gamma^{dc}$.}\label{fig2} \end{figure} Now, we turn to the behavior of the linear response transport coefficients in Eqs. (\ref{l11}), (\ref{l12}) and (\ref{l22}) as functions of the chemical potential. The results can be found in Fiq. \ref{fig3}, where for comparison we also slow (bottom panel) the same coefficients for non-interacting electrons. In the $U=0$ limit, the conductance $G=e^2L_{11}/T$ reaches its maximum value when the chemical potential is in resonance with the energy level of the dot (i.e. $\mu=0$). Driving the system with two barriers oscillating with a phase lag $\delta=\pi/2$, decreases the conductance and favors pumping by dynamically putting the system off resonance. Therefore, the pumping coefficient $L_{12}$ vanishes for $\mu=0$ and attains its peaks when the chemical potentials is apart from the resonance \cite{ludovico, Splett}. In the strongly interacting limit $U\rightarrow\infty$, the extra {\it{ac}}-parameters, $\lambda^f(t)$ and $\mathcal{B}^{f^2}(t)$, are introduced through a renormalized hybridization with the reservoirs, $\Gamma_\alpha(t)\mathcal{B}^{f^2}(t)$, and an effective energy level $\tilde{\varepsilon}^f_d(t)=\lambda^f(t)$. As can be seen from Fig. \ref{fig2} and the top panel in the top panel of Fig. \ref{fig3}, the Lagrange multiplier $\lambda^{f}(t)$ has the effect of moving the resonance from its non-interacting value $\mu=0$, to energies far above the dot level $\mu\gg 0$ (Kondo peak of the conductance \cite{dong}). However the extra {\it{ac}}-parameters introduced by the interactions between the electrons in the dot do not only shift the resonance (as in {\it{dc}}-transport), but also contribute to the pumping of particles. Remarkably we find that for some values of $\mu$ the pumping coefficient $L_{12}$ is enhanced with respect to the non-interacting problem, and it is also bigger than the conductance $L_{12}>L_{11}$. This different behavior arises from the new time-dependent quantities introduced by interactions. As in the non-interacting problem, the pumping coefficient vanishes at the resonance, which in this case occurs when $\mu\gg 0$. This can be easily proved by taking at $T=0$ the limit $\lambda^f\rightarrow \mu$ and $\mathcal{B}^{f^2}\rightarrow 0$ in Eq. (\ref{l12}). On the other hand, $L_{12}$ decays as $\vert\tilde{\varepsilon}_d^f-\mu\vert^{-1}$ when $\mu\ll 0$. To analyze in more depth the behavior of the pumping coefficient, we focus on the energy $\mu=\mu_{max}$ at which $L_{12}$ reaches its maximum value. Then, we study the relation between the energy distance $(\tilde{\varepsilon}_d^f(t)-\mu_{max})$ and the width of the frozen density of states, which is proportional to the total hybridization $\tilde{\Gamma}^f(t)$. The results are shown in Fig. \ref{fig4}. We find that the maximum of the time-averaged pumping coefficient occurs when the two quantities become comparable, i.e. $(\overline{\tilde{\varepsilon}_d^f}(\mu_{max})-\mu_{max})\sim \overline{\tilde{\Gamma}^f}(\mu_{max})$, so that the effect of the modulation of the hybridizations can be felt. A similar behavior of the pumping coefficient was reported in Refs. \cite{citro, Splett}. \begin{figure}[h!] \includegraphics[width=0.48 \textwidth]{fig3b.pdf} \caption{Onsager coefficients as a function of the chemical potential $\mu$ of the reservoir on the left. Top panel corresponds to the strongly interacting case $U\rightarrow \infty$, while the bottom panel shows the results for non-interacting electrons $U=0$. All the parameters are the same as in Fig. \ref{fig2}. }\label{fig3} \end{figure} Note that in the case with $U=0$, the pumping coefficient changes sign as $\mu$ passes the resonance ($\mu=0$). This means that the system switches from the motor mode with $L_{12}>0$ (when $\mu>0$) to the the generator mode with $L_{12}<0$ (for $\mu<0$). However, in the limit $U\rightarrow\infty$, the pumping of particles vanishes for $\mu<0$, and therefore the system operates only as a motor. Finally, we turn to the dissipative coefficient $L_{22}$. We can see from Eq. (\ref{l22}) that it has two contributions. The first one, as for the pumping coefficient in Eq. (\ref{l12}), results in a peak at $\mu=\mu_{max}$ and vanishes for $\mu\gg0$, while the second one leads to a finite value at the Kondo peak (see top panel of Fig. \ref{fig3}). We can also observe a significant increase of the maximum value of dissipation (around $L_{22}^{max}\sim 0.55 \hbar^{-1}$) with respect to the non-interacting problem ($L_{22}^{max}\sim 0.32 \hbar^{-1}$). An increment of the dissipation in nanomotors due to electronic interactions was also reported in \cite{bruch}. This effect can be traced back to the fact that there are more {\it{ac}}-parameters in the interacting problem, that contribute to the pumping of charge as well as to the dissipation. \begin{figure}[h] \includegraphics[width=0.48\textwidth]{fig4.pdf} \caption{Time average of the energy difference $\tilde{\varepsilon}^f_d(t)-\mu$ vs the averaged effective total hybridization $\overline{\tilde{\Gamma}^f}$, evaluated at the chemical potential $\mu_{max}$ for which the pumping coefficient $L_{12}$ achieves its maximum value. The {\it{dc}} component is $\Gamma^{dc}=0.5\Gamma^0$, while the parameter $\Gamma^{ac}$ was varied from $10^{-2}\Gamma^0$ to $\Gamma^{dc}$.}\label{fig4} \end{figure} As discussed in Sec. \ref{secefi}, the enhancement of the pumping effect along with the reduction of the product $L_{11}L_{22}$ favors the improvement of the efficiency in Eq. (\ref{efficiency}). This is why, as we can see in Fig. \ref{fig5}, higher efficiencies can be attained for $U\rightarrow\infty$ in comparison with the non-interacting problem. The improvement of the performance occurs for energies around $\mu_{max}$, for which the pumping coefficient is maximized, and its maximum value is around three times larger than the one obtained for $U=0$ ($\eta^{U\rightarrow\infty}_{max}\sim 3\eta^{U=0}_{max}$). Moreover, not only an enhance of the efficiency can be obtained due to Coulomb interactions, but also the maximum power done by the system on the {\it{ac}}-sources is larger. This is illustrated in Fig. \ref{fig6}, where we show the maximum power divided by the square of the affinity $eV$ (or force) driving the motor, $P^{s\rightarrow ac}_{max}/(eV)^2$, as a function of the efficiency at which the latter power is delivered by the system $\eta(P^{s\rightarrow ac}_{max})$. It can be noticed that, in the strongly interacting limit, the maximum power that is done by the system is higher, and it is delivered more efficiently. \begin{figure}[h] \includegraphics[width=0.46\textwidth]{fig5.pdf} \caption{Efficiency at maximum power $\eta(P^{s\rightarrow ac}_{max})$ as a function of the chemical potential. All the parameters are the same as in Fig. \ref{fig2}.}\label{fig5} \end{figure} \begin{figure}[h] \includegraphics[width=0.49\textwidth]{fig6.pdf} \caption{Maximum power performed by the electronic system on the {\it{ac}}-sources $P^{s\rightarrow ac}_{max}/(eV)^2$, as a function of the efficiency $\eta(P^{s\rightarrow ac}_{max})$. All the parameters are the same as in Fig. \ref{fig2}. }\label{fig6} \end{figure} \section{Conclusions}\label{conclusions} In this work we studied the effects of electron-electron interactions on the performance of a quantum-dot-based nanomotor. To address this problem, we considered the simplest meaningful setup consisting in a two-terminal device with an interacting quantum dot in the middle, as it is illustrated in Fig. \ref{fig1}. Charge and energy transport through the system is driven by a voltage difference between the reservoirs, along with the application of {\it{ac}}-potentials to control the transparency of the tunneling barriers and vary the energy level of the dot. We focused on the strongly-interacting limit, and on the adiabatic response regime for which the {\it{ac}}-driving potentials slowly evolve in time. In this context, we developed a method to describe analytically the interacting quantum dot that combines the time-dependent slave-boson mean-field theory with a linear response treatment in the small rate of change of the {\it{ac}}-parameters of the MF Hamiltonian. The advantage and beauty of the formalism we presented here is that the dynamics of the system turns out to be simply described in terms of {\it{frozen}} equilibrium solutions at every time. Moreover, the approach is not restricted to the strongly interacting limit or the linear response regime, since the slave-boson approach can also be implemented in the finite-$U$ case using for example the Kotliar-Ruckenstein formalism, and one can keep higher order contributions in the adiabatic parameter. In order to study the performance of our system as a motor, we analyzed the relation between the charge current flowing through the quantum dot and the power developed by the {\it{ac}}-driving sources. We computed the relevant transport coefficients and we showed that they satisfy Onsager reciprocity relations. We found that, similarly to the stationary case, all the linear response transport coefficients are obtained from the expressions for a non-interacting quantum dot with correlation-induced renormalizations of the dot energy level and hybridizations with the reservoirs. Finally, as an illustrative example, we considered the system being at zero temperature and with a constant energy level of the dot. We found that the additional {\it{ac}}-parameters introduced by the interactions, due to the temporal dependence of the Lagrange multiplier and the bosonic field, lead to two main effects. One is the shift of the resonance from its non-interacting value to energies deep below the Fermi level (Kondo peak), and the second one is the enhancement of the efficiency with respect to a non-interacting dot. The latter can be understood from the fact that the extra {\it{ac}}-parameters accounting for the interactions increase the pumping of particles while decreasing the electrical conductance. \section{Acknowledgements} We acknowledge support from the H2020 Framework Programme under ERC Advanced Grant No. 692670 “FIRSTORM’, The Ministero dell’Istruzione Universit`'a e Ricerca through PRIN 2015 (Prot. 2015C5SEJJ001) and SISSA/CNR project ”Superconductivity, Ferroelectricity and Magnetism in bad metals” (Prot. 232/2015).
\section{Introduction} Developing material heterojunctions with a wide range of thermal transport properties is the focus of intense research, which can directly impact applications related to electronics, heat management and thermoelectrics \cite{Cahill2003,Cahill2014}. Although this topic has a long history, there still remain open fundamental questions regarding what microscopic processes control heat transport and dictate the thermal contact resistance, $R_C$. Focusing on the case of interfaces comprised of semiconductors and/or insulators, in which phonons are the sole heat carriers, there have been many theoretical studies using a variety of methods to understand phonon transport and predict $R_C$. Simple models include the acoustic mismatch model (AMM) and diffuse mismatch model (DMM) \cite{Swartz1989}, where the AMM assumes wave coherence and specular scattering off a smooth interface, and the DMM assumes fully diffuse scattering off a rough interface. Thus, together both provide a range of $R_C$ values that can provide information about the quality of the interface when compared to experiment, although measurements do not always fall within this range. Interfacial phonon transport has also been investigated using molecular dynamics (MD) \cite{Landry2009a,Landry2009b,Tomar2009,Puri2011,Chalopin2012,English2012,Merabia2012,Jones2013,Liang2014,Volz2014,Rashidi2015,Zhan2015,Gordiz2016,Gordiz2017,Feng2017,Zhou2017,Tao2017,Lee2018}, atomistic Green's function (AGF) \cite{Tian2012,Ong2015,Miao2016,Latour2017,Sadasivam2017} and the Boltzmann transport equation (BTE) \cite{Mansoor2011,Singh2011,Chen2013}. Each approach has its advantages and has been used to identify various phonon transport processes across heterojunctions. For example, MD captures all-order anharmonic phonon scattering, and was used to demonstrate the role of inelastic multi-phonon processes across the interface \cite{Volz2014,Zhan2015,Zhou2017}. AGF and MD naturally treat the interfacial phonon properties, which lead to non-bulk interface modes that have been proposed to mediate phonon transport \cite{Gordiz2016,Gordiz2017}. Detailed mode-resolved phonon transport properties \cite{Feng2017} and transmission coefficients \cite{Latour2017} have been obtained using AGF and MD. The BTE showed that inelastic bulk scattering can result in non-trivial temperature and heat current distributions near an interface \cite{Singh2011}. This may be a general feature of heterojunctions, but what exactly controls such inelastic processes and how this affects phonon transport has yet to be fully understood. When there is a mismatch in the phonon energies, for example with Si and Ge as depicted in Fig. \ref{fig_model_structure}, inelastic phonon scattering is likely an important process. For example, since the maximum Si phonon energy ($\epsilon_{\rm Si,max}$) is nearly double that of Ge ($\epsilon_{\rm Ge,max}$), the high-energy Si phonons cannot conduct heat without inelastic scattering. In this study, we investigate a Si-Ge interface focusing on the role and origin of inelastic bulk scattering in Si and Ge, using the McKelvey-Shockley flux method combined with density functional theory (DFT) and an ideal interface model. Our approach has the advantage of being computationally efficient and physically transparent, which helps provide new insights. We find the high-energy Si phonons do carry significant heat (more than in bulk) due to strong inelastic processes activated by non-equilibrium effects driven by the junction. While Si-Ge interfaces have been extensively investigated \cite{Tomar2009,Landry2009a,Landry2009b,Puri2011,Chalopin2012,Tian2012,Chen2013,Rashidi2015,Zhan2015,Gordiz2016,Zhou2017,Gordiz2017,Tao2017,Latour2017,Alkurdi2017,Larroque2018}, this work builds on prior studies \cite{Singh2011,Miao2016} to further elucidate the role of inelastic bulk scattering, a process that may be important in a broader class of heterojunctions. \begin{figure} \includegraphics[width=9.5cm]{fig1.eps} \caption{Top: Si-Ge interface of length $L$, joined by two ideal contacts in thermodynamic equilibrium at different temperatures, $T_L$ and $T_R$. Bottom: Phonon dispersion of Si (left) and Ge (right).} \label{fig_model_structure} \end{figure} \section{Simulated structure: Si-Ge interface} \label{sec:structure} We consider a single Si-Ge interface of length $L$, with $L/2$ of both Si and Ge, as shown in Fig. \ref{fig_model_structure}. The interface is ideal, meaning atomically smooth with no strain or roughness present. The left side of Si and the right side of Ge are joined by two ideal contacts that are in thermodynamic equilibrium at different temperatures, $T_L$ and $T_R$. The contacts are assumed to be perfectly absorbing; any phonon in Si or Ge reaching a contact will not be reflected. In this study we take $T_L=301$ K and $T_R=300$ K, such that phonon transport is induced by a $\Delta T=1$ K. \section{Theoretical Approach} \label{sec:theory} \subsection{McKelvey-Shockley flux method} \label{sec:McK-S} The treatment of phonon transport inside the Si and Ge is carried out using the McKelvey-Shockley flux (McK-S) method. Originally developed for electron transport \cite{Mckelvey1961,Shockley1962}, it was subsequently adapted for phonon/thermal transport \cite{Maassen2015a,Maassen2015b}. The McK-S approach is a simple version of the BTE that captures ballistic and non-equilibrium effects, and can treat transport from the nano-scale to the macro-scale \cite{Maassen2015a,Maassen2015b,Maassen2016,Kaiser2017,Abarbanel2017}. Importantly, this method supports inelastic phonon scattering \cite{Abarbanel2017}. The McK-S describes the spatial and temporal evolution of the forward- and reverse-moving phonon fluxes (along the transport direction, taken here as $x$). Instead of dealing with directed fluxes, it is possible to rewrite the governing equations directly in terms of temperature and heat current \cite{Abarbanel2017}. Temperature, in steady-state, is given by \begin{align} &D(\epsilon)\frac{\partial^2T(x,\epsilon)}{\partial x^2}=\frac{T(x,\epsilon)-T_0(x)}{\tau_Q(\epsilon)}, \label{temp_en} \\ &T_0(x)=\frac{\int_0^{\infty} T(x,\epsilon) \,C_V(\epsilon) \, /\, \tau_Q(\epsilon) \, {\rm d}\epsilon}{\int_0^{\infty} C_V(\epsilon) \, / \, \tau_Q(\epsilon) \, {\rm d}\epsilon}, \label{temp0} \end{align} where $T(x,\epsilon)$ is the temperature resolved at each phonon energy, $T_0(x)$ the temperature of a fictitious local equilibrium distribution (originating from the use of the relaxation time approximation), $D(\epsilon)=\lambda(\epsilon)v_x^+(\epsilon)/2$ the $\epsilon$-resolved diffusion coefficient, $\tau_Q(\epsilon)=\lambda(\epsilon)/(2 v_x^+(\epsilon))$ the $\epsilon$-resolved heat relaxation time, $C_V(\epsilon)=\epsilon \, g(\epsilon)\, [\partial n_{\rm BE}/\partial T]_{T_{\rm ref}}$ the $\epsilon$-resolved heat capacity, $\lambda(\epsilon)$ the phonon mean-free-path for backscattering (average $x$-projected distance traveled before backscattering), $v_x^+(\epsilon)$ the average $x$-projected phonon velocity, $g(\epsilon)$ the phonon density of states, $n_{\rm BE}(\epsilon,T_{\rm ref})$ the Bose-Einstein distribution, and $T_{\rm ref}$ a reference temperature (300 K in this work). $\lambda(\epsilon)$ and $v_x^+(\epsilon)$ are defined in \cite{defs}. The expression for $T_0(x)$ is obtained by imposing conservation of energy (see Ref. \cite{Abarbanel2017}). In the form given by Eq. (\ref{temp0}), inelastic scattering is permitted (phonons can change energy during scattering). In some previous studies with the McK-S method \cite{Maassen2015a,Maassen2015b,Maassen2016,Kaiser2017}, only elastic scattering was permitted (phonons could not change energy during scattering); a discussion comparing elastic and inelastic scattering can be found in Ref. \cite{Abarbanel2017}. The treatment of scattering in this framework is at the level of the relaxation time approximation, which requires a scattering time to be specified, in this case 3-phonon anharmonic scattering calculated from first-principles. Heat current, in steady-state, is expressed as \begin{align} I_Q(x,\epsilon) =-\kappa(\epsilon) \frac{\partial T(x,\epsilon)}{\partial x}, \label{iq_en} \end{align} where $\kappa(\epsilon)=C_V(\epsilon) D(\epsilon)$, is the $\epsilon$-resolved bulk thermal conductivity. The boundary conditions (BCs) needed to solve for $T(x,\epsilon)$ at the left/right contacts are \begin{align} T(-L/2,\epsilon) &= T_L + \left. \frac{\lambda(\epsilon)}{2}\frac{{\rm d}T(x,\epsilon)}{{\rm d}x}\right|_{x=-L/2}, \label{left_bc} \\ T(L/2,\epsilon) &= T_R - \left. \frac{\lambda(\epsilon)}{2}\frac{{\rm d}T(x,\epsilon)}{{\rm d}x}\right|_{x=L/2}. \label{right_bc} \end{align} These mixed BCs are necessary to capture ballistic and non-equilibrium phonon effects \cite{Maassen2015a,Maassen2015b,Maassen2016,Kaiser2017}, and retrieve the traditional BCs (i.e. $T(-L/2,\epsilon)=T_L$ and $T(L/2,\epsilon)=T_R$) in the diffusive limit. Separate BCs are adopted for the Si-Ge junction (discussed below). The effective, energy-integrated temperature and heat current are obtained using \cite{Abarbanel2017} \begin{align} T(x) = \frac{\int_0^{\infty} T(x,\epsilon) \,C_V(\epsilon)\,{\rm d}\epsilon}{\int_0^{\infty} C_V(\epsilon)\,{\rm d}\epsilon}, \label{temp} \\ I_Q(x)=\int_0^{\infty}I_Q(x,\epsilon)\,{\rm d}\epsilon. \label{iq} \end{align} This approach was shown to compare well to the more rigorous and computationally demanding BTE, particularly when solved using a full phonon dispersion \cite{Maassen2015a,Maassen2015b,Maassen2016,Kaiser2017,Abarbanel2017}. \subsection{Ideal interface model} To treat the Si-Ge interface, we adopt a simple interface model intended to capture the minimal thermal contact resistance between two dissimilar materials, assuming phonons transfer elastically across the junction. The motivation of this model, hereinafter referred to as the ideal interface model (IIM), is not to achieve better agreement with experiment but rather to (approximately) include the fundamental interfacial scattering that should exist in an ideal, smooth junction. A derivation, provided in Appendix \ref{app:interface_model}, is based on minimal assumptions: conservation of energy and detailed balance. AGF can provide a more accurate assessment of the fundamental transmission coefficient \cite{Latour2017}, but is more computationally expensive, particularly if both materials are not well lattice matched. Non-idealities (e.g. interfacial strain or defects) and other processes not considered here (e.g. inelastic interface scattering \cite{Hopkins2009}) will alter the transport properties. We refer interested readers to Appendix \ref{app:interface_model} for further details of the IIM and how it relates to the AMM and DMM. With the IIM, the transmission coefficients are simply: \begin{align} \mathcal{T}_{i \rightarrow f}(\epsilon) = \left\{ \begin{array}{cl} M_f(\epsilon) / M_i(\epsilon), & M_i(\epsilon) \geq M_f(\epsilon) \\ 1, & M_i(\epsilon) < M_f(\epsilon) \end{array} \right. \label{trans_model} \end{align} where $\mathcal{T}_{i\rightarrow f}(\epsilon)$ is the transmission probability of a phonon with energy $\epsilon$ traveling from material $i$ to $f$, and $M_{i/f}(\epsilon)$ is the distribution of modes (also referred to as the number of conducting channel per cross-sectional area) of the phonon states in material $i/f$. Phonons traveling from a material with few channels to a material with more channels ($M_f>M_i$) have a transmission of one, since there are enough final phonon states to accommodate all incoming phonons. However, the transmission is below one for the phonons impinging on a material with fewer number of channels ($M_f<M_i$), since there are not sufficient final states. See \cite{defs} for the definition of $M(\epsilon)$. The transmission coefficients calculated from Eq. (\ref{trans_model}) are used in the following expression the for $\epsilon$-resolved thermal contact resistance (see Appendix \ref{app:interface_model}): \begin{align} R_C(\epsilon) &= \frac{1}{2} \left[ \left( \frac{1-\mathcal{T}_{1\rightarrow2}(\epsilon)}{\mathcal{T}_{1\rightarrow2}(\epsilon)} \right) R_1^{\rm ball}(\epsilon) + \left( \frac{1-\mathcal{T}_{2\rightarrow1}(\epsilon)}{\mathcal{T}_{2\rightarrow1}(\epsilon)} \right) R_2^{\rm ball}(\epsilon) \right], \label{rc_en} \end{align} where $R^{\rm ball}(\epsilon)=C_V(\epsilon) v_x^+(\epsilon)/2$ is the ballistic thermal resistance. Equation (\ref{rc_en}) is relatively general, assuming only elastic transport across the interface and detailed balance, and handles non-equilibrium phonon distributions. The IIM retrieves two known limits: $R_C=0$ in the case of two identical materials, and $R_C(\epsilon)=R^{\rm ball}/2$ when a material is joined with an ideal Landauer contact. Using the IIM, given by Eqns. (\ref{trans_model})-(\ref{rc_en}), we obtain the following boundary conditions for the Si-Ge interface, assumed here to be at $x=l$: \begin{align} \Delta T(l,\epsilon)&=R_C(\epsilon) I_Q(l^{\pm},\epsilon), \label{bc1} \\ I_Q(l^+,\epsilon)&=I_Q(l^-,\epsilon), \label{rc2} \end{align} which states that the contact resistance will result in a discrete temperature drop across the interface $\Delta T(l,\epsilon)=T(l^-,\epsilon)-T(l^+,\epsilon)$ when a heat current flows, and that the heat current is continuous at the interface, respectively. The condition of continuous heat current across the interface, Eq. (\ref{rc2}), implies that there is no heat generation at the interface. Note that the effective thermal contact resistance is not obtained by an integration of $R_C(\epsilon)$ (or its inverse) over energy, but rather is extracted using $R_C=\Delta T(l)/I_Q(l)$ from the $\epsilon$-integrated, effective temperature and heat current. \begin{figure} \includegraphics[width=11cm]{fig2.eps} \caption{(a) DFT-simulated phonon dispersion of Si and Ge. (b) Number of conducting channels per cross-sectional area, $M(\epsilon)$, of Si and Ge. (c) Energy-dependent thermal contact resistance, calculated using Eq. (\ref{rc_en}), for an ideal Si-Ge interface. (d) Mean-free-path for backscattering, $\lambda(\epsilon)$, of Si and Ge at 300 K, arising from anharmonic 3-phonon scattering obtained from DFT.} \label{fig_bulk_phonons} \end{figure} \section{Results} \label{sec:results} \subsection{Bulk phonon properties of Si and Ge} DFT was utilized to compute the phonon dispersions and 3-phonon anharmonic scattering rates for Si and Ge, which serve as input for our Si-Ge interface calculations (details of the DFT modeling are found in Appendix \ref{app:dft_details}). Fig. \ref{fig_bulk_phonons}a shows the calculated phonon dispersions, $\epsilon(q)$, for Si and Ge, which agree well with previous calculations \cite{SiGephonon}. The maximum phonon energies in Si and Ge are $\epsilon_{\rm Si,max}=62$ meV and $\epsilon_{\rm Ge,max}=34$ meV, respectively. From the $\epsilon(q)$, we compute the number of conducting channels per cross-section, $M_{\rm Si,Ge}(\epsilon)$, presented in Fig. \ref{fig_bulk_phonons}b. At low energies the $M_{\rm Si,Ge}(\epsilon)$ scale quadratically, as expected for linear dispersions. Fig. \ref{fig_bulk_phonons}c shows the energy-dependent thermal contact resistance calculated with Eqns. (\ref{rc_en})-(\ref{trans_model}). $R_C(\epsilon)$ is largest for the low-energy acoustic modes, and decreases sharply until $\sim$10 meV above which the resistance is relatively similar. The mean-free-path for backscattering, $\lambda(\epsilon)$, is extracted and presented in Fig. \ref{fig_bulk_phonons}d. $\lambda(\epsilon)$ is longest for the acoustic phonons, where 3-phonon scattering is less likely, reaching $\sim$30 $\mu$m before decaying rapidly to values below 100 nm for $\epsilon>$10 meV. A comparison of this DFT computed $\lambda(\epsilon)$ for Si to the previously reported $\lambda(\epsilon)$ in Ref. \cite{Maassen2015a}, based on phenomenological expressions for scattering, shows that both agree well and yield similar magnitude and energy dependence. The bulk thermal conductivities are calculated to be 160 W/m-K for Si and 51 W/m-K for Ge at 300 K, which compare well to previous simulations \cite{SiGekappa}. \subsection{Si-Ge interface of fixed length (\textbf{\textit{L}}\,=\,200 nm)} The case of $L=200$ nm is interesting since some high-energy phonons are diffusive ($\lambda(\epsilon)$$\ll$$L$), while simultaneously some other low-energy phonons are ballistic ($\lambda(\epsilon)$$\gg$$L$). Fig. \ref{fig_temp}a shows the temperature of the Si-Ge junction versus position, $x$, and phonon energy, $\epsilon$. Above 34 meV, temperature on the Ge side is not defined since there are no phonon states. Most of the temperature drop occurs on the Ge side compared to the Si side, since the former has a lower thermal conductivity. At the interface, there is a discrete temperature drop that varies with energy; it is largest for the low-energy acoustic phonons, where $R_C(\epsilon)$ is high (see Fig. \ref{fig_bulk_phonons}c). The low-energy acoustic phonons have a flat temperature profile, accompanied with a large temperature drop at the left/right contacts, which is a signature of ballistic phonon transport (as discussed in Refs. \cite{Maassen2015a,Maassen2015b,Maassen2016,Kaiser2017}). The high-energy Si phonons have a temperature at the $x=-L/2$ boundary approching $T_L$, indicating diffusive phonon scattering. Fig. \ref{fig_temp}b shows the temperature drop in various sections of the structure versus energy. At low $\epsilon$, $\Delta T$ is mostly localized at the interface/contacts (ballistic transport), while at higher $\epsilon$ much of the $\Delta T$ occurs across the Si and mostly the Ge (diffusive transport). \begin{figure} \includegraphics[width=12.5cm]{fig3.eps} \caption{(a) Temperature profile, $T(x,\epsilon)$, of a $L=200$ nm Si-Ge interface versus position, $x$, and phonon energy $\epsilon$. Effective temperature, $T(x)$, plotted as solid black line. (b) Temperature drop across the various sections of the structure. $T_L-T_R=1$ K.} \label{fig_temp} \end{figure} Using Eq. (\ref{temp}) we calculate the effective, energy-integrated temperature profile, plotted as a solid black line in Fig. \ref{fig_temp}a. We find a temperature drop of 0.24 K, which is relatively large compared to $T_L-T_R=1$ K. The total heat current is $x$-independent and equal to $I_Q=1.1\times10^8$ W/m$^2$, resulting in an effective $R_C=2.2\times10^{-9}$ Km$^2$/W with the IIM ($3.5\times10^{-9}$ Km$^2$/W with the DMM). These values are close to other reported calculations using the DMM ($4.6\times10^{-9}$ Km$^2$/W) \cite{Larroque2018}, the AMM ($\approx 5.5\times10^{-9}$ Km$^2$/W) \cite{Larroque2018} and MD ($\approx3.1\times10^{-9}$ Km$^2$/W) \cite{Landry2009b}. The IIM yields the lowest $R_C$. Surprisingly, the reported AMM value is larger than that of the DMM. A traditional solution of the 1D heat equation gives a linear temperature profile, however we find a non-linear $T(x)$, particularly across the Ge. As discussed later, this is a result of strong inelastic scattering near the interface. Fig. \ref{fig_heat_current}a shows the heat current versus $x$ and $\epsilon$. $I_Q(x,\epsilon)$ flows at different energies in Si and Ge, which is only possible via inelastic scattering; elastic scattering would give an $x$-independent $I_Q(\epsilon)$. Similar features were observed in Ref. \cite{Singh2011}. At the interface, there are select energies, near 13 meV and 26 meV, that carry much of the heat from Si to Ge. These energies are found to have roughly equal number of conducting channels in both materials, $M_{\rm Si}(\epsilon)\approx M_{\rm Ge}(\epsilon)$, which results in small $R_C(\epsilon)$. Focusing on the high-energy Si phonons, a non-zero $I_Q(x,\epsilon)$ is observed near 50 meV. Fig. \ref{fig_heat_current}b shows the fraction of the total heat current carried above the maximum Ge energy, which reaches over 20\% at the left boundary and decreases to zero at the interface (the fraction of heat current flowing above $\epsilon_{\rm Ge,max}$ in bulk Si is 8\%, shown as dashed line). Thus, a significant amount of heat is carried by the high-energy Si phonons, even though they are completely reflected at the interface. The fact that $I_Q(x,\epsilon)$ varies with $x$ indicates inelastic processes are rearranging the heat among the different phonons (i.e. the occupation of the phonon states), which we will illustrate next. \begin{figure} \includegraphics[width=12.5cm]{fig4.eps} \caption{(a) Heat current, $I_Q(x,\epsilon)$, of a $L=200$ nm Si-Ge interface. (b) Fraction of total heat current carried by phonons with energy larger than the maximum Ge phonon energy, $\epsilon_{\rm Ge,max}$. Black dashed line shows the bulk value. $T_L-T_R=1$ K.} \label{fig_heat_current} \end{figure} With no external sink/source removing or adding heat to the structure, we obey the continuity equation for heat: $C_V\,\partial T(x)/\partial t = -\partial I_Q(x)/\partial x$. We can also write a similar equation that is phonon energy resolved: \begin{align} C_V(\epsilon)\frac{\partial T(x,\epsilon)}{\partial t} &= -\frac{\partial I_Q(x,\epsilon)}{\partial x} + S(x,\epsilon), \label{continuity_eq} \end{align} in which we include a ``sink-source'' term, $S(x,\epsilon)$, describing how heat is being removed or added at each phonon energy, $\epsilon$. It can be shown that $\int_0^{\infty} S(x,\epsilon)\,{\rm d}\epsilon=0$, stating that heat is only redistributed among the phonons and that no net heat is removed or added. In steady-state, the left-hand side of Eq. (\ref{continuity_eq}) is zero, giving $S(x,\epsilon)=\partial I_Q(x,\epsilon)/\partial x$. Using Eqns. (\ref{temp_en}) and (\ref{iq_en}), we obtain: \begin{align} S(x,\epsilon)&=\frac{C_V(\epsilon)}{\tau_Q(\epsilon)}[T_0(x)-T(x,\epsilon)]. \label{sinksource} \end{align} Fig. \ref{fig_sinksource}a presents $S(x,\epsilon)$ calculated using Eq. (\ref{sinksource}). The positive (red) and negative (blue) values correspond to heat being added and removed, respectively. In the vicinity of the interface, there is strong redistribution of heat, i.e. inelastic scattering. On the Si side, heat is removed from the high-energy phonons and tranferred to mid-energy phonons ($\sim$30 meV) that can travel into the Ge. Roughly speaking, as the high-energy phonons approach, they ``sense'' the interface and pump heat down to lower-energy phonons that can cross the junction. Since certain phonons transport most of the heat across the interface from Si to Ge, as shown in Fig. \ref{fig_heat_current}a, this creates a highly non-equilibrium distribution in the Ge side of the junction. As an attempt to drive the system towards equilibrium, in the Ge we observe strong inelastic scattering filling depleted states and emptying others. The redistribuion of heat near an interface occurs over a length scale comparable to $\lambda(\epsilon)$. We also see similar features near the left/right contacts. As previously discussed \cite{Maassen2015a,Maassen2015b}, the phonons injected from the contacts are in equilibrium with their originating thermal reservoir, but the phonons impinging on the contacts have a distribution controlled by the scattering that occurred inside the structure. The resulting phonon population near the contacts may be far from equilibrium, thus triggering inelastic processes. \begin{figure} \includegraphics[width=12.5cm]{fig5.eps} \caption{(a) Heat sink/source, $S(x,\epsilon)$, of a $L=200$ nm Si-Ge junction. Positive/negative values correspond to heat added/removed from phonons. $\int_0^{\infty}S(x,\epsilon)\,{\rm d}\epsilon=0$. (b) Temperatures, $T(0,\epsilon)$ and $T_0(0)$, on both sides of the Si-Ge interface (Si/Ge side: $x=0^-/0^+$). $T_L-T_R=1$ K.} \label{fig_sinksource} \end{figure} To better understand what controls the heating/cooling pattern in Fig. \ref{fig_sinksource}a, in Fig. \ref{fig_sinksource}b we present the energy-resolved temperature, $T(0,\epsilon)$ (solid lines), and local equilibrium temperature, $T_0(0)$ (dashed lines), on both sides of the interface ($x=0^-$ for Si, and $x=0^+$ for Ge). According to Eq. (\ref{sinksource}), heat redistribution occurs whenever $T(x,\epsilon)\neq T_0(x)$; heat is added when $T_0(x)-T(x,\epsilon)>0$, and removed when $T(x,\epsilon)-T_0(x)>0$. With this insight, Fig. \ref{fig_sinksource}b shows which phonon energies will be heated/cooled, which correlates with the pattern in Fig. \ref{fig_sinksource}a. The low-energy acoustic modes are far from the equilibrium temperature, because they are near ballistic and do not efficiently scatter, however their value of $C_V(\epsilon)/\tau_Q(\epsilon)$ is small. Note that under near-equilibrium conditions $T(x,\epsilon)$ is independent of $\epsilon$, thus an energy dependence is indicative of a non-equilibrium phonon distribution. In summary, interfaces drive the phonon population out of equilibrium, which in turn activate inelastic scattering. \subsection{Si-Ge interface with varying \textbf{\textit{L}}} Fig. \ref{fig6}a shows the temperature profile across the Si-Ge junction with $L$ ranging from 20 nm to 200 $\mu$m. With $L=20$ nm most of the temperature drop occurs at the left/right contacts and the inteface, indicating near-ballistic transport. With $L=200$ $\mu$m we retrieve the traditional heat equation solution, a linear $T(x)$ with vanishing temperature drops at the interface and contacts. Interestingly a distinct non-linearity is observed with $L=200$ nm, since this is the length scale over which inelastic scattering is strongest. With smaller $L$ scattering is sparse leading to a linear and flat $T(x)$ when approaching the ballistic limit, as discussed in \cite{Maassen2015a}. With larger $L$ most of the scattering occurs close to the interface/contacts and the phonons inside each material are near equilibrium resulting in a linear $T(x)$, as predicted by the classical heat equation. The non-linearity in $T(x)$, observed at intermediate length, arises from inelastic scattering, since assuming only elastic scattering (using the same approach) results in a linear $T(x)$ \cite{Maassen2015a}. The heat current versus $L$ is plotted in Fig. \ref{fig6}b, comparing the IIM to the DMM. For $L>20$ $\mu$m the heat current follows a $L^{-1}$ trend, as expected in the diffusive limit. Below $L=1$ $\mu$m the heat current rolls off, falling below the traditional scaling, as phonon transport becomes quasi-ballistic and approaches the ballistic limit. Fig. \ref{fig6}c presents the energy-resolved heat current for various $L$. Note how each plot is visually different until reaching $\sim$20 $\mu$m, above which $I_Q(x,\epsilon)$ for a given $x$ is the same as bulk. With $L=20$ nm, the heat current flows at roughly the same energies in both Si and Ge, since inelastic scattering occurs over a longer length scale (as discussed above). With $L=200$ nm, we observe the transition of heat current carried by certain energies in Si to others in Ge. For longer $L$, the energy-dependence of the heat currrent is mostly uniform in $x$ (away from the interface and contacts). \begin{figure} \includegraphics[width=14.5cm]{fig6.eps} \caption{Temperature profile, $T(x)$, and heat current, $I_Q$, of Si-Ge interfaces as a function of length $L$. (c) Energy-resolved heat current, $I_Q(x,\epsilon)$ for $L=20$ nm, 200 nm, 2 $\mu$m and 200 $\mu$m. $T_L-T_R=1$ K.} \label{fig6} \end{figure} \section{Conclusions} \label{sec:conclusions} We theoretically analyzed phonon transport across a Si-Ge interface using the McKelvey-Shockley flux method combined with DFT materials modeling, which captures ballistic, non-equilibrium and inelastic scattering effects. This study focused mainly on the role of inelastic bulk phonon scattering that occurs near a heterojunction. We started by investigating a 200 nm long Si-Ge junction, in which we simultaneously observed diffusive transport of high-energy phonons and ballistic transport of low-energy phonons. Our analysis showed that strong inelastic scattering exists near the interface and the contacts. This originates from the non-equilibrium phonon distribution that is induced by the presence of the interface; heat is conducted across the junction at select phonon energies while other phonons are completely reflected (e.g. the high-energy Si phonons), which drive the system away from equilibrium. As a result of these inelastic processes, there is significant redistribution of heat among the phonons near an interface. This enables the high-energy Si phonons to carry significant heat, which are ``cooled'' within roughly one mean-free-path of the junction by pumping heat down to mid-energy Si phonons that can transfer into the Ge. What activates and controls these processes was elucidated. Moreover, a non-linear temperature profile is observed in the regions where inelastic scattering is significant. We also demonstrated how the phonon transport properties vary with the length of the junction, $L$, from 20 nm to 200 $\mu$m. We observe the ballistic to diffusive transition and show how this impacts the temperature and heat current distributions. For our treatment of the Si-Ge interface we adopted a simple interface model intended to (approximately) capture the minimum thermal resistance of an ideal smooth junction. The physics of this model, and its connection to others including the AMM and DMM, were discussed, and an expression for thermal contact resistance was provided. Lastly, while our treatment is not comprehensive, for example not including interfacial phonon modes or inelastic phonon transport across the interface, it does highlight the importance of inelastic bulk scattering and non-equilibrium physics, which are processes that likely play a role in many other heterointerfaces beyond Si-Ge. \acknowledgements This work was partially supported by DARPA MATRIX (Award No. HR0011-15-2-0037) and NSERC (Discovery Grant RGPIN-2016-04881).
\section{Introduction} Molecular quasi-chemical theory (QCT)\cite{redbook,PaulaitisPratt2002,Beck:2006wp,pratt2007potential Asthagiri:2010,Rogers:2011,Rogers} was deliberately developed from molecular statistical thermodynamic theory, and applications have been both simple and remarkably accurate. This situation confronts the canon\cite{chandler1983van} of the theory of dense liquids, and begs the question of what accuracy may be achieved as initial simplifications are addressed. The present paper takes up the questions of accuracy of QCT when refined implementations are pursued. Beyond technical theoretical problems, this program brings forward basic questions of operational single-ion free energies underlying rational plans to study specific ion effects. The basic status of QCT may be supported, but also somewhat camouflaged, by the fact that QCT can be closely coordinated with --- indeed implemented through --- molecular simulation calculations. \cite{tomar2013solvation,tomar2014conditional,tomar2015importance,% asthagiri2017intramolecular,tomar2018solvophobic} Earlier works termed that approach `direct' QCT.\cite{dsabo08,Jiao:co2,% Chaudhari:Kr,Chaudhari:utility} On that simulation basis, QCT provides a compelling molecular theory of liquid water itself.\cite{asthagiri2003free,paliwal2006analysis,shah2007balancing,% chempath2008distribution,chempath2009quasichemical,weber2010molecular,doi:10.1063/1.3499315,% doi:10.1063/1.3660205,doi:10.1063/1.3572058} Nevertheless, the initial motivation\cite{redbook,martin1998hydrolysis,rempe2000hydration} was the exploitation of molecular electronic structure calculations in statistical thermodynamic modeling. That approach is called `cluster' QCT. One motivation for the refinements (below) to cluster QCT is to achieve operational experimental testing of the resulting free energies.\cite{friedman1973thermodynamics} A practical consequence of that goal is that the QCT should be applied to both cation and anion hydration cases.\cite{Beck:2013gp,ACR} Cations interact with ligating atoms with partially negative charge, like oxygens from waters. Recent studies yielded new insights on hydration,\cite{rempe2000hydration,Rempe:2001,Rempe:K,% Asthagiri:divalents,Jiao:2011,Alam:Li,Sabo:2013gs,Mason:Li,Chaudhari:Ba}, mechanisms of selective ion binding,\cite{Varma:2007ej,Varma:2008kl,Varma:2008fh,Varma:2010,% Varma:2011ho,Rossi:2013gm,Chaudhari:Sr} and specific ion effects for cations.\cite{Stevens} But anion hydration clusters often exhibit H-bond donation to the ion. Those clusters can be structurally delicate, making hydrated anions more challenging cases.\cite{chaudhari2017quasi} In the work below, we treat LiF(aq) for the desired testing. For clarity of exposition, we refer to F$^-$(aq) or Li$^+$(aq) when a generic single ion is discussed. The case of F$^-$(aq) fits the description above. An initial QCT application works simply with reasonable accuracy.\cite{chaudhari2017quasi} Nevertheless, refinement of that initial application requires consideration of further technical issues that are taken up here; specifically, quantification of anharmonic effects on free energies of hydrated ion clusters, and the sufficiency of the polarizable continuum model (PCM) for the hydration free energy of those clusters. \subsection*{QCT Basics} QCT treats the ion-water clusters as molecular species of the system under analysis,\cite{redbook,PaulaitisPratt2002,Beck:2006wp,pratt2007potential,% Asthagiri:2010,Rogers:2011,Rogers} then provides a concise format \begin{multline} \mu^{\mathrm{(ex)}}_{\mathrm{F}^{-}} = -RT\ln K^{(0)}_{n}\rho_{\mathrm{H_2O}}{}^{n} +RT\ln p_{\mathrm{F}^{-}}(n) \\ +\left(\mu^{\mathrm{(ex)}}_{\mathrm{F(H_2O)}_n{}^{-}}-n\mu^{\mathrm{(ex)}}_{\mathrm{H_2O}}\right)~, \label{eq:1} \end{multline} for free energies of solution components such as F$^-$(aq). The populations of the clusters are established by applying a clustering algorithm, according to which proximal ligands of a specific ion are defined as \emph{inner-shell} partners of that ion. The chemical association process, \begin{equation} n \mathrm{H_2O} + \mathrm{F}^{-} \rightleftharpoons \mathrm{F(H_2O)}_n{}^{-}~, \label{eq:2charged} \end{equation} introduces the equilibrium ratio, \begin{eqnarray} K_n = \frac{p_{{\mathrm{F}^{-}}}(n)}{\rho_{\mathrm{H_2O}}{}^n p_{{\mathrm{F}^{-}}}(0)}~, \label{eq:Kratio} \end{eqnarray} with $p_{{\mathrm{F}^{-}}}(n)$ as the thermal probability that a specific ion has $n$ inner-shell partners. The factor $K^{(0)}_{n}$ appearing in Eq.~\eqref{eq:1} is the equilibrium constant $K_n$ evaluated for the case that the external medium is an ideal gas. Evaluation of $K^{(0)}_{n}$ is accessible with widely available tools of few-body molecular theoretical chemistry. Application of QCT to F$^-$(aq) thus begins with identification of inner-shell configurations of the medium relative to the ion. Emphasizing the observation above that the challenge in treating anions lies in the variety of H-bond donation structures of $\mathrm{F(H_2O)}_n{}^-$, a natural procedure is to identify water molecules with H atoms within a distance of $\lambda$ from F$^-$ as clustered; that is, as inner-shell partners with the distinguished F$^-$ ion. From there, with $n$ water ligands in the cluster and directly interacting with the ion, the free energy is computed using Eq.~\eqref{eq:1}. For Li$^+$(aq), in contrast to F$^-$(aq), it is natural to identify water molecules with O atoms within a given specific distance from Li$^+$ as clustered. The QCT formula (Eq.~\eqref{eq:1}) is correct for any physical choices of $\lambda$ and $n$. We emphasize that the combination of terms on the right-side should be independent of $n$. This leads to two further observations. Firstly, for intuitive choices of $\lambda$, the formula Eq.~\eqref{eq:1} provides a theory of the populations $p_{{\mathrm{F}^{-}}}(n)$ to within a constant, the left-side of Eq.~\eqref{eq:1}; that is, to within \emph{post hoc} normalization. The most probable value of $n$ provides the minimum value of $\ln p_{{\mathrm{F}^{-}}}(n)$, and it is then natural to simply drop that contribution. Secondly, the independence of Eq.~\eqref{eq:1} on $n$ provides an indication of the sufficiency of operational approximations adopted to evaluate the several contributions. For the leading contribution, $K^{(0)}_{n}$ of Eq.~\eqref{eq:1}, a harmonic approximation for that isolated cluster contribution has been convenient and typically satisfactory. But $K^{(0)}_{n}$ is a characteristic of few-body molecular cluster chemistry, and is available from separate cluster experiments.\cite{tissandier1998proton} Those experimental results permit the work here to avoid that harmonic approximation. In this way, the evaluations below treat anharmonic motion of the clusters considered, and specifically anharmonic zero-point motion, thus further quantifying the significance of the harmonic approximation. In discussing the various contributions to Eq.~\eqref{eq:1}, we arrive finally at the right-most contribution $\left(\mu^{\mathrm{(ex)}}_{\mathrm{F(H_2O)}_n{}^{-}}-n\mu^{\mathrm{(ex) }}_{\mathrm{H_2O}}\right)$. Here, we will adopt the polarizable dielectric continuum model (PCM).\cite{Tomasi:2005tc} Although PCM is an extreme approximation, the supporting physical arguments are that electrostatic effects on chemical energy scales clearly dominate more subtle statistical mechanical issues. Moreover, sensitivities to artificial parameters of the PCM, specifically the radii that establish the boundary of the dielectric continuum, are moderated in forming the required difference. Nevertheless, the PCM approximation applied in this combination is the principal approximation of the work below. That again highlights the challenge of treating anions such as F$^-$. Specifically, if H-bond donation leads to exotic structures for the isolated $\mathrm{F(H_2O)}_n{}^-$ clusters with the ion core highly exposed, that might be a problematic circumstance for the PCM approach. To address this possibility, the work below carries out an inverse sampling approach exploiting the structural results from $ab$ $initio$ molecular dynamics (AIMD) simulations. Those details will be discussed, along with other methods, in the following section. \begin{figure} \includegraphics[width=3.5in]{F_sample_N4_2.pdf} \caption{Electronic energy of the optimized $n=4$ clusters (blue dots) starting with configurations sampled from \emph{ab initio} molecular dynamics. The black curve shows the distribution of these energies. The lowest energy optimum (bottom inset) is about 6 kcal/mol lower in energy than the highest energy optimum (top inset). Harmonic approximation applied to that lowest energy cluster is in good agreement with cluster experiments (FIG.~\ref{fig:cluster_form}).} \label{fig:sample_N4} \end{figure} \section{\label{sec:level1}Methods} \subsection*{Electronic structure calculations and cluster analysis} All electronic structure calculations were carried out using Gaussian 09 (Rev. D.01).\cite{frisch1998gaussian} Geometry optimizations were performed on the $\mathrm{F(H_2O)}_n{}^-$ cluster with 1000 initial cluster configurations sampled from AIMD. The UPBE1PBE\cite{perdew1996generalized} and B3LYP\cite{becke1993density,lee1988development} hybrid density functionals were utilized with the aug-cc-pVDZ\cite{dunning1989gaussian} basis set. Normal mode analysis was then carried out on all 1000 optimized structures to determine zero-point corrected energies and vibrational frequencies.\cite{Rempe:normal} The absence of imaginary frequencies confirmed that all optimizations resulted in true energy minima. These calculations also evaluate the single molecule (or cluster) vibrational/rotational partition functions and thus $K^{(0)}_{n}$. Here, the electronic structure calculations analyze rotations of a specific optimized structure without respect to symmetry. Thus, the free energy integrations require some discussion of symmetry numbers for these molecules.\cite{Ochterski2000thermochemistry,Irikura:1998te} The symmetry number of 2 for the H$_2$O ligands is elementary and included by hand in our results below. Considering next the molecular cluster, the general formula for $K^{(0)}_{n}$ presents a $1/n!$ factor,\cite{redbook,Beck:2006wp} since the $n$ ligands are treated identically. This factor compensates for the coverage of the ligand conformational space in a general configurational integration. In contrast, the electronic structure calculations exploited here integrate over rotations of a specific cluster structure. The rotational partition functions for a cluster structure might be expected to accomplish, as a practical matter, interchange of the chemically identical ligands. But considering, for example, the case $n$ = 4, rigid body rotations do not achieve inversions of a general structure. Thus, the full permutation group of order $n!$ = 24 is not recovered. Therefore, we simply supply by hand a symmetry number of $n!/2$, 12 rather than 24, for the case $n$ = 4. The case for $n$ = 5, which is considered below, is less simple than $n$=4 and goes beyond merely prescribing the full configurational integration. As an expedient, we use the value of $n!/2$ for that case also. \subsection*{AIMD simulations} A system consisting of a single fluoride ion and 64 waters was simulated using the VASP AIMD simulation package.\cite{kresse1993ab,kresse1996efficient} A cubic box of 1.2417~nm was used to match the experimental density of water at standard conditions. The PW91 generalized gradient approximation described the core-valence interactions using the projector augmented-wave (PAW) method. Plane waves with a high kinetic energy cutoff of 400~eV and a time step of 0.5~fs were used for the simulation in an NVE ensemble. A temperature of 350~K was used during the simulation run to avoid glassy behavior that can result at lower $T$.\cite{Rempe:water} A total simulation time of 100 ps was run and the last 50 ps trajectory was used for analysis. \begin{figure} \includegraphics[width=3.5in]{Neighborship_2LRP.pdf} \caption{Radial distributions of water H atoms relative to F$^-$ from AIMD. The integer-labeled distributions are the neighborship-ordered contributions of the $n$-th nearest H atom. A choice $\lambda \leq 0.2$ nm excludes split-shell clusters. Note the this neighborship discrimination is sharper here when H-atoms are utilized than when O-atoms were utilized in initial work.\cite{chaudhari2017quasi}} \label{fig:Neighborship} \end{figure} \subsection*{\label{sec:level2C}PCM for AIMD sampled clusters} The outer-shell contribution to the hydration free energy $\left(\mu^{\mathrm{(ex)}}_{\mathrm{F(H_2O)}_n{}^{-}}-n\mu^{\mathrm{(ex) }}_{\mathrm{H_2O}}\right)$ is treated using the polarizable continuum model (PCM).\cite{Tomasi:2005tc} $N_s = 1000$ $n$-cluster configurations were extracted from the last 50~ps of AIMD simulation, followed by single point electronic energy calculations with PCM as the dielectric medium and separate calculations in the gas~phase. The difference, $\varepsilon = \Delta U$, is employed in computing \begin{eqnarray} \mu_{\mathrm{F(H_2O)}_{n}{}^{-}}^\mathrm{(ex)} = RT \ln \left\lbrack \left(\frac{1}{N_s}\right)\sum\limits_{j=1}^{N_s}\mathrm{e}^{\varepsilon_j/RT} \right\rbrack . \label{eq:rev_widom} \end{eqnarray} This approach corresponds to the PDT formula\cite{Beck:2006wp,dullens2005widom} for the inverse case, that is, particle deletion. We explicitly verified that these PCM results were insensitive to the specific value of the solution dielectric constant in a high $\epsilon$ range relevant to liquid water; the $\epsilon \rightarrow \infty$ could have been used with imperceptible difference. Therefore, although the configurations sampled here correspond to AIMD trajectories at 350~K, we expect the differences in PCM-single-point energies at 298~K to be small. Those differences could, of course, be studied in future work. In PCM, the boundary around the solute is defined by spheres centered on each of the atoms. The sensitivity of the outer-shell contribution to the size of this cavity is characterized by changing the radius, $R_{\mathrm{F}^{-}}$, of the solute atom between 0.15~nm and 0.20~nm. Our operational value was $R_{\mathrm{F}^{-}} = 0.169$~nm, the default PCM radius. That radius lies close to the maximum in the radial distribution of water hydrogens about the anion (FIG.~\ref{fig:Neighborship}). \section{Results} \subsection*{Clustering constraint and solution structure} The arrangements of ligands around a solute guide our assignment of the clustering radius, $\lambda$. The radial distribution function of water-H atoms relative to F$^-$, when resolved into neighborship-ordered contributions, clarify those considerations (FIG.~\ref{fig:Neighborship}). Notice that the 6th-nearest neighbor distribution is bimodal, with peaks on both sides of the minimum of $g_{\mathrm{H\vert F}}\left(r\right)$. A choice of $\lambda\leq0.20$ nm excludes such split-shell occupancies,\cite{chaudhari2017quasi,Sabo:2013gs} that is, waters that are not always in direct contact with the ion. The thermal probability, $p_{\mathrm{F}^{-}}(n)$, contributing to the second term of Eq. \eqref{eq:1}, is then evaluated based on this constraint. \subsection*{\label{sec:level2B}Accuracy of the harmonic approximation} We extracted $N_s = 1000$ $n$-clustered configurations from the last 50~ps of AIMD simulations and optimized their geometries with respect to energy in the gas phase (FIG. \ref{fig:sample_N4},\ref{fig:sample_N5}). Only cluster sizes with $2 \leq n \leq 5$ were observed for $\lambda=0.2$~nm. For the case of $n=4$, optimized energies span a range of 1-3 kcal/mol in a bimodal fashion (FIG. \ref{fig:sample_N4}). Those energy differences are attributed to subtle changes in the orientations of the ligands. For $n=5$, some optimizations pushed a water molecule out to form structures that we label henceforth as ``4+1'' (bottom inset). The rest are ``5+0'' optimized clusters (top inset). The ``4+1'' structures violate the clustering constraint and are not included in evaluation of the free energy. This issue does not arise for clusters with $n \leq 4$. Finally, $-RT\ln K^{(0)}_{n}$ is evaluated within a harmonic assumption for the lowest energy structure (FIG.~\ref{fig:cluster_form}). Comparison with cluster experiments\cite{tissandier1998proton} indicates accurate agreement for cluster sizes $n \leq 4$. The $n=5$ case suggests that the ``4+1'' structures contribute importantly to these experiments, as also found earlier for sodium.\cite{Soniat:2015kl} The B3LYP functional, which performs better in this comparison, is adopted for further analyses that include outer-shell contributions. \begin{figure} \includegraphics[width=3.5in]{F_sample_N5_2.pdf} \caption{Electronic energy of the optimized $n=5$ clusters (blue dots) starting with configurations sampled from \emph{ab initio} molecular dynamics. The black curve shows the distribution of these energies. Two kinds of optimized structures are observed here. Lowest energy, `\emph{split-shell}' (4+1) structures (bottom inset), which do not obey the clustering constraint, are the first kind. The lowest energy (5+0) structures are the second kind and they conform to the clustering constraint on which QCT theory is developed.} \label{fig:sample_N5} \end{figure} \begin{figure} \includegraphics[width=3.5in]{1_F_compare_free_energy_sample2_2_new.pdf} \caption{Evaluation of $-k_{\mathrm{B}}T\ln K^{(0)}_{n}$ using the harmonic approximation agrees well with cluster experiments\cite{tissandier1998proton} for cluster sizes $n\leq 4$. For $n=5$, the results suggest that (4+1) structures contribute importantly to these experiments. Anharmonicity effects likely make less specific, more quantitative contributions elsewhere.\cite{kathmann2007critical} The B3LYP functional, which performs better here, is adopted for further analyses including outer-shell contributions.} \label{fig:cluster_form} \end{figure} \begin{figure} \includegraphics[width=3.5in]{2_b3lyp_split_bootstrap_3_new.pdf} \caption{Topmost: The free energy contribution related to cluster poly-dispersity. Red: The outer shell contribution to the hydration free energy evaluated using the PCM model.\cite{Tomasi:2005tc} The red band is obtained by varying $R_{\mathrm{F}^{-}}$, as indicated in the text. Green: Isolated cluster free energy (FIG.~\ref{fig:cluster_form}), with the corresponding dashed curve from cluster experiments.\cite{tissandier1998proton} Black: The excess free energy of hydration for F$^-$, $\mu^{\mathrm{(ex)}}_{\mathrm{F}^{-}}$, evaluated using Eq.~\eqref{eq:1}. The sum of these contributions is substantially independent of $n$. The black dotted line ($-111.1$ kcal/mol) is the value tabulated by Marcus.\cite{Marcus:1994ci}} \label{fig:full_b3lyp} \end{figure} \section{\label{sec:level2}Discussion} Anharmonic effects on cluster free energies are easy to observe and interesting (FIGS.~\ref{fig:sample_N4} \& \ref{fig:sample_N5}). Even for such a small cluster as F(H$_2$O)$_4{}^-$, the energy landscape has many local minima. These minima are a challenge for computational optimization. Nevertheless, comparison of theoretical results with experimental assessment of anharmonic effects, and including zero-point motion on that basis, shows that the differences for cluster free energies are not troublesome for this QCT application (FIG.~\ref{fig:cluster_form}, \ref{fig:full_b3lyp}). The sum of the several QCT contributions for F$^-$(aq) (FIG.~\ref{fig:full_b3lyp}) is substantially independent of $n$, which adds confidence to the QCT results. The predicted hydration free energy ($-106.4$ kcal/mol) is in good agreement with experimental tabulation of Marcus ($-111$~kcal/mol).\cite{Marcus:1994ci} A similar QCT analysis for Li$^+$(aq) arrives at a value of $-121.1$~kcal/mol for $\mu^{\mathrm{(ex)}}_{\mathrm{Li}^{+}}$ (see Supplementary Information). Then the QCT prediction for the neutral combination, $\mu_{\mathrm{F^{-}}}^{\mathrm{(ex)}} + \mu_{\mathrm{Li^{+}}}^{\mathrm{(ex)}}$ = $-227.5$~kcal/mol, is in fair agreement with experimental tabulations, which range between $-229$~kcal/mol and $-232$~kcal/mol.\cite{friedman1973thermodynamics,hunenberger2011single,% Marcus:1994ci,tissandier1998proton} Issues of a surface potential are not involved in this comparison.\cite{Leung:2009dx,Rempe:2010er} \section{\label{sec:level2}Conclusions} The use of the PCM implicit solvation model is simple and physically natural, but is ultimately the most serious approximation for QCT applications to anions in water. On the one hand, the simplest QCT application results in the central ion well-covered with inner-shell ligands before relying on a traditional PCM approximation. On the other hand, energy-optimized cluster structures for \emph{anions} can leave the central ion highly exposed. Application of PCM to those structures incurs more serious errors than for metal cations. Cluster sampling from \emph{ab initio} molecular dynamics substantially fixes that issue with the standard QCT application. The QCT results obtained that way for LiF, a neutral combination so not involving a surface potential,\cite{you2014comparison} shows fair agreement with experimental free energies. We emphasize that we do not address here the partial molar volumes of simple ions in water on this basis of QCT, though the ground-work for that next challenge was laid many years ago.\cite{redbook} \section{Acknowledgment} Sandia National Laboratories is a multimission laboratory managed and operated by National Technology \& Engineering Solutions of Sandia, LLC, a wholly owned subsidiary of Honeywell International Inc., for the U.S. Department of Energy’s National Nuclear Security Administration under contract DE-NA0003525. This work was supported by Sandia's LDRD program. This work was performed, in part, at the Center for Integrated Nanotechnologies (CINT), an Office of Science User Facility operated for the U.S. DOE's Office of Science by Los Alamos National Laboratory (Contract DE-AC52-06NA25296) and SNL. The views expressed in the article do not necessarily represent the views of the U.S. Department of Energy or the United States Government.
\section{INTRODUCTION} \IEEEPARstart{H}{uman} opinions are moulded through a continuous process, subject to a host of influences. In-person meetings, visual and print media, etc., remain the chief exogenous factors. With the wide spread of the internet, there is a drastic change in the way opinions are formed. They are increasingly shaped by information diffused through tweets and posts on virtual platforms. Such spreads tend to influence the behavior of individuals and thereby the societies. Due to their relevance to social and economic problems, there is a growing interest to understand the underlying dynamics. Influence dynamics and formation of opinions have been extensively studied from the perspective of analytical modeling and psychology. Early 1900s have witnessed social experiments that have enormously helped in understanding human behavior. With their aid, in the following decades, several behavioral models were proposed. Among them, one of the earliest formulations \cite{french1956formal}, interprets the formation of groups. \cite{stone1961opinion} proposed a continuous-time model for joint decision making. DeGroot \cite{degroot1974reaching} came up with a discrete-time repeated averaging model. Similar models which investigate the impact of agent weights on consensus can be found in \cite{chatterjee1977towards,cohen1986approaching}. However, these models study agreement in groups. The DeGroot's model was extended \cite{friedkin1990social} to consider possible disagreements. In all these models, opinions are real numbers within a range. A more simplistic model is the voters model, where opinions are discrete. It was first proposed in \cite{clifford1973model}, where agents adopt opinions through random interactions. Variations to the model have been proposed over the years \cite{follmer1974random,orlean1995bayesian,latane1997self,weisbuch1999dynamical}. All the network models \cite{french1956formal,stone1961opinion,degroot1974reaching,chatterjee1977towards,cohen1986approaching,friedkin1990social,clifford1973model,follmer1974random,orlean1995bayesian,latane1997self,weisbuch1999dynamical}, although different in their level of detail, are linear, collaborative, and mostly rely on chanced interactions. One of the initial attempts with antagonistic interactions is \cite{altafini2013consensus}, where negative edge weights reflect the lack of synergy. Extensions to this work appear in \cite{altafini2015predictable,proskurnikov2016opinion}. In all these models, the agents are similar and their interactions are uninhibited - an agent can interact with any other agent. The first nonlinear opinion model is by Krause \cite{krause1997soziale}. Ever since, similar models have been proposed \cite{deffuant2000mixing,sznajd2000opinion,hegselmann2002opinion,lorenz2007continuous,mor2011opinion,yang2014opinion,liu2013opinion}. They recommend repeated opinion averaging, but differ in their communication regimes. Among them, the bounded-confidence model \cite{hegselmann2002opinion} is well known; an agent engages with others who conform to its belief. The interactions among agents may change with time, thereby capturing an aspect of relationship dynamics. This addressed one of the earlier shortcomings, while overlooking the possibility of agent types. The impact of agent types on consensus has been widely studied. One of the earliest works \cite{weisbuch2002meet}, studies agents with different interaction thresholds. \cite{kou2012multi,fu2015opinion,liang2013opinion}, classify agents as closed, open and moderate, and analyse different group compositions. \cite{faure2002dynamics,galam2004contrarian,amblard2004role,acemoglu2010spread,acemouglu2013opinion,delellis2017steering} classify agents based on opinions, and discuss the effect of contrarians, extremists and forceful agents. \cite{moussaid2013social} analyses the impact of well-informed minorities in the midst of an uninformed majority. In \cite{porfiri2007decline,yildiz2011discrete}, extremist minorities in a fairly stubborn society, and stubborn agents in a voters model have been explored. \cite{ghaderi2014opinion} studies stubbornness of agents as a criterion in a cost function. Similar to bounded-confidence models, in the context of non-equilibrium systems, Vicsek \textit{et al.} \cite{vicsek1995novel} proposed a model with biologically inspired interactions to study the motion of self-propelled particles. Accordingly, at each time-step a particle driven with a constant absolute velocity adopts the the average heading of those in its $r-$neighborhood with some added perturbation. This nearest neighbor rule has indicated consensus about the heading, despite the absence of centralized co-ordination and a dynamic neighborhood. This, coupled with the model's simplicity, makes it a popular choice for studying robotic swarms. It has been extensively used for data fusion in sensor networks \cite{ogren2004cooperative}, collaboration of UAVs \cite{stipanovic2004decentralized}, and in explaining the behavior of animal groups \cite{chazelle2009convergence,shaw1962schooling}. In this work, we adapt the model in \cite{vicsek1995novel} since the nearest-neighbor rule with dynamic local interactions epitomizes influence spread in networks. We assume that beliefs of members of a social group are analogous to the direction of motion of a particle in space. Unlike all bounded-confidence models, we distinguish agents within a neighborhood based on familiarity. Heterogeneous agents with non-uniform interaction thresholds have been considered. The opinion distribution is modeled as a truncated Gaussian, in contrast with a uniform spread encountered in most of the existing works. This is consistent with the assumptions and experimental validation of opinions collected from social networks \cite{boccara2008models,de2014learning,chacoma2015opinion}. It is evident that beliefs and the underlying interaction network co-evolve. In most of the existing works, the changes in network are either due to randomly induced ties or as a consequence of the bounded-confidence assumption. In addition, \cite{zimmermann2005cooperation} employs a reward-or-penalize strategy for evolution of ties. The impact of rewiring is analysed in \cite{kozma2008consensus,nardini2008s}. In the context of complex systems, \cite{delellis2017steering}, \cite{boccaletti2006complex,delellis2010evolution} explore a dynamic member-set, network based on proximity rule, and edge snapping, respectively. Instead, here, a network derived from individual opinions, thresholds and interactions evolve in accordance with prescribed rules, reflecting dynamic interpersonal relationships. Besides, neither are all agents nor are all their interactions equal; this is not only modeled by dynamic weights of nodes and edges, but also by familiarity-based interactions. These aspects have been rarely explored in conjunction with opinion dynamics. While such a model may not include all the complexities of a social network, our studies show that interesting phenomena can be observed in the results obtained from this model which give some insights into the evolution of opinion and consensus in social networks. \section{THE MODELS} \subsection{The original Vicsek Model} Consider $N$ particles that are restricted to move in a periodic square box. The particles are randomly placed in the box and have the same absolute velocity. Their initial headings ($\theta_{i}(0)$) are uniformly chosen at random from within a range $(-\pi,\pi]$. At every time-step, the particles assume the average heading ($\langle\theta(t)\rangle_{r}$) of those within a circle of radius $r$ surrounding them, with some added noise ($\Delta\theta$). This average direction is given by $\arctan[\langle\sin(\theta(t))\rangle_{r}/\langle\cos(\theta(t))\rangle_{r}]$. \subsection{The Modified Vicsek-like Model and Corresponding Social Network} Consider $N$ agents, each with a belief $\theta_{i}(t) \in [0,\pi]$. An agent engages with those others, whose beliefs do not deviate from its own by more than a fixed tolerance ($\theta_{T_{i}}$). This is similar to interactions over virtual networks that are oblivious to geographic locations of agents and the distances separating them. The like-minded individuals who influence an agent, constitute its opinion neighborhood, \begin{equation} N_{i}(t)~:=~\{~j~:~|\theta_{i}(t)-\theta_{j}(t)|~\leq ~\theta_{T_{i}}\}. \end{equation} In Fig. \ref{fig1}, the vectors represent opinions and shaded sectors indicate tolerances. It is clear that the sectors of agents $1$ and $2$ overlap the opinion vectors of $2$ and $1$, respectively. The same can be observed with $2$ and $3$, indicating they are neighbors. \begin{figure}[t!] \centering \includegraphics[width=4.5cm]{fig1.eps} \vspace{-5pt} \caption{Opinion vectors with shaded sectors indicating tolerance ($\theta_{T_{i}}$)} \label{fig1}\vspace{-15pt} \end{figure} The agents and their influence can be abstracted using vertices and directed edges of a graph $G(t)= (V,E(t))$. Its vertex set $V$ is invariable and is a collection of $N$ agents. Its edge set $E(t)$ is a collection of all the interactions at time $t$, \begin{equation} E(t)~\subseteq~\{~(i,j)~:~j\in~N_{i}(t)~,~\forall i,~i~\neq~j~\}. \end{equation} The directed edge $(i,j)$ is the influence of $i$ on $j$. To illustrate, consider the agents and their tolerance as portrayed in Fig.\ref{fig1}. The corresponding vertex and edge sets are $V=\{1,2,3,4,5\}$ and $E(t)=\{(1,2),(2,1),(2,3),(3,1)\}$, respectively. This is represented in Fig. \ref{fig2a} where there are bidirectional edges between vertex pairs $(1, 2)$ and $(2, 3)$. The beliefs of $4$ and $5$ are different from the rest, and are isolated. Fig. \ref{fig2b} depicts a more realistic scenario, where influences are not reciprocated. It can be observed that 2 influences 1, while 1 does not influence 2. Similarly, 3 influences 2 and not vice versa. \begin{figure}[t!] \centering \subfigure[Agents and their influence]{\includegraphics[width=4.cm]{fig2.eps} \label{fig2a}} \subfigure[A more realistic scenario]{\includegraphics[width=4.cm]{fig2b.eps}\label{fig2b}} \caption{Representation of agents and their interactions using a graph $G(t)$} \label{fig2} \vspace{-15pt} \end{figure} The ad-hoc nature of human interactions is modeled by asynchronous updates. When an agent modifies its belief under the influence of its neighbors ($\langle \theta_{i}(t)\rangle$), it is governed by \begin{align}\label{e1} \begin{split} &\theta_{i}(t+1) = \langle \theta_{i}(t)\rangle,\\ & \tan(\langle \theta_{i}(t)\rangle)=\frac{\sum\limits_{j\in N_{D_{i}}(t)\cup \bar{N}_{ND_{i}}(t)} w_{ij}(t) \sin(\theta_{j}(t))}{ \sum\limits_{j\in N_{D_{i}}(t)\cup \bar{N}_{ND_{i}}(t)}w_{ij}(t) \cos(\theta_{j}(t))}. \end{split} \end{align} Whenever agents interact and update their beliefs, the network topology may change; the updated belief of an agent may impact its neighborhood set, and thereby, the network's edges. The edges are classified as direct and non-direct ties. Direct ties are an agent's frequent contacts belonging to $N_{D_{i}}(t)$, and are its one-hop neighbors. Non-direct ties are occasional contacts belonging to $N_{ND_i}(t)$, and are an agent's two-hop or three-hop neighbors, such that, \begin{equation} N_{i}(t) = N_{D_{i}}(t)\cup N_{ND_{i}}(t). \end{equation} This is essential because, like-minded agents may be unaware of each others' presence in a vast network. Empirical analyses establishing the importance of such influences can be found in \cite{aral2009distinguishing}. When an agent updates its belief using (\ref{e1}), it considers $N_{D_{i}}(t)$ and a randomly chosen subset, $\bar{N}_{ND_{i}}(t) \subseteq N_{ND_{i}}(t)$. This way, noise is inherent in our model; greater an agent's tolerance, more susceptible it is to such chanced interactions. However, there exist noise-free extensions to the Vicsek model that analyse heterogenous thresholds \cite{yang2006consensus}. Trust scores - $w_{ij}(t),~\text{with}~j~\neq~i$, in (\ref{e1}) associated with edges signify the strength of an influence. Initially, direct ties are assigned random trust scores ($w_{ij}(t)$). Between a pair of vertices $(j,i)$, a sequence of directed edges connecting them is a directed path. To compute the weight of a non-direct tie, all such paths between the vertex pair are identified. The weight of each path is defined as the product of weights of the edges that constitute them. The score of a temporary edge is the average of the weights of all such paths between a pair $(j,i)$; \begin{align} \begin{split} &w_{ij}(t)=\frac{\sum\limits_{p=1}^{p_{max}}\prod\limits_{(m,n)\in E_{path}}w_{mn}(t)}{p_{max}},\\ &E_{path}=\{(m,n)|\ (m,n)\in \text{the directed path}~ (j,i) \},\\ &p_{max}=|E_{path}|,~\sum_{j,j\neq i}w_{ij}(t)~=~ 1-w_{ii}(t). \end{split} \end{align} Hence, the influences of direct ties are stronger. Evidently, the trust scores are proposed based on familiarity of agents - frequent or occasional contact. This is unlike \cite{da2015sudden} which is an exclusive treatment of trust based on several psychological parameters. It is also different from \cite{fu2008reputation,delellis2017evolving}, where trust or reputation is built over time through interactions. The self-weights ($w_{ii}(t)$) reflect an agent's status in the network. To measure them, we use Katz's centrality \cite{katz1953new}, \begin{equation} W(t)~=~\beta(I-\alpha A^{T}(t))^{-1}~.~\mathbf{1}, \end{equation} where, $\beta$ is a positive non-zero bias, $\alpha <1/\lambda_{max}$, $A(t)$ is the adjacency matrix of the underlying network, and $W(t)$ is a vector of self-weights. Accordingly, the importance of a node is based not only on its degree, but also on the nature of its contacts. Essentially, a node's connection to influential nodes yields a higher self-weight than ties with less prominent ones. Additionally, a socially important individual is less obligated to yield to influence, which is reflected in (\ref{e1}), where, self-weights quantify the importance accorded to one's opinion. Upon interactions, new connections are forged only with non-direct ties, since, humans do not reach-out beyond them \cite{christakis2009connected}. A new tie is gained when the cumulative number of random interactions between agent $i$ and its non-direct tie $j$, exceeds its sociability index ($s_{i}$). Under the assumption that socially important agents do not forge ties easily \cite{bruggeman2013social}, the index is assumed to be proportional to self-weight; \begin{equation} s_{i} = K_{C}w_{ii}, \end{equation} where, $K_{C}$ is a proportionality constant, chosen based on the network size. Also, it has been observed that inter-personal bonds are not easily lost \cite{leary2017need}. Therefore, only the ties between agents with dissimilar opinions disappear; agent $i$ loses a direct tie $j$ when the following condition is violated, \begin{equation} |\theta_{i}(t)-\theta_{j}(t)|\leq\theta_{T_{i}}. \end{equation} \section{PROBLEM FORMULATION} Consider $N$ agents, each with a belief $\theta_{i}(t)$ and a tolerance $ \theta_{T_{i}}$. The beliefs are updated using (\ref{e1}), and the interactions are governed by rules prescribed in the previous section. As beliefs change, the underlying network topology evolves. This interplay yields different collective behaviors. We are interested in studying consensus or the lack of it, subject to different (\romannum{1}) initial opinion spreads, (\romannum{2}) constituent agent types, (\romannum{3}) individual tolerance, and (\romannum{4}) densities of agents. \subsection{Classification of Agents} The agents are grouped based on their tolerances; \subsubsection{Rigid} These are stubborn individuals that dialogue with those with similar beliefs. Their intolerance to diverse beliefs is modeled with lower thresholds, $\theta_{T_{i}}\in[0,\theta_{R}]$. \subsubsection{Flexible} They admit beliefs very different from their own, and are modeled as agents with higher tolerances, $\theta_{T_{i}}\in[\theta_{F_{1}},\theta_{F_{2}}]$, such that, $\theta_{F_{2}}>\theta_{F_{1}}>\theta_{R}$. \cite{kou2012multi} - \cite{liang2013opinion} employ a similar strategy, where, agents are classified based on predetermined values of threshold. \subsection{Classification of Groups} The groups are classified depending on the initial distribution of their agents' beliefs. In real, opinions may not be uniformly spread. Instead, there could be a popular opinion with a few others scattered in the vicinity. This pattern is modelled using a truncated Gaussian model, whose mean ($\mu$) and standard deviation ($\sigma$), represent the popular opinion and the nature of the group, respectively. This is not only consistent with \cite{boccara2008models}, but are also subtantiated by experiments carried out in \cite{de2014learning} and \cite{chacoma2015opinion}. Accordingly, the groups are classified as, \subsubsection{Conservative} The agents' initial beliefs are typically in the vicinity of a popular opinion. Using a truncated Gaussian distribution to model the initial spread, opinions take values around the mean ($\mu$); since, such groups allow a few agents with contrary opinions (in Fig. \ref{fig5b}). This is addressed by choosing a small spread, $\sigma \in [0,\theta_{C}]$. \subsubsection{Liberal} It admits varied opinions, and this diversity is reflected in a larger spread, $\sigma \in [\theta_{L_{1}},\theta_{L_{2}}]$, where, $\theta_{L_{2}}>\theta_{L_{1}}>\theta_{C}$. Unlike a conservative group, there are fewer agents with beliefs close to the mean (in Fig. \ref{fig5d}). \begin{figure}[t!] \subfigure[PDF of a conservative group]{\includegraphics[width=4.cm]{pmfc.eps} \label{fig5a}} \hfil \subfigure[Conservative group opinions]{\includegraphics[width=4.cm]{oc.eps}\label{fig5b}} \subfigure[PDF of a liberal group]{\includegraphics[width=4.cm]{pmfl.eps}\label{fig5c}} \hfil \subfigure[Liberal group opinions]{\includegraphics[width=4.cm]{ol.eps}\label{fig5d}} \caption{Truncated Gaussian distribution of initial opinions in groups} \label{fig5}\vspace{-15pt} \end{figure} The names accorded to these groups have no political connotations, and have been chosen as they best fit the description. \section{STRUCTURAL PROPERTIES OF THE NETWORK} Consensus in a group can either be a global or a local phenomenon. Although global consensus is ideal, in real, it often happens that the members of a group separate to form smaller opinion groups. It would be interesting to discern the possible causes of this phenomenon. To this end, we undertake a diagnostic approach to identify the edges and the corresponding agents responsible. As a consequence of the proposed model, the collection of these edges have been observed to possess some unique characteristics. Consider an initial network, $G(t_{0})=(V,E(t_{0}))$. The beliefs updated using (\ref {e1}) is said to have converged when, \begin{equation} \theta({t_{k}})-\theta({t_{k}-1})~=~0,~\text{for some}~k>0. \end{equation} The converged network is $G(t_{f})$, where, $t_{f}:=t_{k}$. When there is local consensus, there will be more than one connected component in $G(t_{f})$. To identify the responsible edges, $G(t_{f})$ is compared with $G(t)$. The edge cut-set ($E_{cs}(t)$) is a collection of such edges with interesting properties: (\romannum{1}) There exists a unique set of agents and edges that are responsible for group splits, (\romannum{2}) The newly formed ties that are acquired as the network evolves, are not responsible for the factions formed. These properties are established in the following theorems. \begin{theorem} The edge cut-set $E_{cs}(t)$ of a $(G(t), G(t_{f} ))$ pair is unique and minimal. \end{theorem} \begin{proof} Assume $E_{cs}(t)$ is not unique, then, \begin{equation} \exists\ E_{cs}^{'}(t)\subset\{ E(t)\setminus E_{cs}(t)\} \ni (G(t)-E_{cs}^{'}(t))=G(t_{f}) \end{equation} This implies that there exist edges in $G(t)$ between components of $G(t_{f})$ that are not in $E_{cs}(t)$. But, $E_{cs}(t)$ is the set of all such cross-connections, and therefore $E_{cs}^{'}(t)=E_{cs}(t)$. This proves uniqueness of $E_{cs}(t)$. Now, Assume that $E_{cs}(t)$ is not minimal, then, \begin{equation} \exists (i,j)\in E_{cs}(t)\ni (G(t)-\{E_{cs}(t)\setminus(i,j)\})=G(t_{f}) \label{e13} \end{equation} But, $(i,j)\in E_{cs}(t)$, implies that it is an edge in $G(t)$ between two groups of $G(t_{f})$, and therefore $(i,j)$ cannot be redundant or (\ref{e13}) cannot be true. This proves minimality. \end{proof} \begin{theorem} If $E_{cs}(t_{0})$ is an edge cut-set corresponding to a pair $(G(t_{0}),G(t_{f}))$, then any $E_{cs}(t)$ corresponding to a pair $(G(t),G(t_{f})),\ t_{0}< t \leq t_{f}$, is a sub-set of $E_{cs}(t_{0})$. \end{theorem} \begin{proof} Let $E_{cs}(t_{0})$ be the edge cut-set corresponding to $(G(t_{0}),G(t_{f}))$. For any $t>t_{0}$, we know that $E_{cs}(t)$ will have no new edges between vertices in different components of $G(t)$. Thus, it is apparent that no new edge is added to $E_{cs}(t),\forall t>t_{0}$, and therefore $E_{cs}(t)\subseteq E_{cs}(t_{0})$. \end{proof} \begin{corollary} For any $(G(t_{0}),G(t_{f}))$ pair, the edge cut-set $E_{cs}(t_{0})$ is the largest minimal set among $\{E_{cs}(t),\ \forall t>t_{0}\}$. \end{corollary} \section{SIMULATION RESULTS \& DISCUSSIONS} A group of 100 agents has been considered with the simulation time set at 250 units. Unlike in \cite{fu2015opinion,liang2013opinion}, where, tolerance of agents is assigned according to some distribution, here, all the agents of a type are assumed to have a fixed tolerance, consistent with \cite{kou2012multi}. For instance, all rigid agents have a tolerance $\theta_{R} \in \{10^\circ,30^\circ\}$, while all flexible agents have a tolerance $\theta_{F} \in \{40^\circ,80^\circ\}$. The distribution of initial opinions for conservative and liberal groups are set at $\mu = 90^\circ$ with $\sigma \in \{10^\circ,15^\circ\}$ and $\sigma \in \{20^\circ,25^\circ\}$, respectively. The initial network is derived from opinions and tolerances. There are no assumptions made regarding the structure of the initial network. To prevent trivial initial networks - like well-connected ones - the out-degree of each vertex is capped at 25. The constant of proportionality, $K_{C}$, is set to 100. To account for diverse opinions, network topologies, and interaction patterns, Monte Carlo simulations have been carried out. To this end, we define four group configurations, \begin{enumerate} \item Configuration 1 is a conservative group with all rigid agents, or more rigid agents than flexible ones. \item Configuration 2 is a conservative group with all flexible agents, or more flexible agents than rigid ones. \item Configuration 3 is a liberal group, where, the density of agents is similar to Configuration 1. \item Configuration 4 is also a liberal group, where, the density of agents is similar to Configuration 2. \end{enumerate} Each configuration with fixed agent tolerances is subjected to 100 simulation runs. Each run corresponds to a particular opinion distribution, fixed agents' density and tolerance - $\{10^\circ, 40^\circ\},~\{10^\circ, 80^\circ\},~\{30^\circ, 40^\circ\}~\text{or}~\{30^\circ, 80^\circ\}$. Starting with a group of all flexible agents, we study the impact of density of rigid agents on consensus. This is quantified by, \begin{align} \small \begin{split} &\text{Rate of Consensus} = \frac{\text{ No. of times group consensus is achieved}}{\text{No. of simulation trials}}. \end{split} \end{align} The consensus rate for a configuration is essentially the average occurence of group consensus. \subsection{Conservative Groups} In such groups, when flexible members are in a majority, the dialogue between agents mostly yields consensus. This is observed in Fig. \ref{fig6a}, where the rate of consensus is high. On increasing the number of rigid members in the group, factions are formed. This is captured by a marginal drop in the consensus rate in Fig. \ref{fig6a}. This is because, the rigid members of the group could lose ties with their neighbors upon marginally changing their beliefs. Such changes to the neighborhood results in an eventual split of an originally connected group, rendering it highly intolerant to unpopular opinions. Additionally, from the plots in Fig. \ref{fig6a}, it can be inferred that flexible agents facilitate group consensus. This is substantiated by a drastic decline in consensus rate when their population is barely 10\%. Another key observation is regarding the tolerance of agents; as the tolerance of rigid agents is increased from $10^\circ$ to $30^\circ$, there is a remarkable improvement in the rate of consensus. \begin{figure*}[t!] \centering \subfigure[Conservative group with $\sigma = 10^{\circ}$ (top) and $\sigma = 15^{\circ}$ (bottom) ]{\includegraphics[width=0.45\textwidth]{90101.eps} \label{fig6a}\vspace{-10pt}} \hfil \subfigure[Liberal group with $\sigma = 20^{\circ}$ (top) and $\sigma = 25^{\circ}$ (bottom)]{\includegraphics[width=0.45\textwidth]{90202.eps}\label{fig6b}\vspace{-10pt}} \caption{Rate of consensus in conservative and liberal groups with varying agent densities and individual tolerance} \label{fig6}\vspace{-15pt} \end{figure*} \subsection{Liberal Groups} In these groups, the rate of consenus is impacted not only by the presence of rigid agents, but also a wider belief distribution. Intuitively, a group with all flexible individuals should have a relatively high rate of consensus for different values of $\theta_{T_{i}}$ and different initial spreads, which is also observed in Fig. \ref{fig6}. However, because of the belief spread, unlike conservative groups, the behaviour of a liberal group is sensitive to the inclusion of even a small number of rigid agents. Upon the inclusion of rigid agents in an all flexible group, there is a significant drop in the rate of consensus, which can be observed in Fig. \ref{fig6b}. The earlier observation about flexible agents being facilitators of group consensus holds. This is again justified by an eventual decline in consensus rate when their population is reduced to $10\%$ or lower. Similarly, an increase in tolerance of rigid agents positively impacts consensus. \begin{figure}[t!] \centering \subfigure[Group of rigid agents ($\mu = 90^\circ,~\sigma = 20^{\circ}$) ]{\includegraphics[width=5.5cm]{newop.eps} \label{fig8e}\vspace{-10pt}} \subfigure[$t=0$ ]{\includegraphics[width=4.cm]{t1.eps} \label{fig8a}} \hfil \subfigure[$t=5$]{\includegraphics[width=4.cm]{t5.eps}\label{fig8b}} \subfigure[$t=10$]{\includegraphics[width=4.cm]{t10.eps} \label{fig8c}} \hfil \subfigure[$t=15$]{\includegraphics[width=4.cm]{t15.eps}\label{fig8d}} \caption{Evolution of opinions ((a)) and the underlying network ((b)-(e)) indicating $E_{cs}(t)$ (bold edges) and factions (different node markers)} \label{fig8}\vspace{-15pt} \end{figure} Whenever there is a decline in the rate of consensus in any of the four configurations (see Fig. 4), it is indicative of instances when factions are formed. Higher the number of such instances, lower is the rate of consensus. In Fig. \ref{fig8e}, the evolution of opinions in a group of rigid individuals is illustrated. The lack of consensus results in more than one opinion group, which are formed when individuals with dissimilar opinions lose their ties belonging to the edge cut-set ($E_{cs}(t_{0})$). From Fig. \ref{fig8a} - \ref{fig8d}, it can be seen that the number of ties in the set decreases over time, $E_{cs}(t_{15})\subset E_{cs}(t_{10})\subset E_{cs}(t_{5}) \subset E_{cs}(t_{0})$. It can be observed that the new ties formed do not cause group splits. The ties in $E_{cs}(t_{0})$ are all lost when the network converges (Fig. \ref{fig8d}), resulting in four groups. Thus, a conservative group with flexible agents in majority evolves into a moderately tolerant society; where minor disagreements do not create break-away factions. However, with the inclusion of rigid agents, despite the narrow initial spread of beliefs, there may be opinion groups formed. Essentially, a conservative society is less accommodative of rebelling minorities, which is similar to the observation in \cite{porfiri2007decline}. On the contrary, a liberal group with rigid agents evolves into a pluralistic society, while one with all flexible individuals always tends to form agreeable groups. Although not with similar societal construct or comparable adaptive interactions, the works \cite{kou2012multi,fu2015opinion,liang2013opinion} report similar predictions. Further, the role played by flexible agents as prime facilitators of group consensus, is worth reiterating. In-line with \cite{kou2012multi,fu2015opinion,liang2013opinion}, \cite{yang2006consensus}, an increase in the individual tolerance has shown to significantly transform the outlook of a group into a more progressive one. \section{CONCLUSIONS} We discussed a modified version of the Vicsek model to study influence dynamics, its spread and consequence on opinions. The heading angles of agents in \cite{vicsek1995novel} are considered analogous to beliefs, while ignoring their physical distances. Like in bounded-confidence models, a closest-opinion rule has been proposed. In comparison with \cite{kou2012multi,fu2015opinion,liang2013opinion}, the proposed model is equipped to handle the subtleties in human interactions, and opinion formation. The structural properties of the evolving network that are a consequence of the proposed model have been analytically established. With these preliminary results, in subsequent works, we intend to develop them further to predict agents responsible for group splits and regulate group behavior. To emulate real-life scenarios, we have considered different agent types, groups, and their compositions. In addition to confirming anticipated behavior, the results are in sync with similar reports in literature. Overall, the modified Vicsek-like model seems to demonstrate the potential to explain many observed phenomena in influence dynamics, group fragmentation and the role of agents. To realise its maximum potential, several avenues and future research directions can be pursued. The effect of opinion density on agreement values can be explored. In addition, the impact of leaders on group behavior may be evaluated. \bibliographystyle{IEEEtran}
\section{Introduction} Quadratic stochastic operators (QSO's) and their application in biology were first considered by Bernstein \cite{Br}. They arise as models of genetic evolution that describe the dynamics of gene frequencies in mathematical population genetics. These and similar models are also considered in their own right from a dynamical systems perspective. Consider a population of $m$ different genetic types, where individuals possess a single type. The frequency of occurrence of the different types is given by a probability distribution $x = (x_1,\ldots,x_m)$ and thus by a point $x$ on the simplex $\Delta^{m-1}$. Let $p_{ij,k}$ be the conditional probability that two individuals of type $i$ and $j$ given they interbreed, produce offspring of type $k$. The expected gene distribution in the next generation is modeled by a quadratic operator $V: \Delta^{m-1} \to \Delta^{m-1}$, \[ (V(x))_k = \sum_{i,j=1}^m p_{ij,k} x_i x_j. \] The quadratic operator is a Volterra operator if $p_{ij,k} = 0$ for any $k \not\in \{i,j\}$. That is, the genetic type of an offspring is a copy of one of its parents. Several publications treat dynamics of Volterra quadratic operators. A randomization is considered in \cite{JKM17}. That paper studies random dynamical systems obtained from sequences of independent and identically distributed quadratic operators. Under some conditions it is shown that trajectories converge to one of the vertices of $\Delta^{m-1}$ almost surely. A generalization is the concept of cubic stochastic operators (CSO). A CSO is given by a map $V: \Delta^{m-1} \to \Delta^{m-1}$ of the form \[ (V(x))_l = \sum_{i,j,k=1}^m p_{ijk,l} x_i x_j x_k \] with $p_{ijk,l} \ge 0$ and $\sum_{l=1}^m p_{ijk,l} = 1$. A CSO is called a Volterra operator if $p_{ijk,l}=0$ if $l \not\in \{i,j,k\}$. We will consider a family of Volterra CSO's with coefficients of heredity \[ p_{ijk,l} = \left\{ \begin{array}{ll} 1, & \delta_{il} + \delta_{jl} + \delta_{kl} = 3, \\ \theta, & \delta_{il} + \delta_{jl} + \delta_{kl} = 2, \delta_{ij} + \delta_{ik} + \delta_{jk} =1, \\ 1-\theta, & \delta_{il} + \delta_{jl} + \delta_{kl} = 1, \delta_{ij} + \delta_{ik} + \delta_{jk} =1, \\ \frac{1}{3}, & \delta_{il} + \delta_{jl} + \delta_{kl} = 1, \delta_{ij} + \delta_{ik} + \delta_{jk} =0, \\ 0, & \textrm{otherwise}, \end{array} \right. \] where $\delta_{ij}$ is the Kronecker symbol and $\theta \in [0,1]$. Properties of such CSO's are studied in \cite{JKL17}. We will take the approach of \cite{JKM17} and consider random iterations of CSO's. For this we restrict to populations with three types, that is, to maps on the two dimensional simplex $\Delta^2$. The resulting map $V_\theta:\Delta^2 \to \Delta^2$ is given by \begin{equation}\label{cneop} \left\{\begin{array}{l} (V_\theta(x))_1=x_1\big( x_1^2+3\theta x_1 (x_2+x_3)+3(1-\theta)(x_2^2 + x_3^2) + 2x_2 x_3\big), \\[2mm] (V_\theta(x))_2 =x_2\big(x_2^2+3\theta x_2 (x_3+x_1)+3(1-\theta)(x_3^2 + x_1^2) + 2x_3 x_1\big), \\[2mm] (V_\theta(x))_3=x_3\big( x_3^2+3\theta x_3 (x_1+x_2)+3(1-\theta)(x_1^2 + x_2^2) + 2x_1 x_2\big). \end{array}\right. \end{equation} The system can be seen as a discrete version of Kolmogorov equations for three interacting species. It is easy to see that $V_{2/3}$ is the identity map. It is shown in \cite{JKL17} that orbits of $V_\theta$, $\theta \ne \frac{2}{3}$, converge to one of the equilibria for which none, one or two of the genetic types go extinct. The simplex $\Delta^2$ consists of different invariant regions as depicted in Figure~\ref{f:parti}. Write \[ G_1=\{y \in \Delta^2: y_1 \ge y_2 \ge y_3\}; \] $G_1$ is a subset of $\Delta^2$ which is invariant under each $V_\theta$. The simplex $\Delta^2$ is the union of $G_1$ and its symmetric images under permutations of coordinates, see Figure~\ref{f:parti}. \begin{figure}[!ht] \begin{tikzpicture} \draw (0,0)--(4,0)--($(2,{2*sqrt(3)})$)--(0,0); \draw (0,0)--($(3,{sqrt(3)})$); \draw ($(2,{2*sqrt(3)})$)--(2,0); \draw ($(1,{sqrt(3)})$)--(4,0); \draw (0,0) node[below]{$\mathbf{e}_1$}; \draw (4,0) node[below]{$\mathbf{e}_2$}; \draw ($(2,{2*sqrt(3)})$) node[above]{$\mathbf{e}_3$}; \draw (1.8,0.4) node[left]{$G_1$}; \draw (1.4,1.1) node[left]{$G_2$}; \draw (1.9,2) node[left]{$G_3$}; \draw (2.1,2) node[right]{$G_4$}; \draw (2.5,1.1) node[right]{$G_5$}; \draw (2.3,.4) node[right]{$G_6$}; \end{tikzpicture}\hspace{2cm} \begin{tikzpicture} \draw (0,0)--(4,0)--($(4,{4*sqrt(3)/3})$)--(0,0); \draw (0,0) node[below]{$\mathbf{e}_1$}; \draw (4,0) node[below]{$c$}; \draw ($(4,{4*sqrt(3)/3})$) node[above]{$C$}; \draw (3.2,0.8) node[left]{$G_1$}; \draw (2,0) node[below]{$\Gamma_{12}$}; \draw ($(4,{2*sqrt(3)/3})$) node[right]{$M_{12}$}; \draw ($(2,{2.2*sqrt(3)/3})$) node[above]{$M_{23}$}; \end{tikzpicture} \caption{Left: the partition of $\Delta^2$ in invariant triangles. Right: notation for $G_1$.}\label{f:parti} \end{figure} The boundary of $G_1$ is the union of three edges, $M_{12} = \{y \in \Delta^2: y_1 = y_2 \ge y_3, \}$, $M_{23} = \{y \in \Delta^2: y_1 \ge y_2 = y_3, \}$, $\Gamma_{12} = \{y \in \Delta^2: y_1 \ge y_2, y_3=0 \}$. Let $C =(1/3,1/3,1/3)$ be the center of $\Delta^2$, $c=(1/2,1/2,0)$, $\mathbf{e}_1=(1,0,0)$ be the two other vertices of $G_1$. These vertices are the fixed points of $V_\theta$ restricted to $G_1$, for any $\theta \ne \frac{2}{3}$ \cite{JKL17}. The set of fixed points of $V_\theta$ on $\Delta^2$ consists of these points and their symmetric images, in total $7$ points. Let $\A$ denote this set of fixed points. \begin{figure}[h!] \begin{tikzpicture} \draw (0,0)--(4,0)--($(2,{2*sqrt(3)})$)--(0,0); \draw (0,0)--($(3,{sqrt(3)})$); \draw ($(2,{2*sqrt(3)})$)--(2,0); \draw ($(1,{sqrt(3)})$)--(4,0); \foreach \x in {1, 1.32, 1.62} \draw[-stealth,thick,black] ($(\x, {sqrt(3)*\x})$) -- ($(\x+ 0.35,{sqrt(3)*\x+ sqrt(3)*0.35})$); \foreach \x in {0, 0.32, 0.64} \draw[stealth-,thick,black] ($(\x, {sqrt(3)*\x})$) -- ($(\x+ 0.35,{sqrt(3)*\x+ sqrt(3)*0.35})$); \foreach \x in {3, 2.68, 2.38} \draw[-stealth,thick,black] ($(\x, {-sqrt(3)*\x+4*sqrt(3)})$) -- ($(\x- 0.35,{-sqrt(3)*\x+ 4*sqrt(3)+sqrt(3)*0.35})$); \foreach \x in {4, 3.68, 3.36} \draw[stealth-,thick,black] ($(\x, {-sqrt(3)*\x+4*sqrt(3)})$) -- ($(\x- 0.35,{-sqrt(3)*\x+ 4*sqrt(3)+sqrt(3)*0.35})$); \foreach \y in {1.2, 1.7, 2.3, 2.85} \draw[-stealth,thick,black] (2, \y) -- (2,\y+0.5); \foreach \y in {0, .28, .56,.84} \draw[stealth-,thick,black] (2, \y) -- (2,\y+0.3); \foreach \x in {2.02, 2.32, 2.64} \draw[-stealth,thick,black]($(\x, {1/3*sqrt(3)*\x})$) -- ($(\x+ 0.35,{1/3*sqrt(3)*\x+ 1/3*sqrt(3)*0.35})$); \foreach \x in {0, 0.5, 1,1.5} \draw[stealth-,thick,black] ($(\x, {1/3*sqrt(3)*\x})$) -- ($(\x+ 0.45,{1/3*sqrt(3)*\x+ 1/3*sqrt(3)*0.45})$); \foreach \x in {2.5,3,3.5,4} \draw[stealth-,thick,black] ($(\x, {-1/3*sqrt(3)*\x+4/3*sqrt(3)})$) -- ($(\x- 0.45,{-1/3*sqrt(3)*\x+ 4/3*sqrt(3)+1/3*sqrt(3)*0.45})$); \foreach \x in {1.95,1.65,1.35} \draw[-stealth,thick,black] ($(\x, {-1/3*sqrt(3)*\x+4/3*sqrt(3)})$) -- ($(\x- 0.35,{-1/3*sqrt(3)*\x+ 4/3*sqrt(3)+1/3*sqrt(3)*0.35})$); \draw (0,0) node[below]{$(0,0,1)$}; \draw (2,0) node[below]{$(0,\frac{1}{2},\frac{1}{2})$}; \draw (4,0) node[below]{$(0,1,0)$}; \draw (3,1.8) node[right]{$(\frac{1}{2},\frac{1}{2},0)$}; \draw ($(2,{2*sqrt(3)})$) node[above]{$(1,0,0)$}; \draw (1,1.8) node[left]{$(\frac{1}{2},0,\frac{1}{2})$}; \draw (2,-1) node[below]{Case $\theta >\frac{2}{3}$}; \path[-stealth,black] (2.1,1.6) edge[bend left=5] node { } (2.15,1.9); \path[-stealth,black] (2.5,1.6) edge[bend right=15] node { } (2.7,1.9); \path[-stealth,black] (2.5,2) edge[bend right=15] node { } (2.55,2.3); \path[-stealth,black] (2.1,2) edge[bend left=5] node { } (2.15,2.3); \path[-stealth,black] (2.3,2) edge[bend right=5] node { } (2.35,2.3); \path[-stealth,black] (2.35,2.4) edge[bend right=5] node { } (2.3,2.7); \path[-stealth,black] (2.15,2.4) edge[bend left=5] node { } (2.17,2.7); \path[-stealth,black] (2.15,2.8) edge[bend right=5] node { } (2.1,3.1); \path[-stealth,black] (2.2,1.4) edge[bend right=5] node { } (2.35,1.7); \path[-stealth,black] (2.25,1.7) edge[bend right=5] node { } (2.42,2); \path[-stealth,black] (1.82,1.8) edge[bend right=5] node { } (1.85,2.1); \path[-stealth,black] (1.82,2.2) edge[bend right=5] node { } (1.85,2.5); \path[-stealth,black] (1.6,2.3) edge[bend left=5] node { } (1.7,2.6); \path[-stealth,black] (1.7,2.7) edge[bend left=5] node { } (1.83,3); \path[-stealth,black] (1.9,2.8) edge[bend right=5] node { } (1.92,3.1); \path[-stealth,black] (1.4,2.1) edge[bend left=5] node { } (1.5,2.4); \path[-stealth,black] (1.7,1.5) edge[bend left=30] node { } (1.4,1.7); \path[-stealth,black] (1.3,1.75) edge[bend left=30] node { } (1.35,2.1); \path[-stealth,black] (1.6,1.8) edge[bend left=5] node { } (1.65,2.1); \path[-stealth,black] (1.82,1.4) edge[bend right=5] node { } (1.85,1.7); \path[-stealth,black] (1.85,1) edge[bend left=30] node { } (1.8,.7); \path[-stealth,black] (1.75,.9) edge[bend left=5] node { } (1.45,.7); \path[-stealth,black] (1.4,.7) edge[bend left=5] node { } (1.1,.47); \path[-stealth,black] (.9,.4) edge[bend left=5] node { } (.6,.2); \path[-stealth,black] (.5,.2) edge[bend left=5] node { } (.2,.03); \path[-stealth,black] (1.8,.6) edge[bend left=30] node { } (1.6,.3); \path[-stealth,black] (1.5,.25) edge[bend left=10] node { } (1.2,.15); \path[-stealth,black] (1.1,.2) edge[bend left=10] node { } (0.8,.1); \path[-stealth,black] (.7,.15) edge[bend left=10] node { } (0.4,.065); \path[-stealth,black] (1.3,.4) edge[bend left=5] node { } (.95,.25); \path[-stealth,black] (1.7,.65) edge[bend left=5] node { } (1.4,.45); \path[-stealth,black] (.85,.7) edge[bend left=5] node { } (.5,.5); \path[-stealth,black] (.75,1.1) edge[bend right=5] node { } (.55,.7); \path[-stealth,black] (.4,.5) edge[bend left=1] node { } (.2,.2); \path[-stealth,black] (1.7,1.2) edge[bend left=5] node { } (1.4,1); \path[-stealth,black] (1.2,1.25) edge[bend right=5] node { } (.9,1.05); \path[-stealth,black] (1.2,.85) edge[bend right=5] node { } (.9,.65); \path[-stealth,black] (1,1) edge[bend right=5] node { } (.7,0.75); \path[-stealth,black] (1.4,1.1) edge[bend left=5] node { } (1.05,0.9); \path[-stealth,black] (1.5,1.25) edge[bend right=45] node { } (1.2,1.35); \path[-stealth,black] (1.15,1.4) edge[bend right=25] node { } (.9,1.2); \path[-stealth,black] (2.1,1) edge[bend right=5] node { } (2.15,.7); \path[-stealth,black] (2.1,.7) edge[bend right=15] node { } (2.2,.4); \path[-stealth,black] (2.2,.3) edge[bend right=45] node { } (2.45,.15); \path[-stealth,black] (2.5,.2) edge[bend right=15] node { } (2.8,.15); \path[-stealth,black] (3,.1) edge[bend right=5] node { } (3.4,.07); \path[-stealth,black] (2.2,.9) edge[bend right=5] node { } (2.5,.65); \path[-stealth,black] (2.55,.6) edge[bend right=5] node { } (2.8,.45); \path[-stealth,black] (2.95,.4) edge[bend right=5] node { } (3.3,.15); \path[-stealth,black] (3.25,.3) edge[bend right=5] node { } (3.7,.05); \path[-stealth,black] (2.3,.6) edge[bend right=5] node { } (2.7,.35); \path[-stealth,black] (2.7,.25) edge[bend right=5] node { } (3.1,.17); \path[-stealth,black] (3.5,.5) edge[bend left=5] node { } (3.8,.2); \path[-stealth,black] (3.1,.75) edge[bend left=5] node { } (3.4,.55); \path[-stealth,black] (2.6,1) edge[bend left=5] node { } (2.9,.8); \path[-stealth,black] (2.2,1.15) edge[bend left=5] node { } (2.5,1.0); \path[-stealth,black] (2.75,1.2) edge[bend left=5] node { } (3.15,.9); \path[-stealth,black] (2.8,1.4) edge[bend left=5] node { } (3.15,1.1); \path[-stealth,black] (2.35,1.2) edge[bend left=45] node { } (2.7,1.25); \path[-stealth,black] (2.75,1.45) edge[bend left=45] node { } (3.05,1.4); \path[-stealth,black] (3.2,1.1) edge[bend left=5] node { } (3.4,.8); \path[-stealth,black] (3.4,.7) edge[bend left=5] node { } (3.7,.4); \end{tikzpicture} \hspace{1cm} \begin{tikzpicture} \draw (0,0)--(4,0)--($(2,{2*sqrt(3)})$)--(0,0); \draw (0,0)--($(3,{sqrt(3)})$); \draw ($(2,{2*sqrt(3)})$)--(2,0); \draw ($(1,{sqrt(3)})$)--(4,0); \foreach \x in {1, 1.32, 1.64} \draw[stealth-,thick,black] ($(\x, {sqrt(3)*\x})$) -- ($(\x+ 0.35,{sqrt(3)*\x+ sqrt(3)*0.35})$); \foreach \x in {0, 0.32, 0.64} \draw[-stealth,thick,black] ($(\x, {sqrt(3)*\x})$) -- ($(\x+ 0.35,{sqrt(3)*\x+ sqrt(3)*0.35})$); \foreach \x in {3, 2.68, 2.36} \draw[stealth-,thick,black] ($(\x, {-sqrt(3)*\x+4*sqrt(3)})$) -- ($(\x- 0.35,{-sqrt(3)*\x+ 4*sqrt(3)+sqrt(3)*0.35})$); \foreach \x in {4, 3.68, 3.36} \draw[-stealth,thick,black] ($(\x, {-sqrt(3)*\x+4*sqrt(3)})$) -- ($(\x- 0.35,{-sqrt(3)*\x+ 4*sqrt(3)+sqrt(3)*0.35})$); \foreach \y in {1.2, 1.7, 2.3, 2.85} \draw[stealth-,thick,black] (2, \y) -- (2,\y+0.5); \foreach \y in {0, .28, .56,.84} \draw[-stealth,thick,black] (2, \y) -- (2,\y+0.3); \foreach \x in {2.02, 2.32, 2.64} \draw[stealth-,thick,black]($(\x, {1/3*sqrt(3)*\x})$) -- ($(\x+ 0.35,{1/3*sqrt(3)*\x+ 1/3*sqrt(3)*0.35})$); \foreach \x in {0, 0.5, 1,1.5} \draw[-stealth,thick,black] ($(\x, {1/3*sqrt(3)*\x})$) -- ($(\x+ 0.45,{1/3*sqrt(3)*\x+ 1/3*sqrt(3)*0.45})$); \foreach \x in {2.5,3,3.5,4} \draw[-stealth,thick,black] ($(\x, {-1/3*sqrt(3)*\x+4/3*sqrt(3)})$) -- ($(\x- 0.45,{-1/3*sqrt(3)*\x+ 4/3*sqrt(3)+1/3*sqrt(3)*0.45})$); \foreach \x in {1.95,1.65,1.35} \draw[stealth-,thick,black] ($(\x, {-1/3*sqrt(3)*\x+4/3*sqrt(3)})$) -- ($(\x- 0.35,{-1/3*sqrt(3)*\x+ 4/3*sqrt(3)+1/3*sqrt(3)*0.35})$); \draw (0,0) node[below]{$(0,0,1)$}; \draw (2,0) node[below]{$(0,\frac{1}{2},\frac{1}{2})$}; \draw (4,0) node[below]{$(0,1,0)$}; \draw (3,1.8) node[right]{$(\frac{1}{2},\frac{1}{2},0)$}; \draw ($(2,{2*sqrt(3)})$) node[above]{$(1,0,0)$}; \draw (1,1.8) node[left]{$(\frac{1}{2},0,\frac{1}{2})$}; \draw (2,-1) node[below]{Case $\theta <\frac{2}{3}$}; \path[stealth-,black] (2.1,1.6) edge[bend left=5] node { } (2.15,1.9); \path[stealth-,black] (2.5,1.6) edge[bend right=15] node { } (2.7,1.9); \path[stealth-,black] (2.5,2) edge[bend right=15] node { } (2.55,2.3); \path[stealth-,black] (2.1,2) edge[bend left=5] node { } (2.15,2.3); \path[stealth-,black] (2.3,2) edge[bend right=5] node { } (2.35,2.3); \path[stealth-,black] (2.35,2.4) edge[bend right=5] node { } (2.3,2.7); \path[stealth-,black] (2.15,2.4) edge[bend left=5] node { } (2.17,2.7); \path[stealth-,black] (2.15,2.8) edge[bend right=5] node { } (2.1,3.1); \path[stealth-,black] (2.2,1.4) edge[bend right=5] node { } (2.35,1.7); \path[stealth-,black] (2.25,1.7) edge[bend right=5] node { } (2.42,2); \path[stealth-,black] (1.82,1.8) edge[bend right=5] node { } (1.85,2.1); \path[stealth-,black] (1.82,2.2) edge[bend right=5] node { } (1.85,2.5); \path[stealth-,black] (1.6,2.3) edge[bend left=5] node { } (1.7,2.6); \path[stealth-,black] (1.75,2.7) edge[bend left=5] node { } (1.83,3); \path[stealth-,black] (1.88,2.8) edge[bend right=5] node { } (1.9,3.1); \path[stealth-,black] (1.4,2.1) edge[bend left=5] node { } (1.5,2.4); \path[stealth-,black] (1.7,1.55) edge[bend left=15] node { } (1.4,1.75); \path[stealth-,black] (1.3,1.75) edge[bend left=30] node { } (1.35,2.1); \path[stealth-,black] (1.6,1.8) edge[bend left=5] node { } (1.65,2.1); \path[stealth-,black] (1.82,1.4) edge[bend right=5] node { } (1.85,1.7); \path[stealth-,black] (1.9,1) edge[bend left= 15] node { } (1.8,.7); \path[stealth-,black] (1.75,.9) edge[bend left=5] node { } (1.45,.7); \path[stealth-,black] (1.4,.65) edge[bend left=5] node { } (1.1,.45); \path[stealth-,black] (.9,.35) edge[bend left=5] node { } (.6,.15); \path[stealth-,black] (.5,.15) edge[bend left=5] node { } (.2,.03); \path[stealth-,black] (1.8,.6) edge[bend left=30] node { } (1.6,.25); \path[stealth-,black] (1.5,.25) edge[bend left=10] node { } (1.2,.1); \path[stealth-,black] (1.1,.2) edge[bend left=10] node { } (0.8,.1); \path[stealth-,black] (.7,.1) edge[bend left=10] node { } (0.4,.035); \path[stealth-,black] (1.3,.4) edge[bend left=5] node { } (.95,.25); \path[stealth-,black] (1.7,.65) edge[bend left=5] node { } (1.4,.45); \path[stealth-,black] (.85,.7) edge[bend left=5] node { } (.5,.5); \path[stealth-,black] (.75,1.05) edge[bend right=5] node { } (.55,.65); \path[stealth-,black] (.4,.45) edge[bend left=1] node { } (.2,.2); \path[stealth-,black] (1.7,1.2) edge[bend left=5] node { } (1.4,1); \path[stealth-,black] (1.2,1.25) edge[bend right=30] node { } (.9,1.05); \path[stealth-,black] (1.2,.85) edge[bend right=5] node { } (.9,.65); \path[stealth-,black] (1,1) edge[bend right=5] node { } (.7,0.75); \path[stealth-,black] (1.4,1.1) edge[bend right=5] node { } (1.05,0.9); \path[stealth-,black] (1.5,1.25) edge[bend right=45] node { } (1.2,1.3); \path[stealth-,black] (1.15,1.4) edge[bend right=45] node { } (.9,1.2); \path[stealth-,black] (2.1,1) edge[bend right=5] node { } (2.15,.7); \path[stealth-,black] (2.1,.7) edge[bend right=15] node { } (2.2,.4); \path[stealth-,black] (2.2,.3) edge[bend right=45] node { } (2.45,.15); \path[stealth-,black] (2.5,.2) edge[bend right=15] node { } (2.8,.15); \path[stealth-,black] (3,.1) edge[bend right=5] node { } (3.4,.07); \path[stealth-,black] (2.2,.9) edge[bend right=5] node { } (2.5,.65); \path[stealth-,black] (2.55,.6) edge[bend right=5] node { } (2.8,.45); \path[stealth-,black] (2.95,.4) edge[bend right=5] node { } (3.3,.15); \path[stealth-,black] (3.25,.3) edge[bend right=5] node { } (3.7,.05); \path[stealth-,black] (2.3,.6) edge[bend right=5] node { } (2.7,.35); \path[stealth-,black] (2.7,.25) edge[bend right=5] node { } (3.1,.17); \path[stealth-,black] (3.5,.5) edge[bend left=5] node { } (3.8,.2); \path[stealth-,black] (3.1,.75) edge[bend left=5] node { } (3.4,.55); \path[stealth-,black] (2.6,1) edge[bend left=5] node { } (2.9,.8); \path[stealth-,black] (2.2,1.15) edge[bend left=5] node { } (2.5,1.0); \path[stealth-,black] (2.75,1.2) edge[bend left=5] node { } (3.15,.9); \path[stealth-,black] (2.8,1.4) edge[bend left=5] node { } (3.15,1.1); \path[stealth-,black] (2.35,1.2) edge[bend left=45] node { } (2.7,1.25); \path[stealth-,black] (2.7,1.4) edge[bend left=45] node { } (3.05,1.4); \path[stealth-,black] (3.2,1.1) edge[bend left=5] node { } (3.4,.8); \path[stealth-,black] (3.2,.85) edge[bend left=5] node { } (3.5,.6); \end{tikzpicture} \caption{Trajectories of $V_\theta$: the dynamics is different for $\theta > \frac{2}{3}$ and $\theta < \frac{2}{3}$. }\label{f:dyn} \end{figure} Figure~\ref{f:dyn} indicates the different dynamics of $V_\theta$ for $\theta < \frac{2}{3}$ and $\theta>\frac{2}{3}$. See \cite{JKL17}. For $\theta < \frac{2}{3}$, $C$ is attracting, $\mathbf{e}_1$ is repelling. Moreover, positive orbits in $\mathrm{int}(G_1)$ converge to $C$. For $\theta>\frac{2}{3}$ the stability of the fixed point is reversed, so $C$ is repelling, $\mathbf{e}_1$ is attracting and positive orbits in $\mathrm{int}(G_1)$ converge to $\mathbf{e}_1$. The fixed point $c$ is still a saddle fixed point for all $\theta \ne \frac{2}{3}$. \section{{Main results}} \label{sec:mainresult} Let $\mu$ be a probability measure on $[0,1]$ equipped with the Borel $\sigma$-algebra and let $\Theta_n,\,n \in \Z$ be a two-sided sequence of independent $[0,1]$-valued random variables with law $\mu$. A sequence of random parameters $\Theta_n$ yields an element $\omega \in \Omega = [0,1]^\mathbb{Z}$. Denote the left shift operator on $\Omega$ by $\vartheta$: if $\omega = (\Theta_n)_{n\in\mathbb{Z}}$, then $\vartheta \omega = (\Theta_{n+1})_{n\in\mathbb{Z}}$. The family $V_{\Theta_n}$, $n \in \Z$ is a family of independent and identically distributed maps taking values in $\Delta^2$ equipped with the topology inherited by $\R^2$, which defines a discrete {\em random dynamical system} (RDS) $\varphi_n (x,\omega) := V_{\Theta_n}\circ \cdots \circ V_{\Theta_1} (x)$ for $n \ge 0$ and $\varphi_{n} (\omega,x):= V_{\Theta_{n+1}}^{-1} \circ \cdots \circ V_{\Theta_0}^{-1} (x)$ for $n < 0$. We also write $\varphi_n (x)$, suppressing the dependence on $\omega$ from the notation. If $\Theta$ is a random variable with distribution $\mu$, then we write $\EE g(\Theta)$ for the expected value of $g(\Theta)$ instead of $\int g(y)\,\dd \mu(y)$ in case $g$ is a measurable function for which the integral is defined (possibly $\infty$ or $-\infty$). We aim to identify the long term dynamics, in particular the forward point attractor, of the RDS $\varphi$. A set $A \subset \Delta^2 \times \Omega$ is a forward point attractor if \begin{enumerate} \item $A$ is a compact random set, i.e. $A(\omega) = A \cap (\Delta^2 \times \{\omega\})$ is a nonempty compact set so that $d(x , A(\omega))$ depends measurably on $\omega$ for any $x \in \Delta^2$; \item $A$ is strictly $\varphi_n$-invariant, i.e. \[ \varphi_n (A (\omega)) = A (\vartheta^n \omega) \] almost surely; \item $A$ attracts points, i.e. \[ \lim_{n\to \infty} d (\varphi_n (x) , A (\vartheta^n \omega)) = 0 \] almost surely, for every $x \in \Delta^2$. \end{enumerate} A forward point attractor is called minimal if it is the minimal set with these properties. It is shown in \cite{CS} that minimal point attractors in the weak or pullback sense always exist. For forward point attractors this question is open but in the particular set-up of the following theorem we will see that a minimal forward point attractor exists. The following result describes the minimal forward point attractor of the RDS $\varphi$. We will exclude the very special (and uninteresting) case $\mu(\{2/3\})=1$ which means that $\varphi_{n}=\mathrm{Id}$ almost surely for every $n \in \Z$. \begin{theorem}\label{t:A} Let $\mu \neq \delta_{2/3}$ be a probability measure on $[0,1]$. Then the minimal forward point attractor of the RDS $\varphi$ is given by $\A$. Moreover, every trajectory converges almost surely (to one of the points in the set $\A$). \end{theorem} \begin{proof} Since the set of fixed points of $V_\theta$ contains $\A$ for every $\theta \in [0,1]$ it follows that $\A$ is almost surely contained in any forward (and in any pullback or weak) point attractor. To show the converse inclusion, let $x \in \Delta^2$. We need to show that $V_{\Theta_n}\circ \cdots \circ V_{\Theta_1}(x)$ converges to the set $\A$ almost surely. By symmetry it suffices to consider the RDS on $G_1$. We start with calculations of the Lyapunov exponents at the vertices $\mathbf{e}_1,c,C$ of $G_1$. Recall that a Lyapunov exponent at a point $x$ is a limit point $\lim_{n\to\infty} \frac{1}{n} \log \| D ( V_{\Theta_n}\circ \cdots \circ V_{\Theta_1}) (x) v \|$ for a $v \ne 0$, and is used to determine expected contraction or expansion rates of nearby trajectories. See \cite{A98}. Write $(V_\theta(x))_1 = x_1 W_1 (x)$. Consider the permutation $\sigma (x_1,x_2,x_3) = (x_2,x_3,x_1)$ and let $W_2 =W_1 \circ \sigma$, $W_3 = W_1\circ \sigma^2$. With this notation, \[ D V_\theta (x) = \left( \begin{array}{ccc} W_1 (x) + x_1 \frac{\partial}{\partial x_1} W_1 (x) & x_1 \frac{\partial}{\partial x_2} W_1 (x) & x_1 \frac{\partial}{\partial x_3} W_1 (x) \\ x_2 \frac{\partial}{\partial x_1} W_2 (x) & W_2 + x_2 \frac{\partial}{\partial x_2} W_2 (x) & x_1 \frac{\partial}{\partial x_3} W_2(x) \\ x_3 \frac{\partial}{\partial x_1} W_3 (x) & x_3 \frac{\partial}{\partial x_2} W_3 (x) & W_3 (x) + x_3 \frac{\partial}{\partial x_3} W_3 (x) \end{array} \right). \] A calculation shows \begin{align*} D V_\theta (C) &= \left( \begin{array}{ccc} \frac{11}{9} + \frac{2}{3}\theta & \frac{8}{9} - \frac{1}{3}\theta & \frac{8}{9} - \frac{1}{3} \theta \\ \frac{8}{9} - \frac{1}{3}\theta & \frac{11}{9} + \frac{2}{3}\theta & \frac{8}{9} - \frac{1}{3}\theta \\ \frac{8}{9} - \frac{1}{3}\theta & \frac{8}{9} - \frac{1}{3}\theta & \frac{11}{9} + \frac{2}{3}\theta \end{array} \right), \end{align*} \[ D V_\theta (c) = \left( \begin{array}{ccc} \frac{3}{2} + \frac{3}{4}\theta & \frac{3}{2} - \frac{3}{4}\theta & \frac{1}{2} + \frac{3}{4} \theta \\ \frac{3}{2} - \frac{3}{4}\theta & \frac{3}{2} + \frac{3}{4}\theta & \frac{1}{2} + \frac{3}{4} \theta \\ 0 & 0 & 2 - \frac{3}{2} \theta \end{array} \right), \] \[ D V_\theta (\mathbf{e}_1) = \left( \begin{array}{ccc} 3 & 3\theta & 3 \theta \\ 0 & 3 (1-\theta) & 0 \\ 0 & 0 & 3 (1-\theta) \end{array} \right). \] By $S_3$-equivariance, $D V_\theta (C)$ acting on $T_C \Delta^2$ is a multiple of the identity. At $C$, $DV_\theta (C)$ has a multiple eigenvalue; a calculation shows the eigenvalue is $\frac{1}{3} + \theta$. Likewise $D V_\theta (\mathbf{e}_1)$ is a multiple of the identity on $T_{\mathbf{e}_1} \Delta^2$ with eigenvalue $3 (1-\theta)$. By $S_3$-equivariance, $DV_\theta (c)$ on $T_c \Delta^2$ is diagonalizable. The two eigenvalues are $\frac{3}{2} \theta$ with eigenvector $(1,-1,0)$ and $2 - \frac{3}{2} \theta$ with eigenvector $(1,1,-2)$. Note that zero eigenvalues occur for $\theta = 0$ at $c$ and for $\theta=1$ at $\mathbf{e}_1$. We now prove that the RDS has negative Lyapunov exponents at at least one of the vertices $\mathbf{e}_1$, $C$. By Birkhoff's ergodic theorem, the Lyapunov exponents at $\mathbf{e}_1$ and $C$ equal $\EE \log (3 (1-\Theta))$ and $\EE \log (\frac{1}{3} + \Theta)$ respectively. Using Jensen's inequality, we find that \begin{align*} \EE \log (3 (1-\Theta))& \le \log (3 (1-\EE \Theta)), \\ \EE \log \big(\frac{1}{3} + \Theta\big)&\le \log \big(\frac{1}{3} + \EE \Theta\big). \end{align*} If $\EE \Theta \neq 2/3$, then exactly one of the two expressions on the right hand side is (strictly) negative. If $\EE \Theta=2/3$, then both expressions on the right hand side are zero and both inequalities are in fact strict due to the assumption $\mu \neq \delta_{2/3}$. Therefore at least one of $\EE \log(3 (1-\Theta))$ and $\EE \log(\frac{1}{3} + \Theta)$ is (strictly) negative. We conclude that either $\mathbf{e}_1$, or $C$, or both, have negative Lyapunov exponents. It remains to prove that for $x \in G_1$, $\varphi_n (x)$ converges to one of the equilibria in $\{ \mathbf{e}_1, c, C\}$. Consider $x \in \mathrm{int}(G_1)$. Let $\ast \in \{ \mathbf{e}_1, c, C\}$. Assume that the RDS has negative Lyapunov exponents at $\ast$. By the local stable manifold theorem \cite[Theorem~(5.1)]{R79}, if $\mathcal{U}$ is a small neighborhood of $\ast$ and $x \in \mathrm{int}(G_1) \cap \mathcal{U}$, we have $\PP (\lim_{n\to\infty} \varphi_n (x) = \ast) \ge \varepsilon$ for some $\varepsilon>0$. Note that the integrability condition to apply \cite[Theorem~(5.1)]{R79} is satisfied, compare \cite{SV}. By Lemma~\ref{l:lyapgezero}, if the RDS has nonnegative Lyapunov exponents at $\ast$, then $\PP (\varphi_n (x) \not \in \mathcal{U} \textrm{ for some }n\in \mathbb{N}) = 1$. It is further clear that, if $\mathcal{V}$ is the complement in $\mathrm{int}(G_1)$ of a small neighborhood of $\{ \mathbf{e}_1, c, C\}$, for $x \in \mathcal{V}$ we have $\PP (\varphi_n (x) \not \in \mathcal{V} \textrm{ for some }n\in \mathbb{N}) = 1$. These properties and the observation that at least one equilibrium in $\{ \mathbf{e}_1, c, C\}$ has negative Lyapunov exponents together easily imply that for $x \in \mathrm{int}(G_1)$, $\varphi_n (x)$ converges to one of the equilibria in $\{ \mathbf{e}_1, c, C\}$ with probability one. The same type of reasoning can be used for the RDS restricted to the invariant edges $M_{12}, M_{23}, \Gamma_{12}$ of $G_1$. Consider for instance $M_{12}$. Then the RDS restricted to $M_{12}$ has a Lyapunov exponent $\EE \log(2 - \frac{3}{2}\Theta)$ at $c$ and a Lyapunov exponent $\EE\log(\frac{1}{3}+\Theta)$ at $C$. As above, one of these Lyapunov exponents is negative. The above reasoning can now be followed. \end{proof} The previous theorem does not provide any information about the stability of the points in the set $\A$. Ideally, we would like to identify, for each $x \in \Delta^2$, the smallest (deterministic) subset $A (x)$ of $\A$ for which \[ \PP \big( \lim_{n \to \infty} d(\varphi_n(x),A(x)) = 0 \big) > 0. \] Of course, for each $x \in \A$ we have $A(x)=\{x\}$, but what about other $x \in \Delta^2$? By symmetry, it suffices to consider $x \in G_1$. It will turn out that the set $A(x)$ depends on the distribution $\mu$. We have the following result. \begin{theorem} \label{t:A(x)} Assume $\mu \neq \delta_{2/3}$. \begin{itemize} \item[a)] For $x \in \mathrm{int}(G_1)$, we have \begin{itemize} \item[i)] $\mathbf{e}_1 \in A(x)$ iff $\EE \log \big( 3(1-\Theta)\big) <0$; \item[ii)] $c \in A(x)$ iff both $\EE \log \big( \frac{3}{2} \Theta \big) <0$ and $\EE \log \big( 2 - \frac{3}{2} \Theta \big) <0$; \item[iii)] $C \in A(x)$ iff $\EE \log \big( \frac{1}{3} + \Theta \big) <0$. \end{itemize} \item[b)] For $x \in M_{12} \setminus \{ C,c\}$, we have \begin{itemize} \item[i)] $C \in A(x)$ iff $\EE \log \big( \frac{1}{3} + \Theta \big) <0$; \item[ii)] $c \in A(x)$ iff $\EE \log \big( 2 - \frac{3}{2} \Theta \big) <0$. \end{itemize} \item[c)] For $x \in M_{23}\setminus \{\mathbf{e}_1,C\} $, we have \begin{itemize} \item[i)] $\mathbf{e}_1 \in A(x)$ iff $\EE \log \big( 3(1-\Theta)\big) <0$; \item[ii)] $C \in A(x)$ iff $\EE \log \big( \frac{1}{3} + \Theta \big) <0$. \end{itemize} \item[d)] For $x \in \Gamma_{12}\setminus \{ \mathbf{e}_1,c\}$, we have \begin{itemize} \item[i)] $\mathbf{e}_1 \in A(x)$ iff $\EE \log \big( 3(1-\Theta)\big) <0$; \item[ii)] $c \in A(x)$ iff $\EE \log \big( \frac{3}{2} \Theta \big) <0$. \end{itemize} \end{itemize} \end{theorem} Before proving the theorem, let us consider some special cases. Take an iterated function system where $\mu$ is supported on two values $\theta - \frac{1}{10}, \theta+\frac{1}{10}$ for a parameter $\theta$: $\mu = \frac{1}{2} \delta_{\theta - \frac{1}{10}} + \frac{1}{2}\delta_{\theta+\frac{1}{10}}$. If $\theta < \frac{2}{3} - \frac{1}{10}$, $C$ is an attracting vertex for both maps $V_{\theta-\frac{1}{10}}$ and $V_{\theta + \frac{1}{10}}$. If $\theta > \frac{2}{3} + \frac{1}{10}$, $\mathbf{e}_1$ is an attracting vertex for both maps $V_{\theta-\frac{1}{10}}$ and $V_{\theta + \frac{1}{10}}$. In both cases the dynamics of the iterated function system is clear. Transitions in the dynamics will take place if $\theta$ runs from $\frac{2}{3}-\frac{1}{10}$ to $\frac{2}{3} + \frac{1}{10}$. We base our observations on Figure~\ref{f:lyap} that shows graphs of the Lyapunov exponents at the three vertices $c,C,\mathbf{e}_1$. From this we see that for varying $\theta$ there are intervals where subsequently $\{ C\}$, $\{ C,\mathbf{e}_1\}$, $\{ C,\mathbf{e}_1,c\}$, $\{c,\mathbf{e}_1\}$ and $\{\mathbf{e}_1\}$ are the vertices with negative maximal Lyapunov exponent. Boundary points of these intervals are parameter values with zero Lyapunov exponent at a vertex. In particular there is an open interval of parameter values where all three vertices have negative Lyapunov exponents. This gives rise to intermingled basins (see \cite{kan94}) for the basins of three attractors: every point in $\mathrm{int(G_1)}$ has positive probability to converge to each of the three vertices of $G_1$. Compare \cite{GH} for the context of iterated function systems on an interval and an explanation of the terminology. Remarkably, the random system can converge to $c$ with positive probability for every starting point $x\in \mathrm{int}(G_1)$, while this convergence is not possible for the deterministic system. \begin{figure}[!ht] \begin{center} \includegraphics[width=12cm]{lyap} \caption{Graphs of Lyapunov exponents at the three vertices $c,C,\mathbf{e}_1$. The two solid curves depict two Lyapunov exponents of the random saddle $c$, the increasing dashed curve depicts the Lyapunov exponent of $C$ (the two exponents are equal) the remaining decreasing dash-dotted curve depicts the Lyapunov exponent of $\mathbf{e}_1$ (the two exponents are equal). \label{f:lyap}} \end{center} \end{figure} Assume that $\mu$ is Lebesgue measure, so that $\Theta$ is chosen uniformly from $[0,1]$. A calculation gives the following identities: \begin{align*} \EE \log (3(1-\Theta)) &= \log(3) - 1 > 0, \\ \EE \log(\frac{3}{2} \Theta) &= \log(\frac{3}{2})-1 < 0, \\ \EE \log(2-\frac{3}{2}\Theta) &= \frac{5}{3}\log(2)-1>0, \\ \EE \log(\frac{1}{3} + \Theta) &= \log (\frac{4}{3} 2^{2/3})-1 < 0. \end{align*} It follows that for any $x \in \textrm{int}(G_1)$, $\varphi_n (x)$ converges to the center point $C$ almost surely, as $n\to \infty$. Assume that $\Theta$ is uniformly distributed on $[\frac{2}{3}-a,\frac{2}{3}+a]$, $0<a\le \frac{1}{3}$, so that $\EE \Theta = \frac{2}{3}$. Since $\log(x)$ is a concave function, $\EE \log (3(1-\Theta))$, $\EE \log(\frac{3}{2} \Theta)$, $\EE \log(2-\frac{3}{2}\Theta)$ and $\EE \log(\frac{1}{3} + \Theta)$ are all negative. The situation is similar to the example of the iterated function system. For any $x \in \mathrm{int}(G_1)$, trajectories $\varphi_n (x)$ converge almost surely and each point $\mathbf{e}_1,c,C$ occurs as limit point with positive probability. \begin{proof}[Proof of Theorem~\ref{t:A(x)}] We will only prove item~a). The proof of item~a) gives all the ingredients for the other items, which can then easily be concluded. Let us first consider the vertex $\mathbf{e}_1$. Recall from the proof of Theorem~\ref{t:A} that at $\mathbf{e}_1$ the Lyapunov exponents equal $\EE \log (3 (1-\Theta))$. So the condition $\EE \log (3 (1-\Theta)) <0$ means that the Lyapunov exponents at $\mathbf{e}_1$ are negative. The following statement was already observed in the proof of Theorem~\ref{t:A} and is a consequence of the local stable manifold theorem. For $\varepsilon >0$ small and $x \in B_\varepsilon (\mathbf{e}_1) = \{ x \in G_1 \; ; \; d (x,\mathbf{e}_1) < \varepsilon \}$, \[ \PP \big( \lim_{n \to \infty} d(\varphi_n(x), \mathbf{e}_1) = 0 \big) > 0. \] That is, $\mathbf{e}_1 \in A(x)$ for $x \in B_\varepsilon (\mathbf{e}_1)$. It now follows from Lemma~\ref{l:Asaddle} that $\mathbf{e}_1 \in A(x)$ for all $x \in \mathrm{int}(G_1)$. Lemma~\ref{l:lyapgezero} demonstrates that $\mathbf{e}_1 \not\in A(x)$ in case $\EE \log (3 (1-\Theta)) \ge 0$. We conclude that for $x \in \mathrm{int} (G_1)$, $\mathbf{e}_1 \in A(x)$ iff $\EE \log \big( 3(1-\Theta)\big) <0$. The same reasoning can be followed for the edge $C$, so that for any $x \in \mathrm{int}(G_1)$ we have that $C \in A(x)$ precisely if $\EE \log (\frac{1}{3} + \Theta) < 0$. The random saddle point $c$ is more difficult to treat. By earlier calculations, the Lyapunov exponents at $c$ are $\EE \log \big( \frac{3}{2} \Theta \big)$ and $\EE \log \big( 2 - \frac{3}{2} \Theta \big)$. Under the condition of negative Lyapunov exponents at $c$, the support of $\mu$ has nonempty intersection with both $[0,\frac{2}{3})$ and $(\frac{2}{3},1]$. Lemma~\ref{l:Asaddle} provides, for given $x \in \mathrm{int}(G_1)$ and $\varepsilon>0$, an integer $N\in \mathbb{N}$ so that \[ \PP \big( d(\varphi_N(x), c) < \varepsilon \big) > 0. \] As before we conclude that for any $x \in \mathrm{int}(G_1)$, we find $c \in A(x)$ under the assumption that both Lyapunov exponents at $c$ are negative. If one of the Lyapunov exponents is nonnegative, $c \not\in A(x)$ by Lemma~\ref{l:lyapgezero}. \end{proof} The following lemma is specific to the family $V_\theta$ and an ingredient for the proof of Theorem~\ref{t:A(x)}. \begin{lemma}\label{l:Asaddle} Assume the support of $\mu$ intersects $[0,\frac{2}{3})$. Then for any $\varepsilon>0$ and $x \in \mathrm{int} (G_1)$, there exists $N \in \mathbb{N}$ with \[ \PP \big( d(\varphi_N(x), C) < \varepsilon \big) > 0. \] Assume the support of $\mu$ intersects $(\frac{2}{3},1]$. Then for any $\varepsilon>0$ and $x \in \mathrm{int} (G_1)$, there exists $N \in \mathbb{N}$ with \[ \PP \big( d(\varphi_N(x), \mathbf{e}_1) < \varepsilon \big) > 0. \] Assume the support of $\mu$ intersects both $[0,\frac{2}{3})$ and $(\frac{2}{3},1]$. Then for any $\varepsilon>0$ and $x \in \mathrm{int} (G_1)$, there exists $N \in \mathbb{N}$ with \[ \PP \big( d(\varphi_N(x), c) < \varepsilon \big) > 0. \] \end{lemma} \begin{proof} Consider first the fixed point $\mathbf{e}_1$. It follows from \cite{JKL17} that for $x \in \mathrm{int}(G_1)$ there exists $\theta$ in the support of $\mu$ and $N\in\mathbb{N}$ so that $V_\theta^N (x) \in B_\varepsilon(\mathbf{e}_1)$. By continuity of $V_\theta$ in $\theta$, we find that for given $x \in \mathrm{int}(G_1)$ there is $N\in\mathbb{N}$ so that $ \PP \big( d(\varphi_N(x), \mathbf{e}_1) < \varepsilon \big) > 0. $ The statement on $C$ goes similarly. To prove the statement on $c$, we start with an analysis of random iterates near $C$. Put $x_3 = 1 - x_1 - x_2$ in $V_\theta$ and consider the resulting map \begin{align*} F_\theta(x_1,x_2) &= \\ \MoveEqLeft \left( \begin{array}{c} x_1 \left( x_1^2 + 3 \theta x_1 (1-x_1) + 3(1-\theta) (x_2^2 + (1-x_1-x_2)^2) + 2 x_2(1-x_1-x_2)\right) \\ x_2 \left(x_2^2 + 3 \theta x_2(1-x_2) + 3(1-\theta) (x_1^2 + (1-x_1-x_2)^2) + 2 x_1 (1-x_1-x_2) \right) \end{array} \right). \end{align*} Compute $DF_\theta (\frac{1}{3},\frac{1}{3}) = (\frac{1}{3} + \theta) \left( \begin{array}{cc} 1 & 0 \\ 0 & 1 \end{array}\right) $. The Hessian of the first component $F_{\theta,1}$ of $F$ equals \[ \frac{1}{3} (4- 6 \theta) \left( \begin{array}{cc} -1 & 1 \\ 1 & 2 \end{array}\right). \] Likewise the Hessian of $F_{\theta,2}$ equals \[ \frac{1}{3} (4- 6 \theta) \left( \begin{array}{cc} 2 & 1 \\ 1 & -1 \end{array}\right). \] So the second order Taylor expansion of $F_\theta$ around $(\frac{1}{3},\frac{1}{3})$ equals, in terms of $x = x_1-\frac{1}{3}, y = x_2 - \frac{1}{3}$, \[ T_\theta (x,y) = (\frac{1}{3} + \theta) \left( \begin{array}{c} x \\ y \end{array} \right) + \frac{1}{3} (2 - 3 \theta) \left( \begin{array}{c} - x^2 + 2xy + 2y^2 \\ 2x^2 + 2xy - y^2 \end{array} \right). \] Denote $\lambda_\theta = \frac{1}{3} + \theta$. Write $T_\theta (x,y) = \lambda_\theta \left( \begin{array}{c} x \\ y \end{array} \right) + P_\theta (x,y)$. Consider a local coordinate transformation $H_\theta (x,y) = \left( \begin{array}{c} x \\ y \end{array} \right) + U_\theta (x,y)$ with $U_\theta (x,y) = \frac{-1}{\lambda_\theta - \lambda_\theta^2} P_\theta (x,y)$.\\ Calculate \begin{align*} H_\theta^{-1} \circ F_\nu \circ H_\theta (x,y) &= H_\theta^{-1} \left[ \lambda_\nu H_\theta (x,y) + P_\nu \circ H_\theta(x,y) \right] \\ &= H_\theta^{-1} \left[ \lambda_\nu \left( \begin{array}{c} x \\ y \end{array} \right) + \lambda_\nu U_\theta (x,y) + P_\nu (x,y) + \mathcal{O}(3) \right] \\ &= \lambda_\nu \left( \begin{array}{c} x \\ y \end{array} \right) + \lambda_\nu U_\theta (x,y) - U_\theta (\lambda_\nu (x,y)) + P_\nu (x,y) + \mathcal{O}(3) \\ &= \lambda_\nu \left( \begin{array}{c} x \\ y \end{array} \right) + (\lambda_\nu - \lambda_\nu^2) U_\theta (x,y) + P_\nu (x,y) +\mathcal{O}(3) \\ &= \lambda_\nu \left( \begin{array}{c} x \\ y \end{array} \right) + P_\nu (x,y) - \frac{\lambda_\nu - \lambda_\nu^2}{\lambda_\theta - \lambda_\theta^2} P_\theta (x,y)+\mathcal{O}(3). \end{align*} Here $\mathcal{O}(3)$ stands for terms of at least third order in $(x,y)$. Consequently $H_\theta^{-1} \circ F_\theta \circ H_\theta$ is linear up to quadratic order. We note that there is in fact a coordinate change, equal to $H_\theta$ up to quadratic order, that smoothly linearizes $F_\theta$. The formulas show the effect of the same coordinate change $H_\theta$ on $F_\nu$. Consider lines $y = kx$ with $-\frac{1}{2} \le k \le 1$. The line with $k=-\frac{1}{2}$ contains $M_{23}$, the line with $k=1$ contains $M_{12}$. So the collection of lines covers $G_1$. We will calculate $Q_\nu = H_\theta^{-1} \circ F_\nu \circ H_\theta$ in the point $(x,kx)$. Note first \begin{align*} Q_\nu (x,y) &= (\frac{1}{3} + \nu) \left( \begin{array}{c} x \\ y \end{array} \right) + \\ & \qquad \left[ \frac{1}{3} (2-3\nu) - \frac{ (\frac{1}{3} + \nu) - (\frac{1}{3} + \nu)^2}{ (\frac{1}{3} + \theta) - (\frac{1}{3} + \theta)^2} \frac{1}{3} (2-3\theta) \right] \left( \begin{array}{c} -x^2 + 2 xy + 2y^2 \\ 2 x^2 + 2xy - y^2 \end{array} \right), \end{align*} ignoring terms of order three. The expression on the right hand side can be simplified to \begin{align*} Q_\nu (x,y) &= (\frac{1}{3} + \nu) \left( \begin{array}{c} x \\ y \end{array} \right) + \frac{1}{3} (2 - 3 \nu) \left[ \frac{\theta - \nu}{\frac{1}{3} + \theta} \right] \left( \begin{array}{c} -x^2 + 2 xy + 2y^2 \\ 2 x^2 + 2xy - y^2 \end{array} \right). \end{align*} So \begin{align*} Q_\nu (x,kx) &= (\frac{1}{3} + \nu) \left( \begin{array}{c} x \\ kx \end{array} \right) + \frac{1}{3} (2 - 3 \nu) \left[ \frac{\theta - \nu}{\frac{1}{3} + \theta} \right] x^2 \left( \begin{array}{c} -1 + 2 k + 2k^2 \\ 2 +2k - k^2 \end{array} \right). \end{align*} It follows that a point $(x,kx)$ is mapped to a point $(u, v)$ with \[ v/u = k - x \left( \frac{1}{3} (2-3\nu) \frac{\theta-\nu}{(\frac{1}{3} + \nu) (\frac{1}{3} + \theta)} \right) (k-1) (2k+1) (k+2) + \mathcal{O}(2) (k-1)(2k+1), \] where $\mathcal{O}(2)$ here are terms of at least quadratic order in $x$. Assume $\frac{2}{3} < \theta < 1$ (so that $C$ is unstable for $V_\theta$) and $\nu < \frac{2}{3}$ ($C$ is stable for $V_\nu$). This is possible by the assumption on the support of $\mu$. We then find that (for $x>0$ small and $-\frac{1}{2}<k<1$) $v/u > k$. Take a fundamental domain $D = B_\delta(C) \setminus V^{-1}_\theta (B_\delta (C))$ for $V_\theta$. Here $\delta$ is a small positive number, so that $D$ is close to $\mathbf{e}_1$. Take any $p \in \textrm{int} (G_1)$. A number of iterates $V_\nu^N$ maps $p$ to a point close to $C$, which we may assume to be in $D$ by composing with iterates of $V_\theta$ if needed. For $q \in D$ and $N > 0$, let $M \in \mathbb{N}$ be so that $V_\theta^M \circ V_\nu^N (q) \in D$. If $N$ is large enough we know $M>0$. By the previous calculations, if $q$ lies on the line $y = kx$ then $V_\theta^M \circ V_\nu^N (q)$ lies on a line $y = \ell x$ for $\ell > k$. Several such compositions map a point in $D$ to a point still in $D$ but now close to $M_{12}$ (namely on a line $y = \ell x$ for an $\ell$ close to $1$). Finally, there is an iterate $V_\theta^O$ that maps the last point to a point close to $c$. By continuity of the maps $V_\theta$ in $\theta$, the same holds true if we take nearby parameter values from small balls around $\nu$ and $\theta$. \end{proof} The next lemma discusses consequences of positive or vanishing Lyapunov exponents at the fixed points. The analysis of dynamics near a fixed point with vanishing Lyapunov exponents is the more delicate case, compare also the study of random interval diffeomorphisms in \cite{GH}. \begin{lemma}\label{l:lyapgezero} Assume $\EE \log (3 (1-\Theta)) \ge 0$. Let $x \in \mathrm{int}(G_1)$. For $\varepsilon>0$ small, \[ \PP ( d(\varphi_n(x) ,\mathbf{e}_1) > \varepsilon \textrm{ for some } n \in \mathbb{N}) = 1. \] Assume $\EE \log (\frac{1}{3} + \Theta) \ge 0$. Let $x \in \mathrm{int}(G_1)$. For $\varepsilon>0$ small, \[ \PP ( d(\varphi_n(x) , C) > \varepsilon \textrm{ for some } n \in \mathbb{N}) = 1. \] Assume $\EE \log (\frac{3}{2} \Theta) \ge 0$ or $\EE \log (2 - \frac{3}{2} \Theta) \ge 0$. Let $x \in \mathrm{int}(G_1)$. For $\varepsilon>0$ small, \[ \PP ( d(\varphi_n(x) , c) > \varepsilon \textrm{ for some } n \in \mathbb{N}) = 1. \] \end{lemma} \begin{proof} We first prove the statement on $\mathbf{e}_1$. Let $r (x) $ be the Euclidean distance of $x$ to $\mathbf{e}_1$. Define $s:\mathrm{int}(G_1)\times [0,1] \to (0, \infty]$ such that \begin{align}\label{e:logr} \log r (V_\theta (x)) &= \log r (x) + \log (3 (1-\theta)) + \log s (x,\theta). \end{align} Then, denoting $\delta:=1-x_1$ and $\gamma:=1-\theta$, we get $$ s^2(x,\theta)=\frac 1{9\gamma^2 r^2(x)}\Big(\Big(1-\big(V_\theta (x)\big)_1\Big)^2+\Big(\big(V_\theta (x)\big)_2\Big)^2+ \Big(\big(V_\theta (x)\big)_3\Big)^2\Big), $$ where \begin{align*} 1-\big(V_\theta (x)\big)_1&=f_1(x)+\gamma g_1(x),\\ \big(V_\theta (x)\big)_2&=f_2(x)+\gamma g_2(x),\\ \big(V_\theta (x)\big)_3&=f_3(x)+\gamma g_3(x), \end{align*} with \begin{align*} f_1(x)&=3\delta^2 - 2\delta^3 - 2 (1-\delta)x_2x_3, \\ g_1(x)&=3(1-\delta)(\delta-r^2(x)), \\ f_2(x)&=x_2^3+3x_2^2(x_3+1-\delta)+2x_3(1-\delta)x_2,\\ g_2(x)&=3x_2\big(x_3^2+(1-\delta)^2-x_2(x_3+1-\delta)\big),\\ f_3(x)&=x_3^3+3x_3^2(x_2+1-\delta)+2x_3(1-\delta)x_2, \\ g_3(x)&=3x_3\big(x_2^2 +(1-\delta)^2 -x_3(x_2+1-\delta)\big). \end{align*} Note that $f_i(x)\ge 0$ for all $i \in \{1,2,3\}$ and $x \in \mathrm{int}(G_1)$ (consider the case $\gamma=0$). Also, $g_i (x) \ge 0$ for all $i \in \{1,2,3\}$, at least for $r(x)$ small. Therefore, \begin{align*} s^2(x,\theta)&\ge s^2(x,0)=\frac 1{9r^2(x)}\sum_{i\in \{1,2,3\}} (f_i(x)+g_i(x))^2 \\ &\ge\frac 1{9r^2(x)} \Big(9\delta^2 + 9 x_2^2 + 9x_3^2-O(r^4(x))\Big)=1-O(r^2(x)). \end{align*} We can therefore define $t(w) = -Ce^{w}$ with $C>0$ so that $t(\log r(x)) \le \log s(x,\theta)$ for all $\theta$ and $r(x) < \varepsilon$. Here $A_0 = \log (\varepsilon)$ is assumed to be a large negative number. Consider the random walk on the line \begin{align}\label{e:rww} w_{n+1} = w_n + \log(3(1-\Theta_{n+1})) + t (w_n). \end{align} We compare orbits of \eqref{e:rww} with $\varphi_n (x)$. Whenever $w_i < \log (\varepsilon)$, $0 \le i \le n$ and $w_{n+1} > \log (\varepsilon)$, we have $r(\varphi_{n+1} (x)) >\varepsilon$. So we must show that there exists some $A_0 \in \R$ such that for every deterministic initial condition $w_0 < A_0$, we have \[ \PP(w_n \ge A_0 \textrm{ for some } n \in \mathbb{N}) = 1. \] This is standard if $\EE \log(3(1-\Theta)) >0$. We assume now the case of vanishing Lyapunov exponents $\EE \log(3(1-\Theta)) = 0$. Fix $A_0 \le -1$ and consider the stopped walk $W_{n}:=w_{n\wedge \tau}$, where $\tau:= \inf\{m \in \N:\,w_m\ge A_0\}$. We define the {\em Lyapunov function} $V(x)=\log (-x)$, $x \le -1$. We claim that \begin{equation}\label{supermart} \EE \big(V(W_{n+1})|\F_n\big) \le V(W_n) \mbox{ a.s.~on the set } \{W_n<A_0\}, \end{equation} where $\F_n$ denotes the $\sigma$-algebra generated by $W_1,\,W_2,\cdots,W_n$. This means that the process $n \mapsto W_n$ is a nonnegative supermartingale which therefore converges almost surely to an integrable random variable $W_\infty$ which immediately implies that $\tau<\infty$ almost surely since $\log(3(1-\Theta))$ is not deterministic.\\ Let us prove \eqref{supermart}. All we have to show is that $$ \EE \log \Big(1-\frac {\Gamma +t(w)}{-w} \Big) \le 0 $$ for all sufficiently small $w\le -1$ where $\Gamma=\log(3(1-\Theta))$. In fact all we will use about $\Gamma$ is that is has mean 0 and is not almost surely equal to 0 and bounded from above. Note that due to the upper boundedness of $\Gamma$ the term inside the $\log$ is almost surely positive whenever $w$ is sufficiently small. We decompose $\Gamma$ as $\Gamma=\Gamma_1+\Gamma_2$, where $\Gamma_1:=\Gamma \eins_{U}$ and $\Gamma_2:=\Gamma \eins_{U^c}$ and where the set $U$ is chosen such that $\EE \Gamma_1=\EE \Gamma_2=0$ and $\Gamma_1$ is bounded and not identically 0 (it may be necessary to enlarge the probability space for such a decomposition to exist). Now, \begin{equation}\label{terms} \EE \log \Big(1-\frac {\Gamma +t(w)}{-w} \Big)=\EE \log\Big(1-\frac {\Gamma_1 +t(w)}{-w} \Big)+ \EE \log \Big( 1-\frac{\Gamma_2}{-w-\Gamma_1-t(w)}\Big). \end{equation} The second term can be estimated as follows: $$ \EE \log \Big( 1-\frac{-\Gamma_2}{-w-\Gamma_1-t(w)}\Big)\le \EE \frac{\Gamma_2}{-w-\Gamma_1-t(w)}=-\frac 1{-w-t(w)}\EE \big(\Gamma \eins_U\big)=0. $$ It remains to estimate the first term on the right hand side of \eqref{terms}. For $\varepsilon \in (0,1)$ there exists $\delta >0$ such that $$ \log(1+x)\le x -\frac 12 (1-\varepsilon)x^2, \mbox{ for all } |x|\le \delta. $$ Therefore, for $w\le -1$ sufficiently small we have \begin{align*} \EE \log \Big(1-\frac {\Gamma_1 +t(w)}{-w} \Big)&\le - \frac 1{-w}\big(\EE \Gamma_1 + t(w)\big) - \frac 12 (1-\varepsilon) \EE \Big(\frac {\Gamma_1 +t(w)}{-w}\Big)^2\\ &= \frac {-t(w)}{-w}-\frac 1{2w^2} (1-\varepsilon)\big(\EE \Gamma_1^2+t(w)^2\big) \end{align*} which is smaller than 0 for $w$ sufficiently small since $\EE \Gamma_1^2>0$ and $\lim_{w \to -\infty}w\,t(w)=0$. This finishes the proof of the first statement in the lemma. The corresponding statement concerning $C$ is proved similarly (it is in fact easier as the eigenvalues of $D V_\theta (C)$ are bounded away from zero uniformly in $\theta$) and will not be included here. Finally we prove the statement for $c$. Take coordinates $u_1 = u_1(x) = x_1-x_2$, $u_2 = u_2(x) = 1 - x_1-x_2$ for which $u_1 (c) = u_2 (c) = 0$. Note that $u_1 \ge 0$ and $u_2 \ge 0$ on $G_1$. Writing $\gamma_1 = \frac 32 \theta$, $\gamma_2 = 2 - \frac 32 \theta$, a calculation shows \begin{align*} u_1 ( V_\theta (x) ) &= \gamma_1 u_1 (1 - u_1^2 - 3 u_2^2 ) + u_1 (u_1^2 + 3 u_2^2), \\ u_2 ( V_\theta (x) ) &= \gamma_2 u_2 ( 1 - 4 u_2 + u_1^2 + 3 u_2^2) + u_2 ( 4 u_2 - u_1^2 - 3 u_2^2). \end{align*} Let $s_1 (x), s_2 (x)$ be defined by \begin{align*} \log (u_1 ( V_\theta (x) )) &= \log (u_1(x)) + \log (\gamma_1) + \log (s_1 (x)), \\ \log (u_2 ( V_\theta (x) )) &= \log (u_2(x)) + \log (\gamma_2) + \log (s_2 (x)). \end{align*} We find $s_1 (x) \ge 1 - O ( \| (u_1,u_2) \|^2)$, $s_2 (x) = 1 - O ( \| (u_1,u_2) \|^2)$. Assume for definiteness $\EE \log(\gamma_1) = 0$. Using Jensen's inequality (see the proof of Theorem~\ref{t:A}) yields $\EE \log(\gamma_2) <0$. The case $\EE \log(\gamma_1) > 0$ and $\EE \log(\gamma_2) <0$ is treated similarly and also the case $\EE \log(\gamma_2) \ge 0$ and $\EE \log(\gamma_1) < 0$ is treated similarly. For constants $k>0$, $L<0$, consider the random walk \begin{align*} w_{n+1} &= (w_n + \log (\gamma_2) + k e^{L} + k e^{w_n}) \wedge 0 \end{align*} We may pick $k>0$ and $L$ large negative so that $\log (u_2 (\varphi_n (x))) \le w_n$ as long as $w_n \le L$. In fact, this holds uniformly in $u_1 (\varphi_n(x)) \le L$. There is no loss of generality in assuming $L=0$ and $k$ is small positive. We first consider the values $w_n$. For $k$ small enough we have $\EE \gamma_2 - 2 k <0$. This implies that $e^{w_n}$ converges to zero almost surely. To be specific, write $\omega = (\Theta_n)_{n\in\mathbb{N}}$. There are $\lambda<1$ and a measurable function $C_\omega$ so that for $\mu^\mathbb{N}$ almost all $\omega$, $e^{w_n} \to 0 $ as $n\to \infty$ and \[ e^{w_n} \le C_\omega \lambda^n e^{w_0}. \] Now consider \begin{align*} v_{n+1} &= (v_n + \log (\gamma_1) - k e^{v_n} - k e^{w_n}) \wedge 0. \end{align*} As long as $w_n\le 0$ and $v_n \le 0$, we find $v_n \le \log (u_1(\varphi_n(x)))$. We use the exponential convergence of $e^{w_n}$ to zero to treat the iterates $v_n$. Assume first $e^{w_0}=0$ and thus $e^{w_n} = 0$ for all $n\in\mathbb{N}$. This gives the random walk \begin{align} \label{e:vn0} v^0_{n+1} &= (v^0_n + \log (\gamma_1) - k e^{v^0_n}) \wedge 0. \end{align} As in the previous reasoning on iterates near $\mathbf{e}_1$ the following statement is derived: there is a set of $\omega$'s of full measure, for which for any given $v_0 \le 0$, there are infinitely many $n$ with $v_n=0$. Now consider the random walk $v_{n+1} = (v_n + \log (\gamma_1) - k e^{v_n} - k e^{w_n} ) \wedge 0$ with the term involving $e^{w_n}$ included. We obtain \[ |v_m - v^{0}_m| \le \sum_{i=0}^{m-1} e^{w_i} \le C_\omega \frac{\lambda}{\lambda-1} e^{w_0}. \] Let $v^{0,n}_k$ be the orbit for \eqref{e:vn0} with $v^{0,n}_0 = v_n$. Then \begin{align}\label{e:vv0} |v_{n+k} - v^{0,n}_k| &\le \sum_{i=0}^{k-1} e^{w_{n+k}} \le C_{\sigma^n \omega} \frac{\lambda}{\lambda-1} e^{w_n}. \end{align} Let $B>0$ be such that $C_\omega < B$ for positive probability. For almost all $\omega$, there are arbitrary large $n$ with $C_{\sigma^n \omega}<B$. The right hand side of \eqref{e:vv0} goes to zero if $n\to \infty$ and $C_{\sigma^n \omega}<B$. We already know that with probability one there are infinitely many $k$ with $v^{0,n}_k=0$. This suffices to conclude the result. \end{proof} \section*{Acknowledgments} The second author (UJ) thanks the TU Berlin for the kind hospitality and for providing all facilities and the German Academic Exchange Service (DAAD) for providing financial support by a scholarship.
\section{Introduction} The design of naturalistic spoken dialog systems (SDSs) that can interact with users in a human-like manner, requires models that control when it is an appropriate time for the system to speak. These turn-taking models (e.g. \cite{raux_finite-state_2009,ferrer_is_2002,maier_towards_2017}) are used to make decisions as to whether the current speaker will continue to hold the floor (HOLD) or not (SHIFT). A naive approach to modeling these decisions is to identify turn exchange points using silence thresholding. This approach is limited in its naturalness since the chosen threshold can potentially be too short (leading to interruptions) or too long (leading to unnaturally long pauses). These traditional threshold-based approaches also cannot model rapid turn-switches, which can potentially involve a brief period of overlap during the turn exchange \cite{heldner_pauses_2010}. It has been proposed in the projection theory of Sacks \cite{sacks_simplest_1974} that, rather than reacting to silence, humans often form predictions as to when their conversational partner will finish their turn. Using these predictions we are able to anticipate utterance endpoints, and start our turns accordingly. LSTM-based turn-taking models that operate in a similar predictive fashion were proposed by Skantze in \cite{skantze_towards_2017}. In these models LSTMs are used to make continuous predictions of a person's speech activity at each individual time step of 50ms. The networks are trained to predict a vector of probability scores for speech activity in each individual frame within a set future window. Rather than designing classifiers to make specific decisions, these continuous models are able to capture general information about turn-taking in the data that they are trained on. They can therefore be applied to a wide variety of turn-taking prediction tasks and have been shown to outperform traditional classifiers when applied to HOLD/SHIFT predictions. A downside to the approach in \cite{skantze_towards_2017} is that, since a single LSTM is being used, all input features must be processed at the same rate. When considering linguistic features, the the relevant information for turn-taking prediction happens at a coarse temporal granularity in comparison with acoustic features, where much of the relevant information occurs at the sub-word prosodic level. When using a single LSTM, this requires either averaging the acoustic features to represent them at a word-level temporal resolution, or upsampling the linguistic features to represent them at the acoustic temporal resolution. Both of these options have their drawbacks. In the case of averaging the acoustic features, we lose the finer-grained prosodic inflections that are important to forming turn-taking predictions. In the case of upsampling the linguistic features, the model has a harder time with the longer term dependencies that exist between linguistic features. Because the linguistic features are sampled at a higher rate, the model is more susceptible to the vanishing gradient problem. We propose a way to address this problem by using a multiscale RNN architecture, in which modalities are modeled in separate sub-network LSTMs that are allowed to operate at their own independent timescales. A master LSTM is used fuse the modalities and form predictions at a regular rate by taking as input a concatenation of the current hidden states of the sub-networks. This allows the hidden states of the sub-networks to be updated at an appropriate temporal rate. In this paper we present significant extensions to the original work of Skantze in \cite{skantze_towards_2017}. We investigate the performance of our proposed multiscale architecture on two datasets that contain two different combinations of modalities. We look at the influence of modeling modalities in separate sub-networks and using separate timescales. We find that there are significant performance benefits to modeling linguistic features at a slower temporal rate, and in a separate sub-network from acoustic features. We also find that our approach can be used to incorporate gaze features into turn-taking models, a task that has been previously found to be difficult \cite{de_kok_multimodal_2009}. \section{Continuous Turn-taking Prediction} The main objective of continuous turn-taking prediction as proposed in \cite{skantze_towards_2017} is to predict the future speech activity annotations of one of the speakers in a dyadic conversation using input speech features from both speakers ($x_t$). At each timestep $t$ of frame-size 50ms, speech features are extracted and input into an LSTM that is used to predict the future speech activity ($y_t$) of one of the speakers. The future speech activity is a 3 second window comprising of 60 frames of the binary annotations for frames $t+1$ to $t+60$. The output layer of the network uses an element-wise sigmoid activation function to predict a probability score for the target speaker's speech activity at each future frame. To represent linguistic features in this model the word-rate features are upsampled to the 50ms acoustic feature rate. They use one-hot encodings, where the feature is "switched on" for a single frame, 100ms after the word is finished (to simulate real-world ASR conditions). To model more fine-grained prosodic inflections the 50ms acoustic feature rate could be increased. However, doing this leads to a sparser linguistic feature representation since all features input into an LSTM must be processed at the same rate. This makes it more difficult for the network to model longer-term dependencies that exist in the linguistic modality. \begin{figure*}[ht] \begin{center} \makebox[\textwidth]{\includegraphics[width=0.92\textwidth]{figures/multiscale_rnn_fixed.jpg}} \caption{Multiscale RNN architecture } \label{fig:multiscale} \end{center} \end{figure*} \section{Multiscale Continuous Turn-taking Prediction} To address this problem we modify the original network architecture to include a variable number of sub-network LSTM cells that process features from separate modalities independently. The sub-networks are allowed to process the input features from the separate modalities at different timescales. An example network configuration that uses a master LSTM ($h^0$) and two sub-network LSTMs ($h^1$,$h^2$, each assigned a modality) is shown in Fig. \ref{fig:multiscale}. We use superscripts to denote the index of modalities $m\in M$, and subscripts to index timesteps (represented using the notation $t^m$). At each timestep of the master LSTM ($t^0$), the current states of the sub-network LSTMs are concatenated and fed into the master LSTM. The hidden state update process for the network is shown in Algorithm \ref{multiscale_algo}. By feeding the current states of the sub-networks into the master LSTM, we are effectively performing a sampling operation, represented in the algorithm by the step $h_{t^0+1}^m \longleftarrow h_{t^m+1}^m$. The sampling operation can either increase or decrease the temporal resolution of the individual modalities, depending on the timescales used. For example, in Fig. \ref{fig:multiscale}, the temporal resolution of the first sub-network ($h^1$) is decreased since we sample it at a regular rate every five $t^1$ timesteps. The temporal resolution of the second modality could either be increased or decreased by the sampling process since the features have irregular timesteps. The processing of features at a slower update rate potentially allows the network to better retain information. The model was implemented using the PyTorch framework and our code is available online\footnote{www.github.com/mattroddy/lstm\_turn\_taking\_prediction}. \input{algo.tex} \section{Experimental Design} To assess the performance of our multiscale approach, we test it on two different datasets. In each dataset, features from two separate modalities are investigated by training models using a variety of different network configurations. The HCRC map-task corpus (MTC) \cite{anderson_hcrc_1991} is used to examine linguistic and acoustic modalities while the Mahnob Mimicry Database (MMD) \cite{bilakhia_mahnob_2015} is used to examine visual and acoustic modalities. In this section we discuss the details of the datasets and how features were extracted. We then discuss the evaluation metrics used to assess network performance. We then outline our experimental procedure. \subsection{Map-Task corpus} The MTC is a corpus of 128 dyadic task-based dialogues totaling 18 hours in length. We used 96 conversations as training and 32 conversations for testing. Additionally, we used 32 conversations of the training set as a held-out test set during hyperparameter searches. The speech transcriptions supplied with the corpus were used as the ground-truth for the speech-activity predictions \paragraph{Acoustic Features}\label{acous_feats} As acoustic features, we use the low-level descriptors from the eGeMAPs \cite{eyben_geneva_2016} feature set extracted with the OpenSmile toolkit \cite{eyben_opensmile_2010}. The features were all normalized using z-scores on a per-file basis. We extract the features at two different temporal resolutions: 10ms and 50ms. We use these two different temporal resolutions to investigate which one is more useful for our turn-taking models. In our results tables and discussion we refer to these as "Acous 10ms" and "Acous 50ms". \paragraph{Linguistic Features}\label{ling_section} For linguistic features we use the word annotations supplied with the corpus. The words were represented as an enumerated vocabulary where the raw word features were transformed into a linear embedding of size 64 that is jointly trained with the rest of the network. In an effort to simulate the conditions of a real-time system, the linguistic features were not provided to the system until 100ms after the end of the word. Three different temporal rates for the processing of linguistic features are tested in our experiments. In our discussion and results below, "Ling 50ms" refers to using word features that have been sampled at regular 50ms intervals, as was proposed in \cite{skantze_towards_2017}. "Ling 10ms" refers to using word features that are sampled at a faster rate of 10ms. "Ling Asynch" refers to using an irregular update rate, where the LSTM only processes the linguistic features when a new word is available. \subsection{Mahnob Mimicry Database} The MMD is an audio-visual corpus of 54 dyadic conversations totaling 11 hours in length. The participants are either assigned discussion topics or roles to play in a loosely defined role-playing scenario. When splitting the data into training and test sets we balanced the number of role-playing and discussion conditions in the training and test set. We used 39 conversations for training and 15 for testing. Since there are no speech transcriptions available for the dataset, we manually labeled the dataset for speech activity. The procedure we used for extracting acoustic for MMD was the same as that followed in for the MTC in section \ref{acous_feats}. \paragraph{Visual Features} We automatically extract visual features using the OpenFace toolkit \cite{baltrusaitis_openface_2016}. During informal exploratory experiments we found that the automatically extracted gaze features performed better than other features extracted with the toolkit (e.g. facial action units, pose). We therefore used the gaze features (a six dimensional vector of eye gaze directions) along with a confidence score as our visual input feature. The video in the MMD uses a high frame rate of 58Hz. We perform a comparison of using features at this high frame rate and using features that are averaged over 50ms frame windows. In the results tables and the discussion below we refer to the high frame rate video and the averaged video features as "Visual 58Hz" and "Visual 50ms" respectively. \subsection{Evaluation Metrics} To evaluate the performance of the different network configurations we use two kinds of evaluation metrics that were proposed in \cite{skantze_towards_2017}. These two kinds of metrics represent the prediction performance on two common types of turn-taking decisions that are pertinent to SDSs. \paragraph*{Prediction at Pauses} The prediction at pauses metric represents the standard turn-taking decision made at brief pauses in the interaction to predict whether the person holding the floor will continue speaking (HOLD) or the interlocutor will take a turn (SHIFT). To make this decision, we find all points where there is a pause of a minimum set length. We then select all of these instances where only one person continued within a one second window directly after the pause. We average the predicted output probabilities within the window for each of the speakers at the frame directly after the pause. The speaker with the higher score is selected as the predicted next speaker, giving us a binary HOLD/SHIFT classification for which we report F-scores. We test predictions at pauses of both 500ms (PAUSE 500) and 50ms (PAUSE 50). The majority vote F-score for the MTC (always HOLD) is 0.5052 and 0.4608 for PAUSE 50 and PAUSE 500 respectively. For MMD the corresponding values are 0.7298 and 0.8185. \paragraph*{Prediction at Onsets} Prediction at onsets (ONSET) represents a prediction of the length of an utterance after an initial period of speech. It represents a useful decision for estimating how long the upcoming utterance will be. It categorizes onset predictions into SHORT and LONG, where SHORT utterances can be considered similar to backchannels. For an utterance to be classified as short, 1.5 seconds of silence by a participant has to be followed by a maximum of 1 second of speech, after which the speaker must be silent for at least 5 seconds. For the utterance to be classified as long, 1.5 seconds of silence must be followed by at least 2.5 seconds of speech. The point at which the predictions are made is 500ms from the start of the utterance. The prediction is made by taking the mean of the 60 output nodes from the sigmoid layer and comparing them to a threshold value. The majority vote F-score for the MTC (always SHORT) is 0.3346. For the MMD the corresponding value is 0.5346. \begin{table}[t] \centering \caption{Map-task corpus experimental results} \label{tab:tab_maptask} \resizebox{\columnwidth}{!}{ \input{tables/merge_maptask_results.tex} } \end{table} \begin{table}[t] \centering \caption{Mahnob corpus experimental results} \label{tab:tab_mahnob} \resizebox{\columnwidth}{!}{ \input{tables/mahnob_merged.tex} } \end{table} \subsection{Experimental Procedure} In our experiments, the networks were trained to minimize binary cross entropy (BCE) loss which was shown to produce good results in \cite{roddy_investigating_2018}. We test the impact of using three different network configurations with multiple combinations of modalities at different temporal resolutions. The three network configurations are: "no subnets", which corresponds to an early fusion approach in which the modalities are fed directly into a single LSTM; "one subnet", which corresponds to the use of only one sub-network LSTM; and "two subnets", which corresponds to the use of separate LSTM sub-networks for the individual modalities. We note that combinations such as "Ling 50ms" with "Acous 10ms" are not possible when using the "no subnets" and "one subnet" configurations since the features are being input into the same LSTM and cannot operate at different temporal resolutions. Grid searches for three hyperparameters (hidden node size, dropout, and L2 regularization) were performed for each network configuration. In order to limit the influence of parameter count changes between the different network configurations, the hidden node count in a given network was limited to a sum of 150. Once the hyperparameters for a network are chosen, we train the network five times and report the mean values of the different evaluation metrics in Tables \ref{tab:tab_maptask} and \ref{tab:tab_mahnob}. The best performing modality combination for a given network configuration is shown in bold and the best overall performance is shown in italics. In our discussion below we use two-tailed t-tests to report on the difference between the means of metrics. \section{Discussion} Looking at the results from the fusion of linguistic and acoustic modalities shown in Table \ref{tab:tab_maptask}, it is clear that there are significant benefits in modeling acoustic and linguistic modalities separately using different timescales. Our best performance on all evaluation metrics is achieved using our multiscale approach where features from the two modalities are modeled at separate rates. Comparing the BCE loss of the best performing early-fusion result (7) with the best multiscale result (11) gives a statistically significant improvement ($P<.001$). Comparing the performance of the acoustic feature timescales, we observe that the faster rate of 10ms consistently performs better than the slower 50ms rate. Looking at the performance of the three different linguistic timescales in (3,4,5), we see that processing linguistic features at the slower regular rate of 50ms achieves the best performance. Comparing the BCE loss of (3) and (5) suggests that sampling linguistic features at a fast temporal rate makes it difficult for the network to model longer term dependencies ($P=.004$). The effect of processing modalities on their own in separate sub-networks without the added gain of using separate timescales is inconclusive when we examine (6) and (10). Using a single subnet as an added layer also does not yield significant differences to the early fusion approach. We conclude that the main advantage in using our multiscale approach on a combination of acoustic and linguistic modalities is its ability to fuse the two modalities when the linguistic features are operating at a slow 50ms timescale and the acoustic features are operating at a fast 10ms timescale. Comparing our results with previously published baselines reported on the same dataset by Skantze in \cite{skantze_towards_2017}, our best result on the PAUSE 500 task of 0.8553 is a large improvement over his reported score of 0.762. Looking at the results from the fusion of visual and acoustic modalities shown in in Table \ref{tab:tab_mahnob}, we were able to achieve our best BCE loss using our multiscale approach to fuse acoustic features at a 10ms timescale and visual features at a 58Hz timescale. Comparing this result (9) with our best "no subnets" result (2) gives a statistically significant improvement ($P=0.035$). We note that using early fusion with gaze features (5) does not add any value when compared to acoustic features on their own (1). The results also indicate that the faster 58Hz gaze features perform better than the averaged 50ms visual features when used in conjunction with the acoustic features. This suggests that we loose relevant information by averaging the gaze features within a timestep. \section{Conclusion} In conclusion, we have shown that there are considerable benefits in using multiscale architectures for continuous turn-taking prediction. When fusing linguistic and acoustic modalities, the architecture allows acoustic features to be modeled at a fast temporal rate (which is better-suited to capturing prosodic inflections) while modeling linguistic features at a slower rate (which is better-suited to capturing long-term linguistic dependencies). When fusing visual and acoustic modalities, our multiscale approach allowed the use of high frame-rate visual features without resorting to averaging. \section{Acknowledgements} \scriptsize{ The ADAPT Centre for Digital Content Technology is funded under the SFI Research Centres Programme (Grant 13/RC/2106) and is co-funded under the European Regional Development Fund.} \bibliographystyle{ACM-Reference-Format} \balance{}
\section{Introduction} Fractional quantum Hall state~\cite{Hall1} possesses exotic topological phase. With the rapid development of condensed matter physics~\cite{c1,c2,c3} and topological quantum computation~\cite{t1,t2,t3,t4,MZM2}, topological phases and transitions, which are beyond the symmetry breaking theory and not characterized by local order parameter, become of great importance. Symmetry-protected topological (SPT) phases and related phase transitions can be described by the topological order~\cite{XGWenBook} as well as the topological entanglement entropy\cite{TEE1,TEE2,TEE3,TEE4}. Over the past few years, one-dimensional topological systems, such as the extended Kitaev chains with variable-range pairing and hopping parameters in the Hamiltonian~\cite{model1,model2}, have received great attention. These models exhibit SPT phases and can produce new topological effects to enrich the appearance of one-dimensional topological superconductors~\cite{model3,model4} and have been demonstrated experimentally~\cite{exp1,exp2,exp3}, where Majorana zero modes (MZMs), as a key to realize fault-tolerant quantum computing~\cite{t1,t2,t3,t4,MZM2}, are observed. It has been indicated that the entanglement entropy (EE) can provide information about the topological phases in extended Kitaev chains via the logarithmic scaling~\cite{model1,EElog1,EElog2,EElog4}. Moreover, quantum Fisher information (QFI), as a witness of multipartite entanglement~\cite{QFI}, can characterize topological quantum phases by a power-law scaling~\cite{QFI_Topo,QFI_Topo_YRZ}. Nevertheless, characterizing the topological phases with high winding numbers $|\nu|\geq 2$ needs different approaches, as shown by QFI defined on a dual lattice \cite{QFI_Topo_YRZ}. Additionally, in experiments, it is challenging to accurately measure the number of paired MZMs. Thus, developing new ways of characterizing SPT states with higher winding numbers from the perspective of quantum information is crucial. On the other hand, quantum coherence is a useful resource for various quantum information tasks~\cite{QC1,QC2,QC3} and plays important roles in quantum critical systems~\cite{QC_QPT1,QC_QPT2,QC_QPT3,QC_QPT4,QC_QPT5} and quantum thermodynamics~\cite{DE,DE_a1,DE_a2}. Recently, quantum coherence has been quantified in a rigorous framework by the relative entropy~\cite{QC1}, $\mathcal{C}(\rho) = S(\rho^{\text{diag.}}) - S(\rho)$, where $S$ is the von Neumann entropy function. $S(\rho^{\text{diag.}})$ is the recently defined diagonal entropy (DE), for which $\rho^{\text{diag.}}$ denotes a diagonal part of the full density matrix $\rho$. In the case of a pure state $\rho$, the EE $S(\rho)=0$, and therefore the DE $S(\rho^{\text{diag.}})$ is equal to quantum coherence. Meanwhile, for pure states $S(\rho^{\text{diag.}})$ can be interpreted as the intrinsic randomness, which is proved to be a valid measure of quantum coherence~\cite{QC_XM}. Based on above discussions, the DE of pure states can still provide information of the quantum coherence and thus may be possible to signal the quantum phases transitions. More importantly, besides being detected in nanowire devices~\cite{exp1,exp2} and quantum spin liquids~\cite{exp3}, SPT states can also be realized by digital quantum simulation~\cite{exp4}, where the entanglement spectrum is applied to characterize the SPT states. However, the calculation of both EE and entanglement spectrum require the reduced density matrix measured via state tomography in different bases, which is an obstacle for quantum simulation experiments. Fortunately, for DE, we only need to measure the diagonal part of a density matrix that can be obtained much easier than the full density matrix. Hence, DE is a more experimentally feasible quantity comparing with EE. Recently, the global entanglement (GE), as a measure of multipartite entanglement~\cite{GE1,GE2}, was widely applied in the field of condensed matter physics. The GE, which can be easily computed since only one-qubit reduced density operators are required, is an indicator of quantum phase transitions~\cite{GE3,GE4,GE5} and many-body localization~\cite{GE6}. Nevertheless, whether the GE could detect TPTs remains an open question. In this paper, we focus on the extended Kitaev chains with variable-range pairing and hopping and calculate the DE of the SPT ground states. We also compute the GE in the models for reference. The topological phases considered here are described by a $\mathbb{Z}$-valued topological invariant given by the winding number~\cite{WN1,WN2,WN3} as well as the pairs of MZMs~\cite{t1,t2,t3,t4,MZM2}. We show that the DE density extracted from both the finite size scaling law and block scaling law can highlight the critical points associated with the topological phase transitions (TPTs) in the models for the TPTs, especially with higher winding numbers. However, the GE is trivial for TPTs in some cases. It is worthwhile to emphasize that the characterization of TPTs by the DE density is independent of the chosen bases, showing the universality of this approach. The remainder of this work is organized as follows. In Section 2, we briefly review the Hamiltonian of extended Kitaev chains, the winding numbers and MZMs in the models, and the definition of DE and GE. In Section 3, the calculation results of diagonal entropy as well as global entanglement in the extended Kitaev chains are presented. In Section 4, we report discussions and draw conclusions. \section{Models and definitions} \subsection{\label{sec:level2} Extended Kitaev chains} First of all, we consider the extended Kitaev chains with variable-range pairing term, for which the Hamiltonian is written as~\cite{model1} \begin{eqnarray} \mathcal{H}_{1} = -\frac{J}{2}\sum_{j=1}^{N}(c_{j}^{\dagger}c_{j+1}+\text{H.c.})-\mu\sum_{j=1}^{N}(c_{j}^{\dagger}c_{j}-\frac{1}{2}) + \frac{\Delta}{2}\sum_{j=1}^{N}\sum_{l=1}^{N-j}\frac{1}{d_{l}^{\alpha}}(c_{j}c_{j+l}+\text{H.c.}), \label{hamiltonian1} \end{eqnarray} where $c_{j}^{\dagger}$ and $c_{j}$ are creation and annihilation spinless fermion operators, $J$ and $\Delta$ denote the strength of hopping and pairing, respectively. $\mu$ is the chemical potential. $\alpha$ (nonnegative) represents the decay rate of pairing with distance, and $N$ is the size of the Kitaev chain. For closed boundary conditions, $d_{l}=\text{min}\{l,N-l\}$. It has been shown that the winding numbers of the topological phases in this model only contains $\nu = 0,\pm\frac{1}{2},\pm1$~\cite{model1,QFI_Topo}, however the phases of higher winding numbers are absent. Next, in order to estimate the ability of DE to detect the TPTs with higher winding numbers, we also pay attention to the extended Kitaev chain with both of longer-range pairing and hopping. The corresponding Hamiltonian reads~\cite{model2} \begin{eqnarray} \mathcal{H}_{2} = -\mu\sum_{j=1}^{N}(c_{j}^{\dagger}c_{j}-\frac{1}{2})+ \sum_{l=1}^{r}\sum_{j=1}^{N-l}[\frac{\Delta}{d_{l}^{\alpha}}(c_{j}c_{j+l}+\text{H.c.}) -\frac{J}{d_{l}^{\beta}}(c_{j}^{\dagger}c_{j+l}+\text{H.c.})], \label{hamiltonian2} \end{eqnarray} where $r$ represents the longest pairing and hopping distance, and $\beta$ (nonnegative) represents the decay rate of hopping. Both of $\mathcal{H}_{1}$ and $\mathcal{H}_{2}$ are exactly solved by applying the Fourier transformation and Bogoliubov diagonalization \cite{ES1,ES2,ES3}. They can be written in momentum space with the form \begin{eqnarray} \mathcal{H}=\sum_{k}\epsilon_{k}\Psi_{k}^{\dagger}(\textbf{h}_{k}\cdot\overrightarrow{\sigma})\Psi_{k}, \label{hk} \end{eqnarray} where the summation takes over all $k=(2\pi/N)(n+1/2)$ $(n=0,1,...,N-1)$ for closed chains with antiperiodic boundary conditions, $\epsilon_{k}$ is the energy spectra, $\Psi_{k}^{\dagger}=(c_{k}^{\dagger},c_{-k})$ is the Nambu spinor, $\overrightarrow{\sigma}$ is the Pauli vector, and \begin{eqnarray} \textbf{h}_{k}=(0,h_{y}(k),h_{z}(k)) \label{Av} \end{eqnarray} is the unit Anderson vector. The concrete expressions of the unit Anderson vectors for $\mathcal{H}_{1}$ and $\mathcal{H}_{2}$ are given in the Appendix A. \subsection{\label{sec:level2} Winding numbers and Majorana zero modes} Before we introduce the DE, we will present the definitions of winding numbers and Majorana zero modes (MZMs), as two characterizations of topologically nontrivial phases, and related results in the extended Kitaev chains. It has been proved that the number of pairs of MZMs is equal to the absolute value of winding number~\cite{QFI_Topo_YRZ}. The time reversal symmetry and particle-hole symmetry are preserved in both $\mathcal{H}_{1}$ and $\mathcal{H}_{2}$, which contributes to a constraint on the movement of the Anderson vector $\textbf{h}_{k}$ in the auxiliary $y-z$ plane as a circle $S^{1}$. The winding number defined as \begin{eqnarray} \nu = \frac{1}{2\pi}\oint d \Theta = \frac{1}{2\pi}\int_{-\pi}^{\pi}dk \frac{1}{h_{y}(k)}\frac{\partial h_{z}(k)}{\partial k}, \label{wn} \end{eqnarray} where $\Theta_{k}=\arctan[h_{y}(k)/h_{z}(k)]/2$ is the Bogoliubov angle, can count how many times the vector $\textbf{h}_{k}$ winds in the $y-z$ plane when $k$ varies from $-\pi$ to $\pi$, i.e., the whole Brillouin zone. Hence, $\nu$ can characterize the mapping from the reduced Hamiltonian $\mathcal{H}_{k} = \textbf{h}_{k}\cdot\overrightarrow{\sigma}$ with $k \in S^{1}$ to the movement of $\textbf{h}_{k}$ and is regarded as a topological invariant. With the concrete expressions of $\textbf{h}_{k}$ given in Appendix A, we can directly obtain the trajectory of $\textbf{h}_{k}$. Two examples are presented in Fig. \ref{Fig_a3}. As shown in Fig. \ref{Fig_a3}(a), the trajectory shifts upward with the increase of $\mu$, and $\nu$ changes from 0 to -1 at $\mu=-1$ and from -1 to 0 at $\mu=1$. Similarly, as depicted in Fig. \ref{Fig_a3}(b), when $\mu$ increases, $\nu$ changes from $0$ to $-1$ at $\mu=-1.5$, from $-1$ to $-3$ at $\mu=-1$, and from $-3$ to $-1$ at $\mu\simeq-0.42$. Next, in order to obtain the MZMs, we can rewrite $\mathcal{H}_{1}$ and $\mathcal{H}_{2}$ with open boundary conditions in terms of Majorana operators \begin{eqnarray} a_{j}=\frac{1}{\sqrt{2}}(c_{j}^{\dagger}+c_{j}), b_{j}=\frac{i}{\sqrt{2}}(c_{j}^{\dagger}-c_{j}), \label{MZM1} \end{eqnarray} with fermionic anticommutation relation $\{a_{i},a_{j}\}=\{b_{i},b_{j}\}=\delta_{ij}$ and $\{a_{i},b_{j}\}=0$. We firstly consider a easier case, i.e., $\mathcal{H}_{1}$ with $\alpha=+\infty$, $\Delta=1$. It can be directly obtained that the trajectory of $\textbf{h}_{k}$ is the same as Fig. \ref{Fig_a3}(a) but with opposite direction and $\nu$ changes from 0 to 1 at $\mu=-1$ and from 1 to 0 at $\mu=1$ as $\mu$ increases. The Hamiltonian with Majorana operators reads \begin{eqnarray} \mathcal{H}_{1}=\frac{i}{2}\sum_{j=1}^{N-1}b_{j}a_{j+1} - i\mu\sum_{j=1}^{N}a_{j}b_{j}. \label{MZM2} \end{eqnarray} Based on the ansatz proposed in~\cite{model3,MZM1}, the left Majorana mode can be written as \begin{eqnarray} \Phi_{\text{left}} = \sum_{j=1}^{L} m_{j}a_{j}, \label{MZM3} \end{eqnarray} where the real coefficients $m_{j}$ can be determined by the condition~\cite{MZM2,MZM3} \begin{eqnarray} [\mathcal{H},\Phi_{\text{left}}]=0. \label{MZM4} \end{eqnarray} Similarly, the right Majorana mode $\Phi_{\text{right}} = \sum_{j=1}^{L} n_{j}b_{j}$ with $n_{j}=m_{N-j+1}$ can also be obtained. In Fig. \ref{Fig_a3}(c), the probability of the left and right Majorana mode $P_{M1}$ and $P_{M2}$ for $\mu=-0.5$ are displayed. There is only one pair of MZMs, which is consistent with the winding number $\nu=1$. We then study a more complex case. For the Hamiltonian $\mathcal{H}_{2}$, taking Eq. (\ref{MZM4}) into consideration, a straightforward calculation of $[\mathcal{H}_{2},\Phi_{\text{left}}]$ leads to \begin{eqnarray} \sum_{l=1}^{r}\sum_{j=1}^{N-l}i[(\frac{\Delta}{d_{l}^{\alpha}}+\frac{J}{d_{l}^{\beta}})m_{j+l}b_{j} + (\frac{J}{d_{l}^{\alpha}}-\frac{\Delta}{d_{l}^{\beta}})m_{j}b_{j+l}] + i\mu\sum_{j=1}^{N}m_{j}d_{j} =0. \label{MZM5} \end{eqnarray} For $\alpha=\beta=0.2$, $\Delta=1$, $J=0.8$ and $\mu=0.6$ (the trajectory of $\textbf{h}_{k}$ is the same as Fig. \ref{Fig_a3}(b) but with opposite direction and $\nu=3$), it can be found that there are only $k$ equations containing $k+3$ $m_{j}$. Consequently, there are 3 independent left zero modes, which corresponds with the winding number $\nu=3$. The right Majorana modes can also be obtained using a similar approach. We depicted three pairs of MZMs in Fig. \ref{Fig_a3}(d)-(f). It can be observed that the signature of the second ($P_{M1}^{(2)}$, $P_{M2}^{(2)}$) and third ($P_{M1}^{(3)}$, $P_{M2}^{(3)}$) MZMs are weaker than the first MZMs, which may lead to a difficulty for experiments to characterize the number of MZMs. \begin{figure}[] \includegraphics[width=0.8\textwidth]{Fig_a3.pdf} \caption{(a) The trajectory of $\textbf{h}_{k}$ in $\mathcal{H}_{1}$ with $\alpha=+\infty$, $\Delta=-1$ and $\mu=-1.5$. In this case, the winding number $\nu=0$. (b) The trajectory of $\textbf{h}_{k}$ in $\mathcal{H}_{2}$ with $\alpha=\beta=0.2$, $r=3$, $J=-0.8$ and $\mu=-0.6$. In this case, the winding number $\nu=-3$. (c) For $\mathcal{H}_{1}$ with $\Delta=1$ and $\mu=-0.5$, we have only one pair of MZMs. For $\mathcal{H}_{2}$, when $\alpha=\beta=0.2$, $r=3$, $J=0.8$ and $\mu=0.6$, there are three pairs of MZMs shown in (d), (e) and (f).}\label{Fig_a3} \end{figure} \subsection{\label{sec:level2} Diagonal entropy} Here, we focus on two types of scaling law for DE. (i) The finite size scaling law extracted from the association between the DE of pure state, that is, the total ground state without partial trace, and the system size $N$. (ii) The block scaling of DE obtained from the relation between the DE for a subsystem composed of $L$ continuous sites and $L$ in the considered systems with a fixed system size $N$ (usually $N\gg L$). On the proposes of obtaining the first scaling law, we can calculate the DE of pure states in momentum space. The ground state of $\mathcal{H}_{1}$ and $\mathcal{H}_{2}$ with momentum $k$ can be represented as \begin{equation} |g(k)\rangle = (\cos\Theta_{k} - i\sin\Theta_{k} \eta_{k}^{\dagger}\eta_{-k}^{\dagger})|0\rangle, \label{GS} \end{equation} where $\eta_{k}$ and $\eta_{-k}^{\dagger}$ are Bogoliubov ferminic operators. $|0\rangle$ is the vacuum state. Then, the DE can be calculated directly \begin{eqnarray} S_{k}^{\text{diag.}} = S(|g(k)\rangle\langle g(k)|) = -\sin^{2}\Theta_{k}\log(\sin^{2}\Theta_{k})-\cos^{2}\Theta_{k}\log(\cos^{2}\Theta_{k}), \label{DE_k} \end{eqnarray} where $S(\rho)=-\text{Tr}(\rho\log\rho)$, and the DE of the $N$ sites ground state is $S^{\text{diag.}}_{N}=\sum_{k}S_{k}^{\text{diag.}}$ since the ground state is $|\mathcal{G}\rangle=\prod_{k} |g(k)\rangle$. It is noted that we pay attention to the DE of pure state, that is, the total ground state without partial trace. Therefore, DE has the potential to capture nonlocal properties of the ground states and detect TPTs. We also study the second scaling law of DE in the extended Kitaev chains with infinite length to ensure $N\gg L$. Before the derivation of the diagonal reduced density matrix $\rho_{L}^{\text{diag.}}$, for better comprehension of the block scaling law of DE, we emphasize that the extended Kitaev chains $\mathcal{H}_{1}$ and $\mathcal{H}_{1}$ can be mapped to extended Ising models $\mathcal{H}_{1}^{\text{Ising}}$ and $\mathcal{H}_{2}^{\text{Ising}}$ respectively via the Jordan-Wigner transformation. $\mathcal{H}_{1}^{\text{Ising}}$ reads \begin{equation} \mathcal{H}_{1}^{\text{Ising}} = \sum_{j=1}^{N}\sum_{l=1}^{N-j} (\frac{J_{l}^{x}}{2}\sigma_{j}^{x}\sigma_{j+l}^{x} +\frac{J_{l}^{y}}{2}\sigma_{j}^{y}\sigma_{j+l}^{y})\prod_{n=j+1}^{j+l-1}\sigma_{n}^{z} + \sum_{j=1}^{N}\frac{\mu}{2} \sigma_{j}^{z}, \label{Ising_1} \end{equation} where $J_{l}^{x} = -\frac{1}{2}(\frac{J}{2}-\frac{\Delta}{d_{l}^{\alpha}})$, $J_{l}^{y} = -\frac{1}{2}(\frac{J}{2}-\frac{\Delta}{d_{l}^{\alpha}})$ for $l=1$ and $J_{l}^{x} = -J_{l}^{y} = \frac{\Delta}{2 d_{l}^{\alpha}}$ for other values of $l$, and $\mathcal{H}_{2}^{\text{Ising}}$ is given by \begin{equation} \mathcal{H}_{2}^{\text{Ising}} = \sum_{l=1}^{r}\sum_{j=1}^{N-l} (\frac{J_{l}^{x}}{2}\sigma_{j}^{x}\sigma_{j+l}^{x} +\frac{J_{l}^{y}}{2}\sigma_{j}^{y}\sigma_{j+l}^{y})\prod_{n=j+1}^{j+l-1}\sigma_{n}^{z} + \sum_{j=1}^{N}\frac{\mu}{2} \sigma_{j}^{z}, \label{Ising_2} \end{equation} where $J_{l}^{x} = -\frac{1}{2}(\frac{J}{d_{l}^{\beta}}+\frac{\Delta}{d_{l}^{\alpha}})$, $J_{l}^{y} = -\frac{1}{2}(\frac{J}{d_{l}^{\beta}}-\frac{\Delta}{d_{l}^{\alpha}})$ for all values of $l$. Then the diagonal terms of the reduced density matrix $\rho_{L}^{\text{diag.}}$ for ground state can be always expended as \begin{equation} \rho^{\text{diag.}}_{L} = \frac{1}{2^{L}}\sum_{\substack{\gamma_{1},..., \gamma_{L},\in\{0,z\}}}\langle\sigma^{\gamma_{1}}_{1}...\sigma^{\gamma_{L}}_{L}\rangle\sigma^{\gamma_{1}}_{1}...\sigma^{\gamma_{L}}_{L}, \label{diagonal_matrix} \end{equation} where $\sigma^{z}_{l}$ and $\sigma^{0}_{l}$ $(l=1,...,L)$ are the Pauli matrix and two-dimensional identity matrix, respectively. The correlation functions $\langle\sigma^{\gamma_{1}}_{1}...\sigma^{\gamma_{L}}_{L}\rangle$ can be calculated by applying the Wick theorem, which is shown in Appendix B. Then the diagonal entropy $S(\rho_{L}^{\text{diag.}}) = -\text{Tr}(\rho_{L}^{\text{diag.}}\log\rho_{L}^{\text{diag.}})$ can be obtained. \subsection{\label{sec:level2} Global entanglement} Next, we present the definition of GE, which is give by~\cite{GE1,GE2} \begin{equation} E = \frac{2}{N}\sum_{i=1}^{N}[1-\text{Tr}(\rho_{i}^{2})], \label{GE} \end{equation} where $\rho_{i}$ denotes the one-qubit reduced density operator. In the extended Ising chains (\ref{Ising_1}) and (\ref{Ising_2}), $\rho_{i}$ can be written as~\cite{single_q1,single_q2} \begin{equation} \rho_{i} = \frac{1}{2}\left( \begin{array}{cc} 1+\langle\sigma_{i}^{z}\rangle & 0 \\ 0 & 1-\langle\sigma_{i}^{z}\rangle \\ \end{array} \right) , \label{single_q} \end{equation} with $\langle\sigma_{i}^{z}\rangle=\frac{1}{2\pi}\int_{-\pi}^{\pi}e^{-2i\Theta_{k}}dk$ (for the chains with infinite length). The expressions of Bogoliubov angle $\Theta_{k}$ are presented in Appendix A. \section{Results} \begin{figure} \includegraphics[width=0.6\textwidth]{Fig0.pdf} \caption{A diagrammatic sketch of the distribution of quantum coherence. The quantum coherence of the subsystem consisted of $L$ continuous spins $\rho_{L}$ is $\mathcal{C}(\rho_{L}) = S(\rho_{L}^{\text{diag.}}) - S(\rho_{L})$. There are two contributions of $\mathcal{C}(\rho_{L})$, the intrinsic coherence and local coherence, which measure the coherence between the bipartite system and the coherence on each qubits in the considered subsystem respectively. The intrinsic coherence the local coherence on each qubits are marked by the arrows. The total local coherence is directly proportional to the number of spins $L$ in the subsystem.}\label{Fig0} \end{figure} \begin{figure} \includegraphics[width=0.6\textwidth]{Fig1.pdf} \caption{The DE of pure states $S_{N}^{\text{diag.}}$ as a function of the length of chains $N$ for $\mathcal{H}_{1}$ (a) and $\mathcal{H}_{2}$ (b). The DE for a subsystem composed of $L$ continuous sites $S(\rho_{L}^{\text{diag.}})$ as a function of the length of subsystem $L$ for $\mathcal{H}_{1}$ (c) and $\mathcal{H}_{2}$ (d).}\label{Fig1} \end{figure} \subsection{\label{sec:level2} Scaling laws of diagonal entropy} We firstly explore the formulation of finite size scaling law of DE. The size of extended Kitaev chains reads $N$. As shown in Figs. \ref{Fig1}(a) and \ref{Fig1}(b), the numerical calculations indicate that there is a volume law for DE, i.e., \begin{equation} S^{\text{diag.}}_{N}=sN. \label{DE_scaling_k} \end{equation} It has been recognized that the validity of scaling laws may depend on the winding numbers of topological phases. For instance, the power-law scaling of QFI ~\cite{QFI_Topo_YRZ} and two-site scaling law of quantum coherence~\cite{QC_QPT1} for the topological phases with high winding numbers can only be observed in the dual lattice. It is remarkable that the scaling law (\ref{DE_scaling_k}) is not only true for the lower $\nu$ topological phases shown in Fig.~\ref{Fig1}(a) but also valid for the high $\nu=\pm 3$ topological phases indicated in Fig.~\ref{Fig1}(b). Then, we study the block scaling law of DE for the ground states of the extended Kitaev chains. The block scaling law show the relation between some quantities, such as EE, and the length of subsystem $L$ in a system with size $N$. The block scaling law of EE for the ground states of many-body systems, as the area law of EE~\cite{TEE1,TEE2,TEE3,EElog3,summary_EE1,summary_EE2}, is fully explored. Moreover, the volume law of the R\'{e}nyi entropy for scrambled pure quantum states~\cite{volume_1} and the DE for the ground states of quantum magnetism systems~\cite{volume_2} are revealed. The results presented in Fig. \ref{Fig1}(c) and \ref{Fig1}(d) indicate that the block scaling law of DE is \begin{equation} S(\rho_{L}^{\text{diag.}})=aL+b\log L+c, \label{scaling_block} \end{equation} which is still satisfied for the topological phases with higher winding number. The logarithmic term originates from EE because $S(\rho_{L}^{\text{diag.}}) = \mathcal{C}(\rho_{L}) + S(\rho_{L})$, and the block scaling law of EE for reduced ground states is $S(\rho_{L})\sim \log L$~\cite{EElog3}. The volume term can be explained from the perspective of distribution of quantum coherence~\cite{QC_QPT1,basis1}. The total quantum coherence can be divided into the intrinsic coherence and the local coherence, which measure the coherence between different parts and on each qubits respectively, see Fig. \ref{Fig0} for details. Thus, the local coherence, as a contribution of diagonal entropy, is naturally directly proportional to the number of qubits (the length of subsystem $L$). We also note that only the volume term survives for the DE of pure states since both the EE and intrinsic coherence vanish for the total ground state without partial trace. \begin{figure*}[t] \centering \includegraphics[width=0.9\textwidth]{Fig2.pdf} \caption{The susceptibility of DE density $\chi_{\mu}(s)$ as a function of $\mu$ with $\Delta=-1.5,0.5$ (a) and as a function of $\Delta$ with $\mu=0,1.5$ (b). The insets show the $s$ as a function of $\mu$ and $\Delta$, respectively. (e) The value of $s$ in the $\mu-\Delta$ plane, where the locations of non-analyticality of $s$ are marked by the solid white lines. (f) Phase diagram of $\mathcal{H}_{1}$ in the $\mu-\Delta$ plane, where topological phases are identified by different winding numbers $\nu$. Four cases are for the extended Kitaev chain $\mathcal{H}_{1}$ with $\alpha=+\infty$ and $J=1$. (c) (d) (g) (h) are similar to (a) (b) (e) (f) but with the parameters $\alpha=0$. It should be noted in (b) that $s$ is analytical and therefore the DE susceptibility $\chi_{\Delta}(s)$ is continuous at $\Delta=0$ with parameters $\alpha=+\infty$, $J=1$, and $\mu=1.5$, which suggests that the TPT doesn't occur under this condition. }\label{Fig2} \end{figure*} \subsection{\label{sec:level2} Results of diagonal entropy density} In the following, we pay attention to the DE density defined as $s=S^{\text{diag.}}_{N}/N$ for the finite size scaling law of DE and as the parameter $a$ in Eq. (\ref{scaling_block}) for the block scaling law of DE. We then explore its capability in signaling the existence of TPTs in the studied model. We calculate the DE density $s$ in the extended Kitaev chain described by $\mathcal{H}_{1}$. As shown in the insets of Figs.~\ref{Fig2}(a-d), $s$ behaves non-analytically at critical points where TPTs occur. In order to probe the TPTs, the idea of susceptibility is employed~\cite{QC_QPT2}. The DE density susceptibility with respect to the quantity $\mathcal{O}$ which drives TPTs is defined as $\chi_{\mathcal{O}}(s)=\partial s/ \partial\mathcal{O}$. The non-analytical behaviors of $s$ at critical points lead to the discontinuity of DE susceptibility $\chi_{\mathcal{O}}(s)$. From Figs.~\ref{Fig2}(a-d), we can find that the DE susceptibility $\chi_{\mu}(s)$ is able to spotlight the critical points of TPTs efficiently. The values of $s$ in the $\mu-\Delta$ plane with $\alpha=+\infty$ and $\alpha=0$ are shown in Figs. \ref{Fig2}(e) and \ref{Fig2}(g) respectively. The locations of non-analytical DE are highlighted by the solid white lines, which are consistent with the phase diagrams shown in Figs.~\ref{Fig2}(f) and \ref{Fig2}(h) obtained by numerically calculating the winding numbers. \begin{figure} \includegraphics[width=0.6\textwidth]{Fig3.pdf} \caption{(a) The DE density $s$ and (b) the DE susceptibility $\chi_{\mu}(s)$ as functions of $\mu$ with $r=3$, $\alpha=\beta=0.2$, $\Delta=1$ and $J=0.3,-0.8$ in the model $\mathcal{H}_{2}$. (c) The values of $s$ in the $\mu-\Delta$ plane with $\alpha=\beta=0.2$ and $\Delta=1$. The solid white lines mark the locations of discontinuous $\chi_{\mu}(s)$. (d) Topological phases in $\mathcal{H}_{2}$ with $\alpha=\beta=0.2$ and $\Delta=1$ characterized via winding numbers. It is noted that for $J_{1}=-0.8$, the locations of the critical points are $\mu_{c1}^{J_{1}}\simeq -1.5$, $\mu_{c2}^{J_{1}}\simeq -1$, $\mu_{c3}^{J_{1}}\simeq -0.42$, which are highlighted by the dashed red lines in (d), and for $J_{2}=0.3$, the locations of the critical points are $\mu_{c1}^{J_{2}}\simeq -1.6$, $\mu_{c2}^{J_{2}}\simeq 0.15$, $\mu_{c3}^{J_{2}}\simeq 0.36$, $\mu_{c4}^{J_{2}}\simeq 0.55$, which are highlighted by the dashed blue lines in (d). The locations of the critical points are consistent with the locations of discontinuous points as shown in (b).}\label{Fig3} \end{figure} In order to demonstrate the capability of DE in detecting TPTs related to the topological phases with high winding numbers, we study the DE in the extended Kitaev chain with both longer-range pairing and hopping described by $\mathcal{H}_{2}$. The phase diagram of $\mathcal{H}_{2}$ with $r=3$, $\alpha=\beta=0.2$, and $\Delta=1$ is shown in Fig.~\ref{Fig3}(d), and we can see that there exist the topological phases with winding numbers $|\nu_{\text{max}}|=3$ in this model. The dependence of values of DE density $s$ and its susceptibility $\chi_{\mu}(s)$ on parameter $\mu$ are displayed in Figs.~\ref{Fig3}(a) and ~\ref{Fig3}(b). The solid white lines in Fig.~\ref{Fig3}(c) mark the locations of discontinuous DE susceptibility, which coincide with the phase diagram of $\mathcal{H}_{2}$ given in Fig.~\ref{Fig3}(d). We can see that all the properties of the symmetry-protected TPTs including higher winding numbers can be sufficiently captured by the DE susceptibility. Furthermore, we plot the DE density extracted from the block scaling law $S(\rho_{L}^{\text{diag.}})=aL+b\log L+c$, i.e., the parameter $a$, as a function of $\mu$ for $\mathcal{H}_{1}$ with $\Delta = -1$, $\alpha=0$, $J=1$ in Fig. \ref{Fig4}(a). Comparing to the results of $\chi_{\mu}(s)$ at $\mu=1$ shown in Fig. \ref{Fig2}(c), the non-analytical behaviors of $\chi_{\mu}(a)$ at $\mu=1$ is similar to the DE density obtained from finite size scaling law. Thus the TPTs can be diagnosed via the discontinuity of susceptibility $\chi_{\mu}(a) = \partial{a}/\partial{\mu}$. Meanwhile, we can study the DE density $a$ for $\mathcal{H}_{2}$ with $\Delta = 1$, $\alpha=\beta=0.2$, where the topological phase with winding number $\nu=-3$ exists. Remarkably, as depicted in Fig. \ref{Fig4}(b), the DE density $a$ can also characterize the TPTs with high winding number topological phases. In comparison with~\cite{volume_2}, where the DE density $a$ in Ising model is studied, the non-analytical behaviors of $a$ can not be observed at the critical point associated with the quantum phase transition between ferromagnetic phase and paramagnetic phase. Instead, there is a dramatic change of $a$ and $a$ remains analytical and continuous at the critical point, which makes a distinction between the capability of $a$ in detecting (second-order) quantum phase transitions and topological phase transitions. Finally, we recognize that the DE is a basis-dependent quantity~\cite{basis1,basis2}. In above discussions, we only consider the DE in $\sigma^{z}$ basis. In order to demonstrate whether the formulation of DE block scaling law Eq.~(\ref{scaling_block}) and the capability of DE in detecting TPTs are dependent on the chosen basis or not, we numerically study the DE in $\sigma_{x}$ basis. As depicted in Fig. \ref{Fig_a} (a), the formulation of block scaling law for DE in $\sigma_{x}$ basis still satisfies the form of Eq.~(\ref{scaling_block}). Therefore, we can obtain the DE density $a$ by fitting the data of DE as a function of subsystem size $L$. The parameter $a$ and its susceptibility with respect of $\mu$, i.e., $\chi_{\mu}(a)$, as a function of $\mu$ are shown in Fig. \ref{Fig_a}, which indicates that the DE in $\sigma_{x}$ basis can be a probe of the critical points associated with TPTs. Hence, we argue that the formulation of DE block scaling law as well as the capability of DE in characterizing TPTs are independent of the chosen basis. As a side remark, in Appendix B, we study the parameters $b$ and $c$ in Eq. (\ref{scaling_block}), which suggests that the parameters $b$ and $c$ can also diagnose the TPTs. \begin{figure} \includegraphics[width=0.6\textwidth]{Fig4.pdf} \caption{The DE density $a$ for the block scaling law (inset) and the susceptibility of $a$ $\chi_{\mu}(a)$ as a function of $\mu$ for $\mathcal{H}_{1}$ with $\Delta = -1$, $\alpha=0$, $J=1$ (a) and for $\mathcal{H}_{2}$ with $\Delta = 1$, $\alpha=\beta=0.2$, $J=-0.8$ (b). As shown in Figs. \ref{Fig2}(c) and \ref{Fig3}(c), the locations of TPTs for the parameters in (a) and (b) are $\mu_{c}=1$ and $\mu_{c}\simeq -0.42$ respectively. }\label{Fig4} \end{figure} \begin{figure} \includegraphics[width=0.7\textwidth]{Fig_a1.pdf} \caption{(a) The value of DE $S(\rho_{L}^{\text{diag}.})$ as a function of subsystem size $L$ for $\mathcal{H}_{1}$ with $\Delta=-1$, $\alpha=0$, $J=1$ and $\mu=0.8$. The form of fitting curve satisfies Eq.~(\ref{DE}). (b) The parameter $a$ and its susceptibility with respect of $\mu$ $\chi_{\mu}(a)$ as a function of $\mu$ for $\mathcal{H}_{1}$ with $\Delta=-1$, $\alpha=0$, $J=1$.}\label{Fig_a} \end{figure} \subsection{\label{sec:level2} Results of global entanglement} \begin{figure} \includegraphics[width=1\textwidth]{Fig_a4.pdf} \caption{(a) The susceptibility of DE density $\chi_{\Delta}(a)$ as a function of $\Delta$ in $\mathcal{H}_{1}$ with $\alpha=0$ and $\mu=0,1.5$. The inset shows the DE density $a$ as a function of $\Delta$ in $\mathcal{H}_{1}$ with $\alpha=0$ and $\mu=0,1.5$. (b) The GE $E$ as a function of $\Delta$ in $\mathcal{H}_{1}$ with $\alpha=0$ and $\mu=0,1.5$. (c) The susceptibility of GE $\chi_{\Delta}(E)$ as a function of $\Delta$ in $\mathcal{H}_{1}$ with $\alpha=0$ and $\mu=0,1.5$.}\label{Fig_a4} \end{figure} \begin{figure} \includegraphics[width=0.7\textwidth]{Fig_a2.pdf} \caption{(a) The susceptibility of GE $\chi_{\Delta}(E)$ as a function of $\Delta$ in $\mathcal{H}_{1}$ with $\alpha=+\infty$ and $\mu=0.6$. The inset shows the GE $E$ as a function of $\Delta$ in $\mathcal{H}_{1}$ with $\alpha=+\infty$ and $\mu=0,0.6$. (b) The susceptibility of GE $\chi_{\Delta}(E)$ as a function of $\Delta$ in $\mathcal{H}_{1}$ with $\alpha=+\infty$ and $\mu=1.2$. The inset shows the GE $E$ as a function of $\Delta$ in $\mathcal{H}_{1}$ with $\alpha=+\infty$ and $\mu=1.2$. (c) The susceptibility of DE density $\chi_{\Delta}(a)$ as a function of $\Delta$ in $\mathcal{H}_{1}$ with $\alpha=+\infty$ and $\mu=0$. The inset shows the DE density $a$ as a function of $\Delta$ in $\mathcal{H}_{1}$ with $\alpha=+\infty$ and $\mu=0$. (d) Similar to (c) but with $\mu=1.2$.}\label{Fig_a2} \end{figure} We study the GE in the extended Kitaev chains to demonstrate its capability in detecting TPTs and compare its results with DE. Firstly, we calculate the GE for the ground states in $\mathcal{H}_{1}$ with $\alpha=0$ and $\mu=0,1.5$, and in this cases, the critical point is $\Delta_{c}=0$ (see Fig. \ref{Fig2}(h)). In Fig. \ref{Fig_a4}, the DE density $a$, the GE $E$ and their susceptibility $\chi_{\Delta}(a)$, $\chi_{\Delta}(E)$, as a function of $\Delta$ are depicted. There are non-analytical behaviors of $a$ and $E$ at the critical point $\Delta_{c}=0$ with $\mu=1.5$. Whereas, only the non-analytical behavior of $a$ at $\Delta_{c}=0$ can be observed for $\mu=0$, while $\chi_{\Delta}(E)$ is continuous at $\Delta_{c}=0$ indicating that GE exhibits analytical behavior. These results show that GE can not efficiently detect TPTs. We then provide another example to show the instability of GE and the robustness of DE as a probe of TPTs. As shown in Fig. \ref{Fig2}(b) and \ref{Fig2}(f), $\Delta_{c}=0$ is the critical point of TPT in $\mathcal{H}_{1}$ with $\alpha=+\infty$ and $\mu \in (-1,1)$, while for $\mu > 1$ or $\mu < -1$, there is no critical point of TPT. The GE in $\mathcal{H}_{1}$ with $\alpha=+\infty$ and $\mu=0,1.2$ are calculated. In the inset of Fig. \ref{Fig_a2}(a), we find that the GE $E\equiv1$ with $\mu=0$ and different values of $\Delta$, which suggests GE fails to diagnose the TPT. It is also shown that there is a dip of GE at the critical point $\Delta=1$ with $\mu=0.6$. Nevertheless, in Fig. \ref{Fig_a2}(b), similar behavior of GE is also observed at $\Delta=0$ with $\mu=1.2$ where the TPT is absent, and both of the susceptibility $\chi_{\Delta}(E)=\partial E/\partial\Delta$ at $\Delta=0$ with $\mu=0.6$ and $\mu=1.2$ are continuous. Moreover, the DE density $a$ with the same parameters are also calculated for reference. The results are depicted in Fig. \ref{Fig_a2}(c) ($\mu=0$) and \ref{Fig_a2}(d) ($\mu=1.2$). There is a non-analytical behavior of $a$ at the critical point $\Delta_{c}=0$ with $\mu=0$. But only the local minimum point of $a$ is observed at $\Delta=0$ with $\mu=1.2$, which indicates the absence of TPTs. A more obvious signature can be shown by the susceptibility of $a$ with respect of $\Delta$, i.e., $\chi_{\Delta}(a)=\partial a/\partial\Delta$. The $\chi_{\Delta}(a)=\partial a/\partial\Delta$ at $\Delta=0$ is discontinuous in $\mu=0$, while it is continuous in $\mu=1.2$. Based on above discussions, the GE can not be a genuine probe of TPTs. In condition that GE fails to characterize TPTs, the DE can still efficiently detect TPTs. \section{Conclusions} In conclusion, we have studied the diagonal entropy (DE) in the extended Kitaev chains with variable-range pairing and hopping. Firstly, we show that there is a volume term in the finite size scaling law and block scaling law of DE. The universality of the volume law is also demonstrated for the topological phases with high winding numbers. Secondly, the DE density, as the parameter of volume term, is numerical calculated. The non-analytical behaviors of DE density, equivalent to the discontinuity of its susceptibility, efficiently spotlight the critical points related to topological phase transitions (TPTs) in the Kitaev chains. Finally, we reveal that the global entanglement can not explicitly diagnose the TPTs, which makes a merit of DE as a probe of TPTs. It is well-known that experimentally addressing EE is still a challenge~\cite{exp_a1}. We emphasize that the DE can be measured more easily than EE via quantum tomography since only $2^{N}$ instead of $2^{2N}$ measurements are required for $N$ qubits system~\cite{exp_a2}. Consequently, DE is an experimentally feasible quantity that can detect TPTs. This work may shed light on a comprehensive understanding of the coherence and DE in topological superconductors. The method is well worthy extending to the characterization of the TPTs in two-dimensional systems~\cite{toric1,toric2,toric3,2D_add} and non-Hermite systems~\cite{non_H1,non_H2,non_H3}, as well as the TPTs with finite temperature~\cite{tem}. \begin{acknowledgments} Z.H.S. would like to thank Yu-Ran Zhang for useful discussions. Q.H. was partially supported by the National Key R$\&$D Program of China (Grants No. 2018YFB1107200 and No. 2016YFA0301302), National Natural Science Foundation of China (Grants No. 11622428, and No. 61475006), and thanks C.P. Sun at Beijing Computational Science Research Center for his hospitality. H.F. was partially supported by the National Key R$\&$D Program of China (Grants No. 2016YFA0302104 and No. 2016YFA0300600), National Natural Science Foundation of China (Grant No. 11774406), and Strategic Priority Research Program of Chinese Academy of Science (Grant No. XDB28000000). \end{acknowledgments}
\section{Introduction} The recent joint detection\cite{LIGO2017, Abbott2017} of electro-magnetic (EM) and gravitational wave (GW) emission from merging neutron stars (NS) has been one of the biggest scientific achievements of the past decades, revolutionising astrophysical observations and having far-ranging repercussions for transients high-energy astrophysics. Various predictions for a range of potentially detectable EM counterparts had been made prior to the detection of GW170817 / GRB 170817A, but the actual quality and quantity of the data wildly exceeded expectations: kilonovae had largely remained a theoretical construct up to this point, although the first tentative detections were getting published\cite{Tanvir2013,Berger2013}, while short gamma-ray bursts (sGRBs) and their subsequent afterglow jets were only expected for a subset of NS mergers due to their collimated nature. GRB 170817A of course provided us not just with a close view of a GW source, but also with a kilonova \emph{and} a GRB \emph{and} a long-lasting broadband afterglow. In these proceedings, I discuss in particular how the detection of the afterglow for this source has forced us to update our models for sGRB jets and afterglows. \section{GW170817 / GRB 170817A prompt emission and gravitational waves} Let us first recap the non-afterglow observations of GW170817 / GRB 170817A that nevertheless have an implication for our understanding of its afterglow. From the GW analysis, the angle $\theta_\nu$ between the angular momentum vector of the binary neutron has been inferred to be $\theta_\nu \approx 18^\circ \pm 8^\circ$ \cite{Abbott2017b, Mandel2018}, potentially pointing at an off-axis observation of the prompt and/or afterglow emission, in case the jet collimation angle $\theta_0 < \theta_\nu$. The source was detected in gamma rays, both by INTEGRAL\cite{Savchenko2017} and Fermi-GBM\cite{Goldstein2017}, before its gravitational wave signal was identified. The GRB was delayed by 1.7 s relative to the merger time. If the emission is indeed detected off-axis, this delay limits\cite{Abbott2017b, ShoemakerMurase2018, MatsumotoNakarPiran2018} the prompt emission radius $R_\gamma$ according to $t_{\gamma,\oplus} / (1+z) = t_\gamma - \cos(\theta_\nu - \theta_0) R_\gamma / c$, where $t_\gamma$ and $t_{\gamma,\oplus}$ the observed time in the burster and observer frame respectively, $z = 0.0098$ the redshift, $c$ the speed of light and $R_\gamma = \int_0^{t_\gamma} \beta_\gamma c \delta t$. For example, an offset $\theta_\nu - \theta_0 \approx 13^\circ$ would limit $R_\gamma \lesssim 2\times 10^{12}$ cm for $\beta_\gamma \uparrow 1$ (or smaller if the jet launching was delayed or the jet was moving non-relativistically before reaching $R_\gamma$). This radius is as expected\cite{Nakar2007} for internal shock dissipation, but at odds with Poynting flux dominated models or other models that put the dissipation closer to the deceleration radius. While labeled `an ordinary short GRB'\cite{Goldstein2017}, GRB 170817A did exhibit some nonstandard features (one other example that comes close to its behavior is GRB 150101B\cite{Abbott2017b, Troja2018GRB150101B, Burns2018}). Its isotropic equivalent prompt energy release $E_{\gamma,iso} \approx 5 \times 10^{46}$ erg, rendering it 2 to 6 orders of magnitude less energetic than other sGRBs. The burst consisted of a brief ($\sim 0.5$ s) smooth pulse, followed by weak soft emission between 1 and 2 seconds after the GBM trigger time\cite{Goldstein2017, Veres2018}. The gamma-ray spectrum of the initial peak is well described by a power law turning over into an exponential drop (the `Comptonized function' among the standard fit functions typically used, rather than e.g. the `Band' function or a smoothly broken power law), peaking at $E_{peak} = 229\pm 78$ keV. It is noteworthy that this peak value is typical, whereas $E_{\gamma,iso}$ is not, making the burst an outlier in the $E_{peak} - E_{\gamma,iso}$ plane\cite{Ghirlanda2009}. The later emission is best fit by a blackbody spectrum peaking at $k_B T = 10.3 \pm 1.5$ keV. The smoothness of the initital pulse is consistent with an off-axis observation smoothing out variability relative to an on-axis observation\cite{Salafia2016}. The minimum variability timescale for the peak, (taken to be the rise time of $0.125$ s) yields an upper limit on the size of the emission region of $\delta R \sim 4 \times 10^{13}$ cm\cite{Goldstein2017}. The Lorentz factor $\Gamma$ at the time of emission can be constrained in a number of ways \cite{Kasliwal2017, Troja2017, MatsumotoNakarPiran2018, Veres2018}, mostly implying an emission site that is at least mildly relativistic. The low energy of GRB 170817A can be explained by positioning the observer outside of the cone of a collimated outflow, diminishing the observed flux through off-axis relativistic beaming. But the angular dependency of relativistic beaming is extremely steep, so much that a typical flow with $\Gamma \sim 100$ on-axis (as expected for short GRBs\cite{Nakar2007, Berger2014}), would lead to a predicted energy even lower than what is observed. This issue can be resolved by moving the observer closer to the axis of the jet, lowering the Lorentz factor of the outflow to open up the beaming cone, or both. The limiting cases of this are either placing the observer inside of the sub-energetic wings of a jetted flow, or having only mildly relativistic quasi-spherical flow. However, this is not straightforward either if one wishes to avoid opacity issues due to electron-positron pair-production and Thomson scattering\cite{Troja2017, LambKobayashi2018}), although not impossible\cite{Mooley2018superluminal}. It is therefore possible that the prompt emission observed for GRB 170817A has been produced by a mechanism different from ordinary short GRBs. A discussion of the kilonova emission and properties lies beyond the scope of these notes. Nevertheless, the properties of the merger inferred from the kilonova emission also constrain the physics of the GRB prompt and afterglow. In particular, the are indications for a brief\cite{MetzgerThompsonQuataert2018} or extended\cite{YuLiuDai2018} period of energy injection by a magnetar-like remnant. For the latter case of a long-lasting remnant ($\gg 1$ second, which is not a natural fit given that the GW observations constrain internal magnetic fields to not be much lower than $\sim 10^{16}$ G\cite{Pooley2018}), short GRB afterglow plateaus come to mind, which have been argued to be produced by long-term energy injection from magnetar dipole spin-down. Any plateau stage for GRB 170817A would have been missed by an off-axis observer. \section{GRB 170817A and jet / blast wave toy models} Keeping the constraints from the non-afterglow measurements in mind, we now turn to the afterglow stage of GRB 170817A. The afterglow of GRB 170817A was first detected at radio and X-ray frequencies\cite{Hallinan2017, Troja2017} at around nine days, following a number of non-detections (upper limits) at these wavelengths\cite{Evans2017}. At the time when the first reports on this source became public, it was reasonable to interpret the data for these first two weeks as exhibiting signs of a flattening in the light curve, given that the flux levels for the second and third X-ray points were comparable after a rise relative to the first detection, and given that the radio detections were interspersed with another claimed upper limit\cite{Alexander2017}. The early non-detections made clear that we could not be witnessing an on-axis afterglow, whereas the apparent flattening was consistent with the peak emission from a basic collimated flow model. Here `basic' refers to the simplicity of the \emph{initial conditions}, a blast wave with an energy, mass and velocity distribution that is independent of angle up to some truncation angle $\theta_0$ (i.e. 'top-hat', the simplest non-spherical starting point). Off-axis observations with observers placed at $\theta_{obs} > \theta_0$ would see a steeply rising light curve as the relativistic beaming cone of the shock-accelerated electrons at the blast wave front come into view. Once the jet is into view completely, the light curve would turn over towards a decaying slope. However, the explanation of the afterglow light curve observations as revealing the turnover of top-hat jet emission quickly turned out not to be viable when renewed observations showed a continuing rise with $\alpha \approx -0.8$ in $t^{-\alpha}$, lasting longer than the turnover would have. This compounded issues already identified with the prompt emission in view of off-axis top-hat jet models (i.e. the extremely steep angular dependence of relativistic beaming), that led authors to include structured jet alternatives in the first batch of papers\cite{Troja2017, Hallinan2017}. The latest observations\cite{Troja2018b}, indicate a rising slope of $\alpha \approx -0.9$, a peak time $t_{p} = 164\pm 12$ days and finally a steep decay slope $\alpha \approx 2$. To understand the options from here, a brief review of popular jet morphologies in the context of new observations is in order (for an extensive older review on jets, see \cite{Granot2007}). {\bf \underline{basic top hat jets.}} The first jetted flow models\cite{Rhoads1997} for long and short GRBs simply assumed a forward shock moving ultra-relativistically and truncated at an angle that would start growing noticeably in the observer frame once the Lorentz factor dropped to $\gamma \approx 1 / \theta_0$ (in the observer frame, the sideways velocity is suppressed by this same factor $\gamma$; the turning point marks when spreading becomes clear to observers even when including this factor). Once spreading starts, this becomes a runaway effect due to the feedback between the increasing size of the working surface sweeping up external medium and the induced further decay of $\gamma$. For reasons of simplicity, this model includes no ininital angular jet structure (with radial structure either neglected in the case of homogeneous shell models, or taken from a self-similar solution\cite{BlandfordMcKee1976} before spreading). The evolution of such jets has been numerically simulated in detail, revealing the expected lateral structure of a shock system expanding sideways as well as forwards (see e.g. \cite{Meliani2007, ZhangMacFadyen2009, vanEerten2011, WygodaWaxmanFrail2011}). Fully numerically resolved simulations\cite{vanEertenMacFadyen2013} confirm that lateral expansion in these systems affects the decay phase slope of the light curve rather than the rising phase slope. For reasonable jet opening angles ($\theta_0 > 0.05$ rad), no runaway stage of expansion occurs in practice because the jet moves into the trans-relativistic stage approximately around the same time full causal contact across all angles is achieved (ultra-relativistic flow and full causal contact are necessary assumptions in runaway spreading models). In conclusion, off-axis top-hat jets remain ruled out by the rising slope, whether simulated numerically or solved (semi-) analytically. {\bf \underline{Power-law structured jets.}} A straightforward extension of the top-hat model is to impose lateral structure on the jet using a discrete number of lateral components or simple functional form such as a power law dependency on angle for the energy, $\epsilon \propto \theta^{-a}$ (e.g. \cite{LipunovPostnovProkhorov2001, RossiLazzatiRees2002}). One of the initial motivations for such models was to shift the observed variation in jet opening angles and energetics to jet orientation relative to the observer instead\cite{LipunovPostnovProkhorov2001, ZhangMeszaros2002}. This requires that the lateral drop in energy in energy is not too steep ($a < 2$), but such a shallow slope also has the implication that the afterglow emission must be bright and decaying for off-axis observers still within the wings of the jet. Given the late-time rise of GRB 170817A, this possibility is ruled out as well, and the remaining options for the lateral jet structure are those where the wings have little energy relative to the tip, e.g. through a steep power-law or even exponential dependence of energy on angle. {\bf \underline{Gaussian jets.}} Jets with a steep drop in energy $\epsilon$ with angle can also be modeled usings exponentials, i.e. $\epsilon \propto \exp [-\theta^2/2 \theta^2_c]$, with $\theta_c$ setting the width of the core. On-axis observers and observers at very small angles will observe a light curve that very closely resembles that produced by a top-hat jet (another practical reason why numerical simulations tended to start from top-hats), and observers at $\theta_{obs} \lesssim 4 \theta_c$ will see a declining signal from the beginning\cite{Rossi2004}. However, observers at larger angles will see a smoothly rising signal, as different regions come into view once the beaming cones of their relativistic emission have opened up sufficiently ---due to the deceleration of the jet--- to encompass the direction to the observer. During the rising stage this behaviour, where the emission is dominated by successively more energetic regions, is equivalent to observing a spherical blast wave with an ongoing injection of energy, and we return to this point below. Another attractive feature of (Gaussian) structured jets is that they manage to capture well the jet morphology produced by detailed numerical simulations of relativistic jet launching \cite{AloyJankaMueller2005} and breakout\cite{Morsony2007, MizutaAloy2009, Lazzati2017breakout, Kathirgamaraju2018, Margutti2018}. Once the entire jet has come into view, the effect will be similar to the top-hat jet case, and a steep decay of the light curve is seen comparable to that of a GRB observed on-axis post jet-break\cite{Rhoads1999, SariPiranHalpern1999}. {\bf \underline{Quasi-spherical blast waves with energy injection.}} A spherical blast wave model for the afterglow using regular afterglow parameters would show a bright decelerating light curve already at early times. On the other hand, the gamma-rays and afterglow of GRB 170817A might have been produced by a special subclass of GRB, or perhaps by something not normally detected as a GRB at all. One option here would be the (quasi-)spherical release of energy with only moderate velocity, perhaps a cocoon of material (e.g. neutron star merger debris\cite{Nagakura2014}) which has managed to absorb the energy of what would otherwise have been a collimated GRB jet. Initial predictions for quasi-spherical cocoon models included afterglow peak timescales of days\cite{NakarPiran2017, Lazzati2017}, rather than the observed weeks for GRB 170817A. This timescale is set by the deceleration radius of the ejecta. If the peak time is to match that observed for GRB 170817A, the deceleration time needs to be artificially postponed. A natural means to do so, would again be to invoke additional structure in the outflow, this time radial rather than lateral. Indeed, the right peak times can be achieved by assuming a stratification of cocoon outflow velocities behind the front of the shock, effectively acting as a mechanism for the long-term injection of energy\cite{Mooley2018}. There is ample precedent for models including velocity stratification, both for GRBs\cite{ReesMeszaros1998} and kilonova ejecta\cite{Metzger2017}. During the rising light curve stage, it is fundamentally not possible to distinguish observationally between radial energy injection and lateral energy `injection' (i.e. more energetic regions coming into view). However, following the peak, the light curve slope is not expected to be steep\cite{Troja2018}, and to fall well short of the recently measured value\cite{Troja2018b}. Of all jet toy models, it turns out that the Gaussian jet plus off-axis observer configuration is the most successful in capturing the observed features of GRB 170817A\cite{Troja2018, Troja2018b}, from initial non-detections to extended shallow rise and turnover to steep decay. Basic cocoon models would have peaked on a timescale comparable to the kilonova. Relativistic jets with extended energetic wings would have been visible too soon. The top-hat jet profile is unable to account for an extended shallow rise. Quasi-spherical (cocoon) models with radial energy injection will ultimately end up decaying according to the non-relativistic Sedov-Taylor solution for a non-relativistic point explosion\cite{FrailWaxmanKulkarni2000}, perhaps slightly steeper on account of lateral spreading, when merely wide-angled rather than quasi-spherical\cite{LambMandelResmi2018}. Either slope will fall short of the observed slope by a large margin, and will only be achieved at larger timescales than currently observed anyway. \subsection{Successful jets, choked jets and cocoons} While a staple of jet modeling of active galactic nuclei and long GRBs for decades, cocoons are a new arrival when it comes to the modeling of short GRBs\cite{Murguia-Berthier2014, Nagakura2014}. Cocoons are produced when (part of) the jet energy gets dissipated in a dense medium before emergence into the more dilute circumburst environment. It is an open question whether enough dense material, for example debris from the neutron star merger, is present in the path of the jet to materially effect its evolution. Numerical studies of the ejection of merger debris show that this can be concentrated along the orbital plane\cite{Rosswog1999}, but also more isotropic in the case of a soft neutron star matter equation of state\cite{Hotokezaka2013}. The jet can be choked completely if the combination of jet opening angle and merger debris is sufficiently high (e.g. total quasi-isotropic ejecta mass of $10^{-2} M_\odot$, combined with a wide-angled jet injection of $~45^\circ$, depending on jet power\cite{Nagakura2014}). In the choked jet case, a quasi-spherical trans-relativistic blast wave is formed. As stated above, a choked jet scenario appears ruled out by recent observations, but this does not imply the absence of a cocoon entirely. Successful jet breakout with a prominent cocoon component has been simulated by various groups\cite{Kasliwal2017, GottliebNakarPiran2018, Lazzati2018, Xie2018}. This leads to a structured jet that can be modeled using the semi-analytical approaches already described. When it comes to the broadband afterglow light curve of GRB 170817A, the data is by this point consistent with a successfully launched jet with significant angular structure that potentially includes a cocoon component. \section{Synchrotron emission from the afterglow} There is little doubt that the predominant emission mechanism during the afterglow phase is synchrotron emission. Afterglow detections covering nine orders of magnitude in frequency (i.e. from radio to X-rays) are fully consistent with a single power law spectrum\cite{Troja2017, Haggard2017, Troja2018, Margutti2018, Alexander2018, Ruan2018, Troja2018b}. Interpreted as being part of the synchrotron spectrum between the \emph{injection break} $\nu_m$ (associated with the lower cut-off of the shock-accelerated power-law electron population) and the \emph{cooling break} $\nu_c$ (beyond which the impact of the synchrotron energy loss term on the electron population becomes noticeable), the measured spectral slope $\beta = 0.585 \pm0.005$ implies an electron power law slope $-p = -2.17 \pm 0.01$. The nine orders of magnitude represent a remarkable stretch for a single power law: radio observations (albeit on-axis ones) often fall below $\nu_m$ initially, and the cooling break $\nu_c$ is often found between optical and X-rays for afterglows\cite{Greiner2011}. Nevertheless, once the off-axis orientation of the observer is taken into account, the afterglow spectra for GRB 170817A can be fit using otherwise reasonable values for the model parameters\cite{Troja2017, LambKobayashi2018, Troja2018, Troja2018b}. Figure \ref{spectrum_figure} illustrates the broader synchrotron spectrum for variables in this range, including turnover points. A cooling break this high could actually be less relevant to the spectrum than the upper cut-off on the emission resulting from the balance between particle acceleration timescale and synchrotron loss timescale for electrons at very high energies (i.e. the electrons predominantly responsible for high frequency photon emission). Approximations of this timescale are typically based on a comparison between electron gyroradius and characteristic time for synchrotron energy loss\cite{DaiCheng2001}. Two further complications to modeling electron cooling are that there can also be additional cooling due to synchrotron self-Compton losses, and that estimates for the cooling break are highly sensitive to the level of detail that is applied to modeling the \emph{local} cooling rate of electrons advected from the shock front\cite{GranotSari2002, vanEertenZhangMacFadyen2010, Guidorzi2014}. \begin{figure}[htb] \begin{center} {\includegraphics[scale=0.6]{spectrum.eps}}\hspace{0.5cm} \caption{Synthetic spectra for an off-axis structured jet GRB with physics settings comparable to those inferred for GRB 170817A around 150 days, using different approximations to electron cooling. Here $Y$ is the Compton $Y$-parameter, to account for an additional impact on the electron cooling rate from synchrotron self-Compton losses.} \label{spectrum_figure} \end{center} \end{figure} The value $p = 2.17$ lies in between the two typical limiting values for $p$ expected from theoretical considerations. For particle shock-acceleration in non-relativistic blast waves, $p = 2$ is expected\cite{Bell1978, BlandfordOstriker1978, BlandfordEichler1987}. For the case of ultra-relativistic blast waves, various authors have argued for $p \approx 2.2-2.4$, based on particle-in-cell simulations and (semi-)analytical methods\cite{Kirk2000, Achterberg2001, Spitkovsky2008}. It is therefore tempting to interpret\cite{Margutti2018} the precise measurement of $p = 2.17 \pm 0.01$ for GRB 170817A directly within this framework as being indicative of a moderately relativistic blast wave Lorentz factor with a Lorentz factor $\Gamma \approx 3-10$. However, decades of afterglow modeling (as well as modeling of other synchrotron sources such as blazars), have established an overall observational range and distribution of $p$ values that is at minimum observationally at odds with this direct interpretation. Multiple authors have demonstrated that the distribution of $p$ as measured for various samples of afterglows, is not consistent with a universal value\cite{ShenKumarRobinson2006, Curran2009, Curran2010}, nor does $p$ exhibit a general hardening trend over time when spectral energy distributions are compared over multiple epochs\cite{Varela2016} (such a trend which would manifest itself both in a changing spectral slope and in the light curve temporal slope). As a matter of fact, $p$ has even been measured\cite{DaiCheng2001, PanaitescuKumar2001, Filgas2011, ZhangHuangZong2015} to have values $p < 2$ including measurements using broadband observations covering many orders in magnitude (e.g. $p = 1.73 \pm 0.03$\cite{Varela2016}). It is not (yet) clear whether the view of particle acceleration allowed by an off-axis event such as GRB 170817A is fundamentally more clear than that for the larger sample of shock-accelerating systems. \section{Closing remarks} In all, the long-term evolution of the broadband afterglow light curve of GRB 170817A has been remarkably successful. The late rise was instrumental in ruling out an observer positioned within the opening angle of a relativistic outflow, implying either an observer positioned outside of the jet, or no successful jet and a trans-relativistic quasi-spherical explosion. The continued rise then ruled out off-axis jet models with hard edges and single-shell cocoon models, requiring a structured jet or velocity stratification within a cocoon model. Ultimately, the turn-over to steep decay served to rule-out quasi-spherical models entirely. In addition, we now even have very large baseline interferometry (VLBI) observations for the same source. The apparent source size at 207.4 days has been constrained to be less than 2 milliarcseconds\cite{Ghirlanda2018}, which is too small to be consistent with an isotropic, mildly relativistic blast wave such as the cocoon-type models described above. Other VLBI observations\cite{Mooley2018superluminal} reveal superluminal motion consistent with the energetic and narrow core of a structured jet. Taken together, the afterglow evidence is becoming compelling that, like other short GRBs, GRB 170817A came with a collimated relativistic jet, and that the GW170817 / GRB 170817A event has become the smoking gun for the short GRB / neutron star merger connection. Observations of future event will tell whether there is on occasion sufficient material in the path of the outflow to give rise to sub-population of choked jet explosions. However, even if the afterglow can be reconciled with the `typical' expected behaviour for short GRBs, the prompt emission does remain puzzling and atypical. Observationally, the energy is very low, but neither off-axis beaming nor low Lorentz factor explanations are a completely satisfactory solution. It remains an open question whether the prompt emission has been produced by the same mechanism as that observed for short GRBs in general. And even in the case the prompt emission was produced differently, it is not clear whether the normal process genuinely did not occur or was merely not detectable at our observational angle.
\section{Introduction} Ultra-luminous X-ray Sources (ULXs) are non nuclear point-like extragalactic X-ray sources with bolometric luminosity higher than the Eddington limit for a 10$M_{\odot}$ black hole ($L_{Edd} \sim 2 \times 10^{39}$ erg s$^{-1}$; \citealt{1989ARA&A..27...87F}). The majority of them are X-ray binaries with a neutron star (NS) or a black hole (BH), most probably accreting above the Eddington limit. In the past years, there has been an extensive debate on the possibility that the compact object is a stellar or a massive stellar BH accreting above Eddington (\citealt{2009MNRAS.400..677Z,2009MNRAS.395L..71M,2010ApJ...714.1217B,2011NewAR..55..166F}), or an Intermediate mass Black Hole accreting sub-Eddington \citep{1999ApJ...519...89C}. The recent discovery of pulsating ULXs (\citealt{2014Natur.514..202B,2016ApJ...831L..14F,2017Sci...355..817I,2017MNRAS.466L..48I}) led to the conclusion that the accretor can in fact also be a NS. In the last 15 years a significant number of stellar optical counterparts of ULXs have been identified and progressively investigated in detail by several authors (e.g. \citealt{2002ApJ...580L..31L,2004ApJ...603..523Z,2005MNRAS.356...12S, 2007ApJ...658..999M,2008A&A...486..151G,2011ApJ...734...23G}). \cite{2011ApJ...737...81T} and \cite{2013ApJS..206...14G} performed an homogeneous reanalysis of all the available {\it Hubble Space Telescope} ({\it HST}) photometric data of stellar counterparts of ULXs. In the majority of the cases, they appear to be hosted in young stellar environments (e.g. \citealt{2006ApJ...641..241R,2006IAUS..230..293P,2007ApJ...661..165L,2008A&A...486..151G,2011ApJ...734...23G}) and have magnitudes and colours consistent with those of O-B type stars. As for Galactic X-ray binaries, the optical emission of ULX binaries originates from the donor star and the outer regions of the accretion disc. The X-ray flux produced in the innermost regions of the disc can intercept the outer regions and be thermalized, resulting in an enhancement of the optical-IR flux (e.g. \citealt{1993PASJ...45..443S} for standard accretion onto a Schwarzschild BH). The peculiar character of ULX binaries is that X-ray irradiation could be dominant also for massive donors.\\ Comparison of stellar evolutionary tracks of ULXs with the photometric properties of their optical counterparts on the colour-magnitude diagram may be used to constrain the masses of their donor stars (e.g. \citealt{2005MNRAS.356...12S,2005MNRAS.362...79C,2007MNRAS.376.1407C}). \cite{2008MNRAS.386..543P,2010MNRAS.403L..69P} (hereafter PZ and PZ2, respectively) produced evolutionary tracks of ULXs binary systems accreting onto a BH via a standard self-irradiated accretion disc. They showed that a massive donor is needed to fuel persistent ULXs at the required rates (see also \citealt{2005MNRAS.364..344P,2005MNRAS.356..401R}) and provided constrains on both the donor and the BH. Several ULXs are also associated with very extended optical emission nebulae, that give important information on their energetics and lifetime \citep{2002astro.ph..2488P,2003MNRAS.342..709R}. In this work we consider a ULX with a stellar or massive-stellar BH accreting super-Eddington. This configuration can explain some basic facts concerning the X-ray spectral components and the short-term variability at high energies observed in some ULXs (\citealt{2015MNRAS.447.3243M}) and is supported also by the detection of emission lines and blueshifted absorption lines from highly ionized Fe, O and Ne in high-resolution X-ray spectra (\citealt{2016Natur.533...64P}). Super-critical accretion was considered already in \cite{1973A&A....24..337S}, who proposed that in such conditions radiation pressure could originate an outflow from the innermost regions of the accretion disc. \cite{1988ApJ...332..646A} first studied in detail the properties of such optically thick, advection-dominated accretion discs (slim discs). More recently, supercritical accretion onto BHs has been studied by means of 2D radiation and magneto-hydro simulations, that show the formation of an advection-dominated disc and an outflow region, with powerful clumpy winds driven by radiation pressure (e.g. \citealt{2009PASJ...61..783T,2011ApJ...736....2O,2013PASJ...65...88T}). In the following we study the evolution of ULXs binary systems and compute their optical emission assuming that they accrete onto a BH via a non standard, advection-dominated slim disc with an outflow. The plan of the paper is the following. In Section 2 we summarize the model of PZ for Eddington-limited accretion in ULX binaries, which is at the base of this work. In Section 3 we describe the implementation of our model for super-Eddington accretion in ULX binaries. In Section 4 we show the evolutionary tracks of our systems in the color-magnitude diagram and analyze the results obtained with and without an outflow. We then show a preliminary application of our model to NGC 1313 X-2 and NGC 4559 X-7. Finally, in Section 5 we discuss our results and further developments of this work. \section{Self-irradiated accretion discs in ULX binaries: the PZ model} The starting point of our calculation is the model of PZ, that includes X-ray irradiation. As in PZ, we compute the evolution of representative ULX binary systems with black holes (BHs) of 20 and 100$M_{\odot}$, and donor masses in the range between 8-25 $M_{\odot}$. The system is evolved up to the giant phase by means of an updated version of the Eggleton code. The emission properties and the track followed on the colour-magnitude diagram (CMD) are computed with a dedicated code during the contact phases. We assume Population I chemical composition (Helium abundance Y = 0.28, metal abundance Z = 0.02), a mixing length parameter $\alpha = 2.0$ and an overshoot constant $\delta_{ov}=1.2$. Wind mass loss from the donor has been taken into account following the prescription in \citealt{1988A&AS...72..259D} (see \citealt{2005MNRAS.364..344P}, \citealt{2006ApJ...640..918M} and PZ for details). However, accretion takes place only when the donor fills its Roche Lobe. In PZ accretion is assumed to be always sub-Eddington and the accretion rate is not allowed to exceed the critical rate $\dot{M}_{crit} \simeq 10 \dot{M}_{Edd}$ (for a standard efficiency of 0.1; $\dot{M}_{Edd} = L_{Edd}/c^2$). Once the mass transfer rate sets in, a standard accretion disc (\cite{1973A&A....24..337S}) forms. Its inner and outer radii are assumed to be equal to $r_{in} = 6 r_{g}$, where $r_{g}$ is the gravitational radius, and $r_{out} = 2 r_{circ}$, where $r_{circ}$ is the circularization radius.\footnote{The circularization radius $r_{circ}$ is defined as the radius where the Keplerian angular momentum is equal to the angular momentum of the gas streaming from the inner Lagrangian point. The accreting gas settles initially at $r_{circ}$ and then spreads at smaller and larger radii because of viscous dissipation and conservation of angular momentum, forming a disc (see e.g. \citealt{frank2002accretion}, chapter 5.2 for details). Typically, $r_{circ}$ is a significant fraction of the Roche lobe radius, so that the disc outer boundary $r_{out}$ cannot extend more than a few times $r_{circ}$. We take $r_{out} = 2 r_{circ}$ as a reference value.} A fraction of the X-ray flux emitted from the inner regions of the disc is absorbed and thermalized in the outer parts. Following \cite{2005MNRAS.362...79C}, the local temperature stratification induced by such X-ray heating is given by: \begin{equation} \centering T(\tau) = \Bigl\{\frac{\pi}{\sigma}\Bigl[B_{x}(\tau)+B_{d}(\tau)\Bigr]\Bigr\}^{1/4} \, . \label{eq:temp_strat} \end{equation} Here $B_{x}(\tau)$ is the energy flux originating from X-ray irradiation, while $B_{d}(\tau)$ refers to the contribution of viscous heating. The former takes the form: \small \begin{eqnarray}\label{eq:bbirr} &&B_{x}(\tau)=\frac{1}{2} S_{x}\biggl\{ k_{s}f_{s}(\alpha)\left(\frac{\xi}{1+\xi}\right)\left[A_{s}-\left(A_{s}-\frac{1}{2}\right)e^{\tau/A_{s}}\right] \nonumber \\ && +k_{h}f_{h}(\alpha)\left(\frac{1}{1+\xi}\right)\left[A_{h}+\left(A_{h}-\frac{1}{2}\right)e^{\tau/A_{h}}\right]\biggr\}. \end{eqnarray} \normalsize where $S_{x}$ is the incident X-ray flux absorbed by an annulus of the disc, $\tau$ is the optical depth to optical photons, $\xi = S_{h}/S_{s}$ is the hardness parameter (ratio of the hard and soft X-ray flux), $k_{s}$ and $k_{h}$ are the opacities (in units of the electron scattering opacity) for the soft and hard components of the incident radiation, $f_{s}(\alpha)$ and $f_{h}(\alpha)$ are functions that depend on the geometry of the system ($\alpha$ being the angle of incidence of the X-rays measured from the normal to the surface), $A_{s} = cos(\alpha)/k_{s}$ and $A_{h} = cos(\alpha)/k_{h}$. The incident X-ray flux has been calculated from the following expression: \begin{equation} S_{x}= \frac{L_x}{(1-A)4\pi r^2} \label{eq:irr_stand} \end{equation} where $L_{x} = \eta \dot{M}c^2$ is the bolometric luminosity of the source and $A$ is the albedo to X-rays, fixed at $A = 0.9$\footnote{Varying the value of the albedo $A$ between 0.7 and 0.95 has no major effects on the position and shape of the evolutionary tracks on the CMD, as shown in PZ2.}. The disc spectrum is calculated integrating over the disc annuli and assuming that they emit as black bodies at the temperature given by equation~(\ref{eq:temp_strat}) (where we set $\tau = 2/3$ as the photospheric optical depth). Concerning the star, assuming it at a distance equal to the binary separation $\textit a$, its temperature is given by an expression similar to equation~(\ref{eq:temp_strat}): \begin{equation} T_{star} = \Bigl[T^4_{unirr,star}+T^4_{irr,star}\Bigr]^{1/4} \, , \label{eq:temp_stratstar} \end{equation} where $\sigma T^4_{unirr,star}$ and $\sigma T^4_{irr,star}$ represent the energy fluxes of the unirradiated star and that originating from X-ray irradiation, respectively. The latter is calculated from: \begin{equation} T_{irr,star} = \Bigl[\frac{L_{x}(1-A)}{8 \pi \sigma a^2 }\Bigr] \, . \label{eq:irrstar} \end{equation} For further details on the adopted irradiation model we refer to PZ, \cite{2001MNRAS.320..177W}, and \cite{2005MNRAS.362...79C}. \subsection{Photometry of the donor}\label{subs:phot} In order to perform a direct comparison of the emission properties of ULX binary systems with the available {\it HST} photometric measurements, in the present version of the code we implemented a different method for calculating the magnitudes of the donor stars. While PZ perform an interpolation of the tabulated magnitudes and bolometric corrections (BC) reported in \cite{cox1999editor}, here we use the code of \cite{2003MmSAI..74..474G} to calculate the donor magnitudes for a given luminosity, mass and metallicity. Thus, output magnitudes of the donor are now given in different photometric systems, including the Johnson and {\it HST} systems. \section{Modelling super-Eddington accretion in ULX binaries} In the present model, when the accretion rate is below the Eddington limit, the treatment of the accretion flow follows that of PZ. However, in ULX binaries the mass transfer rate from the donor can exceed the Eddington rate. When $\dot{M}\geq \dot{M}_{crit}$, accretion can no longer proceed via a standard thin disc and a bimodal structure is assumed: an inner disc with non-standard disc geometry and temperature profile (vertical scale height comparable to the radius and $T \propto r^{-1/2}$), and an outer disc with standard structure. In addition, a massive optically thick outflow (with an inner advection dominated region) is assumed to set in. In these physical conditions, also the geometry of X-ray irradiation varies. \cite{1988ApJ...332..646A} investigated accretion at $\dot{M}\geq \dot{M}_{crit}$ assuming a vertically integrated disc structure. In these discs (usually referred to as slim discs) the radial infall velocity and the horizontal pressure gradient become important and can no longer be neglected in the Euler equation. The radial infall velocity of the gas is comparable to the rotational velocity. As the optical depth in the disc is very large, the radiation diffusion timescale becomes larger than the infall timescale and the gas transports a large fraction of the internal energy inwards, producing a strong horizontal heat flux. Such an advective cooling changes the energy balance of the disc. As a consequence, the disc scale height and the radial temperature profile differ significantly from the standard case. Moreover, a large fraction of the advected heat is accreted by the BH and the disc luminosity is no longer proportional to the accretion rate, but tends asymptotically to $\approx 10 L_{Edd}$ \citep{2000PASJ...52..133W}. When the luminosity exceeds the Eddington limit, the huge pressure force produced by the emitted X-ray flux effectively removes gas from the surface of the disc, overcoming the gravitational force and leading to the formation of a massive radiation-driven outflow. This effect is clearly seen in recent 2D magneto-hydro simulations of super-Eddington accretion (e.g \citealt{2013PASJ...65...88T}). Observational evidence of the existence of high velocity outflows in ULXs comes from the discovery of emission and absorption lines in their optical (\citealt{2015NatPh..11..551F}) and X-ray \citep{2016arXiv161100623P} spectra. Then, in the following we assume that, when the mass transfer rate exceeds the Eddington limit, a bimodal disc structure sets in: an outer standard disc and an inner advection-dominated slim disc with an outflow. The radius where the transition between the two regimes occurs, as well as the onset and extension of the outflow, depend on the mass transfer rate. \subsection{Bimodal disc without outflow}\label{ssec:advection_no_outflow} As a starting point towards a full implementation of our model, we first consider the case of an hybrid (inner advection-dominated plus outer viscosity-dominated) disc structure without an outflow. The innermost and outermost radii of the disc are $r_{in} = 6 r_{g}$ and $r_{out} = 2 r_{circ}$. For the inner slim disc we adopt the parameterization (for self-similar solutions) of \cite{2000PASJ...52..133W}. They define the boundary radius $r_{0}$ as the radial coordinate where the structure of the disc changes (the inward advected heat is equal to the viscously dissipated heat). It is: \begin{equation} r_{0} \propto \dot{m} r_{g} \, , \label{eq:r0} \end{equation} where $\dot{m}=\dot{M}/\dot{M}_{Edd}$. As $\dot{m}$ increases, the inner slim disc becomes more and more extended. This bimodal configuration affects the temperature profile (and hence the emitted spectrum) of the disc: in the inner region, where advection dominates, the temperature varies as $T(r) \propto r^{-1/2}$, while in the outer region, where viscous heating is dominant, $T(r) \propto r^{-3/4}$. Fig.~\ref{fig:lum} shows the luminosity calculated integrating the emitted flux over all the annuli of the disc and assuming local blackbody emission. When advection becomes important, the disc luminosity significantly overcomes the Eddington limit but it never exceeds $\approx 10 L_{Edd}$ (\citealt{1999PASJ...51..725W,2000PASJ...52..133W}). In fact, as $\dot m$ increases, the photon mean free path becomes progressively smaller and the radiation diffusion timescale progressively larger. As a consequence, more and more internal energy is effectively advected inward on a dynamical timescale and not radiated away. \begin{figure} \includegraphics[width= \columnwidth]{fig1_new.pdf} \caption{Luminosity of a bimodal disc without outflow as a function of the mass transfer rate. The curve is obtained plotting the luminosity calculated at different phases and for different systems (donors of 10 and 25 $M_{\odot}$, BHs of 20 and 100 $M_{\odot}$). } \label{fig:lum} \end{figure} The geometry of the inner slim portion of the disc significantly affects also self-irradiation. The flux emitted from the inner regions intercepts the outer parts if $dH/dr \ll 1$ and $H/r \ll 1$ (see e.g. \citealt{frank2002accretion}). In the inner regions of a slim disc $H \simeq r$ and therefore the X-ray flux produced inside is not able to illuminate the outside. In these conditions the geometry of disc self-irradiation must be reconsidered. \begin{figure} \centering \includegraphics[width =\columnwidth]{fig2.pdf} \caption{Inner slim disc and outer standard disc scale height (in units of $2 r_g$ and in logaritmic scale) in our bimodal-disc model ($\dot m = 509$). The portion of the standard disc that can irradiate the outer regions is that between $r_0$ and $r_x$.} \label{fig:xrayregion} \end{figure} \subsubsection{Geometry of disc self-irradiation} In our hybrid disc structure the X-ray irradiating flux is produced outside the boundary radius $r_{0}$. In these conditions, the fact that X-ray emission from the inner disc is isotropic or partially beamed has no effect on the outside region. We consider as irradiating flux all the radiation emitted between radii $r_0$ and $r_{x}$, where $r_{x}$ marks approximately the boundary of the region where the gas temperature falls within the X-rays-ultraviolet (UV) energy band (see Fig.~\ref{fig:xrayregion}). If the temperature at $r_{0}$ is lower than $\simeq 5 \times 10^5$ K, no X-ray irradiation takes place. The extension of the irradiating region ($\Delta r = r_{x}-r_{0}$) for BHs of 20 $M_\odot$ and 100 $M_\odot$ is shown in Fig.~\ref{fig:irr_region}. The extension of the irradiating region depends on the mass transfer rate, since both $r_{0}$ and $r_{x}$ depend on $\dot m$. $\Delta r$ reaches a maximum at around a few thousands ${\dot m}$ and then decreases sharply. The irradiation luminosity shows a similar trend with the mass transfer rate. Clearly, the irradiating region is less extended than in the standard case. However, the X-ray-UV irradiation luminosity is bigger, because the flux increases with the mass transfer rate. \begin{figure} \includegraphics[width = \columnwidth]{deltar_vs_mdot_in_solar_mass_year_and_cm_new.pdf} \caption{X-ray-UV irradiating region of the disc for the model without outflow ({\it dashed} line) and with outflow ({\it solid} line). The ({\bf red}) curves on the top refer to a BH of $100 M_{\odot}$f, while the ({\bf orange}) curves on the bottom to a BH of $20 M_{\odot}$. For the case without outflow $\Delta r = r_{x}-r_{0}$, while for the case with outflow $\Delta r = r_{x}-r_{ph}$.} \label{fig:irr_region} \end{figure} As the results of the evolutionary tracks with a bimodal disc structure without an outflow are likely not to be directly relevant for modelling ULXs, they are reported in Appendix ~\ref{appendix:app} and are no longer discussed further. \begin{figure} \includegraphics[width = \columnwidth]{fig3_v2.pdf} \caption{Luminosity of a bimodal disc with outflow as a function of the accretion rate. The {\it dashed} line is the expression reported in equation~(\ref{eq:ltotp}), while the {\it dotted} lines are the values computed for our models (donor mass of 10 $M_\odot$ and 20 $M_\odot$, BH masses 20 $M_\odot$ and 100 $M_\odot$).} \label{fig:lpout} \end{figure} \subsection{Bimodal disc with outflow} In addition to a bimodal disc, we included in our model of ULX binaries also an optically thick outflow. For sufficiently large $\dot m$ the outflow can cover all the slim disc and part of the standard disc. Following the treatment of \cite{2007MNRAS.377.1187P} (to which we refer for a detailed discussion), the outflow can be divided in four zones, depending on the optical depth (measured in the direction perpendicular to the disc plane) and on the mechanism involved in the energy transport. They are delimited by three characteristic radii: $r_{ph,in}$ and $r_{ph,out}$ mark the inner and outer radial locations of the photosphere, while $r_{sph}$ (spherization radius; \citealt{1973A&A....24..337S}) is the radius below (above) which energy transport is dominated by the outward advected heat (radiation diffusion). The expression of these radii is given by \citep{2007MNRAS.377.1187P}: \begin{eqnarray} \frac{r_{ph,in}}{r_{in}} & \approx & 1 + \frac{1}{3\epsilon_{w}} \\ \frac{r_{sph}}{r_{in}} & \approx & \left[ 1.34 - 0.4\epsilon _{w} + 0.1\epsilon ^{2}_{w} \right. \nonumber \\ && \left. - (1.1 - 0.7 \epsilon _{w}) \dot{m_{0}}^{-2/3} \right] \dot{m_{0}} \\ \frac{r_{ph,out}}{r_{in}} & \approx & 3 \epsilon _{w} \dot{m}_{0}^{3/2} \, , \label{eq:routflow} \end{eqnarray} where $\dot{m}_{0}=\dot{M}/\dot{M}_{crit}$ and $\epsilon_{w}$ is the fraction of radiative energy spent in accelerating the outflow. Following \cite{2007MNRAS.377.1187P}, we set $\epsilon_{w} = 0.5$. In terms of these radii the outflow is divided in four zones: \begin{itemize} \item zone A is the inner optically thin part of the outflow at $r < r_{ph,in}$; \item zone B is the inner optically thick part of the outflow between $r_{ph,in}$ and $r_{sph}$, where outward advection of energy dominates; \item zone C is the outer optically thick part of the outflow between $r_{sph}$ and $r_{ph,out}$, where diffusion of radiation dominates; \item zone D is the outer optically thin part of the outflow at $r > r_{ph,out}$. \end{itemize} We approximate the temperature profile of the outflow in regions B and C with the following expressions: \begin{eqnarray} && T_{B}(r) = T_{r_{sph}}\bigg(\frac{r}{r_{sph}}\bigg)^{-1/2} \\ && T_{C}(r) = T_{r_{sph}}\bigg(\frac{r}{r_{sph}}\bigg)^{-3/4} \, , \label{eq:toutflow} \end{eqnarray} where $T_{r_{sph}} = 1.5m^{-1/4}\dot{m_{0}}^{-1/2}(1+0.3\dot{m_{0}}^{-3/4})(1-\epsilon _{w}) \, {\rm keV}$ is the temperature at the spherization radius. The total luminosity of the system is calculated integrating the emitted flux over all the annuli of the disc for $r_{in} < r < r_{ph,in}$ and $r_{ph,out} < r < r_{out}$, and over all radial slices of the outflow for $r_{ph,in} < r < r_{ph,out}$. Local blackbody emission at the appropriate temperature is assumed. The final expression of the emitted luminosity is \citep{2007MNRAS.377.1187P}: \begin{equation} L \approx L_{Edd} \left( 1+\frac{3}{5}\ln \dot{m_{0}} \right) \, . \label{eq:ltotp} \end{equation} This luminosity is shown in Fig.~\ref{fig:lpout}, along with that computed from our models (see below). The fractional difference is at most $10\%$. \begin{table} \caption{Donor and BH masses of the binary systems considered in this work}\label{tab:systems} \begin{center} \begin{tabular}{|c|c|} % \hline Donor star ($M_{\odot}$) & Black Hole ($M_{\odot}$)\\ \hline 8.0; 10.0; 12.0 & 20.0\\ 15.0; 20.0; 25.0 & 20.0\\ 8.0; 10.0; 12.0 & 100.0\\ 15.0; 20.0; 25.0 & 100.0\\ \hline \end{tabular} \end{center} \end{table} \begin{figure*} \includegraphics[width=\columnwidth]{cmd_10_20_colormap_ARTICOLO_new.png} \includegraphics[width=\columnwidth]{cmd_10_100_colormap_ARTICOLO_new.png} \includegraphics[width=\columnwidth]{cmd_25_20_colormap_ARTICOLO_arrow_new.png} \includegraphics[width=\columnwidth]{cmd_25_100_colormap_ARTICOLO_new.png} % \caption{Evolution on the colour-magnitude diagram of a ULX binary system with a donor mass of $10 M_{\odot}$ ({\it upper} panels) or $25 M_{\odot}$ ({\it lower} panels) at zero age main sequence and a BH mass of $20 M_{\odot}$ ({\it left} panels) or $100 M_{\odot}$ ({\it right} panels). The {\it thick} ({\it light grey}, {\it cyan} in the on-line version) line represents the evolution calculated assuming standard sub-Eddington accretion (PZ). The {\it thin} ({\it gray-scale}, {\it color-scale} in the on-line version) line represents the new evolution computed for super-Eddington accretion. Points $a$, $b$ and $c$ mark the evolutionary phases at which the spectral energy distribution is computed. The track of the system with a $25 M_{\odot}$ donor and a $20 M_{\odot}$BH was interrupted when $r_{ph,out}>r_{out}$. Representative arrows in the bottom left panel indicate the direction of the evolution along the tracks.} \label{fig:diagrammi*} \end{figure*} \subsubsection{Geometry of disc self-irradiation} The geometry of disc self-irradiation with the outflow is different from that without the outflow. The outflow reprocesses entirely the disc emission up to $r_{ph,out} \gg r_{0}$ and has a scale height of order unity. Consequently, radiation from the disc emitted inside $r_{ph,out}$ cannot hit the region of the disc outside it. The irradiating region is then $\Delta r = r_{x}-r_{ph,out}$, with $r_{ph,out} \gg r_{0}$, and is thus significantly less extended than in the pure slim disc case. Moreover, its dependence on the mass transfer rate is different, as shown in Fig.~\ref{fig:irr_region}. It has a maximum at a few hundreds times $\dot{m}$. An additional contribution to the emitting region may come also from the photosphere of the outflow located at $r_{ph,out}$ and facing the outer disc. We add its contribution to the irradiating flux if its temperature falls in the X-ray-UV band (eq.[\ref{eq:toutflow}]). However, this is usually not sufficient to compensate the 'missing' flux from the region between $r_{0}$ and $r_{ph,out}$, and therefore irradiation is smaller than in the pure slim disc case. Also in this case, the fact that X-ray emission from the inner disc is isotropic or partially beamed has no effect on the outside region. \section{Results} \subsection{Photometry}\label{ssec:resphot} We compared the B, V and R (Johnson) magnitudes obtained with the new treatment of the photometry of the donor star presented in Sec.~\ref{subs:phot} with those of PZ. The accretion disc and X-ray irradiation are not taken into account, while the decrement of the mass of the donor during its evolution is considered. The maximum difference between the magnitudes computed with the old and new treatment of photometry occurs for massive ($> 20 M_\odot$) stars during main sequence and is $\sim 40\%$. For comparison, in PZ the maximum fractional deviation of the adopted fitting formula from the tabulated reference magnitudes is $\sim 15\%$. \subsection{Evolutionary tracks on the color-magnitude diagram}\label{ssec:cmd_outflow} We used the model described in the previous Sections to compute the evolution of 12 binary systems with the initial donor and BH masses reported in Tab. ~\ref{tab:systems}. In the following, we will show the results for systems with donors of $10 M_{\odot}$ and $25 M_{\odot}$, and BHs of $20 M_{\odot}$ and $100 M_{\odot}$. The initial binary separation of all systems is chosen so that the first contact phase occurs during MS. The possibility that accretion starts only after MS is not considered because, for massive donors, this phase is too short to be consistent with the characteristic age of the optical emission nebulae typically associated to ULXs ($>500$ thousand years; \citealt{2002astro.ph..2488P}). \begin{figure*} \bfseries \begin{tasks}[counter-format = {(tsk[a])},label-offset = {0.8em},label-format = {\bfseries}](3) \task \includegraphics[width = 0.3\textwidth]{spettro_10_20_v51_A.pdf} \task \includegraphics[width = 0.3\textwidth]{spettro_10_20_v51_B.pdf} \task \includegraphics[width = 0.3\textwidth]{spettro_10_20_v51_C.pdf} \end{tasks} \caption{Optical-through-X-ray spectrum of the system with a $10 M_{\odot}$ donor and a $20 M_{\odot}$ BH at the phases marked with $a$, $b$ and $c$ on the evolutionary track for super-Eddington accretion. The {\it thick} ({\it red}) line represents the spectrum of the self-irradiated outer disc plus the outflow and the innermost slim disc, while the {\it thin} ({\it gray}) line is the spectrum of the X-ray heated donor. The {\it gray} ({\it light blue}) strip marks the optical band. At phases $a$ and $c$ both the disc and the outflow irradiate the outer standard disc, while at phase $b$ only the outflow does it. The mass of the donor star at each time is: $M_{donor,a} \simeq 4.4 M_{\odot}$, $M_{donor,b} \simeq 4.2 M_{\odot}$ and $M_{donor,c} \simeq 2.03 M_{\odot}$.}\label{fig:spettro1020*} \end{figure*} \begin{figure*} \begin{tasks}[counter-format = {(tsk[a])},label-offset = {0.8em},label-format = {\bfseries}](3) \task \includegraphics[width = 0.3\textwidth]{spettro_25_20_v51_A.pdf} \task \includegraphics[width = 0.3\textwidth]{spettro_25_20_v51_B.pdf} \task \includegraphics[width = 0.3\textwidth]{spettro_25_20_v51_C.pdf} \end{tasks} \caption{Same as Figure~\ref{fig:spettro1020*} for a $25 M_{\odot}$ donor and a $20 M_{\odot}$ BH. At phase $a$ the outflow irradiate the outer standard disc, while at phases $b$ and $c$ there is no irradiation. The mass of the donor star at each time is: $M_{donor,a} \simeq 11.80 M_{\odot}$, $M_{donor,b} \simeq 11.78 M_{\odot}$ and $M_{donor,c} \simeq 11.70 M_{\odot}$.} \label{fig:spettro2520*} \end{figure*} \begin{figure*} \begin{tasks}[counter-format = {(tsk[a])},label-offset = {0.8em},label-format = {\bfseries}](3) \task \includegraphics[width = 0.3\textwidth]{spettro_10_100_v51_A.pdf} \task \includegraphics[width = 0.3\textwidth]{spettro_10_100_v51_B.pdf} \task \includegraphics[width = 0.3\textwidth]{spettro_10_100_v51_C.pdf} \end{tasks} \caption{Same as Figure~\ref{fig:spettro1020*} for a $10 M_{\odot}$ donor and a $100 M_{\odot}$ BH. At phases $a$ and $c$ only the photosphere of the outflow at $r_{ph,out}$ radiates the outer standard disc. In $b$ both the outflow and the disc irradiate the outer standard disc. In $c$ the donor is on the Giant branch. The mass of the donor star at each time is: $M_{donor,a} \simeq 4.99 M_{\odot}$, $M_{donor,b} \simeq 3.90 M_{\odot}$ and $M_{donor,c} \simeq 1.38 M_{\odot}$.}\label{fig:spettro10100*} \end{figure*} \begin{figure*} \begin{tasks}[counter-format = {(tsk[a])},label-offset = {0.8em},label-format = {\bfseries}](3) \task \includegraphics[width = 0.3\textwidth]{spettro_25_100_v51_A.pdf} \task \includegraphics[width = 0.3\textwidth]{spettro_25_100_v51_B.pdf} \task \includegraphics[width = 0.3\textwidth]{spettro_25_100_v51_C.pdf} \end{tasks} \caption{Same as Figure~\ref{fig:spettro1020*} for a $25 M_{\odot}$ donor and a $100 M_{\odot}$ BH. At phases $a$ and $c$ no irradiation occurs. The mass of the donor star at each time is: $M_{donor,a} \simeq 13.06 M_{\odot}$, $M_{donor,b} \simeq 11.46 M_{\odot}$ and $M_{donor,c} \simeq 7.30 M_{\odot}$.}\label{fig:spettro25100*} \end{figure*} In Fig.~\ref{fig:diagrammi*} we show the evolutionary tracks on the color-magnitude diagram calculated in this paper, compared to those reported in PZ (case AB mass transfer). In the lower part of each track the donor is on the Main Sequence (MS). On the upper part the donor has left the MS and moves towards the Giant Branch. During MS $\dot{m}$ is sub-Eddington or mildly super-Eddington, while afterwards accretion becomes highly super-Eddington. As shown in Fig.~\ref{fig:diagrammi*}, during MS our tracks almost overlap those obtained by PZ. The residual difference depends mainly on the different method used for calculating the donor magnitude (see Sec.~\ref{ssec:resphot}) and on the fact that $\dot{m}$ is mildly super-Eddington. When the donor evolves off the MS, the effects induced by the new structure of the accretion flow (super-Eddington accretion with outflow) become relevant and the tracks differ significantly from those of PZ. The evolutionary tracks are brigther and bluer than those computed assuming Eddington-limited accretion. These features depend on the combination of two effects. First, owing to the larger $\dot{m}$, the flux emitted from the outer standard accretion disc grows significantly. Then, the temperature in the disc and the irradiating flux become progressively higher than in PZ, despite the fact that the extension of the irradiation region is reduced. Second, even if the X-ray-UV emitting region of the disc is hidden below the optically thick outflow, the photosphere of the latter can have a temperature sufficiently high to effectively irradiate the outer regions. These effects increase both the emitted luminosity and irradiation making the system appearing brigther and bluer. As the system evolves, the orbital separation increases, the accretion disc becomes bigger and the disc emission comparatively redder. In addition, at variance with PZ, in our model we allow the mass ratio to vary during the evolution of the binary system. As all our evolved donors lose a considerable amount of mass, the separation and the accretion disc are bigger than in PZ. We note that the track of the system with a $25 M_{\odot}$ donor and a $20 M_{\odot}$BH was interrupted when $r_{ph,out}>r_{out}$, as the outflow starts to engulf the binary because of the very high mass transfer and outflow rates, and the model is no longer self-consistent. While this does not rule out the possibility that these systems exist and may reproduce some of the observed ULXs, they are likely to evolve in a significantly different way and treating them is beyond the goals of the present investigation. In general, systems with a $20 M_\odot$ BH and $12-20 M_\odot$ donors accreting supercritically are characterized by rather blue colors (F450W -- F555W $\simeq - 0.2: + 0.1$) and high luminosity ($M_V \simeq - 4 : - 6.5$) when the donor has evolved off the main sequence. Systems with a massive ($100 M_\odot$) BH accreting supercritically from evolved donors of similar mass have comparable colours but can reach $M_V \simeq - 8$. Points $a$, $b$ and $c$ on the colour-magnitude diagram in Figure~\ref{fig:diagrammi*} mark the post-MS evolutionary phases at which optical-through-X-ray spectra are computed. They are shown in Figures~\ref{fig:spettro1020*} -~\ref{fig:spettro25100*} and refer to phases with high mass transfer rate. The X-ray spectrum includes the contribution of the disc and the outflow, assuming that they emit locally as blackbodies at different temperatures. A more realistic description of the inner disc spectrum, which involves modelling additional physical processes, will be presented in a forthcoming paper. The bump at optical wavelengths that forms in standard accretion discs because of self-irradiation (e.g. \citealt{1993PASJ...45..443S}) is suppressed as irradiation is comparatively less important than the intrinsic disc emission at very high $\dot{m}$. The flux emitted from the accretion disc overcomes that from the star in almost all cases. \subsection{Comparison with the HST photometry of NGC 1313 X-2 and NGC 4559 X-7} \label{ssec:cmd_outflow_counterparts} A detailed comparison of the computed evolutionary tracks and optical-through-X-ray spectra of our models with a sample of ULXs is ongoing. Here we show a preliminary application to NGC 1313 X-2 and NGC 4559 X-7 using only optical data. We compare the position on the CMD of the optical counterparts of NGC1313 X-2 and NGC4559 X-7 with the evolutionary tracks of our systems. We account for ULXs variability taking the mean values of the magnitudes collected in different epochs. Absolute magnitudes are calculated for the distances reported in the literature and adopted for the parent population studies (see below). \subsubsection*{NGC 1313 X-2} \begin{figure*} \includegraphics[width = \textwidth]{cmd_controparti_ngc1313x2.pdf} \caption{Evolution on the colour-magnitude diagram of ULX binary systems with a BH mass of $20 M_{\odot}$ ({\it left}) and $100 M_{\odot}$ ({\it right}) for donors with different initial main sequence masses (from $8 M_{\odot}$ up to $25 M_{\odot}$). Magnitudes are in the {\it HST} photometric system. The point represents the mean value of all the measured magnitudes of NGC 1313 X-2 (see text for details). We assume a distance of 4.07 Mpc.} \label{fig:ngc1313x2} \end{figure*} \begin{figure*} \includegraphics[width = \textwidth]{ngc4559x7_cmd.pdf}\caption{Same as Fig.~\ref{fig:ngc1313x2} for NGC4559 X-7. We assume a distance of 10 Mpc.}\label{fig:ngc4559x7} \end{figure*} NGC 1313 X-2 (hereafter X-2) is one of the best known and studied ULXs, hosted in the barred spiral galaxy NGC 1313. In the following, we assume a distance of $4.07 \pm 0.22$ Mpc (\citealt{2008A&A...486..151G}) and an optical extinction $E(B-V)=0.13$ (\citealt{2011ApJ...737...81T}). The observed X-ray luminosity of NGC 1313 X-2 is in the range $10^{39}$--$3 \times 10^{40}$ erg s$^{-1}$ (\citealt{2007ApJ...658..999M}). The environment of this ULX has been analyzed in detail (\citealt{2004ApJ...603..523Z, 2007ApJ...658..999M, 2008A&A...486..151G}). The source is found to reside in an OB association aged $\sim 20 \pm 5$ Myrs \citep{2008A&A...486..151G}. Intensive {\it HST} monitoring of its optical counterpart in 2009 led to the determination of the orbital period of the system, which turns out to be $P = 6.12 \pm 0.16$ days in case of significant X-ray irradiation of the donor or $P = 12.24 \pm 0.16$ if X-ray irradiation is negligible (\citealt{2009ApJ...690L..39L}, \citealt{2012MNRAS.419.1331Z}). As the source appears to show both regular and stocastic variability at the level of $\sim 0.1$ mag, in the following we will consider the average of all measurements of X-2 taken during the 2009 monitoring campaign (F555W = $-4.88 \pm 0.06$, F450W-F555W = $-0.18 \pm 0.1$; \citealt{2011ApJ...737...81T})\footnote{The error on the colour is the quadratic sum of the standard deviations $\sigma = (\sum_i (m_i- {\bar m})^2/(n-1) )^{1/2}$ of the single magnitudes, where we take $\sigma$ (not the error of the mean) as representing the dispersion of the measurements induced by the intrinsic source variability.}. This value then represents a reasonable smoothed average of the observed orbital and X-ray irradiation-induced variability. In Fig.~\ref{fig:ngc1313x2} we compare the position on the colour-magnitude diagram of the optical counterpart of X-2 with the evolutionary tracks of ULX binaries accreting above Eddington. The point representing X-2 intersects: (i) the tracks of a $100 M_{\odot}$ BH with donors of 20 and $25 M_{\odot}$ in the MS phase, (ii) the tracks of a stellar-mass BH with donors of 12, 15, 20 and $25 M_{\odot}$ during the terminal age MS or H-shell burning phase, when accretion is super-critical. We rule out the first possibility because the duration of the entire tracks that intersect the photometric point is less than 8--12 Myrs, not in agreement with the age of the parent stellar population ($\sim 20 \pm 5$ Myrs). Concerning the stellar-mass BH case (ii), we exclude donors more massive than $20 M_{\odot}$ for similar reasons. On the other hand, case (ii) with donors having initial masses in the range $12-15 M_{\odot}$ is in agreement with the age of the parent stellar population. For these systems the bolometric luminosity ($\sim 10^{40}$ erg s$^{-1}$) is consistent with the observed range of values. It is important to note that, at the time of intersection, accretion is highly super-critical and the optical emission is dominated by the outer standard portion of the disc. Nonetheless, the contribution of the star to the optical flux is 10\%, sufficient to produce a $\sim 0.1$ mag modulation on the optical light curve if irradiation is important. The orbital period P is between 4.5 and 5 days, in reasonable agreement with the reported photometric periodicity. In this case, the observed $\sim 6$ days modulation would represent a single orbital period and the maximum of the light curve would correspond to superior conjunction, when the largest fraction of the irradiated donor surface is visible. Any evidence of a $\sim 12$ days asymmetric modulation would rule out this scenario. \subsubsection*{NGC 4559 X-7} NGC 4559 X-7 (hereafter X-7) is a ULX located in the outerskirts of the spiral galaxy NGC 4559. We assume a Galactic extinction $E(B-V) = 0.018$ \citep{2011ApJ...737...81T} and a distance of 10 Mpc \citep{2005MNRAS.356...12S}. The ULX is embedded in a young star-forming complex with age $\leq 30$ Myrs and stars in the \textit{Chandra} error circle are Red or Blue Supergiants with age $\sim 20$ Myrs. The average magnitude and colours of the optical counterpart of X-7 are F555W = $-7.05\pm0.08$ and F555W-F814W = $-0.11\pm0.13$ (from two measurements; \citealt{2011ApJ...737...81T}), while its bolometric luminosity is $\sim 5 \times 10^{40}$ erg s$^{-1}$ \citep{2005MNRAS.356...12S}. In Fig.~\ref{fig:ngc4559x7} we compare the position on the colour-magnitude diagram of the optical counterpart of X-7 with the evolutionary tracks of ULX binaries accreting above Eddington. We rule out that X-7 is powered by accretion onto a stellar-mass BH of 20 $M_{\odot}$ because, even for super-Eddington accretion from a $20-25 M_\odot$ donor in the H-shell burning phase, the magnitude is too low to reproduce the observed photometry. Conversely, the point representing X-7 intersects the evolutionary tracks of a 100 $M_{\odot}$ BH accreting above Eddington from a $15-25 M_{\odot}$ evolved donor. Assuming a characteristic age of $\sim 20$ Myrs, a $\sim 15 M_\odot$ donor is more plausible. Tracks computed for a more extended grid of BH masses show agreement for masses in the range $70-100 M_{\odot}$ (Ambrosi, Zampieri et al. in prep.). For all these systems the bolometric luminosity ($\sim 4 \times 10^{40}$ erg s$^{-1}$) is in fair agreement with the observed value.\\ Finally, we note that, irrespective of the BH mass, both the counterparts of NGC 1313 X-2 and NGC 4559 X-7 appear to be associated with evolved donors. Despite the post-MS phase of a massive star not being its longest evolutionary phase, it is certainly the only one with significant super-Eddington rates. Limiting the comparison to this phase, the position on the post-MS tracks of NGC 1313 X-2 (where agreement with the observed photometry is found) falls on a rather short-lived phase of the system (when the orbital separation is rapidly increasing), while it falls along a comparatively slower evolutionary phase for NGC 4559 X-7. On this ground alone, the probability of finding NGC 4559 X-7 at the observed position on the CMD seems somewhat higher than that of NGC 1313 X-2. \section{Discussion and conclusions} In this work we modelled the optical emission of ULXs accreting super-Eddington. At first we considered a bimodal accretion disc formed by an inner advection-dominated slim disc and an outer standard disc. Then, we included the effects of an outflow produced by radiation pressure. As noted above, the case of a pure slim disc is useful to understand the effects of supercritical accretion on the emission properties of the disc and on self-irradiation. For $\dot{m} > 10^{3}$ the outflow can completely cover the accretion disc and the evolution can no longer be followed with the present model. Super-critical accretion has considerable effects on the optical emission. The disc self-irradiation is very different from that produced in the standard case. The innermost regions do not radiate the outer ones. Two competing effects influence self-irradiation. On one side, the irradiating flux grows with $\dot{m}$. On the other side, it decreases because the size of the irradiating region diminishes. Irradiation is considerably stronger than that produced by an Eddington-limited disc, but at very high $\dot m$ it is progressively less important than the intrinsic disc and donor emission. During MS, the evolutionary tracks on the CMD obtained with our model almost overlap with those of \cite{2008MNRAS.386..543P}. The residual difference depends on the treatment of photometry and to the fact that the accretion rate can be mildly super-Eddington. On the other hand, the post MS evolution is markedly different and is characterized by two phases. Initially, when the accretion disc is not very extended, the luminosity increases with $\dot m$ and the system becomes bluer ($B-V = -0.3-0.1$). As the orbital seperation increases, the accretion disc becomes bigger, the emission becomes progressively redder and the system moves to the right on the CMD. At super-Eddington rates, the disc flux typically overcomes that produced by the donor (apart from the case of small black holes and very massive donors) and the 'optical bump' that characterizes standard self-irradiated discs disappears. We compared the predictions of our model with the {\it HST} observations of NGC 1313 X-2 and NGC 4559 X-7. We constrain the donor and the BH mass of these objects, considering as a further constraint the age of the parent population and the observed bolometric luminosity. The position of NGC 1313 X-2 on the CMD is in agreement with a $20 M_{\odot}$ BH accreting above the Eddington limit from a post-MS donor with initial mass in the range $12-15 M_{\odot}$. The orbital period of the system is $\sim 5$ days, in fair agreement with the observed one. It should be emphasized that the $20 M_{\odot}$ BH and $12-15 M_{\odot}$ donor tracks intersect the observed photometric point of X-2 because accretion is highly super-critical and the optical emission, dominated by the outer standard portion of the disc, is significantly enhanced and blue in comparison with that for Eddington-limited accretion. We now compare the results of the dedicated analysis of NGC 1313 X-2 presented by \cite{2010MNRAS.403L..69P} (PZ2) for Eddington-limited accretion with those obtained here. PZ2 found that the photometric point representing X-2 is well reproduced by a system with a $\sim 50-100 M_\odot$ BH and a MS donor of $\sim 12-15 M_\odot$ or by a system with a $\sim 20 M_\odot$ BH undergoing mass transfer from a H-shell burning donor of $\sim 12-15 M_\odot$. The orbital period of the systems that intersect X-2 on the CMD is $\sim 6$ days in the first case and $\sim 12$ days in the second case. In both cases accretion is Eddington-limited. A similar conclusion for the $\sim 20 M_\odot$ BH case was reached by \cite{2014ApJ...794....7M} who calculated the magnitudes of simulated ULX binaries evolved in young star clusters and compared them with the available photometry of several ULXs. The adopted code is that of PZ and PZ2, while the input parameters at the beginning of the Roche-lobe overflow phase (radius, mass, optical luminosity, effective temperature, and age of the donor, mass of the BH, orbital period) were provided by $N$-body simulations, that did not produce matches with systems having BH masses larger than $\sim 25 M_\odot$. In fact, besides the accretion regime, there are two other aspects to consider when comparing the results of PZ2 with our ones. First, PZ2 considered the {\it HST} ACS observations performed in 2003 (taken from \citealt{2007ApJ...658..999M}), while here we considered a longer dataset, averaging over the variability induced by the orbital motion and X-ray irradiation. Second, the conversion from {\it HST} ACS/WFC F435W and F555W filters to the standard Johnson photometric system leads to some inaccuracy, especially for variable sources (see e. g. \citealt{2005PASP..117.1049S}). We note that also \cite{2014ApJ...794....7M} used the first 2003 {\it HST} ACS photometric epoch (taken from \citealt{2013ApJS..206...14G}). Using the two 2003 {\it HST} photometric measurements adopted in PZ2, we find agreement with the tracks of $20-25 M_\odot$ donors during MS for a $100 M_\odot$ BH and the track of a $20 M_\odot$ donor at terminal age MS for a $20 M_\odot$ BH, that do not have the correct age of the parent OB association. This would rule out both Eddington-limited accretion onto a $100 M_\odot$ BH and super-Eddington accretion onto a $20 M_\odot$ BH for X-2. On the other hand, comparison with the average photometry of the 2009 {\it HST} monitoring campaign still rules out the $100 M_\odot$ BH scenario, but allows for super-Eddington accretion onto a $20 M_\odot$ BH from a H-shell burning donor of $\sim 12-15 M_\odot$. Therefore, adopting the 2009 average photometry and performing the comparison with the new tracks in the original {\it HST} photometric system is crucial to rule out the Eddington-limited $100 M_\odot$ BH scenario of PZ2 and to pinpoint the matching $20 M_\odot$ BH super-Eddington system. Letting aside the details of the photometric comparison, we note that the orbital period of the $20 M_\odot$ BH matching binary system is $\sim 12$ days for Eddington-limited accretion, while it is $\sim 5$ days for super-Eddington accretion. In fact, in order to reach a comparable optical luminosity an Eddington-limited disc has to be more extended, and hence the system has to have a longer orbital period. This would provide a further means to distinguish between Eddington-limited and super-Eddington accretion in this sytem. Unfortunately, present measurements are not sufficiently accurate to discriminate between a $\sim 6$ days irradiation-modulated orbital periodicity and a $\sim 12$ days ellipsoidally-modulated one. Also the optical counterpart of NGC 4559 X-7 has been previously analysed by PZ. The same caveat concerning the photometric transformation to the Johnson system applies also here, but is less critical. The same {\it HST} measurement of \cite{2005MNRAS.356...12S} is considered. PZ found that X-7 is reproduced by a massive or a stellar-mass BH accreting from a $30-50 M_{\odot}$ donor during the H-shell burning phase. We did not consider donors more massive than $25 M_{\odot}$ for a 20 $M_{\odot}$ BH because, after the MS, the outflow starts to engulf the binary and the model is no longer self-consistent. For less massive donors, no agreement is found because the optical emission is not sufficiently luminous. For a 100 $M_{\odot}$ BH, agreement is found for evolved donors of $15-25 M_{\odot}$, smaller than in the Eddington-limited systems of PZ owing to the fact that super-Eddington accretion makes the tracks more luminous and bluer for a given donor mass. We note that our result for NGC 1313 X-2 is consistent with the findings of \cite{2013ApJ...778..163B}, who performed a detailed analysis of the \textit{NuSTAR} and \textit{XMM-Newton} spectra of the source using a slim disc plus Comptonization model and found that they are well described by a low mass BH ($M \sim 20-30 M_{\odot}$). The results for NGC 1313 X-2 and NGC 4559 X-7 are also in agreement with the BH masses estimated by \citealt{2017MNRAS.469L..99F} using the same wind model \citep{2007MNRAS.377.1187P}. From the properties of the outflow measured in the X-rays they constrain the masses and accretion rates of NGC 1313 X-1, NGC 55 ULX and NGC 5408 X-1, finding that the BH mass is likely to be in the range $10-100 M_{\odot}$. In the future we will explore in detail the properties of all the ULXs with avaiable optical observations. We will compare them with updated evolutionary tracks covering a wider parameter space in terms of BH and donor masses. The comparison will be performed in the same photometric system used for the observations, accounting for the variability of the sources and including the optical-through-X-ray spectral energy distribution. Moreover, the case of accreting NSs will be explored in order to asses whether optical emission can help distinguishing between ULXs hosting BHs and NSs. As detecting pulsation has proven to be very difficult, it would be important to have other methods to discriminate among them. Modelling accreting NSs is made more difficult by the dynamical and radiative effects of the magnetic fields, the structure and strength of which in pulsar ULXs are unknown. At present we are working at extending our super-Eddington accretion model to the case of a non-magnetized NS, which can be accomodated with relatively little effort within the present framework. Results will be presented in a forthcoming paper. \section*{Acknowledgements} We thank the referee Ciro Pinto for the useful comments. We acknowledge financial contribution from the grants ASI-INAF I/037/12/0 (project ``Accretion onto stellar and intermediate-mass compact objects with NuSTAR'') and ASI/INAF n. 2017-14-H.O (projects "High-Energy observations of Stellar-mass Compact Objects: from CVs to Ultraluminous X-Ray Sources`` and ''Understanding the x-ray variabLe and Transient Sky (ULTraS)``). \newpage \bibliographystyle{plain}
\section{Introduction} Wocjan and Elphick \cite{wocjan18} proved that many spectral lower bounds for the chromatic number, $\chi(G)$, are also lower bounds for the quantum chromatic number, $\chi_q(G)$. This was achieved using pinching and twirling and a combinatorial definition of $\chi_q(G)$ due to Mancinska and Roberson \cite{mancinska16}. In a different paper Mancinska and Roberson \cite{mancinska162} defined a quantum independence number $\alpha_q(G)$, using quantum homomorphisms. It is known (see for example Section 6.18 of \cite{roberson13}) that: \[ \alpha(G) \le \alpha_q(G) \le \lfloor \theta'(G) \rfloor \le \theta'(G) \le \theta(G) \le \theta^+(G) \le \lceil \theta^+(G) \rceil \le \chi_q(\overline{G}) \le \chi(\overline{G})\,, \] where $\theta', \theta, \theta^+$ are the Schrijver, Lov\'asz and Szegedy theta functions. Analogously to $\chi_q(G)$, $\alpha_q(G)$ is the maximum integer $t$ for which two players sharing an entangled state can convince a referee that the graph $G$ has an independent set of size $t$. There exist graphs $G$ for which there is an exponential separation between $\alpha(G)$ and $\alpha_q(G)$ \cite{mancinska162}. \section{Inertial upper bound for the independence number} The best known spectral upper bound for $\alpha(G)$ is as follows: \begin{equation}\label{eq:alpha} \alpha(G) \le n^0(W) + \min\{n^+(W) , n^-(W)\}, \end{equation} where $W$ is a Hermitian weighted adjacency matrix of $G$ and $n^0, n^+, n^-$ are the numbers of zero, positive and negative eigenvalues of $W$ respectively. We also let $A$ denote the adjacency matrix of $G$, and $V(G)$ and $E(G)$ denote the vertex set and edge set of $G$ respectively, where $|V(G)| = n$ and $|E(G)| = m$. Obviously $n = n^0 + n^- + n^+$ and $rank(G) = n^+ + n^-$. This bound was originally proved by Cvetkovic \cite{cvetkovic73}, using interlacing of the eigenvalues of the empty graph on $\alpha(G)$ vertices. Godsil \cite{godsil06} presented an alternative proof that we generalize to prove the inertial upper bound on the quantum independence number. His proof relies on the following elementary result: \begin{lem}\label{lem:max_iso} Let $M\in \mathbb{C}^{s\times s}$ be an arbitrary Hermitian matrix. A subspace $\mathcal{U}$ of $\mathbb{C}^s$ is called totally isotropic with respect to the Hermitian form defined by $M$ if \[ \< \Psi | M | \Psi\> = 0 \] for all vectors $|\Psi\>\in\mathcal{U}$. The dimension of all maximal totally isotropic subspaces is equal to \begin{equation} \label{eq:dimension} n^0(M) + \min\{ n^+(M), n^-(M) \}\,. \end{equation} \end{lem} \begin{proof} Using Sylvester's law of inertia we may assume that $M$ is diagonal and has only eigenvalues $+1$, $0$, and $-1$. It is easy to show that there exists a totally isotropic subspace having dimension as in (\ref{eq:dimension}). Let $|\varphi^+_{a}\>$, $|\varphi^0_{b}\>$, $|\varphi^-_{c}\>$ denote the eigenvectors and the corresponding eigenvalues $+1$, $0$ and $-1$, respectively, where $a\in[n^+], b\in [n^0]$, and $c\in [n^-]$. We may assume without loss of generality that $n^+\ge n^-$. Then the vectors \begin{align*} |\varphi^0_b\>\,, & \quad b\in [n^0]\,, \\ |\varphi^{+}_c\> + |\varphi^{-}_c\>\,, & \quad c\in [n^-] \end{align*} span a totally isotropic subspace of dimension $n^0+n^-$. We now show that there cannot exist a totally isotropic subspace whose dimension is larger than $n^0+n^-$. Let $\mathcal{U}$ be any totally isotropic subspace. Let $\mathcal{V}$ be the subspace spanned by $|\varphi^+_a\>$ for $a\in [n^+]$. We have \begin{eqnarray*} n^+ + n^0 + n^- & = & s \\ & \ge & \dim(\mathcal{U} + \mathcal{V}) \\ & = & \dim(\mathcal{U}) + \dim(\mathcal{V}) + \dim(\mathcal{U} \cap \mathcal{V}) \\ & = & \dim(\mathcal{U}) + n^+\,, \end{eqnarray*} which shows that $\dim(\mathcal{U})$ cannot be larger than $n^0 + n^-$. \end{proof} \begin{proof} The inertial upper bound on $\alpha$ is established as follows. Let $G$ be a graph with vertex set $V$ and Hermitian weighted adjacency matrix $W$. Let $e_u$ denote the standard basis vector corresponding to vertex $u$. If $S$ is an independent set in $V$ and $u, v \in S$, then \[ \<e_u | W | e_v\> = 0. \] It follows that the subspace spanned by the orthogonal vectors $e_u$ for $u$ in $S$ is a totally isotropic subspace. The dimension of such a subspace is bounded by the inertia of $W$, as shown in Lemma~\ref{lem:max_iso}. \end{proof} \section{Inertial upper bound for the quantum independence number} \begin{thm}\label{thm:inertial_bound} For any graph $G$ with quantum independence number $\alpha_q(G)$ and Hermitian weighted adjacency matrix $W$: \begin{equation}\label{eq:alphaq} \alpha_q(G) \le n^0(W) + \min\{n^+(W) , n^-(W)\}. \end{equation} \end{thm} In order to prove Theorem 1 we need a combinatorial definition of $\alpha_q$. Laurent and Piovesan provide a combinatorial definition of $\alpha_q$ in Definition 2.5 of \cite{laurent15}, but we use the equivalent definition described in the paragraph after their Definition 2.8. For matrices $X,Y\in\mathbb{C}^{d\times d}$, their trace inner product (also called Hilbert-Schmidt inner product) is defined as \[ \<X, Y\>_{\mathrm{tr}} = \mathrm{tr}(X^\dagger Y)\,. \] \begin{dfn}[Quantum independence number $\alpha_q$]\label{def:alpha_q} For a graph $G$, $\alpha_q(G)$ is the maximum integer $t$ for which there exist orthogonal projectors $P^{(u,i)} \in\mathbb{C}^{d\times d}$ for $u \in V(G), i \in[t]$ satisfying the following conditions: \begin{align} \sum_{u\in V(G)} P^{(u,i)} = I_d & \quad \mbox{for all } i \in [t]\quad & \label{eq:complete} \\ \<P^{(u,i)} , P^{(u,j)}\>_{\mathrm{tr}} = 0 & \quad \mbox{for all } i \not= j \in [t], \mbox{ for all } u \in V(G) & \label{eq:orthogonal u} \\ \<P^{(u,i)} , P^{(v,j)}\>_{\mathrm{tr}} = 0 & \quad \mbox{for all } i \not= j \in [t], \mbox{ for all } uv \in E(G).\quad & \label{eq:orthogonal uv} \end{align} We refer to condition (\ref{eq:complete}) as the \emph{completeness} condition and to conditions (\ref{eq:orthogonal u}) and (\ref{eq:orthogonal uv}) as the \emph{orthogonality} conditions.\footnote{Deviating slightly from \cite{laurent15}, we present the cases $u=v$ and $uv\in E$ as separate conditions to simplify the presentation below.} \end{dfn} Observe that the (classical) independence number $\alpha(G)$ is a special case of $\alpha_q(G)$ when the dimension $d$ is restricted to be $1$, that is, the only possible ``projectors'' are the scalars $1$ and $0$. More precisely, let $S=\{u_i \mid i \in [t]\}$ be any (classical) independent set. Then, for all $i\in [t]$, we set $P^{(u_i,i)}=1$ and $P^{(v,i)}=0$ for all $v\in V$ with $v\neq u_i$. Mancinska \emph{et al} \cite{mancinska161} defined the projective packing number, $\alpha_p(G)$, as follows, and noted that for all graphs $\alpha_q(G) \le \alpha_p(G)$. For the sake of completeness, we include the simple proof showing that the quantum independence number is bounded from above by the projective packing number. We show afterwards that the projective packing number is bounded from above by the inertia bound. It is more convenient to work with the projective packing number than with the quantum independence number. \begin{dfn} A $d$-dimensional projective packing of a graph $G=(V,E)$ is a collection of orthogonal projectors $P^{(u)}\in\mathbb{C}^{d\times d}$ such that \begin{equation}\label{eq:projective_orthogonal} \< P^{(u)}, P^{(v)} \>_{\mathrm{tr}} = 0 \end{equation} for all $uv\in E$. The value of a projective packing using projectors $P^{(u)}\in\mathbb{C}^{d\times d}$ is defined as \begin{equation} \frac{1}{d} \sum_{u\in V} r^{(u)}\,, \end{equation} where $r^{(u)}$ denote the ranks of the operators $r^{(u)}$. The projective packing number $\alpha_p(G)$ of a graph $G=(V,E)$ is defined as the supremum of the values over all projective packings of the graph $G$. \end{dfn} \begin{lem} For all graphs, we have $\alpha_q(G)\le \alpha_p(G)$. \end{lem} \begin{proof} Let $P^{(u,i)}\in\mathbb{C}^{d\times d}$, $u\in V, i \in [t],$ be a collection of orthogonal projectors satisfying the conditions in Definition~\ref{def:alpha_q}. Define the operators \begin{equation} P^{(u)} = \sum_{i\in [t]} P^{(u,i)}\,. \end{equation} These operators are orthogonal projectors because of condition~(\ref{eq:orthogonal u}). For $uv\in E$, we have \begin{eqnarray} \< P^{(u)}, P^{(v)}\>_{\mathrm{tr}} & = & \sum_{i,j\in[t]} \< P^{(u,i)}, P^{(v,j)}\>_{\mathrm{tr}} \\ & = & \sum_{i\neq j\in[t]} \< P^{(u,i)}, P^{(v,j)}\>_{\mathrm{tr}} + \sum_{i\in[t]} \< P^{(u,i)}, P^{(v,i)}\>_{\mathrm{tr}} \label{eq:middle} \\ & = & 0\,. \end{eqnarray} The sums in (\ref{eq:middle}) are equal to zero because of conditions~(\ref{eq:orthogonal uv}) and (\ref{eq:complete}), respectively. We have \[ \sum_{u\in V} r^{(u)} = \sum_{i\in [t]} \sum_{u\in V} \mathrm{rank}(P^{(u,i)}) = \sum_{i\in [t]} d = t \cdot d\,, \] because the projectors $P^{(u,i)}$ for each $i\in[t]$ add up to $I_d$ due to condition (\ref{eq:complete}). This concludes the proof $\alpha_q(G)\le \alpha_p(G)$. \end{proof} We will use the following result to reformulate the conditions on the orthogonal projectors of a projective packing as conditions on their eigenvectors. We omit the proof of this basic result. \begin{lem}\label{lem:elementary} Let $P,Q\in\mathbb{C}^{d\times d}$ be two arbitrary orthogonal projectors of rank $r$ and $s$, respectively. Let \[ P = \sum_{k\in[r]} |\psi_k\>\<\psi_k| \quad\mbox{and}\quad Q = \sum_{\ell\in[s]} |\phi_\ell\>\<\phi_\ell| \] denote their spectral resolutions, respectively. Then, the following two conditions are equivalent: \begin{align} \< P, Q\>_{\mathrm{tr}} = 0 & \\ \<\psi_k | \phi_\ell \> = 0 & \quad \mbox{for all}\quad k\in[r], \ell\in[s]\,. \end{align} \end{lem} \begin{thm}\label{thm:inertial_bound_projective_packing} For any graph $G$ with projective packing number $\alpha_p(G)$ and Hermitian weighted adjacency matrix $W$: \begin{equation}\label{eq:alphaq} \alpha_p(G) \le n^0(W) + \min\{n^+(W) , n^-(W)\}. \end{equation} \end{thm} \begin{proof} Let \[ P^{(u)} = \sum_{k\in [r^{(u)}]} |\psi^{(u,k)}\>\<\psi^{(u,k)}| \] denote the spectral resolution of $P^{(u)}$, where $r^{(u)}$ is its rank. Let \[ r = \sum_{u\in V} r^{(u)}\,. \] Define the composite vectors \begin{equation} |\Psi^{(u,k)}\> = |u\> \otimes |\psi^{(u,k)}\>\,. \end{equation} For all $u,v\in V$, $k\in[r^{(u)}]$, and $\ell\in[r^{(v)}]$, we have \begin{eqnarray} \<\Psi^{(u,k)}|\Psi^{(v,\ell)}\> & = & \delta_{u,v} \cdot \delta_{k,\ell} \\ \<\Psi^{(u,k)}|(W\otimes I_d)|\Psi^{(v,\ell)}\> & = & 0\,. \end{eqnarray} The above equalities hold due to the special tensor product structure of the vectors $|\Psi^{(u)}\>$, the orthogonality condition in (\ref{eq:projective_orthogonal}), and Lemma~\ref{lem:elementary}. It follows that these vectors span a $r$-dimensional isotropic subspace with respect to the quadratic form defined by $W\otimes I_d$. Using Lemma~\ref{lem:max_iso} and that the inertia of $W\otimes I_d$ is $d$ times the inertia of $W$, we obtain \[ \frac{r}{d} \le n^0(W) + \min\{ n^+(W) + n^-(W) \}\,, \] which completes the proof since this bound holds for all projective packings of $G=(V,E)$ and all Hermitian weighted adjacency matrices $W$ of $G$. \end{proof} \section{Eigenvalue upper bound for $\alpha_q(G)$} Hoffman, in an unpublished paper, proved that for $\Delta$-regular\footnote{We use the unconventional symbol $\Delta$ instead of $d$ for the degree of regular graphs because $d$ is the dimension of the Hilbert space used in the definition of the quantum independence number.} graphs: \[ \alpha(G) \le \frac {n|\lambda_n|}{\Delta + |\lambda_n|}, \] where $\lambda_n$ is the smallest eigenvalue of $A$. This result is typically proved using interlacing of the quotient matrix, and is known as the Hoffman bound or ratio bound. Lov\'asz (Theorem 9 in \cite{lovasz79}) proved that for $\Delta$-regular graphs: \begin{equation}\label{eq:thetaHoffman} \theta(G) \le \frac {n|\lambda_n|}{\Delta + |\lambda_n|}. \end{equation} It is therefore immediate that the Hoffman bound is an upper bound for $\alpha_q(G)$ for regular graphs. Golubev \cite{golubev17} proved that for \emph{any} graph \[ \alpha(G) \le \frac{n(\mu - \delta)}{\mu}\,, \] where $\delta$ is the minimum degree and $\mu$ is the largest eigenvalue of the Laplacian matrix of $G$. This bound equals the Hoffman bound for regular graphs. Bachoc \emph{et al} subsequently proved (see section 5 in \cite{bachoc17}), in the context of simplicial complexes, that for any graph: \[ \theta(G) \le \frac{n(\mu - \delta)}{\mu}. \] It is therefore immediate that the Golubev bound is an upper bound for $\alpha_q(G)$. \section{Quantum clique number $\omega_q(G)$} Mancinska and Roberson \cite{mancinska162} also define the quantum clique number where $\omega(G) \le \omega_q(G) = \alpha_q(\overline{G})$. It is straightforward to show that for non-empty graphs $\omega(G) \le \mathrm{rank}(G)$, by interlacing the eigenvalues of $G$ with the eigenvalues of the complete graph on $\omega(G)$ vertices. Alon and Seymour \cite{alon89} used the complement of the folded 7-cube on 64 vertices to demonstrate that $\chi(G) \not \le \mathrm{rank}(G)$, since this graph has $\chi = 32$ and $\mathrm{rank} = 29$. Therefore at some point in the hierarchy of parameters between $\omega$ and $\chi$, the rank of a graph ceases to be an upper bound. We can prove that rank is an upper bound for $\omega_q(G)$ as follows. \begin{thm} For any non-empty graph $G$, $\omega_q(G) \le \mathrm{rank}(G)$. \end{thm} \begin{proof} Elphick and Wocjan \cite{elphick17} proved that for any graph $G$, $n - 1 \le n^-(A) + n^-(\overline{A})$. Therefore \[ \omega_q(G) = \alpha_q(\overline{A}) \le n^0(\overline{A}) + n^+(\overline{A}) = n - n^-(\overline{A}) \le 1 + n^-(A) \le \mathrm{rank}(G). \] \end{proof} The complement of the folded 7-cube has $\alpha = 2$ so $n/\alpha \not \le \mathrm{rank}(G)$, and consequently rank is not an upper bound for the fractional chromatic number. We do not know whether rank is an upper bound for $\theta(\overline{G}).$ \section{Implications for $\alpha_q(G)$ and for $\alpha(G)$} It follows from Theorem~\ref{thm:inertial_bound} that any graph with $\alpha(G) = n^0 + \min{(n^+ , n^-)}$, has $\alpha_q = \alpha$. This is the case for numerous graphs, including odd cycles, perfect, folded cubes, Kneser, Andrasfai, Petersen, Desargues, Grotzsch, Heawood, Clebsch and Higman-Sims graphs. Furthermore if the inertia bound is tight with an appropriately chosen weight matrix than again $\alpha_q = \alpha$. This is the case for all bipartite graphs. There are also many graphs, including Chvatal, Hoffman-Singleton, Flower Snark, Dodecahedron, Frucht, Octahedron, Thomsen, Pappus, Gray, Coxeter and Folkman for which $\alpha = \lfloor\theta\rfloor$, so again $\alpha_q = \alpha$. For all such graphs there are no benefits from quantum entanglement for independence. The Clebsch graph demonstrates that the inertia bound is not an upper bound for $\lfloor \theta'(G) \rfloor$. Elzinga and Gregory \cite{elzinga10} asked whether there exists a real symmetric weight matrix $W$ for every graph $G$ such that: \begin{equation}\label{eq:elzinga} \alpha(G) = n^0(W) + \min{(n^+(W) , n^-(W))}? \end{equation} They demonstrated experimentally that this is true for all graphs with up to 10 vertices, and for vertex transitive graphs with up to 12 vertices. Sinkovic \cite{sinkovic18} subsequently proved that there is no real symmetric weight matrix for which~(\ref{eq:alpha}) is tight for Paley 17. This leaves open, however, whether there is always a Hermitian weight matrix for which~(\ref{eq:alpha}) is exact. It follows from Theorem~\ref{thm:inertial_bound}, that every graph with $\alpha < \alpha_q$ is a counter-example to~(\ref{eq:elzinga}) for real symmetric and Hermitian weight matrices. This leads to the question of whether ~(\ref{eq:elzinga}) is true for $\alpha_q$ or $\alpha_p$? It follows from Theorem~\ref{thm:inertial_bound_projective_packing} that the answer is no, because for some graphs, such as the line graph of the cartesian product of $K_3$ with itself, the projective packing number is non-integral. There are also numerous regular graphs for which the Hoffman bound on $\alpha(G)$ is exact, but the unweighted inertia bound is not. Examples include the Shrikhander, Tesseract, Hoffman and Cuboctahedral graphs. There are also many regular graphs where the floor of the Hoffman bound is exact, but the unweighted inertia bound is not. Examples include some circulant, cubic and quartic graphs. For all of these graphs, $\alpha_q = \alpha$. It would be interesting to find the graph with the smallest number of vertices that has $\alpha(G) < \alpha_q(G)$. Such a graph must have at least 11 vertices (given the experimental results due to Elzinga and Gregory). The smallest such graph that we know of is due to Piovesan (see Figure 3.1 in \cite{piovesan16}) which has 24 vertices, with $\chi = \alpha =5, \chi_q = 4$ and $\alpha_q \ge 6$. \section{An example} We conclude by using the Clebsch graph to illustrate the parameters and bounds described in this paper. As is well known, the Clebsch graph is strongly regular and vertex transitive with 16 vertices. It has $\omega = 2, \chi = 4, \alpha = 5$ and spectrum $(5^1, 1^{10}, -3^5)$. The inertia bound is therefore exact, so $\alpha_q = \alpha_p = 5$. It also has $\theta' = \theta = \theta^+ = 6$. Not only is the inertia bound exact for $\alpha_q$ but the Hoffman bound in (\ref{eq:thetaHoffman}) is exact for $\theta$. Because the graph is vertex transitive: \[ \alpha(G) \chi_f(G) = \theta(G) \theta(\overline{G}) = \theta'(G) \theta^+(\overline{G}) = \theta^+(G) \theta'(\overline{G}) = \alpha_p(G) \xi_f(G) = n, \] where $\chi_f$ is the fractional chromatic number and $\xi_f$ is the projective rank. All of these equalities are well known apart from the last one, which is due to Roberson \cite{roberson13}. Therefore $\chi_f = \xi_f = 3.2$ and $\theta'(\overline{G}) = \theta(\overline{G}) = \theta^+(\overline{G}) = 2.67.$ Finally, it is demonstrated in \cite{wocjan18} that $\chi_q = 4$. \subsection*{Acknowledgements} We would like to thank David Roberson for helpful comments on an earlier version of this paper, in particular in regard to the projective packing number. We would also like to thank David Anekstein for testing various ideas for this paper experimentally. This research has been supported in part by National Science Foundation Award 1525943.
\section{Introduction} The last few decades have witnessed rapid strides in high-field superconducting magnet technology, with fields $B_0>20$T and inhomogeneities better than 1ppb routinely available, fueling several recent advances in biomolecular nuclear magnetic resonance (NMR)~\cite{Petkova202,Cady10}. In parallel, there has been a silent revolution in the development of magnetic shielding technology~\cite{Kornack07}, with specialized alloys of mu-metal providing shielding factors $>$10$^6$, and extinguishing fields to $<$0.1nT in a relatively large volume~\cite{mcdermott02,Blumich09,Ledbetter11}. From a physical point of view, both extremes of ultra-high and ultra-low magnetic fields provide uniquely complimentary advantages. In quantum information science, for instance, high fields provide a means to store and protect quantum information due to long spin relaxation times ($T_1$). In particular, the electronic spin associated with the nitrogen-vacancy (NV) center in diamond~\cite{Jelezko06} -- which has emerged as a promising platform for quantum information processing~\cite{Yao12,Hensen15,klimov15}, simulation~\cite{Cai13,Ajoy13b} and metrology~\cite{Maze08,Balasubramanian08} -- has a $T_1$ approaching 10ms at ~8T~\cite{Takahashi08}. In addition, high fields enable the ability to apply highly frequency selective quantum control often with $<1$ppm resolution; as well as sensitivity gains in measurement, especially bulk inductive spin readout, where SNR scales favorably, $\propto B_0^{7/4}$~\cite{Hoult1978}. Ultra-low to zero fields (1nT-100mT), on the other hand, provide the alternative advantages of spin \I{indistinguishability} -- spins even of completely different species act identically, allowing access to heteronuclear spin singlets with long lifetimes~\cite{Emondts14} and the easy construction of Hamiltonian models in naturally occurring spin networks. More specifically, the low field regime is interaction dominated, where the spin Larmor frequencies are smaller that couplings. Indeed at zero field, with the absence of any field $B_0$ that acts to truncate the inter-spin couplings, the interaction Hamiltonians for free evolution are completely isotropic, without orientational dependence~\cite{Weitekamp83,Pines92}. This can allow the relatively easy production of nearest-neighbor Heisenberg models $\mH = \sum_j J_j \vec{S}_j\cdot\vec{S}_{j+1} + BS_{zj}$ in large spin networks in liquids~\cite{Burgarth17}. In dipolar coupled solids, this leads to fast entanglement generation since there are no disallowed transitions from energy costs set by $B_0$~\cite{Krojanski04}. Finally low-field also allows the possibility of ultra-fast quantum control, since there are no speed limits set by the rotating wave approximation. \begin{figure*} \centering {\includegraphics[width=\textwidth]{figure_1_instrument.pdf}} \caption{\textbf{Overview of instrument.} (a) Mechanical shuttler constructed over a high field (7T) superconducting magnet on X and Y adjustable rails for control over alignment. A low field shield is positioned below the magnet. For hyperpolarization experiments in diamond, optimal pumping using laser and polarization transfer with microwaves to ${}^{13}\R{C}$ in diamond particles occurs within the shielded region, after which the sample is shuttled rapidly for measurement at 7T. A liquid nitrogen (LN$_2$) gun enables rapid in-situ sample freeze. (b,g) A twin carriage actuator shuttles a carbon fiber rod along a conveyer belt. The actuator has a positional precision of 50$\mu$m and operates at a maximum speed of 2m/s and acceleration of 30m/s$^2$. (c) Panel illustrates pressure fitting using a pair of O-rings of a 8mm thin wall NMR tube containing the sample to the shuttling rod. (d) A dielectric mirror above the diamond sample increases the efficiency of optical excitation. (e) Panel details the setup within the low field shield (see \zfr{DNP-setup}). The iron shield is secured on sliding rails to prevent movement from the magnetic force of the 7T magnet. (f) The bore of the 7T magnet is sealed with a teflon guide that allows the shuttling motion to self-align (see \zfr{guide-shuttling}).} \zfl{setup} \end{figure*} In this work we construct a device that combines and harnesses the power of both regimes in a single platform (see \zfr{setup} and video at Ref.~\cite{shuttlervideo}) capable of sweeping magnetic fields over a four order-of-magnitude dynamic range from $\scriptsize{\sim}$1mT to 7T, and extendable to a 1nT-7T range. The device works by physically transporting (\I{shuttling}) a sample precisely and at high speed (under 700ms) between low and high field (7T) centers placed 830mm apart, exploiting a high mechanical precision ($50\mu$m) to achieve arbitrary tunable fields in the fringing field between the two centers. The sample shuttling takes place faster than the $T_1$ times of nuclear spins in a variety of physical systems, which coupled with high resolution inductive detection at 7T make the system ideally suited to studying nuclear spins under different field environments. The system also provides the ability for spin manipulation at the low and high field centers, and rapid in-situ sample freeze to enhance $T_1$ lifetimes. This capability paves the way for several versatile applications of the device. In this paper we shall particularly focus on applications for the quantum system consisting of coupled ${}^{13}\R{C}$ nuclear spins and NV center electrons in diamond. Coupled to the optically addressable NV center qubit, ${}^{13}\R{C}$ spins have garnered attention as forming viable nodes of a quantum information processor~\cite{Dutt07,Neumann10,Reiserer16} due to their long lifetimes, and the fact that they can be rapidly and directly manipulated by the NV center~\cite{Khaneja07,Borneman12,Taminiau12}. Their utility as quantum memories have been demonstrated to provide wide gains in quantum sensing, both with respect to sensing resolution~\cite{Laraoui13,Ajoy15,Rosskopf17} and sensitivity~\cite{Ajoy2016} -- especially compelling for nanoscale MRI experiments at high fields~\cite{Aslam17}. Exploiting the complimentary advantages of low and high field control that our instrument offers will enable enhanced resolution gains in ancilla assisted quantum sensing. Moreover low fields serve to strongly mitigate inherent anisotropies in the system Hamiltonians. We exploited this recently, employing our instrument, to develop the first method for efficient room temperature dynamic nuclear polarization (DNP) of ${}^{13}\R{C}$ nuclei via the optically pumped NV centers. The polarization transfer at low fields is orientation independent, allowing ${}^{13}\R{C}$ hyperpolarization in \I{powdered}, randomly oriented, micro- and nano-diamonds~\cite{Ajoy17}, allowing the possibility of a ``nanodiamond polarizer'' for the optical hyperpolarization of liquids brought in contact with these high surface area diamond particles. Sample shuttling to high fields after DNP allows an efficient detection of the ${}^{13}\R{C}$ hyperpolarization In this paper, we focus on the instrumental (see \zfr{setup}) capabilities at low and high fields enabled by our device, that enabled the hyperpolarization experiments in Ref.~\cite{Ajoy17} . \zsr{construction} and \zsr{probe} describe the construction and design aspects of our instrument. \zsr{low-field} demonstrates our capability for low field spin manipulation, and its application for the optical hyperpolarization of ${}^{13}\R{C}$ in diamond powder in \zsr{diamond}. \zsr{cryo} describes a cryogenic system that delivers in-situ rapid sample cooling at low field. Finally \zsr{toolbox} briefly outlines potential experiments harnessing the power of low and high fields enabled by our field cycling device. \section{Mechanical field cycling from low field to 7T} \zsl{construction} The field cycler consists of a tower constructed over a high field (7T) superconducting magnet with a magnetic shield positioned below it (see \zfr{setup}). A video showing the working of the instrument is available online~\cite{shuttlervideo}. A fast conveyor belt actuator stage (Parker HMRB08) carries the sample in the fringing field of the magnet and into the shield, allowing a $\scriptsize{\sim}$1mT -7T field sweep (in principle 1nT-7T with mu-metal shields). The sample is carried by a carbon fiber shuttling rod (Rock West composites) that is fastened rigidly on a twin carriage mount on the actuator stage (\zfr{setup} a,b and g). Carbon fiber was chosen because of its exceptional strength, low mass and immunity to eddy-current forces~\cite{Redfield03}, while the twin-carriage minimizes yaw and aids in alignment, crucial for high sample filling factors. \zfr{shuttler-charac} highlights the versatile control available in our system -- the ability to tune the shuttler velocity and acceleration (\zfr{shuttler-charac}a) and spatial position for start and stop of motion (\zfr{shuttler-charac}b), and motion trajectories (see \cite{shuttlervideo}). Shuttling is possible upto a speed 2m/s and acceleration 30m/s$^{2}$ over a 1600mm travel range, with a high positional precision of $50\mu$m. This control could be exploited in systems with specific level anti-crossings (LACs); for instance in SABRE based DNP with parahydrogen~\cite{Adams09}, where we can precisely control the rate of passage through the LACs to optimize polarization transfer efficiency (\zsr{toolbox})~\cite{Theis16}. We have characterized the shuttling time from 7T-8mT to be $648\pm $2.6ms (see \zfr{shuttler-charac}a inset). This highlights the remarkably high repeatability in our instrument, which contrasts to conventional pneumatically controlled field cyclers. To our knowledge, this is also the first time sample shuttling times have been quantified with such high precision. \begin{figure}[t] \centering {\includegraphics[width=0.49\textwidth]{shuttling-characteristics.pdf}} \caption{\textbf{Field cycling repeatability and control.} {{(a)} Shuttling time from 8mT where the DNP excitation occurs to 7T as a function of shuttling velocity, where times are measured from the arrival of a trigger pulse from the actuator (see \zfr{trigger-sequence}). The inset demonstrates the high repeatability of the system, with travel time 648$\pm 2.6$ms over 1400 trials shuttler operation. {(b)} Measurements of shuttling time as a function of distance from the NMR coil at 7T, revealing the high mechanical precision of the instrument.} } \zfl{shuttler-charac} \end{figure} \subsection{Shuttling alignment and vibrational stability} \zsl{alignment} Our system incorporates special features to maximize the sample filling factor for highly efficient inductive detection, and for low field quantum control through radiofrequency or microwave excitation (\zsr{low-field}). For minimum possible clearance to excitation coils at both fields, and low vibration associated with motion jerk, it is essential that the shuttling rod be aligned parallel to the magnet over the entire distance of travel. We align to better than 1mdeg through a series of design implementations. Firstly, the entire shuttling tower (80/20 1530-S) containing the actuator, motor and twin carriage is on an XY tunable platform (\zfr{setup}a, and video at Ref.~\cite{shuttlervideo}). This centers the shuttling rod to the magnet bore with a precision better than 0.25 mm over the 1600 mm travel. Secondly, and more critically, two alignment funnel-shaped guiding stages made of soft teflon are employed at the magnet bore (\zfr{setup}f), and NMR probe (\zfr{probe}b). The stages vertically align the structure, and provide additional points of support to greatly reduce vibration (see video at Ref.~\cite{shuttlervideo}). The carbon fiber shuttling rod (8mm diameter, 1.7m length), while soft enough to be guided by the teflon stages, is inherently less prone to vibration due to its low moment of inertia and high strength (430 GPa tensile modulus). \zfr{guide-shuttling} visualizes the guiding process, taken with a camera located in the NMR probe focusing on the teflon guide above it (\zfr{probe}b). The rod starts out slightly misaligned but is \I{dynamically} guided to be perfectly aligned, the carbon fiber malleable enough to be able to guide into place with no jerk. The funnel guide has a 45 degree taper with an opening of 8.077 mm, ensuring a tight fit with the 8mm shuttling rod. This ensures shuttling with minimum clearance to the NMR coil and consequently high filling factors (see \zfr{shuttling-movie}). \begin{figure}[t] \centering {\includegraphics[width=0.49\textwidth]{Alignment_matching.pdf}} \caption{\textbf{Guided self-aligning high speed shuttling.} Panels illustrate the guiding action of the teflon funnel right above the RF coil that allows for self-aligned high speed shuttling within a misalignment of less than 1 mdg. For illustration purposes we employ an optical fiber light inside the carbon figure shuttling rod, and a camera mounted inside the NMR probe (see also \zfr{shuttling-movie}). {(a)} The rod approaches the funnel misaligned, but is dynamically guided to be centered (panels {(b-c)}).} \zfl{guide-shuttling} \end{figure} \subsection{Sample attachment to shuttling rod} The sample is pressure-fit to the carbon fiber rod for rapid attachment and detachment (see video at Ref.~\cite{shuttlervideo}). The lower end of the rod contains a ceramic connection for attaching the NMR tube carrying the sample (\zfr{setup}c). It consists of a pair of soft, high temperature modulus, silicone O-rings (McMaster 1/16 Fractional Width, 0.254" OD). Remarkably, this arrangement proves resilient for fast shuttling with just the simplicity of a hand-tight pressure fit. The diameter of the NMR tube (Wilmad 8mm OD, 1mm thickness) was chosen to match that of the shuttling rod for a seamless joint through the alignment guides. \zfr{setup}d details the tube containing a sample of powdered diamond employed in optical hyperpolarization experiments. A plunger carrying a dielectric mirror is used to isolate the sample to a compact volume. The plunger is fitted with a threaded screw hole for easy fastening access, positioning, and removal. The mirror (Thorlabs BB1-E02 Broadband Dielectric Mirror, 400 - 750 nm) is machine ground to the inner diameter of the NMR tube, and provides a double pass for the incoming laser radiation for efficient polarization of NV center electrons. \begin{figure}[t] \centering {\includegraphics[width=0.49\textwidth]{TriggerSequence.pdf}} \caption{\textbf{Trigger sequence for field cycling and detection.} The actuator motion is triggered by a 24V pulse indirectly generated from the PulseBlaster controller. For instance, in experiments for optical polarization transfer to ${}^{13}\R{C}$ spins in diamond (\zfr{toolbox}a), the shuttling motion occurs from the low-field region where DNP is excited ($\sim$ 8mT) and finally to high-field 7T, after which the actuator returns a pulse that triggers the NMR measurement. } \zfl{trigger-sequence} \end{figure} \subsection{Synchronization and Triggering} \zsl{sync} Shuttling and inductive detection are synchronized (see \zfr{trigger-sequence}) using a high-speed pulse generator (SpinCore PulseBlaster USB 100 MHz). The servomotor is triggered to start motion for shuttling with a 24V 10ms pulse. This is generated by upconverting the 3.3V pulse trigger from the pulse generator to 5V by a TI SN74LS04N CMOS inverter, which then serves as the gate to a high voltage MOSFET switch (Williamette MHVSW-001V-036V). The MOSFET switch relays the 24V pulse to the servomotor that drives the belt-driven actuator stage to the desired position. Finally, the actuator returns a 24V pulse indicating the completion of motion, which is passed through a voltage divider to trigger the NMR console (Agilent DD2) to initiate measurement (see \zfr{trigger-sequence}). This is also used to precisely quantify the shuttling times and jitter (\zfr{shuttler-charac}). \subsection{Comparison with other field cycling platforms} Let us now briefly compare our field cycling platform to previous reports. Unlike conventional field cycling platforms, that are geared towards relaxometry experiments in liquids and proteins, our device seeks to harness the versatile dichotomy in spin dynamics regimes between low and high fields. Our instrument allows a large dynamic range magnetic field sweep from 1mT-7T, which can be further extended to a ten order-of-magnitude range 1nT-7T through enhanced low field shielding, following a zero-field setup similar to the one described in Ref.~\cite{Tayler17}. Note that in contrast, fast field cycling~\cite{Lips01} which uses specialized power supplies and switched-coils ~\cite{Sousa04,Ferrante05} to rapidly switch between magnetic fields, cannot easily access fields $>$2T. For experiments described in \zfr{toolbox}, the ability to manipulate and store spins at higher field enables applications not accessible by pulsed field cycling. Focusing now on field cycling devices employing sample shuttling, they come in two flavors: pneumatic and mechanical shuttling. Pneumatic devices generally provide higher shuttling speeds even though it is challenging to measure the speeds precisely; however compressed air causes sample vibration upon motion start and stop, which adds an additional 0.1-1s time for stabilization. Our mechanical instrument operates with high positional precision (50$\mu$m), shuttles with a maximum velocity of 2m/s with high repeatability (\zfr{shuttler-charac}), and has a large thrust force capacity (295N). While the lower speed limits it from certain tasks (eg. protein relaxometry), the precision of control over position and velocity makes it ideal for a plethora of other applications (\zsr{toolbox}), for instance for field sweeps through energy level anti-crossings over a wide dynamic range. While inspired by the pioneering mechanical field cycling platform of Redfield~\cite{Redfield12}, our device extends his original innovative field cycler in several directions. First the use of a more precise actuator stage allows the ability to access fields at very high resolution, and with high repeatability (\zfr{shuttler-charac}). The fact that the low field center is far separated from the highfield center, and primarily situated at the bottom of the magnet, allows one to accessorize the field cycler with optical and microwave irradiation and cryocooling (see \zsr{cryo}) components for spin control at low fields. This makes the field cycler as suitable for optical spin hyperpolarizaton experiments (\zsr{diamond}) involving the nitrogen vacancy center in diamond. In contrast to other mechanical shuttling designs~\cite{Chou12}, the shuttling assembly occupies only 8mm in the magnet bore, allowing interfacing with magnetic inserts~\cite{chou15} which would allow the creation of homogeneous intermediate field regions for quantum control~\cite{Cousin16}. \begin{figure}[t] \centering {\includegraphics[width=0.38\textwidth]{Instru_probe_2.pdf}} \caption{\textbf{NMR probe for high speed shuttling} which enables high speed shuttling from high to low fields. (a) The probe has a hollow Cu-shielded cylindrical opening through which the carbon fiber rod carrying the sample is shuttled. (b) The top of the probe consists of a teflon funnel guide that helps in aligned shuttling (\zfr{guide-shuttling}). Either split or saddle coils (\zfr{DNP-setup}) can be used for ${}^{13}\R{C}$ NMR detection at 75 MHz. } \zfl{probe} \end{figure} \begin{figure}[t] \centering {\includegraphics[width=0.49\textwidth]{coil_shuttling.pdf}} \caption{\textbf{Snapshots of high-speed sample shuttling}{ obtained with a camera mounted inside the NMR probe in the 7T superconducting magnet bore. Note that the rod tip here was redesigned with a Vespel holder for single crystal samples. The camera is focused on a mirror mounted on the bottom face of the teflon funnel that guides the shuttling (\zfr{probe}). {(a)} Sample approaching split NMR detection coil. {(b)} Shuttling to the low-field center, for instance for DNP excitation. The shuttling time is 648$\pm 2.6$ms (\zfr{shuttler-charac}). {(c)} Sample approaching the center of the NMR coil with better than 100$\mu$m precision. Clearance to the sides of the coil is under 0.5 mm. }} \zfl{shuttling-movie} \end{figure} \begin{figure}[t] \centering {\includegraphics[width=0.49\textwidth]{DNP-box-instrument.pdf}} \caption{\textbf{Low field optical hyperpolarization setup.} {Figure illustrates the setup for polarization transfer at low field ($\sim$ 1-30 mT), performed inside a magnetic shield under the 7T NMR magnet (see video at Ref.~\cite{shuttlervideo}). {(a)} The carbon fiber rod attached to the NMR tube carrying the diamond sample is shuttled into a DNP excitation coil. Laser irradiation (5W over a 8 mm beam diameter) is applied from the bottom of the tube with a 45 degree mirror. {(b)} Overview of the DNP coil wrapped on the inside of a quartz tube and showing connections to the 100W microwave (MW) amplifier. {(c)} Panel shows the coil originally printed on copper foil for a 9mm diameter tube. (see ~\cite{coilvideo2}).}} \zfl{DNP-setup} \end{figure} \section{NMR probe compatible with shuttling} \zsl{probe} Modifications were made to conventional NMR probe design to accommodate fast sample shuttling (\zfr{probe}) \I{through} it. \zfr{shuttling-movie} visualizes the actual shuttling process at the probe. The probe is designed hollow for shuttling to low fields below the magnet and is constructed out of 12.7 mm thick brass plates for enhanced shielding and structural rigidity. The top plate holds the tuning and matching capacitors (Voltronics AT4HV and AP14) along with the quartz tube (ID 9 mm $\times\:$ OD 11 mm Technical Glass Products) outside of which is fabricated a saddle shaped NMR coil. The probe can accommodate either split solenoid coils (\zfr{shuttling-movie}) or current saddle shaped ones (similar to \zfr{DNP-setup}c). The teflon funnel at the top (\zfr{probe}b) allows for the rod to self align (\zsr{alignment}). Assuming the sample fills the full height of the coil, the filling factor is $\approx$0.4, which is comparable to commercial probes, allowing high sensitivity inductive detection. \subsection{Saddle coils for maximizing filling factor} \zsl{coil} We have developed a rapid technique of fabricating saddle coils for NMR detection that are compatible with shuttling, yet optimized to the sample of interest to provide large filling factors. A descriptive video showing the fabrication method is available online~\cite{coilvideo2}. The coils are wrapped on a Quartz tube matched to the NMR tube being shuttled such that the sample tightly fills the entire coil volume. The coils are fabricated by cutting them out of flexible adhesive copper foil (Venture Tape, thickness 31.75 $\mu$m) (see \zfr{DNP-setup}c) using an inexpensive vinyl cutter (Silhouette Cameo2) in 17 seconds and 1.5mm cutting depth (see video at Ref.~\cite{coilvideo2}). The RF coil in the probe has 10.56mm 110$^{\circ}$ windows~\cite{Hoult1978} and track width of 1.25 mm with 0.75 mm spacing. After printing, excess copper around the coil was carefully removed and contact paper (Circuit StrongGrip Transfer Tape) was applied on top to maintain the coil shape (see ~\cite{coilvideo2}). When inserted into the quartz tube, the inside of the tube was coated with water to prevent the coil from adhering while positioning to a slit for the leads to be pulled through. A heat gun was used to release the contact paper and adhere the coil to the wall of the tube. The fabricated coils for ${}^{13}\R{C}$ NMR had an inductance of 0.28$\mu$H and Q factor of 150 at 75.03 MHz. \begin{figure}[t] \centering {\includegraphics[width=0.35\textwidth]{field_map.pdf}} \caption{\textbf{Full field map} characterizing the fields natively accessible in our field cycler. Note that we measure the longitudinal $B\hat{\T{z}}$ component of the field, and for these measurements we have removed the low-field shield to just illustrate the native fringing field of the magnet (fields $>$3.5T are not delineated due to saturation of the magnetometer). The addition of the shielding allows the modification of the low field characteristics with negligible effect at high field. The instrument is hence able to access a wide field range with high field resolution, set ultimately by the 50$\mu$m sample positional precision (see \zfr{LAC})} \zfl{field-map} \end{figure} \begin{figure}[t] \centering {\includegraphics[width=0.49\textwidth]{LAC.pdf}} \caption{\textbf{Accessing level-anticrossings in diamond.} Figure illustrates the spatial longitudinal field dependence at shuttling positions corresponding to the diamond NV center (a) ESLAC $\approx$ 510G and (b) GSLAC $\approx$ 1020G. The gradients are linear to a good approximation. (a) At the ESLAC, the 50$\mu$m positional precision of our instrument allows a field resolution of 0.114G and maximum sweep rate of 0.458T/s considering a speed of 2m/s. (b) Our shuttler can sweep through the GSLAC at 1.21T/s with a resolution of 0.303G.} \zfl{LAC} \end{figure} \begin{figure}[t] \centering {\includegraphics[width=0.49\textwidth]{low-field-instrument.pdf}} \caption{\T{Zero-field center and quantum control.} Enhanced shielding installed at the low-field center allows access to the zero field regime~\cite{Tayler17}. (a) Cross section of zero-field ($\approx 1$nT) center consisting of concentric mu-metal shields designed to fit the low-field iron shield (\zfr{setup}e). A solenoid leading into the shield enables implementation of a Hamiltonian \I{quench} to zero-field. Quantum control at zero-field is implemented via fast DC magnetic pulses (shown in (b)) generated within a triaxial Helmholtz coil is mounted on a 3D printed coil holder. (c) Switching circuit that generates fast DC pulses for spin manipulation at zero-field, shown here for a single channel (X,-X). MOSFET switches triggered and synchronized by Pulse Blaster switch current into the coils from a high-current power supply (Agilent 6653A). We routinely achieve ~1$\mu$s pulse rise times with $\approx$ 4A of current (see (b))} \zfl{ZF-setup} \end{figure} \section{Low-field center} \zsl{low-field} \subsection{Construction} Our field cycling device provides a wide dynamic field range by employing a magnetically shielded low-field location that the sample can be shuttled into (\zfr{setup}e and video at Ref.~\cite{shuttlervideo}). Since the shields sit in the $\approx$300G fringing field of the 7T magnet, they are positioned on sliding rails to secure them against upward magnetic forces. The shield is constructed out of concentric layers of stress annealed iron (NETIC S3-6 alloy 0.062'' thick, Magnetic Shield Corp.) and mu-metal (TwinLeaf MS-1), with the iron on the outside due to its high saturation, and mu-metal on the inside due to its high permeability (over $10^6$ with 4 layers). In combination, with 3 layers of iron and 4 layers of mu-metal, one can achieve a lower field center of approximately 1nT. In practice, the low-field shielding can be customized to suit the target field desired in experiments, in particular -- low fields (1-30mT) for optical DNP experiments in diamond~\cite{Ajoy17}, ultra-low fields ($<1\mu$T) for relaxometry, and even ‘zero’ fields ($<1$nT) for applications exploiting isotropic Hamiltonians models~\cite{Burgarth17, Llor91,Appelt10,Ledbetter11} and decoherence free subspaces ~\cite{Emondts14,Pileio10} readily available at these fields. \subsection{Field map} We have obtained a $B_z$ field map over the full travel range of the sample from low to high field (\zfr{field-map}). Measurements were performed with a sensitive longitudinal field Gaussmeter (Lakeshore HMMA-2504-VR-10) that is inserted into the hollow shuttling rod so as to be aligned centered with the bore. The fact that the superconducting magnet is unshielded leads to rather weak gradients in the fringing field, allowing one to access fields with $<$1G resolution over a wide range given the 50$\mu$m precision over sample position. This is highlighted in \zfr{LAC} for the excited (ESLAC $\approx$510G) and ground (GSLAC $\approx$1020G) state level crossings of NV centers in diamond. The weak gradients manifest as approximately linear spatial field dependencies. Indeed our instrument allows us to access the ESLAC region with a $\approx$114mG resolution, and sweep through it at 0.458T/s. This would allow applications for the optical hyperpolarization of ${}^{13}\R{C}$ nuclei and P1 centers in the vicinity of the ESLAC (\zfr{toolbox}f)~\cite{Fischer13,wunderlich17,Pagliero17}. \subsection{Zero-field quantum control} While our focus in this paper is the use of the device in the low-field regime, our instrument also potentially allows one to achieve a zero-field~\cite{Tayler17} ($<$1nT) center by interfacing concentric mu-metal shields into the iron low-field volume (\zfr{ZF-setup}). Quantum control at zero-field can be enabled using fast DC magnetic field pulses. We have developed a pulsing circuit consisting of high power MOSFETs that allow the rapid switching of current from a 600W power supply generating fast DC pulses for spin manipulation (see \zfr{ZF-setup}c). The free evolution of Hamiltonian in the absence of a static magnetic field without laser and microwave irradiation is isotropic. This opens the possibility to exploit isotropic Hamiltonians and fast entanglement growth that naturally occurs at zero-field for several quantum simulation problems~\cite{Burgarth17}, while retaining the high detection sensitivity at high field. A detailed description of experiments in this regime will be presented elsewhere~\cite{Ajoy17u}. \section{Applications to ${}^{13}\R{C}$ optical hyperpolarization in diamond} \zsl{diamond} We recently employed the unique field cycling ability of our instrument, along with the ability of laser and microwave control of the NV electronic spins at low field to develop a novel method for dynamic nuclear polarization (DNP) of ${}^{13}\R{C}$ spins in powdered diamond ~\cite{Ajoy17}. The aim of this paper is to highlight how the complimentary advantages of low and high fields enabled by our instrument enabled this advance. Low fields (typically employed $B _{ \text{pol}}\sim$1-30mT) mitigate of the strong orientation dependence of the NV centers, while high fields allow efficient detection of the generated hyperpolarization. Importantly, low fields allow one to invert the conventional hierarchy used in DNP experiments, entering the regime where the nuclear Larmor frequency is smaller than the electronic hyperfine interaction. This engenders hyperpolarization generation through microwave frequency sweeps of the electronic spectrum. To be more specific, \zfr{DNP-setup} describes the DNP setup in the low-field center (see video at Ref.~\cite{shuttlervideo}). The sample is irradiated simultaneously with laser and microwaves sweeping across the inhomogeneously broadened NV center powder pattern to perform the polarization transfer (\zfr{dnp}a). The microwave excitation is produced via coils (outlined in \zsr{coil}) connected to a high power (20-100W) microwave amplifier. The DNP mechanism (see \zfr{dnp}c) can be interpreted as partly-adiabatic traversals of Landau-Zener crossing in the rotating frame, with a model of NV electron coupled to a single ${}^{13}\R{C}$ nucleus~\cite{Ajoy17}. In the low field hyperpolarization regime, the ${}^{13}\R{C}$ nuclear Larmor frequency $\omega_L =\gamma B_{\text{pol}} \lesssim \left| A \right|$. In the NV sublevel $m_s=\pm 1$, the eigenstates are set by the hyperfine coupling, denoted as $\beta_{\uparrow}$ and $\beta_{\downarrow}$. On the other hand, nuclear eigenstates become dominant in the $m_s=0$, manifold, and are denoted as $\alpha_{\uparrow}$ and $\alpha_{\downarrow}$. When taking second order hyperfine coupling into consideration, Larmor frequency $\tilde { \omega } _ { L } \approx \omega _ { L } + \frac { \gamma _ { e } B _ { \text { pol } } A \sin \vartheta } { \Delta - \gamma _ { e } B _ { \text { pol } } \cos \vartheta }$, where $\vartheta$ is the orientation of N-to-V axis respect to external magnetic field, and $\Delta$=2.87GHz is the NV zero-field splitting. Sweeping microwaves across this set of transitions, leads to their sequential excite a set of transitions that drive the coherence hyperpolarization transfer~\cite{Ajoy17, Ajoy18}. We demonstrated that the hyperpolarization transfer is an orientation independent hyperpolarization technique, and is enabled by the relatively small inhomogeneous broadening ($\approx $400MHz) of the NV electronic linewidth (powder pattern) at low fields (1-30mT). As a typical example, for 200$\mu$m diamond particles (Element6) containing about 1ppm of NV centers, the ${}^{13}\R{C}$ polarization at a field of 13mT was enhanced to the level corresponding to thermal magnetization at a field higher than 1900T. Field cycling allows one to harness the high sensitivity of inductive measurement at 7T (\zfr{dnp}b), enabling the unambiguous inductive readout of the bulk ${}^{13}\R{C}$ nuclear magnetization. Indeed hyperpolarization enables a measurement time gain of about five orders of magnitude at 7T, allowing the detection of a single 200$\mu$m particle with unit SNR in one shot~\cite{Ajoy17}. The high-precision and programmable field cycling ability of our setup also proves beneficial in relaxometry, in determining the factors affecting the spin lifetimes times of the ${}^{13}\R{C}$ nuclei in diamond. \zfr{T1B} for instance shows a relaxation-field map $T_1({B})$ for 200$\mu$m powdered diamond microparticles at various fields ${B}$. For these measurements, we first begin by hyperpolarizing the ${}^{13}\R{C}$ nuclei \I{opposite} to the direction set by ${B}_0=$7T. The sample is then rapidly shuttled to the target field $B_\R{relax}$, allowed to wait for time $T_\R{relax}$, and then rapidly shuttled again to 7T for detection. Sweeping $t$ and fitting the decay to a monoexponential provides the lifetime $T_1({B})$. Substantial time savings, typically 4-5 orders of magnitude, are obtained via the hyperpolarization process. \zfr{T1B}a shows typical relaxation data at explemary low and high fields. We measure the $T_1$ times to be 395.7s at ${B}_0=7$T and 10.19s at ${B}_{\R{pol}}=$8mT. Since the DNP polarization is inhomogeneous, i.e. spins closer to the NV centers are more strongly polarized, spin diffusion between them also causes a signal decay at low fields, leading to a super-exponential fall in signal. This feature slightly underestimates the $T_1$ at ${B}_{\R{pol}}$. The field dependent relaxation data in \zfr{T1B}b shows a steep dependence with field, the spin lifetimes falling rapidly at low fields, but growing to long room temperature polarization lifetimes ($\sim$5min) beyond 1T. This feature arises from an increasing overlap between the ${}^{13}\R{C}$ Larmor and electronic dipolar reservoirs associated for instance with P1 centers at low fields, and will be addressed in detail in a future manuscript. \begin{figure}[t] \centering {\includegraphics[width=0.49\textwidth]{Instru_DNP_1.pdf}} \caption{\textbf{${}^{13}\R{C}$ optical hyperpolarization in diamond.} (a) Hyperpolarization protocol via laser irradiation that polarizes NV center to $m_s=0$ sublevel (close to $100\%$) and frequency/field sweeping over NV center ESR spectrum which transfers the polarization to ${}^{13}\R{C}$ nuclei~\cite{Ajoy17}. (b) $200\mu m$ diamond powder hyperpolarized at 13mT displays 277 times signal gain over Boltzmann thermal polarization. Orange line shows the ${}^{13}\R{C}$ NMR signal due to Boltzmann polarization at 7T, averaged 120 times over 7 hours, while the purple line is a single shot DNP signal obtained with 40s of optical pumping. The signals are displayed with their noise unit-normalized for comparison. (c) Model of NV center coupled to a single ${}^{13}\R{C}$ nucleus with hyperfine interaction $A$. The N-V axis oriented at $\theta$ respect to external magnetic field $B_{pol}$. At low polarizing fields, we access the regime where the ${}^{13}\R{C}$ nuclear Larmor frequency $\omega_L =\gamma B_{pol} \lesssim \left| A \right|$~\cite{Ajoy17}. } \zfl{dnp} \end{figure} \begin{figure}[t] \centering {\includegraphics[width=0.5\textwidth]{Instru_T1_2.pdf}} \caption{\textbf{Mapping ${}^{13}\R{C}$ spin relaxation times.} (a) $T_1$ lifetimes of ${}^{13}\R{C}$ nuclear spins in 200$\mu$m diamond particles measured experimentally with our instrument at two explemary fields, at low field ${B}_{\R{pol}}=$8mT where DNP is excited and high field ${B}_0=$7T where the polarization is detected. The low-field $T_1$ shows a super-exponential decay, which we hypothesize arises due to spin diffusion. \I{Inset:} Measurement protocol. After optically hyperpolarized at low field, the sample was rapidly delivered to a designated $B_\R{relax}$ to relax for $T_\R{relax}$, followed by a rapid shuttling to high field and subsequent detection. (b) Map of field dependence of relaxation time, $T_1(B)$ was obtained by extracting the monoexponential decay constant from the full decay curve at every field value. We observe a sharp increase in relaxation time $T_1$ past a field of $\approx$0.5T. This dependence arises from an interaction of the ${}^{13}\R{C}$ nuclei with the dominant dipolar coupled bath of P1 centers. \I{Inset:} Relaxation rate $1/T_1$ on log scale.} \zfl{T1B} \end{figure} \begin{figure}[t] \centering {\includegraphics[width=0.49\textwidth]{LN2.pdf}} \caption{\T{Cryogenic system for rapid sample freeze.} (a) An NMR tube is filled with liquid nitrogen through a fine slit to immerse the glass bulb containing the sample in a cryogenic bath. The sample is frozen uniformly within 3-4s before sample is laser irradiated from the bottom of the tube. (b) Panel demonstrates liquid nitrogen injection. The cryogenic jet flows from the quartz nozzle for 1s. Under laser irradiation, the liquid remains in the tube for 30s. (c) Panel depicts the dewar that creates constant pressure for liquid flow. The dewar is (re)filled from the top and stores 5.45L of cryogenic liquid for 1 hour. Solenoid valves are triggered by the Pulse Blaster (see \zfr{trigger-sequence}) to control refilling and ejection of liquid nitrogen.} \zfl{LN2} \end{figure} \section{In-situ fast sample freeze} \zsl{cryo} We have interfaced our field cycling instrument with a homebuilt liquid nitrogen (LN$_2$) cryogenic system for fast in-situ freezing of the sample at the low-field center (\zfr{setup}a). The primary aim is to increase the sample $T_1$ lifetimes. For instance, ${}^{13}\R{C}$ spins in pyruvate, an important molecule in the metabolic cycle and cancer detection, can exceed 55s at 10mT~\cite{Chattergoon13}, but when frozen the resulting $T_1$ can be nearly an hour~\cite{van11}. A striking example of where such sample cooling would be useful is when employed for a ``\I{nanodiamond hyperpolarizer}'' -- where polarization can be transferred from optically polarized ${}^{13}\R{C}$ nuclei in high surface area diamond particles to external ${}^{13}\R{C}$ in the frozen solution~\cite{Ajoy17} -- the long $T_1$ times enabling a larger buildup of hyperpolarization. \zfr{LN2} describes the setup. The design incorporates a means to rapidly cool the sample in a manner that can be synchronized with the device shuttling (\zfr{trigger-sequence}). A consistent jet of cryogenic liquid is rapidly ejected from a nozzle (see \zfr{DNP-setup}) on-demand which cools the sample to 77K (liquid nitrogen temperature) within 3-4 seconds. Flowing N$_2$ gas is applied to evacuate water vapor to prevent condensation. A dewar with two openings (\zfr{LN2}c) stores cryogenic liquid and creates the pressure that drives the LN$_2$ flow. The top opening is for (re-)filling by an external liquid nitrogen source, and the bottom for injecting liquid into a quartz nitrogen nozzle to generate a jet (\zfr{LN2}b). Both inlet and outlet are regulated by two solenoid valves individually (Asco 1/4” Cryogenic Solenoid Valve, 7/32” orifice diameter, 24VDC control voltage), which can be triggered indirectly by the Pulse Blaster and respond within 1ms to ensure synchronization (see \zsr{sync}). The system is designed so that laser irradiation and cryogenic cooling can occur simultaneously, and the LN$_2$ level in the dewar is constantly replenished to maintain a constant jet pressure. The exact manner in which the sample cooling occurs is detailed in \zfr{LN2}a. A fine slit in the sample tube allows an inlet to the cryogenic liquid, ensuring that it forms a cold bath around the sample. The sample itself is held in a glass bulb within the tube. The liquid remains in the NMR tube for more than 30s with only 1s LN$_2$ injection, during which period the temperature in the tube remains stable even with laser irradiation. Importantly, this implementation of sample freeze is completely compatible with the field cycling -- the LN$_2$ bath shuttled along with the sample at high speed and does not affect the inductive measurement at 7T. The sample can be rapidly thawed prior to measurement by a resistive heater attached in the NMR probe to enable high resolution readout. \begin{figure*}[t] \centering {\includegraphics[width=0.96\textwidth]{experiment_diagrams.pdf}} \caption{\T{Proposed experiments} employing our field cycling instrument with low (1-30mT) and high (7T) field spin control and measurement (i-iv), along with the ability to access intermediate fields upto 2m/s sample shuttling speeds (v-vi). (a) \I{Low field DNP:} The device allows the room temperature hyperpolarization of ${}^{13}\R{C}$ nuclei in diamond nano- and micro-particles, allowing their use in signal enhanced MRI. (b-c) \I{Relaxometry:} Accessing intermediate fields with high precision allows field dependent nuclear $T_1$ measurement with thermal polarization and hyperpolarization. (d-e) \I{Spin storage at high fields:} Long nuclear $T_1$'s at high field allow one to exploit the ${}^{13}\R{C}$ nuclei as quantum memories for enhanced computation and sensing tasks. (f) The high spatial resolution allows the ability to access and sweep through level anti-crossings at intermediate fields with high precision, with applications in coherent polarization transfer.} \zfl{toolbox} \end{figure*} \section{Proposed experiments harnessing high and low magnetic fields} \zsl{toolbox} Our field cycling instrument allows one to harness the power of quantum control and measurement at low (1-30mT) and high (7T) fields, along with the ability to access intermediate fields with high resolution and controllable sweep rates. Indeed programming the field trajectories with a high degree of control allows versatile use of the device for several applications. In this section, we mention some potential experiments exploiting this capability. For concreteness, we focus in \zfr{toolbox} on potential experiments in the system consisting of NV centers and ${}^{13}\R{C}$ nuclear spins in diamond. \I{Hyperpolarized diamond MRI:} -- The optical access and microwave control of the NV electronic spin available at low fields enable the coherent optical hyperpolarization of ${}^{13}\R{C}$ nuclei (see \zsr{diamond}). Our instrument opens the potential to at once hyperpolarize diamond nano- and micro-particles at low field~\cite{Ajoy17}, and image them with MRI with high sensitivity (\zfr{toolbox}a). Diamond particles are non-cytotoxic, and can be easily functionalized~\cite{liu07,fu07,Schrand09,Bumb13}. Hence the use of hyperpolarized ${}^{13}\R{C}$ spins in diamond particles as MRI tracers is especially compelling -- the hyperpolarization providing bright MRI contrast that reports directly on the particle position, allowing their use as microfluidic flow tracers, as well as bio-sensors. \I{Relaxometry:} -- Our device can be employed for relaxometry using conventional Boltzmann polarization (\zfr{toolbox}b) or low-field hyperpolarization (\zfr{toolbox}c). Particularly pertinent for these applications are the ability to field cycle with high resolution, over a wide field range, and under programmable field trajectories, all of which our device can perform exceedingly well. We envision the use of this field cycling device broadly for hyperpolarized relaxometry of substances that are polarized via the diamond particles, with hyperpolarization providing significant savings in experimental time for the measurements. While in \zfr{T1B} we had considered exemplary hyperpolarized relaxometry on ${}^{13}\R{C}$ nuclei in diamond, a more detailed exposition of the factors determining the ${}^{13}\R{C}$ lifetimes (extracted from this data) will be presented in a forthcoming publication. \I{Quantum memories at high field:} -- High fields enable long ${}^{13}\R{C}$ nuclear $T_1$'s, which in ultrapure diamond could exceed a few hours. Even for diamond microparticles containing a high density ($>$1ppm) of NV centers, we have observed nuclear $T_1$ approaching 400s at 7T (see \zfr{T1B}). These long lifetimes make the ${}^{13}\R{C}$ nuclei very attractive as ancillary quantum memories for the NV electronic qubits~\cite{Ajoy15,Zaiser16,Rosskopf17,Ajoy12g}. Field cycling hence allows the dual benefit of long nuclear lifetimes at high field and technically simple electronic control and readout at low field. High fields are also associated with a concomitant increase in the nuclear coherence time, a fact that engenders their use in ancilla assisted quantum sensing protocols (\zfr{toolbox}e-f). Indeed there can be a significant boosts in quantum sensing resolution in such protocols, with resolution $\Delta f\leq 1/T_{2,\R{memory}}$~\cite{Aslam17}. Such an experiment is schematically represented in \zfr{toolbox}e-f: a quantum sensing (eg. magnetometery) experiment is first performed via the NV electron, the states of the NV and ${}^{13}\R{C}$ nuclei are then correlated~\cite{Laraoui13} and the quantum information stored at high field for $T_{2,\R{memory}}$. A subsequent sensing experiment performed with the NV can then be correlated with the previous measurement, and the result readout optically via NV center flouresence (\zfr{toolbox}e), or inductively via the ${}^{13}\R{C}$ magnetization (\zfr{toolbox}f). \I{Accessing level anti-crossings:} -- The high precision and repeatability of our instrument, along with its ability to sweep different fields with a programmable velocity profile, enable it to access specific level anti-crossings (LACs) over an extremely wide dynamic range (1mT-7T) (see \zfr{LAC}). LACs are traditionally helpful in several hyperpolarization contexts, for instance in optically pumped NV centers at the ESLAC ($\sim$ 510G) transferring their polarization to ${}^{13}\R{C}$ nuclei and P1 centers~\cite{Fischer13,wunderlich17,Pagliero17}, and in parahydrogen based SABRE e.g. at 6mT to hyperpolarize ${}^{1}$H and at 0.1-1$\mu$T for ${}^{13}\R{C}$ and ${}^{15}$N nuclei~\cite{Pravdivtsev213}. The high dynamic range allows access to low and high field LACs~\cite{Clevenson16} and clock states~\cite{Parker15x} that have been technically hard to probe previously. The small size of the sample and confined position at the center of the fringe field guarantee the homogeneity of the field. \section{Conclusions and Outlook} In summary, low and high fields offer complimentary advantages that can be harnessed together in order to open interesting avenues in metrology, hyperpolarization, and quantum information science. Low fields offer access to coupling dominated Hamiltonians, with low anisotropy, and spin indistinguishability; while high fields allow spin selectivity, long lifetime sand coherence times, and high SNR bulk detection. In this manuscript, we have described the construction and operation of a device that blends these two complimentary advantages on a single platform. In particular, we have constructed a novel field cycling platform capable of rapid ($<$ 700ms) magnetic field sweeps over a wide field range in principle up to 1nT-7T. High positional precision and repeatability allows access to fields with high resolution. The device also allows optical and microwave spin control, and sample cooling at low fields, along with sensitive inductive readout at high field. While we have geared our device strongly to the applications in hyperpolarization of solids using optical pumping at low fields, we envision several applications in relaxometry, imaging, and quantum sensing, control and information storage that will be enabled by our instrument. \section{Acknowledgements} We gratefully thank A. Redfield, D. Suter, T. Zens and A. Llor for insightful conversations. We acknowledge valuable contributions from E. Granlund, J. D. Breen, S. Thangaratnam, R. Clark, S. Ebert, M. Garcia, D. Arnold, X. Cai, A. Kumar, A. Lin, G. Li, P. Raghavan, J. Wang, T. Huynh and J. Fyson, and the UC Berkeley College of Chemistry machine shop. C.A.M. acknowledges support from the National Science Foundation through grants NSF-1309640 and NSF-1401632, and from Research Corporation for Science Advancement through a FRED Award. The authors and UC Berkeley have filed patents on the instrument, techniques and applications.
\section{Supplementary material for Section \ref{sec:general_cost}}\label{appendix_C} \emph{Proof of Proposition \ref{theorem:intermediate}} Firstly, we prove that for any $\lambda \in \Lambda^{\dagger}$, $\mathcal{F}^{*}(\lambda) \subseteq \mathcal{F}^{\dagger}$. From the definition of $\Lambda^{\dagger}$ in \eqref{eq:intermediate}, we know that for any $\lambda \in \Lambda^{\dagger}$, there exists at least one route flow $\l^{\dagger} \in \mathcal{F}^{\dagger}$ satisfying the constraints in \eqref{opt_l}, and hence such $\l^{\dagger}$ is a feasible solution of the optimization problem \eqref{opt_l}; thus $\widehat{\potential}(\l^{\dagger}) \geq \Psi(\lamb)$. Additionally, since $\l^{\dagger}$ is an optimal solution of \eqref{eq:drop_all}, which has the same objective function as \eqref{opt_l} but without the constraints \eqref{prime:popu_i}, we conclude that $\widehat{\potential}(\l^{\dagger}) \leq \Psi(\lamb)$ for any feasible $\lambda$ (including $\lambda \in \Lambda^{\dagger}$). Thus, $\Psi(\lamb)=\widehat{\potential}(\l^{\dagger})$, and $\l^{\dagger}$ is an equilibrium route flow. Analogous to the argument in proof of Theorem \ref{q_opt}, the equilibrium edge load equals to $w^{\dagger}$. Since the set $\mathcal{F}^{\dagger}$ in \eqref{eq:Ldag_polytope} contains all route flows such that the induced edge load is $w^{\dagger}$, we can conclude that the set of equilibrium route flow $\mathcal{F}^{*}(\lambda) \subseteq \mathcal{F}^{\dagger}$ for any $\lambda \in \Lambda^{\dagger}$. Next, we prove that $\Lambda^{\dagger} = \argmin_{\lambda} \Psi(\lamb)$. We have argued in the first part of the proof that for any $\l^{\dagger} \in \mathcal{F}^{\dagger}$, $\widehat{\potential}(\l^{\dagger}) \leq \Psi(\lamb)$ for any feasible $\lambda$; and since for any $\lambda \in \Lambda^{\dagger}$, $\mathcal{F}^{*}(\lambda) \subseteq \mathcal{F}^{\dagger}$, we have $\Psi(\lamb)=\widehat{\potential}(\l^{\dagger})$. Therefore, $\widehat{\potential}(\l^{\dagger})=\min_{\lambda} \Psi(\lamb)$, and $\Lambda^{\dagger} \subseteq \argmin_{\lambda} \Psi(\lamb)$. Additionally, for any $\lambda\in \argmin_{\lambda} \Psi(\lamb)$, we have $\Psi(\lamb)=\min_{\lambda} \Psi(\lamb)=\widehat{\potential}(\l^{\dagger})$. Since $\mathcal{F}^{\dagger}$ includes all route flows that satisfy \eqref{sub:balance}-\eqref{sub:l_positive} and attain the minimum value of $\Psi(\lamb)$, any equilibrium route flow $\l^{*} \in \mathcal{F}^{*}(\lambda)$ for $\lambda \in \argmin_{\lambda} \Psi(\lamb)$ must be in $\mathcal{F}^{\dagger}$. Hence, such $\lambda$ must also be in $\Lambda^{\dagger}$ defined in \eqref{eq:intermediate}, i.e. $\argmin_{\lambda} \Psi(\lamb) \subseteq \Lambda^{\dagger}$. We can therefore conclude that $\Lambda^{\dagger} = \argmin_{\lambda} \Psi(\lamb)$. From Lemma \ref{lemma:directional_derivative_psi}, we know that the function $\Psi(\lamb)$ is convex in $\lambda$. Additionally, the set of feasible population size vector $\lambda$ is a closed convex set. Consequently, the set $\Lambda^{\dagger} = \argmin_{\lambda} \Psi(\lamb)$ is convex and non-empty. Finally, we show that $w^{*}(\lambda)=w^{\dagger}$ if and only if $\lambda \in \Lambda^{\dagger}$. From the first part of the proof, we know that $\mathcal{F}^{*}(\lambda) \subseteq \mathcal{F}^{\dagger}$. Therefore, the unique equilibrium edge load is $w^{\dagger}$, which does not depend on $\lambda$. Additionally, for any feasible $\lambda \notin \Lambda^{\dagger}$, from the second part of the proof, we know that $\Psi(\lamb)>\widecheck{\potential}(w^{\dagger})$. Thus, $w^{*}(\lambda) \neq w^{\dagger}$. \hfill\ensuremath{\square} \section{Extension to Networks with Multiple Origin-destination Pairs}\label{appendix_D} In this section, we extend our model to networks with multiple origin-destination pairs, and show that all the results presented in the paper still hold. Consider a network with a set of origin-destination (o-d) pairs $\mathcal{K}$. Each o-d pair $k \in \mathcal{K}$ is connected by the set of routes $\routeSet_k$. The set of all routes is $\routeSet = \cup_{k \in \mathcal{K}} \routeSet_k$. The demand of travelers between o-d pair $k \in \mathcal{K}$ is $D_k > 0$. The information environment -- state, TISs, signals and common prior --is the same as that introduced in Sec. \ref{network}. The fraction of travelers between o-d pair $k\in \mathcal{K}$ who subscribe to TIS $i \in \playerSet$ is $\lambda_k^i$. A feasible size vector $\lambda = (\lambda_k^i)_{k \in \mathcal{K}, i \in \playerSet}$ satisfies $\lambda_k^i\geq 0$ for any $k \in \mathcal{K}$ and any $i \in \playerSet$, and $\sum_{i \in \playerSet}\lambda_k^i=1$ for any $k \in \mathcal{K}$. We denote the strategy profile as $q=(q_{r,k}^{i}(t^i))_{r \in \routeSet_k, i \in \playerSet, t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti], k \in \mathcal{K}}$, where $q_{r,k}^{i}(t^i)$ is the amount of travelers in population $i$ who take route $r$ between o-d pair $k$ when the signal is $t^i$. A strategy profile $q$ is feasible if it satisfies: \begin{align*} \sum_{r \in R_k} q_{r,k}^{i}(t^i)&=\lambda_k^i \cdot D_k, \quad \forall i \in \playerSet, \quad \forall t^i \in \playerTypeSet^i, \quad \forall k \in \mathcal{K}, \\ q_{r,k}^{i}(t^i) & \geq 0, \quad \forall r \in \routeSet_k, \quad \forall i \in \playerSet, \quad \forall t^i \in \playerTypeSet^i, \quad \forall k \in \mathcal{K}. \end{align*} For any feasible strategy profile $q$, the induced route flow vector is $f=(f_{r, k}(t))_{r \in \routeSet_k, k \in \mathcal{K}, t \in \playerTypeSet}$, where $f_{r, k}(t)$ is the flow on route $r$ induced by travelers between o-d pair $k$ when the type profile is $t$: \begin{align}\label{eceq:q} f_{r, k}(t)= \sum_{i \in \playerSet}q_{r,k}^{i}(t^i), \quad \forall r \in \routeSet_k, \quad \forall k \in \mathcal{K}, \quad \forall t \in \playerTypeSet. \end{align}The aggregate edge load on edge $e \in \E$ when the type profile is $t$ can be written as follows: \begin{align}\label{we} w_e(t)= \sum_{i \in \playerSet}\sum_{k \in \mathcal{K}}\sum_{r \in \left\{\routeSet_k|r \ni e\right\}} q_{r,k}^{i}(t^i)\stackrel{\eqref{eceq:q}}{=} \sum_{k \in \mathcal{K}}\sum_{r \in \left\{\routeSet_k|r \ni e\right\}} f_{r, k}(t). \end{align} The expected cost of each route $r \in \routeSet$ given type $t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]$, denoted $\mathbb{E}[\cfun_{\r}({\q})|\ti]$, can be written as in \eqref{eq:ecrti}. A feasible strategy profile $\q^{*}$ is a BWE if for any $k \in \mathcal{K}$, any $i \in \playerSet$, and any $t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]$: \begin{align*} \forall \r \in \routeSet_k, \quad q_{r,k}^{i*}(t^i)>0 \quad \Rightarrow \quad \mathbb{E}[\cfun_{\r}({\qwe})|\ti] \leq \mathbb{E}[\cfun_{\r'}(\q^{*})|\ti], \quad \forall \r' \in \routeSet_k. \end{align*} We now state the extensions of our results to the network with $\mathcal{K}$ o-d pairs. Firstly, we can check that the following function of $\strat$ is a weighted potential function of the Bayesian congestion game with $\mathcal{K}$ o-d pairs: \begin{align*} \Phi(q)= \sum_{e \in \E}\sum_{s \in \S} \sum_{t \in \playerTypeSet}\pi(s, t) \int_{0}^{\sum_{i \in \playerSet}\sum_{k \in \mathcal{K}}\sum_{r \in \left\{\routeSet_k|r \ni e\right\}} q_{r,k}^{i}(t^i)} c_e^s(z) dz, \end{align*} Therefore, given any size vector $\lambda$, the set of equilibrium strategy profiles $\mathcal{\Q}^{*}(\lambda)$ can be solved by the same convex optimization problem \eqref{eq:potential_opt} in Theorem \ref{q_opt}. The equilibrium edge load $w^{*}(\lambda)$ is unique. Secondly, with simple modifications, we characterize the set of feasible route flow vectors $\mathcal{F}$ as follows: \begin{align*} \mathcal{F} \stackrel{\Delta}{=} \{\l ~ \vert ~\forall k \in \mathcal{K}, ~\text{$(\l_{r, k}(t))_{r \in \routeSet_k, t \in \playerTypeSet}$ satisfies \eqref{sub:balance} -- \eqref{sub:popu_i}}\}, \end{align*} and the set of equilibrium route flows $\mathcal{F}^{*}(\lambda)$ can be solved by the optimization problem \eqref{opt_l} in Proposition \ref{l_opt}. Particularly, the information impact constraint \eqref{sub:popu_i} for o-d pair $k \in \mathcal{K}$ and population $\i \in \playerSet$ now becomes: \begin{align}\label{IIC} D_k - \sum_{r \in \routeSet_k} \min_{t^i \in \playerTypeSet^i} f_{r,k}(t^i, t^{-i}) \leq \lambda_k^i \totalDemand_k, \quad \forall t^{-i} \in \playerTypeSet^{-i}, \quad \forall i \in \playerSet, \quad \forall k \in \mathcal{K}. \end{align} That is, the impact of information sent by TIS $i$ on the route flows between o-d pair $k$ is bounded by the amount of travelers who subscribe to TIS $i$ and travel between o-d pair $k$. Thirdly, for any o-d pair $k$ and any pair of TISs $i$ and $j$, we can analogously analyze how the equilibrium outcomes change with the sizes $\lambda_k^i$ and $\lambda_k^j$, while the sizes of all other populations remain unchanged. We denote this direction of perturbing $\lambda$ as $z_k^{ij}$. We can show that Theorem \eqref{l_behavior} holds: three regimes (one or two may be empty) can be distinguished by whether or not the information impact all the travelers between o-d pair $k$ who subscribe to TIS $i$ (resp. $j$), i.e. whether or not \eqref{IIC} is tight at the optimum of \eqref{opt_l}. Fourthly, the relative value of information, denoted $V_k^{ij*}(\lambda)$, is the travel cost saving experienced by travelers between o-d pair $k$ who subscribe to TIS $i$ compared with travelers who subscribe to TIS $j$. Analogous to Lemma \ref{lemma:directional_derivative_psi}, we obtain: \begin{align*} V_k^{ij*}(\lambda)= C_k^{j*}(\lambda)-C_k^{i*}(\lambda)= - \frac{1}{D_k} \nabla \Phi_{z_k^{ij}}(q). \end{align*} By applying sensitivity analysis, we can show that $V_k^{ij*}(\lambda)$ is positive, zero, and negative in the three regimes respectively. Finally, we analyze how travelers between each o-d pair $k \in \mathcal{K}$ choose TIS subscription. By dropping the information impact constraints \eqref{IIC} in \eqref{opt_l} and following \eqref{eq:Ldag_polytope} - \eqref{eq:intermediate}, we obtain the extension of Theorem \ref{order_population}: characterization of the set $\Lambda^{\dagger}$, which is the set of size vectors induced by travelers' choice of TISs. We note that how an individual traveler between o-d pair $k$ chooses information subscription not only depends on the choices of other travelers between the same o-d pair, but also the choices of travelers who travel between other o-d pairs. This is because travelers between different o-d pairs may take common routes and edges, and hence impact each other’s costs. \section{Supplementary Material for Section \ref{equilibrium_regime}}\label{appendix_B} \begin{lem}\label{unique_wdagij} The route flows $\l^{\i \j, \dagger} \in \mathcal{F}^{\i \j, \dagger}$ induce a unique edge load $w^{\i \j, \dagger}$. \end{lem} \emph{Proof of Lemma \ref{unique_wdagij}} Following \eqref{eq:q_w} and \eqref{opt_l}, any edge load $w^{\i \j, \dagger}$ induced by route flows in $\mathcal{F}^{\i \j, \dagger}$ (which we defined as optimal solution set of \eqref{eq:basic_opt_ij}) is an optimal solution of the following optimization problem: \begin{align*} \min_{w}\quad & \widecheck{\potential}(w), \\ s.t. \quad & w_{\e}(\t)=\sum_{\r \ni \e} \load_{\path}(\t), \quad \forall \t \in \playerTypeSet, \quad \forall \e \in \E,\\ & \text{$\l$ satisfies \eqref{sub:balance}, \eqref{sub:ldemand}, \eqref{sub:l_positive}, \eqref{prime:popu_i}$\setminus\{\i, \j\}$, \eqref{extra}.} \end{align*} The constraints \eqref{sub:balance}, \eqref{sub:ldemand}, \eqref{sub:l_positive} are linear constraints. Following from \eqref{affine_popu_i}, constraints \eqref{prime:popu_i}$\setminus\{\i, \j\}$, \eqref{extra} are each equivalent to a set of linear constraints. Additionally, $w$ is a linear function of $\l$, thus the feasible set of $w$ in this optimization problem must also be a convex polytope. Since $\widecheck{\potential}(w)$ is a strictly convex function in $w$, the optimal solution $w^{\i \j, \dagger}$ is unique. \hfill\ensuremath{\square} \emph{Proof of Lemma \ref{lemma:lambl_lambup}.} First, we show that both thresholds $\underline{\lamb}^\i$ and $\bar{\lamb}^\i$ belong to the interval $[0,1-|\lamb^{-\i \j}|]$. Since $\underline{\lamb}^\i$ is attainable on the set $\mathcal{F}^{\i \j, \dagger}$, there exists $\tilde{\l}^{\i \j, \dagger} \in \mathcal{F}^{\i \j, \dagger}$ such that: \begin{equation*} \begin{split} \underline{\lamb}^\i = \frac{1}{\totalDemand}\widehat{J}^{\i}(\tilde{\l}^{\i \j, \dagger}) \stackrel{\text{\eqref{widehatj}}}{=}\frac{1}{\totalDemand}\(\totalDemand-\sum_{\r \in \routeSet} \min_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \tilde{\l}^{\i \j, \dagger}_\r\(t^i, \playerType^{-\player}\)\) \geq\frac{1}{\totalDemand}\(\totalDemand-\sum_{\r \in \routeSet} \tilde{\l}^{\i \j, \dagger}_\r\(\widehat{\t}^{\i}, \playerType^{-\player}\)\)\stackrel{\eqref{sub:ldemand}}{=}0. \end{split} \end{equation*} Similarly, we can check that $\bar{\lamb}^\i \leq 1-|\lamb^{-\i \j}|$. Additionally, we know for any $\l^{\i \j, \dagger} \in \mathcal{F}^{\i \j, \dagger}$: \begin{align*} \bar{\lamb}^\i \stackrel{\eqref{pairwise_threshold}}{\geq} \frac{1}{\totalDemand} \left\{\(1-|\lamb^{-\i \j}|\)\totalDemand-\widehat{J}^{\j}(\l^{\i \j, \dagger})\right\} \stackrel{\eqref{extra}}{\geq} \frac{1}{\totalDemand}\widehat{\md}^{\i}(\l^{\i \j, \dagger}) \stackrel{\eqref{pairwise_threshold}}{\geq} \underline{\lamb}^\i. \end{align*} Therefore, $0 \leq \underline{\lamb}^\i \leq \bar{\lamb}^\i \leq 1-|\lamb^{-\i \j}|$. \hfill\ensuremath{\square} For any two populations $\i, \j \in \playerSet$, we can compute the threshold $\underline{\lamb}^\i$ as follows: \begin{equation}\label{linear_program_lambli} \begin{split} \min \quad &y \\ s.t. \quad & \totalDemand- \sum_{\r \in \routeSet} \load_{\path}(t^i_\r, \widehat{\t}^{-\i}) \leq y \cdot \totalDemand, \quad \forall t^i_1 \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti], \dots, \forall t^i_{|\routeSet|} \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti],\\ & \l^{\i \j, \dagger} \in \mathcal{F}^{\i \j, \dagger}, \end{split} \end{equation} where $\mathcal{F}^{\i \j, \dagger}$ is the polytope defined in \eqref{drop_i_j}. Therefore, \eqref{linear_program_lambli} is a linear programming. Analogously, the threshold $\bar{\lamb}^\i$ is the optimal value of the following linear program: \begin{equation}\label{linear_program_lambupi} \begin{split} \max \quad &y \\ s.t. \quad & -|\lamb^{-\i \j}|\totalDemand+ \sum_{\r \in \routeSet} \load_{\path}(\t^j_\r, \widehat{\t}^{-\j}) \geq y \cdot \totalDemand, \quad \forall \t^j_1 \in \playerTypeSet^{\j},\dots \forall \t^j_{|\routeSet|} \in \playerTypeSet^{\j},\\ & \l^{\i \j, \dagger} \in \mathcal{F}^{\i \j, \dagger}. \end{split} \end{equation} \emph{Proof of Theorem \ref{l_behavior}.} $\left[\text{Regime } \Lambda_1^{\i\j} \right]$: First, we show by contradiction that the constraint (\ref{prime:popu_i}$_i$) is tight for any equilibrium route flow. Assume that for a given $\lambda \in \Lambda_1^{\i\j}$, there exists an equilibrium route flow $\l^{*}$ such that (\ref{prime:popu_i}$_\i$) is not tight. From Proposition \ref{l_opt}, we know that $\l^{*}$ is an optimal solution of \eqref{opt_l}. Since $\eqref{opt_l}$ is a convex optimization problem, $\l^{*}$ is still a minimizer of $\widehat{\potential}(\l)$ if we drop the constraint (\ref{prime:popu_i}$_i$). Additionally, the constraints (\ref{prime:popu_i}$_i$) and (\ref{prime:popu_i}$_{j}$) implies that $\l^{*}$ must also satisfy \eqref{extra}. Thus, such $\l^{*}$ is an optimal solution of the following problem: \begin{equation}\label{eq_l_extra} \min_{\l} \quad \widehat{\potential}(\l), \quad s.t. \quad \text{\eqref{sub:balance}, \eqref{sub:ldemand}, \eqref{sub:l_positive}, \eqref{extra}, and \eqref{prime:popu_i}$\setminus \{\i\}$}. \end{equation} Moreover, the threshold $\bar{\lamb}^\i$ defined in \eqref{pairwise_threshold} is attained by a route flow, say $\tilde{\l}^{\i \j, \dagger}$, in the set $\mathcal{F}^{\i \j, \dagger}$. Thus, we can write: $1-|\lamb^{-\i \j}|-\frac{1}{\totalDemand}\widehat{J}^{\j}(\tilde{\l}^{\i \j, \dagger}) = \bar{\lamb}^\i \stackrel{\text{(Lemma \ref{lemma:lambl_lambup})}}{\geq} \underline{\lamb}^\i \stackrel{\eqref{def_reg_one}}{>}\lamb^{\i}.$ Rearranging, we obtain: $\frac{1}{\totalDemand}\widehat{J}^{\j}(\tilde{\l}^{\i \j, \dagger}) < 1-|\lamb^{-\i \j}| -\lamb^{\i}=\lambda^{\j}$, and so such $\tilde{\l}^{\i \j, \dagger}$ also satisfies (\ref{prime:popu_i}$_{j}$). Since $\tilde{\l}^{\i \j, \dagger}$ is an optimal solution of \eqref{drop_i_j}, which minimizes the same objective function as \eqref{eq_l_extra} but without the constraint (\ref{prime:popu_i}$_{j}$), we thus know that $\tilde{\l}^{\i \j, \dagger}$ is also an optimal solution in \eqref{eq_l_extra}. Since the induced edge load is unique, we can conclude that the edge load induced by $\l^{*}$ must be identical to that induced by $\tilde{\l}^{\i \j, \dagger}$, which is $w^{\i \j, \dagger}$. Then, from \eqref{drop_i_j}, we have $\l^{*} \in \mathcal{F}^{\i \j, \dagger}$. Therefore, from \eqref{pairwise_threshold}, we can write $\underline{\lamb}^\i \leq \frac{1}{\totalDemand} \widehat{J}^{\i}(\l^{*})$. Since we assumed that (\ref{prime:popu_i}$_{i}$) is not binding in equilibrium, we obtain: $\frac{1}{\totalDemand} \widehat{\md}^{\i}(\l^{*})< \lamb^{\i} < \underline{\lamb}^\i\leq \frac{1}{\totalDemand} \widehat{\md}^\i(\l^{*})$, which is a contradiction. Thus, (\ref{prime:popu_i}$_{i}$) must be tight in equilibrium for any $\lambda$ in regime $\Lambda_1^{\i\j}$. Finally, following the tightness of (\ref{prime:popu_i}$_{i}$) at optimum of \eqref{opt_l}, by rearranging the constraint \eqref{extra} in \eqref{eq:l_behavior}, we have $\widehat{\md}^{\j}(\l^{*}) \leq \(1-|\lamb^{-\i \j}|\) \totalDemand- \widehat{\md}^{\i}(\l^{*}) =\lambda^\j \totalDemand$. Thus, (\ref{prime:popu_i}$_{j}$) is guaranteed to hold in Regime $\Lambda_1^{\i\j}$ given the constraint \eqref{extra} and the fact that (\ref{prime:popu_i}$_{i}$) is tight at the optimum of \eqref{opt_l}. Hence, (\ref{prime:popu_i}$_{j}$) can be dropped in \eqref{opt_l} without changing the optimal solution set. $\left[\text{Regime } \Lambda_3^{\i\j} \right]$: Analogous to the proof given for regime $\Lambda_1^{\i\j}$, we can argue that constraint (\ref{prime:popu_i}$_{j}$) is tight in any equilibrium for any $\lambda$ in regime $\Lambda_3^{\i\j}$. By imposing constraint \eqref{extra}, (\ref{prime:popu_i}$_i$) can be dropped from the constraint set in \eqref{opt_l} without changing the optimal solution set. $\left[\text{Regime } \Lambda_2^{\i\j} \right]$: To study this regime, we need two additional thresholds \[\underline{\underline{\lamb}}^{\i} \stackrel{\Delta}{=} \frac{1}{\totalDemand} \max_{\l^{\i \j, \dagger} \in \mathcal{F}^{\i \j, \dagger}}\left\{\widehat{J}^{\i}(\l^{\i \j, \dagger})\right\}, \text{ and } \bar{\bar{\lamb}}^{\i} \stackrel{\Delta}{=} \frac{1}{\totalDemand} \min_{\l^{\i \j, \dagger} \in \mathcal{F}^{\i \j, \dagger}}\left\{\(1-|\lamb^{-\i \j}|\)\totalDemand-\widehat{J}^{\j}(\l^{\i \j, \dagger})\right\}.\] From \eqref{pairwise_threshold}, we can check that $\underline{\lamb}^\i \leq \underline{\underline{\lamb}}^{\i}$, and $\bar{\bar{\lamb}}^{\i} \leq \bar{\lamb}^\i$. For any $\lamb^{\i} \in [\underline{\lamb}^\i, \underline{\underline{\lamb}}^{\i}]$, we argue that $\F^{*}(\lamb) \subseteq \mathcal{F}^{\i \j, \dagger}$. Since the set $\mathcal{F}^{\i \j, \dagger}$ as defined by \eqref{drop_i_j} is a bounded polytope, and $\underline{\lamb}^\i$ (resp. $\underline{\underline{\lamb}}^{\i}$) is the minimum (resp. maximum) value of the continuous function $\widehat{\md}^{\i}(\l^{\i \j, \dagger})$ on $\mathcal{F}^{\i \j, \dagger}$, we know from the mean value theorem that there exists a $\tilde{\l}^{\i \j, \dagger} \in \mathcal{F}^{\i \j, \dagger}$ satisfying: $\lambda^\i =\frac{1}{\totalDemand} \widehat{\md}^{\i}(\tilde{\l}^{\i \j, \dagger})$. Such $\tilde{\l}^{\i \j, \dagger}$ also satisfies constraint (\ref{prime:popu_i}$_{j}$). Therefore, $\tilde{\l}^{\i \j, \dagger}$ satisfies all the constraints in \eqref{eq:Lprime}, and minimizes $\widehat{\potential}(\l)$. So $\tilde{\l}^{\i \j, \dagger}$ is an equilibrium route flow, which implies that $\F^{*}(\lamb) \cap \mathcal{F}^{\i \j, \dagger} \neq \emptyset$. Since the equilibrium edge load vector is unique, and the edge load induced by $\tilde{\l}^{\i \j, \dagger}$ is $w^{\i \j, \dagger}$, we must have $w^{*}(\lambda)=w^{\i \j, \dagger}$. Furthermore, from \eqref{drop_i_j}, $\mathcal{F}^{\i \j, \dagger}$ is a superset of all feasible route flows that can induce $w^{\i \j, \dagger}$. Therefore, $\F^{*}(\lamb) \subseteq \mathcal{F}^{\i \j, \dagger}$ for any $\lambda^\i \in [\underline{\lamb}^\i, \underline{\underline{\lamb}}^{\i}]$. Similarly, we can argue that for any $\lamb^{\i} \in [\bar{\bar{\lamb}}^{\i}, \bar{\lamb}^\i]$, $\F^{*}(\lamb) \subseteq \mathcal{F}^{\i \j, \dagger}$. To prove that $\mathcal{F}^{*}(\lambda) \subseteq \mathcal{F}^{\i \j, \dagger}$ for any $\lambda$ in regime $\Lambda_2^{\i\j}$, we need to argue two cases $\underline{\underline{\lamb}}^{\i} \geq \bar{\bar{\lamb}}^{\i}$ and $\underline{\underline{\lamb}}^{\i} < \bar{\bar{\lamb}}^{\i}$ separately. If $\underline{\underline{\lamb}}^{\i} \geq \bar{\bar{\lamb}}^{\i}$, then $[\underline{\lamb}^\i, \bar{\lamb}^\i] \subseteq [\underline{\lamb}^\i, \underline{\underline{\lamb}}^{\i}] \cup [\bar{\bar{\lamb}}^{\i}, \bar{\lamb}^\i]$. Therefore, $\F^{*}(\lamb) \subseteq \mathcal{F}^{\i \j, \dagger}$ for any $\lambda$ in regime $\Lambda_2^{\i\j}$. If $\underline{\underline{\lamb}}^{\i}< \bar{\bar{\lamb}}^{\i}$, for any $\lamb^{\i} \in (\underline{\underline{\lamb}}^{\i}, \bar{\bar{\lamb}}^{\i})$, we can check that any $\l^{\i \j, \dagger} \in \mathcal{F}^{\i \j, \dagger}$ satisfies the constraint (\ref{prime:popu_i}$_i$): $\frac{1}{\totalDemand}\widehat{\md}^{\i}(\l^{\i \j, \dagger}) \leq \underline{\underline{\lamb}}^{\i}<\lamb^{\i}$. Additionally, since $\lamb^{\i} < \bar{\bar{\lamb}}^{\i} \leq 1-|\lamb^{-\i \j}|-\frac{1}{\totalDemand} \widehat{\md}^{\j}(\l^{\i \j, \dagger})$, we know that $\frac{1}{\totalDemand} \widehat{\md}^{\j}(\l^{\i \j, \dagger}) <1-|\lamb^{-\i \j}|-\lamb^{\i} =\lambda^{\j}$, i.e. $\l^{\i \j, \dagger}$ also satisfies the constraint (\ref{prime:popu_i}$_{j}$). Thus, any $\l^{\i \j, \dagger} \in \mathcal{F}^{\i \j, \dagger}$ is an equilibrium route flow, i.e. $\F^{*}(\lamb) =\mathcal{F}^{\i \j, \dagger}$ for any $\lamb^{\i} \in (\underline{\underline{\lamb}}^{\i}, \bar{\bar{\lamb}}^{\i})$. Combined with the fact that $\F^{*}(\lamb) \subseteq \mathcal{F}^{\i \j, \dagger}$ for any $\lambda \in [\underline{\lamb}^\i, \underline{\underline{\lamb}}^{\i}] \cup [\bar{\bar{\lamb}}^{\i}, \bar{\lamb}^\i]$, we know that $\F^{*}(\lamb) \subseteq \mathcal{F}^{\i \j, \dagger}$ for any $\lambda$ in regime $\Lambda_2^{\i\j}$. \hfill\ensuremath{\square} \begin{coro}\label{cor:strategy} If the game $\game$ has a parallel-route network, then the equilibrium route flow $\l^{*}$ is unique. Moreover, if there are two populations, then the equilibrium strategy profile is unique in regime $\Lambda_1^{12}$ or $\Lambda_3^{12}$, and can be written as follows: \begin{subequations} \begin{align} \text{In regime $\Lambda_1^{\i\j}$: }\quad \strat^{1*}_\r(\t^1)&=\l^{*}_{\r}(\t^1, \widehat{\t}^2)-\min_{\widehat{\t}^1 \in \playerTypeSet^1} \l^{*}_{\r}(\widehat{\t}^1, \widehat{\t}^2), \quad \forall \r \in \routeSet, \quad \forall \t^1 \in \playerTypeSet^1, \label{q11}\\ \strat^{2*}_\r(\t^2)&=\min_{\widehat{\t}^1 \in \playerTypeSet^1} \l^{*}_{\r}(\widehat{\t}^1, \t^2), \quad \forall \r \in \routeSet, \quad \forall \t^2 \in \playerTypeSet^2, \label{q21}\\ \text{In regime $\Lambda_3^{\i\j}$: }\quad \strat^{1*}_\r(\t^1)&=\min_{\widehat{\t}^2 \in \playerTypeSet^2} \l^{*}_{\r}(\t^1, \widehat{\t}^2), \quad \forall \r \in \routeSet, \quad \forall \t^1 \in \playerTypeSet^1,\label{q_13}\\ \strat^{2*}_\r(\t^2)&=\l^{*}_{\r}(\widehat{\t}^1, \t^2)-\min_{\widehat{\t}^2 \in \playerTypeSet^2} \l^{*}_{\r}(\widehat{\t}^1, \widehat{\t}^2), \quad \forall \r \in \routeSet, \quad \forall \t^2 \in \playerTypeSet^2,\label{q_23} \end{align} \end{subequations} where $\(\widehat{\t}^1, \widehat{\t}^2\)$ is any type profile. \end{coro} \emph{Proof of Corollary \ref{cor:strategy}.} Given a parallel route network, we immediately obtain the uniqueness of $\l^{*}$ from Theorem \ref{q_opt}. Then from Proposition \ref{Lprime}, any strategy profile that can induce $\l^{*}$ can be expressed as in \eqref{eq_rep}. In regime $\Lambda_1^{12}$, we know from Theorem \ref{l_behavior} that the constraint (\ref{prime:popu_i}$_1$) is tight in equilibrium. Therefore, from \eqref{sub:x_sum} and \eqref{sub:x_bound}, we obtain: \begin{align*} \lambda^1 \totalDemand\stackrel{\eqref{sub:x_sum}}{=} \sum_{\r \in \routeSet} \chi_\r^1 \stackrel{\eqref{sub:x_bound}}{\geq} \sum_{\r \in \routeSet}\max_{\t^1\in \playerTypeSet^1} \(\l_r^{*}(\widehat{\t}^1, \widehat{\t}^2)-\l_r^{*}(\t^1, \widehat{\t}^2)\)\stackrel{\eqref{widehatj}}{=} \widehat{\md}^{1} (\l^{*}) =\lambda^1 \totalDemand. \end{align*} Thus, \eqref{sub:x_bound} is tight for any $\r \in \routeSet$, i.e. $\chi_\r^1=\max_{\t^1 \in \playerTypeSet^1} \(\l_r^{*}(\widehat{\t}^1, \widehat{\t}^2)-\l_r^{*}(\t^1, \widehat{\t}^2)\)$. Additionally, from \eqref{sub:x_sum}, $\chi_\r^2=\min_{\t^1 \in \playerTypeSet^1} \l_r^{*}(\t^1, \widehat{\t}^2)$. Thus, $\chi$ as defined in \eqref{X} is unique. Following \eqref{eq_rep}, we can obtain the unique $\q^{*}$ as defined in \eqref{q11}-\eqref{q21}. Analogously, we can argue that the equilibrium strategy profile is also unique in regime $\Lambda_3^{12}$, and is written as in \eqref{q_13}-\eqref{q_23}. \hfill\ensuremath{\square} \emph{Proof of Proposition \ref{bathtub}.} $\left[\text{Regime $\Lambda_1^{\i\j}$}\right]$: Consider any population size vector $\lambda \in \Lambda_1^{ij}$, there exists a sufficiently small $\epsilon >0$ such that $\lambda^{'} =\lambda+\epsilon z^{\i\j} \in \Lambda_1^{ij}$, i.e. $\lambda^{i'}=\lamb^{\i}+\epsilon>\lamb^{\i}$, $\lambda^{j'}=\lambda^j-\epsilon<\lambda^j$, and the sizes of all other populations remain unchanged. Consider any equilibrium route flow $\l^{*}(\lambda) \in \mathcal{F}^{*}(\lambda)$ and any $\l^{*}(\lambda^{'}) \in \mathcal{F}^{*}(\lambda^{'})$. We know from Theorem \ref{l_behavior} that constraint (\ref{prime:popu_i}$_i$) is tight in equilibrium, and thus $\l^{*}(\lambda)$ and $\l^{*}(\lambda^{'})$ satisfy: $\frac{1}{\totalDemand}\widehat{\md}^{\i}(\l^{*}(\lambda)) = \lamb^{\i}< \lambda^{\i '} =\frac{1}{\totalDemand}\widehat{\md}^{\i}(\l^{*}(\lambda^{'}))$. Consequently, any equilibrium route flow $\l^{*}(\lambda)$ for size vector $\lambda$ is in the feasible domain of \eqref{eq:l_behavior} for size vector $\lambda^{'}$, but $\l^{*}(\lambda) \notin \mathcal{F}^{*}(\lambda^{'})$, because $\widehat{\md}^{\i}\(\l^{*}(\lambda)\)=\lamb^{\i} < \lambda^{\i'}$, i.e. the constraint (\ref{prime:popu_i}$_i$) is satisfied, but not tight. Since $\l^{*}(\lambda^{'}) \in \mathcal{F}^{*}(\lambda^{'})$, we must have $\Psi(\lambda^{'}) =\widehat{\potential}(\l^{*}(\lambda^{'}))<\widehat{\potential}(\l^{*}(\lambda))=\Psi(\lamb)$. Additionally, from \eqref{Psi}, we know that $\Psi(\lambda^{'})=\widecheck{\potential}(w^{*}(\lambda^{'})) < \widecheck{\potential}(w^{*}(\lambda))=\Psi(\lambda)$. Thus, the unique equilibrium edge load $w^{*}(\lambda)$ necessarily changes in the direction $z^{\i\j}$ in regime $\Lambda_1^{\i\j}$. $\left[\text{Regime $\Lambda_2^{\i\j}$}\right]$: From Theorem \ref{l_behavior}, $\F^{*}(\lamb) \subseteq \mathcal{F}^{\i \j, \dagger}$ for any $\lambda \in \Lambda_2^{\i\j}$. Since the equilibrium edge load is unique, we know $w^{*}(\lambda)=w^{\i \j, \dagger}$. From \eqref{Psi} we can conclude that $\Psi(\lamb)=\widecheck{\potential}(w^{\i \j, \dagger})$. Thus, $\Psi(\lamb)$ as well as $w^{*}(\lambda)$ remain fixed in regime $\Lambda_2^{\i\j}$. $\left[\text{Regime $\Lambda_3^{\i\j}$}\right]$: Following similar argument in regime $\Lambda_1^{\i\j}$, we conclude that $\Psi(\lamb)$ monotonically increases in the direction $z^{\i\j}$ in regime $\Lambda_3^{\i\j}$. As a result, $w^{*}(\lambda)$ changes when $\lambda$ is perturbed in the direction $z^{\i\j}$ in regime $\Lambda_3^{\i\j}$. \hfill\ensuremath{\square} \begin{lem}{(\cite{fiacco1986convexity}, page 102)}\label{continuous_phi} The value of the potential function in equilibrium, $\Psi(\lamb)$, is convex with respect to $\lambda$ if in \eqref{eq:potential_opt}, $\Phi(\strat)$ is convex in $\strat$, and the constraints are affine in $\strat$ and $\lambda$. \end{lem} \begin{lem}{(\cite{fiacco2009sensitivity}, page 3469)}\label{directional} If in \eqref{eq:potential_opt}, the objective function $\Phi(\strat)$ is convex and continuously differentiable in $\strat$, and additionally the set of BWE $\q^{*}$ and the set of Lagrange multiplies $\mu^{*}$, $\nu^{*}$ are nonempty and bounded, then $\Psi(\lamb)$ is continuous and directionally differentiable in $\lambda$. Furthermore, for any given $\i, \j \in \playerSet$, the directional derivative of $\Psi(\lamb)$ in the direction $z^{\i\j}$ is $\nabla_{z^{\i \j}} \Psi(\lamb)=\min_{\q^{*} \in \mathcal{\Q}^{*}(\lambda)} \max_{\substack{ (\mu^{*}, \nu^{*})\\ \in \(M(\q^{*}), N(\q^{*})\)}} \nabla_\lambda L(\q^{*}, \mu^{*}, \nu^*, \lambda) z^{\i\j}$, where $M(\strat^{*})$ and $N(\q^{*})$ are the sets of Lagrange multipliers $\mu^{*}$ and $\nu^{*}$ in \eqref{lagrangian} associated with the BWE $\q^{*} \in \mathcal{\Q}^{*}(\lambda)$. \end{lem} \emph{Proof of Proposition \ref{no_info}.} Since the interim belief of population $\j$, $\belief^j(\state, \t^{-j}|\t^j)$ in \eqref{uninformed_mu} is independent with type $\t^j$, the equilibrium strategy of the uninformed population $\strat^{\j*}(\t^j)$ must be identical across all $\t^j \in \playerTypeSet^j$. Following \eqref{eq:mdi} and \eqref{widehatj}, the impact of information metric $J^\j(\q^{*})=\widehat{J}^{\j}(\l^{*})=0$ for any $\q^{*} \in \mathcal{\Q}^{*}(\lambda)$, $\l^{*} \in \F^{*}(\lamb)$ and any $\lambda$. For the sake of contradiction, we assume that the regime $\Lambda_3^{\i\j}$ is non-empty. From Theorem \ref{l_behavior}, we know that the constraint (\ref{prime:popu_i}$_\j$) must be tight in equilibrium when $\lambda$ is in regime $\Lambda_3^{\i\j}$. However, since $\widehat{J}^{\j}(\l^{*})=0$ for any $\lambda$, the constraint (\ref{prime:popu_i}$_\j$) is tight only when $\lambda^{j}=0$, i.e. $\lamb^{\i}=1-|\lamb^{-\i \j}|$. This implies that the regime $\Lambda_3^{\i\j}$ is indeed empty. Thus, there are at most two regimes $\Lambda_1^{\i\j}$ and $\Lambda_2^{\i\j}$. Following Proposition \ref{prop:relative_value}, we can conclude that $C^{\j*}(\lamb) \geq C^{\i*}(\lamb)$.\QED \input{appendix_six} \section{Supplementary Material for Sec. \ref{Sec:potential_game}}\label{appendix_A} \emph{Proof of Lemma \ref{potential_lemma}.} First note that $\Phi(\strat)$, as defined in \eqref{eq:potential_q}, is a continuous and differentiable function of the strategy profile $\strat$. To show that $\Phi(\strat)$ is a weighted potential function of $\game$, we write the first order derivative of $\Phi(q)$ with respect to $\strat_{\path}^{\player}(\ti)$: \begin{align} \frac{\partial \Phi (q)}{\partial \strat_{\path}^{\player}(\ti)}&=\sum_{\state \in \S} \sum_{\playerType^{-\player} \in \playerTypeSet^{-\player}} \pi(\state, t^i, \playerType^{-\player}) \sum_{\e \in \r}\cfun_{\e}^{\s}\(w_{\e}(t^i, \playerType^{-\player})\) \notag\\ &\stackrel{\text{\eqref{eq:ecrti}}}{=} \mathrm{Pr}(t^i) \mathbb{E}[\cfun_{\r}({\q})|\ti], \quad \forall \r \in \routeSet, \quad \forall t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti], \quad \forall \i \in \playerSet. \label{potential_prove} \end{align} Thus, $\Phi (q)$ satisfies \eqref{potential_def} with $\gamma(t^i)=\mathrm{Pr}(t^i)$ for any $t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]$ and any $\i \in \playerSet$. \hfill\ensuremath{\square} \emph{Proof of Lemma \ref{lemma:potential_convex}.} Since each $\cfun_{\e}^{\s}(w_{\e}(\t))$ is differentiable in $w_{\e}(\t)$, we know that $\widecheck{\potential}(w)$ is twice differentiable with respect to $w$. The first order partial derivative of $\widecheck{\potential}(w)$ with respect to $w_{\e}(\t)$ can be written as: $\frac{\partial \widecheck{\potential}(w)}{\partial w_{\e}(\t)}= \sum_{\state \in \S} \pi(\state, \t) \cfun_{\e}^{\s}\(w_{\e}\(\t\)\)$ for any $\e \in \E$, and any $\t \in \playerTypeSet$. Also, the second order derivative of $\widecheck{\potential}(w)$ can be written as follows: \begin{equation*} \begin{split} &\frac{\partial^2 \widecheck{\potential}(w)}{\partial w_{\e}(\t) \partial w_{\e^{'}}(\t^{'})}= \left\{ \begin{array}{ll} \sum_{\state \in \S} \pi \(\state, \t \) \frac{d \cfun_{\e}^{\s}\(w_{\e}\(\t\)\)}{d w_{\e}\(\t\)}, & \text{if $\e=\e^{'}$ and $\t=\t^{'}$,}\\ 0, & \text{otherwise,} \end{array} \right. \quad \forall \e, \e^{'} \in \E, \quad \forall \t, \t^{'} \in \playerTypeSet. \end{split} \end{equation*} Since for any $\e \in \E$ and any $\state \in \S$, $\cfun_{\e}^{\s}(w_{\e})$ is increasing in $w_{\e}$, $\sum_{\state \in \S} \pi \(\state, \t \) \frac{d \cfun_{\e}^{\s}\(w_{\e}\(\t\)\)}{d w_{\e}\(\t\)}>0$. Thus, the Hessian matrix of $\widecheck{\potential}(w)$ has positive elements on the diagonal and 0 in all other entries, i.e. it is positive definite. Therefore, $\widecheck{\potential}(w)$ is strictly convex in $w$. \hfill\ensuremath{\square} \emph{Proof of Theorem \ref{q_opt}.} We first show that any minimum of \eqref{eq:potential_opt} is a BWE. The Lagrangian of \eqref{eq:potential_opt} is given by \eqref{lagrangian}, where $\mu=(\mu^{t^i})_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti], \i \in \playerSet}$ and $\nu=(\nu_{r}^{t^i})_{\r \in \routeSet, t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti], \i \in \playerSet}$ are Lagrange multipliers associated with the constraints \eqref{sub:demand} and \eqref{sub:non-negative}, respectively. For any optimal solution $q$, there must exist $\mu$ and $\nu$ such that $\(\strat, \mu, \nu\)$ satisfies the following Karush-Kuhn-Tucker (KKT) conditions: \begin{taggedsubequations}{KKT}\label{KKT} \begin{align} \frac{\partial \mathcal{L}}{\partial \strat_{\path}^{\player}(\ti)} &= \frac{\partial \Phi }{\partial \strat_{\path}^{\player}(\ti)}-\mu^{t^i} - \nu_{r}^{t^i} =0, \quad &\forall \r \in \routeSet, \quad \forall t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti], \quad \forall \i \in \playerSet, \label{first_order}\\ \nu_{r}^{t^i} \strat_{\path}^{\player}(\ti) &= 0, \quad &\forall \r \in \routeSet, \quad \forall t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti], \quad \forall \i \in \playerSet, \label{com_slack}\\ \nu_{r}^{t^i} &\geq 0, \quad &\forall \r \in \routeSet, \quad \forall t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti], \quad \forall \i \in \playerSet. \label{beta_positive} \end{align} \end{taggedsubequations}Using \eqref{potential_prove} and \eqref{first_order}, we have $\frac{\partial \Phi(q) }{\partial \strat_{\path}^{\player}(\ti)} = \mathrm{Pr}(t^i) \mathbb{E}[\cfun_{\r}({\q})|\ti]= \mu^{t^i} +\nu_{r}^{t^i}$ for any $\r \in \routeSet$, and $t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]$, $\i \in \playerSet$. From \eqref{com_slack}, we see that for any $\r \in \routeSet$, and $t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]$, $\i \in \playerSet$, if $\strat_{\path}^{\player}(\ti)>0$, the corresponding Lagrange multiplier $\nu_{r}^{t^i}=0$, and $\mathrm{Pr}(t^i) \mathbb{E}[\cfun_{\r}({\q})|\ti]=\mu^{t^i}$. However, if $\strat_{\path}^{\player}(\ti) =0$, then $\mathrm{Pr}(t^i) \mathbb{E}[\cfun_{\r}({\q})|\ti]=\mu^{t^i}+\nu_{r}^{t^i} \geq \mu^{t^i}$. Thus, for any $\r \in \routeSet$, and $t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]$, $\i \in \playerSet$: \begin{equation*} \begin{split} \strat_{\path}^{\player}(\ti)>0 \quad \Rightarrow \quad \mathrm{Pr}(t^i) \mathbb{E}[\cfun_{\r}({\q})|\ti]=\mu^{t^i} \leq \mu^{t^i} +\nu_{r^{'}}^{t^i} =\mathrm{Pr}(t^i) \ecrpti, \quad \forall \r^{'} \in \routeSet. \end{split} \end{equation*} From \eqref{eq:BWE_fun}, we conclude that an optimal solution of \eqref{eq:potential_opt} is a BWE. Next, we show that any BWE $\q^{*}$ of the game $\game$ is an optimal solution of \eqref{eq:potential_opt}. Consider a pair of Lagrange multipliers $\bar{\mu}$ (resp. $\bar{\nu})$) corresponding to the constraints (4a) (resp. (4b)), where $\bar{\mu}^{t^i }=\min_{\r \in \routeSet}\mathrm{Pr}(t^i) \mathbb{E}[\cfun_{\r}({\qwe})|\ti]$ and $\bar{\nu}_\r^{t^i}=\mathrm{Pr}(t^i) \mathbb{E}[\cfun_{\r}({\qwe})|\ti]-\bar{\mu}^{t^i }$. We can easily check that \eqref{first_order} and \eqref{beta_positive} are satisfied by $(\q^{*}, \bar{\mu}, \bar{\nu})$. Since $\q^{*}$ is a BWE, we know from \eqref{eq:BWE_fun} that for a route $\r \in \routeSet$, and $t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]$, $\i \in \playerSet$, if $\q^{\i*}_{\r}(\ti)>0$, then $\mathbb{E}[\cfun_{\r}({\qwe})|\ti]=\min_{\r \in \routeSet} \mathbb{E}[\cfun_{\r}({\qwe})|\ti]$ and consequently $\bar{\nu}_{\r}^{t^i}=\mathrm{Pr}(t^i) \mathbb{E}[\cfun_{\r}({\qwe})|\ti]-\bar{\mu}^{t^i }=0.$ This implies that \eqref{com_slack} is also satisfied by $(\q^{*}, \bar{\mu}, \bar{\nu})$. Noting that $\Phi(\strat) \equiv \widecheck{\potential}(w)$, where the induced edge load $w$ is linear in $\strat$ (see \eqref{eq:q_w}), and that $\widecheck{\potential}(w)$ is strictly convex in $w$ (Lemma \ref{lemma:potential_convex}), we conclude that $\Phi(\strat)$ is a convex function of $\strat$. Furthermore, since $\stratSet(\lambda)$ is a convex polytope, \eqref{eq:potential_opt} is a convex problem. Thus, KKT conditions are also sufficient for optimality, and any BWE $\q^{*}$ is an optimal solution of \eqref{eq:potential_opt}. Finally, for any $\lambda$, we can use equations \eqref{eq:q_w} and \eqref{eq:potential_w} to re-express \eqref{eq:potential_opt} as an optimization problem whose solution gives an equilibrium edge load $w^{*}(\lambda)$: \begin{equation}\label{opt_w} \begin{split} \min_{w, \strat} &\quad \widecheck{\potential}(w)\\ s.t. &\quad \strat \in \stratSet(\lambda), \quad w_{\e}(\t)=\sum_{\r \ni \e} \sum_{\i \in \playerSet}\strat_{\path}^{\player}(\ti), \quad \forall \t \in \playerTypeSet, \quad \forall \e \in \E. \end{split} \end{equation} Clearly, the feasible set of the above problem is a convex polytope. From Lemma \ref{lemma:potential_convex}, $\widecheck{\potential}(w)$ is strictly convex in $w$. Therefore, the equilibrium edge load $w^{*}(\lambda)$ is unique. \hfill\ensuremath{\square} \begin{lem}{(Theorem 2 in \cite{wachsmuth2013licq})}\label{licq_lemma} The Lagrange multiplies $\mu^{*}$ and $\nu^{*}$ associated with any $\q^{*} \in \mathcal{\Q}^{*}(\lambda)$ at the optimum of \eqref{eq:potential_opt} are unique if and only if the LICQ condition is satisfied in that the gradients of the set of tight constraints in \eqref{sub:demand}-\eqref{sub:non-negative} at the optimum are linearly independent. \end{lem} \emph{Proof of Lemma \ref{unique_lag}.} Let the set of constraints that are tight at optimum of \eqref{eq:potential_opt} in \eqref{sub:non-negative} be denoted as $\mathcal{B}$. Assume for the sake of contradiction that LICQ does not hold, i.e. the set of equality constraints \eqref{sub:demand} and the elements in the set $\mathcal{B}$ are linearly dependent. Now, note that the constraint sets \eqref{sub:demand} and \eqref{sub:non-negative} are each comprised of linearly independent affine functions. Hence, there must exist a type $\bar{\t}^\i$ such that the gradient of the corresponding equality constraint (i.e. $\sum_{\r \in \routeSet} \strat_\r^{\i*}(\bar{\t}^\i) =\lamb^{\i} \totalDemand$) is linearly dependent with the elements in the set $\mathcal{B}$, which implies that $\strat_\r^{\i*}(\bar{\t}^\i)=0, \forall \r \in \routeSet$. However, this violates the equality constraint in \eqref{sub:demand} as $\sum_{\r \in \routeSet} \strat_\r^{\i*}(\bar{\t}^\i)=\lamb^{\i} \totalDemand \neq 0$, and we arrive at a contradiction. Since LICQ holds, for any equilibrium strategy profile $\q^{*} \in \mathcal{\Q}^{*}(\lambda)$, the corresponding $\mu^{*}$ and $\nu^{*}$ must be unique. Following the proof of Theorem \ref{q_opt}, we conclude that for any $\q^{*} \in \mathcal{\Q}^{*}(\lambda)$, $\(\q^{*}, \mu^{*}, \nu^{*}\)$ satisfies the KKT conditions, and $\mu^{t^i*}$ and $\nu^{t^i*}_\r$ can be written as \eqref{define_al} and \eqref{define_beta}, respectively. Finally, noting that the equilibrium edge load is unique (Theorem \ref{q_opt}), $\mu^{*}$ and $\nu^{*}$ in \eqref{define_al}-\eqref{define_beta} are thus unique in equilibrium. \hfill\ensuremath{\square} \emph{Proof of Proposition \ref{Lprime}.} \underline{Step I}: We show that any $\strat \in \stratSet(\lambda)$ induces a route flow $\l$ that satisfies \eqref{sub:balance}-\eqref{sub:popu_i}. From \eqref{eq:load}, we obtain that for any $t^i, \tilde{t}^{\i} \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]$, any $\playerType^{-\player}, \tilde{\t}^{-\i} \in \playerTypeSet^{-\player}$, and any $\i \in I$, $\l$ satisfies \eqref{sub:balance}: \begin{equation*} \begin{split} &\load_{\path}(t^i, \playerType^{-\player})-\load_{\path}(\tilde{t}^{\i}, \playerType^{-\player})= \strat_{\path}^{\player}(\ti)+\sum_{\j \in \playerSet \setminus \{\i\}} \strat^{j}_\r (\tj)-\strat^\i_\r(\titil)-\sum_{\j \in \playerSet \setminus \{\i\}} \strat^{j}_\r (\tj)\\ =&\strat_{\path}^{\player}(\ti)+\sum_{\j \in \playerSet \setminus \{\i\}} \strat^j_\r(\tjtil)-\strat^\i_\r(\titil)-\sum_{\j \in \playerSet \setminus \{\i\}} \strat^j_\r(\tjtil) = \load_{\path}(t^i, \tilde{\t}^{-\i})-\load_{\path}(\tilde{t}^{\i}, \tilde{\t}^{-\i}) \end{split} \end{equation*} From \eqref{sub:demand} and \eqref{sub:non-negative}, we can directly conclude that $\l$ must also satisfy \eqref{sub:ldemand} and \eqref{sub:l_positive}. Additionally, \begin{align*} &\totalDemand-\sum_{\r \in \routeSet}\min_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]}\load_{\path}(t^i, \playerType^{-\player}) \stackrel{\eqref{eq:load}}{=}\totalDemand -\sum_{\r \in \routeSet} \sum_{\j \in \playerSet \setminus \{\i\}}\strat^{j}_\r (\tj)-\sum_{\r \in \routeSet}\min_ {t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \strat_{\path}^{\player}(\ti)\\ \stackrel{\eqref{sub:demand}}{=}& \totalDemand-\sum_{\j \in \playerSet \setminus \{\i\}}\lambda^j \totalDemand -\sum_{\r \in \routeSet}\min_ {t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \strat_{\path}^{\player}(\ti)=\lamb^{\i} \totalDemand- \sum_{\r \in \routeSet}\min_ {t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \strat_{\path}^{\player}(\ti) \stackrel{\eqref{sub:non-negative}}{\leq} \lamb^{\i} \totalDemand, \text{ } \quad \forall \playerType^{-\player} \in \playerTypeSet^{-\player}, \text{ } \forall \i \in \playerSet. \end{align*} Therefore, $\l$ satisfies \eqref{sub:popu_i}. Thus, any feasible route flow must satisfy \eqref{sub:balance}-\eqref{sub:popu_i}. \underline{Step II}: Next, we show that for any route flow $\l \in \mathcal{F}(\lambda)$ (i.e. $\l$ that satisfies constraints \eqref{sub:balance}-\eqref{sub:popu_i}), the set of feasible strategies that induce $\l$ can be characterized by \eqref{eq_rep}. For any route $\r \in \routeSet$, the linear system of equations \eqref{eq:load} has $\prod_{\i \in \playerSet} |\T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]|$ equations in $\sum_{\i \in \playerSet} |\T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]|$ variables. Note that for any given $\widehat{\t} =\(\widehat{\t}^{\i}\)_{\i \in \playerSet} \in \playerTypeSet$, the following equations are linearly independent: \begin{equation}\label{eq:indep} \begin{split} \sum_{\i \in \playerSet} \strat^\i_\r(\widehat{\t}^{\i}) &=\load_{\path}(\widehat{\t}),\\ \strat_{\path}^{\player}(\ti)+\sum_{\j \in \playerSet \setminus \{\i\}} \strat_\r^j(\widehat{t}^j)&=\load_{\path}(t^i, \widehat{\t}^{-\i}), \quad \forall t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti] \setminus \{\widehat{\t}^{\i}\}, \quad \forall \i \in \playerSet. \end{split} \end{equation} We then show that given any $\t \in \playerTypeSet$, $\sum_{\i \in \playerSet} \strat_{\path}^{\player}(\ti)=\load_{\path}(\t)$ is a linear combination of the equations in \eqref{eq:indep}. Following \eqref{sub:balance}, we can write: \begin{align*} &\sum_{\i \in \playerSet} \load_{\path}(t^i, \widehat{\t}^{-\i})-(|\playerSet|-1)\load_{\path}(\widehat{\t}) =\load_{\path}(\t^1, \widehat{\t}^{-1})+\load_{\path}(\t^2, \widehat{\t}^{-2}) +\sum_{\i=3}^{|\playerSet|} \load_{\path}(t^i, \widehat{\t}^{-\i})-(|\playerSet|-1)\load_{\path}(\widehat{\t})\\ \stackrel{\eqref{sub:balance}}{=}&\load_{\path}(\t^1, \t^2, \widehat{\t}^{-1-2})+\load_{\path}(\widehat{\t})+\sum_{\i=3}^{|\playerSet|} \load_{\path}(t^i, \widehat{\t}^{-\i})-(|\playerSet|-1) \load_{\path}(\widehat{\t})\\ =&\load_{\path}(\t^1, \t^2, \widehat{\t}^{-1-2})+\sum_{\i=3}^{|\playerSet|} \load_{\path}(t^i, \widehat{\t}^{-\i})- (|\playerSet|-2) \load_{\path}(\widehat{\t}), \end{align*} where $\widehat{\t}^{-1-2}=(\widehat{\t}^3, \cdots, \widehat{\t}^{|\playerSet|})$. We apply the same procedure iteratively for another $|\playerSet|-2$ times: \begin{align}\label{iterative} \sum_{\i \in \playerSet} \load_{\path}(t^i, \widehat{\t}^{-\i})-(|\playerSet|-1)\load_{\path}(\widehat{\t}) &=\load_{\path}(\t), \quad \forall \t \in \playerTypeSet. \end{align} Now for any $\r \in \routeSet$ and $\t \in \playerTypeSet$, we can write $\sum_{\i \in \playerSet} \strat_{\path}^{\player}(\ti)=\sum_{\i \in \playerSet} \(\strat_{\path}^{\player}(\ti)+\sum_{\j \in \playerSet \setminus \{\i\}} \strat_\r^j(\widehat{t}^j)\)- (|\playerSet|-1) \sum_{\i \in \playerSet} \strat^\i_\r(\widehat{\t}^{\i})\stackrel{\text{\eqref{eq:indep}}}{=}\sum_{\i \in \playerSet} \load_{\path}(t^i, \widehat{\t}^{-\i})-(|\playerSet|-1)\load_{\path}(\widehat{\t}) \stackrel{\eqref{iterative}}{=}\load_{\path}(\t).$ Thus, for any $\r \in \routeSet$, the linear system \eqref{eq:load} is comprised of $\sum_{\i \in \playerSet} |\T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]|$ variables, and any constraint can indeed be expressed as a linear combination of $\sum_{\i \in \playerSet} |\T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]| -|\playerSet|+1$ independent equations in \eqref{eq:indep}. From the rank-nullity theorem, we conclude that the dimension of null space of this linear map is $|\playerSet|-1$. Then, for any $\r \in \routeSet$, any $\i \in \playerSet$, setting $\strat^\i_\r(\widehat{\t}^{\i})=\chi_\r^\i$, any solution of \eqref{eq:load} can be expressed as \eqref{eq_rep}, where $\widehat{\t} \in \playerTypeSet$ is an arbitrary type profile. Additionally, $\sum_{\i \in \playerSet}\chi_\r^\i=\sum_{\i \in \playerSet}\strat^\i_\r(\widehat{\t}^{\i})=\load_{\path}(\widehat{\t})$. Thus, $\chi$ satisfies \eqref{sub:sum_demand}, i.e. for each $\r \in \routeSet$, out of the $|\playerSet|$ variables in $\{\chi_\r^\i\}_{\i \in \playerSet}$, $|\playerSet|-1$ are free, and the remaining one is obtained from \eqref{sub:sum_demand}. We can conclude that the strategy profile $\strat$ as defined in \eqref{eq_rep} induces the route flow $\l$. It remains to be shown that if $\strat$ is a feasible strategy profile, $\chi$ must satisfy \eqref{sub:x_sum} and \eqref{sub:x_bound} as well. Since $\strat$ satisfies \eqref{sub:demand}, we obtain that $\lamb^{\i} \totalDemand \stackrel{\eqref{sub:demand}}{=} \sum_{\r \in \routeSet} \strat^{\i}_\r(t^i)\stackrel{\eqref{eq_rep}}{=} \sum_{\r \in \routeSet} \(\load_{\path}(t^i, \widehat{\t}^{-\i})-\load_{\path}(\widehat{\t}^{\i}, \widehat{\t}^{-\i})+\chi_\r^\i\)\stackrel{\text{\eqref{sub:ldemand}}}{=} \sum_{\r \in \routeSet} \chi_\r^\i$ for any $\i \in \playerSet$, i.e. $\chi$ satisfies \eqref{sub:x_sum}: Additionally, from \eqref{sub:non-negative}, $0 \leq q^{\i}_\r(t^i)\stackrel{\eqref{eq_rep}}{=}\load_{\path}(t^i, \widehat{\t}^{-\i})-\load_{\path}(\widehat{\t}^{\i}, \widehat{\t}^{-\i})+\chi_\r^{\i}$ for any $\r \in \routeSet$ and any $t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]$. Thus, $\chi_\r^{\i} \geq \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \left\{\load_{\path}(\widehat{\t}^{\i}, \widehat{\t}^{-\i})-\load_{\path}(t^i, \widehat{\t}^{-\i})\right\}$, i.e. $\chi$ satisfies \eqref{sub:x_bound}. Step III: Finally, we show that the set of $\chi$ satisfying \eqref{X} is non-empty, i.e., any $\l \in \mathcal{F}(\lambda)$ can be induced by at least one feasible strategy profile $\strat$. Consider any $\l \in \mathcal{F}(\lambda)$, we explicitly construct the following $\chi$, and show that such $\chi$ satisfies \eqref{X}: \begin{align}\label{x_example} \noindent\chi_\r^\i=\gamma_\r \cdot \(\lamb^{\i} \totalDemand -\sum_{\r \in \routeSet} \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t})-\load_{\path}(t^i, \widehat{\t}^{-\i})\)\) + \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t})-\load_{\path}(t^i, \widehat{\t}^{-\i})\), \text{ } \forall \r \in \routeSet, \text{ } \forall \i \in \playerSet, \end{align} where $\widehat{\t}$ is any arbitrary type profile, and $\gamma_\r=\frac{\load_{\path}(\widehat{\t})-\sum_{\i \in \playerSet} \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t})-\load_{\path}(t^i, \widehat{\t}^{-\i})\)}{\sum_{\r \in \routeSet} \left[\load_{\path}(\widehat{\t})-\sum_{\i \in \playerSet} \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t})-\load_{\path}(t^i, \widehat{\t}^{-\i})\)\right]}$ if $\sum_{\r \in \routeSet} \left[\load_{\path}(\widehat{\t})-\sum_{\i \in \playerSet} \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t})-\load_{\path}(t^i, \widehat{\t}^{-\i})\)\right]\neq 0$ and 0 otherwise. First, we check that the $\(\chi_\r^\i\)_{\r \in \routeSet, \i \in \playerSet}$ as defined in \eqref{x_example} satisfies \eqref{sub:x_bound}. Note that $\gamma_\r\geq 0$. To see this, since for any $\t \in \playerTypeSet$, $\sum_{\i \in \playerSet} \load_{\path}(t^i, \widehat{\t}^{-\i})-(|\playerSet|-1)\load_{\path}(\widehat{\t})\stackrel{\eqref{iterative}}{=}\load_{\path}(\t) \geq 0$, we know that $\min_{\t \in \playerTypeSet}\sum_{\i \in \playerSet} \load_{\path}(t^i, \widehat{\t}^{-\i})-(|\playerSet|-1)\load_{\path}(\widehat{\t}) =\min_{\t \in \playerTypeSet} \load_{\path}(\t)\geq 0$. Thus, for any $\r \in \routeSet$, we obtain: \begin{align} \load_{\path}(\widehat{\t})-\sum_{\i \in \playerSet} \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t})-\load_{\path}(t^i, \widehat{\t}^{-\i})\) &=\min_{\t \in \playerTypeSet} \sum_{\i \in \playerSet} \load_{\path}(t^i, \widehat{\t}^{-\i})- (|\playerSet|-1)\load_{\path}(\widehat{\t})=\min_{\t \in \playerTypeSet} \load_{\path}(\t)\geq 0. \label{min_t} \end{align} Hence, we can conclude that $\gamma_\r \geq0$. Next, $\lamb^{\i} \totalDemand -\sum_{\r \in \routeSet} \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t})-\load_{\path}(t^i, \widehat{\t}^{-\i})\) \stackrel{\eqref{sub:ldemand}}{=}\lamb^{\i} \totalDemand -\(\totalDemand-\sum_{\r \in \routeSet} \min_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]}\load_{\path}(t^i, \widehat{\t}^{-\i})\) \stackrel{\eqref{sub:popu_i}}{\geq} 0$. Using the above inequalities, we obtain that $\chi_\r^\i$ as considered in \eqref{x_example} satisfies \eqref{sub:x_bound}. Second, we check $\chi_\r^\i$ satisfies \eqref{sub:x_sum}. If $\sum_{\r \in \routeSet} \left[\load_{\path}(\widehat{\t})-\sum_{\i \in \playerSet} \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t})-\load_{\path}(t^i, \widehat{\t}^{-\i})\)\right] >0$, then: \begin{align*} \sum_{\r \in \routeSet} \chi_\r^\i &=\sum_{\r \in \routeSet} \gamma_\r \cdot \(\lamb^{\i} \totalDemand -\sum_{\r \in \routeSet} \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t})-\load_{\path}(t^i, \widehat{\t}^{-\i})\)\) +\sum_{\r \in \routeSet} \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t})-\load_{\path}(t^i, \widehat{\t}^{-\i})\)\\ &=\(\lamb^{\i} \totalDemand -\sum_{\r \in \routeSet} \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t})-\load_{\path}(t^i, \widehat{\t}^{-\i})\)\)+\sum_{\r \in \routeSet} \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t})-\load_{\path}(t^i, \widehat{\t}^{-\i})\)=\lamb^{\i} \totalDemand. \end{align*} On the other hand, if $\sum_{\r \in \routeSet} \left[\load_{\path}(\widehat{\t})-\sum_{\i \in \playerSet} \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t})-\load_{\path}(t^i, \widehat{\t}^{-\i})\)\right]=0$, we obtain that: \begin{footnotesize} \begin{align*} 0&=\sum_{\r \in \routeSet} \left[\load_{\path}(\widehat{\t})-\sum_{\i \in \playerSet} \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t})-\load_{\path}(t^i, \widehat{\t}^{-\i})\)\right]\stackrel{\eqref{sub:ldemand}}{=} \totalDemand- \sum_{\i \in \playerSet} \(\sum_{\r \in \routeSet}\max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t})-\load_{\path}(t^i, \widehat{\t}^{-\i})\)\) \\ &\stackrel{\eqref{sub:popu_i}}{\geq} \totalDemand-\sum_{\i \in \playerSet} \lamb^{\i} \totalDemand =0, \end{align*} \end{footnotesize}which implies that for any $\i \in \playerSet$, $\sum_{\r \in \routeSet}\max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t})-\load_{\path}(t^i, \widehat{\t}^{-\i})\)=\lamb^{\i} \totalDemand$. Since in this case, $\gamma_\r=0$, we can conclude that $\sum_{\r \in \routeSet}\chi_\r^\i= \sum_{\r \in \routeSet}\max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t})-\load_{\path}(t^i, \widehat{\t}^{-\i})\)=\lamb^{\i} \totalDemand$, i.e. $\chi$ satisfies \eqref{sub:x_sum}. Finally, $\chi_\r^\i$ also satisfies \eqref{sub:sum_demand}. If $\sum_{\r \in \routeSet} \left[\load_{\path}(\widehat{\t})-\sum_{\i \in \playerSet} \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t})-\load_{\path}(t^i, \widehat{\t}^{-\i})\)\right] >0$, we have: \begin{align*} \sum_{\i \in \playerSet} \chi_\r^\i &= \gamma_\r \cdot \sum_{\i \in \playerSet} \(\lamb^{\i} \totalDemand -\sum_{\r \in \routeSet} \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t})-\load_{\path}(t^i, \widehat{\t}^{-\i})\)\) +\sum_{\i \in \playerSet} \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t})-\load_{\path}(t^i, \widehat{\t}^{-\i})\)\\ &= \gamma_\r \cdot \(\totalDemand -\sum_{\i \in \playerSet}\sum_{\r \in \routeSet} \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t})-\load_{\path}(t^i, \widehat{\t}^{-\i})\)\) +\sum_{\i \in \playerSet} \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t})-\load_{\path}(t^i, \widehat{\t}^{-\i})\)\\ &\stackrel{\eqref{sub:ldemand}}{=}\gamma_\r \cdot \(\sum_{\r \in \routeSet} \left[\load_{\path}(\widehat{\t})-\sum_{\i \in \playerSet} \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t})-\load_{\path}(t^i, \widehat{\t}^{-\i})\)\right]\)+\sum_{\i \in \playerSet} \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t})-\load_{\path}(t^i, \widehat{\t}^{-\i})\)\\ &=\load_{\path}(\widehat{\t})-\sum_{\i \in \playerSet} \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t})-\load_{\path}(t^i, \widehat{\t}^{-\i})\)+\sum_{\i \in \playerSet} \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t})-\load_{\path}(t^i, \widehat{\t}^{-\i})\)=\load_{\path}(\widehat{\t}). \end{align*} If $\sum_{\r \in \routeSet} \left[\load_{\path}(\widehat{\t})-\sum_{\i \in \playerSet} \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t})-\load_{\path}(t^i, \widehat{\t}^{-\i})\)\right] =0$, then we have \[0=\sum_{\r \in \routeSet} \left[\load_{\path}(\widehat{\t})-\sum_{\i \in \playerSet} \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t})-\load_{\path}(t^i, \widehat{\t}^{-\i})\)\right] \stackrel{\eqref{min_t}}{=}\sum_{\r \in \routeSet} \min_{\t \in \playerTypeSet} \load_{\path}(\t) \geq 0,\] which implies that for any $\r \in \routeSet$, $\min_{\t \in \playerTypeSet}\load_{\path}(\t)=0$. In this case, $\gamma_r=0$, and thus $\sum_{\i \in \playerSet} \chi_\r^\i=\sum_{\i \in \playerSet} \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t})-\load_{\path}(t^i, \widehat{\t}^{-\i})\)\stackrel{\eqref{min_t}}=\load_{\path}(\widehat{\t})-\min_{\t \in \playerTypeSet} \load_{\path}(\t)=\load_{\path}(\widehat{\t})$, i.e. $\chi$ satisfies \eqref{sub:sum_demand}. Therefore, if $\l$ satisfies \eqref{sub:balance}-\eqref{sub:popu_i}, we can conclude that the $\chi$ in \eqref{x_example} satisfies \eqref{X}, i.e. the set of $\chi$ satisfying \eqref{X} is non-empty. We already showed in Step II that $\strat$ as defined in \eqref{eq_rep} with parameter $\chi$ satisfying \eqref{X} is a feasible strategy profile, and $\strat$ induces $\l$. Therefore, if $\l$ satisfies \eqref{sub:balance}-\eqref{sub:popu_i}, there exists a feasible $\strat$ that induces $\l$, i.e. any $\l\in \mathcal{F}(\lambda)$ is a feasible route flow. In summary, we have shown that any feasible route flow satisfies \eqref{eq:Lprime} (Step I); For any $\l$ that satisfies \eqref{eq:Lprime}, the set of feasible strategy profiles that induce $\l$ can be written in \eqref{eq_rep}-\eqref{X} (Step II); Such set is non-empty, and hence $\l$ is feasible (Step III). We can thus conclude that the set of feasible route flows is $\mathcal{F}(\lambda)$, and the set of feasible strategies that induce $\l$ is as in \eqref{eq_rep}-\eqref{X}. \hfill\ensuremath{\square} \emph{Proof of Proposition \ref{l_opt}.} From Proposition \ref{Lprime}, we know that the set of feasible route flows is the set $\mathcal{F}(\lambda)$ characterized by \eqref{sub:balance}-\eqref{sub:popu_i}. Additionally, the weighted potential function in \eqref{eq:potential_q} can be equivalently written as a function of $\l$ given by \eqref{eq:potential_l}. Therefore, the minimum of \eqref{opt_l} is equal to that in \eqref{eq:potential_opt}, and the set of optimal solutions is the set of equilibrium route flows. \hfill\ensuremath{\square} \subsection{Bayesian Routing Game}\label{sub:game} The Bayesian routing game for a fixed size vector $\lambda$ can be defined as \[\game \stackrel{\Delta}{=} \left(\playerSet, \S, \playerTypeSet, \stratSet(\lambda), \mathcal{C}, \beta\right),\] where \begin{itemize} \item[-] $\playerSet$: Set of populations, $\playerSet = \{1,2, \dots, I\}$ \item[-] $\S$: Set of states with prior distribution $\theta \in \Delta (\S)$ \item[-] $\playerTypeSet=\prod_{\i \in \playerSet}\T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]$: Set of population type profiles with element $\t=(t^i)_{\i \in \playerSet} \in \playerTypeSet$ \item[-] $\stratSet(\lambda)=\prod_{\i \in \playerSet} \stratSet^{\i}(\lambda)$: Set of feasible strategy profiles for a given size vector $\lambda$, with element $\strat=(\strat^{\player})_{\i \in \playerSet} \in \stratSet(\lambda)$ \item[-] $\mathcal{C}= \{\cfun_{\e}^{\s}\left(\cdot\right)\}_{\e \in \E, \state \in \S}$: Set of state-dependent edge cost functions \item[-] $\beta=\left(\beta^{\i}\right)_{\i \in \playerSet}$: $\beta^{\i} \in \Delta(\S \times \playerTypeSet^{-\player})$ is population $\i$'s belief on state $\state$ and other populations' types $\playerType^{-\player}$ \end{itemize} All parameters including the common prior $\pi$ are common knowledge, except that populations privately receive signals about the network state from their respective TIS. The game is played as shown in Fig. \ref{fig:game_timing}. \begin{figure}[H] \centering \setlength{\unitlength}{1cm} \begin{picture}(9.5,1.5) \put(0,1){\line(1,0){10}} \put(0,1){\makebox(0,0){$\bullet$}} \put(0,0.8){\makebox(0,0){\footnotesize{Nature draws $\state$}}} \put(0,0.5){\makebox(0,0){\footnotesize{Population $\i$ receives $t^i$}}} \put(5.5,1){\makebox(0,0){$\bullet$}} \put(5.5,1.3){\makebox(0,0){{\textit{interim stage}}}} \put(5.5,0.8){\makebox(0,0){\footnotesize{Population $\i \in \playerSet$:}}} \put(6,0.48){\makebox(0,0){\footnotesize{-obtains belief $\belief^i(\state, \tmi|\ti)$}}} \put(5.4,0.1){\makebox(0,0){\footnotesize{-plays strategy $\strat^{\player}$}}} \put(10,0.9){\line(0,1){0.2}} \put(10,1){\makebox(0,0){$\bullet$}} \put(10,1.3){\makebox(0,0){\textit{ex post stage}}} \put(10.0,0.8){\makebox(0,0){\footnotesize{Realize costs}}} \end{picture} \caption{Timing of the game $\game$.} \label{fig:game_timing} \end{figure} For any $\i \in \playerSet$ and $t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]$, the interim belief of population $\i$ is derived from the common prior: \begin{equation}\label{interim_belief} \belief^i(\state, \tmi|\ti)=\frac{\pi(\state, t^i, \playerType^{-\player})}{\mathrm{Pr}(t^i)}, \quad \forall \state \in \S, \quad \forall \playerType^{-\player} \in \playerTypeSet^{-\player}, \end{equation} where $\mathrm{Pr}(t^i)=\sum_{\state \in \S} \sum_{\playerType^{-\player} \in \playerTypeSet^{-\player}} \pi(\state, t^i, \playerType^{-\player})$. For a strategy profile $\strat \in \stratSet(\lambda)$, the induced route flow is denoted $\l \stackrel{\Delta}{=} \(\load_{\path}(\t)\)_{\r \in \routeSet, \t \in \playerTypeSet}$, where $\load_{\path}(\t)$ is the aggregate flow assigned to the route $\r\in \routeSet$ by populations with type profile $\t$, i.e. \begin{equation}\label{eq:load} \load_{\path}(\t)=\sum_{\i \in \playerSet} \strat_{\path}^{\player}(\ti), \quad \forall \r \in \routeSet, \quad \forall \t \in \playerTypeSet. \end{equation} Note that the dependence of $\l$ on $\strat$ is implicit and is dropped for notational convenience. Again, for the strategy profile $\strat \in \stratSet(\lambda)$, we denote the induced edge load as $w \stackrel{\Delta}{=}\(w_{\e}(\t)\)_{\e \in \E, \t \in \playerTypeSet}$, where $w_{\e}(\t)$ is the aggregate load on the edge $\e$ assigned by populations with type profile $\t$: \begin{equation}\label{eq:q_w} w_{\e}(\t)=\sum_{\r \ni \e} \sum_{\i \in \playerSet} \strat_{\path}^{\player}(\ti) \stackrel{\text{\eqref{eq:load}}}{=}\sum_{\r \ni \e} \load_{\path}(\t) , \quad \forall \e \in \E, \quad \forall \t \in \playerTypeSet. \end{equation} The corresponding cost of edge $\e \in \E$ in state $\state \in \S$ is $\cfun_{\e}^{\s}(w_{\e}(\t))$. Then, the cost of route $\r \in \routeSet$ in state $\state \in \S$ can be obtained as: $c_{\r}^{\state}(q(\t))=\sum_{\e \in \r} \cfun_{\e}^{\s}(w_{\e}(\t))$. Finally, the expected cost of route $\r$ for population $\i \in \playerSet$ can be expressed as follows: \begin{align} \noindent\mathbb{E}[\cfun_{\r}({\q})|\ti] &=\sum_{\state \in \S} \sum_{\playerType^{-\player} \in \playerTypeSet^{-\player}} \sum_{\e \in \r} \belief^i(\state, \tmi|\ti) \cfun_{\e}^{\s}(w_{\e}(t^i, \playerType^{-\player})), \quad \forall \r \in \routeSet, \quad \forall t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti], \quad \forall \i \in \playerSet, \label{eq:ecrti} \end{align} The equilibrium concept for our game $\game$ is Bayesian Wardrop equilibrium (BWE). A strategy profile $\q^{*} \in \stratSet(\lambda)$ is a BWE if for any $\i \in \playerSet$ and any $t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]$: \begin{align}\label{eq:BWE_fun} \forall \r \in \routeSet, \quad \q^{\i*}_{\r}(\ti)>0 \quad \Rightarrow \quad \mathbb{E}[\cfun_{\r}({\qwe})|\ti] \leq \mathbb{E}[\cfun_{\r'}(\q^{*})|\ti], \quad \forall \r' \in \routeSet. \end{align} That is, in a BWE, travelers in population $\i$ with type $t^i$ only take routes that have the smallest expected cost based on their interim belief $\belief^i(\state, \tmi|\ti)$. We define the \emph{equilibrium population cost}, denoted $C^{\i*}(\lamb)$, as the expected cost incurred by a traveler of a given population across all types and network states in equilibrium: $C^{\i*}(\lamb) \stackrel{\Delta}{=} \frac{1}{\lamb^{\i} \totalDemand} \sum_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \mathrm{Pr}(t^i) \sum_{\r \in \routeSet} \mathbb{E}[\cfun_{\r}({\qwe})|\ti] \q^{\i*}_{\r}(\ti)$. In fact, from \eqref{eq:BWE_fun}, we can write: \begin{align}\label{eq:population_cost_def} C^{\i*}(\lamb) \stackrel{\eqref{eq:BWE_fun}}{=} \frac{1}{\lamb^{\i} \totalDemand} \sum_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \mathrm{Pr}(t^i) \(\sum_{\r \in \routeSet} \q^{\i*}_{\r}(\ti)\) \min_{\r \in \routeSet} \mathbb{E}[\cfun_{\r}({\qwe})|\ti] \stackrel{\eqref{sub:demand}}{=} \sum_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \mathrm{Pr}(t^i) \min_{\r \in \routeSet} \mathbb{E}[\cfun_{\r}({\qwe})|\ti]. \end{align} Note that $\lamb^{\i}=0$ is a degenerate case for population $\i$ as its size approaches 0. In this case, the cost $C^{\i*}(\lamb)$ can be viewed as the expected cost faced by an individual (non-atomic) traveler who subscribes to the TIS $\i$. \subsection{Beliefs}\label{sub:belief} In the framework of Bayesian games \cite{fudenberg1991game}, the notion of ``type'' captures all the private information available to each population (see \cite{harsanyi1967games}). In our model, the private information of each population is the signal it receives from the corresponding TIS, i.e. $\signal^{\i}$. We define the type of population $\i$ as $t^i$ and the type space as $\T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]$, where for each $\i \in \playerSet$, $\T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti] \equiv Y^i$, $t^i \stackrel{\Delta}{=} \signal^{\i}$. Thus, the distribution of type conditional on state is the same as that of signals, i.e. $p(t^i|\state)=p(\yi|\state)$. Based on type $t^i$, each population generates a belief about the state and the opponent's type, denoted $\belief^i(\state, \tmi|\ti) \in \Delta(\S \times \playerTypeSet^{-\player})$. We further assume that the type conditional probability distributions and the prior distribution on states are common knowledge. \begin{assumption}\label{as:common_knowledge} The type conditional distribution matrixs, $P^1$, $P^2$ and the prior distribution on states, $\theta(\state)$, are common knowledge of the game. \end{assumption} The beliefs $(\mu^i)_{\i \in \playerSet}$ can be expressed as follows: $\forall \state \in \S, t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti], \playerType^{-\player} \in \playerTypeSet^{-\player}, \i \in \playerSet.$ \begin{equation}\label{eq:belief_complex} \begin{split} \belief^i(\state, \tmi|\ti)&=\frac{\mathrm{Pr}^{\i}(\state, t^i, \playerType^{-\player})}{\mathrm{Pr}(t^i)}=\frac{\theta(\state)\mathrm{Pr}^{\i}(t^i, \playerType^{-\player}|\state)}{\mathrm{Pr}(t^i)}\\ &=\underbrace{\frac{\theta(\state)p(t^i|\state)}{\mathrm{Pr}(t^i)}}_{\mathrm{Pr}(\state|t^i)} \cdot \mathrm{Pr}^{\i}(\playerType^{-\player}|t^i, \state), \end{split} \end{equation} where $\mathrm{Pr}^{\i}(\playerType^{-\player}|t^i, \state)$ is population $\i$'s beliefs of the other population's type probability distribution conditional on state $\state$. We know from Assumption \ref{as:independent} that $t^i, \playerType^{-\player}$ are independent conditional on state $\state$. We also know from Assumption \ref{as:common_knowledge} that population $\i$ knows the accuracy matrix of the other population, $P^{-\i}$. Thus, $\mathrm{Pr}^{\i}(\playerType^{-\player}|t^i, \state)=p(\playerType^{-\player}|\state)$. We can simplify \eqref{eq:belief_complex} as: \begin{equation}\label{eq:belief_fun} \forall \i \in \playerSet, \quad \belief^i(\state, \tmi|\ti)=\frac{\theta(\state)p(t^i|\state)}{\mathrm{Pr}(t^i)} \cdot p(\playerType^{-\player}|\state), \end{equation} where the marginal distribution $\mathrm{Pr}(t^i)$ is in \eqref{eq:marginal_type}. When Assumption \ref{as:common_knowledge} is satisfied, there exists common prior, $\pi(\state, \t^1, \t^2) \in \Delta(\S \times \playerTypeSet^1 \times \playerTypeSet^2)$: \begin{equation} \pi(\state, \t^1, \t^2)=\theta(\state) \cdot p(\t^1|\state) \cdot p(\t^2|\state). \end{equation} Beliefs $\mu^1, \mu^2$ can be restated as the conditional probability derived from the common prior: \begin{equation}\label{eq:objective_fun} \belief^i(\state, \tmi|\ti)=\frac{\pi(\state, t^i, \playerType^{-\player})}{\mathrm{Pr}(t^i)}, \quad \forall \state \in \S, \i \in \playerSet, t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]. \end{equation} \section{Concluding Remarks}\label{concluding} In this article, we study the equilibrium route choices and costs in a heterogeneous information environment, in which each population receives a private signal from their traffic information system (TIS). Each population maintains a belief about the unknown network state and about the signals received by other traveler populations. We focus on analyzing the equilibrium structure under perturbations of population sizes, the relative value of information between any pair of populations, as well as the equilibrium adoption rates when travelers can choose their TIS subscription. The main ideas behind our analysis approach are: (i) Identification of qualitatively distinct equilibrium regimes based on whether or not the impact of information is fully attained; (ii) Sensitivity analysis of the weighted potential function in equilibrium with respect to the population size vector; and (iii) Characterization of adoption rates under the choice of TIS. Our approach can be easily extended to games where the edge costs are non-decreasing (rather than strictly increasing) in the edge loads. In particular, such a game still admits a weighted potential function, although now the essential uniqueness only applies to the equilibrium edge costs, rather than the loads. The qualitative properties of equilibrium structure, results about the relative ordering of population costs, and adoption rates can be extended as well. However, the characterization of regime thresholds in this case is more complicated from a computational viewpoint due to the non-uniqueness of edge load vector. One future research question of interest is to analyze how the travelers' expected cost and TIS adoption rates change when one or more TIS providers make technological changes to their service (for example, improving accuracy levels), or when a new TIS is introduced. Addressing this problem would involve applying our results to evaluate the value of information for each traveler population as well as the adoption rates under the new information environment, and comparing them with that of the current environment. Another interesting extension of this work is to study how to design an ``optimal" information structure to regulate traffic flows in a network with uncertain state. In the spirit of Bayesian persuasion viewpoint developed by \cite{kamenica2011bayesian}, and \cite{kolotilin2017persuasion}, in this extension, an information designer (transportation authority) can send a public or private signal that is correlated with the network state to travelers according to a chosen information structure. The signal determines the (heterogeneous) information environment faced by travelers, and hence influences their routing decisions. The approach presented in this article can be useful in analyzing the impact of information design on travelers' routing decisions and costs. \section{Equilibrium Cost} In this section, we discuss how expected cost of individual commuters of each population, denoted as $\ciwel$, and the expected social average cost, denoted as $\cwesocial$ change with respect to $\lambda$. We know from Corollary \ref{essential_unique} that the BWE is essentially unique in the sense that $\llamb$ is unique for any equilibrium strategy profile. Therefore, both $\ciwel$ and $\cwesocial$ are identical for $q^{*}(\lamb)$. Before discussing the properties of $\ciwel$ and $\cwesocial$, we first prove the continuity and convexity of the optimal-value potential function. This part of discussion follows the discussion in Fiacco \cite[]. We provide a brief review of Fiacco's theory in the Appendix. We define $\Psi(\lamb)(\lambda)$ as the optimal value of $\Phi$ when $l$ is the equilibrium load distribution of game $\gl$, i.e.: \begin{equation}\label{Plamb} \Psi(\lamb)(\lambda)=\Phi(\llamb). \end{equation} The next lemma shows that $\Psi(\lamb)(\lambda)$ is continuous, differentiable and convex in $\lambda$. \begin{lemma} $\forall \lambda \in (0,1)$, $\Psi(\lamb)(\lambda)$ is countinuous and differentiable in $\lambda$. Furthermore, $\Psi(\lamb)$ is convex in $\lambda$. \end{lemma} \begin{proof} The potential funtion $\Phi(q)$ is convex in $q$ and does not change with respect to $\lambda$. Thus, $\Phi(q)$ is convex in $(q, \lambda)$. Constraints \eqref{sub:demand} is affine in both $q$ and $\lambda$. Constraints \eqref{sub:positive} is linear, thus convex in $\lambda, q$. The domain of $\lambda$ is $[0,1]$, which is convex. We know from Proposition \ref{continuous_phi} in the Appendix that $\Psi(\lamb)(\lambda)$ is convex in $\lambda$. Since the feasible solution set is closed and convex, $\Phi(q)$ is continuous and convex in $q$, the optimal solution is attainable. Therefore, the optimal valued functiom $\Psi(\lamb)(\lambda)$ is continuous and differentiable in $\lambda$. \end{proof} In the following theorem, we further show that $\Psi(\lamb) (\lambda)$ has a bathtub shape with respect $\lambda$. \begin{theorem}[Bathtub Theorem]\label{bathtub} \begin{itemize} \item When $\lambda \in [0, \underline{\lamb}^1)$, $\frac{d \Psi(\lamb)(\lambda)}{d \lambda}<0$. \item When $\lambda \in [\lambda, \bar{\lamb}^1]$, $\frac{d \Psi(\lamb)(\lambda)}{d \lambda}=0$. \item When $\lambda \in (\bar{\lamb}^1, 1]$, $\frac{d \Psi(\lamb)(\lambda)}{d \lambda}>0$. \end{itemize} \end{theorem} The name Bathtub Theorem comes from the fact that the function $\Psi(\lamb)(\lambda)$ is a U-shape function of $\lambda$ with a flat bottom in the range of $[\underline{\lamb}^1, \bar{\lamb}^1]$. \begin{proof} \begin{itemize} \item When $\lambda \in \Lambda_2,$ we know from Theorem \ref{l_behavior} that $\l_r^{*}(\t)=\load_{\path}^{\dagger}(\t), \forall \r \in \routeSet, \t \in \playerTypeSet$. $\Psi(\lamb)(\lambda)$ is a constant with respect to $\lambda$. Since $\Psi(\lamb)(\lambda)$ is differentiable, we have $\frac{d \Psi(\lamb)(\lambda)}{d \lambda}=0, \forall \lambda \in (\underline{\lamb}^1, \bar{\lamb}^1)$. \item When $\lambda \in [0, \underline{\lamb}^1)$, we first show that the solution of the following optimization problem satisfies \eqref{left_bind}: \begin{equation}\label{constraint_leq} \begin{split} &\min_{l} \quad \Phi (l)\\ s.t. \quad &1-\frac{\sum_{\r \in \routeSet} \min_{\tone_{k_1} \in \playerTypeSet^1} \load_{\path}(\tone_{k_1}, \t^2_1)}{D} \leq \lambda \\ &\text{$l$ satisfies \eqref{sub:balance}, \eqref{sub:ldemand}, \eqref{sub:l_positive}}. \end{split} \end{equation} The proof by contradiction is the same as that in the proof of Theorem \ref{l_behavior}. Assuming \eqref{left_bind} is not satisfied, then $\load_{\path}^{\dagger}$ is the solution, which violates the assumption that $\lambda < \underline{\lamb}^1$. Therefore, the optimal solution of \eqref{constraint_leq} satisfies \eqref{left_bind}. The optimal solution of \eqref{constraint_left} is the same as the optimal solution of \eqref{constraint_leq}. We consider $\forall \lambp, \lambda$ such that $0 \leq \lambp < \lambda < \underline{\lamb}^1$. The corresponding equilibrium load distributions $\lrwep$ and $\llambr$ satisfies: \begin{equation} 1-\frac{\sum_{\r \in \routeSet} \min_{\tone_{k_1} \in \playerTypeSet^1} \lrwep(\tone_{k_1}, \t^2_1)}{D} = \lambp< \lambda =1-\frac{\sum_{\r \in \routeSet} \min_{\tone_{k_1} \in \playerTypeSet^1} \llambr(\tone_{k_1}, \t^2_1)}{D} \end{equation} Therefore, $\lrwep$ lies in the feasible set of the optimization program \eqref{constraint_leq} corresponding to $\lambda$, but $\lrwep$ does not satisfy the equation \eqref{left_bind}, so $\lrwep$ is not the optimal solution of \eqref{constraint_leq}. We have: \begin{equation} \Psi(\lamb)(\lambp)>\Psi(\lamb)(\lambda), \quad \forall \lambda \in [0, \underline{\lamb}^1). \end{equation} Since we know $\Psi(\lamb)(\lambda)$ is differentiable, we know that $\frac{d \Psi(\lamb)(\lambda)}{d \lambda}<0, \forall \lambda \in [0, \underline{\lamb}^1)$. \item Analogously, we know that $\frac{d \Psi(\lamb)(\lambda)}{d \lambda}>0, \forall \lambda \in (\bar{\lamb}^1, 1]$. \end{itemize} The theorem is proved by summing up all three cases. \end{proof} Bathtub theorem charaterizes the shape of $\Psi(\lamb)(\lambda)$. In regime $\Lambda_1$ and $\Lambda_3$, $\Psi(\lamb)(\lambda)$ strictly decreasing and strictly increasing respectively. In regime $\Lambda_2$, $\Psi(\lamb)(\lambda)$ is constant. This shape first coicides with our observation in Theorem \ref{l_behavior} that in regime $\Lambda_2$, the equilibrium load distribution is $\load_{\path}^{\dagger}$. In regime $\Lambda_1, \Lambda_2$, equilibrium load distribution changes as $\lambda$ changes. The result in Bathtub theorem also matches the result that $\Psi(\lamb)(\lambda)$ is convex in $\lambda$. \begin{lemma}\label{unique_lag} For any given $\lambda \in [0, 1]$, the parametric optimization problem \eqref{q_program} satisfies KKT, LICQ, SOSC conditions at optimal points in all three regimes. The Lagrangian multipliers $\mu^{t^i}, \nu_{r}^{t^i}$ are unique and can be expressed as \eqref{alpha_define}, \eqref{beta_define}. SCS holds in regime $\Lambda_1$ and $\Lambda_3$. $(\qtirlamb, \mu^{t^i}(\lambda), \nu_{r}^{t^i}(\lambda))$ are unique and once continuously differentiable in regime $\Lambda_1, \Lambda_3$. $\Psi(\lamb)(\lambda)$ is twice continuously differentiable with respect to $\lambda$ in regime $\Lambda_1, \Lambda_3$. \end{lemma} \begin{proof} \begin{itemize} \item Since \eqref{potential_opt} is a convex optimization problem, KKT conditions are satisfied at any optimal points. \item LICQ holds at equilibrium points.\\ The left hand side of constraints \eqref{sub:demand} are afine functions and the gradients are linearly independent. The left hand side of constraints \eqref{sub:positive} are also affine and the gradients are linearly independent. Assuming LICQ is violated, the constraints of \eqref{sub:positive} that are binding include $\{\strat_{\path}^{\player}(\ti)\}_{\r \in \routeSet}=0$ for at least one specific $t^i$, which contradicts with the fact that $\sum_{\r \in \routeSet}\strat_{\path}^{\player}(\ti)=\lambda^i D, \forall t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti], \i \in \playerSet$. Therefore, LICQ is satisfied. We know from Proposition \ref{unique_lagrangian} that the associated Lagrangian multipliers $\mu^{t^i}, \nu_{r}^{t^i}$ are unique. In the prove of Theorem \ref{q_opt}, we show by construction that $\mu^{t^i}$, $\nu_{r}^{t^i}$ defined as \eqref{alpha_define}, \eqref{beta_define} satisfies KKT conditions, thus are unique Lagrangian multipliers. \item SOSC is satisfied. \\ For any direction $z$ that satisfies constraints \eqref{z_constraint}, since $\nabla_{q} \strat_{\path}^{\player}(\ti)$ has 1 on the position corresponding to $\strat_{\path}^{\player}(\ti)$ and 0 on others, we know from \eqref{sub:g_gradient} that $z$ is non-negative. \eqref{sub:h_gradient} requires $z$ to be zero. Therefore, non-zero $z$ does not exist, any equilibrium points satsifies SOSC condition. \item We now prove that SCS holds in regime $\Lambda_1, \Lambda_3$ by contradiction. If SCS does not hold in regime $\Lambda_1$, with out loss of generality, we assume that there exist $\lambda_1 \in \Lambda_1, \tone_{k_1}, \r_1$ such that $q_{r_1}(\tone_{k_1}, \lambda_1)=0$ and $\beta^{\tone_{k_1}}_{r_1}(\lambda_1)=0$. Recall from the expression of $\beta_{r_1}^{\tone_{k_1}}(\lambda_1)$ from \eqref{beta_define}, we have: \begin{equation} \begin{split} q_{r_1}(\tone_{k_1}, \lambda_1)&=0\\ \beta_{r_1}^{\tone_{k_1}}(\lambda_1)&=Pr(\tone_{k_1})\mathbb{E}[c_{r_1}(l_{r_1}(\q^{*}_{\lambda_1}))|\tone_{k_1}]-\min_{\r \in \routeSet} Pr(\tone_{k_1})\mathbb{E}[c_r(\load_{\path}(\q^{*}_{\lambda_1}))|\t^1]=0. \end{split} \end{equation} Let $\epsilon$ be a sufficient small positive number, for $\lambda=\lambda+\epsilon$, we construct strategy for population 1 and 2 as $q^1(\lambda), q^2(\lambda)$, where: \end{itemize} \end{proof} We next calculate the first order derivative of $\Psi(\lamb)(\lambda)$ with respect to $\lambda$ and show the link between derivative and $\ciwel$. \begin{theorem} We can write the first order derivative of $\Psi(\lamb)(\lambda)$ as the difference of the expected cost of individual commuters in each populations as follows: \begin{equation}\label{gradient_difference} \frac{d \Psi(\lamb)(\lambda)}{d \lambda}=(\conewel-\ctwowel)D. \end{equation} Furthermore, \begin{itemize} \item $\forall \lambda \in [0, \underline{\lamb}^1)$, $\conewel<\ctwowel$. \item $\forall \lambda \in [\underline{\lamb}^1, \bar{\lamb}^1]$, $\conewel=\ctwowel$. \item $\forall \lambda \in (\bar{\lamb}^1, 1]$, $\conewel>\ctwowel$. \end{itemize} \end{theorem} \begin{proof} Recall that the Lagrangian function of \eqref{potential_opt} is \eqref{lagrangian}, where the Lagrangian multipliers are $\nu_{r}^{t^i} \geq 0, \forall t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti], \i \in \playerSet, \r \in \routeSet$ and $\mu^{t^i}, \forall t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti], \i \in \playerSet$. We know from proposition \ref{} in the appendix that the Lagrangian multipliers are unique when LICQ is satisfied at equilibrium point. Thus the Lagrangian multiplier is unique, and can be expressed as \eqref{alpha_define}, \eqref{beta_define}. Fiacco points out in Proposition \ref{} that when the optimal valued function $\Psi(\lamb)(\lambda)$ is differentiable with respect to $\lambda$, the derivative can be written as: \begin{equation}\label{gradient_original} \frac{d \Psi(\lamb)(\lambda)}{d \lambda} = \min_{q^{*}(\lamb)} \max_{(\alpha^{*}, \beta^{*})} \frac{\partial L(q, \alpha, \beta)}{\partial \lambda}. \end{equation} Since the Lagrangian multipliers at equilibrium is unique, we can simplify the first order derivative from \eqref{gradient_original} as: \begin{equation} \frac{d \Psi(\lamb)(\lambda)}{d \lambda} = \min_{q^{*}(\lamb)}\frac{\partial L(q, \alpha, \beta)}{\partial \lambda} \end{equation} We calculate $\frac{\partial L(q, \alpha, \beta)}{\partial \lambda}$ as: \begin{equation}\label{l_lamb_partial} \frac{\partial L(q, \alpha, \beta)}{\partial \lambda}=\min_{q^{*}(\lamb)} (\sum_{\t^1 \in \playerTypeSet^1} \alpha^{\t^1}(q^{*}(\lamb))-\sum_{\t^2 \in \playerTypeSet^2} \alpha^{\t^2}(q^{*}(\lamb))) D \end{equation} Put the expression of Lagrangian multipliers in, we further simplify the first order derivative as: \begin{equation} \frac{d \Psi(\lamb)(\lambda)}{d \lambda} = \min_{q^{*}(\lamb)}(\sum_{\t^1 \in \playerTypeSet^1}\min_{\r \in \routeSet}Pr(\t^1) \mathbb{E}[\cfun_{\r}(\q^{*}(\lamb))|\tone]- \sum_{\t^2 \in \playerTypeSet^2}\min_{\r \in \routeSet}Pr(\t^2) \mathbb{E}[\cfun_{\r}(\q^{*}(\lamb))|\ttwo]) D \end{equation} Since $\mathbb{E}[\cfun_{\r}(\q^{*}(\lamb))|\tone], \mathbb{E}[\cfun_{\r}(\q^{*}(\lamb))|\ttwo]$ are functions of equilibrium load distribution, they are identical for any equilibrium strategy profile. Recall the expressions of $\mathbb{E}[\cfun_{\r}({\q})|\ti]$ from \eqref{ecrti}, we get: \begin{equation} \begin{split} \frac{d \Psi(\lamb)(\lambda)}{d \lambda} &= (\sum_{\t^1 \in \playerTypeSet^1}\min_{\r \in \routeSet} \sum_{\state \in \S} \sum_{\t^2 \in \playerTypeSet^2}\pi\left(\state, \t^1, \t^2\right) \cfun_{\path}^{\state}\left(\llambr(\t^1, \t^2)\right)\\ &-\sum_{\t^2 \in \playerTypeSet^2} \min_{\r \in \routeSet} \sum_{\state \in \S} \sum_{\t^1 \in \playerTypeSet^1} \pi\left(\state, \t^1, \t^2\right) \cfun_{\path}^{\state}\left(\llambr(\t^1, \t^2)\right)) D \end{split} \end{equation} Recall the expression of $\ctiwel$ and $\ciwel$ from \eqref{ctiwel} and \eqref{ciwel}, and since at BWE, $\q^{*}$ only put positive demand on routes which have the minimum expected travel time, $\ctiwel$ can be restated as: \begin{equation} \ctiwel=\min_{\r \in \routeSet} \sum_{\state \in \S} \sum_{\playerType^{-\player} \in \playerTypeSet^{-\player}} \belief^i(\state, \tmi|\ti) \cfun_{\path}^{\state} \left(\l_r^{*}\left(t^i, \playerType^{-\player} \right) \right) \end{equation} We can have the expressions for $\ciwel$ in the same way: \begin{equation}\label{restate_ciwel} \ciwel=\sum_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \min_{\r \in \routeSet} \sum_{\state \in \S} \sum_{\playerType^{-\player} \in \playerTypeSet^{-\player}} \pi(\state, t^i, \playerType^{-\player}) \cfun_{\path}^{\state} \left(\l_r^{*}\left(t^i, \playerType^{-\player} \right) \right) \end{equation} We can see that: \[\frac{d \Psi(\lamb)(\lambda)}{d \lambda}=(\conewel-\ctwowel)D\] which is \eqref{gradient_difference}. Following from Theorem \ref{bathtub}, we immediately get that population 1 has lower averge cost in regime $\Lambda_1$. Population 2 has lower average cost in regime $\Lambda_3$. Two populations have the same average cost in regime $\Lambda_2$. \end{proof} The following proposition shows a simple case in which $\bar{\lamb}^1=1$, thus $\Psi(\lamb)(\lambda)$ first decreases then remain constant with respect to $\lambda$. \begin{proposition}\label{no_info} If population 2 gets no information from the signal. i.e. $p^2(t^2|s)=p^2(t^2)$, $\bar{\lamb}^1=1$. \end{proposition} \begin{proof} When $p^2(t^2|s)=p^2(t^2)$, $\mu(\state, \t^1|\t^2)$ is identical for any $\t^2$. Therefore, the strategy of population 2 is identical for any $\t^2$. $\forall \ttwo_{k_2}, \ttwo_{k_2} \in \playerTypeSet^2, \forall \r \in \routeSet$, $\load_{\path}^{\dagger}(\t^1_1, \ttwo_{k_2})=\load_{\path}^{\dagger}(\t^1_1, \ttwo_{k_2})$. Therefore, $\bar{\lamb}^1=1$. \end{proof} \section{Pairwise Comparison of Populations}\label{equilibrium_regime} In this section, we first analyze the effects of perturbations in the relative sizes of any two populations on the equilibrium structure. Next, we study how the cost difference between any two populations depends on the population sizes. \subsection{Equilibrium Regimes}\label{sub:impact_information} To study the effects of perturbations in the relative sizes of any two populations, we employ the notion of directional perturbation of size vector $\lambda$. In particular, for any two populations $\i$ and $\j$, we consider the $|\playerSet|$-dimensional direction vector $z^{\i\j}\stackrel{\Delta}{=}(\dots 0 \dots, 1, \dots 0 \dots, -1,$ $ \dots 0 \dots)$ with 1 in the $\i$-th position and $-1$ in the $\j$-th position. When $\lambda$ is perturbed in the direction of $z^{\i\j}$, the size of population $\i$ (resp. population $j$) increases (resp. decreases), and the sizes of the remaining populations do not change. For any size vector $\lambda$ and any two populations $\i$ and $j$, let the vector of the remaining populations' sizes be denoted $\lamb^{-\i \j} \stackrel{\Delta}{=} \(\lamb^{\k}\)_{\k \in \playerSet \setminus \{\i, \j\}}$. The total size of the remaining populations is $|\lamb^{-\i \j}| \stackrel{\Delta}{=} \sum_{\k \in \playerSet \setminus \{\i, \j\}} \lamb^{\k}$. For pairwise comparison, we only consider the case when the sizes of both populations are strictly positive so that $|\lamb^{-\i \j}| < 1$, and the range of the perturbations in the population $\i$'s size is $(0, 1-|\lamb^{-\i \j}|)$. We denote the set of admissible $\lamb^{-\i \j}$ as $\Lamb^{-\i \j}$. Now consider an optimization problem that is similar to \eqref{opt_l}, except that the two constraints in the \eqref{prime:popu_i} set corresponding to the populations $\i$ and $\j$ are replaced by a single constraint: \begin{equation}\label{eq:basic_opt_ij}\tag{OPT-$\mathcal{F}^{ij}$} \min \quad \widehat{\potential}(\l), \quad s.t. \quad \text{\eqref{sub:balance}, \eqref{sub:ldemand}, \eqref{sub:l_positive}, \eqref{prime:popu_i}$\setminus\{\i, \j\}$, \eqref{extra}}, \end{equation} where the constraints \eqref{prime:popu_i}$\setminus\{\i, \j\}$ indicate that all but (\ref{prime:popu_i}$_\i$) and (\ref{prime:popu_i}$_\j$) from the original set \eqref{prime:popu_i} are included, and the constraint \eqref{extra} is defined as follows: \begin{align}\label{extra}\tag{\ref{prime:popu_i}$_{\i\j}$} \widehat{\md}^{\i}(\l)+\widehat{\md}^{\j}(\l) \leq \(1-|\lamb^{-\i \j}|\) \totalDemand. \end{align} The constraint \eqref{extra} ensures that the total impact of information on population $\i$ and $\j$ does not exceed their total demand. We denote the set of optimal solutions for \eqref{eq:basic_opt_ij} as $\mathcal{F}^{\i \j, \dagger}$. Analogously to Theorem \ref{q_opt}, we can show that any $\l^{\i \j, \dagger} \in \mathcal{F}^{\i \j, \dagger}$ induces a unique edge load $w^{\i \j, \dagger}$, which can be obtained by \eqref{eq:q_w}; see Lemma \ref{unique_wdagij}. Then, the optimal solution set of \eqref{eq:basic_opt_ij} can be written as the following polytope: \begin{equation}\label{drop_i_j} \begin{split} \mathcal{F}^{\i \j, \dagger} = \left\{\l \left \vert \begin{array}{l} \text{$\l$ satisfies \eqref{sub:balance}, \eqref{sub:ldemand}, \eqref{sub:l_positive}, \eqref{prime:popu_i}$\setminus\{\i, \j\}$, and \eqref{extra}},\\ \sum_{\r \ni \e} \load_{\path}(\t)=w^{\i \j, \dagger}_\e(\t), \quad \forall \e \in \E, \quad \forall \t \in \playerTypeSet \end{array} \right. \right\}. \end{split} \end{equation} Note that both $\mathcal{F}^{\i \j, \dagger}$ and $w^{\i \j, \dagger}$ depend on $\lamb^{-\i \j}$ but do not depend on $\lamb^{\i}$ or $\lambda^{\j}$. Before proceeding further, we need to define two thresholds for the size of one of the two perturbed populations (say, population $\i$): \begin{align}\label{pairwise_threshold} \underline{\lamb}^\i&\stackrel{\Delta}{=} \frac{1}{\totalDemand} \min_{\l^{\i \j, \dagger} \in \mathcal{F}^{\i \j, \dagger}}\left\{\widehat{J}^{\i}(\l^{\i \j, \dagger})\right\}, \quad \bar{\lamb}^\i \stackrel{\Delta}{=} \frac{1}{\totalDemand} \max_{\l^{\i \j, \dagger} \in \mathcal{F}^{\i \j, \dagger}}\left\{\(1-|\lamb^{-\i \j}|\)\totalDemand-\widehat{J}^{\j}(\l^{\i \j, \dagger})\right\} \end{align} where $\widehat{J}^{\i}(\l^{\i \j, \dagger})$ and $\widehat{J}^{\j}(\l^{\i \j, \dagger})$ are the impact of information metrics for the population $\i$ and $\j$, respectively. We can check that $\underline{\lamb}^\i$ and $\bar{\lamb}^\i$ are admissible thresholds: \begin{lemma}\label{lemma:lambl_lambup} $0\leq \underline{\lamb}^\i \leq \bar{\lamb}^\i \leq 1-|\lamb^{-\i \j}|$. \end{lemma} Additionally, \eqref{pairwise_threshold} can be expressed as linear programming problems, see \eqref{linear_program_lambli}-\eqref{linear_program_lambupi}. These two thresholds play a crucial role in our subsequent analysis. We are now ready to introduce the equilibrium regimes that are induced by the relative change in the sizes of populations $i$ and $j$ with fixed sizes of other populations $\lamb^{-\i \j} \in \Lamb^{-\i \j}$. These regimes are defined by the following sets: \begin{subequations}\label{regime_one_two_three} \begin{align} \Lambda_1^{\i\j} &\stackrel{\Delta}{=} \{\(\lamb^{\i}, \lambda^{\j}, \lamb^{-\i \j}\) \left \vert \lambda^\i \in (0, \underline{\lamb}^\i) \right.\}, \label{def_reg_one}\\ \Lambda_2^{\i\j} &\stackrel{\Delta}{=} \{\(\lamb^{\i}, \lambda^{\j}, \lamb^{-\i \j}\) \left \vert \lambda^\i \in [\underline{\lamb}^\i, \bar{\lamb}^\i]\setminus \{0, 1-|\lamb^{-\i \j}|\} \right.\},\label{def_reg_two}\\ \Lambda_3^{\i\j} &\stackrel{\Delta}{=} \left\{\(\lamb^{\i}, \lambda^{\j}, \lamb^{-\i \j}\) \left\vert \lambda^\i \in ( \bar{\lamb}^\i, 1-|\lamb^{-\i \j}|) \right. \right\}. \label{def_reg_three} \end{align} \end{subequations} We say that the population $\i$ (resp. population $\j$) is a ``minor population'' in regime $\Lambda_1^{\i\j}$ (resp. regime $\Lambda_3^{\i\j}$) because $\lamb^{\i} < \underline{\lamb}^\i$ (resp. $\lambda^{j}<1-|\lamb^{-\i \j}|-\bar{\lamb}^\i$). Moreover, neither population is minor in regime $\Lambda_2^{\i\j}$. Note that degenerate situations are possible. In particular, if either one or both of the thresholds $\underline{\lamb}^\i$ and $\bar{\lamb}^\i$ take values in the set $\{0, 1-|\lamb^{-\i \j}|\}$, then from the regime definitions \eqref{def_reg_one}-\eqref{def_reg_three}, the number of regimes are reduced to two (for example, in the the simple routing game in Section \ref{motivate}) or even one regime (see Example \ref{single_TIS}). The following theorem describes the properties of equilibrium route flows in the regimes under the directional perturbations in the size vector $\lambda$. \begin{theorem}\label{l_behavior} For any two populations $\i, \j \in \playerSet$, and any given $\lamb^{-\i \j} \in \Lamb^{-\i \j}$, the set of equilibrium route flows $\F^{*}(\lamb)$ when $\lambda$ is in regime $\Lambda_1^{\i\j}$ or regime $\Lambda_3^{\i\j}$ can be expressed as follows: \begin{align}\label{eq:l_behavior} \F^{*}(\lamb)=\left\{ \argmin \widehat{\potential}(\l) \left \vert \begin{array}{lll} s.t. &\eqref{sub:balance}, \eqref{sub:ldemand}, \eqref{sub:l_positive}, \eqref{extra} \text{ and \eqref{prime:popu_i}$\setminus \{\j\}$} & \text{ if } \lambda \in \Lambda_1^{\i\j} \\ s.t. &\eqref{sub:balance}, \eqref{sub:ldemand}, \eqref{sub:l_positive}, \eqref{extra} \text{ and \eqref{prime:popu_i}$\setminus \{\i\}$} & \text{ if } \lambda \in \Lambda_3^{\i\j} \end{array} \right. \right\} \end{align} In regime $\Lambda_1^{\i\j}$ (resp. regime $\Lambda_3^{\i\j}$), the constraint (\ref{prime:popu_i}$_\i$) (resp. (\ref{prime:popu_i}$_\j$)) is tight in equilibrium. Additionally, in regime $\Lambda_2^{\i\j}$, we have $\F^{*}(\lamb) \subseteq \mathcal{F}^{\i \j, \dagger}$. \end{theorem} Essentially, this result is based on how the impact of information on each perturbed population compares with its size; i.e. whether or not the constraint (\ref{prime:popu_i}$_i$) (resp. (\ref{prime:popu_i}$_j$)) for the population $\i$ (resp. populatiom $\j$) is tight in equilibrium. In the first side regime $\Lambda_1^{\i\j}$, the constraint (\ref{prime:popu_i}$_i$) is tight at optimum of \eqref{opt_l}. This implies that the impact of information extends to the entire demand of the minor population $\i$. In fact, the threshold $\underline{\lamb}^\i$ is the largest size of population $\i$ for which the impact of information on itself is fully attained. We can argue similarly for the other side regime $\Lambda_3^{\i\j}$, where population $\j$ is the minor population; i.e. (\ref{prime:popu_i}$_\j$) is tight at optimum of \eqref{opt_l} and ($1-|\lamb^{-\i \j}|-\bar{\lamb}^\i$) is the largest size of population $\j$ such that the impact of information on itself is fully attained. In contrast to the two side regimes, in the middle regime $\Lambda_2^{\i\j}$, the sizes of both populations $\i$ and $\j$ are above the threshold sizes $\underline{\lamb}^\i$ and $(1-|\lamb^{-\i \j}|-\bar{\lamb}^\i)$, respectively. We can replace the constraints (\ref{prime:popu_i}$_\i$) and (\ref{prime:popu_i}$_\j$) in the optimization problem \eqref{opt_l} by \eqref{extra} without changing its optimal value, i.e. the optimal value of \eqref{eq:basic_opt_ij} is equal to $\Psi(\lamb)$. However, since the set $\mathcal{F}^{\i \j, \dagger}$ (as defined in \eqref{drop_i_j}) contains all route flows that attain the optimal value $\Psi(\lamb)$ but may not necessarily satisfy the constraints (\ref{prime:popu_i}$_\i$) and (\ref{prime:popu_i}$_\j$), the equilibrium route flow set $\mathcal{F}^{*}(\lambda)$ must be a subset of $\mathcal{F}^{\i \j, \dagger}$. In this regime, the impact of information on neither population is fully attained. A specialized result derived from Theorem \ref{l_behavior} and Proposition \ref{Lprime} is that in routing games with two heterogeneously informed populations and a parallel-route network, the equilibrium strategy profile in the regimes $\Lambda_1^{12}$ and $\Lambda_3^{12}$ is unique, see Corollary \ref{cor:strategy}. Thanks to Theorem \ref{l_behavior}, we can analyze the monotonicity of the value of potential function at equilibrium $\Psi(\lamb)$ with respect to perturbations of $\lambda$ in the direction $z^{\i\j}$. \begin{proposition}\label{bathtub} For any two populations $\i, \j \in \playerSet$, and any given $\lamb^{-\i \j} \in \Lamb^{-\i \j}$, under directional perturbations of $\lambda$ along the direction $z^{\i\j}$, the function $\Psi(\lamb)$ monotonically decreases in regime $\Lambda_1^{\i\j}$, does not change in $\Lambda_2^{\i\j}$, and monotonically increases in $\Lambda_3^{\i\j}$. Furthermore, the equilibrium edge load vector $w^{*}(\lambda)= w^{\i \j, \dagger}$ if and only if $\lambda \in \Lambda_2^{\i\j}$. \end{proposition} Following Theorem \ref{l_behavior}, in the side regime $\Lambda_1^{\i\j}$ (resp. $\Lambda_3^{\i\j}$), the set of route flows which satisfy the constraints of the optimization problem in \eqref{eq:l_behavior} increases (resp. decreases) as $\lambda$ is perturbed in the direction $z^{\i\j}$. Thus, the value of the potential function in equilibrium, $\Psi(\lamb)$, is non-increasing (resp. non-decreasing) in the direction $z^{\i\j}$. In fact, since the constraint (\ref{prime:popu_i}$_\i$) (resp. (\ref{prime:popu_i}$_\j$)) is tight in equilibrium, one can argue that $\Psi(\lamb)$ strictly decreases (resp. increases) in the direction $z^{\i\j}$. In contrast, in the middle regime $\Lambda_2^{\i\j}$, since $\mathcal{F}^{*}(\lambda) \subseteq \mathcal{F}^{\i \j, \dagger}$, we can conclude that $w^{*}(\lambda)=w^{\i \j, \dagger}$. Therefore, $\Psi(\lamb)=\widecheck{\potential}(w^{\i \j, \dagger})$, which does not change when $\lambda$ is perturbed in the direction $z^{\i\j}$. The necessary and sufficient condition for the invariance of $w^{*}(\lambda)$ under relative perturbations in the sizes of any two populations in Proposition \ref{bathtub} is a direct consequence of the monotonicity of $\Psi(\lamb)$ and the uniqueness of $w^{*}(\lambda)$. This result is useful in determining the relative ordering of population costs in equilibrium, as discussed next. \subsection{Relative Value of Information} \label{value_of_information} We now study the difference between the equilibrium costs of any two populations under perturbations in their relative sizes. For any two populations $\i, \j \in \playerSet$ and size vector $\lambda$, we define the \emph{relative value of information}, denoted $V^{\i\j*}(\lamb)$, as the expected travel cost saving that a traveler in population $\i$ enjoys over a traveler in population $\j$, i.e. $V^{\i\j*}(\lamb) \stackrel{\Delta}{=} C^{\j*}(\lamb)-C^{\i*}(\lamb)$. Equivalently, $V^{\i\j*}(\lamb)$ is the expected reduction in the cost faced by an individual traveler when her subscription unilaterally changes from TIS $\i$ to TIS $\j$, while the TIS subscriptions of all other travelers remain unchanged. We say TIS $\i$ is relatively more valuable (resp. less valuable) than TIS $\j$ if $V^{\i\j*}(\lamb)>0$ (resp. $V^{\i\j*}(\lamb)<0$). Similarly, if $V^{\i\j*}(\lamb)=0$, TIS $\i$ is said to be as valuable as TIS $\j$. It turns out that, for any given size vector $\lambda$, $V^{\i\j*}(\lamb)$ is closely related to the sensitivity of $\Psi(\lamb)$ (i.e. the value of the potential function in equilibrium) with respect to the perturbation in the relative sizes of populations $\i$ and $\j$. \begin{lemma}\label{lemma:directional_derivative_psi} The value of the weighted potential function in equilibrium, $\Psi(\lamb)$ as defined in \eqref{Psi}, is convex and directionally differentiable in $\lambda$. For any $\i, \j \in \playerSet$, \begin{align}\label{link_rv_derivative} V^{\i\j*}(\lamb) = -\frac{1}{\totalDemand} \nabla_{z^{\i \j}} \Psi(\lamb), \end{align} where $\nabla_{z^{\i \j}} \Psi(\lamb)\stackrel{\Delta}{=} \lim_{\epsilon \to 0^{+}} \frac{\Psi(\lambda+\epsilon z^{\i\j})-\Psi(\lamb)}{\epsilon}$ is the derivative of $\Psi(\lamb)$ in the direction $z^{\i\j}$. \end{lemma} \emph{Proof of Lemma \ref{lemma:directional_derivative_psi}} The proof involves applying the results on sensitivity analysis of convex optimization problems, as summarized in Lemmas \ref{continuous_phi} and \ref{directional}; for a detailed background on these technical results, we refer the reader to \cite{fiacco2009sensitivity}, \cite{fiacco1986convexity}, and \cite{rockafellar1984directional}. Since in \eqref{eq:potential_opt}, the weighted potential function $\Phi(\strat)$ is convex in $\strat$, and the constraints \eqref{sub:demand}-\eqref{sub:non-negative} are affine in $\strat$ and $\lambda$, from Lemma \ref{continuous_phi}, we know that the optimal value of the potential function $\Psi(\lamb)$ is convex in $\lambda$. Next, we can check that \eqref{eq:potential_opt} satisfies the following conditions: (1) The potential function $\Phi(\strat)$ is continuously differentiable in $\strat$, and constraints \eqref{sub:demand}-\eqref{sub:non-negative} are linear in $\strat$ and $\lambda$; (2) The optimal solution set $\mathcal{\Q}^{*}(\lambda)$ is non-empty and bounded (Theorem \ref{q_opt}). The Lagrange multipliers at the optimum of \eqref{eq:potential_opt} are unique, and bounded (Lemma \ref{unique_lag}). Therefore, from Lemma \ref{directional}, we know that $\Psi(\lamb)$ is differentiable in the direction $z^{\i\j}$, and $\nabla_{z^{\i \j}} \Psi(\lamb)$ can be expressed as: \begin{footnotesize} \begin{align*} \nabla_{z^{\i \j}} \Psi(\lamb)&=\min_{\q^{*} \in \mathcal{\Q}^{*}(\lambda)} \max_{\substack{ (\mu^{*}, \nu^{*})\\ \in \(M(\q^{*}), N(\q^{*})\)}} \nabla_{\lambda} \mathcal{L}(\q^{*}, \mu^{*}, \nu^{*}, \lambda) z^{\i \j}\\ &\stackrel{\text{\eqref{lagrangian}}}{=}\min_{\q^{*} \in \mathcal{\Q}^{*}(\lambda)} \max_{\substack{ (\mu^{*}, \nu^{*})\\ \in \(M(\q^{*}), N(\q^{*})\)}}\(\sum_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \mu^{*t^i}-\sum_{\t^j \in \playerTypeSet^\j} \mu^{*\t^j}\) \totalDemand, \end{align*} \end{footnotesize}where $M(\q^{*})$ (resp. $N(\q^{*})$) is the set of optimal Lagrange multipliers $\mu^{*}$ (resp. $\nu^{*}$) associated with the equilibrium strategy $\q^{*}$. From Lemma \ref{unique_lag}, since both $\mu^{*}$ and $\nu^{*}$ are unique in equilibrium, $\nabla_{z^{\i \j}} \Psi(\lamb)$ can be simplified: \begin{footnotesize} \begin{align*} \nabla_{z^{\i \j}} \Psi(\lamb)&=\(\sum_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \mu^{*t^i}-\sum_{\t^j \in \playerTypeSet^\j} \mu^{*\t^j}\) \totalDemand\\ &\stackrel{\eqref{define_al}}{=}\(\sum_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \min_{\r \in \routeSet}\mathrm{Pr}(t^i) \mathbb{E}[\cfun_{\r}({\qwe})|\ti] -\sum_{\t^j \in \playerTypeSet^\j} \min_{\r \in \routeSet}\mathrm{Pr}(\t^j) \mathbb{E}[c_\r(\q^{*})|\tj] \) \totalDemand\notag\\ &\stackrel{\eqref{eq:population_cost_def}}{=} \(C^{\i*}(\lamb)-C^{\j*}(\lamb)\) \totalDemand=-V^{\i\j*}(\lamb)\cdot \totalDemand.\hskip0.5\textwidth \end{align*} \end{footnotesize} \hfill\ensuremath{\square} Our next theorem provides the qualitative structure of relative value of information in the three regimes \eqref{def_reg_one}-\eqref{def_reg_three}. \begin{theorem}\label{prop:relative_value} For any two populations $\i, \j \in \playerSet$, and any $\lamb^{-\i \j} \in \Lamb^{-\i \j}$, the relative value of information $V^{\i\j*}(\lamb)$ is positive in regime $\Lambda_1^{\i\j}$, zero in regime $\Lambda_2^{\i\j}$, and negative in regime $\Lambda_3^{\i\j}$. Furthermore, $V^{\i\j*}(\lamb)$ is non-increasing in the direction $z^{\i\j}$. \end{theorem} \emph{Proof of Theorem \ref{prop:relative_value}.} First, we know from Proposition \ref{bathtub} that in direction $z^{ij}$, $\Psi(\lamb)$ decreases in regime $\Lambda_1^{\i\j}$, does not change in regime $\Lambda_2^{\i\j}$ and increases in regime $\Lambda_3^{\i\j}$. Following Lemma \ref{lemma:directional_derivative_psi}, we directly obtain that $V^{\i\j*}(\lamb)>0$ in $\Lambda_1^{\i\j}$, $V^{\i\j*}(\lamb)=0$ in $\Lambda_2^{\i\j}$, and $V^{\i\j*}(\lamb)<0$ in $\Lambda_3^{\i\j}$. Next, from Lemma \ref{lemma:directional_derivative_psi}, we know that $\Psi(\lamb)$ is convex in $\lambda$. Hence, for any $\i, \j \in \playerSet$, the directional derivative $\nabla_{z^{\i \j}} \Psi(\lamb)$ is non-decreasing in $z^{\i\j}$. From \eqref{link_rv_derivative}, $V^{\i\j*}(\lamb)$ is non-increasing in $z^{\i\j}$. \hfill\ensuremath{\square} Theorem \ref{prop:relative_value} shows that one population has advantage over another population if and only if it is the minor population of the two. For the two side regimes, information impacts the entire demand of the minor population. As a result, in equilibrium, the travelers in the minor population do not choose the routes with a high expected cost based on the signal they receive from their TIS; however, the travelers in the other population may still choose these routes. On the other hand, in the middle regime, neither population has an advantage over the other one because the information only partially impacts each population's demand. Consequently, both populations route their demand in a manner such that they face identical cost in equilibrium. Additionally, the travel cost saving that population $\i$ travelers enjoy over the population $\j$ is the highest when population $\i$ has few travelers. Intuitively, in each side regime, the travelers in the non-minor population face a higher congestion externality relative to the travelers in the minor population, because all travelers within a population are routed according to the same strategy. Naturally, the difference in the equilibrium costs due to the imbalance in congestion externality decreases as the size of the minor population increases, and reduces to zero in the middle regime. Furthermore, given any two populations $\i, \j \in \playerSet$ and the sizes of all other populations $\lamb^{-\i \j}$ being fixed, Theorem \ref{prop:relative_value} provides a computational approach to compare the equilibrium costs of populations $\i$ and $\j$ for the full range of $\lamb^{\i} \in (0, 1-|\lamb^{-\i \j}|)$ without explicit computation of BWE or equilibrium route flows for each $\lamb^{\i}$. This approach can be summarized as follows: (i) Solve \eqref{eq:basic_opt_ij} to obtain an optimal solution $\l^{\i \j, \dagger}$; (ii) Compute $w^{\i \j, \dagger}$ by plugging $\l^{\i \j, \dagger}$ into \eqref{eq:q_w}; (iii) Obtain $\underline{\lamb}^\i$ and $\bar{\lamb}^\i$ by solving \eqref{pairwise_threshold}; and (iv) Find the relative ordering of equilibrium costs of population $\i$ and $\j$ by checking which of the three possible regimes the size vector $\lambda$ belongs to. Finally, we can specialize Theorem \ref{prop:relative_value} to analyze situations when a population does not have an access to a TIS, or chooses not to use it at all. Formally, we say that a population $\j \in \playerSet$ is \emph{uninformed} if its type is independent with the network state and other populations' types, i.e. $\mathrm{Pr}(\t^j|\state, \t^{-j})=\mathrm{Pr}(\t^j)$ for any $\t^{-j} \in \playerTypeSet^{-j}$, any $\t^j \in \playerTypeSet^\j$, and any $\state \in \S$. Following \eqref{interim_belief}, the uninformed population $\j$'s interim belief can be written as follows: \begin{align} \belief^j(\state, \t^{-j}|\t^j)&\stackrel{\eqref{interim_belief}}{=}\frac{\pi(\state, \t^j, \t^{-j})}{Pr(\t^j)}=\frac{Pr(\t^j|\state, \t^{-j}) \cdot Pr(\state, \t^{-j})}{Pr(\t^j)}=Pr(\state, \t^{-j})=\sum_{\t^j \in \playerTypeSet^\j} \pi(\state, \t^{-j}, \t^j), \label{uninformed_mu} \end{align} That is, the interim belief $\belief^j(\state, \t^{-j}|\t^j)$ is identical for any signal $\t^j \in \playerTypeSet^{\j}$ received by population $\j$, and is equal to the marginal probability of $\(\state, \t^{-\j}\)$ calculated from the common prior $\pi$. Therefore, the uninformed population has no further information besides the common knowledge. We show that the equilibrium cost of the uninformed travelers is no less than the cost of any other population. \begin{proposition}\label{no_info} Consider the game $\game$ in which population $\j$ is uninformed. Then, for any size vector $\lambda$, the equilibrium cost of population $\j$'s travelers $C^{\j*}(\lamb) \geq C^{\i*}(\lamb)$, where the population $\i$ is any other population (i.e. $\i \in \playerSet \setminus \{\j\}$). \end{proposition} Indeed, if population $\j$ is uninformed, we can argue that its equilibrium routing strategy $q^{\j*}(\t^j)$ must be identical for any $\t^j \in \playerTypeSet^{j}$. Consequently, from \eqref{eq:mdi}, the impact of information metric for the population $\j$ is $\widehat{J}^\j(\strat^{\j*})=0$, and perturbing the relative sizes of population $\j$ and any other population $\i \in \playerSet \setminus \{\j\}$ never results in a regime in which population $\j$ is the minor population. Applying Theorem \ref{prop:relative_value}, we can conclude that the equilibrium cost of population $\j$ cannot be less than that of any other population. We illustrate the results on equilibrium structure and relative value of information in the following two examples: \begin{example}\label{benchmark_example} We consider a game with two populations on two parallel routes ($\r_1$ and $\r_2$) with following parameters: $\theta(a)=0.2$, $\totalDemand=10$, $c_1^{\mathbf{n}}(\l_1)=\l_1+15$, $c_1^{\a}(\l_1)=3\l_1+15$, $c_2 (\l_2)=2\l_2+20$. Types $\t^1$ and $\t^2$ are independent conditional on the state, i.e. $\mathrm{Pr}(\t^1, \t^2|\state)=\mathrm{Pr}(\t^1|\state) \cdot \mathrm{Pr}(\t^2|\state)$. Population 1 has 0.8 chance of getting accurate information of the state, and population 2 has 0.6 chance, i.e. $\mathrm{Pr}(\t^1=\state|\state)=0.8$, and $\mathrm{Pr}(\t^2=\state|\state)=0.6$. The value of the potential function in equilibrium, equilibrium route flows and population costs are shown in Fig. \ref{fig:8_6_load_potential_cost}. In this example, population 1 travelers receive more accurate state information than population 2 travelers. However, population 1 faces a higher cost than population 2 when its size is sufficiently large, i.e., when $\lambda$ is in regime $\Lambda_3^{12}$; see Figure \ref{fig:ind_both_inf}. This is due to the fact that in regime $\Lambda_3^{12}$, the population 1's advantage of receiving more accurate information is dominated by the congestion externality it faces due to its relatively large size, in comparison to population 2. \begin{figure}[H] \centering \begin{subfigure}[b]{0.32\textwidth} \includegraphics[width=\textwidth]{potential_both.eps} \caption{} \label{fig:pot_80_60_18_20_2} \end{subfigure} ~ \begin{subfigure}[b]{0.32\textwidth} \includegraphics[width=\textwidth]{flow_both_inf.eps} \caption{} \label{fig:load_H_80_L_60_D_10_P_2} \end{subfigure}~ \begin{subfigure}[b]{0.32\textwidth} \includegraphics[width=\textwidth]{ind_both_inf.eps} \caption{} \label{fig:ind_both_inf} \end{subfigure} \caption{Effects of varying population sizes for Example \ref{benchmark_example}: (a) Weighted potential function in equilibrium, (b) Equilibrium route flows on $r_1$, and (c) Equilibrium population costs.} \label{fig:8_6_load_potential_cost} \end{figure} \end{example} \begin{example}\label{correlation} Let us now consider the game with two populations on two parallel routes ($r_1$ and $r_2$) with the same cost functions, prior distribution $\theta$ and total demand $\totalDemand$ as that in Example \ref{benchmark_example}. Both populations 1 and 2 have 0.75 chance of getting accurate information about the state, i.e. $\mathrm{Pr}(t^i=\state|\state)=0.75$ for any $\i \in \playerSet$ and any $\state \in \S$. In Fig. \ref{fig:compare}, we illustrate the equilibrium population costs in two cases: (i) Types $\t^1$ and $\t^2$ are perfectly correlated, i.e. $\t^1=\t^2$; (ii) Types $\t^1$ and $\t^2$ are independent conditional on the state, i.e. $\mathrm{Pr}(\t^1, \t^2|\state)=\mathrm{Pr}(\t^1|\state) \cdot \mathrm{Pr}(\t^2|\state)$. This example illustrates how the correlation among received signals (or lack thereof) affects the equilibrium structure. Note that case (i) can be viewed as a single-population game. This is because when $\t^1$ and $\t^2$ are perfectly correlated, there is no information asymmetry among travelers. Thus, $\lambda^1$ has no impact on the equilibrium outcome, and $\underline{\lamb}^1=0$, $\bar{\lamb}^1=1$ (Fig.~\ref{fig:perfect_correlate}). However, case (ii) is not equivalent to a single-population game. Although both populations have identical chance of getting accurate information about the state, there is information heterogeneity among travelers of the two populations, i.e. travelers in one population do not know the signals received by travelers in the other population, and thus the equilibrium outcome changes with the size $\lambda^1$ (Fig.~\ref{fig:independent}). \begin{figure}[H] \centering \begin{subfigure}[b]{0.32\textwidth} \includegraphics[width=\textwidth]{perfect_correlate.eps} \caption{} \label{fig:perfect_correlate} \end{subfigure} ~ \begin{subfigure}[b]{0.32\textwidth} \includegraphics[width=\textwidth]{conditional_ind.eps} \caption{} \label{fig:independent} \end{subfigure} \caption{Effects of varying population sizes on equilibrium population costs for Example \ref{correlation}: (a) Perfectly correlated types; (b) Conditional independent types.} \label{fig:compare} \end{figure} \end{example} We include two additional examples in the e-companion. Example \ref{non_necessary} shows that the regime $\Lambda_3^{12}$ can be empty even when population 2 is not an uninformed population. Thus, an uninformed population $\j$ is sufficient but not necessary for $\bar{\lamb}^\i=1-|\lamb^{-\i \j}|$. In Example \ref{single_TIS}, we present a situation when only single regime exists in equilibrium. Our results so far focus on how equilibrium properties and population costs change with the directional perturbation of the size vector $\lambda$. We emphasize that given any $\i, \j \in \playerSet$, the thresholds $\underline{\lamb}^\i$ and $\bar{\lamb}^\i$, as defined in \eqref{pairwise_threshold}, depend on the sizes of the remaining populations $\lamb^{-\i \j}$, and the populations' interim beliefs $(\beta^{\i})_{\i \in \playerSet}$ derived from the common prior $\pi$. Importantly, the qualitative structure of the equilibrium regimes resulting from perturbations in the sizes of any two populations is applicable for any size vector $\lambda$ and any common prior. The main property that drives these results is that the equilibrium regimes only depend on whether or not the impact of information on each population is fully attained. \section{Equilibrium Characterization}\label{Sec:potential_game} In this section, we show that the game $\game$ is a weighted potential game. This property enables us to express the sets of equilibrium strategy profiles and route flows as optimal solution sets of certain convex optimization problems. \input{potential_function} \input{load_program_new} \input{equilibrium_structure} \subsection{Adoption Rates under Choice of TIS}\label{implication} Our analysis so far has focused on the equilibrium properties with fixed population sizes. We now extend our results on the relative value of information (Section \ref{equilibrium_regime}) and the size independence of the equilibrium edge load vector (Section \ref{sub:equilibrium_edge}) to analyze travelers' choice of TIS subscription when they can choose to subscribe to any TIS in the set $\playerSet$. We model travelers' choice of TIS and the choice of routes as a two-stage game: In the first stage, travelers choose to subscribe to one TIS from the set $\playerSet$. The induced size vector is $\lambda=\(\lamb^{\i}\)_{\i \in \playerSet}$, where $\lamb^{\i}$ is the fraction of travelers who choose TIS $\i$. In the second stage, travelers play the Bayesian routing game $\game$. Note that the size vector $\lambda$ here is determined by the travelers' TIS choices in the first stage, as opposed to being a parameter. In equilibrium, a traveler who chooses TIS $\i$ experiences the expected cost $C^{\i*}(\lamb)$. The travelers has no ex-ante incentive to unilaterally change her TIS subscription if and only if $C^{\i*}(\lamb)$ is the lowest across all $\i \in \playerSet$. Therefore, no traveler has the incentive to change her TIS subscription if and only if: \begin{align}\label{ssf} \lamb^{\i}>0 \quad \Rightarrow \quad C^{\i*}(\lamb)=\min_{\j \in \playerSet} C^{\j*}(\lamb), \quad \forall \i \in \playerSet. \end{align}Such population size vector $\lambda$ can be viewed as the vector of equilibrium adoption rates, one for each TIS. For any size vector that satisfies \eqref{ssf}, all travelers experience identical expected costs, and no traveler has the incentive to change her TIS subscriptions. Our next theorem shows that all size vectors $\lambda \in \Lambda^{\dagger}$ are equilibrium TIS adoption rates. \begin{theorem}\label{order_population} The set of equilibrium adoption rates under the choice of TIS is $\Lambda^{\dagger}$. \end{theorem} \emph{Proof of Theorem \ref{order_population}} Firstly, we show for any $\lambda \in \Lambda^{\dagger}$, all travelers have identical costs in equilibrium. Consider any $\i, \j \in \playerSet$ such that $\lamb^{\i}>0$ and $\lambda^j>0$, the directional derivative of $\Psi(\lamb)$ in the direction $z^{\i\j}$, $\nabla_{z^{\i \j}} \Psi(\lamb)$, must be 0. Otherwise, $\Psi(\lamb)$ strictly decreases in the direction $z^{\i\j}$ (resp. $z^{ji}$) if $\nabla_{z^{\i \j}} \Psi(\lamb)<0$ (resp. if $\nabla_{z^{\i \j}} \Psi(\lamb)>0$), which contradicts the fact that $\Lambda^{\dagger} = \argmin_{\lambda} \Psi(\lamb)$ as in Proposition \ref{theorem:intermediate}. From Lemma \ref{lemma:directional_derivative_psi}, we know that $C^{\i*}(\lamb)=C^{\j*}(\lamb)$. Therefore, any two populations with positive size have identical costs in equilibrium. If any $\lambda \in \Lambda^{\dagger}$ satisfies $\lamb^{\i}>0$ for all $\i \in \playerSet$, then the first step in our proof is sufficient to show that \eqref{ssf} is satiesfied. Otherwise, for any $\lambda \in \Lambda^{\dagger}$, and any degenerate population $\i \in \{\playerSet|\lamb^{\i}=0\}$, we need to show that $C^{\i*}(\lamb) \geq C^{\j*}(\lamb)$, where $\lambda^{\j}>0$. Since $\Lambda^{\dagger} = \argmin_{\lambda} \Psi(\lamb)$, we know that $\Psi(\lamb)$ must be non-decreasing in the direction $z^{\i\j}$. Thus, we obtain: $\nabla_{z^{\i \j}} \Psi(\lamb)\stackrel{\eqref{link_rv_derivative}}{=}\(C^{\i*}(\lamb)-C^{\j*}(\lamb)\) \totalDemand \geq 0$. Thus, $C^{\i*}(\lamb) \geq C^{\j*}(\lamb)$. The first and the second steps together show that any $\lambda \in \Lambda^{\dagger}$ satisfies \eqref{ssf}, and hence is a vector of equilibrium adoption rates. Finally, we show that for any feasible $\lambda \notin \Lambda^{\dagger}$, \eqref{ssf} is not satisfied. Since $\Lambda^{\dagger} = \argmin_{\lambda} \Psi(\lamb)$, for any $\lambda \notin \Lambda^{\dagger}$, we can claim that there must exist a direction $z^{\i\j}$ such that $\Psi(\lamb)$ decreases in the direction $z^{\i\j}$, $\nabla_{z^{\i \j}} \Psi(\lamb)<0$. Otherwise, $\lambda$ is a local minimum of $\Psi(\lamb)$, and since $\Psi(\lamb)$ is convex in $\lambda$ (Lemma \ref{lemma:directional_derivative_psi}), $\lambda$ is a global minimum, which contradicts the fact that $\lambda \notin \Lambda^{\dagger}$. For such a direction $z^{\i\j}$, there are two possible cases: (1) $\lamb^{\i} >0$ and $\lambda^{\j}>0$. In this case, from \eqref{link_rv_derivative}, $C^{\i*}(\lamb) \neq C^{\j*}(\lamb)$, and thus travelers do not have identical costs in equilibrium. (2) $\lamb^{\i}=0$ and $\lambda^{\j}>0$. In this case, from \eqref{link_rv_derivative}, we must have $\nabla_{z^{\i \j}} \Psi(\lamb)=\(C^{\i*}(\lamb)-C^{\j*}(\lamb)\) \totalDemand<0$. Therefore, $C^{\j*}(\lamb)>C^{\i*}(\lamb)$, which implies that travelers in population $\j$ has incentive to change subscription to TIS $\i$. To sum up, in either case, $\lambda \notin \Lambda^{\dagger}$ cannot be a vector of equilibrium adoption rates. \hfill\ensuremath{\square} \color{black} Note that the set $\Lambda^{\dagger}$ is not a singleton set in general. Recall from Example \ref{benchmark_example}, the set $\Lambda^{\dagger}$ is the range $\Lambda_2^{12}$, in which both TIS are chosen. Therefore, the equilibrium adoption rate of each TIS is not unique. However, since $\Lambda^{\dagger}$ is a convex set, the equilibrium adoption rate of each TIS $\i \in \playerSet$ is in a continuous range, denoted $[\lambda^{\i\dagger}_{min}, \lambda^{\i\dagger}_{max}]$, where $\lambda^{\i\dagger}_{min}=\min_{\lambda^{\dagger}\in \Lambda^{\dagger}} \lambda^{\i\dagger}$ (resp. $\lambda^{\i\dagger}_{max}=max_{\lambda^{\dagger} \in \Lambda^{\dagger}} \lambda^{\i\dagger}$) is the minimum (resp. maximum) equilibrium adoption rate. Furthermore, since the set $\Lambda^{\dagger}$ is determined by the heterogeneous information environment created by all TIS, the equilibrium adoption rate of each TIS $\i$ is not only determined by the distribution of its own signal, but is also related to the distribution of other TIS signals, and the possible correlations between signals of different TIS. Finally, Theorem \ref{order_population} can be used to assess whether or not a set of TIS can induce a heterogeneous information environment. For any $\lambda^{\dagger} \in \Lambda^{\dagger}$, the support set of $\lambda^{\dagger}$, denoted $\bar{\I}(\lamb^{\dagger}) \stackrel{\Delta}{=} \{\i \in \playerSet | \lambda^{\i\dagger} >0\}$, represents the set of TISs chosen by travelers. In particular, if $|\bar{\I}(\lamb^{\dagger})|=1$, then all travelers choose to subscribe to a single TIS even though multiple TIS are available. Thus, the resulting information environment is homogeneous; see Example \ref{single_TIS}, where $\lambda^1=1$ and $\lambda^2=0$ is the only equilibrium adoption rate. However, if $|\bar{\I}(\lamb^{\dagger})|>1$, then more than one TIS are chosen, i.e., the heterogeneous information environment is sustained. Moreover, if TIS $\i \notin \bar{\I}(\lamb^{\dagger})$ for any $\lambda^{\dagger} \in \Lambda^{\dagger}$, then this TIS is redundant in that it is not chosen in equilibrium even if it is available to travelers. \section{Introduction}\label{sec:introduction} Travelers are increasingly relying on traffic navigation services to make their route choice decisions. In the past decade, numerous services have come to the forefront, including Waze/Google maps, Apple maps, INRIX, etc. These Traffic Information Systems (TISs) provide their subscribers with costless information about the uncertain network condition (state), which is typically influenced by exogenous factors such as weather, incidents, and road conditions. The information provided by TIS can be especially useful in making travel decisions when a change in state corresponds to changes in travel times of multiple edges or routes of the network. Experiential evidence suggests that the accuracy levels of TISs are less than perfect, and exhibit heterogeneities due to the inherent technological differences in data collection and analysis procedures. Moreover, travelers may use different TISs or choose not to use them at all, depending on factors such as marketing, usability, and availability. Therefore, we can reasonably expect that travelers face an environment of asymmetric and incomplete information about the network state. Importantly, information heterogeneity can directly influence the travelers' route choice decisions, and the resulting congestion externalities. Consider an example where some travelers are informed by their TIS that a certain route has an incident. Taking a detour based on this information may not only reduce their own travel time, but also benefit the uninformed travelers by shifting traffic away from the affected route. However, if too many travelers take the detour, then this alternate route will also start getting congested, limiting the benefits of information (Section \ref{motivate}). Thus, the question arises as to how information heterogeneity impacts the travelers’ route choices and costs. In this article, we develop a game-theoretic approach to study this question. We consider a routing game in which the travelers are privately informed about the network state by their respective TIS, and choose strategies based on their beliefs about the state and other travelers' behavior. We conduct a systematic study of how the sizes of heterogeneously informed traveler populations affect the equilibrium structure and the relative value of information faced by travelers subscribed to one TIS in comparison to another TIS. Furthermore, we characterize the set of equilibrium adoption rates when travelers can choose any available TIS based on its relative value. \subsection{Our Model and Contributions} We model the traffic routing problem in an asymmetric and incomplete information environment as a Bayesian routing game. We consider a general traffic network with an uncertain state that is realized from a finite set according to a prior probability distribution. The cost function (travel time) of each edge in the network is increasing in the aggregate traffic load on that edge. Moreover, the edge costs are \emph{state-dependent} in that the state can affect them in various ways. There are multiple heterogeneous TISs, each sending a noisy signal of the state to its subscribed traveler population. The signal sent by each TIS is privately known to only its subscribers, but the joint distribution of the state and all signals is known by all travelers (common knowledge). This joint distribution is the \emph{common prior} of the game, and each population's private belief of the state and other populations’ private signals is derived from it. Our information environment is general in that we do not impose any structural assumption on the common prior. For example, the signals of different TISs can be correlated or independent, conditional on the state. Also, one TIS can be more accurate than another in some states, but less in the other states. Thus, we do not assume that the TISs are ordered according to the accuracy of their signals (Section \ref{model_environment}). We use \textsl{Bayesian Wardrop Equilibrium (BWE)} as the solution concept of our game. In a BWE, all populations assign demand on routes with the smallest expected cost based on their private beliefs. In fact, our game is a weighted potential game, i.e. the set of BWE is the optimal solution set of a convex optimization problem that minimizes the weighted potential function over the set of feasible routing strategies of traveler populations (Theorem \ref{q_opt}). This property establishes the essential uniqueness of BWE, i.e. the equilibrium edge load vector is unique. However, the strategy-based optimization problem is not directly useful for analyzing how the set of equilibrium strategies and population costs depend on the population size vector. To address this issue, we provide a characterization of the set of feasible route flows (i.e. route flows induced by feasible strategy profiles) as a convex polytope (Proposition \ref{Lprime}), and show that this set is the optimal solution set of another convex optimization problem (Proposition \ref{l_opt}). The optimal value of this flow-based formulation is the value of weighted potential function in equilibrium (Section \ref{Sec:potential_game}). The flow-based formulation enables us to analyze the sensitivity of equilibrium structure with respect to perturbations in the size vector. The constraints in this formulation include: basic route feasibility constraints, a set of size-independent equality constraints, and a set of size-dependent inequality constraints. The equality constraints ensure that any shift in route flows resulting from a change of signal received by one population is independent of the signals received by other populations. Each inequality constraint corresponds to a single population, and ensures that the maximum extent to which the received signals impact its equilibrium routing behavior is limited by the population's size. Hence, we refer to these inequality constraints as \emph{information impact constraints} (IICs). Consequently, the effects of perturbation in the size vector on the equilibrium structure can be studied by evaluating the tightness of the IICs corresponding to the perturbed populations at the optimum of the flow-based formulation. In particular, Theorem \ref{l_behavior} describes how the qualitative properties of equilibrium route flows change under perturbations in the sizes of any two populations, with sizes of all other populations being fixed (i.e. directional perturbations of the size vector). Among the two perturbed populations, we say that one population is the ``minor population'' if its size is smaller than a certain (population-specific) threshold. Then, the corresponding IIC is tight in equilibrium, i.e. the impact of information on the minor population is fully attained. These population-specific thresholds depend on the common prior distribution as well as sizes of all other populations. In fact, each threshold can be computed by solving a linear program. Based on the two thresholds, we can distinguish three qualitatively distinct equilibrium regimes: In the two side regimes exactly one population assumes the minority role, on the other hand, in the middle regime neither population is minor. We can apply Theorem \ref{l_behavior} to analyze the sensitivity of the equilibrium value of the weighted potential function under directional perturbation of population sizes (Proposition \ref{bathtub}). In the middle regime, perturbing the relative sizes does not change the equilibrium value of the potential function. On the other hand, in the two side regimes the value of the potential function monotonically decreases as the size of the minor population increases. Thanks to the essential uniqueness of BWE, the equilibrium edge load vector does not change with this directional perturbation if and only if the size vector falls in the middle regime. These results allow us to compare the expected cost in equilibrium faced by travelers in any pair of populations. In particular, we can evaluate how this cost difference --- which we call the \emph{relative value of information} --- changes with pairwise size perturbations. By using the results on sensitivity analysis of general convex optimization problems (\citet{fiacco1983introduction}, \citet{rockafellar1984directional}), we show that the relative value of information is proportional to the derivative of the equilibrium value of potential function in the direction of perturbation. Combining this observation with Proposition \ref{bathtub}, we obtain that the minor population faces a lower cost relative to the other population in the two side regimes; whereas both populations face identical costs in the middle regime. Importantly, the relative value of information is non-increasing in the size of its subscribed population (Theorem \ref{prop:relative_value}). This result is based on the intuition that an individual traveler faces higher congestion externality when more travelers have access to the same information, and hence make their route choices according to the same strategy. Thus, an increase in the size of minor population decreases the relative imbalance in congestion externality, thereby reducing the advantage enjoyed by its travelers over the other population. Our results can be easily specialized to a simpler information environment in which one of the populations does not have an access to TIS (uninformed population). In this case, we obtain that the equilibrium cost of the uninformed population is no less than that of any other population regardless of the size vector (Proposition \ref{no_info}). That is, having access to a TIS always leads to a non-negative relative value of information in comparison to being uninformed (Section \ref{equilibrium_regime}). Furthermore, we extend our approach of comparing the relative value of information for any pair of populations to study how the equilibrium outcome depends on the population sizes in general. In particular, we characterize a non-empty set of size vectors, for which the equilibrium edge load vector is size-independent, and the value of potential function is minimized (Proposition \ref{theorem:intermediate}). This result enables us to study situations when travelers can choose their TIS subscription based on its value. Then, the notion of adoption rate of TIS becomes relevant, because the value of information to users (as well as non-users) of a TIS depends on the size of the population with access to information provided by it. Intuitively, if it is possible for the non-users of a particular TIS to receive a greater value by adopting it, then they may continue to do so until there is no longer a positive relative value in adopting that TIS. Theorem \ref{order_population} shows that the set of equilibrium adoption rates (i.e. fraction of travelers choosing each TIS in equilibrium) is exactly the set of population sizes that minimize the value of potential function at equilibrium. Naturally, any size vector that is induced by travelers' equilibrium choice of TIS satisfies the property that all travelers face identical costs and no traveler has an incentive to change her TIS subscription (Section \ref{sec:general_cost}). We conclude our work in Section \ref{concluding}. We include supplementary results, examples, and most of the proofs in the electronic companion of this article. \subsection{Related Work}\label{related_work} \emph{Congestion games}. Well-known results in classical congestion games include their equivalence with potential games (\citet{rosenthal1973class}, \citet{monderer1996potential}, and \citet{sandholm2001potential}), analysis of network formation games as congestion games (\cite{gopalakrishnan2014potential}, and \cite{tardos2007network}), and equilibrium inefficiency (\citet{roughgarden2004bounding}, \citet{Koutsoupias}, \cite{correa2007fast}, \cite{acemoglu2007competition}, and \cite{nikolova2014mean}). \cite{Milchtaich1996111} has studied congestion games with player-specific cost functions, which can model both heterogeneous private information and heterogeneous preferences. However, the existence of potential function is not guaranteed with general player-specific cost functions. In our game, the heterogeneity in the expected costs among populations arises only due to heterogeneous private beliefs, which are derived from a common prior. This feature makes our game a weighted potential game (\cite{sandholm2001potential}). Moreover, \cite{acemoglu2018informational} studied a congestion game where travelers have different information sets about the available edges (routes). While their work focuses on heterogeneous information about the network structure, we use a Bayesian approach to model the information heterogeneity resulting from the differences in TIS access and accuracy. \emph{Traffic Information Systems}. Prior work has studied the effects of TIS on travelers' departure time choices (\cite{arnott1991does}, and \cite{khan2018bottleneck}), and on their route choices (\cite{ben1991dynamic}, \cite{ben1996impact}). In particular, the paper \cite{mahmassani1991system} used simulation approach to show that as more travelers receive information, the informed travelers gradually start facing higher costs and their relative value of being informed diminishes. Our analysis, when applied to the game with one uninformed population and other more informed ones, also leads to similar conclusion. Our results are more general because they are applicable to routing games with multiple heterogeneously informed populations with arbitrary TIS accuracies. \emph{Value of Information}. In a classical paper, \cite{blackwell1953equivalent} showed that for a single decision maker, more informative signal always results in higher expected utility. In game-theoretic settings, it is generally difficult to determine whether the value of information in equilibrium for individual players and/or society is positive, zero or negative (see \cite{hirshleifer1971private}, and \cite{haenfler2002social}). However, the value of information is guaranteed to be positive when certain conditions are satisfied; see for example \cite{neyman1991positive}, and \cite{lehrer2006restrictions}. Since travelers are non-atomic players in our game, the relative value of information between any two TISs is equivalent to the value of information for an individual traveler when her subscription changes unilaterally. We give precise conditions on the population sizes under which the value of information in our Bayesian routing game is positive, zero, or negative. \section{General Properties of Equilibrium Outcome}\label{sec:general_cost} In this section, we first extend our approach of pairwise comparison of populations to study how the equilibrium outcome depends on population sizes in general. Then, we analyze the TIS adoption rates in situations where travelers can choose information subscription. \subsection{Size-Independence of Edge Load Vector}\label{sub:equilibrium_edge} Our analysis in Section \ref{equilibrium_regime} showed that if perturbations in the relative sizes of any two populations $\i, \j \in \playerSet$ induce a middle regime $\Lambda_2^{ij}$, then the equilibrium outcome in this regime is independent of the sizes of the perturbed populations $\i$ and $\j$. A natural question to ask is whether this result can be generalized; i.e., can we find a set of size vectors for which the equilibrium edge load does not depend on the size of \emph{any} population? The answer is affirmative. We now explicitly characterize the set of size vectors, denoted $\Lambda^{\dagger}$, for which the edge load is size-independent. Since \eqref{opt_l} is a convex optimization problem, and \eqref{prime:popu_i} are the only size-dependent constraints, we can equivalently view $\Lambda^{\dagger}$ as the set of size vectors for which all the IICs can be dropped from \eqref{opt_l} without changing its optimal value. Hence, for any $\lambda \in \Lambda^{\dagger}$, the optimal value of \eqref{opt_l} is identical to that of the following convex optimization problem: \begin{equation}\label{eq:drop_all} \begin{split} \min \quad &\widehat{\potential}(\l), \quad s.t. \quad \text{\eqref{sub:balance}, \eqref{sub:ldemand} and \eqref{sub:l_positive}}. \end{split} \end{equation} Let us denote the optimal solution set of \eqref{eq:drop_all} as $\mathcal{F}^{\dagger}$. Analogous to Theorem \ref{q_opt}, one can argue that any optimal solution $\l^{\dagger} \in \mathcal{F}^{\dagger}$ induces a unique edge load $w^{\dagger}$, obtained from \eqref{eq:q_w}. Thus, $\mathcal{F}^{\dagger}$ can be written as the convex polytope: \begin{align}\label{eq:Ldag_polytope} \mathcal{F}^{\dagger}= \left\{\l \left \vert \begin{array}{l} \text{$\l$ satisfies \eqref{sub:balance}, \eqref{sub:ldemand}, \eqref{sub:l_positive}, and $\sum_{\r \ni \e} \load_{\path}(\t)=w^{\dagger}_\e(\t), \quad \forall \e \in \E, \quad \forall \t \in \playerTypeSet$} \end{array} \right. \right\}. \end{align} Furthermore, since any route flow in the set $\mathcal{F}^{\dagger}$ satisfies the constraints \eqref{sub:balance}-\eqref{sub:l_positive} -- but not necessarily \eqref{prime:popu_i} constraints -- and also attains the optimal value of \eqref{opt_l}, we must have that for any $\lambda \in \Lambda^{\dagger}$, $\mathcal{F}^{*}(\lambda) \subseteq \mathcal{F}^{\dagger}$. Therefore, for each $\lambda \in \Lambda^{\dagger}$, there must exist a $\l^{\dagger} \in \mathcal{F}^{\dagger}$ that is an equilibrium route flow, i.e. at least one $\l^{\dagger} \in \mathcal{F}^{\dagger}$ satisfies the \eqref{prime:popu_i} constraints corresponding to $\lambda$: \begin{align}\label{eq:intermediate} \Lambda^{\dagger}\stackrel{\Delta}{=}\left\{\lambda \left \vert \sum_{\i \in \playerSet} \lamb^{\i} =1; \quad \lamb^{\i} \geq 0, \text{ } \forall \i \in \playerSet; \quad \text{$\exists \l^{\dagger} \in \mathcal{F}^{\dagger}$ s.t. } \widehat{J}^{i}(\l^{\dagger}) \leq \lamb^{\i} \totalDemand, \quad \forall \i \in \playerSet \right.\right\} \end{align} The following proposition shows the properties of equilibrium edge load and the value of potential function in the set $\Lambda^{\dagger}$: \begin{proposition}\label{theorem:intermediate} The set $\Lambda^{\dagger}$ is convex, and attains the minimum of $\Psi(\lamb)$, i.e. $\Lambda^{\dagger}=\argmin_{\lambda}\Psi(\lamb)$. The equilibrium edge load vector $w^{*}(\lambda)$ is size-independent, and is equal to $w^{\dagger}$ if and only if $\lambda \in \Lambda^{\dagger}$. \end{proposition} This result shows that some of the properties of $\Psi(\lamb)$ and the change of equilibrium edge load vector under pairwise perturbation (Proposition \ref{bathtub}) also hold for the more general case of perturbation in sizes of multiple populations. \input{implement} \subsection{Equilibrium Route Flows} Our main question of interest is how the set of BWE $\mathcal{\Q}^{*}(\lambda)$, i.e. optimal solution set of \eqref{eq:potential_opt}, and more importantly, the equilibrium edge load $w^{*}(\lambda)$, change with the perturbations in the size vector $\lambda$. However, characterizing the effect of $\lambda$ directly from \eqref{eq:potential_opt} is not so straightforward. Recall that in the simple routing game in Section \ref{motivate}, the effects of perturbations in $\lambda$ on the equilibrium route flow are relatively easier to describe in comparison to the effects on the set of equilibrium strategy profile --- the equilibrium route flow remains fixed in a certain range of $\lambda$, whereas the set of equilibrium strategy profiles do not. Thus, our approach involves studying how $\lambda$ affects the set of equilibrium route flows. We show two results in this regard: (i) The set of feasible route flows and the set of feasible strategy profiles that induces a particular route flow can be both expressed as polytopes (Proposition \ref{Lprime}); (ii) The set of equilibrium route flows is the optimal solution set of a convex optimization problem (Proposition \ref{l_opt}). These results enable us to evaluate how the equilibrium edge load and population costs change with perturbations in $\lambda$. Let us start by introducing the set of route flows \[\mathcal{F}(\lambda) \stackrel{\Delta}{=} \{\l \in \mathbb{R}^{|\routeSet| \times |\playerTypeSet|} \left \vert \text{$\l$ satisfies \eqref{sub:balance}-\eqref{sub:popu_i}} \right.\},\] where the constraints are given by: \begin{footnotesize} \begin{subequations}\label{eq:Lprime} \begin{align} \load_{\path}(t^i, \playerType^{-\player})- \load_{\path}(\tilde{t}^{\i}, \playerType^{-\player})&= \load_{\path}(t^i, \tilde{\t}^{-\i})-\load_{\path}(\tilde{t}^{\i}, \tilde{\t}^{-\i}), \quad \forall \r \in \routeSet, \text{ } \forall t^i, \tilde{t}^{\i} \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti], \text{and } \forall \playerType^{-\player}, \tilde{\t}^{-\i} \in \playerTypeSet^{-\player}, \forall \i \in \playerSet,\label{sub:balance}\\ \sum_{\r \in \routeSet} \load_{\path}(\t)&=D, \quad \forall \t \in \playerTypeSet, \label{sub:ldemand}\\ \load_{\path}(\t) &\geq 0, \quad \forall \r \in \routeSet, \quad \forall \t \in \playerTypeSet, \label{sub:l_positive}\\ \totalDemand-\sum_{\r \in \routeSet}\min_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]}\load_{\path}(t^i, \playerType^{-\player}) &\leq \lamb^{\i} \totalDemand, \quad \forall \playerType^{-\player} \in \playerTypeSet^{-\player}, \quad \forall \i \in \playerSet. \label{sub:popu_i} \end{align} \end{subequations} \end{footnotesize} The constraints \eqref{sub:balance}-\eqref{sub:l_positive} do not depend on the size vector $\lambda$ and can be understood as follows: \eqref{sub:balance} captures the fact that the change in the flow through any route resulting from change in the type of population $\i \in \playerSet$ does not depend on the particular types of the remaining populations; \eqref{sub:ldemand} ensures that all the demand $\totalDemand$ is routed through the network; and \eqref{sub:l_positive} guarantees that the demand assigned to any route is nonnegative. On the other hand, the constraints in \eqref{sub:popu_i} depend on the size vector $\lambda$, wherein the size of each population $\i \in \playerSet$, $\lamb^{\i}$, appears linearly in the constraint corresponding to that population. To further interpret \eqref{sub:popu_i}, we define the ``impact of information'' for any given population as the maximum extent to which the signal received from its TIS can influence the routing behavior of travelers within the population. Specifically, for any strategy profile $\strat \in \stratSet(\lambda)$ and population $\i \in \playerSet$, we define the \emph{impact of information} on population $\i \in \playerSet$ as follows: \begin{align}\label{eq:mdi} J^i(\strat) \stackrel{\Delta}{=} \lambda^i \totalDemand -\sum_{\r \in \routeSet}\min_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \strat_{\path}^{\player}(\ti). \end{align} Using \eqref{sub:demand}, we can re-write \eqref{eq:mdi} as: $J^i(\strat)=\sum_{\r \in \routeSet} \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]}\(q^i_r(\widehat{t}^{i})-q^i_r(t^i)\)$, where $\widehat{t}^{i}$ is an arbitrary type in $\T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]$. That is, for each population $\i \in \playerSet$, $J^i(\strat)$ is the summation over all routes of the maximum difference between the demands assigned to each route $\r$ by the type $\widehat{t}^{i}$ and any other type $t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]$. Using \eqref{eq:load}, we can alternatively express this metric in terms of the flow $\l$ induced by $\strat$: \begin{equation}\label{widehatj} \begin{split} \widehat{J}^{\i}(\l)& \equiv J^i(\strat) \stackrel{\eqref{eq:load}}{=} \sum_{\r \in \routeSet} \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]}(\load_{\path}(\widehat{t}^{i}, \widehat{t}^{-i})-\load_{\path}(t^i, \widehat{t}^{-i}))\stackrel{\eqref{sub:ldemand}}{=}\totalDemand-\sum_{\r \in \routeSet} \min_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \load_{\path}(t^i, \widehat{t}^{-i}), \end{split} \end{equation} where $(\widehat{t}^{i}, \widehat{t}^{-i})$ is any type profile in $\playerTypeSet$. Now the constraints \eqref{sub:popu_i} can be equivalently stated as: \begin{subequations} \begin{align} \widehat{J}^{i}(\l) &\leq \lamb^{\i} \totalDemand, \quad \forall \i \in \playerSet. \tag{IIC} \label{prime:popu_i} \end{align} \end{subequations} These constraints ensure that the impact of signals on any population's strategy is bounded by its size. We will refer to them as information impact constraints (IIC). We use \eqref{prime:popu_i} and \eqref{sub:popu_i} interchangeably, and refer the constraint in \eqref{prime:popu_i} corresponding to population $\i \in \playerSet$ as (\ref{prime:popu_i}$_\i$). Also, it is easy to see that for each $\i \in \playerSet$, (\ref{prime:popu_i}$_\i$) can be written as a set of affine inequalities: \begin{align}\label{affine_popu_i} \totalDemand-\sum_{\r \in \routeSet}\load_{\path}(t^i_\r, \widehat{\t}^{-\i}) &\leq \lamb^{\i} \totalDemand, \quad \forall t^i_1 \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti], \dots, \forall t^i_{|\routeSet|} \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]. \end{align} Thus, $\mathcal{F}(\lambda)$ is a convex polytope. The following proposition relates the set of feasible strategy profiles and the induced route flows \begin{proposition}\label{Lprime} The set of feasible route flows is the convex polytope $\mathcal{F}(\lambda)$. Furthermore, for a given route flow $\l \in \mathcal{F}(\lambda)$, any feasible strategy profile $\strat\in \stratSet(\lambda)$ that induces $\l$ can be expressed as: \begin{align}\label{eq_rep} \strat_{\path}^{\player}(\ti)&=\load_{\path}(t^i, \widehat{\t}^{-\i})-\load_{\path}(\widehat{\t}^{\i}, \widehat{\t}^{-\i})+\chi_\r^{\i}, \quad \forall \r \in \routeSet, \quad \forall t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti], \quad \forall \i \in \playerSet, \end{align} where $\widehat{\t}=\(\widehat{\t}^{\i}\)_{\i \in \playerSet}$ is any type profile in $\playerTypeSet$, and $\chi=\(\chi_{\r}^{\i}\)_{\r \in \routeSet, \i \in \playerSet}$ satisfies the following constraints: \begin{subequations}\label{X} \begin{align} \sum_{\r \in \routeSet} \chi_\r^\i&=\lamb^{\i} \totalDemand, \quad \forall \i \in \playerSet, \label{sub:x_sum}\\ \sum_{\i \in \playerSet} \chi_{\r}^{\i}& =\load_{\path}( \widehat{\t}), \quad \forall \r \in \routeSet,\label{sub:sum_demand}\\ \chi_\r^\i & \geq \max_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \(\load_{\path}(\widehat{\t}^{\i}, \widehat{\t}^{-\i})-\load_{\path}(t^i, \widehat{\t}^{-\i}) \), \quad \forall \r \in \routeSet, \quad \forall \i \in \playerSet.\label{sub:x_bound} \end{align} \end{subequations} \end{proposition} The proof of this proposition is comprised of three steps: In Step I, we show that any route flow that is induced by a feasible strategy profile must satisfy constraints \eqref{sub:balance}-\eqref{sub:popu_i}. In Step II, we show the converse: for any given $\l$, any feasible strategy profile $\strat$ that induces it must be given by \eqref{eq_rep}, where $\chi$ is a vector satisfying \eqref{X}. In Step III, we prove that if $\l$ satisfies \eqref{sub:balance}-\eqref{sub:popu_i}, then we can indeed construct a vector $\chi$ that satisfies \eqref{X}, and the corresponding $\strat$ in \eqref{eq_rep} is a feasible strategy profile that induces $\l$. By combining Steps II and III, we can conclude that any $\l$ satisfying \eqref{sub:balance}-\eqref{sub:popu_i} can be induced by at least one feasible strategy profile, and thus is a feasible route flow. The next proposition provides a characterization of the set of equilibrium route flows, and is analogous to Theorem \ref{q_opt} which characterizes the set of equilibrium strategy profiles. \begin{proposition} \label{l_opt} A feasible route flow $\l \in \mathcal{F}(\lambda)$ is an equilibrium route flow if and only if $\l$ is an optimal solution of the following convex optimization problem: \begin{equation}\tag{OPT-$\mathcal{F}$}\label{opt_l} \begin{split} \min \quad &\widehat{\potential}(\l), \quad s.t. \quad \l \in \mathcal{F}(\lambda), \end{split} \end{equation} where $\mathcal{F}(\lambda)$ is the set of feasible route flow vectors, which satisfy constraints \eqref{sub:balance} -- \eqref{sub:popu_i} \end{proposition} We denote the set of equilibrium route flows $\l^{*}$ in the game $\game$ as $\mathcal{F}^{*}(\lambda)$. From Theorem \ref{q_opt}, equations \eqref{eq:q_w} and \eqref{eq:potential_q}, we know that for any size vector $\lambda$, and any $\q^{*} \in \mathcal{\Q}^{*}(\lambda)$, any $\l^{*} \in \mathcal{F}^{*}(\lambda)$, \begin{equation}\label{Psi} \Psi(\lamb) = \Phi(\q^{*})=\widehat{\potential}(\l^{*}) =\widecheck{\potential}(w^{*}(\lambda)). \end{equation} Propositions \ref{Lprime} and \ref{l_opt} form the basis of our analysis of how the perturbations of size vector effects the equilibrium structure and population costs. \section{Value of Information in Bayesian Congestion Games}\label{motivate} Consider a network of two parallel routes, denoted $\r_1$ and $\r_2$. The network state belongs to the set $\S=\{\a, \mathbf{n}\}$, where the state $\a$ represents an incident on $\r_1$, and the state $\mathbf{n}$ represents the nominal condition, see Fig. \ref{two_route}. The state $\a$ occurs with probability $p$. The route cost functions are defined as follows: \vspace{-5mm} \begin{multicols}{2} \begin{equation*}\label{affine_cost} \begin{split} c_1^s(\l_{1})&=\left\{ \begin{array}{ll} \alpha_1^{\a} \l_{1} +b_1, & \state=\a,\\ \alpha_1^{\n} \l_{1} +b_1, & \state=\mathbf{n}. \end{array} \right.\\ c_2(\l_{2})&=\alpha_2 \l_{2}+b_2, \end{split} \end{equation*} \columnbreak \begin{figure}[H] \centering \includegraphics[width=0.8 \linewidth]{network1.jpg} \caption{Two Route Network.} \label{two_route} \end{figure} \end{multicols} \vspace{-7mm} where $\l_\r$ is the flow through route $\r$. For simplicity, we assume that $\alpha_1^{\n}<\alpha_2 <\alpha_1^{\a}$ and $b_1=b_2\stackrel{\Delta}{=} b$. The network faces a unit demand comprising of two traveler populations: population 1 with demand $\lambda^1$ and population 2 with demand $\lambda^2=1-\lambda^1$. Each population $\i \in \playerSet=\{1,2\}$ receives a noisy observation (signal) $t^i$ of the network state from its information system. Thus, the signal space of population $\i$ is $\T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]=\{\a, \mathbf{n}\}$. We assume that population 1 receives the correct state with probability 1 (i.e. complete information), and population 2 receives signal $\a$ or $\mathbf{n}$ with probability $0.5$, independent of the state (i.e. no information); this information structure is common knowledge. Let $\strat^{\player}_1(t^i)$ denote the demand assigned to $\r_1$ by population $\i$ when receiving signal $t^i$; the remaining demand $\(\lambda^i-\strat^{\player}_1(t^i)\)$ is assigned to $\r_2$. Since signal $\t^2$ is independent of the state, we have $\strat^2_1(\a)=\strat^2_1(\mathbf{n}) \stackrel{\Delta}{=} \strat^2_1$. Any feasible demand assignment must satisfy the constraints: $0 \leq \strat^1_1(\t^1) \leq \lambda^1 $ and $0 \leq \strat^2_1 \leq \lambda^2$. We represent a feasible strategy profile as $q_1=\(\strat^1_1(\a), \strat^1_1(\mathbf{n}), \strat^2_1\)$. The expected route cost on $\r$ for population 1 receiving signal $\t^1$, denoted $\mathbb{E}[\cfun_{\r}(\q)|\tone]$, can be expressed as follows: \vspace{-5mm} \begin{align*} \mathbb{E}[\cfun_{1}({\q_1})|\tone]&=\left\{ \begin{array}{ll} c_1^\a \(\strat^1_1(\a)+\strat^2_1\), \quad & \t^1=\a,\\ c_1^\n \(\strat^1_1(\mathbf{n})+\strat^2_1\), \quad & \t^1=\mathbf{n}. \end{array} \right.\\ \mathbb{E}[\cfun_{2}({\q_1})|\tone]&=c_2 (1 -\strat^1_1(\t^1)-\strat^2_1), \quad \forall \t^1 \in \playerTypeSet^1. \end{align*} For population 2, the expected route costs $\mathbb{E}[\cfun_{\r}(\q_1)|\ttwo]$ can be expressed as: \begin{align*} \mathbb{E}[\cfun_{1}({\q_1})|\ttwo]&=p \cdot c_1^\a\(\strat^1_1(\a)+\strat^2_1\)+ (1-p) \cdot c_1^\n \(\strat^1_1(\mathbf{n})+\strat^2_1)\),\\ \mathbb{E}[\cfun_{2}({\q_1})|\ttwo]&=p \cdot c_2 ( 1-\strat^1_1(\a)-\strat^2_1)+(1-p) \cdot c_2 ( 1-\strat^1_1(\mathbf{n})-\strat^2_1). \end{align*} This routing game with heterogeneously informed populations admits a Bayesian Wardrop equilibrium as defined in Sec. \ref{sub:game}. Let $\q^{*}_1=\(\strat^{1*}_1(\a), \strat^{1*}_1(\mathbf{n}), \strat^{2*}_1 \)$ denote an equilibrium. Note that each population - given the signal it receives - assigns all the demand on one route, or splits on both routes. Thus, there are $3\times 3 \times 3=27$ possible cases. Our results enable us to study how the equilibrium strategies and route flows change as the population size $\lambda^1$ varies from 0 to 1. In particular, there exists a threshold $0 \leq \underline{\lamb}^1 \leq 1$ of population 1's demand, which distinguishes two equilibrium regimes, i.e. the equilibrium structure is different depending on whether $\lambda^1 \in [0, \underline{\lamb}^1)$ or $\lambda^1 \in [\underline{\lamb}^1, 1]$. For this example, we have $\underline{\lamb}^1&\stackrel{\Delta}{=} \alpha_2\(\frac{1}{\alpha_1^{\n}+\alpha_2} -\frac{1}{\alpha_1^{\a}+\alpha_2}\)$. In the first regime, i.e. if $\lambda^1 \in [0, \underline{\lamb}^1)$, the game admits a unique equilibrium: \vspace{-3mm} \begin{align*} \strat^{1*}_1(\a)&=0 \notag\\ \strat^{1*}_1(\mathbf{n})&=\lambda^1 \notag\\ \strat^{2*}_1&=\frac{\alpha_2}{\bar{\alpha}_1+\alpha_2}-\lambda^1\frac{(1-p) (\alpha_1^{\n}+\alpha_2)}{\bar{\alpha}_1+\alpha_2}\notag \end{align*} where $\bar{\alpha}_1=p\alpha_1^{\a}+(1-p)\alpha_1^{\n}$. This regime corresponds to the following case: \[\mathbb{E}[c_1(\q^{*})|\a] >\mathbb{E}[c_2(\q^{*})|\a], \quad \mathbb{E}[c_1(\q^{*})|\mathbf{n}] <\mathbb{E}[c_2(\q^{*})|\mathbf{n}], \quad \mathbb{E}[c_1(\q^{*})|\t^2] =\mathbb{E}[c_2(\q^{*})|\t^2].\] Thus, in equilibrium, population 1 faces different route costs on each route. In particular, in state $\mathbf{n}$ (state $\a$), population 1 assigns all its demand on route $\r_1$ (resp. route $\r_2$), and population 2 splits its demand on both routes. The induced equilibrium flow on $\r_1$ is given by: $\l_1^{*}(\t^1, \t^2)=\strat^{2*}$ if $\t^1=\a$, and $\l_1^{*}(\t^1, \t^2)=\lambda^1+\strat^{2*}$ if $\t^1=\mathbf{n}$. In the second regime, i.e. if $\lambda^1 \in [\underline{\lamb}^1, 1]$, the set of equilibria can be represented as follows: \vspace{-3mm} \begin{equation*}\label{eq:q_two} \begin{split} \strat^{1*}_1(\a)&=\chi\\ \strat^{1*}_1(\mathbf{n})&=\underline{\lamb}^1+\chi\\ \strat^{2*}_1&=\frac{\alpha_2}{\alpha_1^{\a}+\alpha_2}-\chi, \end{split} \end{equation*} where $\max \left\{0, \lambda^1 -\frac{\alpha_1^{\a}}{\alpha_1^{\a} +\alpha_2}\right\} \leq \chi \leq \min \left\{\frac{\alpha_2}{\alpha_1^{\a}+\alpha_2}, \lambda^1 -\underline{\lamb}^1 \right\}$. Note that the equilibrium set is a connected set for $\lambda^1 \in (\underline{\lamb}^1, 1)$ and singleton set for $\lambda^1=\underline{\lamb}^1$ or $\lambda^1=1$, the equilibrium is unique. Any equilibrium in this regime satisfies: \[\mathbb{E}[c_1(\q^{*})|\a] =\mathbb{E}[c_2(\q^{*})|\a], \quad \mathbb{E}[c_1(\q^{*})|\mathbf{n}] =\mathbb{E}[c_2(\q^{*})|\mathbf{n}], \quad \mathbb{E}[c_1(\q^{*})|\t^2] =\mathbb{E}[c_2(\q^{*})|\t^2],\] i.e. each population faces equal route costs. Consequently, each population splits its demand on both routes. Furthermore, all equilibria induce a unique route flow that is independent of $\lambda$: $\l_1^*(\t^1, \t^2)=\frac{\alpha_2}{\alpha_1^{\a}+\alpha_2}$ if $\t^1=\a$, and $ \l_1^*(\t^1, \t^2)=\frac{\alpha_2}{\alpha_1^{\n}+\alpha_2}$ if $\t^1=\mathbf{n}$. Notice that if $\lambda^1 \in [0, \underline{\lamb}^1)$, we have $\strat_1^{*1}(\mathbf{n})-\strat^{1*}_1(\a)=\lambda^1$, i.e. population 1 shift all its demand from $\r_1$ to $\r_2$ on receiving incident information. However, if $\lambda^1 \in [\underline{\lamb}^1, 1]$, we have $\strat_1^{*1}(\mathbf{n})-\strat^{1*}_1(\a)=\underline{\lamb}^1\leq \lambda^1$, i.e. information only influences part of population 1's demand. In other words, information maximally impacts population 1 in the first regime, and only partially in the second regime. Now, we can calculate the expected equilibrium costs, denoted $C^{\i*}(\lamb)$. If $\lambda^1 \in [0, \underline{\lamb}^1)$, $C^{1*}(\lamb)$ can be written as follows: \begin{align*} C^{1*}(\lamb)&=p \mathbb{E}[\cfun_{2}({\q_1})|\a] + (1-p) \mathbb{E}[\cfun_{1}({\q_1})|\n] \notag =b+\bar{C}+\bar{C}^1 \lambda^1\\ C^{2*}(\lamb)&=\mathbb{E}[\cfun_{1}({\q_1})|\ttwo] =\mathbb{E}[\cfun_{2}({\q_1})|\ttwo] \notag =b+\bar{C}+\bar{C}^2\lambda^2, \end{align*} where \vspace{-3mm} \begin{align*} \bar{C}&=\frac{\alpha_2(\alpha_1^{\n}(1-p^2)+\alpha_1^{\a} p^2)}{\bar{\alpha}_1+\alpha_2},\\ \bar{C}^1&=\frac{p(1-p)\alpha_1^{\n}(\alpha_1^{\a}+\alpha_2)+p(1-p)\alpha_2(\alpha_1^{\n}+\alpha_2)}{\bar{\alpha}_1+\alpha_2},\\ \bar{C}^2&=\frac{\alpha_2 p(1-p)(\alpha_1^{\a}-\alpha_1^{\n})}{\bar{\alpha}_1+\alpha_2}. \end{align*} Since $C^{2*}(\lamb)-C^{1*}(\lamb)=\bar{C}^2 \lambda^2-\bar{C}^1\lambda^1>0$, population 1 gains by receiving information in comparison to population 2 which is uninformed. Furthermore, $\underline{\lamb}^1$ is the threshold size of population 1 at which this gain becomes 0. On the other hand, if $\lambda^1 \in [\underline{\lamb}^1, 1]$, the expected cost of both populations are identical in equilibrium, because each population faces equal route costs: \begin{align*} C^{1*}(\lamb)=C^{2*}(\lamb)=b+\bar{C}+\frac{\bar{C}^1 \bar{C}^2}{\bar{C}^1+\bar{C}^2}. \end{align*} The relative value of information $V^{*}(\lamb)$, which is the difference of two population costs in equilibrium can be obtained as follows: \begin{align*} V^{*}(\lamb)&\stackrel{\Delta}{=} C^{2*}(\lamb)-C^{1*}(\lamb) =\left\{ \begin{array}{ll} \frac{1}{\bar{\alpha}_1+\alpha_2} p\(1-p\)\left[\alpha_2(\alpha_1^{\a}-\alpha_1^{\n})-\lambda^1(\alpha_1^{\a}+\alpha_2)(\alpha_1^{\n}+\alpha_2)\right], & \quad \lambda^1 \in [0, \underline{\lamb}^1),\\ 0, & \quad \lambda^1 \in [\underline{\lamb}^1, 1]. \end{array} \right. \end{align*} Thus, $V^{*}(\lamb)$ monotonically decreases in the first regime, and remains 0 in the second regime. Finally, the equilibrium average cost is simply the average expected cost in equilibrium: \vspace{-3mm} \begin{align*} C^{*}(\lamb)=\lambda^1 C^{1*}(\lamb)+\lambda^2 C^{2*}(\lamb) =\left\{ \begin{array}{ll} \(\bar{C}^1+\bar{C}^2\)(\lambda^1)^2-2 \bar{C}^2\ \lambda^1+\bar{C}+b+\bar{C}^2, & \quad \forall \lambda^1 \in [0, \underline{\lamb}^1),\\ b+\bar{C}+\frac{\bar{C}^1 \bar{C}^2}{\bar{C}^1+\bar{C}^2}, & \quad \forall \lambda^1 \in [\underline{\lamb}^1, 1]. \end{array} \right. \end{align*} Note that $C^{*}(\lamb)$ monotonically decreases with $\lambda^1$ in the first regime, and attains a fixed (minimum) value in the second regime. To see this, for $\lambda^1 \in [0, \underline{\lamb}^1)$, we can write: \begin{align*} \frac{\partial C^{*}(\lamb)}{\partial \lambda^1}=2 \(\bar{C}^1+\bar{C}^2\) \lambda^1 - 2\bar{C}^2<0, \end{align*} and thus $\frac{\partial C^{*}(\lamb)}{\partial \lambda^1}=0$ when $\lambda^1=\underline{\lamb}^1$. Thus, increasing the size of informed population decreases the average cost but only when it is below $\underline{\lamb}^1$. We illustrate the aforementioned results using the following parameters: $\alpha_1^{\n}=1$, $\alpha_1^{\a}=3$, $\alpha_2=2$, $b=20$, and $p=0.2$. Fig. \ref{fig:H_75_L_50_D_1_stra} shows the equilibrium strategy $\(\strat^{1*}_1(\a), \strat^{1*}_1(\mathbf{n}), \strat^{2*}_1 \)$, the flow through route $\r_1$ in each state, and also the expected population costs and average cost in equilibrium. The costs are normalized by the socially optimum cost, denoted $C^{so}$, which is the minimum cost achievable by a fully informed social planner, averaged over both states. \begin{figure}[h!] \begin{subfigure}[b]{0.45\textwidth} \includegraphics[width=\textwidth]{strategy.eps} \caption{} \label{fig:H_100_L_50_D_1_q} \end{subfigure} ~ \centering \begin{subfigure}[b]{0.45\textwidth} \includegraphics[width=\textwidth]{flow.eps} \caption{} \label{fig:H_100_L_50_D_1_f} \end{subfigure}\\ \begin{subfigure}[b]{0.45\textwidth} \includegraphics[width=\textwidth]{ind_mot.eps} \caption{} \label{fig:H_100_L_50_D_1_p} \end{subfigure} ~ \centering \begin{subfigure}[b]{0.45\textwidth} \includegraphics[width=\textwidth]{social.eps} \caption{} \label{fig:H_100_L_50_D_1_s} \end{subfigure} \caption{(a) Equilibrium strategies; (b) Equilibrium route flows;\\ (c) Equilibrium population costs; (d) Equilibrium average cost.} \label{fig:H_75_L_50_D_1_stra} \end{figure} For this simple example, we evaluated the effect of varying $\lambda^1$ on the equilibrium structure, population costs and average cost in equilibrium. \section{Motivating Example}\label{motivate} In this section, we motivate our analysis using a simple game of two asymmetrically informed traveler populations routing over a network of two parallel routes, denoted $\r_1$ and $\r_2$. The network state $\state$ belongs to the set $\S=\{\a, \mathbf{n}\}$, where the state $\a$ represents an incident condition on $\r_1$, and the state $\mathbf{n}$ represents the nominal condition. The state $\a$ occurs with probability $p \in (0, 1)$. The network faces a unit size of demand ($\totalDemand=1$), which is comprised of two traveler populations: population 1 with size $\lambda^1$ and population 2 with size $\lambda^2=1-\lambda^1$. Each population $\i \in \playerSet=\{1,2\}$ receives a signal $t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]=\{\a, \mathbf{n}\}$ from its TIS. Assume for simplicity that population 1 receives the correct state with probability 1 (i.e. complete information), and population 2 receives signal $\a$ or $\mathbf{n}$ with probability $0.5$, independent of the state (i.e. no information). Let $\strat^{\player}_1(t^i)$ denote the traffic demand assigned to route $\r_1$ by population $\i$ when receiving signal $t^i$; the remaining demand $\(\lambda^i-\strat^{\player}_1(t^i)\)$ is assigned to route $\r_2$. Since the signal $\t^2$ is independent of the state, we have $\strat^2_1(\a)=\strat^2_1(\mathbf{n}) \stackrel{\Delta}{=} \strat^2_1$. A feasible demand assignment must satisfy the constraints: $0 \leq \strat^1_1(\t^1) \leq \lambda^1 $ and $0 \leq \strat^2_1 \leq \lambda^2$. For this example, we can represent a routing strategy profile as $q_1=\(\strat^1_1(\a), \strat^1_1(\mathbf{n}), \strat^2_1\)$. We denote the aggregate route flow on $\r$ as $\load_{\path}$. We consider simple affine cost functions: the cost of $r_1$ is $c_1^{\a}(\l_{1})=\alpha_1^{\a} \l_{1} +b$ in state $\a$, and $c_1^{\mathbf{n}}(\l_{1})=\alpha_1^{\n} \l_{1} +b$ in state $\mathbf{n}$; the cost of $r_2$ is $c_2(\l_{2})=\alpha_2 \l_{2}+b$. The slopes satisfy $\alpha_1^{\n}< \alpha_2<\alpha_1^{\a}$. Since population 1 has complete information, its travelers know the exact cost function in both states. However, since population 2 travelers are uninformed, they make their route choices based on the expected cost of each route, evaluated according to the prior distribution of states. This routing game with heterogeneously informed traveler populations admits a Bayesian Wardrop equilibrium, as discussed in Section \ref{model_environment}. Let $\q^{*}_1=\(\strat^{1*}_1(\a), \strat^{1*}_1(\mathbf{n}), \strat^{2*}_1 \)$ denote an equilibrium strategy profile. Each population, given the signal it receives, can either assign all its demand on one of the two routes, or splits on both routes. Thus, there are $3^3=27$ possible cases. Our results can be used to study how the equilibrium strategies and route flows change as the size of a population varies from 0 to 1. Detailed analysis for this simple routing game and some interesting variants are available in \cite{wu2017informational}. Specifically, we find that there exists a threshold size of population 1, $0 < \underline{\lamb}^1=\alpha_2\(\frac{1}{\alpha_1^{\n}+\alpha_2} -\frac{1}{\alpha_1^{\a}+\alpha_2}\) < 1$, such that the qualitative structure of equilibrium routing strategies is different based on whether $\lambda^1 \in [0, \underline{\lamb}^1)$ or $\lambda^1 \in [\underline{\lamb}^1, 1]$. In the first regime, i.e. when $\lambda^1 \in [0, \underline{\lamb}^1)$, the game admits a unique equilibrium: $\strat^{1*}_1(\a)=0$, $\strat^{1*}_1(\mathbf{n})=\lambda^1, \text{ and } \strat^{2*}_1=\frac{\alpha_2}{\bar{\alpha}_1+\alpha_2}-\lambda^1\frac{(1-p) (\alpha_1^{\n}+\alpha_2)}{\bar{\alpha}_1+\alpha_2}$, where $\bar{\alpha}_1=p\alpha_1^{\a}+(1-p)\alpha_1^{\n}$. This equilibrium regime corresponds to the following outcome: in state $\mathbf{n}$ (resp. state $\a$), population 1 assigns all its demand on route $\r_1$ (resp. route $\r_2$), and population 2 splits its demand on both routes. The induced equilibrium flow on $\r_1$ is given by $\l_1^{*}=\strat^{2*}_1$ if $\t^1=\a$, and $\l_1^{*}=\lambda^1+\strat^{2*}_1$ if $\t^1=\mathbf{n}$. On the other hand, in the second regime, i.e. when $\lambda^1 \in [\underline{\lamb}^1, 1]$, the equilibrium set may not be singleton, and can be represented as follows: $\strat^{1*}_1(\a)=\chi$, $\strat^{1*}_1(\mathbf{n})=\underline{\lamb}^1+\chi, \text{ and } \strat^{2*}_1=\frac{\alpha_2}{\alpha_1^{\a}+\alpha_2}-\chi$, where $\max \left\{0, \lambda^1 -\frac{\alpha_1^{\a}}{\alpha_1^{\a} +\alpha_2}\right\} \leq \chi \leq \min \left\{\frac{\alpha_2}{\alpha_1^{\a}+\alpha_2}, \lambda^1 -\underline{\lamb}^1 \right\}$. Thus, the equilibrium set is a one-dimensional interval for $\lambda^1 \in (\underline{\lamb}^1, 1)$, and a singleton set for $\lambda^1=\underline{\lamb}^1$ or $\lambda^1=1$. In this regime, both populations face identical expected route costs in equilibrium. Consequently, each population splits its demand on both routes. Moreover, the equilibrium route flow on each route is unique and independent of $\lambda^{1}$: $\l_1^*=\frac{\alpha_2}{\alpha_1^{\a}+\alpha_2}$ if $\t^1=\a$, and $ \l_1^*=\frac{\alpha_2}{\alpha_1^{\n}+\alpha_2}$ if $\t^1=\mathbf{n}$. Notice that when $\lambda^1 \in [0, \underline{\lamb}^1)$, we have $\strat_1^{1*}(\mathbf{n})-\strat^{1*}_1(\a)=\lambda^1$, i.e. population 1 shifts all its demand to $\r_2$ when receiving the signal about the incident on $\r_1$. However, if $\lambda^1 \in [\underline{\lamb}^1, 1]$, we have $\strat_1^{1*}(\mathbf{n})-\strat^{1*}_1(\a)=\underline{\lamb}^1 < \lambda^1$, i.e. the change in the received signal only influences a part of travelers in population 1. One can say that the information impacts the entire demand of population 1 in the first regime, but not in the second regime. For any feasible $\lambda =\(\lambda^{1}, \lambda^{2}\)$, we can calculate the equilibrium population costs, denoted $C^{\i*}(\lamb)$. If $\lambda^1 \in [0, \underline{\lamb}^1)$, it is easy to check that $C^{2*}(\lamb)-C^{1*}(\lamb)>0$, i.e. when the state information is only available to a small fraction of travelers, the informed travelers have an advantage over the uninformed ones. On the other hand, if the size of informed population exceeds the threshold $\underline{\lamb}^1$, then $C^{1*}(\lambda)=C^{2*}(\lambda)$. In this case, all travelers face identical cost in equilibrium. We illustrate the aforementioned results in Fig. \ref{fig:H_75_L_50_D_1_stra} using the following parameters: $\alpha_1^{\n}=1$, $\alpha_1^{\a}=3$, $\alpha_2=2$, $b=20$, and $p=0.2$. The costs are normalized by the socially optimal cost, denoted $C^{so}$, which is the minimum cost achievable by a social planner with complete information of the state. Our subsequent analysis considers more general settings with multiple (heterogeneous and possibly correlated) information systems and general network topology. \begin{figure}[H] \begin{subfigure}[b]{0.32\textwidth} \includegraphics[width=\textwidth]{strategy.eps} \caption{} \label{fig:H_100_L_50_D_1_q} \end{subfigure} ~ \begin{subfigure}[b]{0.32\textwidth} \includegraphics[width=\textwidth]{flow.eps} \caption{} \label{fig:H_100_L_50_D_1_f} \end{subfigure} ~ \begin{subfigure}[b]{0.32\textwidth} \includegraphics[width=\textwidth]{ind_mot.eps} \caption{} \label{fig:H_100_L_50_D_1_p} \end{subfigure} \caption{Effects of varying population 1 size on equilibrium structure and costs: (a) Population strategies, (b) Flow on route $r_1$, (c) Population costs.} \label{fig:H_75_L_50_D_1_stra} \end{figure} \input{network_model} \input{bayesian_game} \section{Model}\label{model_environment} \subsection{Environment} \label{network} To generalize the simple routing game in Section \ref{motivate}, we consider a transportation network modeled as a directed graph. For ease of exposition, we assume that the network has a single origin-destination pair. All our results apply to networks with multiple origin-destination pairs; see Sec \ref{appendix_D}. Let $\E$ denote the set of edges and $\routeSet$ denote the set of routes. The finite set of network states, denoted $\S$, represents the set of possible network conditions, such as incidents, weather, etc. The network state, denoted $\state$, is randomly drawn by a fictitious player ``Nature'' from $\S$ according to a distribution $\theta \in \Delta(\S)$, which determines the prior probability of each state. For any edge $\e \in \E$ and state $\state \in \S$, the state-dependent edge cost function $\cfun_{\e}^{\s}(\cdot)$ is a positive, increasing, and differentiable function of the load through the edge $\e$. The state can impact the edge costs in various ways. The network serves a set of non-atomic travelers with a fixed total demand $\totalDemand$. We assume that each traveler is subscribed exclusively to one of the TIS in the set $\playerSet=\{1, \cdots, I\}$. We refer to the set of travelers subscribed to the TIS $\i \in \playerSet$ as population $\i$. All travelers within a population receive an identical signal from their TIS. Let $\lamb^{\i}$ denote the ratio of population $\i$'s size and the total demand $\totalDemand$. We also consider degenerate situations when the sizes of one or more populations approach 0. Thus, a vector of population sizes $\lambda = \(\lambda^1, \dots, \lambda^{I}\)$ satisfies $\sum_{\i \in \playerSet} \lamb^{\i} =1$ and $\lamb^{\i} \geq 0$ for any $\i \in \playerSet$. The size vector $\lambda$ is considered as given in our analysis of equilibrium structure and costs (Sections \ref{Sec:potential_game} and \ref{equilibrium_regime}). In Section \ref{sec:general_cost} we consider a more general situation where $\lambda$ results from the travelers' TIS subscription choices. Each TIS $\i \in \playerSet$ sends a noisy signal $t^i$ of the state to population $\i$. The signal received by each population determines its type (private information). We assume that the type space of population $\i$ is a finite set, denoted as $\T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]$. Note that the type spaces $\T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]$ and the state space $\S$ need not be of the same size. Let $\t \stackrel{\Delta}{=} \(\t^1, \t^2, \dots, \t^{I}\)$ denote a type profile, i.e. vector of signals received by the traveler populations; thus, $\t \in \playerTypeSet\stackrel{\Delta}{=} \prod_{\i \in \playerSet} \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]$. The joint probability distribution of the state $\state$ and the vector of signals $\t$ is denoted $\pi \in \Delta(\S \times \playerTypeSet)$, and it is the common prior of the game. The marginal distribution of $\pi$ on states is consistent with the common prior, i.e. $\sum_{\t \in \playerTypeSet} \pi(\state, \t)=\theta(\state)$ for all $\state \in \S$. The conditional probability of type profiles $\t$ on the state $\state$ is given by $p(\t|\state)=\frac{\pi(\state, \t)}{\theta(\state)}$, i.e. the joint distribution of signals received by the populations when the network state is $\state$. In our modeling environment, the signals of different TIS can be correlated, conditional on the state. \section{Extensions and discussions}\label{sec:optimization} In this section, we discuss the extension of our results when the following model aspects are included: non-decreasing edge cost functions, networks with multiple origin-destination pairs, and TISs which minimize the cost of subscribed populations. \noindent \emph{Non-decreasing edge cost functions.} Our results hold in games where the edge costs are non-decreasing (rather than strictly increasing) in the edge loads. In particular, such a game still admits the same weighted potential function as in \eqref{eq:potential_q}, although now the essential uniqueness only applies to the equilibrium edge costs, rather than the loads. All results in Secs. \ref{equilibrium_regime} and \ref{sec:general_cost} remain unchanged for non-decreasing cost functions. However, under pairwise perturbation of size vector, the edge load vector $w^{\i \j, \dagger}$ induced by the optimal flow vectors of \eqref{eq:basic_opt_ij} is no longer unique. Therefore, each regime threshold as in \eqref{pairwise_threshold} is the optimal solution of a bi-level optimization problem, which is more complicated from a computational viewpoint. \noindent \emph{Networks with multiple origin-destination pairs.} Consider a network with the set of origin-destination (o-d) pairs $\mathcal{K}$, where each o-d pair $k \in \mathcal{K}$ is connected by a set of routes $\routeSet_k$. The demand of travelers between each o-d pair $k \in \mathcal{K}$ is $D_k > 0$, and the fraction of travelers between o-d pair $k$ who subscribe to TIS $i \in \playerSet$ is $\lambda_k^i$. In equilibrium, travelers between each o-d pair choose routes with the minimum expected cost among all routes between that o-d pair. Equation \eqref{eq:potential_q} is still the weighted potential function of the game, and hence Theorem \ref{q_opt} still holds. Propositions \ref{Lprime} and \ref{l_opt} hold with simple modifications: the demand constraint \eqref{sub:ldemand} is satisfied for each $k \in \mathcal{K}$, i.e. $\sum_{\r \in \routeSet_k} f_r(\t)=\totalDemand_k$, and the information impact constraint \eqref{sub:popu_i} is satisfied for each $k \in \mathcal{K}$ and $\i \in \playerSet$, i.e. $ D_k - \sum_{r \in \routeSet_k} \min_{t^i \in \playerTypeSet^i} f_{r}(t^i, t^{-i}) \leq \lambda_k^i \totalDemand_k$. All the results on qualitative properties of equilibrium structure, relative ordering of average costs of travelers, and adoption rates remain unchanged for travelers between each o-d pair. In particular, for any $k \in \mathcal{K}$ and any $\i, \j \in \playerSet$, when perturbing the sizes $\lambda_k^i$ and $\lambda_k^j$, three regimes (one or two may be empty) can be distinguished by whether or not the information impacts all the travelers between o-d pair $k$ who subscribe to TIS $i$ (resp. $j$). Moreover, by analogously applying sensitivity analysis, we show that the relative value of information, now defined as the travel cost saving experienced by travelers between o-d pair $k$ who subscribe to TIS $i$ compared with travelers who subscribe to TIS $j$, is positive, zero, and negative in the three regimes respectively. We also analyze how travelers between each o-d pair $k \in \mathcal{K}$ choose TIS subscription. We note that the relative value of information and adoption rates for travelers between one o-d pair depends on the sizes and the route choices of populations between the same o-d pair as well as between other o-d pairs. This is because travelers between different o-d pairs may take common routes and edges, and hence impact each other’s costs. \noindent \emph{Cost minimizing TISs.} Our analysis approach and results can be instantiated to a modified game, where each TIS aims at minimizing the total cost of their subscribed traveler population based on the private information of the unknown state. That is, in the modified game, the players are the TISs (instead of the traveler populations in the original game), who send direct routing recommendations to their subscribed travelers based on the heterogeneous information of the unknown state. Travelers are not strategic, and always follow the recommended routes even though the costs of these routes may not be the minimum. To distinguish the modified game from the original game, we denote the strategy profile in the modified game as $\tilde{q}$, and the load vector as $\tilde{w}$. In equilibrium, the routing strategy of TIS $\i$ with type $t^i$ minimizes the total cost of population $i$ based on the private belief and the strategies of all other TISs, i.e. \begin{align}\label{eq:opt_i} \tilde{\strat}^{\i*}(t^i) \in \argmin_{\tilde{\strat}^i(t^i)} \sum_{\state \in \S} \sum_{\playerType^{-\player} \in \playerTypeSet^{-\player}} \belief^i(\state, \tmi|\ti) \sum_{\r \in \routeSet} \(\sum_{\e \in \r} \cfun_{\e}^{\s}(\tilde{w}_e(t^i, \playerType^{-\player}))\) \tilde{\strat}^{\i}_\r(t^i), \quad \forall \i \in \playerSet, \quad \forall t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti], \end{align} where $\tilde{w}_e(t^i, \playerType^{-\player})= \sum_{\r \ni \e} \(\sum_{\j \in \playerSet \setminus \{\i\}}\tilde{\strat}^{j*}_r(\t^j)+ \tilde{\strat}^{\i}_\r(t^i)\)$ is the aggregate edge load on edge $\e$. We now show that the equilibrium strategy profile can be solved by an optimization problem. To ensure the uniqueness of the equilibrium load vector, we assume that the total cost of each edge $w_{\e} \cfun_{\e}^{\s}(w_{\e})$ is strictly convex in $w_{\e}$ for all $\e \in \E$ and all $\state \in \S$. \begin{proposition}\label{prop:modified} A strategy profile $\tilde{q}^{*} \in \stratSet(\lambda)$ is an equilibrium strategy profile of the modified game if and only if it minimizes the expected total cost of all travelers: \begin{equation}\label{eq:modified_potential} \min \quad \mathbb{E}[C(\tilde{q})] \stackrel{\Delta}{=} \sum_{\state \in \S} \sum_{\t \in \playerTypeSet} \sum_{\e \in \E} \pi(\state, \t) \tilde{w}_e(\t) \cdot \cfun_{\e}^{\s}(\tilde{w}_e(\t)), \quad s.t. \quad \tilde{q} \in \stratSet(\lambda), \end{equation} where $\tilde{w}(\t)$ is the induced load vector, and $\stratSet(\lambda)$ is the set of feasible strategy profiles. The equilibrium edge load vector $\tilde{w}^{*}(\lambda)$ is unique. \end{proposition} \proof{Proof of Proposition \ref{prop:modified}.} First, we compute the first order derivative of $\mathbb{E}[C(\tilde{q})]$ with respect to $\tilde{q}_r^i(t^i)$ as follows: \begin{align}\label{eq:derivative} \frac{\mathbb{E}[C(\tilde{q})] }{\partial \tilde{\strat}_{\r}^i(t^i)}= \sum_{\state \in \S} \sum_{\playerType^{-\player} \in \playerTypeSet^{-\player}} \sum_{\e \in \r} \pi(\state, t^i, \playerType^{-\player}) \(\cfun_{\e}^{\s}(\tilde{w}_e(t^i, \playerType^{-\player}))+ \tilde{w}_e(t^i, \playerType^{-\player}) \frac{d \cfun_{\e}^{\s}(\tilde{w}_e(t^i, \playerType^{-\player}))}{d \tilde{w}_e(t^i, \playerType^{-\player})}\) \end{align} We define a modified cost function $\tilde{c}_e^s\(\tilde{w}_e\(t^i, \playerType^{-\player}\)\) \stackrel{\Delta}{=} \cfun_{\e}^{\s}(\tilde{w}_e(t^i, \playerType^{-\player}))+ \tilde{w}_e(t^i, \playerType^{-\player}) \frac{d \cfun_{\e}^{\s}(\tilde{w}_e(t^i, \playerType^{-\player}))}{d \tilde{w}_e(t^i, \playerType^{-\player})}$ for all $\e \in \E$ and all $\state \in \S$. Hence, the first-order derivative in \eqref{eq:derivative} equals to the expected cost of route $\r\in \routeSet$ as in \eqref{eq:ecrti}, but with the modified cost function, i.e. $\frac{\mathbb{E}[C(\tilde{q})] }{\partial \tilde{\strat}_{\r}^i(t^i)}= \mathbb{E}[\tilde{c}_r(\tilde{\strat})|t^i]$. Next, since for any $\e \in \E$, $\t \in \playerTypeSet$, and $\state \in \S$, $\tilde{w}_e(\t) \cdot \cfun_{\e}^{\s}(\tilde{w}_e(\t))$ is strictly convex in $w_{\e}(\t)$, analogous to Lemma \ref{lemma:potential_convex}, we know that the objective function $\mathbb{E}[C(\strat)]$ in \eqref{eq:modified_potential} is convex in $\strat$. Then, analogous to the proof of Theorem \ref{q_opt}, we know that a strategy profile $\tilde{q}$ is an optimal solution of \eqref{eq:modified_potential} if and only if $\tilde{\strat}$ satisfies the following condition: \begin{align}\label{eq:modified_eq} \forall \r \in\routeSet, \quad \tilde{q}_r^i(t^i)>0, \quad \Rightarrow \quad \mathbb{E}[\tilde{c}_r(\tilde{\strat})|t^i] \leq \mathbb{E}[\tilde{c}_{r'}(\tilde{\strat})|t^i], \quad \forall \r' \in \routeSet, \quad \forall \i \in \playerSet, \quad \forall t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]. \end{align} Therefore, to prove Proposition \ref{prop:modified}, it remains to show that for any $\i \in \playerSet$ and any $t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]$, $\tilde{\strat}^i(t^i)$ minimizes the expected cost of population $\i$ as in \eqref{eq:opt_i} if and only if it satisfies the condition in \eqref{eq:modified_eq}. Since $\tilde{\strat}$ satisfies the feasibility constraint in \eqref{eq:feasible_q}, we can write the Lagrangian of \eqref{eq:opt_i} as follows: \begin{align*} \tilde{\mathcal{L}}(\tilde{q}^i(t^i), \tilde{\mu}^{t^i}, \tilde{\nu}_{r}^{t^i})=& \sum_{\state \in \S} \sum_{\playerType^{-\player} \in \playerTypeSet^{-\player}} \belief^i(\state, \tmi|\ti) \sum_{\r \in \routeSet} \(\sum_{\e \in \r} \cfun_{\e}^{\s}(\tilde{w}_e(t^i, \playerType^{-\player}))\) \tilde{\strat}^{\i}_\r(t^i) \\ &+ \tilde{\mu}^{t^i} \(\lamb^{\i} \totalDemand - \sum_{\r \in \routeSet} \tilde{\strat}_r^{\i}(t^i)\) - \sum_{\r \in \routeSet} \tilde{\nu}_{r}^{t^i} \tilde{\strat}_r^i(t^i). \end{align*} and the set of KKT conditions for the optimal solution as follows: \begin{subequations} \begin{align} \frac{\partial \tilde{\mathcal{L}}}{\partial \tilde{q}_r^i(t^i)} &= \sum_{\state \in \S} \sum_{\playerType^{-\player} \in \playerTypeSet^{-\player}} \belief^i(\state, \tmi|\ti)\( \sum_{\e \in \r} \cfun_{\e}^{\s}(\tilde{w}_e(t^i, \playerType^{-\player}))\)-\tilde{\mu}^{t^i} - \tilde{\nu}_{r}^{t^i} =0, \quad &\forall \r \in \routeSet, \\%\quad \forall t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti], \quad \forall \i \in \playerSet, \label{first_order}\\ \tilde{\nu}_{r}^{t^i} \tilde{q}_r^i(t^i) &= 0, \quad &\forall \r \in \routeSet, \\%\quad \forall t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti], \quad \forall \i \in \playerSet, \label{com_slack}\\ \tilde{\nu}_{r}^{t^i} &\geq 0, \quad &\forall \r \in \routeSet. \end{align} \end{subequations} Then, a strategy profile $\tilde{\strat}^{*}$ is the optimal solution of \eqref{eq:modified_potential} if and only if \hfill \Halmos \endproof Proposition \ref{prop:modified} shows that Note that the expected cost function $\mathbb{E}[C(\tilde{q})]$ can be viewed as the potential function of the modified game. Moreover, we can re-express $\mathbb{E}[C(\tilde{q})]$ as follows: \begin{align*} \mathbb{E}[C(\tilde{q})]= \sum_{\state \in \S} \sum_{\t \in \playerTypeSet} \sum_{\e \in \E} \pi(\state, \t) \int_{0}^{\sum_{\r \ni \e} \sum_{\i \in \playerSet} \tilde{\strat}^{\i}_\r(t^i)} \(\cfun_{\e}^{\s}(z) + z \cdot \frac{d \cfun_{\e}^{\s}(z)}{d z}\) dz. \end{align*} That is, the potential function of the modified game can be obtained from the potential function $\Phi(\tilde{q})$ of the original game as in \eqref{eq:potential_q} by substituting the original cost function $\cfun_{\e}^{\s}(\tilde{w}_e)$ with the total marginal cost function $\frac{d \(\tilde{w}_e \cdot \cfun_{\e}^{\s}(\tilde{w}_e)\)}{d \tilde{w}_e} = \cfun_{\e}^{\s}(\tilde{w}_e)+ w_{\e} \cdot \frac{d \cfun_{\e}^{\s}(\tilde{w}_e)}{d \tilde{w}_e}$ for all $\e \in \E$ and all $\state \in \S$. Therefore, in equilibrium, travelers take routes with the minimum marginal cost (instead of the original cost function), which leads to minimizing the expected total cost of all travelers. Following the same approach as in Secs. \ref{Sec:potential_game} -- \ref{equilibrium_regime}, we characterize the three regimes induced by the perturbation of relative sizes of any pair of populations, and compare the average costs of the perturbed populations in each regime. The values of the regime boundaries given by \eqref{pairwise_threshold} in the modified game will be different from that in the original game since we use a modified potential game as in \eqref{eq:modified_potential}. Furthermore, analogous to Sec. \ref{sec:general_cost}, we characterize the set of population sizes $\tilde{\Lambda}^{\dagger}$, where the value of the potential function in equilibrium is the minimum across all $\lambda$, and all travelers experience the same average costs in equilibrium. Interestingly, since the potential function in the modified game is the expected total cost of all travelers, the impact of $\lambda$ on the value of potential function is equivalent to the impact on the equilibrium cost of all travelers. Therefore, we can conclude that the total cost of all travelers is minimized when $\lambda \in \tilde{\Lambda}^{\dagger}$. \color{black} \subsection{Equilibrium Strategy Profiles}\label{sub:weighted_potential} Following \cite{sandholm2001potential}, the game $\game$ is a weighted potential game if there exists a continuously differentiable function $\Phi: \stratSet(\lambda) \rightarrow \mathbb{R}$ and a set of positive, type-specific weights $\{\gamma(t^i)\}_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti], \i \in \playerSet}$ such that: \begin{equation}\label{potential_def} \frac{\partial \Phi(q(\t))}{\partial \strat_{\path}^{\player}(\ti)}=\gamma(t^i) \mathbb{E}[\cfun_{\r}({\q})|\ti], \quad \forall \r \in \routeSet, \quad \forall t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti], \quad \forall \i \in \playerSet. \end{equation} We show that our game $\game$ is a weighted potential game. \begin{lemma}\label{potential_lemma} Game $\game$ is a weighted potential game with the potential function $\Phi$ as follows: \begin{equation}\label{eq:potential_q} \Phi\(q\) \stackrel{\Delta}{=} \sum_{\state \in \S} \sum_{\e \in \E} \sum_{\t \in \playerTypeSet} \pi \(\state, \t\) \int_{0}^{\sum_{\r \ni \e} \sum_{\i \in \playerSet} \strat_{\path}^{\player}(\ti)} \cfun_{\e}^{\s}(z) dz, \end{equation} and the positive type-specific weight is $\gamma(t^i) = \mathrm{Pr}(t^i)$ for any $t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]$ and any $\i \in \playerSet$. \end{lemma} Using \eqref{eq:load} and \eqref{eq:q_w}, $\Phi$ can be equivalently expressed as a function of the route flow $\l$ or the edge load $w$ induced by a strategy profile $\strat \in \stratSet(\lambda)$: \begin{align} \widehat{\potential}(\l) &\stackrel{\Delta}{=} \sum_{\state \in \S} \sum_{\e \in \E} \sum_{\t \in \playerTypeSet} \pi \(\state, \t\) \int_{0}^{\sum_{\r \ni \e}\load_{\path}(\t)} \cfun_{\e}^{\s}(z) dz \label{eq:potential_l}\\ \widecheck{\potential}(w) &\stackrel{\Delta}{=} \sum_{\state \in \S} \sum_{\e \in \E} \sum_{\t \in \playerTypeSet} \pi \(\state, \t\) \int_{0}^{w_{\e}(\t)} \cfun_{\e}^{\s}(z) dz. \label{eq:potential_w} \end{align} Thus, for any feasible strategy profile $\strat \in \stratSet(\lambda)$, we can write $\Phi (\strat) \equiv \widehat{\potential}(\l) \equiv \widecheck{\potential}(w)$, where $\l$ and $w$ are the route flow and edge loads induced by the strategy profile $\strat$. In addition, $\widecheck{\potential}(w)$ satisfies the following property: \begin{lemma}\label{lemma:potential_convex} The function $\widecheck{\potential}(w)$ is twice continuously differentiable and strictly convex in $w$. \end{lemma} Our first result provides a characterization of the set of equilibrium strategy profiles: \begin{theorem}\label{q_opt} A strategy profile $\strat \in \stratSet(\lambda)$ is a BWE if and only if it is an optimal solution of the following convex optimization problem: \begin{equation}\tag{OPT-$\stratSet$}\label{eq:potential_opt} \min \quad \Phi(\strat), \quad s.t. \quad \strat \in \stratSet(\lambda), \end{equation} where $\stratSet(\lambda)$ is the set of feasible strategy profiles. The equilibrium edge load vector $w^{*}(\lambda)$ is unique. \end{theorem} The existence of BWE follows directly from Theorem \ref{q_opt}. For any size vector $\lambda$, we denote the set of BWE for the game $\game$ as $\mathcal{\Q}^{*}(\lambda)$. Importantly, since the equilibrium edge load $w^{*}(\lambda)$ is unique, the equilibrium population cost $C^{\i*}(\lamb)$ for each population $\i \in \playerSet$ in \eqref{eq:population_cost_def} must also be unique for any $\lambda$. Thus, the equilibria of $\game$ can be viewed as \emph{essentially unique}. We denote the optimal value of \eqref{eq:potential_opt}, i.e. the value of the weighted potential function $\Phi(\strat)$ in equilibrium as $\Psi(\lamb)$. The Lagrangian of \eqref{eq:potential_opt} that we use in proving Theorem \ref{q_opt} is given as follows: \begin{equation}\label{lagrangian} \mathcal{L}(q, \mu, \nu, \lambda)=\Phi(q)+\sum_{\i \in \playerSet} \sum_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]}\mu^{t^i}\(\lambda^i D - \sum_{\r \in \routeSet} \strat_{\path}^{\player}(\ti)\) -\sum_{\r \in \routeSet}\sum_{\i \in \playerSet} \sum_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]}\nu_{r}^{t^i} \strat_{\path}^{\player}(\ti), \end{equation} where $\mu=(\mu^{t^i})_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti], \i \in \playerSet}$ and $\nu=(\nu_{r}^{t^i})_{\r \in \routeSet, t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti], \i \in \playerSet}$ are Lagrange multipliers associated with the constraints \eqref{sub:demand} and \eqref{sub:non-negative}, respectively. The next lemma shows that for any BWE $\q^{*} \in \mathcal{\Q}^{*}(\lambda)$, the optimal Lagrange multipliers $\mu^{*}$ and $\nu^{*}$ in \eqref{lagrangian} associated with $\q^{*}$ are unique. \begin{lemma}\label{unique_lag} The Lagrange multipliers $\mu^{*}$ and $\nu^{*}$ at the optimum of \eqref{eq:potential_opt} are unique: \begin{subequations} \begin{align} \mu^{t^i *}&=\min_{\r \in \routeSet}\mathrm{Pr}(t^i) \mathbb{E}[\cfun_{\r}({\qwe})|\ti], \quad \forall t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti], \quad \forall \i \in \playerSet \label{define_al}\\ \nu_\r^{t^i *}&= \mathrm{Pr}(t^i) \mathbb{E}[\cfun_{\r}({\qwe})|\ti]-\mu^{t^i *}, \quad \forall \r \in \routeSet, \quad \forall t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti], \quad \forall \i \in \playerSet. \label{define_beta} \end{align} \end{subequations} \end{lemma} This result follows from the fact that \eqref{eq:potential_opt} satisfies the \emph{Linear Independence Constraint Qualification (LICQ)} condition (\cite{wachsmuth2013licq}), which ensures the uniqueness of Lagrange multipliers at the optimum of \eqref{eq:potential_opt}; see Lemma \ref{licq_lemma} for the statement of LICQ condition. The value of $\mu^{t^i*}$ relates the expected route costs for each type $t^i$ in equilibrium with the sensitivity analysis of the Lagrangian with respect to population sizes at the optimum of \eqref{eq:potential_opt}. We will use this result in Section \ref{equilibrium_regime} for studying the relative ordering of equilibrium population costs. \section*{Acknowledgement}The authors thank Daron Acemoglu, Tamer Başar, Alexandre Bayen, Sanjeev Goyal, Ali Jadbabaie, Patrick Jaillet, Ramesh Johari, Zaid Khan, Jeffery Liu, Michael Schwarz, Galina Schwartz, Max Shen, David Simchi-Levi, Demos Teneketzis, Pravin Varaiya, Adam Wierman, Muhamet Yildiz for suggestions. We deeply appreciate the feedback of two anonymous reviewers and Associate Editor who reviewed the first version. This work was supported by Google Faculty Research Award, NSF Grant No. 1239054 CPS Frontiers: Foundations Of Resilient CybEr-Physical Systems (FORCES), and NSF CAREER Award CNS 1453126. \bibliographystyle{plainnat} \subsection{Equilibrium Inefficiency}\label{social_value} Finally, we relate our work to the well-known result of \cite{roughgarden2012price} on inefficiency due to selfish routing. We first define a benchmark to compare to the equilibrium average cost as defined in \eqref{eq:average_cost_def}. Given any feasible strategy profile $\strat \in \stratSet(\lambda)$, we denote the average cost of all travelers as $C(\strat)\stackrel{\Delta}{=} \frac{1}{\totalDemand} \sum_{\i \in \playerSet}\sum_{t^i \in \T^{\i}}%\newcommand{\Ti}{\mathbb{E}[\cfun_{\r}(\q^{*})|\ti]} \mathrm{Pr}(t^i) \sum_{\r \in \routeSet} \mathbb{E}[\cfun_{\r}({\q})|\ti] \strat_{\path}^{\player}(\ti)$. For any feasible size vector $\lambda$, we define $C^{opt}(\lamb)$ as the minimum average cost over all feasible strategy profiles: \begin{align}\label{copt} C^{opt}(\lamb) \stackrel{\Delta}{=}\min_{\strat \in \stratSet(\lambda)} C(\strat). \end{align} Let $\q^{opt}(\lamb)$ denote a feasible strategy that attains the minimum average cost. It is clear that $C^{opt}(\lamb)$ is a trivial lower bound of $C^{*}(\lamb)$ for any size vector $\lambda$. The cost $C^{opt}(\lamb)$ can be seen as the average cost minimized by an ``informationally constrained'' social planner who routes the demand of each population $\i \in \playerSet$ according to $\strat^{\i,opt}$ based on the population's private signal, but not knowing the network state or signals received by the other populations. Therefore, the benchmark $C^{opt}(\lamb)$ is the minimum average cost in the same asymmetric information environment as the game $\game$, and the inefficiency caused by the selfish routing can be evaluated by the ratio $C^{*}(\lamb) /C^{opt}(\lamb)$. By straightforward extension of the well-known result in \citet{roughgarden2004bounding} on the worst-case inefficiency in complete information congestion games, we obtain a tight upper bound of $C^{*}(\lamb)/C^{opt}(\lamb)$ in our information environment for any size vector $\lambda$, see Proposition \ref{pigou_bound}. Note that one can consider socially optimal cost, denoted $C^{so}$, as an alternative benchmark to $C^{opt}(\lamb)$. As defined in \eqref{cso_def}, $C^{so}$ is the minimum average cost achieved by a fully informed social planner, i.e. the one who knows the true state and seeks to minimize the average cost over all nature states. Clearly, given any size vector $\lambda$, $C^{so} \leq C^{opt}(\lamb) \leq C^{*}(\lamb)$. This ratio $C^{*}(\lamb)/C^{so}$ represents the combined loss of efficiency due to selfish routing as well as information incompleteness about the network state. In general, the ratio is hard to analyze due to the complexity of heterogeneous information environment; see \cite{roughgarden2012price} for conditions under which this ratio can be analyzed. However, since our focus is on evaluating the inefficiency due to selfish routing, we simply adopt $C^{opt}(\lamb)$ as our benchmark. The next proposition provides a condition on the edge cost functions for which there is no inefficiency due to selfish routing, and consequently, one achieves a stable socially fair, and efficient outcome when $\lambda \in \Lambda^{\dagger}$. \begin{proposition}\label{homo_bathtub} For any $\state \in \S$ and any $\e \in \E$, if the edge cost functions in game $\game$ can be written as $\cfun_{\e}^{\s}(w_{\e})=h_e^s(w_{\e})+b_e^s$, where $h_\e^\state$ is a homogeneous function with degree $k>1$, and $\{b_e^s\}_{\e \in \E, \state \in \S}$ satisfies $\sum_{\e \in \r} b_e^s =b^\state$, for any $\state \in \S$, and any $\r \in \routeSet$, then $\frac{C^{*}(\lamb)}{C^{opt}(\lamb)}=1$ for any size vector $\lambda$. Furthermore, the minimum of the equilibrium average cost $C^{*}(\lamb)$ is achieved in the set $\Lambda^{\dagger}$, i.e. $\Lambda^{\dagger}= \argmin_{\lambda} C^{*}(\lamb)$. \end{proposition} The sufficient condition for this result restricts the edge cost functions to be comprised of a homogeneous function and a constant; in addition, the free flow travel times of all routes must be the same, although they can still be state-dependent. Under this condition, the average cost of all travelers $C(\strat)$ can be written as an affine transformation of the weighted potential function $\Phi(\strat)$. From Theorem \ref{q_opt}, we know that any BWE $\q^{*} \in \mathcal{\Q}^{*}(\lambda)$ minimizes the potential function $\Phi(\strat)$, and thus minimizes $C(\strat)$ as well. Hence, $ \frac{C^{*}(\lamb)}{C^{opt}(\lamb)}=1$ for any size vector $\lambda$. This result also implies that $C^{*}(\lamb)$ in \eqref{eq:average_cost_def} is a linear transformation of the value of the potential function in equilibrium, $\Psi(\lamb)$. Recalling that $\Lambda^{\dagger} = \argmin_{\lambda} \Psi(\lamb)$ from Lemma \ref{lemma_minimum_lambdag}, we can conclude that the routing game attains the minimum of the equilibrium average cost for any $\lambda \in \Lambda^{\dagger}$. \begin{example}\label{eq_average_cost} Fig. \ref{fig:soc_8_6_18_20_2} illustrates how $C^{*}(\lamb)$ and $C^{opt}(\lamb)$ vary with $\lambda$ for the routing game considered in Example \ref{benchmark_example}. In Fig. \ref{fig:soc_8_6_18_20_2}, The size vector $\lambda$ that minimizes $C^{*}(\lamb)$ lies in regime $\Lambda_1^{12}$. Fig. \ref{fig:soc_8_6_18_18_2} presents the same plot for the game in which $c_1^{n}(\l_1)=\l_1+20$, $c_1^{a}(\l_1)=3\l_1+20$; all other parameters remain unchanged. The sufficient condition in Proposition \ref{homo_bathtub} is satisfied in this case, so there is no inefficiency due to selfish routing. \end{example}
\section{INTRODUCTION}\label{sec:intro} \blfootnote{ \rule{0pt}{3ex} \copyright 2018 IEEE. Personal use of this material is permitted. Permission from IEEE must be obtained for all other uses, in any current or future media, including reprinting/republishing this material for advertising or promotional purposes, creating new collective works, for resale or redistribution to servers or lists, or reuse of any copyrighted component of this work in other works.} Understanding driver intent is a prerequisite for a personalised driving experience with features such as personalised risk assessment and mitigation, alerts, advice, automated rerouting, etc. One of the most important driver intentions is the destination of the journey and the route to get there. Furthermore, in particular for hybrid vehicles, knowledge of the route ahead of time can be used to optimise the charge/discharge schedule, e.g.~\cite{Deguchi2004} find improvements in fuel economy of up to 7.8\%. In the data used in~\cite{FroehlKrumm}, 60\% of trips are repeated and hence predictable from the driving history; \cite{Song1018} suggests that in the more general setting of user mobility, more than 90\% of a user's trajectories are ``potentially predictable.'' The combination of value and feasibility has sparked much research in this direction. While some algorithms rely on GPS trajectories only -- e.g.\ \cite{FroehlKrumm} computes geometric similarity between curves obtained from cleaned and filtered raw GPS data -- other approaches, such as~\cite{JulienRoutePred,SimmonsBrowningZhangEtAl2006,Krumm2008}, where Markov chains and hidden Markov models are built on the road network to estimate the most likely routes and destinations, next turns, or trip clusters in a broader sense, require map-matching to first map GPS traces to links in the road network. {The present paper falls into that latter category, as} it builds on and extends the recent work of~\cite{JulienRoutePred} and contributes to a novel and flexible approach to the important problem of driver intent prediction. It is structured as follows: after introducing some notation relating to probability, stochastic processes, and Markov chains in the next section, we then show in Section~\ref{sec:approach} how trips can be modelled as outputs of stochastic processes to obtain an estimate of the posterior probabilities of each known journey pattern. The algorithm resulting if Markov chains are used as the stochastic process models is described in detail in Section~\ref{sec:pred}, and Section~\ref{sec:exm} provides some experimental validation. We close with some possible extensions and improvements, and the observation that~\cite{JulienRoutePred} also fits into the presented framework, if the stochastic process model is chosen to be a naive Bayes model instead of Markov chains. \section{NOTATION}\label{sec:prelim} We \emph{should} write $P(W=w)$ for the probability of the event that a realisation of the discrete random variable $W$ equals $w$, and $P(W=w \mid V=v)$ the probability of that same event $W=w$ given that the event $V=v$ occurred. However, for convenience we will most of the time write $P(w \mid v)$ instead of $P(W=w \mid V=v)$, when it is clear from the context, what is meant. For a set of parameters $\mu$ parametrising a probability distribution, the notation $P(W=w \mid \mu)$ is taken to denote the probability of the event $W=w$ if the parameters are set to $\mu$. We let $\ensuremath{\mathbb{N}}=\{0,1,2,\dotsc\}$ denote the natural numbers, and for $N\in\ensuremath{\mathbb{N}}\setminus\{0\}$, $[N]\mathrel{\mathop:}=\{1,\dotsc,N\}$. Matrices will be denoted by capital letters, their elements by the same letter in lower case, and the set of $n\times n$ row-stochastic matrices, i.e.\ matrices with non-negative entries such that every row sums up to 1, by $\stoch^n$. We denote the cardinality of a set $S$, i.e.\ the number of its elements, by $\card S$. All cardinalities here will be finite. A \emph{stochastic process} is a sequence of random variables $\{X_t\}$ indexed by $t$, which often denotes time. For $t\in\ensuremath{\mathbb{N}}$, we call a sequence $(x_0,x_1,\dotsc,x_T)$ of realisations of the random variables $X_t$ a \emph{trajectory} of the process; $P(x_0,x_1,\dotsc,x_T \mid \mu)$ is the \emph{probability} of the trajectory given that the stochastic process is parametrised by $\mu$,\footnote{e.g.\ if $X_t$ corresponds to an unfair coin flip, $\mu$ would correspond to the probability $p$ of heads} whereas interpreted as a function of $\mu$, it is the \emph{likelihood} of the parameters being equal to $\mu$. Specifically, we will use \emph{Markov chains}, which are stochastic processes with $t\in\ensuremath{\mathbb{N}}$ and $X_t\in[N]$ that are completely defined by a \emph{transition (probability) matrix} $A\in\stoch^N$ and a vector $\pi\in\ensuremath{\mathbb{R}}^N$ of initial probabilities. Then, $P(X_0=i)=\pi_i$ and $P(X_t=j \mid X_{t-1}=i)=a_{ij}$ characterises the process. Note that the ``next state'' $X_{t}$ depends \emph{only} on the current realisation $x_{t-1}$ and not on the past; this is also know as the Markov property. This corresponds to a directed graph with $N$ nodes and weights $a_{ij}$ on the edge from node $i$ to $j$. The stochastic process defined by the Markov chain then corresponds to an agent being initialised on some node $i$ according to $\pi$ and making every decision where to go next according to the weights on the edges leading away from it. \section{PROBLEM SETTING AND FRAMEWORK}\label{sec:approach} From a driver's history $H$ of trips taken in the past, we want to learn a predictive model, allowing us to identify properties (such as destination or specific route) of a currently ongoing trip as soon into the trip as possible. The history is \begin{multline*} H = \Bigl\{ T_1: \{ (t^1_1,t^1_2,\dotsc,t^1_{L_1} ),(r^1_1,r^1_2,\dotsc,r^1_{L_1}) \}, \dotsc,\\ T_{N_H} : \{ (t^{N_H}_1,t^{N_H}_2,\dotsc,t^{N_H}_{L_{N_H}} ),( r^{N_H}_1,r^{N_H}_2,\dotsc,r^{N_H}_{L_{N_H}}) \} \Bigr\}, \end{multline*} where each \emph{trip} $T_i$ has length $L_i$ and consists of sequences $(t^i_1,\dotsc )$ and $(r^i_1,\dotsc )$ of \emph{time stamps} and \emph{road segments}. The road segments are identified by their OpenStreetMap (OSM) way IDs~\cite{wiki:way}, which implies that map matching has been performed on the raw GPS trajectories. We'll return to that point in Sec.~\ref{ssec:data}. Let \[ \Ell=\bigcup\nolimits_{i=1}^{N_H} \bigcup\nolimits_{t=1}^{L_i} \{r^i_t\} \qquad \text{ and } \qquad N=\card\Ell \] be the set and number of all road segments ever visited. Each trip in $H$ belongs to a \emph{cluster} $C_k$, where the cluster encodes the journey pattern, destination, or more generally ``properties'' of the trip. From now on, we shall use the more generic term ``cluster,'' as defined in~\cite{JulienRoutePred}; see also there for further explanations. A cluster could be as coarse as a collection of all trips $T_i$ with the same destination (defined as e.g.\ the last road segment of a trip), hence encoding only the property of destination, or more fine-grained, by defining a measure of similarity between trips and clustering according to those similarities; for instance trips along the ``scenic route to work'' and using the ``fastest route to work'' would then belong to different clusters despite sharing the same destination. More details are again postponed until the computational examples are described in Sec.~\ref{sec:exm}. Whichever way it is obtained, let us define this set of clusters by \begin{equation} C = \{C_1,\dotsc, C_{N_C} \}, \end{equation} and assume that $C_k$ is a partition of $H$, i.e.\ every trip belongs to \emph{exactly one} cluster. We can then state the problem more precisely as:\\[.5ex] \centerline{\begin{fbox}{\parbox{0.8\columnwidth}{Given an ongoing trip $T:\{ (t_1,\dotsc,t_L),(r_1,\dotsc,r_L) \}$, decide what cluster~$C_k$ trip $T$ belongs to.}} \end{fbox}}\\[.5ex] The proposed framework consists of a model for each cluster, providing a likelihood function $P( T \mid C_k)$, a prior probability $P(C_k)$, the Bayesian update to the posterior probabilities $P(C_k \mid T)$, and the criterion by which the prediction is made. The next sections elaborate on these parts. \subsection{Journeys as Stochastic Processes}\label{ssec:stochproc} Inspired by classical single-word speech recognition algorithms -- see e.g.\ the classic survey~\cite{Rabiner1989} -- where words are modelled as stochastic processes (for speech recognition frequently hidden Markov models), emitting sequences of vectors of spectral (and/or temporal) features derived from the acoustic speech signal, and the word corresponding to the stochastic process with the highest likelihood of having generated the present sequence is returned as the result, we propose to model journey patterns as stochastic processes emitting road links. The choice of the type of stochastic process is free, there can even be different kinds for different clusters; once a type is chosen, the parameters for each cluster $C_k$ have to be estimated from the trips in $H$ belonging to $C_k$. In other words, a model for each cluster is ``trained'' on the available history. The outcome of this training process is a mapping $(T,C_k)\mapsto P(T\mid C_k)$, i.e.\ a function that allows us to evaluate the likelihood for each cluster of it having produced the currently available sequence of road segments (and time stamps). Our choice of stochastic process here will be Markov chains, which are particularly easy to train and evaluate; the details are given in Sec.~\ref{ssec:MC}. \subsection{Prior Probabilities}\label{ssec:prior} Before a trip even started, there might already be a high probability of it belonging to a certain cluster: if you have Aikido class on Wednesdays at 19:00 o'clock, and the current trip started on a Wednesday at 18:30 o'clock, there's a very high probability that the trip's destination will be your dojo. More generally, all additional information available about the trip, such as the current day of the week, the weather, current public events etc.\ form the \emph{context} of the trip, and from the context, we can estimate the \emph{prior probabilities} $P(C_k)$ of each $C_k$ without any trip information yet available. In the absence of context, we can set $P(C_k)=\card\{i\mid T_i\in C_k\}/N_C$, i.e.\ make the prior proportional to how many trips in $H$ belonged to $C_k$, or even simply set $P(C_k)=1/N_C$ for all $j\in[N_C]$. \subsection{Bayesian Updates}\label{ssec:bayes} Bayes' law relates the quantity we are ultimately interested in -- the probability of the current trip belonging to $C_k$ given what we already know about the trip, i.e.\ $P(C_k \mid T)$ -- to the quantities estimated from $H$ -- the likelihood $P(T\mid C_k)$ and the prior $P(C_k)$ -- by \begin{equation} \label{eq:bayes} P(C_k\mid T) = \frac{P(T\mid C_k) P(C_k)}{P(T)}. \end{equation} A subtle point concerns the normalisation $P(T)$, the probability of the trip observed so far with no further assumptions on its nature: by computing the numerators $P(T\mid C_k) P(C_k)$ and then normalising them to sum up to one, i.e.\ by imposing \[ \sum\nolimits_{C_k \in C} P(C_k \mid T) = 1, \] we implicitly assume that every trip is indeed in one of the already known clusters. As a simple fix, we could introduce the probability of any trip not belonging to any known cluster as a constant $P(\neg {C})$, in which case we'd have $\sum_{C_k \in C} P(C_k \mid T) = 1-P(\neg C)$, simply a normalisation to a different constant. We proceed without accounting for unknown clusters, but keep this implicit assumption in mind. \subsection{Stopping Criterion}\label{ssec:stop} If, when, and how the updates should be stopped and the final prediction announced depends on the application. If the goal is route planning, we need to be reasonably certain of the unique destination before planning a route. On the other hand, if the goal is identifying risks along the remaining journey, it is sufficient to narrow down the set of possible routes and check for risks along all of them; predictions can be made continuously in this scenario. Other applications might call for other measures. Here, we apply the simple criterion that as soon as one of the clusters' posterior probabilities exceeds a threshold $P(C\mid T)>1-\alpha$, prediction stops and returns cluster $C$ as the result, which should work well for the first application. \section{CLUSTER PREDICTION ALGORITHM}\label{sec:pred} In order to derive a concrete algorithm for cluster prediction, a choice of statistical process model has to be made, and the models have to be trained. In this section, we describe this for the case of Markov chains. \subsection{Modelling Clusters as Markov Chains}\label{ssec:MC} Modelling clusters by Markov chains is, of course, a simplification of reality, but as we shall see it leads to a computationally very tractable algorithm and performs very well in our computational experiments in the next section. The simplifying assumption is the ``Markov assumption'': if the current trip belongs to a cluster $C_k$, the probability distribution of the next road segment\footnote{The capital ``$R$'' is used because it denotes a random variable.}$R_{t+1}$ depends \emph{only} on the current road segment $r_t$. More formally, the state space of the Markov chain is $[N]$, where $N$ is the total number of road segments in the road network under consideration. Every trip $T$, or rather its sequence $(r_1,\dotsc,r_L)$ of road segments, then corresponds to a trajectory of the Markov chain. If a trip belongs to a certain cluster $C_k$, e.g.\ ``scenic route from home to work,'' and if the trip so far has been $r_0,\dotsc,r_t$, then, in full generality, the probability distribution of the next road segment, given all that is known at $t$, is $P(R_{t+1}=r_{t+1} \mid r_0,\dotsc,r_t,C_k)$. In modelling this as a Markov chain, we are imposing that \begin{equation} P(R_{t+1}=j \mid r_0,\dotsc,r_{t-1},R_t=i,C_k) = P(R_{t+1}=j \mid R_t=i,C_k) = a^k_{ij}. \end{equation} Then, $A^k\in\stoch^N$ is the transition probability matrix of cluster $C_k$, and $a^k_{ij}$ is the probability to turn into road $j$ from road $i$, if the current trip is in cluster $C_k$. The transition probabilities are estimated by \begin{multline} \label{eq:MLA} a^k_{ij} = \frac{ \sum_{T_m \in C_k} \card\{ t \mid r^m_t=i, r^m_{t+1}=j \} }{ \sum_{T_m \in C_k} \card\{ t \mid r^m_t=i, t=1,\dotsc,L_m-1 \} } \\[1ex] =\frac{\text{number of transitions from $i$ to $j$ in $C_k$}}{\text{number of times $i$ is transitioned from in $C_k$}}. \end{multline} This very intuitive estimate is in fact the maximum-likelihood (ML) estimate, see e.g.~\cite{AndersonGoodman1957}. If a road segment $i$ never appears (or more precisely, is never transitioned from) in any trip in $C_k$, then~\eqref{eq:MLA} cannot be applied; for now, we can just set these $a^k_{ij}$ to 0, and return to this issue in Sec.~\ref{ssec:prank}. For the initial probabilities $\pi^k_i = P(R_0=i\mid C_k)$, the (ML) estimate is \begin{equation}\label{eq:MLpi} \pi^k_i = \frac{ \card\{ m \mid r^m_0=i \text{ and } T_m\in C_k \} }{ \card\{ m \mid T_m\in C_k \} }, \end{equation} but this assumes that the prediction task always starts at the beginning of a trip; if for whatever reason the first few links of a trip are missing in the data, this might lead to a failure of the prediction. E.g.\ by choosing \[ \pi^k_i = \begin{cases} \frac{1}{\card\{ j \mid r^m_t=j \text{ for any } t \text{ and any } T_m\in C_k\} }& \text{if $r^m_t=i$ for any $t$ and any $T_m\in C_k$} \\ 0 & \text{else, } \end{cases} \] i.e.\ making the initial probability uniform over all road segments that appear in the cluster, or even setting $\pi^k_i=1/N$ for all $i\in\Ell$, we avoid this problem and allow for prediction to start during a trip; we thus treat $\pi^k$ somewhat heuristically as a design parameter. The likelihood function is then given by \begin{equation}\label{eq:MClik} P( r_1, r_2, \dotsc, r_L \mid C_k) = \pi^k_{r_1} \prod_{t=2}^{L} a^k_{r_{t-1},r_{t}}, \end{equation} or recursively by \begin{equation}\label{eq:MClikrec} P( r_1, r_2, \dotsc, r_L \mid C_k) = P( r_1, r_2, \dotsc, r_{L-1} \mid C_k) a^k_{r_{L-1},r_{L}}. \end{equation} \begin{algorithm}[tbh] \begin{algorithmic}[1] \Procedure{Training}{$H$, $C$, $\epsilon>0$} \ForAll{$C_k \in C$} \State $(A^k,\pi^k) \gets$ by~\eqref{eq:MLA}, \eqref{eq:MLpi}, \eqref{eq:MLAprank} \EndFor \EndProcedure \Procedure{Prediction}{$A^k, \pi^k, P(C_k) \,\forall C_k\in C, \alpha, \bar{\epsilon}$} \Statex \emph{Initialization} \State $r_\text{to} \gets r_0$, $r_\text{from} \gets $ None \ForAll{$k=1,\dotsc,N_C$} \State $\ell_k \gets \pi^k_{r_0}$, $P_k \gets \ell_k P(C_k) /\sum_{j=1}^{N_C} P_j P(C_j)$ \EndFor \Statex \emph{Prediction loop} \While{$P_k\leq 1-\alpha \;\forall k$} \If{trip is finished} \State \textbf{return} None \Else \State wait until new segment $r_\text{new}$ is received \State $r_\text{from}\gets r_\text{to}$, $r_\text{to} \gets r_\text{new}$ \ForAll{$k=1,\dotsc, N_C$} \If{$r_\text{from} \notin\Ell \vee r_\text{to}\notin \Ell$} \State $\ell_k \gets \ell_k \cdot \bar{\epsilon}$ \Else \State $\ell_k \gets \ell_k \cdot a^k_{r_\text{from}\, r_\text{to}}$\label{algline:prank_here} \Comment{see Eq.~\eqref{eq:MClikrec}} \EndIf \State $\bar{P}_k \gets \ell_k \cdot P(C_k)$ \Comment{Bayesian update} \EndFor \ForAll{$k=1,\dotsc, N_C$} \State ${P}_k \gets \bar{P}_k/\sum_{j=1}^{N_C} \bar{P}_j$ \Comment{Normalization} \EndFor \EndIf \EndWhile \State \textbf{return} $\arg\max_k P_k$ \EndProcedure \end{algorithmic} \caption{Cluster prediction using Markov chains \label{alg:clustpred} \end{algorithm} \subsection{Unseen Transitions and Unseen Road Segments}\label{ssec:prank} When a transition that has never occurred in the training data occurs in the current trip to be predicted, the algorithm described so far will break down, because the likelihood $P( r_1, r_2, \dotsc, r_L \mid C_k)$ will drop to $0$ for all clusters $C_k$, and hence the posteriors $P( C_k \mid T)$ will be undefined as $0/0$. This will be a rather common situation: the data is not perfect, hence segments visited in reality could be missing in the data, GPS data could be mapped to the wrong way ID, small detours could take the driver along never before visited roads, etc. Similar to the PageRank algorithm~\cite{Page1999} and as in~\cite{JulienRoutePred}, we address this problem by introducing a small $\epsilon>0$ and adding it to \emph{each} transition probability (except self-loops, i.e.\ transitions $i\rightarrow i$), even the ones never observed. The matrices $A^k$ then have to be re-normalized to obtain stochastic matrices again, however now every probability $a^k_{ij}\geq \epsilon/(1+(N-1)\epsilon)>0$. Formally, for all $i\neq j$: \begin{align} \label{eq:MLAprank} \tld{a}^k_{ij} &= a^k_{ij}+\epsilon & a^k_{ij} &= \frac{\tld{a}^k_{ij}}{\sum_m \tld{a}^k_{im}}. \end{align} If the prediction algorithm receives a road segment that has never been seen, i.e.\ if $r_L\notin\Ell$, this is treated in much the same way by extending the likelihood function, or rather the transition probability matrices $A^k$, to assign a minimum probability $\epsilon/(1+(N+1)\epsilon)$ to transitions to or from unseen links. This can be addressed very easily in the code by inserting an \textbf{if} statement before updating the likelihood, but also formally: we add a state $u$ for ``unseen segment'' to $\Ell$ to obtain $\Ell^u=\Ell\cup\{u\}$, and add a column and row equal to $\bar{\epsilon}\mathrel{\mathop:}=\epsilon/(1+(N+1)\epsilon)$ to every $A^k$ (note that a transition from $u$ to $u$ is now allowed, as it corresponds to two previously unseen segments in sequence, and not necessarily a repetition of the current segment). Every link with an ID not in $\Ell$ is then mapped to $u$ before the likelihood is computed. Pseudocode of the full algorithm, including the modifications described here, is shown as Algorithm~\ref{alg:clustpred}. \section{COMPUTATIONAL EXPERIMENTS}\label{sec:exm} We now use the dataset in~\cite{JulienRoutePred} to test the proposed algorithm; a short description is given below, for more details, see~\cite{JulienRoutePred}. \begin{figure} \centering\includegraphics[width=.9\textwidth]{Figures/cross_validation_mesh} \caption{Failure rates and mean percentage of links needed to make a prediction after 8 rounds of 50-50 cross validation. Note the different view angles of the two axes.} \label{fig:results} \end{figure} \subsection{Data}\label{ssec:data} Seven origins and destinations across Dublin were selected, representing typical points of interest such as ``home,'' ``work,'' ``childcare,'' etc. This yields a total of 21 possible origin/destination pairs, for 17 of which up to 3 distinct routes were generated. These routes were then fed into the microscopic traffic simulator SUMO~\cite{SUMO2012} to generate a total of $N_H=781$ trips in the form of timestamps and longitude/latitude coordinates. To simulate real GPS data, uniformly distributed noise (on a disk of radius 10m) was added to each point. To prepare the data in the form of $H$ for our algorithm, the sequence of GPS points needs to be converted into a sequence of way IDs, which was done using the Map Matching operator of IBM Streams Geospatial Toolkit. Subsequently, duplicates were removed (i.e.\ if more than one consecutive GPS point was mapped to the same road segment, only the first instance was kept). \subsection{Clustering}\label{ssec:cluster} As in~\cite{JulienRoutePred}, we consider two types of clusters: \begin{itemize} \item \emph{by Origin/Destination:} Two trips belong to the same cluster, iff they have the same origin and destination (as defined by proximity on their final GPS coordinates). This results in $N_C=17$ clusters. \item \emph{by Route:} Similarity between two trips is measured by the ratio of shared road segments between the two trips and the total number of road segments in both trips. Hierarchical clustering is then performed, and the dissimilarity threshold is chosen to be 0.3, yielding $N_C=30$ clusters. \end{itemize} \subsection{Prediction Results}\label{ssec:res} \begin{figure}[tbh] \centering \parbox[b]{.48\textwidth}{ \centering \includegraphics[width=.48\textwidth]{Figures/Fig2.pdf} \caption{Failure rate and fraction of links needed for prediction vs confidence level $\alpha$ for fixed $\epsilon = 10^{-6}$ if clustering by Origin/Destination.} \label{fig:leave1:alpha:OD} } \hfill{} \parbox[b]{.48\textwidth}{ \centering \includegraphics[width=.48\textwidth]{Figures/Fig3.pdf} \caption{Failure rate and fraction of links needed for prediction vs confidence level $\alpha$ for fixed $\epsilon = 10^{-6}$ if clustering by Route.} \label{fig:leave1:alpha:Route} } \end{figure} \begin{figure}[tbh] \centering \includegraphics[width=.8\columnwidth]{Figures/Fig4.pdf} \caption{Failure rate and fraction of links needed for prediction vs $\epsilon$ for fixed $ \alpha=0.1$ if clustering by Origin/Destination (left) and Route (right).} \label{fig:leave1:eps} \end{figure} \begin{figure}[tbh] \centering \parbox[b]{.48\textwidth}{ \centering \includegraphics[width=.48\columnwidth]{Figures/Fig5.pdf} \caption{Decreasing failure rates as more trips are added to the training data for clustering by Origin/Destination and Route; $\alpha = 0.1$ and $\epsilon=10^{-6}$.} \label{fig:CaseCR1} } \hfill{} \parbox[b]{.48\textwidth}{ \centering {\includegraphics[width=.48\columnwidth]{Figures/Fig6.pdf}} \caption{Fraction of links needed as more trips are added to the training data for clustering by Origin/Destination and Route; $\alpha = 0.1$ and $\epsilon=10^{-6}$.} \label{fig:CaseCR2} } \end{figure} In all cases described below, we chose uniform probabilities for the prior $P(C_k)$ and initial probabilities $\pi^k$, i.e.\ $P(C_k)=1/N_C$ and $\pi^k_i=1/N$ $\forall k,i$. More careful choices could certainly improve prediction results, but as we shall see below, this simplest of choices is sufficient to demonstrate the efficacy of the algorithm. We collected two quantities of interest: the \textit{failure rate} as the number of false predictions (which includes cases where the end of a trip is reached without a prediction being made) divided by the number of all trips predicted, and the \textit{fraction of trip completed} at the time of prediction, i.e.\ \#(road segments visited){/}\#(total road segments in trip). If a wrong prediction was made, we recorded the amount of links needed as \textsl{NaN}; these points are then excluded from the computation of averages. In order to get an idea of good ranges for the parameters $\epsilon$ and $\alpha$, we performed a small initial \textbf{cross-validation} experiment by training on only 50\% of the data and then predicting the route of the remaining 50\%. This was done for 8 random choices of training and testing set, on a grid of values $(\alpha,\epsilon)\in \{10^{-4} , 0.001 , 0.1, 0.2 , 0.25 , 0.3 , 0.35 , 0.4\}\times\{10^{-7},10^{-5}, 0.001 , 0.005, 0.01, 0.1\}$. The results are shown in Fig.~\ref{fig:results} and indicate that the approach is robustly effective over a wide range of values for $\alpha$ and $\epsilon$: with parameters in a reasonable range, e.g.\ $\alpha\in[0.01,0.1]$ and $\epsilon\in[10^{-7},10^{-5}]$, the routes are predicted accurately in more than 99\% of the test cases within the first 20\% of the trip. The results also show ``breakdown points:'' if the confidence level $\alpha$ is increased to the point where a posterior probability of 0.6 is sufficient for prediction already, the amount of false predictions increases rapidly; on the other hand, if the small probability parameter $\epsilon$ is chosen so large that it dominates the probabilities estimated from data, the amount of links necessary to distinguish routes increases rapidly. To investigate further, we then performed \textbf{leave-one-out cross-validation} along two ``slices'' on a finer grid: for each of the $N_H=781$ trips, we trained the Markov chains on the remaining $N_H-1=780$ trips; then, the trip that was left out was predicted. This was done for $\epsilon=10^{-6}$ and a finer grid of values for $\alpha$, and for $\alpha=0.1$ and a finer grid of values for $\epsilon$. The entire procedure was repeated once for clustering by Origin/Destination, and once for clustering by Route. The results are shown in Figs.~\ref{fig:leave1:alpha:OD}-\ref{fig:leave1:eps}, and we observe: \begin{itemize} \item The prediction accuracy is very robust with respect to $\alpha$, the failure rate is below 1\% for a wide range of $\alpha$, and declines rapidly once a breakdown point of $\alpha\approx0.25$ is reached. \item The same goes for the percentage of links needed to make a correct prediction. Additionally we note that, as should be expected, lower confidence in prediction (i.e.\ larger values of $\alpha$) tends to lead to fewer links needed for prediction; however this effect only kicks in once the failure rate increases quickly. \item Predicting the origin and destination appears to be slightly easier, since it consistently requires fewer links to do so. This is not surprising as there are only 17 clusters to choose from, whereas in the case of predicting the route there are 30. \item The robustness with respect to $\epsilon$ is even more pronounced: Fig.~\ref{fig:leave1:eps} indicates that, once a good value for $\alpha$ is selected, neither the failure rate nor the amount of links needed for prediction depend on $\epsilon$. \end{itemize} As a last experiment, we attempted to simulate the realistic situation of an in-car system improving its prediction model with each taken trip by \textbf{incrementally moving trips from the testing set to the training set}. Specifically, for the first data point, we trained on the first trip only and predicted the remaining $N_H-1=780$ ones. This obviously lead to an immediate wrong prediction of almost all trips. We then added the second trip, retrained and predicted the remaining 779 trips, and so on. The results are shown in Figs.~\ref{fig:CaseCR1} and~\ref{fig:CaseCR2}, and we see that once roughly 10\% of the trips have been taken (so around 75 trips), the algorithm predicts at least 90\% of the remaining trips correctly while needing on average between 15 and 20\% of the trip to be completed to make its prediction. \section{CONCLUSIONS} The contribution was twofold: on the one hand, the flexible framework of modelling route patterns as stochastic processes and using the associated likelihoods to update a posterior probability is introduced, and on the other, a concrete algorithm is presented, obtained by modelling the stochastic processes as Markov chains. The flexibility of the approach is only touched upon, there are many possible extensions which should be explored once a richer dataset is available {-- even though we worked on the generation of a realistic dataset (see Sec.\ \ref{ssec:data}), it is still a synthetic one and the excellent performance of the presented algorithm is hard to improve upon. Improvements to be explored using a more challenging, real dataset, include:} \begin{itemize} \item Other stochastic process models can be used. Indeed, the approach taken in~\cite{JulienRoutePred} fits into the outlined framework, if the choice of stochastic process is a naive Bayes model, i.e.\ if assuming that $P(r_1,\dotsc,r_L \mid C_k) = \prod_{t=1}^L P(r_t\mid C_k)$. We intend to test other stochastic process models, such as the recently developed closed-loop Markov modulated Markov chains~\cite{Epperlein2017} in the near future. \item So far, the available context is not used at all. For future practical applications however, the prior probabilities should be made dependent on such contextual variables as the day of the week or the time of the day, for instance by setting $P(C_k, \text{weekday}) \propto \frac{\text{\#(trips in $C_k$ that occurred on a weekday)}}{\text{\#(trips that occurred on a weekday)}}$, the prior probability if the current trip occurs on a weekday would be made proportional to the relative frequency of trips in $C_k$ among previous weekday trips; \cite{JulienRoutePred} has further details on context and its inclusion, only there, the contextual variables influence the stochastic process model directly instead of entering via the prior. \item The initial probabilities $\pi^k$ and small probabilities $\epsilon$ can be shaped to be larger for roads that are not on, but close to, the roads in cluster $C_k$, and smaller for roads that are far away. This can be expected to improve convergence of the posterior probabilities. \end{itemize} Overall, the success the approach has without tapping into such extensions is encouraging further research. \bibliographystyle{siamplain}
\section{Introduction} \label{sect:intro} The existence of dark matter (DM) is widely supported by astrophysical~\cite{Zwicky:1937zza, Clowe:2003tk} and cosmological~\cite{Spergel:2006hy, Ade:2015xua} observations. Among many dark matter candidates, a nonthermally produced~\cite{Davoudiasl:2010am, Davoudiasl:2011fj, Allahverdi:2010im, Allahverdi:2013mza, Allahverdi:2017edd} dark matter can participate in baryon number violation ($\Delta B\neq 0$) processes~\cite{Kitano:2004sv, Agashe:2004ci, Cosme:2005sb}. Baryon number violation allows for nucleon destruction and transfers matter-antimatter asymmetry between visible and dark sectors~\cite{Davoudiasl:2010am,Haba:2010bm}, that may generate the correct baryon asymmetry and dark matter abundance at the same time. An interesting aspect of such a light dark matter is that it can stay kinematically stable~\cite{Allahverdi:2013mza,Allahverdi:2017edd, Davoudiasl:2010am} within a narrow mass range close to the proton's mass, where the protection of a discrete symmetry may not be needed\footnote{In the absence of discrete parities, dangerous $LH\chi$ terms can be avoided by introducing new symmetries on leptons.}: a small dark mater - proton mass difference less than the electron mass can avoid the weak decay of dark matter, and also prevent the proton decay via the dark matter's mixing with the neutron through the baryon number violating interaction. Recently this light dark matter has also been studied for its role in a potential semi-invisible decay of the neutron~\cite{McKeen:2015cuz, Fornal:2018eol, Karananas:2018goc}. In case the dark matter is a Majorana fermion, high-dimension $\Delta B=2$ operators can also be generated, and the current most stringent constraints derive from the Super-Kamiokande (SuperK) measurements on neutron-antineutron oscillation~\cite{Abe:2011ky} and dinucleon decay~\cite{Gustafson:2015qyo}. The resulting bound on the baryon number violation scale is $10^{6-8}$ GeV for operators involving the first two quark generations, and $10\, \text{TeV}$~\cite{McKeen:2015cuz, Allahverdi:2017edd, Dev:2015uca} for the third quark generation. Due to the GeV DM mass and relatively high interaction scale, the cosmic diffuse gamma ray search and nuclear recoil experiments are less effective in probing the light dark matter. Resonance searches at colliders can search for TeV mass mediators~\cite{Dutta:2014kia, Sirunyan:2017jix}. In addition to the constraints on $\Delta B=2$ processes that require the Majorana nature of the DM fermion, $\Delta B=1$ operators are available at lower operator dimension no matter whether the dark matter fermion is Majorana or Dirac type. This leads to interesting mixture between dark matter and a neutron, as studied in the neutron decay case~\cite{McKeen:2015cuz, Fornal:2018eol, Karananas:2018goc}. In this work we pursue a different perspective of this mixing: the presence of anti-DM (or DM itself in case it is Majorana) in the Galactic halo allows for the annihilation between the anti-DM and baryons inside terrestrial experiments' detector materials. The annihilation signal is a 2 GeV energy deposit in the form of multiple light mesons, and flavored mesons can also emerge in case the $\Delta B$ interaction involves heavy quark (HQ) flavors. This final state has been readily searched for at the large-volume water Cherenkov detectors like the SuperK experiment for $n-\bar{n}$ oscillation, and it could also be interpreted into a bound on $\bar{\chi}-N$ annihilation. In this paper, we adopt the minimal extensions of $SU(3)$ triplet scalar ~\cite{Allahverdi:2013mza, Allahverdi:2017edd,McKeen:2015cuz,Karananas:2018goc, Fornal:2018eol,McKeen:2015cuz, Allahverdi:2017edd, Dev:2015uca,Dutta:2014kia, Allahverdi:2015mha} to the Standard Model (SM) that couples to right-handed quarks and dark matter. We briefly discuss the model layouts in Section~\ref{sec:model} and investigate the phenomena of dark matter - baryon mixing and the annihilation signals in Section~\ref{sec:xsec}. The experimental sensitivity on annihilation with be given in Section~\ref{sec:limit} and compare with existing limits from other baryon number violating processes. We also discuss the galactic gamma ray signal, and neutron heating limits that arise from dark matter - baryon annihilation in Section~\ref{sec:alter}, and then we conclude in~\ref{sec:conclusion}. \section{Minimal Standard Model Extensions} \label{sec:model} The minimal phenomenological SM extensions~\cite{Allahverdi:2013mza} for successful baryon number violation and dark matter involve the addition of heavy $SU(3)$ color-triplet scalar(s) $\Phi$ and a singlet fermionic dark matter $\chi$. Here we consider two such implementations. In model I, $\Phi$ is a color-triplet, isospin-singlet scalar $(3,1)_{-1/3}$ with hypercharge $Y=-\frac{1}{3}$. The new interaction Lagrangian terms are \begin{eqnarray} \mathcal{L}_1&=&\lambda_1\Phi^* \chi d_{R} +\lambda'_1\Phi u_{R}d_{R}+\r{c.c.}\nonumber \\ &&+m^2_\Phi |\Phi|^2 +\frac{1}{2} m_\chi \bar{\chi}^c\chi , \label{eq:lm1} \end{eqnarray} where $R$ denote right-handed fermion fields and the color indices are omitted. Here we write a Majorana mass for the dark matter field $\chi$ as the minimal case. Alternative $\chi$ can also be a Dirac fermion, by replacing the $\chi$ with $\chi_R$ at the cost of adding an additional $\chi_L$ to the model. The range of $m_\chi$ is $m_p-m_e<m_\chi<m_p+m_e$ \cite{Allahverdi:2013mza}, where the upper bound to prevent dark matter from decaying to proton and the lower bound from proton stability. One loop correction~\cite{Allahverdi:2013mza} to the $\chi$ mass is $\delta m_\chi \sim (\lambda/4\pi)^2m_\chi{\rm ln}(\Lambda/m_\Phi)$ where $\Lambda$ is a cut off, and it would not exceed $m_e$ for $\lambda \le \mathcal{O}(0.1)$ with TeV $m_\Phi$. In the non-thermal relic density production, dark matter and baryons originate from the decay of $\Phi$ fields~\cite{Allahverdi:2013mza}, the couplings $\lambda, \lambda'$ can carry complex phases to generate necessary $CP$ violation in the interference of the $\Phi\rightarrow q q'$ decay with its self-energy diagrams~\cite{Allahverdi:2010im}. For non-zero $CP$ violation more than one $\Phi$ fields are usually required~\cite{Allahverdi:2013mza}; for dark matter - baryon annihilation at GeV energy, $\Phi$ can be integrated out as heavy field(s), and for convenience we consider the effective $\chi$-quark operators for one such heavy $\Phi$. This can be interpreted as the $\Phi$ with the lowest mass dominates the effective operator, and in the presence of multiple $\Phi$ fields, the total contribution can be proportionally summed up\footnote{Interference is possible when multiple $\Phi$s are mass-degenerate.}. The dark matter - triquark operator with $\Delta B = 1$ is derived by integrating out the heavy scalar $\Phi$, \begin{equation} \mathcal{L} \supset \frac{\lambda'\lambda}{m^2_{\Phi}} (\chi u_Rd_Rd_R) = \frac{\lambda'\lambda}{m^2_{\Phi}}\cdot \beta (\chi n), \label{eq:lchiudd} \end{equation} where the form factor $\beta$ is defined as $\langle 0|u_{R}d_{R}d_{R} | n\rangle$ and $\beta_{udd} \approx 0.0144~\text{GeV}^3$ from lattice QCD \cite{Aoki:2017puj}. This operator is effectively an off-diagonal mass term between the dark matter and the neutron, leading to a mixing suppressed by $m_\Phi^2$. For a Majorana $\chi$, tree-level $\Delta B = 2$ operators can be generated for $n-\bar{n}$ oscillation, as shown in Fig~\ref{fig:nnbartree}, by repeating the $\Delta B =1$ process with $\chi$'s Majorana mass insertion. Note in Model I all the three quarks can be valence quarks, thus the light flavor operator is the most stringently constrained by the SuperK $n-\bar{n}$ data. Coupling to heavy quark flavors, in particular with the 3rd generation quarks, can more easily evade the $n-\bar{n}$ oscillation constraints. \begin{figure}[h] \centering \includegraphics[width=0.32\textwidth]{nnbar_tree} \caption{$n-\bar{n}$ oscillation at tree level.} \label{fig:nnbartree} \end{figure} In model II, $\Phi=(3,1)_{+2/3}$ couples to two down-type quarks and its hypercharge $Y=+\frac{2}{3}$\,.The Lagrangian extension is given by \begin{eqnarray} \mathcal{L}_2&=&\lambda_{2}\Phi^* \chi u_{R}+\lambda'_{2 ij}\Phi d_{Ri}d_{Rj}+\r{c.c.}\nonumber \\ & &+m^2_{\Phi} |\Phi|^2+\frac{1}{2} m_\chi \bar{\chi}^c\chi, \label{eq:lm2} \end{eqnarray} where the subscript $i, j$ denote quark flavors. The omitted QCD indexes are antisymmetric with interchanging the two down-type quarks in the second term, thus $d_{Ri},d_{Rj}$ must couple to different quark flavors. Integrating out the $\Phi$ also gives the $\Delta B=1$ operator in \Eq{eq:lchiudd}, and $\chi$ could also be replaced by its right-handed component if $\chi$ is promoted to a Dirac fermion. Unlike in Model I, the $\Delta B =1$ operator will include at least one heavy down-type quark. The dimension-6 $\Delta B =1$ operator allows the dark matter to mix with neutron ($udd$). Thus the (anti) dark matter ($\chi$) can directly annihilate with the nucleon ($N$) through such mixing and produce a final state of several mesons, as illustrated in \Fig{fig:chinmm}. Due to the close proximity to the proton mass, the final state is almost identical to that of $N\bar{N}$ annihilation. \begin{figure}[h] \centering \includegraphics[width=0.32\textwidth]{nchimmm} \caption{Light anti dark matter annihilates with the nucleon ($N$) through mixing into antineutron $\bar{n}$ and produce a hadronic final state.} \label{fig:chinmm} \end{figure} The dimensional mixing parameter $\varepsilon=\beta\lambda'\lambda/m^2_{\Phi}$ in Fig.~\ref{fig:chinmm} is of mass dimension. The mass eigenstates are then a slight rotation from $\{n,\chi\}$ by $\theta$. In most of the mass range we have $\varepsilon \ll m_n-m_\chi$ (see Appendix \ref{sec:mixangle} for the general case), the mixing angle $\theta$ is \begin{equation} \theta \approx \frac{\varepsilon}{m_n-m_\chi}= \frac{\beta\lambda'\lambda}{m^2_{\Phi}(m_n-m_\chi)}, \label{eq:theta} \end{equation} hence the $\chi N$ annihilation cross section can be written in a simple way, \begin{equation} \sigma_{\chi N} \simeq \theta^2 \sigma_{N\bar{n}}, \label{eq:thetasigma} \end{equation} up to a tiny shift in the size of phase-space. In the following sections we investigate the signals from this annihilation. \section{Dark matter - nucleon annihilation} \label{sec:xsec} The light dark matter - nucleon annihilation occurs at low relative velocities due to non-relativistic halo dark matter velocity at the Earth. The annihilation cross-section can be inferred from the low-energy cross section of nucleon ($N$) and antinucleon ($\bar{N}$) annihilation~\cite{Dover:1992vj, Zenoni:1999st, Bertin:1997gn, Armstrong:1987nu, Feliciello:1999ti, Mutchler:1988av, Astrua:2002zg, Bertin:1996kw}. The parametrization of low energy $p,\bar{n}$ annihilation cross section can take the form $\sigma^{\rm ann}_{p\bar{n}}=a+b/P_{\bar{n}}$~\cite{Dover:1980pd}, where $P_{\bar{n}}$ is the antineutron's momentum and the empirical parameters $a,b$ are fitted to experimental data, as given by \Ref{Armstrong:1987nu}, $\sigma^{\rm ann}_{p\bar{n}} =41.4+(29.0\,\r{GeV})/P_{\bar{n}}$ mb in the momentum range 100-500$~\r{MeV}$. At low energy, $s$-wave is the most dominant contribution~\cite{Bertin:1997gn, Feliciello:1999ti} for annihilation cross section $\sigma_{p\bar{n}}$, and $\sigma v$ approaches to a constant value $\left.\sigma v\right|_{P_{\bar{n}}=0}=44 \pm 3.5$ mb \cite{Mutchler:1988av} in the low velocity limit. For the annihilation with one nucleon inside the nucleus ($A$), the $\bar{n}-A$ annihilation cross section has been analyzed with the data for six different nuclei (C, Al, Cu, Ag, Sn and Pb)~\cite{Astrua:2002zg}, \begin{equation} \sigma(P_{\bar{n}},A)=\sigma_0(P_{\bar{n}})A^{2/3}, \label{eq:totalxsec} \end{equation} where $A$ is the atomic number, and $\sigma_0(P_{\bar{n}})=a+b/P_{\bar{n}}+c/P^2_{\bar{n}}$ (with $a,b,c$ fixed to data). As both protons ($p$) and neutrons ($n$) are present inside nuclei, $\sigma_0$ is a weighted average: $\sigma_0=\alpha\sigma_{p\bar{n}}(P_{\bar{n}})+(1-\alpha)\sigma_{n\bar{n}}(P_{\bar{n}})$, where $Z$ is the number of protons and $\alpha=Z/A$. Among the tested elements, $\alpha$ varies mildly between 0.4 (lead) and 0.5 (carbon), the total cross-section dependence on $A$ agrees well with ~\Eq{eq:totalxsec} and is insensitive to $\alpha$~\cite{Astrua:2002zg}. Therefore we consider the cross section for both $p-\bar{n}$ and $n-\bar{n}$ to be identical with $\sigma_0$, and adopt the $\sigma_{p\bar{n}}$ parametrization from \Ref{Armstrong:1987nu}. As both processes are dominated by strong interaction the $n-\bar{n}$ cross-section is approximately the same as that for $p-\bar{n}$. With $p-\bar{n}$ and $n-\bar{n}$ identical with $\sigma_0$, we then obtain the annihilation cross section for dark matter and a free nucleon (or within a nucleus) at low momentum, by using~\Eq{eq:thetasigma} % \begin{eqnarray} v\sigma_{\chi N} &\approx& 44 \times \frac{(\beta\lambda'\lambda)^2}{m^4_{\Phi}(m_n-m_\chi)^2} \rm{\ mb },\label{eq:sigmavn}\\ v\sigma_{\chi A} &\approx& 44 \times \frac{(\beta\lambda'\lambda)^2 A^{2/3}}{m^4_{\Phi}(m_n-m_\chi)^2} \rm{\ mb }\label{eq:sigmava}. \label{eq:sigmav} \end{eqnarray} \section{Experimental limits} \label{sec:limit} Now we consider the experimental bounds for the $m_\chi$ range above $m_p-m_e$, where the proton decay is kinematically forbidden. In the range $|m_\chi-m_p|<m_e$, $\chi$ is stable, and the $\chi N$ annihilation can be detected at large-volume Cherenkov detectors, along with existing $n-\bar{n}$ oscillation and $n$ decay lifetime limits. For $m_\chi>m_p+m_e$, we will also consider the stability bound of $\chi$ as dark matter, since $\chi$ can decay via mixing to neutrons or directly into 3 quarks/jets at a heavier mass. The $\chi$ decay lifetime will be constrained to $10^{24-26}$s~\cite{Slatyer:2016qyl} by PLANCK~\cite{Ade:2015xua} by the impact on the CMB's propagation. All the experimental bounds are summarized in Fig.~\ref{fig:mphi}. For convenience we give the $m_\Phi$ bounds assuming unity-value couplings $\lambda, \lambda'= 1$. \begin{figure}[h] \centering \includegraphics[width=0.4\textwidth]{mphi_mchi} \caption{Experimental limits for $m_\Phi$ versus $\Delta m=m_\chi-m_p+m_e$ from several models. The dark-green, red, cyan, magenta, orange, blue (dashed) lines denote $n-\bar{n}$ oscillation for first generation at tree level, $\chi-N$ annihilation, neutron decays to dark matter, $n-\bar{n}$ oscillation for third generation at loop level, dark matter decays to proton, dark matter decays to three jets where one of three jets is from a $b$-quark, respectively. The solid (dashed) line denotes stable (unstable) dark matter. The dark matter can decay when $\Delta m>2m_e$. It only decays to proton when $2m_e<\Delta m<2m_e+m_\pi$ and to three jets when $m_\chi>10\text{GeV}$. The $\chi N$ annihilation bound is extended (dashed) to $m_\chi=2$. All curves assume Majorana $\chi$.} \label{fig:mphi} \end{figure} The $\chi N$ annihilation leads to a $ \sim\hskip -1mm$ 2\,GeV final state, and it is the same signal as the $n-\bar{n}$ oscillation in which a pair of bound neutrons annihilate inside an oxygen nuclei, in the large volume of water body at SuperK \cite{Abe:2011ky} or SNO \cite{Aharmim:2017jna} experiments. While the $n-\bar{n}$ oscillation rate per unit volume is determined by water density and is subject to a nuclear suppression factor~\cite{Friedman:2008es}, the free-streaming (anti) dark matter directly interacts with nucleons in both hydrogen and oxygen elements and the rate is determined by the local density in the Galactic halo, \begin{equation} \frac{{\rm d}N}{{\rm d}t}= A_{\rm eff}\phi_\chi= \eta N_{\rm T} n_\chi \sigma_{\chi {\rm T}}v_\chi \label{eq:rate} \end{equation} where subscript T denotes target nuclei. The `effective area' $A_{\rm eff}=\eta \sigma_{\chi {\rm T}} N_{\rm T}$ is proportional to the detector mass and the experiment's detection efficiency $\eta$. The dark matter flux density is $\phi_\chi=n_\chi v_\chi$ and $\sigma_{\chi {\rm T}}v_\chi$ approaches to the $s-$wave limit at the halo's low $v\sim10^{-3}$ velocity. We take the dark matter number density at the Solar system to be $n_\chi \simeq$ $0.43\,{\rm cm}^{-3} $\,$(\rho=0.4\, \text{GeV}/{\rm cm}^3)$. For Majorana type of $\chi$, $100\%$ of the local halo density contribution; in the Dirac $\chi$ case, only the anti dark matter $(\bar{\chi})$ component will participate in the $\bar{\chi} N$ annihilation and a reasonable estimate can be placed by assuming $\chi$ and $\bar{\chi}$ each takes 50\% of the halo density. Note that in general the $\chi$ fraction may vary in nonthermal scenarios, from highly suppressed fractions to nearly 100\% in models like the asymmetric dark matter case~\cite{Petraki:2013wwa}. Here we adopt the SuperK $n-\bar{n}$ oscillation search data \cite{Abe:2011ky} to set the limit on $\chi N$ annihilation. The SuperK contains 22.5 kton fiducial volume of water and the number of target hydrogen (proton) and oxygen from exposure data are $N_p \simeq$ 6.13 $\times 10^{33}$ and $N_{\rm o} \simeq$ 3.06 $\times 10^{33}$\,\cite{Abe:2011ky}. The 24 detected events during a 1489 live-day run is consistent with all-background interpretation~\cite{Abe:2011ky}. Here we assume null result and place a 90\% confidence level bound by requiring the $\chi N$ annihilation considering only the statistical uncertainty of the number of background events. With $\eta=12.1\%$, the SuperK constraint on $m_\Phi$ is $\sim \mathcal{O}(10^7)\,\text{GeV}$ in the kinematically stable mass range of Majorana $\chi$, as shown in Fig.~\ref{fig:mphi}, and decreases 16$\%$ for Dirac $\chi$ with a 50\% halo density. The $\chi N$ annihilation bound is also extended into the unstable range $(m_\chi > m_p + m_e)$, where the shape of the constraint curve is determined by the $m_\chi$ dependence of the $\chi n$ mixing angle $\theta$. The sharp rise at $m_\chi = m_n$ is due to the vanishing of the mass difference which makes $\theta$ less sensitive to $m_\Phi$ for $\varepsilon$ comparable or larger than $|m_\chi-m_n|$. For Majorana $\chi$, $\Delta B=2$ operators lead to $n-\bar{n}$ oscillation, and \Refs{McKeen:2015cuz, Allahverdi:2017edd, Dev:2015uca} studied the corresponding constraints. For $n-\bar{n}$ oscillation with first generation at tree level and third generation at one loop level, the free $n-\bar{n}$ oscillation time is given in Ref.~\cite{Allahverdi:2017edd} and~\cite{McKeen:2015cuz} \begin{equation} \tau^{-1}_{n\bar{n}} \simeq \left\{ \begin{array}{ll} \frac{\beta^2\lambda'^2_1\lambda^2_1 m_\chi}{m^4_\Phi(m^2_n-m^2_\chi)}, & ({\rm 1st\,gen.}) \\ & \\ \frac{\lambda'^4_2\lambda^2_2 m_\chi}{16\pi^2m^6_\Phi} \Lambda^6_{\rm QCD}{\rm ln}\left(\frac{m^2_\Phi}{m^2_\chi}\right), & ({\rm 3rd\,gen.}) \end{array} \right. \end{equation} where $\Lambda_{\rm QCD}^6$ is from the MIT bag model \cite{Rao:1983sd, Babu:2001qr}. The SuperK lifetime limit is $\tau_{n\bar{n}} > 2.7\times 10^8 \r{s}$~\cite{Abe:2011ky}, where the first generation gives the strongest bound on in \Fig{fig:mphi} than $\chi N$ annihilation, as shown in Fig.~\ref{fig:mphi}. A Dirac-type $\chi$ does not generate $n-\bar{n}$ oscillation and evades the stringent $n-\bar{n}$ oscillation and dinucleon decay bounds. Yet the $\Delta B =1$ operator still exists, and $\bar{\chi} N$ annihilation, $\chi$ stability constraints apply. Here we compare the $\bar{\chi} N$ annihilation results with those from $\chi$ decay limits. The dark matter decay process $\chi \rightarrow pe\bar{\nu}$ occurs via the $\chi \bar{n}$ mixing, and the four-fermion interaction is simply scaled by the mixing angle $\theta$ from the SM's effective weak interaction operator for $n\rightarrow p e\bar{\nu}$ decay. For the mass range $m_p+m_e<m_\chi<m_p+m_e+m_\pi$ we compute the $\chi$ decay by phase space since there is no other significant final state. More complicated final states will rise for $m_\chi>m_p+m_e+m_\pi$ and a full study for heavier $\chi$ decay with a multiplicity in mesons is beyond the main focus of this paper. Instead, we present the $\chi\rightarrow qqq$ decay limits for a higher mass range $m_\chi > {\cal O}(10)$ GeV, where each quark hadronizes individually into jet(s). The stability bounds are shown by the orange and blue dashed curves in~\Fig{fig:mphi}. The $\chi$ decay leads to gamma ray signals from final state $\pi^0$ decay that can be probed by Fermi-LAT diffuse gamma ray searches~\cite{Baring:2015sza}, and also by CMB polarization data on the heating effect of the decay-injected photons and charged particles~\cite{Ade:2015xua}. With $m_\chi$ below $m_p+m_e+m_\pi$, PLANCK gives leading constraint $\tau_{\chi}>10^{24}$s\,\cite{Clark:2018ghm}. For heavy $\chi\rightarrow 3j$ decay, the Fermi-LAT limit for the hadronic decay channel is $\tau_{\chi}>10^{26}{\rm s}$\,\cite{Baring:2015sza} that is more stringent than the PLANCK bound $\tau_{\chi}>10^{24}{\rm s}$ \cite{Clark:2018ghm, Slatyer:2016qyl}. Note the in the $\chi \rightarrow pe\bar{\nu}$ channel the electron energy is only a small fraction of the $m_\chi$, the PLANCK bound is scaled proportionally by the energy injection rate to the ${\rm DM}\rightarrow e^+e^-$ limit at $m_{\rm DM}\sim 2E_e$. Recently Ref.~\cite{Fornal:2018eol} studied the neutron's semi-invisible decay $n\rightarrow \chi \gamma$ in the Dirac $\chi$ case to interpret the neutron decay anomaly~\cite{Serebrov:2017bzo, Pattie:2017vsj, Yue:2013qrc}, which gives $|\lambda\lambda'|/m^2_\Phi$ $\approx 6.7 \times 10^{-6}\, {\rm TeV}^{-2}$ at $m_\chi$=0.9379 MeV. For comparison, Fig.~\ref{fig:mphi} illustrates this scenario as the cyan curve, and we find it constrained by the $\chi N$ annihilation bound. A few notes are due about the heavy quark flavor cases in \Eq{eq:lchiudd} that are typical in Model II. By replacing one light quark with a flavored one, \Eq{eq:lchiudd} can mediate $\Delta s$, $\Delta c$, $\Delta b\neq 0$ processes if kinematically permitted. For 1 GeV Majorana dark matter, $D, B$ mesons are too massive to be produced from low energy $\chi N, NN$ interactions. However, $K$ meson production is kinematically allowed and the dinucleon decay $NN\rightarrow KK$ via dimension-9 $\Delta s=2$ operator is constrained to $m_\Phi> 10^7\text{GeV}$ by SuperK measurement~\cite{Gustafson:2015qyo}. Heavy flavored operators can also lead to $\chi - n$ mixing via the presence of heavy quark inside a neutron, namely considering the effective tri-quark form factors $\beta_c, \beta_s, \beta_b$ analogous to the $\beta$ in \Eq{eq:theta}. Since the $\chi N$ annihilation cross-section scales as $\sigma\propto \beta^2m_\Phi^{-4}$, the SuperK limit on $m_\Phi$ scales $\beta_{\rm HQ}^{-1/2}$ for heavy quark flavor cases. Such form factors are currently unavailable and their evaluation in future lattice QCD studies will be greatly helpful. \begin{figure}[h] \centering \subfigure[~$n+\chi \to \pi+\pi$]{ \label{subfig:pipi} \includegraphics[width=0.32\textwidth]{nchi2pipi} \hspace{0.01\textwidth} \subfigure[~$n+\chi \to \pi+K$]{ \label{subfig:pik} \includegraphics[width=0.32\textwidth]{nchi2pik}} \caption{The dark matter interacts with neutron and produces two mesons. Two processes with different down-type quark: $n+\chi \to \pi+\pi$ and $n+\chi \to \pi+K$.} \label{fig:pchi} \end{figure} Still, one can circumvent the $\beta$ form-factor suppression of the neutron's heavy quark presence in a few ways. Ref.~\cite{Allahverdi:2017edd} proposed a loop-level $\Delta b =2$ process where the heavy (b) quark hides as internal lines and the external fermions only involve valence quarks. The corresponding $n-\bar{n}$ oscillation bound is $m_\Phi>10^4\text{GeV}$, as shown in Fig.~\ref{fig:mphi} (magenta). Note by inciting the $\beta$ form factor we assume the heavy fermion presence in the initial state of $N\bar{N}\rightarrow \pi(s)$ annihilation. However, this is unnecessary as the heavy quark can also be the out-going fermion, as illustrated in Fig. ~\ref{fig:pchi}, where the $\chi N \rightarrow \pi K$ does not suffer from an initial-state neutron's $\beta_s$. The two annihilation processes in \Eq{fig:pchi} are kinematically similar, and we expect $\sigma_{\pi K}$ from the $\Delta s=1$ operator to be comparable to a $\sigma_{\pi \pi}$ generated by valence-quark-only operators, up to a reduction in the final state phase space due to the $K,\pi$ mass difference. While the SuperK dinucleon decay data focused on pair-produced $K$ meson signals, we can still estimate the bound on $NN\rightarrow\pi K$ by scaling with the kaon multiplicity and obtain an $m_\Phi\sim \mathcal{O}(10^{6-7})\,\text{GeV}$ bound for the $\Delta s=1$ operator. Additionally, one may consider operators by replacing more than one valence quark with heavy quarks in \Eq{eq:lchiudd}, further reducing their constraints from $\chi N, n-\bar{n}, NN$ interactions. For baryon number generation at high energy scale, heavy-flavored operators work equally well as 1st generation quark operators, plus characteristic flavored signals in high-energy collider searches. \section{Alternative searches} \label{sec:alter} Hydrogen and helium are the two most abundant components that make up nearly 99$\%$ \cite{Ferriere:2001rg} of the interstellar gas in our galaxy. $\chi N$ annihilation occurs between dark matter and the galactic gas and produces a hadronic final state, where the $\pi^0$ decay may yield a diffuse photon signal. The photon signal intensity is written in a similar way as that from dark matter annihilations, \begin{eqnarray} && \frac{{\rm d} \phi_\gamma(\chi N)}{ {\rm d} E {\rm d} \Omega} = \theta^2 \frac{\langle v\sigma_{\chi N} \rangle}{8\pi m_\chi m_N} \frac{{\rm d} N_\gamma}{{\rm d} E} \int_{\rm los} \rho_\chi \rho_B {\rm d}s\,,\\ &&\frac{{\rm d} \phi_\gamma(\chi\chi)}{ {\rm d} E {\rm d} \Omega} = \frac{\langle v\sigma_{\chi\chi} \rangle}{8\pi m^2_\chi} \frac{{\rm d} N_\gamma}{{\rm d} E} \int_{\rm los} \rho^2_\chi {\rm d}s\,, \label{eq:chichibar} \end{eqnarray} where the integration over density profiles is along the line-of-sight (los) direction. $\langle \sigma v \rangle$ is the thermally averaged annihilation cross section, and ${\rm d} N_\gamma/ {\rm d} E$ is the final state photon spectrum. Here we take $\langle \sigma v \rangle_{\chi N} \approx \sigma v_{\chi N}$ for $s-$wave dominated annihilation at low velocity $v\sim 10^{-3}$. The DM density $\rho_\chi$ follows the halo distribution, e.g. the NFW profile $\rho_\chi=\rho_s (r/r_s)^{-1} (1+r/r_s)^{-2}$~\cite{Navarro:1996gj}, where $\rho_s=0.33\,\text{GeV}/ {\rm cm}^3$ and $r_s=20$ kpc. For the Galactic diffuse gas distribution, we assume a simple hydrogen density parametrization $n_{\rm gas}=0.0135(r/1{\rm kpc})^{-1.5} {\rm cm}^{-3}$ in Ref.~\cite{0004-637X-800-1-14}. Note the diffuse gas density is typically two orders of magnitude below the DM density. Given the SuperK limit $m_\Phi$ $\ge$ $\mathcal{O}(10^{7})$\,\text{GeV}, the annihilation cross-section $\langle \sigma v \rangle_{\chi N} \le \mathcal{O}(10^{-41})$\,cm$^{3}\,{\rm s}^{-1}$. Thus the $\chi N$ signal flux is significantly below the Fermi-LAT's sensitivity~\cite{Ackermann:2015lka} of $10^{-30} \,{\rm cm}^{3}{\rm s^{-1}}$ at 1 GeV DM-DM annihilation. \medskip Dark matter - nucleon annihilation can lead to direct energy deposit into stars. In addition, the $\Phi^* u_R\chi$ term leads to $\chi-N$ scattering that allows for stars to capture dark matter~\cite{Gould:1987ir}, and it is not suppressed by $\chi-N$ mixing angle. Both the free-streaming dark matter that transverse stars, as well as those gravitationally captured, may annihilate with stellar nucleons and provide a steady heat source to cold and dense systems like aged neutron stars~\cite{Ozel:2016oaf}. A typical neutron star of $\sim 1.5$ solar mass and 10 Km radius is opaque to the dark matter flow for an $\chi N$ annihilation/scattering cross-section greater than a geometric threshold $\sigma_{\rm th}=10^{-45}$cm$^2$ for $m_{\rm DM}$ between 1 GeV and $10^6$ GeV~\cite{Baryakhtar:2017dbj}. Note that in our case $\chi$ annihilates with a nucleon and there is greater amount of energy release per unit DM mass if compared to conventional DM-DM annihilation cases. The energy deposit thermalizes with the neutron star and is eventually radiated away, raising the neutron star's surface temperature. For recent DM-induced neutron star heating studies, see~\Refs{Kouvaris:2010vv, deLavallaz:2010wp, Raj:2017wrv, Bell:2018pkk}. The SuperK's $\chi N$ bound requires $\theta^2 \leq 10^{-26}$ and the direct $\chi N$ annihilation is less than $10^{-51}$cm$^2$. The average DM flux density through the neutron star is \begin{equation} \frac{{\rm d}N_{\rm ann}}{{\rm d}t}= N_{\rm NS} n_\chi \sigma_{\chi N}v_\chi \end{equation} where $N_{\rm NS}=M_{\rm NS}/m_n$ is the total number of neutrons in the neutron star. Due to gravitational acceleration, the DM gains an average of $35\%$ kinetic energy after falling into the neutron star, and with $v\sim0.67$ the $\chi N$ annihilation cross-section can still be well describe by $\sigma^{\rm ann}_{\chi n} = \theta^2\sigma^{\rm ann}_{n\bar{n}}$, where the parametrization is given by $\sigma^{\rm ann}_{n\bar{n}}=38.0+35.0/P_{\bar{n}}(\text{GeV})$~\cite{Mutchler:1988av}. Then the direct annihilation rate is $\sim 10^{16}\,{\rm s^{-1}}$ for uncaptured DM that transverse the neutron star. Since the annihilation rate is far below saturation, DM capture by elastic scattering would also contribute to the heating process. \Ref{Allahverdi:2013mza} gave the TeV scale $\Phi$ mediated $\chi N$ elastic cross section as $\sigma_{\rm SI} \le 10^{-(15-16)}$ pb for spin-independent (SI) scattering and $\sigma_{\rm SD} \le 10^{-(5-6)}$ pb for spin-dependent (SD) scattering. $\sigma_{\rm SI}$ is suppressed by $m^8_\Phi$ and becomes subdominant at large $m_\Phi$. In contrast $\sigma_{\rm SD}$ from the leading $(\bar{\chi}\gamma_5\gamma^\mu\chi)(\bar{q}\gamma_5\gamma_\mu q)/m^2_\Phi$ operator scales with $m^{-4}_\Phi$. For $\sigma_{\rm ela} \ll \sigma_{\rm th}$ the capture rate by neutron star is proportional to $\sigma_{\rm ela}/\sigma_{\rm th}$ and with $m_\Phi=10^{7}$ GeV the SD scattering leads to $\sim 10^{10}\,{\rm s^{-1}}$. This is still lower in comparison with direct annihilation, and the energy deposit is dominated by direct $\chi n$ annihilation. The heating rate is $\dot{E}={E_{\rm t} \dot{N}}f$~\cite{Baryakhtar:2017dbj}, where $\dot{N}=\pi b^2v_\chi n_\chi$ is the number rate of dark matter flux and $b$ is the impact parameter, $f=\sigma_{\chi N}^{\rm ann}/\sigma_{\rm th}$ is the annihilation efficiency, and each $\chi$ contributes energy equal to $E_{\rm t}=2.35 m_\chi$. A neutron-star sized black body's surface temperature is $T_{\rm s}\simeq 134\,{\rm K}\,(10^7\,\text{GeV}/m_\Phi)$ at $m_\chi=m_p+m_e$ by assuming equilibrium between the DM heating and black-body radiation. To a distant observer this temperature lowers to $T\simeq 100\,{\rm K}\,(10^7\,\text{GeV}/m_\Phi)$ due to gravitational redshift, and is below the current experimental sensitivities~\cite{jwst}. \section{Conclusion} \label{sec:conclusion} In this paper we investigated the dark matter annihilate with baryons (nucleons) through baryon number violating extensions to the Standard Model. For these models we assume color-triplet, iso-singlet scalar(s) and a fermionic dark matter, in which the dark matter is kinematically stable within a small mass range near the proton mass. The annihilation between dark matter and nucleon depends the on the DM-neutron mixing angle, and the cross-section can be determined from the nucleon annihilation cross-section measurements. The mixing angle given in Eq.~\ref{eq:theta} applies to both Dirac and Majorana fermion DM cases, and it provides good probe to the scale of the mediator $m_\Phi$. Due to the identical final state between the $n-\bar{n}$ oscillation and $\chi N$ annihilation at the SuperK experiment, we constrain the stringent limit $m_\Phi$ up to $10^{7}$\,\text{GeV} \hskip 0.9mm by re-interpreting the $n-\bar{n}$ oscillation data for the DM - nucleon annihilation. For Majorana-type dark matter, the constraint is one order in magnitude lower than the bound from neutron-antineutron oscillation. In the Dirac case, DM - nucleon annihilation gives much stronger bounds than that from neutron decay lifetime uncertainties. We also extended the SuperK bound into the mass range $m_\chi> m_p+m_e$ and compare with the DM stability limits. For a small mass range as illustrated in \Fig{fig:mphi}, the SuperK bounds exceed that from DM stability. For operators involving heavy quarks, DM - nucleon annihilation occurs either via the heavy quark's presence in neutrons, or through the unsuppressed $\Delta s = 1$ annihilation processes as the $K$ meson is kinematically allowed in the 2 GeV final state. The $\Delta s =1$ annihilation can also be strongly constrained by SuperK dinucleon data. We then discussed the prospects of dark matter- nucleon annihilation in the indirect detection of the Galactic diffuse gamma rays, and in neutron star heating. Given that the $m_\Phi$ is severely constrained by SuperK, a $\langle \sigma v \rangle_{\chi N} \le \mathcal{O}(10^{-41})$\,cm$^{3}\,{\rm s}^{-1}$ for indirect detection, or a heated neutron star temperature $T\simeq 100\,{\rm K}$ are significantly below the reach of current experiments. \bigskip {\bf Acknowledgements} \medskip The authors thank Xiao-jun Bi, Hong-bo Hu and Eigo Shintani for helpful discussions. Y.G. is supported under grant no.~Y7515560U1 by the Institute of High Energy Physics, Chinese Academy of Sciences. M.J. thanks the Institute of High Energy Physics, Chinese Academy of Sciences for support.
\section{Robust Learning of Probabilistic Movement Primitives} \label{sec:methods} \begin{figure} \setlength\figurewidth{7cm} \setlength\figureheight{4cm} \centering \tikzsetnextfilename{promp_graphmod} \input{fig/promp_graphmod} \caption { Probabilistic Movement Primitive graphical model. The joint state~$\vect{y}_{nt}$ is generated from the compact representation of a trajectory~$\vect{\omega}_n$ using~\eqref{eq:promp:proMP}. The mean behavior of the different trajectories is represented by the variable~$\vect{\mu}_\omega$. The variability of the teacher and the correlations between different joints are represented by~$\matr{\Sigma}_\omega$. Each trajectory~$\vect{\omega}_n$ is generated using~\eqref{eq:promp:distw}. The number of trials is denoted by~$N$, and the number of time steps of the trial $n$ is denoted by~$\mathrm{T}_{n}$. } \label{fig:promp:model} \end{figure} Probabilistic movement primitives (ProMPs) are probability distributions used to represent motion trajectories~\cite{proMP}. A trajectory~$\tau = \{\vect{y}_t\}_{t=1}^T$, can be represented as positions or joint angles at different moments in time. In this paper, we assume that~$\vect{y}_t$ is a $D$ dimensional vector that represents the joint measurement at time $t$ of a robotic system with $D$ degrees of freedom. First, let us introduce a variable~$\vect{\omega}=\trans{[\trans{\vect{\omega}_1},\dots,\trans{\vect{\omega}_D}]}$ that encodes compactly a single robot trajectory, and consists of the concatenation of~$D$ weight vectors~$\vect{\omega}_d$ that represent the trajectory of each of the degrees of freedom of the robot, indexed by~$d$. Given a trajectory realization represented by~$\vect{\omega}$, the joint state at time $t$ is computed as \begin{equation*} \vect{y}_t = \trans{[ \trans{\vect{\phi}_1(t)}\vect{\omega}_1, \cdots, \trans{\vect{\phi}_D(t)}\vect{\omega}_D ]} + \vect{\epsilon}_y, \end{equation*} where the vector~$\vect{\phi}_d(t)$ is a computed from a set of time dependent basis functions, and~$\vect{\epsilon}_y$ is Gaussian white noise. To obtain smooth trajectories, the basis functions need to be smooth. In this paper we use radial basis functions (RBF), polynomial basis functions and a combination of both. The number and type of basis functions to use is a design choice. Each degree of freedom could have a different number of basis functions, but for simplicity we assume every degree of freedom uses~$K$ basis functions. The distribution over the values of the joint state at time~$t$, can be written as \begin{equation} p(\vect{y}_{t}|\vect{\omega}) = \normal{\vect{y}_{t}}{\matr{\Phi}_{t}\vect{\omega}}{\matr{\Sigma}_y}, \label{eq:promp:proMP} \end{equation} where~$\matr{\Phi}_t$ is a~$D \times KD$ matrix used to write the distribution over~$\vect{y}_t$ in vectorized form, and is defined as \[ \matr{\Phi}_t = \begin{pmatrix} \vect{\phi}_1(t) & \cdots & \vect{0} \\ \vdots & \ddots & \vdots \\ \vect{0} & \cdots & \vect{\phi}_D(t) \end{pmatrix}. \] Different realizations of a movement primitive are assumed to have different values for~$\vect{\omega}$. In this model, a particular realization~$n$ represented by~$\vect{\omega}_n$ is assumed to be sampled from \begin{equation} p(\vect{\omega}_n|\vect{\theta}_\omega) = \normal{ \vect{\omega}_n }{ \vect{\mu}_{\omega} }{ \matr{\Sigma}_{\omega} }, \label{eq:promp:distw} \end{equation} where~$\vect{\theta}_\omega = \{\vect{\mu}_\omega, \matr{\Sigma}_\omega\}$ is a set of parameters that capture the similarities and differences of different realizations of the movement primitive. In the rest of this section, we drop the index~$n$ from~$\vect{\omega}_n$ for notational simplicity. \begin{figure} \setlength\figurewidth{8cm} \setlength\figureheight{4cm} \setlength\axislabelsep{0mm} \centering \begin{comment} \input{fig/joint_dist/q0.tex} \input{fig/joint_dist/q1.tex} \end{comment} \tikzsetnextfilename{q0samples} \input{fig/q0_samples.tex} \tikzsetnextfilename{q0} \input{fig/q0.tex} \caption { Demonstrated trajectories and learned distribution for the first degree of freedom of Barrett WAM robot arm. The joint value $y_0$ corresponds to the shoulder yaw recorded in radians as a function of time. Different trajectories of a table tennis forehand motion are demonstrated by the human teacher. These trajectories are depicted in blue and have different durations. The duration of each trajectory is normalized to one to achieve duration invariance, the time invariant trajectories are depicted in green. The learned distribution is depicted in red. The shaded area corresponds to two standard deviations. Note that the model captures the mean behavior and the variability of the teacher at different points in time. } \label{fig:tt:joint_dist} \end{figure} Let us write the distribution~$p(\vect{\omega}|\vect{\theta}_\omega)$ decomposing the~$KD \times 1$ vector~$\vect{\mu}_\omega$ and the~$KD \times KD$ matrix~$\matr{\Sigma}_\omega$ in the components corresponding to each degree of freedom, \begin{equation*} \normal{ \begin{pmatrix} \vect{\omega}_1 \\ \vdots \\ \vect{\omega}_D \\ \end{pmatrix} }{ \begin{pmatrix} \vect{\mu}_{\omega}^1 \\ \vdots \\ \vect{\mu}_{\omega}^D \\ \end{pmatrix} }{ \begin{pmatrix} \matr{\Sigma}_{\omega}^{(1,1)} & \cdots & \matr{\Sigma}_{\omega}^{(1,D)} \\ \vdots & \ddots & \vdots \\ \matr{\Sigma}_{\omega}^{(D,1)} & \cdots & \matr{\Sigma}_{\omega}^{(D,D)} \\ \end{pmatrix} }. \label{eq:promp:distw_dof} \end{equation*} Note that the mean behavior for the degree of freedom~$d$ is captured by the~$K \times 1$ vector~$\vect{\mu}_{\omega}^d$ and the variability by the~$K \times K$ matrix~$\matr{\Sigma}_{\omega}^{(d,d)}$. The correlation between two different joints~$d_1$ and~$d_2$ is captured by~$\matr{\Sigma}_{\omega}^{(d_1,d_2)}$. The model can be forced to consider all the joints independently by forcing the matrix~$\matr{\Sigma}_\omega$ to be block diagonal. A probabilistic graphical model is a probabilistic model for which a graph expresses conditional independence assumptions between random variables~\cite{murphy2012machine}. Figure~\ref{fig:promp:model} shows the graphical representation of the probabilistic model used to represent movement primitives. To sample a robot trajectory given the ProMP parameters~$\vect{\mu}_\omega$ and~$\matr{\Sigma}_\omega$, a vector~$\vect{\omega}_n$ is sampled using~\eqref{eq:promp:distw}. Subsequently, the new trajectory of length~$\mathrm{T}_n$ can be sampled using~\eqref{eq:promp:proMP}. If the used basis functions are smooth, the sampled trajectories will also be smooth. Figure~\ref{fig:tt:joint_dist} show six human demonstrations of a forehand table tennis striking movement and the learned probability distribution. The figure shows the value in radians of the shoulder yaw~$y_0$ with respect to time. The original demonstrations given by the human teacher, depicted in blue, have different durations varying between 0.4 and 0.6 seconds. The time of every demonstration is normalized to be between zero and one to achieve duration invariance using a new variable~$z=\frac{t-t0}{T}$, known as the phase variable~\cite{proMP}. The same demonstrations with respect to the phase variable are depicted in green, and the learned distribution is depicted in red. The shaded area corresponds to two standard deviations. The ProMP learned from the given demonstrations capture the mean behavior and the teacher variability in different points of time. \begin{comment} The ability to capture the variability and the correlation between joints is an important feature of the ProMP representation. However, the number of parameters to estimate by the training procedure grows quadratically with respect to the number of basis functions and degrees of freedom of the robot. An important feature of movement primitive frameworks, is the ability to adapt the movement to reach a desired position at a given time. In Section~\ref{sec:promp:operators}, we present operators to adapt a movement primitive by setting joint space target values or distributions at the desired time. For many applications, it is more natural to adapt or analyze movement primitives in task space. For instance, in table tennis we are interested in the distribution of the position of the racket in Cartesian coordinates. In Section~\ref{sec:promp:kinematics}, we introduce operators to use and adapt in task space a ProMP learned in joint space using the geometry of the robot. \end{comment} \subsection{Learning from Demonstrations} \begin{comment} \begin{itemize} \item Introduce the likelihood of the data and explain why just maximizing the likelihood is not a good idea. \item Introduce the used prior distributions, explain how it encourages independent joints in the absence of data and how correlations between different joints can be learn as more data becomes available unlike previous approach. \item Make an algorithm box for the EM training algorithm to do MAP inference. \item Maybe talk about the matrix condition numbers for the ML and MAP learned covariance matrix. \item Show a plot of conditioned distribution obtained with ML and MAP inference to compare stability from a practical point of view. \end{itemize} \end{comment} The parameters~$\vect{\theta}_\omega$ can be learned from human demonstrations. Let us assume we have~$N$ recorded human demonstrations, and extend the notation with an extra sub-index~$n \in \{1..N\}$ identifying each demonstration. Thus, the variables~$\vect{y}_{nt}$ and~$\vect{\omega}_n$ represent the joint state of the~$n$th trial at time $t$ and the compact representation of the~$n$th trial respectively. The likelihood of the recorded data is given by \begin{equation*} p(\matr{Y}|\vect{\theta}_\omega) = \prod_{n=1}^{N}{\int{p(\vect{\omega}_n \given \vect{\theta}_\omega) \prod_{t=1}^{\mathrm{T}_n}{p(\vect{y}_{nt} \given \vect{\omega}_n)} \diff{\vect{\omega}_n}} }, \label{eq:promp:marginalLH} \end{equation*} where~$\matr{Y}$ is the set of values~$\vect{y}_{nt}$ for all the training instances. Note that evaluating the likelihood requires the computation of an integral over the hidden variables~$\vect{\omega}_n$. Although the integral in this case can be computed in closed form, evaluating the resulting expression would cost cubic time over the trajectory lengths~$\mathrm{T}_n$. Instead, we propose to use the expectation maximization algorithm to optimize the likelihood or posterior distribution with linear time costs over the trajectory lengths~$\mathrm{T}_n$. In~\cite{paraschos2015model}, the ProMP parameters are estimated by first making a point estimate of the hidden variables with least squares, and subsequently finding their empirical mean and covariance matrix as the ProMP parameters. This estimation procedure makes intuitive sense and avoids computing integrals. However, the authors did not provide a mathematical intuition of how their estimation procedure relates to maximizing the marginal likelihood. In the Appendix~\ref{sec:rel_alex_method}, we explain in detail the estimation method introduced in~\cite{paraschos2015model}, and show that it is an special case of an approximation of the proposed EM algorithm to maximize the likelihood. The approximation consists of performing a single EM iteration and approximating the Gaussian distribution computed in the E-step with a Dirac delta distribution, ignoring the uncertainty over the estimates of the hidden variables. In previous work~\cite{gomez2016using}, the parameters were learned maximizing the likelihood. However, maximizing the likelihood results in numerically unstable estimates for the parameters of the ProMP unless a very large number of demonstrations is available. In~\cite{gomez2016using}, the matrix~$\matr{\Sigma}_\omega$ is forced to be block diagonal to deal with the numerical problems. As a result, the ProMP parameters could be robustly estimated, but the model becomes incapable of learning the correlation between the different joints of the robot arm. In this paper, we use regularization to estimate the ProMP parameters in the form of a prior probability distribution~$p(\vect{\theta}_\omega)$. The posterior distribution over the ProMP parameters is given by \begin{equation} p(\vect{\theta}_\omega | \matr{Y}) \propto p(\vect{\theta}_\omega)p(\matr{Y}|\vect{\theta}_\omega). \label{eq:promp:train_posterior} \end{equation} We estimate the parameters~$\vect{\theta}_\omega$ by maximizing the posterior distribution of~\eqref{eq:promp:train_posterior} using the expectation maximization algorithm. This estimator is commonly known as Maximum A Posteriori (MAP) estimate. The pseudo-code summarizing the training procedure is presented in Algorithm~\ref{alg:em_promp}. Lines~\ref{alg:em_promp:estep:cov} and~\ref{alg:em_promp:estep:mean} correspond to the E-step and lines~\ref{alg:em_promp:mstep:mean_mle} to~\ref{alg:em_promp:mstep:noise} correspond to the M-step. The values~$\vect{\epsilon}_{nt} = \vect{y}_{nt} - \matr{\phi}_{nt}\wmean{n}$ are the residuals used to estimate the sensor noise. \begin{algorithm}[t] \begin{algorithmic}[1] \Require Demonstration dataset containing the joint states and corresponding normalized time stamps~$\matr{Y}=\{\vect{y}_{nt}, z_{nt}\}$ and the prior parameters $k_0, \vect{m}_0, v_0, \matr{S}_0$ \Ensure The ProMP parameters~$\vect{\mu}_\omega$, $\matr{\Sigma}_\omega$, $\matr{\Sigma}_y$ \State Compute matrices~$\matr{\phi}_{nt}=\matr{\phi}(z_{nt})$ with the basis functions~$\matr{\phi}$ \State Compute $L = \sum_{n=1}^N{\tau_n}$ \State Set some initial values for~$\vect{\mu}_\omega$, $\matr{\Sigma}_\omega$, $\matr{\Sigma}_y$. We use~$\vect{\mu}_\omega=\vect{0}$, $\matr{\Sigma}_\omega=\matr{I}$ and~$\matr{\Sigma}_y=\matr{I}$. \While{Not converged} \For{ $n \in \{1,\dots,N\}$ } \State $\wcov{n} \gets \left(\Sigma_\omega^{-1} + \sum_{t=1}^{\tau_n}{\trans{\matr{\phi}_{nt}}\matr{\Sigma}_y^{-1}\matr{\phi}_{nt}}\right)^{-1}$ \label{alg:em_promp:estep:cov} \State $\wmean{n} \gets \wcov{n}\left(\matr{\Sigma}_\omega^{-1}\vect{\mu}_\omega + \sum_{t=1}^{\tau_n}{\trans{\matr{\phi}_{nt}}\matr{\Sigma}_y^{-1}\vect{y}_{nt}}\right)$ \label{alg:em_promp:estep:mean} \EndFor \State $\muwmle \gets \frac{1}{N}\left(\sum_{n=1}^N {\wmean{n}}\right)$ \label{alg:em_promp:mstep:mean_mle} \State $\vect{\mu}_\omega \gets \frac{1}{N + k_0}\left( k_0 \vect{m}_0 + N \muwmle \right)$ \label{alg:em_promp:mstep:mean} \State $\swmle \gets \frac{1}{N}{\sum_{n=1}^N{\left(\wcov{n} + (\wmean{n} - \vect{\mu}_\omega)\trans{(\wmean{n} - \vect{\mu}_\omega)}\right)}}$ \label{alg:em_promp:mstep:cov_mle} \State $\matr{\Sigma}_\omega \gets \frac{1}{N + v_0 + KD + 1}\left[\matr{S}_0 + N\swmle\right]$ \label{alg:em_promp:mstep:cov} \State $\matr{\Sigma}_y \gets \frac{1}{L}\sum_{n=1}^N{ \sum_{t=1}^{\tau_n}{\left[ \vect{\epsilon}_{nt}\trans{\vect{\epsilon}_{nt}} + \matr{\phi}_{nt}\wcov{n}\trans{\matr{\phi}_{nt}}\right]} }$ \label{alg:em_promp:mstep:noise} \EndWhile \State \Return~$\vect{\mu}_\omega$, $\matr{\Sigma}_\omega$ and~$\matr{\Sigma}_y$. \end{algorithmic} \caption{Expectation Maximization algorithm to train a ProMP from demonstrations} \label{alg:em_promp} \end{algorithm} \begin{comment} \begin{align} \muwmle &= \frac{1}{N}(\sum_{n=1}^N {\wmean{n}}), \label{alg:em_promp:mstep:mean_mle} \\ \swmle &= \frac{1}{N}{ \sum_{n=1}^N{\left(\wcov{n} + (\wmean{n} - \vect{\mu}_\omega) \trans{(\wmean{n} - \vect{\mu}_\omega)}\right)} }, \label{alg:em_promp:mstep:cov_mle} \\ \matr{\Sigma}_y &= \frac{1}{L}\sum_{n=1}^N{ \sum_{t=1}^{\tau_n}{\left[ \vect{r}_{nt}\trans{\vect{r}_{nt}} + \matr{\phi}_{nt}\wcov{n}\trans{\matr{\phi}_{nt}}\right]} }, \label{alg:em_promp:mstep:noise} \end{align} \end{comment} \subsection{Prior Distribution} We use a Normal-Inverse-Wishart as a prior distribution over the ProMP parameters~$\vect{\mu}_\omega$ and~$\matr{\Sigma}_\omega$, given by \begin{align*} p(\vect{\mu}_\omega,\matr{\Sigma}_\omega) &= \niw{\vect{\mu}_\omega,\matr{\Sigma}_\omega}{k_0}{\vect{m}_0}{v_0}{\matr{S}_0} \\ &= \normal{\vect{\mu}_\omega}{\vect{m}_0}{\frac{1}{k_0}\matr{\Sigma}_\omega} \invwish{\matr{\Sigma}_\omega}{v_0}{\matr{S}_0}, \end{align*} where~$\invwish{\matr{\Sigma}_\omega}{v_0}{\matr{S}_0}$ is an inverse Wishart distribution, used frequently as a prior for covariance matrices. The main reason why we decided to use a Normal-Inverse-Wishart prior for the ProMP model is because it is a conjugate prior, resulting in closed form updates for the parameters in the EM algorithm and simplifying the inference process. Furthermore, the parameters of this prior distribution have a simple interpretation. Lines~\ref{alg:em_promp:mstep:mean_mle} and~\ref{alg:em_promp:mstep:cov_mle} compute the Maximum Likelihood estimates (MLE)~$\muwmle$ and~$\swmle$. Lines~\ref{alg:em_promp:mstep:mean} and~\ref{alg:em_promp:mstep:cov} compute the MAP estimates~$\vect{\mu}_\omega$ and~$\matr{\Sigma}_\omega$. Note that the MAP estimates are a weighted average of the MLE estimates~$\muwmle$ and~$\swmle$ and the assumed prior parameters for the mean~$\vect{m}_0$ and covariance~$\matr{S}_0$ respectively. In the limit of infinite data, the MAP estimates converge to the MLE estimates. We use a non informative prior for~$\vect{\mu}_\omega$ in our experiments by setting~$k_0 = 0$. Note that by setting~$k_0=0$, the MAP estimate~$\vect{\mu}_\omega$ becomes the MLE estimate~$\muwmle$. If a large number of basis functions is used, a sensible choice for the prior parameters is to use~$\vect{m}_0=\vect{0}$ and $k_0>0$. Such a prior will prevent large values on the estimated vector~$\vect{\mu}_\omega$, similar to the regularization used in Ridge Regression. \begin{figure} \centering \setlength\figurewidth{8cm} \setlength\figureheight{5cm} \setlength\axislabelsep{0mm} \tikzsetnextfilename{logcondsw2} \input{fig/convergence/log_cond_sw_2} \caption { \rev{ Conditioning number of the covariance matrix~$\matr{\Sigma_w}$ obtained with multiple learning algorithms. Intuitively, a lower matrix condition number for~$\matr{\Sigma}_w$ translates into more robustness and numerical stability. The conditioning number is presented in logarithmic scale. Note that the condition number stabilizes around 6 demonstrations for Maximum A Posteriori (MAP), whereas Maximum Likelihood (MLE) and the Least Squares method (\alexp{}) with different regularization values~$\lambda$ requires around 50 demonstrations. In consequence, to avoid numerical problems the Prior distributions should be used unless a very large amount of data is available. } } \label{fig:promp:cond} \end{figure} For~$\matr{\Sigma}_\omega$ we use an informative prior. Intuitively, the parameter~$v_0$ of the inverse Wishart prior represents how confident we are about our initial guess of the value of~$\matr{\Sigma}_\omega$ before looking at the data. We use~$v_0=\dim(\vect{\omega})+1$, that is the minimum value for~$v_0$ that results in a proper prior distribution~\cite{murphy2012machine}. We set the prior parameter~$\matr{S}_0$ as \begin{equation} \matr{S}_0 = (v_0 + KD + 1)\blockdiag(\swmle), \label{eq:promp:s0} \end{equation} where~$\swmle$ is the maximum likelihood estimate of~$\matr{\Sigma}_w$ computed in line~\ref{alg:em_promp:mstep:cov_mle} of Algorithm~\ref{alg:em_promp}. Intuitively, the prior distribution favors considering joints independent when few data is available and gradually learn the correlation of different joints as more data is obtained. Using~\eqref{eq:promp:s0}, the update equation for~$\matr{\Sigma}_\omega$ on line~\ref{alg:em_promp:mstep:cov} of Algorithm~\ref{alg:em_promp} can be written as \[\matr{\Sigma}_\omega = \frac{1}{N + N_0}\left[N_0\blockdiag(\swmle) + N\swmle\right],\] with~$N_0 = v_0 + KD + 1$. Note that the MAP estimate of~$\matr{\Sigma}_\omega$ is a linear combination of the full MLE estimate and the MLE estimate under the assumption that all joints are independent. With a large number of trials~$N$, the MAP estimate will converge to the MLE estimate as expected. One of the reasons why we recommend using an informative prior for~$\matr{\Sigma}_\omega$, is because its MLE estimate is typically numerically unstable. We used the matrix condition number~$\kappa(\matr{\Sigma}_\omega)$ to measure numerical stability of the Maximum A Posteriori (MAP) and Maximum Likelihood Estimator (MLE) estimates of~$\matr{\Sigma}_\omega$. Intuitively, the condition number provides a measure of the sensitivity of an estimated value to small changes in the input data~\cite{belsley2005regression}. Therefore, a smaller the condition number means a more numerically stable estimate. Figure~\ref{fig:promp:cond} shows the change in the condition number for~$\matr{\Sigma}_\omega$ in logarithmic scale with respect to the number of training instances for both the MAP and MLE estimates. The condition number for the MAP estimate is depicted in blue, and stabilizes around 6 training instances. On the other hand, the MLE estimate depicted in red requires around 50 training instances to stabilize. \subsection{Relation to the Least Squares method to train ProMPs} \label{sec:rel_alex_method} \begin{algorithm}[t] \begin{algorithmic}[1] \Require Demonstration dataset containing the joint states and corresponding normalized time stamps~$\matr{Y}=\{\vect{y}_{nt}, z_{nt}\}$ and the prior parameters $k_0, \vect{m}_0, v_0, \matr{S}_0$ \Ensure The ProMP parameters~$\vect{\mu}_\omega$, $\matr{\Sigma}_\omega$, $\matr{\Sigma}_y$ \State Compute matrices~$\matr{\phi}_{nt}=\matr{\phi}(z_{nt})$ with the basis functions~$\matr{\phi}$ \State Compute $L = \sum_{n=1}^N{\tau_n}$ \State Set some initial values for~$\vect{\mu}_\omega$, $\matr{\Sigma}_\omega$, $\matr{\Sigma}_y$. We use~$\vect{\mu}_\omega=\vect{0}$, $\matr{\Sigma}_\omega=\matr{I}$ and~$\matr{\Sigma}_y=\matr{I}$. \label{alg:em_approx:param_init} \While{Not converged} \For{ $n \in \{1,\dots,N\}$ } \State Compute~$\wpoint{n}$ with \eqref{eq:em_approx:point_est} \label{alg:em_approx:estep:point_est} \EndFor \State $\muwmle \gets \frac{1}{N}\left(\sum_{n=1}^N {\wpoint{n}}\right)$ \label{alg:em_approx:mstep:mean_mle} \State $\vect{\mu}_\omega \gets \frac{1}{N + k_0}\left( k_0 \vect{m}_0 + N \muwmle \right)$ \label{alg:em_approx:mstep:mean} \State $\swmle \gets \frac{1}{N}{\sum_{n=1}^N{\left((\wpoint{n} - \vect{\mu}_\omega)\trans{(\wpoint{n} - \vect{\mu}_\omega)}\right)}}$ \label{alg:em_approx:mstep:cov_mle} \State $\matr{\Sigma}_\omega \gets \frac{1}{N + v_0 + KD + 1}\left[\matr{S}_0 + N\swmle\right]$ \label{alg:em_approx:mstep:cov} \State $\matr{\Sigma}_y \gets \frac{1}{L}\sum_{n=1}^N{ \sum_{t=1}^{\tau_n}{\left[ \vect{\epsilon}_{nt}\trans{\vect{\epsilon}_{nt}}\right]} }$ \label{alg:em_approx:mstep:noise} \EndWhile \State \Return~$\vect{\mu}_\omega$, $\matr{\Sigma}_\omega$ and~$\matr{\Sigma}_y$. \end{algorithmic} \caption{EM training algorithm with a Dirac delta approximation for the E-step} \label{alg:em_approx} \end{algorithm} An alternative method of training ProMPs was proposed by~\cite{paraschos2015model}. We show that the method proposed in~\cite{paraschos2015model} is a special case of the EM algorithm presented in this paper for the MLE case, with a single iteration and approximating the Gaussian distributions over the hidden variables~$\vect{\omega}_n$ with a Dirac delta distribution on the mean. The method presented in~\cite{paraschos2015model} consists of making point estimates of the hidden variables~$\vect{\omega}_n$ with least squares. Subsequently, the mean and covariance of the point estimates are used to estimate the ProMP parameters. The point estimates of~$\vect{\omega}_n$ are computed for every trajectory using \begin{equation} \vect{\omega}_n = (\trans{\matr{\Phi}_n}\matr{\Phi_n} + \lambda\matr{I})^{-1} \trans{\matr{\Phi}_n}\vect{y}_n, \label{eq:point_est:w} \end{equation} where~$\matr{\Phi}_n$ and~$\vect{y}_n$ are the vertical concatenation of the matrices~$\matr{\Phi}_{nt}$ and vectors~$\vect{y}_{nt}$ respectively, and $\lambda$ is a ridge regression parameter that can be set to zero unless numerical problems arise. Subsequently, the ProMP parameters can be estimated using the MLE estimates for Gaussian distributions \begin{align} \muwmle &= \frac{1}{N}\sum\nolimits_{n=0}^N{\vect{\omega}_n}, \label{eq:point_est:mle:mu_w} \\ \swmle &= \frac{1}{N}{ \sum\nolimits_{n=0}^N { (\vect{\omega}_n - \vect{\mu}_\omega) \trans{(\vect{\omega}_n - \vect{\mu}_\omega)} }. } \label{eq:point_est:mle:sigma_w} \end{align} \rev{ Figure~\ref{fig:promp:cond} shows the numerical stability of the matrix~$\matr{\Sigma}_\omega$ of equations~\eqref{eq:point_est:w} to~\eqref{eq:point_est:mle:sigma_w} using multiple values of~$\lambda$. Note that this training procedure has the same numerical stability issues that the MLE estimates independently of the value of $\lambda$. The reason is that the numerical problems do not come from the estimation of~$\omega$, where~$\lambda$ is being used, but from the estimation of the covariance matrix itself on~\eqref{eq:point_est:mle:sigma_w}. Note also that Figure~\ref{fig:promp:cond} displays the conditioning number of~$\matr{\Sigma}_\omega$ for this method using a minimum of 36 demonstrations. The reason is that using~\eqref{eq:point_est:mle:sigma_w} with~$N < KD$ would result in a rank deficient matrix~$\matr{\Sigma}_\omega$ whose condition number would be~$+\infty$. } \rev{ The discussed numerical issues of training a ProMP using~\eqref{eq:point_est:w} to~\eqref{eq:point_est:mle:sigma_w} make the learned model dangerous to use directly for robotic applications. In~\cite{paraschos2015model}, a small diagonal matrix is added to~$\matr{\Sigma}_\omega$ and in addition a artificial noise matrix~$\matr{\Sigma}_y^*$ needs to be used during conditioning. A very large number of training instances~$N >> KD$ would be required to be able to use~\eqref{eq:point_est:w} to~\eqref{eq:point_est:mle:sigma_w} without any additional tricks. Using the proposed prior distribution solves the numerical problems in a theoretically sound way, and in the limit of infinite amount of data it converges to the expected estimation procedure using maximum likelihood. } \rev{However, the estimation method proposed in Algorithm~\ref{alg:em_promp} differs from using~\eqref{eq:point_est:w} to~\eqref{eq:point_est:mle:sigma_w} in more than just using a prior distribution. To show the differences and similarities, } let us now analyze the EM algorithm presented in this paper if we approximate the E-step with a Dirac delta distribution. Note that using a Dirac delta distribution~$\delta(\vect{\omega}-\wpoint{n})$ means making a point estimate~$\wpoint{n}$ of the hidden variables~$\vect{\omega}_n$ without any uncertainty. The value of the point estimates~$\wpoint{n}$ is given by \begin{equation} \resizebox{0.85\hsize}{!}{ $\wpoint{n} = \left(\matr{\Sigma}_\omega^{-1} + \trans{\matr{\Phi}_{n}}\matr{\Sigma}_y^{-1}\matr{\Phi}_{t}\right)^{-1} \left(\matr{\Sigma}_\omega^{-1}\vect{\mu}_\omega + \trans{\matr{\Phi}_{n}}\matr{\Sigma}_y^{-1}\vect{y}_{n}\right).$ } \label{eq:em_approx:point_est} \end{equation} Algorithm~\ref{alg:em_approx} shows the resulting EM algorithm with the discussed approximation for the E-step. The quality of the approximation depends on how much uncertainty is there in the computation of the hidden variables. Let us further assume that we execute one single iteration of Algorithm~\ref{alg:em_approx} with initial values~$\matr{\Sigma}_\omega = \lambda^{-1}\matr{I}$, $\vect{\mu}_\omega = 0$ and~$\matr{\Sigma}_y = \matr{I}$. It is easy to see that the estimates~$\wpoint{n}$ would be exactly equivalent to the estimates~\eqref{eq:point_est:w} used by~\cite{paraschos2015model}. Note also that Lines~\ref{alg:em_approx:mstep:mean_mle} and~\ref{alg:em_approx:mstep:cov_mle} of Algorithm~\ref{alg:em_approx} compute also exactly the same estimates of~\cite{paraschos2015model} on~\eqref{eq:point_est:mle:mu_w} and~\eqref{eq:point_est:mle:sigma_w} for the ProMP parameters in the MLE case. We can conclude that the training procedure from~\cite{paraschos2015model} is equivalent to a single iteration of the approximated training procedure presented in Algorithm~\ref{alg:em_approx} on the MLE case with a particular initialization of the ProMP parameters. \rev{ We have already extensively discussed the advantages of using MAP estimates using the proposed prior distribution. The remaining questions we want to discuss are weather using uncertainty estimates and more than one EM iteration is helpful. } \rev{Estimating the uncertainty helps in applications where there is actually high uncertainty in the estimation of the hidden variables~$\vect{\omega}_n$ due for example to missing observations or high sensor noise. The answer of how much multiple iterations help depends entirely on the parameter initialization (see Line~\ref{alg:em_approx:param_init} of Algorithm~\ref{alg:em_approx}). Note that the only difference between the first iteration and the rest is that in the first iteration we are working entirely on our initial guess of the values of the ProMP parameters. Whereas in subsequent iterations we are using optimized estimates of the ProMP parameters. } \rev{ For our robot experiments, the sensor noise is on the order of~$10^{-3}$ radians and the number of samples per trajectory is between 200 and 500 per degree of freedom. Furthermore, there are no missing observations as we can always read the joint sensor values. With such a low signal to noise ratio and without missing observations the values of the hidden variables~$\vect{\omega}_n$ can be estimated very precisely and with low uncertainty. As we expected, we did not observe any difference in the performance in any our our robot experiments using the estimates produced by Algorithms~\ref{alg:em_promp} and~\ref{alg:em_approx}. In fact, the estimated parameters~$\vect{\mu}_\omega$ and~$\matr{\Sigma}_\omega$ produced by both algorithms are virtually the same. We can conclude that for modeling robot trajectories on a robot setup like ours, using the approximation of the E-step with a Dirac delta distribution does not impact the performance compared to the complete EM estimation. } \begin{figure} \centering \setlength\figurewidth{8cm} \setlength\figureheight{4cm} \setlength\axislabelsep{0mm} \tikzsetnextfilename{emballlhood} \input{fig/training/em_ball_lhood} \caption{ Log-Likelihood improvement with every iteration of the proposed EM algorithm presented in Algorithm~\ref{alg:em_promp} (A1) and the approximated version presented in Algorithm~\ref{alg:em_approx} (A5). Both algorithms make initially poor estimates of the hidden variables~$\vect{\omega}_n$. However, the proposed algorithm also captures the uncertainty over the estimates of the hidden variables, opposed to the approximated algorithm. As a result, the proposed algorithm continues to successfully improve the likelihood after the first iteration, whereas the approximated algorithm improves only marginally after the first iteration. } \label{fig:point_est:em_improve} \end{figure} \rev{ To show an example problem where uncertainty estimates are more important, we decided to run a small additional experiment where we use a ProMPs to model a table tennis ball trajectory. We collected 80 ball trajectories using the robot vision system, there are a few missing observations due to occlusion or errors in the image processing algorithms as well as a higher signal to noise ratio. Subsequently, we trained two models using the exact and approximated training algorithms. Finally, we tested the trained models predicting the ball position at time~$t=1.2 s$ given the first 160 milliseconds of ball observations. On this experiment, we used~$K=8$ basis functions and~$D=3$ dimensions. The initial parameters for both algorithms were~$\matr{\Sigma}_\omega = \matr{I}$, $\vect{\mu}_\omega = 0$ and~$\matr{\Sigma}_y = \matr{I}$ } Figure~\ref{fig:point_est:em_improve} shows the evaluation of the log likelihood for each iteration of the EM algorithm for both the proposed and the approximated versions. Both algorithms are provided the exact same data and use the exact same parameter initialization. Note that the proposed algorithm outperforms the approximated algorithm in this particular problem. \rev{ The distance between the ground truth ball position measured by the vision system and the position predicted by the ProMP models trained with Algorithm~\ref{alg:em_promp} is around~\textbf{10 cm}, whereas the error of the ProMP trained with Algorithm~\ref{alg:em_approx} is around~\textbf{50 cm}. } As a final argument in favour or using Algorithm~\ref{alg:em_promp} instead of Algorithm~\ref{alg:em_approx}, note that we are not gaining anything out of the approximation. The algorithmic complexity is exactly the same in both cases, and estimating the uncertainty does not hurt the learning algorithm even on the cases where it is very low and the approximation seems to be accurate. \section{Adaptation of Probabilistic Movement Primitives} \label{sec:promp:operators} \begin{figure*} \begin{subfigure}[b]{0.5\textwidth} \tikzsetnextfilename{tableprior} \resizebox{8cm}{4cm}{% \input{fig/task_dist/table_prior.tex} } \caption{} \label{fig:table_dist:prior} \end{subfigure} \begin{subfigure}[b]{0.5\textwidth} \tikzsetnextfilename{tablepost} \resizebox{8cm}{4cm}{% \input{fig/task_dist/table_post.tex} } \caption{} \label{fig:table_dist:post} \end{subfigure} \caption{ Task space distributions of the ball and the racket center before and after adapting the ProMP in task space. The distribution of the ball is presented in orange. Figure~\ref{fig:table_dist:prior} depicts in red the distribution of the center of the racket computed from the ProMP learned from human demonstrations. Subsequently, the ProMP is adapted to hit the ball using Algorithm~\ref{alg:mod_end_eff}, and the resulting ProMP is depicted in blue in Figure~\ref{fig:table_dist:post}. Note that the adapted ProMP is similar to the original ProMP learned from human demonstrations, but the probability mass is concentrated in the area that overlaps with the ball trajectory distribution. } \label{fig:table_dist} \end{figure*} Adapting a movement primitive by setting initial positions, desired via points or final positions is a necessary property to generalize to different situations. These desired via points could be specified in joint space or in task space. For example, a table tennis striking movement needs to start in the current joint configuration of the robot and later reach the predicted task space position of the table tennis ball. In this section, we present operators to adapt movement primitives in joint and in task space. In addition, we evaluate the execution time of these operators showing that they can all run in less than one millisecond on a standard computer, satisfying the real time requirements of the applications presented in this paper. \subsection{Adapting a ProMP in Joint Space} In the original formulation of ProMPs~\cite{proMP}, it was proposed to adapt a ProMP in joint space by conditioning on a desired observation~$\ytdes$ with some noise matrix~$\matr{\Sigma}_y^{*}$ that was referred to as the desired accuracy. However, the authors do not provide any intuition on how~$\matr{\Sigma}_y^{*}$ should be computed or estimated. In this paper, we follow the approach presented in previous work~\cite{gomez2016using} to adapt in joint space by conditioning in the distribution over joint trajectories to reach a particular value~$\vect{y}_t=\ytdes$ without any artificial accuracy matrix~$\matr{\Sigma}_y^{*}$. The reason why we do not need the artificial noise matrix~$\matr{\Sigma}_y^{*}$ opposed to~\cite{proMP} is that we do not suffer from numerical problems inverting~$\matr{\Sigma}_\omega$ due to the different training procedure. The conditioned distribution~$p(\vect{\omega}|\vect{y}_t = \ytdes) \propto p(\vect{y}_t = \ytdes|\vect{\omega})p(\vect{\omega})$ can be computed in closed form and is given by \begin{align*} p(\vect{\omega}|\vect{y}_t = \ytdes) &= \normal{\vect{\omega}}{\vect{m}_\omega}{\matr{S}_\omega}, \\ \vect{m}_\omega &= \matr{S}_\omega(\trans{\matr{\phi}_t}\matr{\Sigma}_y^{-1}\ytdes + \matr{\Sigma}_\omega^{-1}\vect{\mu}_\omega), \\ \matr{S}_\omega &= (\matr{\Sigma}_\omega^{-1} + \trans{\matr{\phi}_t}\matr{\Sigma}_y^{-1}\matr{\phi}_t)^{-1}. \end{align*} There are cases where we do not know the exact value of the desired joint configuration~$\ytdes$, but instead we have a probability distribution~$\ytdes \sim \normal{\ytdes}{\vect{\mu}_q}{\matr{\Sigma}_q}$. For example, in the table tennis task, we need condition the striking movement on the future position of the ball predicted using a Kalman filter. The distribution of the ball is, however, in task space. In Section~\ref{sec:promp:invkin}, we explain how to transform a target task space distribution to a joint space distribution. For the moment, we assume we have a target distribution in joint space, that we can marginalize using \[p(\vect{\omega}|\vect{\mu}_q,\matr{\Sigma}_q) = \int{p(\vect{\omega}|\vect{y}_t = \ytdes)\normal{\ytdes}{\vect{\mu}_q}{\matr{\Sigma}_q}\diff{\ytdes}},\] which can be computed in closed form obtaining \begin{align} p(\vect{\omega}|\vect{\mu}_q,\matr{\Sigma}_q) &= \normal{\vect{\omega}}{\vect{m}_\omega}{\matr{S}_\omega}, \nonumber \\ \vect{m}_\omega &= \matr{S}_\omega(\trans{\matr{\phi}_t}\matr{\Sigma}_y^{-1}\vect{\mu}_q + \matr{\Sigma}_\omega^{-1}\vect{\mu}_\omega), \label{eq:promp:cond:dist:mean_raw} \\ \matr{S}_\omega &= \matr{T}_\omega + \matr{T}_\omega\trans{\matr{\phi}_t}\matr{\Sigma}_y^{-1}\matr{\Sigma}_q \matr{\Sigma}_y^{-1}\matr{\phi}_t\matr{T}_\omega, \label{eq:promp:cond:dist:cov_raw} \end{align} with~$\matr{T}_\omega = (\matr{\Sigma}_\omega^{-1} + \trans{\matr{\phi}_t}\matr{\Sigma}_y^{-1}\matr{\phi}_t)^{-1}$. The ProMPs can also be adapted with desired velocities or accelerations using the same method, replacing the basis function matrices~$\matr{\phi}_t$ by their respective time derivatives~$\dot{\matr{\phi}_t}$ and~$\ddot{\matr{\phi}_t}$. The run time complexity for both adaptation operators is bounded by~$O(K^{3}D^{3})$. In our robot experiments we used a model with~$KD=35$, obtaining an average execution time of 0.044~ms. In the experimental section, we provide running times for different model sizes. The methods presented here to condition in a ProMP on a particular joint configuration~$\ytdes$ and desired joint distribution were already introduced in previous work~\cite{gomez2016using}. The comparison with the adaptation operator presented in~\cite{proMP} and the analysis of their execution time is new to this paper. \subsection{Probability Distribution of a ProMP in Task Space} \label{sec:promp:kinematics} \begin{comment} \begin{itemize} \item So far we have discussed how to learn and adapt probabilistic movement primitives in joint space. However, for many applications it is desirable to adapt a movement primitive on a task space objective like the cartesian coordinates of the robot end effector. \item Briefly describe what is forward and inverse kinematics. Maybe use the robot toy kinematics figure. From now on we assume we have a forward kinematics function we can evaluate. \item The fwd kinematics function is typically not linear, so the task space distribution can not be computed exactly from the joint space distribution. Some form of approximation is required. We linearize the forward kinematics function around the joint space mean. \item If it is possible to find a task space distribution with monte-carlo for a trained striking movement promp and compare it with the approximation to see how accurate it is, that would be very cool. \item Describe how to condition a ProMP in a task space objective. Maybe use toy kinematics figure to motivate why we want to do full approximated Bayesian inference using the trained ProMP as prior. Explain algorithm using an algorithm box. \end{itemize} \end{comment} We compute a probability distribution in task space from a ProMP learned in joint space making use of the geometry of the robot. We assume that we have access to a deterministic function~$\vect{x}_t = \vect{f}(\vect{y}_t)$ called the forward kinematics function that returns the position in task space $\vect{x}_t$ of a point of interest like the end effector of the robot given the joint state configuration $\vect{y}_t$. The deterministic forward kinematics function~$\vect{f}$, can be expressed in our probabilistic framework using \begin{equation*} p(\vect{x}_t | \vect{y}_t) = \delta(\vect{x}_t - \vect{f}(\vect{y}_t)), \label{eq:prob_fwd_kin} \end{equation*} where $\delta$ is the Dirac delta function. The task space distribution can be computed from the ProMP parameters learned in joint space using \[ p(\vect{x}_t|\vect{\theta}_\omega) = \int{ p(\vect{y}_t|\vect{\theta}_\omega) p(\vect{x}_t | \vect{y}_t) d\vect{y}_t}. \] The distribution~$p(\vect{x}_t|\vect{\theta}_\omega)$ can not be computed in closed form for a non-linear forward kinematics function. We compute an approximated distribution~$p(\vect{x}_t|\vect{\theta}_\omega)$ making a linear Taylor expansion of the forward kinematics function around the ProMP mean, obtaining \begin{equation} p(\vect{x}_t|\vect{\theta}_\omega) = \normal{ \vect{x}_t }{ \vect{f}(\matr{\Phi}_t\vect{\mu}_\omega) }{ \matr{J}_t\matr{\Sigma}_\omega\trans{\matr{J}_t} }, \label{eq:promp:task_dist} \end{equation} where~$\matr{J}_t=\matr{J}(\matr{\Phi}_t\vect{\mu}_\omega)$ is the Jacobian of the forward kinematics function~\cite{siciliano2010robotics} evaluated at~$\vect{y}_t = \matr{\Phi}_t\vect{\mu}_\omega$. Figure~\ref{fig:table_dist:prior} shows the task space distribution of a ProMP learned from demonstrations to strike a table tennis ball as well as some particular ball trajectory distribution. The distribution of the center racket is depicted in red and the distribution of the predicted ball trajectory is depicted in orange. \subsection{Adapting ProMPs in Task Space} \label{sec:promp:invkin} For many applications, it is more natural to define goals in task space. For instance, in robot table tennis the movement primitive should be adapted such that the position of the racket matches the predicted position of the ball. In this section, we present our approach to condition a ProMP learned in joint space to have a desired task space distribution. The approach we present in this section was also introduced in previous work~\cite{gomez2016using}. However, in this paper we evaluate it more thoroughly on a coffee preparation task with clear training and validation set to assess for generalization. We denote the desired task space state at time $t$ by the random variable $\vect{x}_t$, with probability distribution given by \begin{equation*} p(\vect{x}_t|\vect{\theta}_x) = \normal{\vect{x}_t}{\vect{\mu}_x}{\matr{\Sigma}_x}, \label{eq:promp:inv_kin:prior_x} \end{equation*} where the parameters~$\vect{\theta}_x = \{\vect{\mu}_x, \matr{\Sigma}_x\}$ are user inputs that represent the desired task space configuration and its uncertainty respectively. For the table tennis task, we use a Kalman filter as ball trajectory model. The Kalman filter provides an estimate for the mean ball position~$\vect{\mu}_x$ and its uncertainty~$\matr{\Sigma}_x$. Given a desired end effector position~$\vect{x}_t$ and a ProMP with parameters~$\vect{\theta}_\omega=\{\vect{\mu}_\omega,\matr{\Sigma}_\omega\}$, a probability distribution for the joint configuration can be computed by \begin{equation} p(\vect{y}_t|\vect{x}_t,\vect{\theta}_\omega) \propto p(\vect{x}_t|\vect{y}_t)p(\vect{y}_t|\vect{\theta}_\omega), \label{eq:promp:inv_kin:point_post} \end{equation} where~$p(\vect{x}_t|\vect{y}_t)$ is given by~\eqref{eq:prob_fwd_kin} and~$p(\vect{y}_t|\vect{\theta}_\omega)$ is the joint space distribution given by the ProMP. The distribution~$p(\vect{y}_t|\vect{x}_t,\vect{\theta}_\omega)$ represents a compromise between staying close to the demonstrated trajectories and achieving the desired racket configuration. Thus, for a robot arm with redundant degrees of freedom, where multiple joint space configurations can achieve the desired racket configuration, the presented approach will prefer joint solutions that are closer to the demonstrated behavior. To achieve the desired task space distribution~$p(\vect{x}_t|\vect{\theta}_x)$ instead of a particular value~$\vect{x}_t$, we marginalize out~$\vect{x}_t$ from~\eqref{eq:promp:inv_kin:point_post} obtaining \begin{equation} \begin{split} p(\vect{y}_t|\vect{\theta}_x,\vect{\theta}_\omega) &= \int{p(\vect{y}_t|\vect{x}_t,\vect{\theta}_\omega)p(\vect{x}_t|\vect{\theta}_x)\diff{\vect{x}_t}} \\ &\propto p(\vect{y}_t|\vect{\theta}_\omega)\int{p(\vect{x}_t|\vect{\theta}_x)p(\vect{x}_t|\vect{y}_t)\diff{\vect{x}_t}}. \end{split} \label{eq:promp:inv_kin:post_raw} \end{equation} Note that~$p(\vect{y}_t|\vect{\theta}_x,\vect{\theta}_\omega)$ is a distribution in joint space that again compromises between staying close to the demonstrated behavior and achieving the desired task space distribution. The integral in~\eqref{eq:promp:inv_kin:post_raw}, required to compute the normalization constant of~$p(\vect{y}_t|\vect{\theta}_x,\vect{\theta}_\omega)$, is intractable. We used Laplace Approximation~\cite{bishop2006pattern} to compute a Gaussian approximation for~$p(\vect{y}_t|\vect{\theta}_x,\vect{\theta}_\omega)$. With a Gaussian distribution for~$p(\vect{y}_t|\vect{\theta}_x,\vect{\theta}_\omega)$, the operator to adapt ProMPs in joint space discussed in Section~\ref{sec:promp:operators} can be used to obtain a new adapted ProMP. \begin{algorithm}[t] \begin{algorithmic}[1] \Require Parameters of desired task space distribution~$\vect{\theta}_x=[\vect{\mu}_x, \matr{\Sigma}_x]$ and ProMP to adapt~$\vect{\theta}_\omega=[\vect{\mu}_\omega, \matr{\Sigma}_\omega]$. \Ensure A new ProMP modulated to strike the ball \State $\vect{\mu}_q \gets \argmax_{\vect{y}_t}{\left(\log{p(\vect{y}_t|\vect{\theta}_x,\vect{\theta}_\omega)}\right)}$ \label{alg:mod_end_eff:mean} \State Compute $\matr{\Lambda}_q$ as the second derivative of $\log{p(\vect{y}_t|\vect{\theta}_x, \vect{\theta}_\omega)}$ with respect to $\vect{y}_t$ evaluated at $\vect{y}_t = \vect{\mu}_q$ \label{alg:mod_end_eff:hessian} \State $\matr{\Sigma}_q \gets \matr{\Lambda}_q^{-1}$ \label{alg:mod_end_eff:cov} \State Compute $\vect{m}_\omega$ and $\matr{S}_\omega$ with \eqref{eq:promp:cond:dist:mean_raw} and \eqref{eq:promp:cond:dist:cov_raw} \State \Return new ProMP with $\vect{\mu}_\omega=\vect{m}_\omega$ and $\matr{\Sigma}_\omega=\matr{S}_\omega$ \end{algorithmic} \caption{Algorithm to adapt a ProMP in task space using Laplace Approximation} \label{alg:mod_end_eff} \end{algorithm} Algorithm~\ref{alg:mod_end_eff} describes the procedure to adapt a ProMP in task space using Laplace Approximation. The mean~$\vect{\mu}_q$ and covariance~$\matr{\Sigma}_q$ of the approximated joint space distribution are computed in Lines~\ref{alg:mod_end_eff:mean} and~\ref{alg:mod_end_eff:cov} respectively. The presented operator for task space conditioning consists of a non linear optimization to compute~$p(\vect{y}_t|\vect{\theta}_x,\vect{\theta}_\omega)$ followed by a use of the joint space conditioning operator. As a result, the task space conditioning operator is necessarily slower than the joint space conditioning operator. In Section~\ref{sec:promp:operators:runtime}, we show that the execution time of the presented operator is nonetheless reliably below 3 milliseconds for ProMP sizes up to~$KD=350$, satisfying the real time requirements of our robot applications by a large margin. Figure~\ref{fig:table_dist} depicts the task space distribution of a ProMP learned from forehand strike demonstrations before~\ref{fig:table_dist:prior} and after~\ref{fig:table_dist:post} adapting it to hit a ball trajectory seen at test time. Note that the adapted ProMP has the probability mass concentrated in the region that overlaps with the ball trajectory distribution. \subsection{Execution Time of the Presented Operators} \label{sec:promp:operators:runtime} \begin{table} \centering \begin{tabular}{@{}lll@{}} \toprule {\bf $KD$} & {\bf Joint Space [ms]} & {\bf Task Space [ms]} \\ \midrule 35 & $0.0448 \pm 0.0164$ & $0.7212 \pm 0.2920$ \\ 70 & $0.0642 \pm 0.0104$ & $0.8328 \pm 0.5484$ \\ 140 & $0.1880 \pm 0.0245$ & $1.0764 \pm 0.3179$ \\ 210 & $0.5294 \pm 0.5879$ & $1.4291 \pm 0.2423$ \\ 280 & $0.8686 \pm 0.7944$ & $1.9267 \pm 0.3822$ \\ 350 & $1.2095 \pm 0.4829$ & $2.3173 \pm 0.3135$ \\ \bottomrule \end{tabular} \caption{ Average execution time of joint and task space conditioning operators in milliseconds for ProMPs of different sizes. The task space operator uses internally the joint space operator, as a result is has a higher execution time. The size of a ProMP is given by the product between the number of degrees of freedom~$D$ and the number of kernels per degree of freedom~$K$. The table presents the mean and standard deviation of the running times for each operator in milliseconds. For robot table tennis, all these operators need to be executed after the ball trajectory is predicted using ball observations and a ball model. In consequence, it is crucial to be able to apply these operators fast enough to successfully hit the already flying ball. } \label{tab:results:time} \end{table} Many use cases for the operators presented in this paper to adapt the movement primitives will have real time execution requirements. If we want to adapt a movement primitive with respect to sensor values measured at time~$t_1$ and subsequently execute the movement primitive in the robot at time~$t_2$, the total execution time for the operator cannot exceed $t_2-t_1$. For example, to make sure that the executed movement primitive starts on the current robot joint state, we use the joint conditioning operator on the measured joint state just before starting the execution of the movement primitive. For our robot experiments, we used a control loop of 500 Hertz. Therefore, we have a real time constrain of 2~ms to read the sensor value for the joint state, condition the ProMP to start at the measured value and send the required motor commands. Table~\ref{tab:results:time} show the average execution time and standard deviation in milliseconds for the operators presented in this paper. Each operator is executed 1000 times for each of the different sizes of ProMPs in a Lenovo Thinkpad X2 Carbon laptop with a processor Intel Core i7-6500U 2.50GHz and 8 GB of RAM. We report the size as the product of the degrees of freedom~$D$ and the number of basis functions per degree of freedom~$K$. On our robot experiment we used a ProMP with size~$K=5$ and~$D=7$, that corresponds to the smallest entry in Table~\ref{tab:results:time}. However, note that even on a ProMP with~$KD=350$ we can meet the real time requirements to play robot table tennis. The operator to condition in joint space can be reliably run under the 2 milliseconds required for our control loop of 500 Hertz. The vision system we use in this paper produces 60 ball observations per second. Therefore, we can potentially correct the ProMP trajectory to changes in the ball trajectory after every ball observation with a running time below 16 milliseconds. Note that our task space conditioning operator runs reliably under 3 milliseconds, satisfying the real time requirements by a large margin. \begin{comment} \begin{table} \centering \begin{tabular}{@{}ll@{}} \toprule {\bf ProMP Operator} & {\bf Time (ms)} \\ \midrule Joint Space Conditioning & $0.0448 \pm 0.0164$ \\ Task Space Conditioning & $0.7212 \pm 0.2920$ \\ Task Space Distribution & $0.0083 \pm 0.0052$ \\ \bottomrule \end{tabular} \caption{ Average execution time and standard deviation of different ProMP operators. The table presents the mean and standard deviation of the running times for each operator in milliseconds. All the operators run in less than one millisecond. For robot table tennis, all these operators need to be executed after the ball trajectory is predicted using ball observations and a ball model. In consequence, it is crucial to be able to apply these operators fast enough to successfully hit the already flying ball. } \label{tab:results:time} \end{table} \end{comment} \begin{comment} \subsection{Additional Operators for Hitting Movements} The operators introduced in Sections~\ref{sec:promp:operators} and~\ref{sec:promp:kinematics} are general purpose operators that can be used on any application to adapt ProMPs in joint space or task space. Application specific knowledge can also be incorporated into probabilistic frameworks in the form of likelihoods or prior distributions. In this section we introduce a task specific operator to determine the staring time of the hitting movement primitive that maximizes the likelihood of hitting the ball. Learning an appropriate initial time of a movement to strike a ball just from human demonstrations is not easy. The moment to start the hitting movement depends highly on the current ball trajectory, and its correct estimation is crucial to hit the ball. In~\cite{mulling2011biomimetic}, the Virtual Hitting Plane (VHP) method is used to estimate the hitting time. The VHP method consists on computing a hitting point as the intersection between the predicted ball trajectory mean and a predefined plane. Subsequently, the start time is computed based on the predicted hitting time. The VHP approach assumes that the optimal hitting points are always located on a predefined plane~\cite{jap_tt_cart}. One disadvantage of this approach is that finding a particular hitting plane that works for a diverse set of ball trajectories is hard. In this section we define the likelihood of hitting the ball. The hitting point and hitting time are marginalized out in the formulation of this likelihood. As a result, the proposed method makes no assumption on the location of the hitting points unlike the VHP method. \subsubsection{Likelihood of Hitting the Ball} \label{sec:methods:hit_lh} \newcommand{\discxr}[0]{\tilde{x}_r} \newcommand{\discxb}[0]{\tilde{x}_b} \newcommand{\discx}[0]{\tilde{x}} \newcommand{\contxb}[0]{\vect{x}_b} \newcommand{\contxr}[0]{\vect{x}_r} \newcommand{\cdiff}[0]{\vect{z}} Let~$\contxb(t)$ and~$\contxr(t)$ be random variables that represent the position of the ball and the racket at time $t$ respectively. We say that the racket hits the ball at time~$t$ if~$\contxb(t)=\contxr(t)$, ignoring for simplicity the geometry of the ball and the racket. For brevity, we will drop the time~$t$ from the notation unless it is necessary. Let us define a new continuous random variable~$\cdiff(t) = \contxb(t) - \contxr(t)$ representing the difference between the position of the ball and the racket. The ProMP is learned from recorded robot trajectories independently of the ball trajectories. As a result, the probability distributions of the racket~$p(\vect{x}_r(t))$ and the ball~$p(\vect{x}_b(t))$ are independent, and the probability distribution of~$\cdiff$ is given by \begin{equation} p(\cdiff) = \int{p(\contxb=\vect{x})p(\contxr=\vect{x}-\cdiff)\diff{\vect{x}}}. \label{eq:hit:diff_dist} \end{equation} Note that~$p(\cdiff)$ is a probability density function. The event of hitting the ball, formalized as~$\discxr=\discxb$, corresponds to~$\cdiff=\vect{0}$ on the probabilistic formulation. If we evaluate the density on~$\cdiff=\vect{0}$, we obtain \begin{equation} p(\cdiff=\vect{0}) = \int{p(\contxb=\vect{x})p(\contxr=\vect{x})\diff{\vect{x}}}. \label{eq:hit:continuous} \end{equation} In this paper, the probability distribution of the trajectory of the ball is computed using a Kalman Filter and the distribution of the racket is computed from the ProMP using the operator described in Section~\ref{sec:promp:kinematics}. A solution for~\eqref{eq:hit:continuous} can be efficiently found in closed form~\cite{prod_conv_gaussians} because~$\vect{x}_b(t)$ and~$\vect{x}_r(t)$ are Gaussian distributed. Given a ball trajectory, the initial time of the movement primitive is computed by maximizing the likelihood of hitting the ball. To increase the robustness of the algorithm, we marginalize the hitting time with a prior distribution~$p_h(t)$, computing the likelihood of hitting the ball~$H(\vect{\theta}_h)$ as \begin{equation} H(\vect{\theta}_h)=\int_{t_0}^{T}{p(\cdiff(t)=\vect{0})p_h(t)\diff{t}}, \label{eq:promp:time_sync:overlap} \end{equation} where~$\vect{\theta}_h=(t_0,T)$ is the initial time and duration of the movement primitive. In previous work~\cite{gomez2016using}, a uniform prior distribution over time~$p_h(t)$ was used to find the optimal starting time. As a result, the ball was hit mostly at the beginning or the end of the striking movement, where the speed of the racket was low and hitting the ball was easier. However, to send the ball to the opponent's side of the table a higher racket velocity is desirable. In this paper, a Gaussian distribution~$p_h(z) = \normal{z}{\mu_z=0.5}{\sigma_z=0.1}$ was used, where~$z=(t-t_0)/T$ is the time variable normalized to be between zero and one. Note that this prior assigns higher probability mass to hit the ball in the middle of the movement, where the velocity of the movement is higher. As a result, the rate of balls returned to the opponent side of the table increased from~3\% to~47\%. \subsubsection{Safety in the Execution of the Movement} Previous approaches to robot table tennis use complex heuristics to ensure that the planned trajectories are safe to execute. Common heuristics include detection of collisions between the robot and the table~\cite{ik_obstacle_avoid}, verification that the planned trajectory do not exceed the joint limits~\cite{ik7dof}, etc. Having good heuristics to ensure safe movements is important in table tennis. It is easy to find unexpected events that could result in dangerous movements for the robot. For instance, if the ball hits the net, then rolls on the table, and the robot still attempts to hit the ball, it will also hit the table. We use a threshold on the likelihood of hitting the ball as the unique safety measure. If the likelihood of hitting the ball before conditioning the ProMP is very low, it is because the movement required to hit the current ball trajectory is very different from the human demonstrated behavior. Our intuition for using the threshold as a security measure is that movements that are similar to the human demonstrations are safe to execute. Using only this simple heuristic, no dangerous movement has been executed by the robot in more than 2000 robot trials used for the experiments on this paper, previous work, and robot demonstrations to the public. \end{comment} \section{Relation between the ProMP and the Gaussian Process Models} In this paper, we represent the robot trajectories as multivariate functions of time. Subsequently, we define a probability distribution over those multivariate functions of time using ProMPs. Gaussian Processes are commonly used as probability distributions over functions. In this section, we present the relation between Gaussian Process models and ProMPs. Let us introduce a new random variable~$\vect{f}_t = \matr{\Phi}_t\vect{\omega}$ to the presented ProMP framework. Note that~$\vect{f}_t$ can be deterministically computed if~$\vect{\omega}$ is given, and that the observed variable~$\vect{y}_t = \vect{f}_t + \vect{\epsilon}_y$. Intuitively, the variable~$\vect{f}_t$ represents a noiseless observation of a function~$\vect{f}(t)$. Given~$m$ observations of the function~$\vect{f}(t)$ at different times~$t_1,t_2,\dots,t_m$, we stack them together in a single vector~$\vect{f}$ as \[ \vect{f} = [\vect{f}(t_1),\vect{f}(t_2),\dots,\vect{f}(t_m)]. \] The distribution of~$\vect{f}$ can be computed in closed form marginalizing~$\vect{\omega}$, obtaining \begin{equation*} p(\vect{f}) = \normal{\vect{f}}{ \matr{\Phi}\vect{\mu}_\omega }{ \matr{\Phi}\matr{\Sigma}_\omega\trans{\matr{\Phi}} }, \label{eq:promp:gp} \end{equation*} where~$\matr{\Phi}=[\matr{\Phi}_1,\dots,\matr{\Phi}_m]$ is the vertical concatenation of the matrices~$\matr{\Phi}_t$ for all the observation pairs~$[t,\vect{f}(t)]$. Note that independently of the number of observations~$m$, the joint distribution of~$\vect{f}$ is multivariate Gaussian after marginalizing~$\vect{\omega}$. Therefore, the ProMP formulation presented in this paper is a special case of a Multiple Output Gaussian Process (MOGP) with a mean function for output~$d$ given by \[\vect{\mu}_d(t) = \trans{\vect{\phi}_d(t)}\vect{\mu}_\omega^{d},\] and covariance function for outputs~$d_1$ and~$d_2$ given by \[k_{(d_1,d_2)}(t_1,t_2) = \trans{\vect{\phi}_{d_1}(t_1)}\matr{\Sigma}_\omega^{(d_1,d_2)}\vect{\phi}_{d_2}(t_2).\] We decided to use the ProMP formulation instead of the MOGP formulation for computational reasons. However, the operators presented in this paper to adapt the movement primitives in task space and computing the likelihood of hitting the ball can be used also with any MOGPs. The computational cost of applying the adapting operators and making predictions in the ProMP model only depends on the number of basis functions and degrees of freedom of the robot. Therefore, once the number of basis functions and degrees of freedom of the robot are fixed the computational cost of all the real time operators is fixed. On the other hand, the computational cost of applying the adapting operators or making predictions with MOGPs would vary depending on the number of joint observations. \section{Appendix Title Goes Here} Appendix one text goes here. \section{} Appendix two text goes here. \section*{Acknowledgment} The authors would like to thank... \end{comment} \section{Experiments and Results} \label{sec:experiments} \begin{comment} \begin{itemize} \item Explain the entire experiment setup, and the players that are being tested \item Explain well the differences between the current paper and previous work with respect to all the players being mesured \item Explain the meaning of Hit, Miss and No Move \item Make a small experiment on efficiency (How long does it take to execute the adapting operators of the real ProMP on a standard computer?) \item Discuss about the choice of basis functions. Why combine RBFs and polynomial. \end{itemize} \end{comment} \begin{figure} \centering \setlength\figurewidth{8cm} \setlength\figureheight{4cm} \setlength\axislabelsep{0mm} \tikzsetnextfilename{superposed} \input{fig/convergence/superposed} \caption{ Convergence of the ProMP parameters as a function of the number of training instances in an adversarial scenario. The convergence of different sets of parameters is depicted with different colors. The set of parameters corresponding to the mean behavior, variability of the movement, and correlation between joints are depicted in red, blue and green respectively. } \label{fig:conv:superposed} \end{figure} We evaluate the presented methods with synthetic data and with a real robot experiments for table tennis and assisting coffee brewing. For the robot experiments we used Barrett WAM arm with seven degrees of freedom capable of high speed motion. The robot control computer uses a 500~Hz control loop, receiving joint angle measures and output motor commands every 2~ms. To track the position of objects of interest like the table tennis ball and the coffee machine, we used four Prosilica Gigabit cameras and the vision system described in~\cite{lampert2012vision}. This vision system tracks the position of a table tennis ball with an approximate frequency of 60~Hz, we attached a table tennis ball to the coffee machine for the coffee brewing experiments. On all our robot experiments we used five basis functions per degree of freedom. Fifth~\cite{mulling2011biomimetic} and third~\cite{KOC2018} order polynomials have been previously used successfully for robot table tennis approaches. Note that the same results should be achievable with a ProMP with six or four polynomial basis functions respectively taking into account the constant term. On the other hand, radial basis functions (RBFs) have been typically used with ProMPs~\cite{proMP} for other robot applications. We tried different combinations of RBFs and polynomial basis functions, obtaining the best results using three RBFs and a first order polynomial, for a total of five basis functions. \subsection{Parameter Convergence on Synthetic Data} The purpose of the experiment with synthetic data, is to evaluate how accurate are the estimates of the ProMP parameters as a function of the number of training instances~$n$ when the assumptions we made for the prior distribution are incorrect. We generate synthetic data from a reference ProMP that displays a strong correlation between different degrees of freedom, opposing the proposed prior assumptions. Subsequently, we test if the proposed learning procedure converges to the expected parameters and how many training examples are necessary for convergence. \begin{figure} \centering \includegraphics[width=6cm]{img/coffee.png} \caption{ The robot executing the coffee task. First, the robot moves towards the top of the coffee grinder to pour fresh beans into it. Subsequently, the robot moves towards the bottom of the grinder to pick the grounds. Finally, the robot deposits the coffee grounds in the brewing chamber of the coffee machine. } \label{fig:coffee} \end{figure} On this synthetic data experiment there is no notion of training or test sets. We simply generate $n$~sample trajectories from a reference ProMP with known parameters~$\vect{\mu}_\omega$ and~$\matr{\Sigma}_\omega$. Subsequently, we train a new ProMP with the sampled trajectories obtaining a new set of parameters~$\hat{\vect{\mu}}_\omega^n$ and~$\hat{\matr{\Sigma}}_\omega^n$ and compare how close they are to the reference parameters~$\vect{\mu}_\omega$ and~$\matr{\Sigma}_\omega$ using the Frobenius norm. In this experiment we used five basis functions~$K=5$ and four degrees of freedom~$D=4$. To ensure a high correlation, we set the parameters of the base ProMP such that the last two degrees of freedom are the addition and subtraction of the first two degrees of freedom respectively. Figure~\ref{fig:conv:superposed} show the average parameter estimation error with respect to the number of training instances~$n$ for different set of parameters. The error over the parameters~$\vect{\mu}_\omega$ that represent the mean behavior is depicted in red. The error over the parameters~$\matr{\Sigma}_\omega$ are divided in the block diagonal terms that represent the captured variability of the movement (depicted in blue) and the rest of the parameters that represent the captured joint correlations (depicted in green). The error of the different set of parameters is normalized between zero and one to facilitate comparison, and the error curves are smoothed out using splines to facilitate visualization of convergence. Note that the learning algorithm converges to the true value as expected. However, more training examples are required to converge to the correlation parameters because the prior is favouring joint independence in a high joint correlation scenario. The effect of the proposed prior is to prefer independence between the joints in absence of strong evidence of correlation. The results from this experiment may suggest that the presented probabilistic framework require large amounts of data samples to learn a movement primitive. In contrast, we show we can learn a coffee-pouring and a table-tennis experiment that the proposed approach, using only two and eight training examples respectively. There are two main explanations why we can converge with fewer training instances to the target performance on different tasks. First, the prior distribution assumptions may be more accurate in some real world tasks than in the adversarial example chosen in this section. Second, we can not compare convergence in parameter space to convergence in the performance of a particular task. The reason is that there might be multiple different parameter values with a similar task performance. \subsection{Assisting Coffee Brewing} \begin{figure} \centering \tikzsetnextfilename{coffeepattern} \begin{tikzpicture} \draw (0cm,0cm) rectangle (8.5cm,6.0cm); \node[draw,circle,fill=green] at (0.4cm,0.4cm) {$T_1$}; \node[draw,circle,fill=green] at (8.1cm,5.6cm) {$T_2$}; \node[draw,circle,fill=green] at (8.1cm,0.4cm) {$T_3$}; \node[draw,circle,fill=green] at (0.4cm,5.6cm) {$T_4$}; \node[draw,circle,fill=green] at (4.65504201681cm,2.98893375532cm) {$T_5$}; \node[draw,circle,fill=green] at (1.58cm,3.0cm) {$T_6$}; \node[draw,circle,fill=green] at (2.48214285714cm,4.82135155949cm) {$T_7$}; \node[draw,circle,fill=green] at (2.47010519172cm,1.17638276213cm) {$T_8$}; \node[draw,circle,fill=green] at (6.59261704682cm,4.49061910478cm) {$T_9$}; \node[draw,circle,fill=green] at (6.59407518797cm,1.50546079484cm) {$T_{10}$}; \node[draw,circle,fill=red] at (8.1cm,2.94693877551cm) {$V_1$}; \node[draw,circle,fill=red] at (4.64285714286cm,0.4cm) {$V_2$}; \node[draw,circle,fill=red] at (4.64285714286cm,5.6cm) {$V_3$}; \node[draw,circle,fill=red] at (0.557142857143cm,4.22040816327cm) {$V_4$}; \node[draw,circle,fill=red] at (0.557142857143cm,1.77959183673cm) {$V_5$}; \node[draw,circle,fill=red] at (4.32857142857cm,4.32653061224cm) {$V_6$}; \node[draw,circle,fill=red] at (4.32857142857cm,1.67346938776cm) {$V_7$}; \node[draw,circle,fill=red] at (6.37142857143cm,3.26530612245cm) {$V_8$}; \node[draw,circle,fill=red] at (2.91428571429cm,2.31020408163cm) {$V_9$}; \node[draw,circle,fill=red] at (2.91428571429cm,3.68979591837cm) {$V_{10}$}; \end{tikzpicture} \caption{ Training and validation set pattern for the position of the coffee machine, designed to evaluate the generalization on a target area. The training pattern was selected with Lloyd's algorithm to cover the target area evenly, and is depicted with green circles. The evaluation pattern is depicted in red, and was selected to be far from the training points while covering evenly the target area. The numbers in the green and red circles represent the order used for training and validation positions for the coffee machine respectively. } \label{fig:coffee:pattern} \end{figure} A coffee preparation task was one of the tasks used to evaluate the proposed methods. We use an inexpensive coffee grinder and an Aeropress as a brewing method. Figure~\ref{fig:coffee} depicts the robot executing the steps required to prepare a cup of coffee. First, the robot needs to move to the top of the grinder and pour fresh coffee beans. Subsequently, the robot moves to place the spoon under the grinder funnel to pick the coffee grounds. Finally, the robot pours the coffee grounds into the brewing chamber. The coffee task requires sequencing movement primitives to pour coffee beans of grounds in different locations and picking the grounds from the grinder. At the same time, the robot should avoid hitting the grinder, coffee machine or the table to prevent damaging the robot, the coffee machines or spilling the coffee. Therefore, this task allows us to test the ability of the proposed framework to divide a complex task into multiple simpler primitives as well as learning from the teacher the right set of movements that avoid hitting external objects. Additionally, the movement primitives to pour or pick coffee should be adapted to the position of the coffee machine or the grinder in order to succeed. The position of these objects is obtained from the vision system in task space, providing an opportunity to test the operator to adapt movement primitives in task space. The operator to condition movement primitives in joint space is also used to start the executed movement primitive at the robot current joint position. For the coffee task we want to test how well the proposed approach adapts to changes in the position of the grinder or the coffee machine, whereas for the table tennis task the goal is to determine how well it adapts to changes in the ball trajectory. Note that the position of the grinder and coffee machine in different experiment trials is easy to control with relatively good precision, while controlling the table tennis ball trajectory between different experiment trials is virtually impossible. As a result, we decided to invest more effort in the experiment design to test the generalization ability of a single movement primitive in the coffee task. \begin{algorithm}[t] \begin{algorithmic}[1] \Require Training set positions~$\{T_{1},\dots,T_{10}\}$ and validation set positions~$\{V_{1},\dots,V_{10}\}$ from Figure~\ref{fig:coffee:pattern}. \Ensure Training set performance~$P^t_n$ and evaluation set performance~$P^v_n$ with~$n$ training samples for~$n \in \{1,\dots,10\}$. \For{ $n \in \{1,\dots,10\}$ } \State $\train(\{T_{1},\dots,T_{n}\})$ \State $P^t_n \gets \evaluate(\{T_{1},\dots,T_{n}\})$ \State $P^v_n \gets \evaluate(\{V_{1},\dots,V_{10}\})$ \EndFor \end{algorithmic} \caption{Procedure to test the generalization performance of a single ProMP on a pouring coffee experiment} \label{alg:coffee:exp} \end{algorithm} To test the generalization ability of a single movement primitive we focused on the movement that pours the coffee grounds in the coffee machine. We generated a pattern with training and evaluation positions for the coffee machine with a rectangular shape of 42cm x 59.4cm. This size corresponds exactly to an A2 format paper size that was printed for the experiments. To select a set of positions that covers evenly the training area we used Lloyd's algorithm~\cite{lloyd1982least}. For the evaluation set we used an algorithm that selected a set of points in the rectangle that maximized the distance to the training set. Figure~\ref{fig:coffee:pattern} shows a resized version of the resulting format for the training and the validation positions for the coffee machine as green and red circles respectively. The numbers on the circles represent the order of the events that should be used in the experiment, and we used them to test the performance on the training and validation sets as a function of the training data. In this experiment we evaluated the success rate of pouring coffee in the machine with a number of training instances varying from 1 to 10 training samples. The procedure to train and evaluate the performance is explained with detail as a pseudo-code in Algorithm~\ref{alg:coffee:exp}. In this pseudo-code the~$\train(\cdot)$ function consists on the human training the robot to pour coffee grounds on the coffee machine on the positions passed as argument, and the~$\evaluate(\cdot)$ function consists on the robot attempting to pour coffee on the specified positions and evaluating the success rate. For example, to evaluate the validation set performance with two training examples, we would train the robot to pour coffee on positions~$\{T_1, T_2\}$ and subsequently evaluate the pouring performance in positions~$\{V_1,\dots,V_{10}\}$. \rev{ We used coffee beans instead of coffee grounds on the pouring experiments to simplify the definition of success in a pouring attempt. A trial is considered successful if and only if all the beans end up in the brewing chamber after pouring. No spilling is allowed, a trial is considered failed if one or more beans fall out of the brewing chamber after the pouring movement is executed. } \begin{table} \centering \begin{tabular}{@{}ccc@{}} \toprule \bf{Training Samples} & \bf{Training} & \bf{Validation} \\ \midrule 1 & \rev{1/1} & \rev{1/10} \\ \{2,\dots,10\} & \rev{10/10} & \rev{10/10} \\ \bottomrule \end{tabular} \caption{ Summary of the results of the generalization performance experiment pouring coffee with a single ProMP. Using only two training samples was enough to generalize to all the target area. With one training sample (T1), the robot succeeded only for the provided training point (T1) and the closest of the validation points (V5), spilling coffee in the rest of the evaluated positions. The obtained results suggest that at least for this task the selected prior is a sensible choice. } \label{tab:coffee:results} \end{table} Table~\ref{tab:coffee:results} summarize the results of the pouring performance measured on this experiment. We expected a curve of generalization performance increasing slowly as a function of the number of training data, but the results obtained showed that after demonstrating the pouring movement only in~$T_1$ and~$T_2$ the robot could successfully generalize to all the \rev{validation points}. \rev{ With the same two training instances we tried to validate generalization in the points~$\{T_3,\dots,T_{10}\}$ and the robot successfully poured coffee in those positions as well. Note that the results presented in Table~\ref{tab:coffee:results} do not mean that the presented approach can generalize to any pouring point given only two demonstrations. If for example, we provide~$T_1$ and~$T_8$ as training examples and attempted to validate in the rest of the pouring area, not only the pouring is likely to fail but the resulting planned movement might be dangerous to execute. The ProMPs, as most machine learning methods that assume independently identically distributed data (IID), does not handle extrapolation well. The ProMP framework could be extended using transfer learning techniques~\cite{pan2010survey} to deal better with a non IID scenario, but such an extension is outside the scope of this paper. } With only one training instance of pouring the robot could not generalize well. However, note that the robot managed to pour successfully at the given training position and one of the validation positions. The validation position where the robot poured successfully was~$V_5$, that is the closest validation point to the given training point~$T_1$, as can be seen in Figure~\ref{fig:coffee:pattern}. The distance between~$T_1$ and~$V_5$ in the printed pattern is 10.4 cm. We also tried to validate the single training instance example on the points~$\{T_2,\dots,T_{10}\}$, but it failed spilling the coffee every time. An alternative method to solve the coffee task without learning from human demonstrations would require trajectory planning with collision avoidance in order to succeed. Additionally, common sense knowledge like keeping the spoon pointing up all the time except when the robot is pouring would have to be explicitly programmed. Instead, our approach learns these common sense knowledge and strategies to succeed avoiding collisions with the grinder and brewing chamber from the human demonstrations. In the next section we evaluate our method in a table tennis task. We believe that robot table tennis is significantly harder than the coffee task presented in this section for a number of reasons that we discuss with more detail in the following section. Unfortunately, it is very hard to control precisely the ball trajectory and as a result, we cannot provide detailed generalization performance as with the coffee task. Instead, we will focus on evaluating the hit and return rate performance compared to previous work. \subsection{Robot Table Tennis} Robot table tennis is a highly dynamic task difficult to play for robots and humans. Unlike the coffee task it has strong real time requirements. The timing of the movement is as important as the movement itself to succeed hitting and returning the ball. Furthermore, it is not trivial or obvious which kind on movements would result in success for a given ball trajectory, making this problem especially interesting for learning approaches that can uncover these patterns given a set of successful trial examples. In this section we evaluate the proposed approach in a robot table tennis setup. In this task we use a table tennis ball gun to throw balls to the robot. Subsequently, we measure weather or not the robot hits the ball and if the ball landed successfully in the opponent's court according to the table tennis rules. For all the experiments presented in this section, we collected eight human demonstrations of a particular striking movement to train a ProMP. Unlike the coffee task, the high variability in the results makes it hard to determine the optimal number of training samples to increase the success rate. Informally, we did not notice any significant performance improvements using more than eight demonstrations. To segment the striking movement from the rest of the demonstrated behavior we used the zero crossing velocity heuristic method. First, we found the point where the racket hit the ball~$t_h$ by detecting the change in direction of the ball. Subsequently, we found a time interval~$(t_a, t_b)$ such that~$t_h \in (t_a,t_b)$ and both~$t_a$ and~$t_b$ were zero crossing velocity points. We found that this heuristic reliably segments table tennis striking movements if the hitting time~$t_h$ can be detected accurately. Some times we could not detect the hitting time~$t_h$ accurately because of vision problems. In such case we simply discarded that trajectory from the training set. We decided to use six as the minimum number of segmented demonstrations in the training set to proceed with the experiments. That is, if more than two demonstrations were discarded by the segmentation heuristic we collected the training data again. Let us explain in detail how we apply the proposed method to table tennis as well the similarities and differences to previous work presented in~\cite{gomez2016using}. A high level pseudo-code of the table tennis strategy is presented in Algorithm~\ref{alg:tt:proc}. This algorithm receives as input a ProMP already trained to play table tennis using human demonstrations, moves the robot to an initial position and blocks its execution until the vision system produces new ball observations. Subsequently, the obtained ball observations are used to predict the rest of the ball trajectory using a Kalman Filter, the optimal initial time is computed from the ball trajectory using a maximum likelihood approach introduced in previous work~\cite{gomez2016using}, and the trained ProMP is conditioned in task space using the operator presented in Section~\ref{sec:promp:kinematics}. Before executing the ProMP conditioned to hit the ball, it is conditioned in joint space to start in the current robot joint state. \begin{algorithm}[t] \begin{algorithmic}[1] \Require A ProMP~$\text{promp0}$ trained for table tennis using human demonstrations. \While{ running } \State $\text{move\_to\_init\_state}(\text{promp0})$ \label{alg:tt:init_state} \State $\text{wait\_ball\_obs}()$ \label{alg:tt:proc:wait_ball_obs} \Repeat \State $\text{ball\_obs} \gets \text{get\_ball\_obs}()$ \label{alg:tt:proc:get_ball_obs} \State $\text{ball\_traj} \gets \text{predict\_ball\_traj}(\text{ball\_obs})$ \label{alg:tt:proc:pred_ball_traj} \State $t_0 \gets \text{comp\_optimal\_t0}(\text{ball\_traj})$ \label{alg:tt:proc:comp_opt_t0} \State $\text{new\_promp} \gets \text{cond\_hit}(\text{promp0},\text{ball\_traj})$ \label{alg:tt:proc:cond_promp_hit} \Until{ $t_0 \ge \text{current\_time}()$ } \State $\text{new\_promp.cond\_joint\_space}(\text{get\_joint\_state}())$ \label{alg:tt:proc:cond_joint_space} \State $\text{execute}(\text{new\_promp})$ \label{alg:tt:proc:execute} \EndWhile \end{algorithmic} \caption{Procedure used on the table tennis experiments} \label{alg:tt:proc} \end{algorithm} Note that the lines~\ref{alg:tt:proc:get_ball_obs} and~\ref{alg:tt:proc:cond_promp_hit} in Algorithm~\ref{alg:tt:proc} are in a loop to allow for re-planning. This feature is an important improvement over the previous work presented in~\cite{gomez2016using}, because it allows for corrections over the predictions of the ball trajectory produced by the Kalman Filter in line~\ref{alg:tt:proc:pred_ball_traj}. In~\cite{gomez2016using}, a set of ball observations of a certain size was obtained and the Kalman Filter was used only once to predict the rest of the ball trajectory. Subsequently, the robot would ``close its eyes'' and attempt to hit the predicted ball trajectory. In consequence, it was hard to fix a sensible size for the initial set of observations. A small set would not provide enough information to predict accurately the ball trajectory, and a large set could potentially leave a small reaction time to the robot effectively loosing the opportunity to hit the ball. In this paper, we took advantage of the short execution time of the presented operators using re-planning. We simply take any amount of available ball observations to predict the ball trajectory and adapt the ProMP, but we keep doing so while there is still time for corrections. The starting time of the movement primitive is computed in Line~\ref{alg:tt:proc:comp_opt_t0} using the operator presented in~\cite{gomez2016using} that maximizes the likelihood of hitting the ball under some assumptions. To compute this likelihood without specifying a hitting time or point, the hitting time was marginalized using some prior distribution. In~\cite{gomez2016using}, a uniform distribution was used as prior over the hitting time. We observed that the human teachers usually hit the ball close to the middle of the movement. In consequence, we changed the prior distribution over the hitting time to match the observed teacher behavior. We used a Gaussian distribution given by \[p_h(z) = \normal{z}{\mu_z=0.5}{\sigma_z=0.1}\] where~$z=(t-t_0)/T$ is the time variable normalized to be between zero and one. As a result, we obtained a substantial improvement on the number of times that the robot manages to successfully return the ball to the opponent's court, that we will call in the rest of this paper the \textit{success rate}. \begin{table} \centering \begin{tabular}{@{}cccc@{}} \toprule \bf{Re-planning} & \bf{Hit time prior} & \bf{Hit rate} & \bf{Success rate} \\ \midrule No & Uniform & 73.7\% & 5.2\% \\ No & Gaussian & 79.5\% & 40.9\% \\ Yes & Uniform & 93.2\% & 9.1\% \\ Yes & Gaussian & 96.7\% & 67.7\% \\ \bottomrule \end{tabular} \caption{ Performance improvement for hit and success rate due to re-planning and the prior over the hitting time. The ball gun was fixed to the same settings on these four experiments, and the same ProMP was used in every case trained with Algorithm~\ref{alg:em_promp}. The goal of these experiments was to test the effect of re-planning and the hitting time prior both independently and combined. Note that re-planning has a significant positive impact mostly over the hitting rate, whereas the prior over the hitting time affects mostly the success rate. The best performance is obtained as expected with a combination of both. } \label{tab:tt:tech} \end{table} Replanning and the prior over the hitting time are features added to the table tennis strategy on this paper that were not present in~\cite{gomez2016using}. Although these features are unrelated to the main contributions of this paper, we consider important to evaluate the performance improvement due to these features to explain the huge performance gap in comparison to the performance reported in~\cite{gomez2016using}. In addition, the replanning feature is possible only because of the fast execution time of the proposed adaptation operators. Therefore, replanning is an example of how the computational efficiency of the proposed methods can have an impact on the success of a task where accurate prediction models are not available. Table~\ref{tab:tt:tech} presents the results of an experiment to measure the improvement of performance due to re-planning and the hitting time prior both independently and combined. We placed the ball gun in a position that the human teacher found comfortable and collected a set of demonstrations, the ball gun parameters were kept fixed during the rest of the experiment. We trained a ProMP with Algorithm~\ref{alg:em_promp} using the collected demonstrations. We use the exact same trained ProMP during this experiment to make sure that the measured improvements are only due to the re-planning and hitting prior features. Note that the change in the prior over the hitting time had a very significant impact on the success rate, increasing it from 5.2\% to 40.9\% without re-planning and from 9.1\% to 67.7\% with re-planning. On the other hand, the re-planning feature improved in general about 20\% on the hit rate, and the success rate improvement was only substantial in combination with the hitting time prior, improving from 40.9\% to 67.7\%. A major difference between this work and~\cite{gomez2016using}, is the training algorithm for the movement primitives. In~\cite{gomez2016using}, the movement primitives were trained with a maximum likelihood algorithm. In Section~\ref{sec:methods}, we discussed how maximum likelihood estimation (MLE) produced unstable estimates of the ProMP parameters opposed to the Maximum A-Posteriori estimates (MAP). To prevent stability problems, the MLE estimates computed in~\cite{gomez2016using} force the matrix~$\matr{\Sigma}_\omega$ to be block diagonal. As a result, the computed ProMP considers all the joints independent. To measure the effect of using the proposed training method opposed to considering all the joints independent with MLE, we tested ProMPs trained with both methods with several ball gun configurations using always the procedure for execution on Algorithm~\ref{alg:tt:proc} with both re-planning and the prior over the hitting time. We obtained an average success rate of 66.3\% and a hit rate of 95.4\% for the MAP trained ProMP. For MLE we obtained an average of 47.7\% and 79.8\% for the hit and success rates respectively. \begin{figure} \centering \includegraphics[width=6cm]{img/fh_teach.png} \caption{ A human subject moving the robot in gravity compensation mode. Gravity compensation mode was used to obtain the human demonstrations necessary to train the robot. } \label{fig:teach:fh} \end{figure} We also compare the performance of our method with a different robot table tennis method based on heuristics~\cite{mulling2011biomimetic} called the MoMP method~\cite{mulling2013learning}. Figure~\ref{fig:teach:fh} shows a human subject moving the robot in gravity compensation mode. \begin{figure*} \centering \setlength\figurewidth{8cm} \setlength\figureheight{6cm} \setlength\axislabelsep{0mm} \begin{subfigure}[b]{0.45\textwidth} \tikzsetnextfilename{success} \input{fig/success.tex} \caption{} \label{fig:tt:map_mle:success} \end{subfigure} \begin{subfigure}[b]{0.45\textwidth} \tikzsetnextfilename{hit} \input{fig/hit.tex} \caption{} \label{fig:tt:map_mle:hit} \end{subfigure} \caption{ Histogram of the success and hit rates on table tennis for ProMPs trained with MAP and MLE. We also compare against humans moving the robot in gravity compensation mode and the MoMP method. For the table tennis experiments, repeating the same experiment multiple times will likely produce different hit and success rate performance. In consequence, we decided to present a histogram of the results computed with the bootstrap method representing how likely is it to obtain a particular hit or success rate for different methods. } \label{fig:tt:map_mle} \end{figure*} Figure~\ref{fig:tt:map_mle} shows an histogram of the success and hit rates obtained in this experiment for both MAP and MLE training, the MoMP method and the human subjects. The histogram was generated with the bootstrap method, generating 5000 random samples of 50 trials from the collected data. The success and hit rates were computed for each of the 5000 samples and recorded in the histogram. We decided to present an histogram of these results instead of just a number to account for the variability of the results natural to the table tennis experiments. An interval containing 90\% of the probability mass of the success rate histogram for the MLE and MAP trained ProMPs would locate the success rate between 34.0\% and 58.0\% for MLE and between 60.0\% and 80.0\% for MAP. From these confidence intervals we can conclude that the difference in success rate of learning the joint correlations with the MAP algorithm presented on this paper compared to the MLE algorithm presented in~\cite{gomez2016using} that assumes the joints as independent is significant. Furthermore, the table tennis procedure presented in Algorithm~\ref{alg:tt:proc} used for the MAP and MLE trained ProMPs does not include any heuristic or method to successfully return the ball to the opponent's court. In both cases this behavior has to be learned from the demonstrated data. The fact that the success rate of the MAP trained ProMP is significantly better than the success rate of the MLE trained ProMP that forces~$\matr{\Sigma}_\omega$ to be block diagonal, suggests that the joint correlations encode information important to successfully return table tennis balls. The performance of the presented approach was significantly better than the MoMP method for both hit and success rates in our experiments. The MoMP method is based on several heuristics that would require a great amount of hand tuning to achieve a good success rate for a particular ball gun configuration. As a result, it is very hard to tune this method to generalize well to different ball gun locations and orientations. On the other hand, our method generalizes well to changes on the ball trajectory and can be easily retrained if the ball gun configuration is significantly changed. \begin{comment} \begin{table} \centering \begin{tabular}{@{}ccc@{}} \toprule \bf{Trials} & \bf{Hit rate} & \bf{Success rate} \\ \midrule 104 & 81.7\% & 60.5\% \\ 131 & 95.4\% & 64.1\% \\ 31 & 100\% & 64.5\% \\ 111 & 99.1\% & 86.5\% \\ \bottomrule \end{tabular} \caption{ Variability of the hitting and success rates. The proposed method was trained from the scratch by the same teacher on different days, placing the ball gun at different locations each time. The exact same code was used on all these trials. } \label{tab:tt:variability} \end{table} \end{comment} \begin{comment} Finally, we compared the performance of the presented approach with the performance of different human subjects. To emulate the hardware constrains of the robotic system, the humans had to move the robot in gravity compensation mode and hit the ball with the robot racket. Table~\ref{tab:tt:human} summarizes the results of this experiment. The human subjects 1 and 2 had experience moving the robot in gravity compensation mode, whereas the subjects 3 and 4 had never used a robot before. Note that there is a high degree of variability in the performance of different human subjects. \begin{table} \centering \begin{tabular}{@{}ccc@{}} \toprule \bf{Player} & \bf{Hit rate} & \bf{Success rate} \\ \midrule Robot & 95.4\% & 66.3\% \\ Human 1 & 97.5\% & 90.2\% \\ Human 2 & 100\% & 80.9\% \\ Human 3 & 98.6\% & 78.4\% \\ Human 4 & 96.6\% & 15.2\% \\ \bottomrule \end{tabular} \caption{ Variability of the hitting and success rates. The proposed method was trained from the scratch by the same teacher on different days, placing the ball gun at different locations each time. The exact same code was used on all these trials. } \label{tab:tt:human} \end{table} The player called~\katmomp, is based on the Virtual Hitting Plane (VHP) method presented in~\cite{mulling2011biomimetic} and the Mixture of Movement Primitives (MoMP) presented in~\cite{mulling2013learning}. First the ball trajectory is estimated from ball observations with the Extended Kalman filter described in~\cite{mulling2011biomimetic}, only the mean of the trajectory is used. A hitting point is computed by finding the intersection between the ball trajectory and a virtual hitting plane. Subsequently, the gating network described in~\cite{mulling2013learning} is used to select a movement primitive from the library of learned movements. Inverse Kinematics is used to adapt the selected movement primitive to go through the hitting point in task space. The adapted movement primitive is executed, and the gating network and movement primitive parameters are improved using reinforcement learning. An important limitation of this approach is the assumption that one single VHP can be used to return balls coming from many different directions. To avoid dangerous movements, the \katmomp~player only moves if the intersection point between the VHP and the ball trajectory is a predefined rectangular region. As a result, this method does not adapt well to any ball gun configuration. In the experiments, the robot did not move in 41.5\% of the executed trajectories using the \katmomp~player, in 57\% of the trials the ball was hit but only on 3\% of the trials the ball was successfully send to the opponent side of the table. The players called~\textit{Offline ProMP}~is based on previous work presented in~\cite{gomez2016using}. This player uses the same operators presented in this paper to adapt probabilistic movement primitives to the changes in the ball trajectory, but the ProMP is trained using maximum likelihood and forced to consider the joints independently to obtain robust estimates. The main disadvantage of the~\textit{Offline ProMP}~player is that it was mostly implemented in Python. Only the execution of the ProMP was implemented in C. The delays added by the required extra communication and the fact Python is an interpreted language often violate the execution deadlines required by real time systems. As a result, the \textit{Offline ProMP}~method does not move half of the times because of missed time deadlines. Other important difference between~\textit{Offline ProMP}~and~\textit{MLE ProMP}~is that~\textit{Offline ProMP}~uses a uniform distribution as a prior over the hitting time to compute the likelihood of hitting the ball, whereas~\textit{MLE ProMP}~uses a Gaussian distribution described in Section~\ref{sec:methods:hit_lh} that gives a higher prior probability of hitting the ball when the racket velocity is higher. As a result, the~\textit{MLE ProMP}~player can return balls to the opponent court more often than the~\textit{Offline ProMP}~player. Finally, the~\textit{MAP ProMP}~player uses Maximum A Posteriori (MAP) presented in this paper to train the movement primitive. The operators used to adapt the movement primitive and to find the initial time are introduced in Section~\ref{sec:methods}. The~\textit{MAP ProMP}~player had both a higher success rate and hitting rate than the~\textit{MLE ProMP}~player. The success rate increased from 47.7\% to 64.1\% and the hitting rate increased from 79.8\% to 95.4\%. Figures~\ref{fig:robot:fh} and~\ref{fig:robot:bh} show the first execution of the movement primitive learned by the~\textit{MAP ProMP}~player for forehand and backhand strikes respectively. In both trials, the ball was successfully hit and returned to the opponent side of the table. All the experiments discussed so far were performed with the same ball gun position orientation and velocity, testing only the forehand striking movement of the robot. To test the capacity of the presented method to work with drastic changes in the ball trajectory, we changed the ball gun position and orientation to test the backhand strike movement of the robot. The human teacher made new demonstrations of backhand striking movements and the learned movement primitive was tested on the robot without making any changes to the code or parameters. The~\textit{MAP ProMP}~player could return successfully 45.3\% and hit 90.6\% of the trials with backhand. Compared with forehand, the success rate for backhand decreased by 18.8\%. However, the success rate of the human teacher was also worst on backhand than with forehand by 12.3\%. \begin{table} \centering \begin{tabular}{@{}lrrrr@{}} \toprule \bf{Player} & \bf{Success} & \bf{Hit} & \bf{Miss} & \bf{No move} \\ \midrule Human FH & 90\% & 97.5\% & 2.5\% & 0\% \\ Human BH & 77.7\% & 100\% & 0\% & 0\% \\ \textit{MAP ProMP}~FH & 64.1\% & 95.4\% & 3.8\% & 0.7\% \\ \textit{MAP ProMP}~BH & 45.3\% & 90.6\% & 3.1\% & 6.25\% \\ \textit{MLE ProMP}~FH & 47.7\% & 79.8\% & 14.2\% & 6\% \\ \katmomp~FH~\cite{mulling2013learning} & 3\% & 57\% & 1.5\% & 41.5\% \\ \textit{Offline ProMP}~FH~\cite{gomez2016using} & 3\% & 45\% & 5\% & 50\% \\ \bottomrule \end{tabular} \caption{ Summary of the results of the evaluated methods on the real robot using the same experimental configuration. Each trial is classified as success, hit, miss or No move. Success means that the ball was hit and send to the opponent side of the table according to the table tennis rules. Hit means that the ball was hit but not successfully returned. Miss means that the robot moved, but missed the ball. And no move means that the robot did not try to move. The human clearly outperforms all the measured methods. The method presented in this paper, called \textit{MAP ProMP}, outperforms all the other robot methods tested in this experiment. } \label{tab:results:real} \end{table} Table~\ref{tab:results:real} summarizes the results of the robot table tennis experiments. The human clearly outperforms all the robot players used on this experiments. But the~\textit{MAP ProMP}~player presented in this paper outperformed all the other robot approaches using the same experimental conditions. The experiments with forehand are represented with the letters FH and backhand with the letters BH. Using a better ball model is probably the best way to improve the performance of the presented method in the robot table tennis task. The Kalman filter used as ball model for the table tennis experiments predicts the bouncing time using only the mean ball position and the table height. This approach to compute the bouncing time does not consider the uncertainty on the ball state. In consequence, the predicted ball trajectory after bounce is often not accurate enough. A better approach would be to marginalize the bouncing time or to detect it from data. Another important extension to increase performance is to use a mixture of ProMPs instead of using a single movement primitive. An operator like the likelihood of hitting the ball could be used to decide which movement primitive to use given the current ball trajectory. \begin{figure*} \centering \begin{subfigure}[b]{4cm} \includegraphics[height=3.2cm,width=4cm]{img/fh_teach.png} \caption{} \label{fig:teach:fh} \end{subfigure} ~ \begin{subfigure}[b]{4cm} \includegraphics[height=3.2cm,width=4cm]{img/fh_robot.png} \caption{} \label{fig:robot:fh} \end{subfigure} ~ \begin{subfigure}[b]{4cm} \includegraphics[height=3.2cm,width=4cm]{img/bh_teach.png} \caption{} \label{fig:teach:bh} \end{subfigure} ~ \begin{subfigure}[b]{4cm} \includegraphics[height=3.2cm,width=4cm]{img/bh_robot.png} \caption{} \label{fig:robot:bh} \end{subfigure} \caption{ Learning table tennis striking movements from teacher demonstrations. Figures~\ref{fig:teach:fh} and~\ref{fig:teach:bh} show the human moving the robot in demonstration mode to teach forehand and backhand striking movements to the robot. Figures~\ref{fig:robot:fh} and~\ref{fig:robot:bh} show the first execution on the robot of the forehand and backhand movement primitives learned from human demonstrations. Note that the joint state configuration of the executed behavior is very similar to the demonstrated behavior. This similarity can be specially seen in Figures~\ref{fig:teach:fh} and~\ref{fig:robot:fh} that have relatively similar ball trajectories. } \label{fig:robot_tt} \end{figure*} \end{comment} \section{Conclusions and Discussion} \begin{comment} \begin{itemize} \item In this paper we introduce new operators to learn and adapt probabilistic movement primitives. \item The presented learning algorithm uses a prior distribution to increase the robustness of the estimated parameters. Using the proposed prior distribution over the ProMP parameters is an effective way to improve robustness while conserving enough flexibility in the model to learn the dependencies between the joints as more data becomes available. On the robot table tennis experiments, the presented approach performs better than previous work that used maximum likelihood estimates with the same amount of teacher demonstrations. \item This paper also presents simple and fast operators to adapt movement primitives in joint and task space, making use of standard methods of probability theory. These operators are evaluated in the table tennis task, using them to adapt the learned striking movement primitive to the current ball trajectory. The presented operators to adapt movement primitives can be applied to any other robotics application. \item It is possible to incorporate task specific knowledge into the ProMP framework by expressing this knowledge as a likelihood or prior distribution. As an example, we define the likelihood of hitting a ball and use it to compute the starting time of the movement primitive. \item The likelihood of hitting the ball is the only table tennis specific operator used in this paper. Unlike previous approaches to robot table tennis, we do not model in any way the interaction between the racket and the ball. The only reason why our model can successfully send balls to the opponent side of the table is because the training data only contains successfull trajectories. Thus, the behavior of successfully returning balls is fully learned from data. \item The presented method assumes there is a single movement primitive to learn, adapt and execute. For table tennis, our method can model eighter forehand or backhand, but it can not switch between both. A library of movement primitives can improve generalization performance. \end{itemize} \end{comment} This paper introduces new operators to learn and adapt probabilistic movement primitives in joint and in task space. The presented learning algorithm uses a prior distribution to increase the robustness of the estimated parameters. Using the proposed prior distribution over the ProMP parameters is an effective way to improve robustness and learn with few training instances while conserving enough flexibility in the model to learn the dependencies between the joints as more data becomes available. This paper also presents simple and fast operators to adapt movement primitives in joint and task space, making use of standard methods of probability theory. These operators were evaluated in the coffee task and table tennis task to adapt the learned movement primitive to the coffee machine position and the ball trajectory respectively. The presented operators to adapt movement primitives can be applied to any other robotic applications. We have compared the table tennis performance of the presented approach with previous work presented in~\cite{gomez2016using}. We tested the performance improvements due to table tennis specific advantages like re-planning and the prior over the hitting time. More importantly, we tested the improvements due to the presented learning algorithm and its ability to learn the joint correlations independently of the table tennis specific improvements. We show that the difference on the learning algorithm alone is enough to obtain a statistically significant improvement. Unlike previous approaches to robot table tennis, our approach does not model the interaction between the racket and the ball. The reason why the presented method can successfully send balls to the opponent's side of the table is because the training data used to learn the movement primitive contains mostly successful examples. Thus, the behavior of successfully returning balls is completely learned from data. A limitation of the presented training method is that it requires manual segmentation of the robot trajectories. Someone needs to specify where every movement primitive starts and ends in the demonstrated behavior. A better approach would be to consider the segmentation as another hidden variable and add it to the proposed EM inference algorithm. The problems of automatic segmentation and clustering should be considered in future work. \section{Introduction} \IEEEPARstart{T}{echniques} that can learn motor behavior from human demonstrations and reproduce the learned behavior in a robotic system have the potential to generalize better to different tasks. Multiple models have been proposed to represent complex behavior as a sequence of simpler movements typically known as movement primitives. A movement primitive framework should provide operators to learn primitives from demonstrations, adapt them to achieve different goals and execute them in a sequence on a robotic system. Deterministic Movement Primitive frameworks have been used successfully for a variety of robotic tasks including locomotion~\cite{dmp_locomotion}, grasping~\cite{ude2010_dmp_gen}, ball in a cup~\cite{kober2014learning} and pancake flipping~\cite{dmp_pancake}. However, deterministic representations capture only the mean behavior of the demonstrations of the teacher. The variability in the demonstrations is not captured nor used. In biological systems, variability seems to be characteristic of all behavior, even in the most skilled and seemingly automated performance~\cite{muller2009motor}. Thus, a movement primitive representation that captures variance in the demonstrated behavior has the potential to model the human teacher better. For a task like table tennis, the variability of the teacher is partially a response to the changes in ball trajectory. Therefore, approaches that capture it have the potential to adapt better to diverse ball trajectories. At the same time, the variability of the teacher can be used to define a region of sensible exploration for a robotic system. Probabilistic approaches can naturally capture variability using a probability distribution. Some probabilistic representations of movement primitives focus on learning a distribution over demonstrated states using Gaussian Mixture models or Hidden Markov models~\cite{calinon2007learning}\cite{billard2008robot}. Subsequently using the log-likelihood as cost function to reproduce the learned movement using an optimal control method~\cite{calinon2014task}\cite{medina2012risk}. Other probabilistic representations focus on learning a distribution over robot trajectories directly. Some approaches represent trajectories as functions of time and the distribution over these trajectories using parametric~\cite{proMP} or non-parametric~\cite{alvarez2009latent} approaches. The trajectories can also be represented with recursive probability distributions, using latent state space models~\cite{chiappa2009using}. In this paper, we build on top of a probabilistic representation introduced in~\cite{proMP} called Probabilistic Movement Primitives (ProMPs). In this probabilistic formulation of movement primitives, a movement primitive is represented as a probability distribution over robot trajectories. Different realizations of the same movement primitive are assumed to be independent samples from the distribution over trajectories. \begin{figure}[b] \centering \includegraphics[width=7cm]{img/fh_robot.png} \caption{ Robot table tennis setup used to evaluate the proposed methods. The ball is tracked using four cameras attached to the ceiling. The robot arm is a Barrett WAM capable of high speed motion, with seven degrees of freedom like a human arm. } \label{fig:robot} \end{figure} ProMPs have typically more parameters than non-probabilistic representations. These extra parameters are used to capture the variability of the movements executed by the teacher and the correlations between different degrees of freedom of the robot. In this paper, we use prior distributions over the ProMP parameters to make robust estimates with few demonstrations. The influence of the prior distribution decreases as more training data becomes available, converging to the maximum likelihood estimates. This paper also presents general purpose operators to adapt a ProMP to have a desired joint or task space configuration at a certain time. By joint space we refer to the joint angles and velocities of the robot, and by task space we refer to the world coordinate position and velocity of the end effector of the robot. The proposed method to learn the movement primitive and the operators to adapt the movement primitives in task and joint space are evaluated with synthetic data, in a robot table tennis task and a robot assisted coffee preparation task. Figure~\ref{fig:robot} shows the robot table tennis setup used in the experiments. The results obtained with the presented method are compared with previous work on robot table tennis. The proposed approach outperforms previous robot table tennis approaches using less task specific heuristics. Examples of task specific heuristics used for robot table tennis in previous approaches include using a Virtual Hitting Planes~\cite{mulling2011biomimetic} and computing optimal racket velocity and orientation at hitting time to send balls to the opponent side of the table~\cite{mulling2013learning}. The presented approach does not compute racket orientations or velocities to return balls to the opponent's court. The training data used to learn the movement primitives was built using only successful human demonstrations. The robot was able to learn the behavior required to successfully return balls to the opponent side of the table from the human demonstrations. We use the pouring coffee task to evaluate the generalization performance of the presented method as a function of the number of training instances by changing the position of the coffee grinder and the brewing chamber. The robot manages to pour successfully on the selected testing area after two training demonstrations, suggesting that the presented prior is a sensible choice for this task. Finally, the fact that the presented approach can be used for two robot tasks as different as table tennis and coffee pouring without any changes suggests it has the potential to perform well in several other robot applications. \begin{comment} \begin{itemize} \item Techniques that can learn motor behavior from human demonstrations and reproduce this behavior in a robotic system have the potential to generalize better to multiple tasks. Multiple techniques have been proposed to represent and learn movements. These techniques typically decompose complex behavior as a sequence of simpler movements called movement primitives. A movement primitive framework should provide operators to learn primitives from human demonstrations, adapt the movement primitives to changes in the robot environment and execute a sequence of movement primitives in a robotic system. Movement Primitive frameworks have been used successfully for a variety of robotic tasks including locomotion~\cite{dmp_locomotion}, grasping~\cite{ude2010_dmp_gen} and pancake flipping~\cite{dmp_pancake}. \item However, only deterministic representations of movement primitives are used for most of these tasks. The variability of the teacher is not captured or used. In biological systems, variability seems to be characteristic of all behavior, even in the most skilled and seemingly automated performance~\cite{muller2009motor}. Thus, a movement primitive representation that captures variability has the potential to model the human teacher better. At the same time, the teacher's variability yields an estimate for sensible exploration on the robotic system. \item In a probabilistic representation of movement primitives, a movement primitive is a probability distribution over robot trajectories, and different realizations of the same movement primitive are assumed to be independent samples from this distribution. As a result, probabilistic representations can represent and capture the variability of the teacher in a natural way. In this paper, we build on top of a probabilistic representation introduced in~\cite{proMP} called Probabilistic Movement Primitives (ProMPs). \item ProMPs have typically more parameters than non-probabilistic representations. These extra parameters are used to capture the variability of the movement and the correlations between different degrees of freedom of the robot. However, to make robust estimates of larger number of parameters, more training data is required. In previous work~\cite{gomez2016using}, the different degrees of freedom of the robot were considered independent to reduce the number of parameters and make robust estimates with 66 demonstrations of table tennis striking movements. In this paper, we use prior distributions over the ProMP parameters and make robust estimates with as few as six demonstrations of striking movements obtaining better results. The advantage of using a sensible prior over constraining the capacity of the model, is that when more data becomes available, the full capacity of the model can be exploited. \item We also introduce new operators for ProMPs. First, an operator to adapt a ProMP learned in joint space to achieve an objective in task space is introduced. Subsequently, a task specific operator for hitting movement is introduced to find the initial time of the movement primitive. \item The proposed operators are evaluated in a table tennis task and compared with previous approaches for robot table tennis and against a human player. The proposed approach outperforms previous robot table tennis approaches, using less table tennis specific methods like Virtual Hitting Planes~\cite{mulling2011biomimetic} or modelling the interaction between the ball and the racket. In particular, we do not use any method to return balls successfully to the opponent side of the table. The only reason why our method can successfully return balls is because only successful trials are used in the training set. \end{itemize} \end{comment}
\section{Introduction} Recently, morphological tasks such as inflection generation and lemmatization (Figure~\ref{fig:morphexample}) have been successfully tackled with neural transition-based models over edit actions \cite{Aharoni&Goldberg2017,Robertson&Goldwater2018,Makarov&Clematide2018,Cotterelletal2017a}. The model, introduced in \newcite{Aharoni&Goldberg2017}, uses familiar inductive biases about morphological string transduction such as conditioning on a single input character and monotonic character-to-character alignment. Due to this, the model achieves lower time complexity (compared to soft-attentional seq2seq models) and strong performance on several datasets. \citeauthor{Aharoni&Goldberg2017} train the model by maximizing the conditional log-likelihood (MLE) of gold edit actions derived by an independent character-pair aligner. The MLE training procedure is therefore a pipeline, and the aligner is completely uninformed of the end task. This results in error propagation and the unwarranted dependence of the transducer on a single gold action sequence---in contrast to weighted finite-state transducers (WFST) that take into account all permitted action sequences. Although these problems---as well as the exposure bias and the loss-metric mismatch arising from this MLE training \cite{Wiseman&Rush2016}---% can be addressed by reinforcement learning-style methods \cite[RL]{Ranzato16,Bahdanauetal2017,Shenetal2016}, for an effective performance, all these approaches require warm-start initialization with an MLE-pretrained model. Another shortcoming of the RL-style methods is delayed punishment: For many NLP problems, including morphological string transduction, one can pinpoint actions that adversely affect the global score. For example, it is easy to tell if inserting some character $c$ at step $t$ would render the entire output incorrect. Assigning individual blame to single actions directly---as opposed to scoring the entire sequence via a sequence-level objective---simplifies the learning problem. \begin{figure}[t] \begin{adjustwidth}{-0.25cm}{} \small \centering \resizebox{1.02\linewidth}{!}{ \begin{tabular}{ccc} 하다 & \multirow{2}{*}{\scalebox{1.5}{$\Huge\rhd$}} & \multirow{2}{*}{하셨습니까} \\ {\small$\{$\textsc{V, Past, Formal Polite,}} & & \\ {\small\textsc{Interrogative, Honorific}$\}$} & & \\ & & \\ 하셨습니까 & \multirow{1}{*}{\scalebox{1.5}{$\Huge\rhd$}} & \multirow{1}{*}{하다} \\ \end{tabular}} \end{adjustwidth} \caption{Morphological tasks with examples in Korean: inflection generation (top) and lemmatization (bottom). (McCune-Reischauer: 하다=hada, 하셨습니까=hasy\u{o}ss\u{u}mnikka).} \label{fig:morphexample} \vspace{-5mm} \end{figure} Faced with problems similar to those arising in transition-based dependency parsing with static oracles \cite{Goldberg&Nivre2012}, we train this model in the imitation learning (IL) framework \cite{Daumeetal2009,Rossetal2011,Changetal2015}, using a simple expert policy. Our approach eliminates both all dependency on an external character aligner and the need for MLE pre-training. By making use of exploration of past and future actions and having a global objective, it addresses the MLE training biases, while providing relevant action-level training signal. The approach leads to strong and state-of-the-art results on a number of morphological datasets, outperforming models trained with minimum risk training (MRT). \medskip \section{Model Description} \label{sec:model} We use a variant of the seq2seq state-transition system by \newcite{Aharoni&Goldberg2017}. The model transduces the input string into the output string by performing single-character edits (insertions, deletions). The encoder RNN computes context-enriched representations of input characters, which are pushed onto the buffer at the beginning of transduction. The decoder RNN keeps track of the history of edits. Transitions---edits---are scored based on the output of the decoder state and can write a character or pop the representation of a character from the top of the buffer. We choose the model variant of \newcite{Makarov&Clematide2018}, who add the copy edi , which results in strong performance gains in low-resource settings. Let $\bv{x}=x_1\dots x_n$, $x_i \in \Sigma_x$ be an input \mbox{sequence,} $\bv{y}=y_1\dots y_p$, $y_j \in \Sigma_y$ an output sequence, and $\bv{a}=a_1\dots a_m$, $a_t \in \Sigma_a$ an action sequence. Let $\{f_h\}^H_{h=1}$ be the set of all features. The morpho-syntactic description of a transduction is then an $n$-hot vector $\bv{e} \in \{0, 1\}^H$. The model employs a bidirectional long short-term memory (LSTM) encoder \cite{Graves&Schmidhuber2005} to produce representations for each character of the input $\bv{x}$:% \vspace{-5mm} \begin{adjustwidth}{-0.25cm}{}% \begin{equation} \bv{h}_1,\dots,\bv{h}_n = \textrm{BiLSTM}(E(x_1),\dots,E(x_n)), \end{equation}% \end{adjustwidth}% \vspace{-1mm} where $E$ returns the embedding for $x_i$. We push $\bv{h}_1,\dots,\bv{h}_n$ in reversed order onto the buffer. The transduction begins with the full buffer and the empty decoder state. Transitions are scored based on the output of the LSTM decoder state \cite{Hochreiter&schmidhuber1997}: \begin{equation} \bv{s}_t = \textrm{LSTM}(\bv{c}_{t-1}, [A(a_{t-1}) \;;\; \bv{h}_i ]), \end{equation} where $\bv{c}_{t-1}$ is the previous decoder state, $A(a_{t-1})$ is the embedding of the previous edit action, and $\bv{h}_i$ is the input character representation at the top of the buffer. If features are part of the input in the task, then the input to the decoder also contains the representation of morpho-syntactic description $\bv{e}$, $[F(f_1) \,; \dots \,; F(f_H)]$, which is a concatenation of the embedded features and a designated embedding $F(0)$ is used instead of $F(f_h)$ if $e_h = 0$. The probabilities of transitions are computed with a softmax classifier:% \vspace{-6mm} \begin{adjustwidth}{-0.25cm}{}% \begin{equation} P(a_t = k \mid \bv{a}_{<t}, \bv{x}, \Theta) = \textrm{softmax}_k(\bv{W}\cdot\bv{s}_t + \bv{b}) \label{gen} \end{equation}% \end{adjustwidth}% \vspace{-2mm} Model parameters $\Theta$ include $\bv{W}$, $\bv{b}$, the embeddings, and the parameters of the LSTMs. The alphabet of edit actions $\Sigma_a$ contains \INSERT[c] for each $c \in \Sigma_y$, \textsc{delete}\xspace, and \textsc{copy}\xspace. An \INSERT[c] action outputs $c$; \textsc{delete}\xspace pops $\bv{h}_i$ from the top of the buffer; \textsc{copy}\xspace pops $\bv{h}_i$ from the top of the buffer and outputs $x_i$. The system exhibits spurious ambiguity: Multiple action sequences lead to the same output string. \subsection{MLE Training} \citeauthor{Aharoni&Goldberg2017} train their model by minimizing the negative conditional log-likelihood of the data $D = \{(\bv{x}^{(l)}, \bv{a}^{(l)})\}_{l=1}^N$: \vspace{-5mm} \begin{adjustwidth}{-0.3cm}{}% \begin{equation} \mathcal{L}(D, \Theta) = - \sum^N_{l=1} \sum^m_{t=1} \log \! P(a^{(l)}_t\! \mid \! \bv{a}^{(l)}_{<t}, \bv{x}^{(l)},\! \Theta), \end{equation}% \end{adjustwidth}% \vspace{-2mm} where gold action sequences $\bv{a}^{(l)}$ are deterministically computed from a character-pair alignment of the input and output sequences $(\bv{x}^{(l)}, \bv{y}^{(l)})$. The character-pair aligner is trained separately to optimize the likelihood of the actual training data $T = \{(\bv{x}^{(l)}, \bv{y}^{(l)})\}_{l=1}^N$. For the details, we refer the reader to \newcite{Aharoni&Goldberg2017}. \section{IL Training} One problem with the MLE approach is that the aligner is trained in a disconnect from the end task. As a result, alignment errors lead to the learning of a suboptimal transducer. Switching to a different aligner can dramatically improve performance \cite{Makarov&Clematide2018}. More fundamentally, in the face of the vast spurious ambiguity, the transducer is forced to adhere to a single gold action sequence whereas typically, legitimate and equally likely alternative edit sequences exist. This uncertainty is not accessible to the transducer, but could be profitably leveraged by it. We address this problem within the IL framework and train the model to imitate an expert policy (dynamic oracle), which is a map---on the training data---from configurations to sets of optimal actions. Actions are optimal if they lead to the lowest sequence-level loss, under the assumption that all future actions are also optimal \cite{Daumeetal2009}. In the \emph{roll-in} stage, we run the model on a training sample and follow actions either returned by the expert policy (as in teacher forcing) or sampled from the model (which itself is a stochastic policy). In this way, we obtain a sequence of configurations summarized as decoder outputs $\bv{s}_1, \dots, \bv{s}_m$. In the \emph{roll-out} stage, we compute the sequence-level loss for every valid action $a$ in each configuration $\bv{s}_t$. To this end, we execute $a$ and then either query the expert to obtain the loss for the optimal action sequence following $a$ or run the model for the rest of the input and evaluate the loss of the resulting action sequence. Finally, the sequence-level losses obtained in this way for all actions $a$ enter the action-level loss for configuration $\bv{s}_t$ that we minimize with respect to $\Theta$. \paragraph{Sequence-level loss} We define the loss in terms of the \emph{Levenshtein distance} \cite{Levenshtein1966} between the prediction and the target and the \emph{edit cost} of the action sequence. Given input $\bv{x}^{(l)}$ with target $\bv{y}^{(l)}$, the loss from producing an action sequence $\bv{a}$ is: \vspace{-5mm} \begin{adjustwidth}{-0.25cm}{}% \begin{equation} \ell(\bv{a}, \bv{x}^{(l)}, \bv{y}^{(l)}) = \beta \, \textrm{distance}(\bv{y}, \bv{y}^{(l)}) + \textrm{cost}(\bv{a}), \label{eq:seqlevloss} \end{equation}% \end{adjustwidth}% where $\bv{y}$ is computed from $\bv{a}$ and $\bv{x}^{(l)}$ and $\beta \geq 1$ is some penalty for unit distance.\footnote{We use unit costs to compute edit cost and distance.} The first term represents the task objective. The second term enforces that the task objective is reached with a minimum number of edits. The second term is crucial as it takes over the role of the character aligner. Initially, we also experimented with only Levenshtein distance as loss, similar to previous work on character-level problems \cite{Leblondetal2018,Bahdanauetal2017}. However, models did not learn much, which we attribute to sparse training signal as all action sequences producing the same $\bv{y}$ would incur the same sequence-level loss, including intuitively very wasteful ones, e.g. first deleting all of $\bv{x}^{(l)}$ and then inserting of all of $\bv{y}^{(l)}$. \paragraph{Expert} The expert policy keeps track of the prefix of the target $\bv{y}^{(l)}$ in the predicted sequence $\bv{y}_{<t}$ and returns actions that lead to the completion of the suffix of $\bv{y}^{(l)}$ using an action sequence with the lowest edit cost. The resulting prediction $\bv{y}$ attains the minimum edit distance from $\bv{y}^{(l)}$. For example, if $\bv{x}^{(l)}=walk$ and $\bv{y}^{(l)}=walked$, the top of the buffer is $\bv{h}_{3}$ representing $x_3=l$, and $\bv{y}_{<3} = wad$ due to a sampling error from a roll-in with the model, the expert returns $\{ \textsc{copy}\xspace \}$. \paragraph{Action-level loss} Given sequence-level losses, we compute the regret for each action $a$: \vspace{-5mm} \begin{adjustwidth}{-0.2cm}{}% \begin{equation} r_t(a) = \ell(\bv{a}, \bv{x}^{(l)}, \bv{y}^{(l)}) -\!\!\!\! \min_{a^{\prime} \in A(\bv{s}_t)} \!\! \ell(\bv{a}^{\prime}, \bv{x}^{(l)}, \bv{y}^{(l)}), \end{equation}% \end{adjustwidth}% where $\bv{a}$ (or $\bv{a}^{\prime}$) is the action sequence resulting from taking $a$ (or $a^{\prime}$) at $\bv{s}_t$ and $A(\bv{s}_t)$ is the set of valid actions. Thus, $r_t(a)$, which quantifies how much we suffer from taking action $a$ relative to the optimal action under the current policy, constitutes the direct blame of $a$ in the sequence-level loss. Classic IL employs cost-sensitive classification, with regrets making up costs \cite{Daumeetal2009,Changetal2015}. Our initial experiments with cost-sensitive classification resulted in rather inefficient training and not very effective models. Instead, we choose to minimize the negative marginal log-likelihood of all optimal actions \cite{Riezleretal2000,Goldberg2013,Ballesterosetal2016}. Given the training data $T = \{(\bv{x}^{(l)}, \bv{y}^{(l)})\}_{l=1}^N$, the action-level loss is: \vspace{-5mm} \begin{adjustwidth}{-0.32cm}{}% \begin{equation} \mathcal{L}(T, \Theta)\! =\! - \sum^N_{l=1} \sum^m_{t=1} \log \! \sum_{a \in A_t}\! P(a \! \mid \! \bv{a}_{<t}, \bv{x}^{(l)}\!, \! \Theta),\!\! \end{equation}% \end{adjustwidth}% where $A_t = \{a \in A(\bv{s}_t): r_t(a) = 0 \}$, the set of optimal actions under the current policy. Depending on the roll-in schedule, the next edit $a_{t+1}$ is sampled either uniformly at random from $A_t$ or from the distribution of valid edits. To include all the computed regrets into the loss, we also experiment with the cost-augmented version of this objective \cite{Gimpel&Smith2010}, where regrets function as costs. The downside of IL is that roll-outs are costly. We avoid computing most of the roll-outs by checking if an action increases the edit distance from $\bv{y}^{(l)}$. If it does, we heuristically assign this action a regret of $\beta$. We use this heuristic in both expert and model roll-outs. \section{Experiments} \begin{table*}[h] \begin{minipage}[t]{0.745\textwidth}\vspace{0pt} \begin{flushleft} \resizebox{1\linewidth}{!}{ \begin{tabular}{l|cccccccccc|c} \bf Model & \bf RU & \bf DE & \bf ES & \bf KA & \bf FI & \bf TR & \bf HU & \bf NV & \bf AR & \bf MT &\bf Avg.\\ \Xhline{2.5\arrayrulewidth} \textsc{med} & 91.5 & 95.8 & 98.8 & 98.5 & 95.5 & 98.9 & 96.8 & 91.5 & \bf 99.3 & 89.0 & 95.6 \\ \textsc{soft} & 92.2 & 96.5 & 98.9 &\bf 98.9 & 97.0 & \bf 99.4 & 97.0 & \bf 95.4 & \bf 99.3 & 88.9 & \bf 96.3 \\ \textsc{ha} & 92.2 & 96.6 & 98.9 & 98.1 & 95.9 & 98.0 & 96.2 & 93.0 & 98.8 & 88.3 & 95.6 \\ \textsc{ha*} & 92.0 & 96.3 & 98.9 & 97.9 & 95.8 & 97.6 & 98.8 & 92.1 & 95.1 & 87.8 & 95.2 \\ \textsc{ca} & 91.9 & 96.4 & 98.8 & 98.3 & 96.5 & 97.7 & 98.9 & 92.1 & 94.6 & 87.7 & 95.3 \\ \hline\hline \textsc{ca-d} &\bf 92.4 &\bf 96.6 &\bf 98.9 & 98.7 & 97.2 & 98.5 & 99.3 & 95.2 & 96.5 &\bf 89.2 & 96.2 \\ \textsc{ca-r} & 92.3 & 96.5 & 98.9 &\bf 98.9 &\bf 97.3 & 98.9 &\bf 99.4 & 95.2 & 96.1 & 88.8 & 96.2 \\ \end{tabular}} \vspace{-2mm} \captionof{table}{Results on \textsc{Sigmorphon 2016} data.\footnotemark} \label{tab:sig2016} \vspace{-2mm} \begin{minipage}[t]{0.491\linewidth}\vspace{0pt} \centering \resizebox{1\textwidth}{!}{ \begin{tabular}{l|cccc|c} \bf Model &\bf \scalebox{0.7}{13SIA} &\bf \scalebox{0.7}{2PIE} &\bf \scalebox{0.7}{2PKE} &\bf \scalebox{0.8}{rP} &\bf Avg. \\ \Xhline{2.5\arrayrulewidth} \textsc{lat} & \bf 87.5 & 93.4 & 87.4 & 84.9 & 88.3 \\ \textsc{nwfst} & 85.1 & 94.4 & 85.5 & 83.0 & 87.0 \\ \textsc{ha$^*$} & 84.6 & 93.9 & 88.1 & 85.1 & 87.9 \\ \textsc{ca} & 85.0 & 94.5 & 88.0 & 84.9 & 88.1 \\ \scalebox{0.78}{\textsc{ha$^*$-mrt}} & 84.8 & 94.0 & 88.1 & 85.2 & 88.0 \\ \scalebox{0.9}{\textsc{ca-mrt}} & 85.6 &\bf 94.6 & 88.0 & 85.3 & 88.4\\ \hline\hline \textsc{ca-d} & 85.7 & 94.4 &\bf 88.4 & 85.1 & 88.4 \\ \textsc{ca-r} & 85.6 & 94.4 & 88.3 &\bf 85.3 &\bf 88.4 \\ \textsc{ca-rm} & 84.9 & 94.1 & 88.3 & 85.0 & 88.1 \\ \end{tabular}} \end{minipage}\enskip \begin{minipage}[t]{0.491\linewidth}\vspace{0pt} \begin{center} \resizebox{1\linewidth}{!}{ % \begin{tabular}{l|cccc|c} \bf Model & \bf EU & \bf EN & \bf GA & \bf TL &\bf Avg.\\ \Xhline{2.5\arrayrulewidth} \textsc{lat} & 93.6 & 96.9 & 97.9 & 88.6 & 94.2 \\ \textsc{nwfst} & 91.5 & 94.5 & 97.9 & 97.4 & 95.3 \\ \textsc{lem}\footnotemark & 96.5 & 96.3 & \bf 98.7 & \bf 98.8 & 97.6 \\ \textsc{ha$^*$} & \bf 97.0 & \bf 97.5 & 97.9 & 98.3 & \bf 97.7 \\ \textsc{ca} & 96.3 & 96.9 & 97.7 & 98.3 & 97.3 \\ \hline\hline \textsc{ca-d} & 96.1 & 97.0 & 97.7 & 98.4 & 97.3 \\ \textsc{ca-r} & 96.6 & 97.2 & 97.5 & 98.3 & 97.4 \\ \textsc{ca-rm} & 96.5 & 97.0 & 97.8 & 98.3 & 97.4 \\ \end{tabular}} \end{center} \end{minipage} \vspace{-2mm} \begin{minipage}[t]{0.51\linewidth}\vspace{0pt} \captionof{table}{Results on \textsc{celex} data.} \label{tab:celex} \end{minipage}\enskip \begin{minipage}[t]{0.47\linewidth}\vspace{0pt} \captionof{table}{Lemmatization results.} \label{tab:lem} \end{minipage} \end{flushleft} \end{minipage}\enskip \begin{minipage}[t]{0.24\linewidth}\vspace{0pt} \begin{minipage}[t]{\linewidth}\vspace{0pt} \begin{flushright} \resizebox{1\linewidth}{!}{ % \begin{tabular}{l|cc} \bf Model & \bf L & \bf M \\ \Xhline{2.5\arrayrulewidth} \scalebox{0.9}{\textsc{sgm17top}} & 50.6 & 82.8 \\ \textsc{ha$^*$} & 31.5 & 80.2 \\ \textsc{ca} & 48.8 & 81.0 \\ \textsc{ha$^*$-mrt} & 33.1 & 81.5 \\ \textsc{ca-mrt} & 49.9 & 82.9 \\ \hline\hline \scalebox{0.9}{\textsc{ca-mrt-a}} & 49.9 & 82.7 \\ \textsc{ca-d} & 50.3 & 82.6 \\ \textsc{ca-r} & \bf 51.6 & 83.8 \\ \textsc{ca-rm} & 50.6 &\bf 84.0 \\ \end{tabular}% } \captionsetup{font=small,labelfont=small} \captionof{table}{Results on \textbf{L}ow and \textbf{M}edium settings of \textsc{Sigmorphon 2017} data (averaged over 52 languages).} \label{tab:sig2017} \end{flushright} \end{minipage} \smallskip \begin{minipage}[t]{\linewidth}\vspace{0pt} \footnotesize{ \textbf{\textsc{-mrt}}: minimum risk training; \textbf{\textsc{-mrt-a}}: MRT with action cost in the loss; \textbf{\textsc{-d}}: only expert roll-outs; \textbf{\textsc{-r}}: expert and model roll-outs; \mbox{\textbf{\textsc{-rm}}}: softmax-margin, expert and model roll-outs } \end{minipage} \end{minipage} \medskip \begin{minipage}[t]{1\linewidth} \textbf{Experimental results.} Soft-attention seq2seq models: \textsc{med}=\newcite{Kann&Schutze2016b} (cited from \newcite{Aharoni&Goldberg2017}), \textsc{soft}=\newcite{Aharoni&Goldberg2017}, \textsc{lem}=\newcite{Bergmanis&Goldwater2018}. WFSTs: \textsc{lat}=\newcite{Dreyeretal2008}, \textsc{nwfst}=\newcite{Rastogietal2016}. Transition-based models: \textsc{ha}=\newcite{Aharoni&Goldberg2017}, \textsc{sgm17top}=\newcite{Makarovetal2017}, and from \newcite{Makarov&Clematide2018}: \textsc{ha$^*$}=reimplementation of \textsc{ha}, \textsc{ca}=model in \S\ref{sec:model}, and \textsc{ha$^*$-mrt}, \textsc{ca-mrt} (risk=normalized edit distance). We report exact-match accuracies for ensembles of 5 models (\textsc{Sigm. 2016} and \textsc{2017}) and single-model averages over 5 folds (\textsc{Celex}) and 10 folds (lemmatization). \end{minipage} \end{table*} We demonstrate the effectiveness of our approach on three tasks: inflection generation (using the typologically diverse \textsc{Sigmorphon 2016} and \textsc{Sigmorphon 2017} datasets of \newcite{Cotterelletal2016,Cotterelletal2017}), reinflection (the small-sized German \textsc{Celex} dataset of \newcite{Dreyeretal2008}), and lemmatization (the standard subset of the \newcite{Wicentowski2002} dataset). We use character and feature embeddings of size 100 and 20, respectively, and one-layer LSTMs with hidden-state size 200. Following \citeauthor{Aharoni&Goldberg2017}, for every character $c \in \Sigma_x \cap \Sigma_y$, we let $A($\INSERT[c]$) := E(c)$, i.e. the same embedding represents both $c$ and the insertion of $c$. We optimize with ADADELTA \cite{Zeiler2012}, use early stopping and batches of size 1. We set the penalty for unit distance $\beta=5$ and roll in with an inverse-sigmoid decay schedule as in \newcite{Bengioetal2015}. \textsc{ca-d} models are trained with expert roll-outs only (as is often the case in dynamic-oracle parsing). \textsc{ca-r} and \textsc{ca-rm} models mix expert and learned roll-outs with probability 0.5 as in \newcite{Changetal2015}. \textsc{ca-rm} models optimize softmax-margin. For comparison, we also train models with MRT (\textsc{ca-mrt-a}) as in \newcite{Shenetal2016}, using a global objective similar to our sequence-level loss (Eq.~\ref{eq:seqlevloss}). We use batches of at most 20 unique samples per training example. The risk is a convex combination of normalized Levenshtein distance and the action sequence cost, which we min-max scale, within a batch, to the [0, 1] interval. We decode all our models using beam search with beam width 4. \addtocounter{footnote}{-2} \stepcounter{footnote}\footnotetext Language codes: RU=Russian, DE=German, ES=Spanish, KA=Georgian, FI=Finnish, TR=Turkish, HU=Hungarian, NV=Navajo, AR=Arabic, MT=Maltese, EU=Basque, EN=English, GA=Irish, TL=Tagalog. } \stepcounter{footnote}\footnotetext{Personal communication.} Our approach performs best on most languages of the \textsc{Sigmorphon 2016} data (Table~\ref{tab:sig2016}) and both limited-resource settings of \textsc{Sigmorphon 2017} (Table~\ref{tab:sig2017}). It achieves marginal improvement over an MRT model on the reinflection task (Table~\ref{tab:celex}) with consistent gains on the 2PKE$\mapsto$z transformation \cite{Dreyeretal2008}, that involves infixation. Using mixed roll-outs (\textsc{ca-r}, \textsc{ca-rm}) improves performance on the \textsc{Sigmorphon 2017} inflection data (Table~\ref{tab:sig2017}), otherwise the results are close to \mbox{\textsc{ca-d}}. We also note strong gains over \textsc{ca-mrt-a} trained with a similar global loss (Table~\ref{tab:sig2017}). Generally, improvements are most pronounced in inflection generation, the only task where the model could profit from adjusting alignment to available feature information (cf. Table~\ref{tab:lem}). We take a closer look at the results in the \textsc{Sigmorphon 2017} medium data-size setting (1,000 training examples per language). \textsc{ca-rm} makes the largest performance gains on languages with complex morphological phenomena (Semitic and Uralic languages, Navajo) and an above average number of unique morpho-syntactic descriptions. Khaling and Basque, outliers with 367 and 740 unique morpho-syntactic descriptions in the training data, are among the top five languages with the largest gains. The lowest gains and rare losses are made for Romance and Germanic languages and languages with many unique morpho-syntactic descriptions but regular morphologies (Quechua, Urdu/Hindi). \vspace{3mm} \section{Related work} Traditionally, morphological string transduction has been approached with discriminative weighted finite-state transducers \cite{Rastogietal2016,Cotterelletal2014,Dreyeretal2008,Eisner2002}. \newcite{Yuetal2016} and \newcite{Graves2012} tackle the modeling of unbounded dependencies in the output, while preserving latent monotonic hard character alignment. \newcite{Faruquietal2016,Kann&Schutze2016b} successfully apply seq2seq modeling to the task. \newcite{Aharoni&Goldberg2017} introduce a neural version of the transition-based model over edits. \newcite{Makarov&Clematide2018} show gains from using the copy edit and address the MLE training biases with MRT. The limitations of teacher forcing have recently been the focus of intense research \cite{Edunovetal2018,Wiseman&Rush2016,Shenetal2016}, including the adaptation of RL methods \cite{Ranzato16,Bahdanauetal2017}. Most of these approaches require warm start with an MLE model and themselves introduce discrepancies between training with sampling and search-based decoding. Such biases do not arise from IL, which has recently been proposed for seq2seq models \cite{Leblondetal2018}. Our approach, related to \newcite{Leblondetal2018}, additionally addresses the problem of spurious ambiguity, which is not present in seq2seq models. \section{Conclusion} We show that training to imitate a simple expert policy results in an effective neural transition-based model for morphological string transduction. The fully end-to-end approach addresses various shortcomings of previous training regimes (the need for an external character aligner, warm-start initialization, and MLE training biases), and leads to strong empirical results. We make our code and predictions publicly available.\footnote{\href{https://github.com/ZurichNLP/emnlp2018-imitation-learning-for-neural-morphology}{{https://github.com/ZurichNLP/emnlp2018-imitation-learning-for-neural-morphology}}} \section*{Acknowledgments} We thank Mathias M\"{u}ller for help with the manuscript, Toms Bergmanis for sharing with us the results of his system, and the reviewers for interesting and helpful comments. We also thank the anonymous COLING reviewer who suggested that we should look at spurious ambiguity. Peter Makarov has been supported by European Research Council Grant No.~338875, Simon Clematide by the Swiss National Science Foundation under Grant \mbox{No.~CRSII5\_173719}.
\section{Introduction} Recent work has established the effectiveness of deep generative models for a range of tasks in NLP, including text generation \cite{hu2017toward,yu2017seqgan}, machine translation \cite{zhang2016variational}, and style transfer \cite{shen2017style,junbo2017adversarially}. Variational autoencoders, which have been explored in past work for text modeling \cite{miao2016neural,bowman2016generating}, posit a continuous latent variable which is used to capture latent structure in the data. Typical VAE implementations assume the prior of this latent space is a multivariate Gaussian; during training, a Kullback-Leibler (KL) divergence term in loss function encourages the variational posterior to approximate the prior. One major limitation of this approach observed by past work is that the KL term may encourage the posterior distribution of the latent variable to ``collapse'' to the prior, effectively rendering the latent structure unused \cite{bowman2016generating,chen2016variational}. In this paper, we propose to use the von Mises-Fisher (vMF) distribution rather than Gaussian for our latent variable. vMF places a distribution over the unit hypersphere governed by a mean parameter $\mu$ and a concentration parameter $\kappa$. Our prior is a uniform distribution over the unit hypersphere ($\kappa = 0$) and our family of posterior distributions treats $\kappa$ as a \emph{fixed} model hyperparameter. Since the KL divergence only depends on $\kappa$, we can structurally prevent the KL collapse and make our model's optimization problem easier. We show that this approach is actually more robust than trying to flexibly learn $\kappa$, and a wide range of settings for fixed $\kappa$ lead to good performance. Our model systematically achieves better log likelihoods than analogous Gaussian models while having higher KL divergence values, showing that it more successfully makes use of the latent variables at the end of training. \begin{figure*}[t!] \centering \includegraphics[width=1\textwidth]{model.pdf} \caption{The Neural Variational RNN (NVRNN) language model based on a Gaussian prior (left) and a vMF prior (right). The encoder model first computes the parameters for the variational approximation $q_\phi(z|x)$ (see dotted box); we then sample $z$ and generate the word sequence $x$ given $z$. We show samples from $\mathcal{N}(0,I)$ and vMF($\cdot$,$\kappa=100$); the latter samples lie on the surface of the unit sphere. While $\kappa$ can be predicted from the encoder network, we find experimentally that fixing it leads to more stable optimization and better performance.} \label{model} \end{figure*} Past work has suggested several other techniques for dealing with the KL collapse in the Gaussian case. Annealing the weight of KL term \cite{bowman2016generating} still leaves us with brittleness in the optimization process, as we show in Section~\ref{sec:bg}. Other prior work \cite{yang2017improved,semeniuta2017a} focuses on using CNNs rather than RNNs as the decoder in order to weaken the model and encourage the use of the latent code, but the gains are limited and changing the decoder in this way requires ad hoc model engineering and careful tuning of various decoder capacity parameters. Our method is orthogonal to the choice of the decoder and can be combined with any of these approaches. Using vMF distributions in VAEs also leaves us the flexibility to modify the prior in other ways, such as using a product distribution with a uniform \cite{guu2017generating} or piecewise constant term \cite{serban2017piecewise}. We evaluate our approach in two generative modeling paradigms. For both RNN language modeling and bag-of-words document modeling, we find that vMF is more robust than a Gaussian prior, and our model learns to rely more on the latent variable while achieving better held-out data likelihoods. To better understand the contrast between these models, we design and conduct a series of experiments to understand the properties of the Gaussian and vMF latent code spaces, which make different structural assumptions. Unsurprisingly, these latent code distributions capture much of the same information as in a bag of words, but we show that vMF can more readily go beyond this, capturing ordering information more effectively than a Gaussian code. \section{Variational Autoencoders for Text} \label{sec:bg} \newcite{bowman2016generating} propose a variational autoencoder model for generative text modeling inspired by \newcite{kingma2013autoencoding}. Instead of modeling $p(x)$ directly as in vanilla language models, VAEs introduce a continuous latent variable $z$ and take the form $p(z)p(x|z)$. To train a VAE, we optimize the marginal likelihood $p(x)=\int p_{\theta}(z) p(x|z)dz$. The marginal log likelihood can be written as: \begin{displaymath} \log p_\theta (x) = \text{KL}(q_{\phi}(z|x)||p_{\theta}(z|x)) + \mathcal{L}(\theta,\phi;x)\\ \end{displaymath} \begin{multline} \mathcal{L}(\theta,\phi;x) = - \text{KL}(q_{\phi}(z|x) || p_{\theta}(z) ) \\ + \mathbb{E}_{q_{\phi}(z|x)}\log p_{\theta}(x|z) \label{elbo} \end{multline} $q_{\phi}(z|x)$, a variational approximation to the posterior $p(z|x)$, can be variously interpreted as a \textit{recognition model} or encoder, parameterized by a neural network to encode the sentence $x$ into a dense \textit{code} $z$. $\mathcal{L}(\theta,\phi;x)$ is often called the evidence lower bound (ELBO). The first term of ELBO is the KL divergence of the approximate posterior from prior and the second term is an expected reconstruction error. Since KL divergence is always non-negative, we can use $\mathcal{L}(\theta,\phi;x)$ as a lower bound of marginal likelihood $\log p_{\theta}(x)$. We optimize $\mathcal{L}(\theta,\phi;x)$, jointly learning the recognition model parameters $\phi$ and generative model parameters $\theta$. As the choice of prior $p(z)$, most previous work uses a centered multivariate Gaussian $p_{\theta}(z)=\mathcal{N}(z;0,I)$. Since Gaussians are a location-scale family of distributions, using them for both the prior and posterior allows us to apply the reparameterization trick and differentiate through the sampling stage $z \sim \mathbb{E}_{q_\phi(z|x)}$ when optimizing ELBO in practice \cite{kingma2013autoencoding}. \subsection{Case Study: NVRNN} A Neural Variational RNN (NVRNN) for language modeling is described in \newcite{bowman2016generating} and depicted in Figure~\ref{model}. The goal of the NVRNN model is to extract a high level representation of a sentence into $z$ and reconstruct the sentence with a neural language model. We denote a sequence of words as $x=\{x_1, x_2, \cdots,x_n\}$. Unlike in vanilla language modeling, an NVRNN conditions on the latent variable $z$ at each step of the generation $p_{\theta}(x|z) = p_{\theta}(x_1|z) \prod_{i=1}^n p(x_i|x_1,\ldots,x_{i-1},z).$ This probability distribution is modeled using a recurrent model like an LSTM \cite{hochreiter1997long} as illustrated in Figure~\ref{model}. There is nothing unique about this choice; other recurrent sequence models like a CNN or a Transformer \cite{vaswani2017attention} could be used. \subsection{Posterior Collapse} When training a VAE, we update $\theta$ and $\phi$ simultaneously. Optimizing Eq.~\ref{elbo} gives two gradient terms: an update from the reconstruction loss (likelihood of the correct labels) and an update from the KL divergence. While the reconstruction loss term encourages the $z$ to convey useful information to this model, the KL term consistently tries to regularize $q(z|x)$ towards the prior on every gradient update. This may trap the model in a bad local optimum where $q_{\phi}(z|x) = p_{\theta}(z)$ for all $x$: in this case, $z$ is simply a noise source, which is useless to the model, so the model has learned to ignore it and will not make large enough gradient updates to break $q(z|x)$ out of this optimum. \newcite{bowman2016generating} termed this issue \textit{KL collapse} and proposed an annealing schedule to handle it, where the weight of the KL term is increased over the course of training.\footnote{Reweighting the KL term is also used in methods like $\beta$-VAE \cite{betavae} and InfoVAE \cite{Zhao_Song_Ermon_2017}.} In this way, the model initially learns to use the latent code but is then regularized towards the prior as training progresses. However, this trick is not sufficient to avert KL collapse in all scenarios, particularly when strong decoders are used and $z$ has a minor impact on $p_\theta(x|z)$. Table~\ref{collapse} shows experiments in a similar setup to that of \newcite{bowman2016generating}. We train an NVRNN model on the Penn Treebank with four different hyperparameter settings. We either use a 3-layer LSTM encoder or a 1-layer LSTM and use or do not use a sigmoid annealing schedule (increase the KL weight from 0 to 1 over the first 20 epochs). We observe the best performance using the 1-layer model with annealing. One might conclude from this table that the annealing trick has worked since both models achieve better performance when annealing is used. But in fact, a vMF-based model can do better than either (NLL of 117), and moreover, we have no way of knowing that a better annealing scheme might not achieve even higher performance after training. Furthermore, the higher-capacity 3-layer model can theoretically do anything the 1-layer model can, so its lower performance indicates that our training is derailed either by overfitting or getting stuck in a local optimum where the latent variable is unused.\footnote{In our experiments, we found significant variance in collapse frequency due to other hyperparameters including whether the encoder is a unidirectional or bidirectional LSTM.} \input{tab_collapse.tex} Getting the best performance out of a VAE is, therefore, a challenging problem that requires careful tuning of the objective function and optimization procedure \cite{bowman2016generating,Zhao_Song_Ermon_2017,betavae}. Beyond the well-documented problem of KL collapse, an optimizer may simply get stuck in a local optimum during training and as a result, fail to find a model that most effectively exploits the latent variable. The solution we advocate for in this paper is to change the distribution for the latent space and simplify the optimization problem. In the next section, we describe the von Mises-Fisher distribution and its use in VAE, where it forces the model to put the latent representations on the surface of the unit hypersphere rather than squeezing everything to the origin. Critically, this distribution lets us fix the value of the KL term by fixing the distribution's concentration parameter $\kappa$; this averts the KL collapse and leads to good model performance across two generative modeling paradigms. \section{von Mises-Fisher VAE} \label{sec:model} The von Mises-Fisher distribution is a distribution on the $(d-1)$-dimensional sphere in $\mathbb{R}^d$. The vMF distribution is defined by a direction vector $\mu$ with $||\mu||=1$ and a concentration parameter $\kappa \geq 0$. The PDF of the vMF distribution for the $d$-dimensional unit vector $x$ is defined as: \begin{align} f_d (x;\mu, \kappa) = C_d(\kappa) \exp (\kappa \mu^{T} x)\\ C_d(\kappa) = \frac{ \kappa^{d/2-1} }{ (2\pi)^{d/2} I_{d/2-1}(\kappa)} \end{align} where $I_v$ stands for the modified Bessel function of the first kind at order $v$. Figure~\ref{model} shows samples from vMF distributions with various $\mu$ vectors (arrows), $d=3$, and $\kappa=100$. This is a high $\kappa$ value, leading to samples that are tightly clustered around $\mu$, which is the mean and mode of the distribution. When $\kappa=0$, the distribution degenerates to a uniform distribution over the hypersphere independent of $\mu$. Past work has used vMF as an emission distribution in unsupervised clustering models \cite{banerjee2005clustering}, VAE for other domains \cite{Davidson_Falorsi_Cao_Kipf_Tomczak_2018,Hasnat_Bohné_Milgram_Gentric_Chen_2017}, and a generative editing model for text \cite{guu2017generating}. We focus specifically on the empirical properties of vMF for text modeling and conduct a systematic examination of how this prior affects VAE models compared to using a Gaussian. \begin{figure}[t!] \centering \includegraphics[width=0.48125\textwidth]{kl_fig_new.pdf} \caption{Visualization of optimization of how $q$ varies over time for a single example during learning. In the Gaussian case, the KL term tends to pull the model towards the prior (moving from $\mu, \sigma$ to $\mu^{\ensuremath{\prime}}, \sigma^{\ensuremath{\prime}}$), whereas in the vMF case there is no such pressure towards a single distribution. } \label{klc} \end{figure} \paragraph{VAE with vMF} We will use vMF as both our prior and variational posterior in our VAE models. Otherwise, the setup for our VAE remains the same as in the Gaussian case established in Section~\ref{sec:bg}. Our prior is the uniform distribution vMF($\cdot,\kappa=0$). Since true posterior $p_{\theta}(z|x)$ is intractable, we will approximate it with a variational posterior $q_{\phi}(z|x) = \text{vMF}(z; \mu, \kappa)$ where the mean direction $\mu$ is the output of encoding neural networks (Figure~\ref{model}, right side) and $\kappa$ is treated as a constant. Before we can implement a VAE, we need to derive an expression for KL divergence in order to optimize ELBO (Equation~\ref{elbo}) and give a sampling algorithm that admits the reparameterization trick \cite{kingma2013autoencoding}. \paragraph{KL divergence} With vMF($\cdot,0$) as our prior, the KL divergence is:\footnote{Our KL divergence agrees with that of \newcite{Davidson_Falorsi_Cao_Kipf_Tomczak_2018} (see their appendix for a derivation), and we have verified it empirically. The equation in \newcite{guu2017generating} gives slightly different KL values, though differences are small ($<$5\%) for most $\kappa$ and dimension values we encounter.} \begin{multline*} \text{KL}(\text{vMF}(\mu,\kappa) || \text{vMF}(\cdot,0)) =\kappa \frac{ I_{d/2}(\kappa)}{I_{d/2-1}(\kappa)}\\ + \left(\frac{d}{2}-1\right)\log\kappa - \frac{d}{2}\log(2\pi) - \log I_{d/2-1}(\kappa) \\ + \frac{d}{2} \log \pi + \log 2 - \log\Gamma\left(\frac{d}{2}\right) \end{multline*} Critically, this only depends on $\kappa$, not on $\mu$. $\kappa$ will be treated as a fixed hyperparameter, so this term will be constant for our model; KL collapse will therefore be rendered impossible. Figure \ref{klc} shows a visualization of the learning trajectories of Gaussian and vMF VAE. For the Gaussian VAE, the KL divergence in the objective function tends to pull the posterior towards the prior centered at the origin and, therefore, make the optimization difficult as mentioned before. For the vMF VAE, given fixed $\kappa$, there is no such vacuous state and $\mu$ can vary freely. Figure \ref{stat_vmf} shows the KL value and concentration of vMF($\mu,\kappa$) for two different dimensionalities. KL increases monotonically with $\kappa$, as does concentration measured by cosine similarity. To get a fixed cosine dispersion as dimensionality increases, higher $\kappa$ values are needed, resulting in higher KL values. \paragraph{Sampling from vMF} Following the implementation of \newcite{guu2017generating}, we use the rejection sampling scheme of \newcite{wood1994simulation} to sample a ``change magnitude'' $w$. Our sample is then given by $z = w \mu + v \sqrt{1-w^2}$, where $v$ is a randomly sampled unit vector tangent to the hypersphere at $\mu$. Neither $v$ nor $w$ depends on $\mu$, so we can now take gradients of $z$ with respect to $\mu$ as required. \begin{figure}[t!] \centering \includegraphics[width=0.48125\textwidth]{vmf2d.pdf} \caption{Visualization of the interaction between $\kappa$, KL, and dimensionality in vMF. Cos represents the cosine similarity between $\mu$ and samples from vMF$_d$($\mu,\kappa$) which reflects how disperse the distribution is. KL is defined as KL with a uniform vMF prior, KL(vMF$_d$($\mu,\kappa)||\text{vMF}(\cdot,0)$). Higher $\kappa$ values yield higher cosine similarities, but also higher KL costs. } \label{stat_vmf} \end{figure} \section{Experiments on Language Modeling} \label{sec:nvrnn} We first evaluate our vMF approach in the NVRNN setting. We will return to this model and analyze its properties further in Sections~\ref{ana:what} and \ref{ana:task} after showing experiments on document modeling. \paragraph{Dataset} For NVRNN, we use the Penn Treebank \cite{marcus1993building}, also used in \newcite{bowman2016generating}, and Yelp 2013 \cite{xu2016cached}. Examples in the Yelp dataset are much longer and more diverse than those from PTB, requiring more understanding of high-level semantics to generate a coherent sequence. Yelp has a long tail of very long reviews, so we truncate the examples to a maximum length of 50 words; this still gives an average length over twice as long as in the PTB setting. Statistics about all datasets used in this paper are shown in Table \ref{dataset}. \input{tab_data.tex} \input{tab_rnn_main.tex} \paragraph{Settings} We evaluate our NVRNN as in \newcite{bowman2016generating} and explore two different settings. In the \textbf{Standard} setting, the input to the RNN at each time step is the concatenation of the latent code $z$ and the ground truth word from the last time step, while the \textbf{Inputless} setting does not use the prior word. The more powerful decoder of the Standard setting makes the latent representations inherently less useful. In the Inputless setting, the decoder needs to predict the whole sequence with only the help of given latent code. In this case, a high-quality representation of the sentence is badly needed and the model is driven to learn it. Our implementation of VAE uses a one layer unidirectional LSTM as both encoder and decoder. We use an embedding size of 100 and hidden units of size 400 in the LSTM. The dimension of the latent code is chosen from $\{ 25,50,100 \}$ by tuning on the development set. We use SGD to optimize all models with decayed learning rate and gradient clipping. For Yelp, the sentiment bit, which ranges from 1 to 5, is also embedded into a 50 dimension vector and input for every time step of the decoding phase. \paragraph{Results} Experimental results of the NVRNN are shown in Table~\ref{nvrnn}. We report negative log likelihood (NLL)\footnote{Reported values are actually a lower bound on the true NLL, computed from ELBO by sampling $z$.} and perplexity (PPL) on the test set. We follow the implementation reported in \newcite{bowman2016generating} where the KL term weight is annealed for the Gaussian VAE; vMF VAE works well without weight annealing. The vMF distribution gives a performance boost in all datasets in both the Standard and Inputless settings. Even in the Standard setting, our model is able to successfully use nonzero KL values to achieve better perplexities, and even when KL collapse does not appear to be the case (e.g., G-VAE on the PTB-Standard setting), a Gaussian family of distributions results in lower KLs and worse log likelihoods, possibly due to optimization challenges. In the Inputless setting, we see large gains: vMF VAE reduces PPL from 379 to 262 in PTB, and from 256 to 134 in Yelp compared to Gaussian VAE. \begin{figure}[t!] \centering \includegraphics[width=0.48125\textwidth]{kl-tradeoff.pdf} \caption{Comparison of Gaussian- and vMF-NVRNN with different hyper-parameters. All models are trained on PTB in the Inputless setting where the latent dimension is 50. G-$\alpha$ indicates Gaussian VAE with KL annealed by the given constant $\alpha$, and V-$\kappa$ indicates VAE with $\kappa$ set to the given value. The green bar reflects the amount of KL loss while the total height reflects the whole objective. \textit{Numbers} above bars are perplexity. vMF is more highly tunable and also achieves stronger results across a wide range of $\kappa$ values.} \label{kl-tradeoff} \end{figure} \paragraph{Trade-off Comparison} Besides the overall perplexity, we are also interested in the trade-off between reconstruction loss and KL, and the contribution of KL to the whole objective. Figure~\ref{kl-tradeoff} shows the ability of our model to explicitly control the balance between the KL and the reconstruction term. First, we ``permanently'' anneal the Gaussian VAE by setting the weight of the KL term to a constant smaller than 1 (0.2 and 0.5 in our case). We find that this trick does mitigate the KL collapse, but the overall performance is worse. Therefore, this is not only a numerical game about the KL vs. NLL trade-off but a deeper challenge of how to structure models to learn effective latent representations. For vMF VAE, when we gradually increase the value of $\kappa$, the concentration of the distribution around the mean direction $\mu$ is higher and samples from vMF are closer to $\mu$. The model achieves the best perplexity when $\kappa=80$. The reconstruction error is bounded around 4.5 due to the difficulty of the task and limited capacity of LSTM decoder. While $\kappa$ is a hyperparameter that needs to be tuned, the model is overall not very sensitive to it, and we show in Section~\ref{ana:task} that reasonable $\kappa$ values transfer across similar tasks. \section{Experiments on Document Modeling} We also investigate how vMF VAE performs in a different setting, one less plagued by the KL collapse issue. Specifically, the Neural Variational Document Model (NVDM), proposed by \newcite{miao2016neural}, is a VAE-based unsupervised document model. This model follows the VAE framework introduced in Section~\ref{sec:bg}. Our document representation is an indicator vector $x$ of word presence or absence in the document. Since this is a fixed-size representation, we use 2-layer MLPs with 400 hidden units for both the encoder $q(z|x)$ and decoder $p(x|z)$; the decoder places a simple multinomial distribution over words in the vocabulary, and the probability of a document is the product of the probabilities of its words. \input{tab_nvdm.tex} \paragraph{Dataset} For NVDM, we use two standard news corpus, 20 News Groups (20NG) and the Reuters RCV1-v2, which were used in \newcite{miao2016neural}.\footnote{The preprocessed version can be downloaded from \href{https://github.com/ysmiao/nvdm}{\texttt{https://github.com/ysmiao/nvdm}}} \paragraph{Results} Experimental results\footnote{We do not compare to results from \newcite{serban2017piecewise}. Compared to our current results, that work reports very strong performance on 20NG and very weak performance on RCV1. Based on consultation with the authors, they use different preprocessing than \newcite{miao2016neural}.} are shown in Table~\ref{nvdm}. In contrast with NVRNN, the NVDM fully relies on the power of latent code to predict the word distribution, so we never observe a KL collapse, yet vMF still achieves better performance than Gaussian. As shown in Figure \ref{stat_vmf}, in order to keep the same amount of dispersion in samples from the variational posterior, larger latent dimensions need larger $\kappa$ values and correspondingly larger KL term values. For 20NG, which is much smaller than RCV1, smaller dimensions therefore give better performance. For both datasets, the settings of $\kappa=100,\text{dim}=25$ and $\kappa=150,\text{dim}\in\{50,200\}$ work well. \section{What do our VAEs encode?} \label{ana:what} We design more probing tasks to demonstrate what is encoded in latent representations induced by vMF VAE. One additional model variant we explore here is the NVRNN-BoW model. This is a variant of NVRNN where the decoder additionally conditions on the vector $BoW = \frac{1}{n} \sum_{i=1}^n e(x_i)$, the average word embedding value of the sentence $x$. While an artificial setting, this lets us see how effectively the latent code can capture information other than simple word choice by making a form of this information independently available. Table~\ref{bow} shows results in this setting, where once again we see the KL collapse problem for the Gaussian models and better performance from vMF on perplexity in both the Standard and Inputless settings. \paragraph{Is the latent code more than a bag of words?} For all of these models, one hypothesis is that the encoder may be learning to memorize the bag of words and then preferentially generate words in that bag from the decoder. To verify this, we investigate whether the BoW representation and the learned latent code can be reconstructed from each other. Specifically, given a sentence $x$ we can compute $BoW$ as defined above and $\mu = \textrm{enc}(x)$, the latent encoding of $x$ as represented by the mean vector output by the encoder. We can use a simple multilayer perceptron to to try to map from the bag of words to the latent code: $\hat{\mu} = MLP(BoW)$, then learn the parameters of the MLP by minimizing $\Vert \hat{\mu} - \mu \Vert^2$ on a sample. The same process can be used to learn a mapping from $\mu$ back to the bag of words. Table~\ref{c2b} shows averaged cosine similarities of our reconstructions under both Gaussian and vMF models. For vMF, $\mu$ can reconstruct the bag-of-words more accurately than the bag-of-words can reconstruct $\mu$, indicating that the latent code in vMF captures more information beyond the bag of words. \input{tab_c2b.tex} We repeat this experiment in a separate NVRNN model where the decoder can explicitly condition on the $BoW$ vector described above. The results are shown in the right column of Table~\ref{c2b}. Our model, v-VAE, achieves a lower cosine similarity than G-VAE (0.23 vs.~0.32), indicating that it capturing less redundant information and using the latent space to more efficiently model other properties of the data. \paragraph{Sensitivity to word order} Table~\ref{c2b} shows that NVRNN with vMF encodes information beyond the bag of words; a natural hypothesis is that it is encoding word order. We can more directly investigate this in the context of both NVRNN and NVRNN-BoW settings. Inspired by \newcite{junbo2017adversarially}, we propose an experiment probing the sensitivity to randomly swapping adjacent pairs of words for the encoding in the Inputless setting on PTB. We vary the probability of swapping each word pair and see how the latent code changes as the number of swaps increases. Ideally, our models should capture ordering information and therefore be sensitive to this change. Figure \ref{word-order} shows the results. v-VAE's representations are more sensitive than those of the G-VAE: they change faster as swaps become more likely.\footnote{The Gaussian VAE here makes very little use of the latent variable, hence why the representations change very little.} In the NVRNN-BoW setting, we see that the models are even more sensitive. vMF enables us to more easily learn this kind of desirable information in our sentence encodings. \begin{figure}[t] \centering \includegraphics[width=0.48125\textwidth]{word-order.pdf} \caption{Sensitivity of latent codes to swapping adjacent words of encoding sequence. Cosine similarity is measured between the latent code (encoded mean vector) of the original sentence and the sentence after swaps are applied. We see that vMF is more highly sensitive to swaps in both the NVRNN and NVRNN-BoW settings, indicating that its latent space likely encodes more ordering information.} \label{word-order} \end{figure} \section{ Analysis: Controlling the Trade-off } \section{Controlling Variance with $\kappa$} \label{ana:task} A core aspect of our approach so far has been treating $\kappa$ as a fixed hyperparameter. Fixing $\kappa$ is beneficial from an optimization standpoint: it makes it more difficult for the model to get stuck in local optima. But it also reduces the model's flexibility, since we can no longer predict per-example $\kappa$ values, and it introduces another parameter that the system designer must tune. Fortunately, a wide range of $\kappa$ values appear to work well for the tasks we consider. Figure~\ref{heatmap} shows how the concentration parameter $\kappa$ changes the results on PTB when the latent dimension and other hyperparameters are held fixed. We have ordered the tasks left-to-right from ``hardest'' to ``easiest'' in terms of necessity of latent representation: the Inputless setting needs heavy information from the latent code to reconstruct the sentence, whereas the Standard-BoW setting has an extremely strong decoder to predict the next word. We see that in each of these cases, a wide range of $\kappa$ values works, and moreover reasonable $\kappa$ values transfer between the two Standard and between the two Inputless settings, indicating that the overall approach is not highly sensitive to these hyperparameter values. \begin{figure}[t] \centering \includegraphics[width=0.48125\textwidth]{heatmap.pdf} \caption{Perplexity of v-VAE in different settings with different $\kappa$ values when the latent dimension is 50. Darker colors correspond to perplexity values closer to the best observed for that setting. For each task, we see that there is a range of $\kappa$ values that work well, and these transfer between comparable tasks.} \label{heatmap} \end{figure} \paragraph{Brittleness of Learning $\kappa$} Throughout this work, we have treated $\kappa$ as a fixed parameter. However, we can treat $\kappa$ in the same way as $\sigma$ in the Gaussian case and learn it on a per-instance basis. The KL divergence of vMF is differentiable with respect to $\kappa$ given gradients of the modified Bessel function of the first kind,\footnote{$\nabla_{\kappa} I_{d}(\kappa) = \frac{1}{2}( I_{d-1}(\kappa) + I_{d+1}(\kappa))$} allowing us to change the concentration on a per-instance basis. However, this reintroduces the issue of KL collapse: the KL term will encourage $\kappa$ to be as low as possible, potentially making the latent variable vacuous. In practice, we observe that it is necessary to clip $\kappa$ values to a certain range for numerical reasons. Within this range, the model gravitates towards the smallest $\kappa$ values and performs substantially worse than models trained with our fixed $\kappa$ approach. This indicates that even with the vMF model, the optimization problem posed by ELBO is simply a hard one and the approach of fixing KL divergence is a surprisingly good optimization technique. \section{Related Work} \paragraph{Applications of VAE in NLP} Deep generative models have achieved impressive successes in domains adjacent to NLP such as image generation \cite{gregor2015draw,oord2016pixel} and speech generation \cite{chung2015a,oord2016wavenet}. VAEs specifically \cite{kingma2013autoencoding,rezende2014stochastic} have been a popular model variant in NLP. They have been applied to tasks including document modeling \cite{miao2016neural}, language modeling \cite{bowman2016generating}, and dialogue generation \cite{serban2017a}. VAEs can be also be applied for semi-supervised classification \cite{xu2017variational}. Recent twists on the standard VAE approach including combining VAE and holistic attribute discriminators for conditional generation \cite{hu2017toward} and using a more flexible latent space regularized by an adversarial method \cite{junbo2017adversarially}. \paragraph{VAE Objective} Several pieces of recent work have highlighted the issues with optimizing the VAE objective. \newcite{Alemi_Poole_Fischer_Dillon_Saurous_Murphy_2018} shed light on the problem from the perspective of information theory. \newcite{Zhao_Song_Ermon_2017} and \newcite{betavae} both propose various reweightings of the objective along with theoretical and empirical justification. \paragraph{Choices of Priors for VAE} Some past work has explored various priors for VAE. \newcite{serban2017piecewise} proposed a piecewise constant distribution which deals with multiple modes, but which sacrifices the property of continuous interpolation. \newcite{guu2017generating} also applied vMF in a VAE model, but used theirs specifically in the sentence-editing case. \newcite{Davidson_Falorsi_Cao_Kipf_Tomczak_2018} explored vMF in a VAE model for MNIST and a link prediction task. \newcite{Hasnat_Bohné_Milgram_Gentric_Chen_2017} applied the vMF distribution for facial recognition. Other past work has used different decoders, including CNNs \cite{yang2017improved} and CNN-RNN hybrids \cite{semeniuta2017a}. Changing the decoder is a change largely orthogonal to changing the prior: it can alleviate the KL vanishing issue, but it does not necessarily scale to new settings and does not give explicit control over utilization of the latent code. \section{Conclusion} In this paper, we propose the use of a von Mises-Fisher VAE to resolve optimization issues in variational autoencoders for text. This choice of distribution allows us to explicitly control the balance between the capacity of the decoder and the utilization of the latent representation in a principled way. Experimental results demonstrate that the proposed model has better performance than a Gaussian VAE across a range of settings. Further analysis shows that vMF VAE is more sensitive to word order information and makes more effective use of the latent code space. \section*{Acknowledgments} This work was partially supported by NSF Grant IIS-1814522, a Bloomberg Data Science Grant, and an equipment grant from NVIDIA. The authors acknowledge the Texas Advanced Computing Center (TACC) at UT Austin for providing HPC resources used to conduct this research. Thanks as well to Raymond J. Mooney, Mingyuan Zhou, Yasumasa Onoe, and the anonymous reviewers for their helpful comments. \section{Conclusion} In this paper, we propose the use of a von Mises-Fisher VAE to resolve optimization issues in variational autoencoders for text. This choice of distribution allows us to explicitly control the balance between the capacity of the decoder and the utilization of the latent representation in a principled way. Experimental results demonstrate that the proposed model has better performance than a Gaussian VAE across a range of settings. Further analysis shows that vMF VAE is more sensitive to word order information and makes more effective use of the latent code space. \section*{Acknowledgments} This work was partially supported by NSF Grant IIS-1814522, a Bloomberg Data Science Grant, and an equipment grant from NVIDIA. The authors acknowledge the Texas Advanced Computing Center (TACC) at The University of Texas at Austin for providing HPC resources used to conduct this research. Thanks as well to the anonymous reviewers for their helpful comments.
\section{Introduction} A {\em spider} is an algebraic structure that can be used to encode the representation category of a quantum group. Kuperberg \cite{kuperberg} gave generators and relations for spiders for rank two Lie algebras. Cautis, Kamnitzer, and Morrison \cite{ckm} did the same for $SL_n$. The aim of this paper is to define a new spider that contains a copy of the $SL_n$ spider. The precise definition of the term ``spider'' is not all that important in this paper. We only need to define two specific spiders, and a map between them. We define a spider by defining its {\em webs}, and giving a list of relations these webs satisfy. A web will be some kind of graph drawn in a disk, with endpoints on the boundary of the disk. A relation will be a formal linear relation between webs. A relation can be applied ``locally'' inside a larger web, which remains unchanged outside the region where the relation is applied. We will work over the field $\mathbb{Q}(q)$. The quantum integers are \[ [n] = q^{1 - n} + q^{3 - n} + \dots + q^{n - 3} + q^{n - 1}. \] We use $\mathbb{Q}(q)$ for the convenience of being able to divide by quantum integers, but it might be possible to prove our main result over the ring $\mathbb{Z}[q^{\pm 1}]$. My motivation for the construction in this paper was to get a better understanding of spiders, which are currently presented by generators and relations that seem somewhat ad hoc. The relations for the new spider are simpler, and defined using the combinatorial data coming from the root system of $SL_n$. However, there is much that still remains mysterious. I do not know how to prove that the new spider contains the $SL_n$ spider without already knowing generators and relations for the $SL_n$ spider. One approach might start by using the same new spider to encode the Hopf algebra $U_q(\mathfrak{sl}_n)$, generalizing the $n = 2$ case from \cite{big14}. I also do not know whether the new spider is a diagrammatic encoding of some other known approach to the $SL_n$ spider. I think it has something to do with the graph planar algebra, as defined in \cite{jones00}, but for paths in the root lattice. With a more sophisticated definition, it should be possible to encode the Ocneanu cells for the $\mathcal{A}^{(n)}$ graph, as defined in \cite{evanspugh}. A bonus feature of our approach is that it extends, with no extra effort, to webs with virtual crossings. These satisfy detour moves, but not virtual Reidemeister one. This leads to an invariant of ``rotational virtual'' knots and links, which is presumably the same as the one defined by Kauffman \cite{kauffman}. \section{Webs} \label{sec:web} \begin{figure} \[ \begin{array}{OOOO} \tikz { \draw[->] (0,0) -- (90:6) node [right] {$k + l$}; \draw[->-] (210:6) node [left] {$k$} -- (0,0); \draw[->-] (330:6) node [right] {$l$} -- (0,0); } & \tikz { \draw[->-] (90:6) node [right] {$k + l$} -- (0,0); \draw[->] (0,0) -- (210:6) node [left] {$k$}; \draw[->] (0,0) -- (330:6) node [right] {$l$}; } & \tikz { \draw[->] (0,1) -- (0,6) node [right] {$k$}; \draw[->] (0,1) -- (0,-4) node [right] {$n - k$}; \draw (0,1) -- (2,1); } & \tikz { \draw[->-] (0,6) node [right] {$k$} -- (0,1); \draw[->-] (0,-4) node [right] {$n - k$} -- (0,1); \draw (0,1) -- (2,1); } \end{array} \] \caption{The four kinds of vertex in a web} \label{fig:webgen} \end{figure} A {\em web} in the $SL_n$ spider is a certain kind of graph drawn in the plane. Each strand is oriented and is labeled by an integer from $\{1,\dots,n-1\}$. A web can have bivalent and trivalent vertices, of the forms shown in Figure~\ref{fig:webgen}. At a trivalent vertex, either strands labeled $k$ and $l$ fuse to a strand labeled $k + l$, or a strand labeled $k + l$ divides into strands labeled $k$ and $l$. At a bivalent vertex, strands labeled $k$ and $n - k$ either both enter or both exit the vertex, and a {\em tag} points to one of the two sides of the vertex, breaking its rotational symmetry. \begin{figure} \[ \begin{array}{|T|T|} \hline { \phantom{ \tikz {\draw (0,-10) -- (0,10)}} \tikz { \draw[->] (0,0) -- (0,6) node [right] {$k$}; \draw[->] (0,0) -- (0,-6) node [right] {$n - k$}; \draw (0,0) -- (2,0); } = (-1)^{k(n - k)} \tikz { \draw[->] (0,0) -- (0,6) node [right] {$k$}; \draw[->] (0,0) -- (0,-6) node [right] {$n - k$}; \draw (0,0) -- (-2,0); } } & { \tikz { \draw[->-] (0,-6) -- (0,-2); \draw (0,-2) -- (2,-2); \draw[->-] (0,2) -- (0,-2); \draw (0,2) -- (2,2); \draw[->] (0,2) -- (0,6) node [right] {$k$}; } = \, \tikz { \draw[->] (0,-6) -- (0,6) node [right] {$k$}; } } \\ \hline { \phantom{ \tikz {\draw (0,-10) -- (0,10)}} \tikz { \draw[->-] (-6,-6) node [left] {$l$} .. controls (-5,-5) and (-4,-3) .. (0,-3); \draw[->-] (6,-6) node [right] {$m$} .. controls (5,-5) and (4,-3) .. (0,-3); \draw[->-] (0,-3) -- (0,3); \draw[->-] (-6,6) node [left] {$k$} .. controls (-5,5) and (-5,3) .. (0,3); \draw[->] (0,3) .. controls (4,3) and (5,5) .. (6,6); } = \tikz { \draw[->-] (-6,-6) node [left] {$l$} .. controls (-5,-5) and (-3,-4) .. (-3,0); \draw[->-] (-6,6) node [left] {$k$} .. controls (-5,5) and (-3,4) .. (-3,0); \draw[->-] (-3,0) -- (3,0); \draw[->-] (6,-6) node [right] {$m$} .. controls (5,-5) and (3,-4) .. (3,0); \draw[->] (3,0) .. controls (3,4) and (5,5) .. (6,6); } } & { \tikz { \draw[->-] (0,-8) -- (0,-4); \draw[->-] (0,-4) arc (270:90:4); \draw[->-] (0,-4) arc (-90:90:4) node[pos=0.5,right]{$1$}; \draw[->] (0,4) -- (0,8) node [right] {$k$}; } = [k] \: \tikz { \draw[->] (0,-8) -- (0,8) node [right] {$k$}; } } \\ \hline \multicolumn{2}{|F|} { \phantom{ \tikz {\draw (0,-10) -- (0,10)}} \tikz { \draw[->-] (45:4) arc (45:135:4) node [pos=0.5, above]{$1$}; \draw[-<-] (135:4) arc (135:225:4); \draw[->-] (225:4) arc (225:315:4) node [pos=0.5, below]{$1$}; \draw[->-] (315:4) arc (315:405:4); \draw[->-] (7,-7) node [right] {$1$} -- (315:4); \draw[->] (45:4) -- (7,7) node [right] {$1$}; \draw[->] (135:4) -- (-7,7) node [left] {$k$}; \draw[->-] (-7,-7) node [left] {$k$} -- (225:4); } = \tikz { \draw[->-] (-7,-7) node [left] {$k$} .. controls (-6,-6) and (-3,-5) .. (0,-4); \draw[->-] (7,-7) node [right] {$1$} .. controls (6,-6) and (3,-5) .. (0,-4); \draw[->-] (0,-4) -- (0,4); \draw[->] (0,4) .. controls (-3,5) and (-6,6) .. (-7,7) node [left] {$k$}; \draw[->] (0,4) .. controls (3,5) and (6,6) .. (7,7) node [right] {$1$}; } + [k - 1] \tikz { \draw[->] (-7,-7) .. controls (-4,-4) and (-4,4) .. (-7,7) node [left] {$k$}; \draw[->] (7,-7) .. controls (4,-4) and (4,4) .. (7,7) node [right] {$1$}; } } \\ \hline \end{array} \] \caption{Web relations. Some labels are omitted, but can be deduced.} \label{fig:webrel} \end{figure} The relations are shown in Figure \ref{fig:webrel}. Here, and throughout the paper, we omit some of the labels on strands, as long as they can be deduced from context. We call the relations: \begin{itemize} \item switching a tag, \item canceling a pair of tags, \item $I = H$, \item bursting a digon, \item bursting a square. \end{itemize} We allow strands to be labeled $n$, with the convention any such strand can be deleted. Any trivalent vertex that had a strand labeled $n$ then becomes a bivalent vertex with a tag on the side of the deleted strand. We also impose the relations obtained by reversing all of the arrows in any of the above relations. Note that we have used a convention for tags that is different from that of \cite{ckm}. To recover the convention in \cite{ckm}, switch the side of the tag on every bivalent vertex whose strands are oriented inward. We have also used a smaller set of relations than in \cite{ckm}, so as to make our job easier. \begin{proposition} \label{prop:relations} The above set of relations is equivalent to the defining relations given in \cite{ckm}, but with a different convention for tags. \end{proposition} \begin{proof} Our relations appear in \cite{ckm} as equations (2.3), (2.12), (2.6), (2.4) for $l = 1$, and (2.10) for $r = s = l = 1$. Conversely, the defining relations (2.3) through (2.10) in \cite{ckm} can be deduced from the relations given here. We leave this as an exercise, with hints. ``Tag migration'' (2.7) is a special case of the $I=H$ relation. The second version of ``tag migration'' (2.8) follows from the first, together with tag cancellation. ``Square removal'' (2.9) is proved by induction on $s$, where the case $s=1$ follows from the $I=H$ relation and our digon bursting relation. ``Removing a bigon'' (2.4) is proved by induction on $l$, using the square removal relation. The other version of ``removing a bigon'' (2.5) follows from the first and tag cancellation. For the ``square switching'' relation (2.10), note that we can burst either of the two squares in the web \[ \tikz { \draw[->-] (0,-5) -- (0,5); \draw[->-] (-30:5) arc (-30:30:5); \draw[-<-] (30:5) arc (30:90:5) node[pos=0.5,above]{$1$}; \draw[->-] (90:5) arc (90:150:5) node[pos=0.5,above]{$1$}; \draw[-<-] (150:5) arc (150:210:5); \draw[->-] (210:5) arc (210:270:5) node[pos=0.5,below]{$1$}; \draw[-<-] (270:5) arc (270:330:5) node[pos=0.5,below]{$1$}; \draw[->-] (0,-5) -- (0,5); \draw[->] (30:5) -- (30:10) node [right] {$l$}; \draw[->] (150:5) -- (150:10) node [left] {$k$}; \draw[-<-] (210:5) -- (210:10) node [left] {$k$}; \draw[-<-] (330:5) -- (330:10) node [right] {$l$}; }. \] Equating the two outcomes implies the case $r = s = 1$ of the square switching relation. The general case then follows by induction. \end{proof} \section{Cobwebs} \label{sec:cob} Biologists classify spider webs into types. If the diagrams in the previous section are supposed to resemble the usual ``orb webs'', then the diagrams introduced in this section more closely resemble ``cobwebs'', since they have no vertices except for bivalent vertices and virtual crossings. Let $e_1,\dots,e_n$ be the standard basis vectors in $\mathbb{R}^n$. The {\em roots} of the $SL_n$ root system are the vectors \[ \alpha_{i,j} = e_i - e_j \] for $i,j \in \{1,\dots,n\}$ with $i \neq j$. Call $\alpha_{i,j}$ a {\em positive root} if $i > j$. \begin{figure} \[ \begin{array}{OOO} \tikz { \draw[->-] (-5,-5) node [left] {$\alpha_{i,j}$} -- (0,0); \draw[->-] (5,-5) node [right] {$\alpha_{k,l}$} -- (0,0); \draw[->] (0,0) -- (-5,5) node [left] {$\alpha_{k,l}$}; \draw[->] (0,0) -- (5,5) node [right] {$\alpha_{i,j}$}; } & \tikz { \draw[->] (0,0) -- (0,5) node [right] {$\alpha_{i,j}$}; \draw[->] (0,0) -- (0,-5) node [right] {$\alpha_{j,i}$}; \draw (0,0) -- (2,0); } & \tikz { \draw[->-] (0,5) node [right] {$\alpha_{i,j}$} -- (0,0); \draw[->-] (0,-5) node [right] {$\alpha_{j,i}$} -- (0,0); \draw (0,0) -- (2,0); } \end{array} \] \caption{Virtual crossings and bivalent vertices in a cobweb.} \label{fig:cobgen} \end{figure} A {\em cobweb} is a collection of strands drawn in the plane. Each strand is oriented and is labeled by a root. A cobweb can have virtual crossings and bivalent vertices, as shown in Figure \ref{fig:cobgen}. A virtual crossing is a point where a pair of strands pass through each other. A bivalent vertex has strands labeled $\alpha_{i,j}$ and $\alpha_{j,i}$, oriented both in or both out, and has a tag that points to one side of the vertex. \begin{figure} \[ \begin{array}{|T|T|} \hline { \phantom{ \tikz {\draw (0,-8) -- (0,8)}} \tikz { \draw (0,-5) -- (0,5); \draw (0,0) -- (2,0); } = (-1) \tikz { \draw (0,-5) -- (0,5); \draw (0,0) -- (-2,0); } } & { \tikz { \draw (0,-5) -- (0,5); \draw (0,-2) -- (2,-2); \draw (0,2) -- (2,2); } = \, \tikz { \draw (0,-5) -- (0,5); } } \\ \hline { \phantom{ \tikz {\draw (0,-8) -- (0,8)}} \tikz { \draw[->] (5,0) arc (0:500:5) node [left] {$\alpha_{i,j}$}; } = q^{\sign(i - j)} } & { \tikz { \draw (-3,-5) .. controls (3,0) .. (-3,5); \draw (3,-5) .. controls (-3,0) .. (3,5); } = \tikz { \draw (-3,-5) .. controls (-2,-4) and (-2,4) .. (-3,5); \draw (3,-5) .. controls (2,-4) and (2,4) .. (3,5); } } \\ \hline { \phantom{ \tikz {\draw (0,-8) -- (0,8)}} \tikz { \draw (-3,-5) -- (3,5); \draw (3,-5) -- (-3,5); \draw (-5,0) .. controls (0,3) .. (5,0); } = \tikz { \draw (-3,-5) -- (3,5); \draw (3,-5) -- (-3,5); \draw (-5,0) .. controls (0,-3) .. (5,0); } } & { \tikz { \draw (0,-5) -- (0,5); \draw (0,0) -- (2,0); \draw (-5,0) .. controls (0,3) .. (5,0); } = \tikz { \draw (0,-5) -- (0,5); \draw (0,0) -- (2,0); \draw (-5,0) .. controls (0,-3) .. (5,0); } } \\ \hline \multicolumn{2}{|F|} { \phantom{ \tikz {\draw (0,-8) -- (0,8)}} \tikz { \draw[->] (-4,-5) -- (4,5) node [right] {$\alpha_{i,j}$}; \draw[->] (4,-5) -- (-4,5) node [left] {$\alpha_{i,j}$}; } = \tikz { \draw[->] (-4,-5) .. controls (0,0) .. (-4,5) node [left] {$\alpha_{i,j}$}; \draw[->] (4,-5) .. controls (0,0) .. (4,5) node [right] {$\alpha_{i,j}$}; } } \\ \hline \end{array} \] \caption{Cobweb relations. Unlabeled strands can have any consistent orientations and labels.} \label{fig:cobrel} \end{figure} The relations are shown in Figure \ref{fig:cobrel}. These apply for any way to fill in the omitted orientations and labels, where the orientations and labels on a vertex or virtual crossing must be as in the Figure~\ref{fig:cobgen}, and both sides of an equation must have the same pattern of orientations and labels on their boundaries. We call the relations: \begin{itemize} \item switching a tag, \item canceling two tags, \item bursting a bubble, \item three detour moves: virtual Reidemeister moves two and three, and sliding a virtual crossing past a tag, \item smoothing a virtual crossing of two strands that have the same label. \end{itemize} We will also need the following ``saddle relation''. \begin{proposition} \label{prop:saddle} The following is a consequence of the cobweb relations, where all strands have the same label $\alpha_{i,j}$. \[ \tikz { \draw[->] (5,-5) .. controls (1,-1) and (-1,-1) .. (-5,-5); \draw[->] (-5,5) .. controls (-1,1) and (1,1) .. (5,5); } = q^{\sign(i-j)} \tikz { \draw[->] (5,-5) .. controls (1,-1) and (1,1) .. (5,5); \draw[->] (-5,5) .. controls (-1,1) and (-1,-1) .. (-5,-5); } \] \end{proposition} \begin{proof} Starting with the cobweb on the left, use virtual Reidemeister two to introduce two virtual crossings, and then smooth both of these crossings, and burst the resulting bubble. \end{proof} Other important consequences of the cobweb relations include virtual Reidemeister one with a scalar, and bursting a negatively oriented bubble. \[ \begin{array}{TT} { \tikz { \useasboundingbox (0,-5) -- (-9,5); \draw[->] (0,-5) .. controls (-12,20) and (-12,-20) .. (0,5); } = q^{\sign(i-j)} \; \tikz { \draw[->] (0,-5) -- (0,5); } } & { \tikz { \draw[->] (-5,0) arc (540:140:5); } = q^{\sign(j - i)} }. \end{array} \] Here, all strands have the same label $\alpha_{i,j}$. Whenever something is defined by generators and relations, it is worth checking that it is not trivial. The following proposition does this. \begin{proposition} \label{prop:1D} The space spanned by closed cobwebs is one-dimensional. \end{proposition} \begin{proof} It is easy to use the cobweb relations to reduce any closed cobweb to some monomial $\pm q^t$ times the empty cobweb. We will describe how to compute this monomial in a completely canonical way. It is best here to think of each bivalent vertex as a place where a single strand changes its label and orientation. With this convention, a closed cobweb consists of a collection of immersed loops. Give each loop the overall orientation that is the same as all segments labeled by a positive root, and the opposite of all segments labeled by a negative root. With respect to these orientations, let $s$ be the number of tags that are on the left side of their loop, and let $t$ be the sum of the turning numbers of all loops. Our desired monomial is then $(-1)^s q^t$. Note that we would get the same answer if we counted tags on the right side of loops, since there must be an even number of tags in total. Our calculation is easily shown to be invariant under all cobweb relations. This implies that the vector space of closed cobwebs modulo cobweb relations is precisely the vector space of scalar multiples of the empty diagram. \end{proof} \section{The map} \label{sec:map} We will define a map that takes each web to a sum of cobwebs. We use a state sum. A {\em state} on a web is a way to assign a subset of $\{1,\dots,n\}$ to each strand such that the following conditions are satisfied. If a strand is labeled by the integer $k$, then it must be assigned a set that has cardinality $k$. The strands at a trivalent vertex must be assigned sets $K$, $L$ and $K \cup L$, where $K$ and $L$ are disjoint. The strands at a bivalent vertex must be assigned sets $K$ and $L$ such that $K$ and $L$ are disjoint, and $K \cup L = \{1,\dots,n\}$. For every state, we define a corresponding cobweb as follows. If a strand is labeled by a set $K$ then replace it by a collection of parallel strands, with one strand labeled $\alpha_{i,j}$ for every $i \in K$ and $j \not \in K$. The orientation of these parallel strands should be the same as that of the original strand. Because of virtual crossings, it does not matter in what order they are arranged. Consider a trivalent vertex in which strands enter from the left and right, and one strand exits to the top. Suppose the strands are assigned the sets $K$ on the left, $L$ on the right, and $K \cup L$ on the top. We replace this vertex with a cobweb that has the following strands: \begin{itemize} \item for every $i \in K$ and $j \not \in K \cup L$ there is a strand labeled $\alpha_{i,j}$ going from the left to the top, \item for every $i \in L$ and $j \not \in K \cup L$ there is a strand labeled $\alpha_{i,j}$ going from the right to the top, and \item for every $i \in K$ and $j \in L$ there are strands labeled $\alpha_{i,j}$ and $\alpha_{j,i}$ that come from the left and right to meet at a bivalent vertex with a tag pointing up. \end{itemize} For a trivalent vertex with one strand oriented in and two strands oriented out, simply reverse all of the arrows in the above. Now consider a bivalent vertex with incoming strands entering from the left and right, and a tag pointing up. Suppose the strands are assigned the sets $K$ on the left and $L$ on the right. We map this vertex to a cobweb with the following strands. For every $i \in K$ and $j \in L$, there are strands labeled $\alpha_{i,j}$ and $\alpha_{j,i}$ coming from the left and right to meet at a bivalent vertex with a tag pointing up. For a bivalent vertex with two strands oriented out, simply reverse all of the arrows in the above. Note that, for any vertex with any state, the two or three strands map to parallel sets of cobweb strands, and the vertex maps to a way to connect up the endpoints from these parallel sets of strands. Thus, for any web with any state, the vertices and edges map to cobwebs that join up correctly to make a single complete cobweb. We can at least partly explain where the definitions in this section come from. A strand labeled $k$ corresponds to the $k$th exterior power of the defining representation of $SL_n$. The weight system for this representation is the set of vectors \[ \lambda_K = \sum_{i \in K} e_i \] such that $K$ has cardinality $k$. (Strictly speaking, we should project these vectors onto the hyperplane spanned by the roots, but this will not make any difference.) A strand assigned the weight $\lambda_K$ is mapped to parallel strands, with one for each root whose inner product with $\lambda_K$ is one. The rule for vertices is not so easily explained. It is, in some sense, the simplest rule possible, but the real justification is that it works, as we prove next. \section{The map is well-defined} \begin{proposition} \label{prop:map} The map defined in Section~\ref{sec:map} is a well-defined injective map from the $SL_n$ spider to the cobweb spider. \end{proposition} \begin{proof} Assuming the map is well-defined, it is clearly not the zero map, since it takes the empty web to the empty cobweb, which is non-zero by Proposition~\ref{prop:1D}. Injectivity then follows from the fact that the $SL_n$ spider has no non-zero proper ideals. To prove that the map is well-defined, we check that it respects each of the web relations listed in Section~\ref{sec:web}. A set of {\em boundary data} on a relation is a way to assign a set to each of the strands on the boundary, where we assign the same set to every strand at any given position on the boundary. For all such boundary data, we replace each web by the sum of cobwebs over all states that are consistent with the boundary data. We then check that the left and right sides of the equation map to the same linear combination of cobwebs, up to the cobweb relations from Section~\ref{sec:cob}. We must do this for every relation, and every choice of boundary data that extends to at least one state on at least one web in the relation. We will repeatedly find ourselves computing the cobweb corresponding to a state on a web. It is easiest to do this one pair of roots $\pm \alpha_{i,j}$ at a time. We check cases based on where $i$ and $j$ lie. Cobweb strands with labels $\pm \alpha_{i,j}$ appear wherever a web strand was assigned a set that contains exactly one of $i$ and $j$. \subsection{Strands labeled $n$} A strand that is labeled $n$ must be assigned the set $\{1,\dots,n\}$, and then mapped to an empty collection of parallel cobweb strands. All of our calculations will be compatible with the convention for strands labeled $n$. \subsection{Reversing all orientations} The cobweb relations are invariant under switching all orientations and mapping $q$ to $q^{-1}$. The coefficients in the web relations are all invariant under mapping $q$ to $q^{-1}$, so all of our proofs will also apply when all orientations are reversed. \subsection{Tag operations} The tag switching and tag canceling relations for webs follow immediately from the same relations for cobwebs. Note that a strand labeled $k$ is mapped to $k(n - k)$ parallel cobweb strands, so a tag switch in the web corresponds to $k(n - k)$ tag switches in the cobweb. \subsection{The $I = H$ relation} Assign the sets $K$, $L$, and $M$ to the strands labeled $k$, $l$ and $m$, and $K \cup L \cup M$ to the strands at the top-right. Here, $K$, $L$, and $M$ are disjoint and have cardinalities $k$, $l$, and $m$. We must then assign $L \cup M$ to the vertical strand in the $I$-shaped web, and $K \cup M$ to the horizontal strand in the $H$-shaped web. Each side of the equation is thus mapped to a single cobweb. Let $\alpha_{i,j}$ be a root. We want to show that the strands labeled $\alpha_{i,j}$ and $\alpha_{j,i}$ are the same for the $I$- and $H$-shaped webs. To be excessively thorough, we could check sixteen cases, based on whether $i$ lies in $K$, $L$, $M$, or none of them, and similarly for $j$. For example, if $i \in K$ and $j \in L$ then there are strands labeled $\alpha_{i,j}$ and $\alpha_{j,i}$ coming from the top-left and bottom-left, and meeting at a bivalent vertex with a tag to the right. If $i \in K$ and $j \not\in K \cup L \cup M$ then there is a strand labeled $\alpha_{i,j}$ going from the top-left to the top-right. The remaining cases are similar. \subsection{Bursting a digon} Assign the set $K$ to the strands on the top and bottom of the webs. A state on the web on the left side of the equation corresponds to a choice of $a \in K$. Namely, assign $K \setminus \{a\}$ and $\{a\}$ to the left and right sides of the digon. The corresponding cobweb has the following strands. For every $i \in K$ and $j \not \in K$, there is a strand labeled $\alpha_{i,j}$ going vertically from the bottom of the cobweb to the top. For every $j \in K \setminus \{a\}$, there are strands labeled $\alpha_{j,a}$ and $\alpha_{a,j}$ going up the left and right side of the digon, and meeting at two bivalent vertices. We can cancel the tags to get a positively oriented bubble labeled $\alpha_{a,j}$. Bursting these bubbles over all $j \in K \setminus \{a\}$ gives $q$ to the power of the exponent: \[ |\{j \in K \mid j < a\}| - |\{j \in K \mid j > a\}|. \] Now take the sum over all $a \in K$. The vertical strands of the cobwebs are the same in all terms, and the powers of $q$ sum to $[k]$. This is the same as the right side of the digon relation. \subsection{Bursting a square} Assign sets to each of the four strands on the boundary of the webs. There are three cases to consider. {\bf Case 1:} Let $K$ have cardinality $k$, and let $y \in K$. Assign $K$ to the top-left and bottom-left strands of all webs, and $\{y\}$ to the top-right and bottom-right strands. Let $K' = K \setminus \{y\}$. A state on the web on the left side of the equation corresponds to a choice of $a \in K'$. Namely, assign $\{a\}$ to the horizontal strands, $\{a,y\}$ to the right side of the square, and $K \setminus \{a\}$ to the left. By checking cases, the cobweb corresponding to the above state has the following strands. For all $j \in K' \setminus \{a\}$, there is a closed loop made by strands labeled $\alpha_{a,j}$ and $\alpha_{j,a}$ meeting at two bivalent vertices. Every other strand goes vertically from the bottom of the cobweb to the top, after canceling a pair of tags in the case of $\alpha_{y,a}$. We can cancel pairs of tags to convert the closed loops to positively oriented bubbles labeled $\alpha_{a,j}$. Bursting all of these bubbles gives $q$ to the power of the exponent \[ |\{j \in K' \mid j < a\}| - |\{j \in K' \mid j > a\}|. \] Now take the sum over all $a \in K'$. The vertical strands are the same for every term, and the powers of $q$ add up to $[k - 1]$. On the right side of the equation, the first term has no state that is consistent with the boundary data, and the second has one. The second term has a coefficient of $[k - 1]$, and maps to the same cobweb as we got on the left side of the equation. {\bf Case 2:} Let $K'$ have cardinality $k - 1$, and $x,y \not\in K'$. Assign $K' \cup \{x\}$ and $\{y\}$ to the bottom-left and bottom-right strands of all webs. Assign $K' \cup \{y\}$ and $\{x\}$ to the top-left and top-right strands of all webs. There is only one state on the web on the left side of the equation that is consistent with the boundary data. Namely, assign $\{y\}$ and $\{x\}$ to the top and bottom sides of the square, and assign $K'$ and $\{x,y\}$ to the left and right sides. By checking cases, the corresponding cobweb has the following strands: \begin{itemize} \item for every $j \in K' \cup \{y\}$, there is a cup formed by strands labeled $\alpha_{x,j}$ and $\alpha_{j,x}$ that meet at a bivalent vertex with a downward tag, \item for every $j \in K' \cup \{x\}$, there is a cap formed by strands labeled $\alpha_{y,j}$ and $\alpha_{j,y}$ that meet at a bivalent vertex with an upward tag, and \item every other strand goes from the bottom of the cobweb to the top. \end{itemize} On the right side of the equation, the first term has one state that is consistent with the boundary data, and the second has none. The cobweb corresponding to the first term is the same as the cobweb corresponding to the left side of the equation. {\bf Case 3:} Let $K$ have cardinality $k$, and $y \not\in K$. Assign $K$ to the top-left and bottom-left strands of all webs, and $\{y\}$ to the top-right and bottom-right strands. A state on the web on the left side of the equation corresponds to a choice of $a \in K$. Namely, assign $\{a\}$ to the top and bottom sides of the square, and assign $K \setminus \{a\}$ and $\{a,y\}$ to the left and right sides. After canceling tags, the corresponding cobweb has the following strands: \begin{itemize} \item for $j \in K \setminus \{a\}$, there is a positively oriented bubble labeled $\alpha_{a,j}$, \item the strands labeled $\alpha_{a,y}$ and $\alpha_{y,a}$ form a cup and a cap with two bivalent vertices, and \item every other strand goes vertically from the bottom of the cobweb to the top. \end{itemize} Use Proposition~\ref{prop:saddle} and tag cancellation to convert the cup and cap to vertical strands with a coefficient $q^{\sign(y - a)}$. This, and bursting all bubbles, gives $q$ to the power of the exponent \[ |\{j \in K \mid j < a\}| - |\{j \in K \mid j > a\}| + \sign(y - a). \] Take the sum these powers of $q$ over all $a \in K$. If it were not for the $\sign(y - a)$ term in the exponent of $q$, we would get $[n]$. The $\sign(y - a)$ changes this to $[n - 1]$ but with one term repeated. Specifically, we get \[ q^m + [n - 1], \text{ where } m = |\{j \in K \mid j < y\}| - |\{j \in K \mid j > y\}|. \] The first term on the right side of the equation has one state consistent with the boundary data. In the corresponding cobweb, all strands go vertically from the bottom to the top with the following exceptions. For all $j \in K$, the strands labeled $\alpha_{j,y}$ and $\alpha_{y,j}$ form a cup and a cap with two bivalent vertices. Use Proposition~\ref{prop:saddle} to convert each such cup and cap to $q^{\sign(y - j)}$ times vertical strands with a canceling pair of tags. These coefficients combine to give $q^m$, with the same $m$ as above. The second term on the right side of the equation has one state that is consistent with the boundary data. This term has a coefficient $[k - 1]$, and has a corresponding cobweb that consists of only vertical strands. In the end, all cobwebs have the same vertical strands, and the coefficients add up to $q^m + [n - 1]$ on either side of the equation. This completes the proof. \end{proof}
\section{Usage} The GI gives specification \texttt{http://www.gi-ev.de/LNI} on the formatting of documents inside the LNI. For \LaTeX-Documents this is done with the help of the document class \texttt{lni}. This document gives information on version 0.6. with bibliography styles \texttt{lnig.bst} (deutsch) version 2.0 and \texttt{lni.bst} (english) version 1.0. The document class can be included within the document header. \begin{verbatim} \documentclass{lni} \end{verbatim} The class inherits from the \texttt{article}-class and needs the Times-Roman font to run properly. Include \texttt{times} and \texttt{verbatim}-styles. These should be shipped with your \LaTeX-installation, and if not they can be downloaded freely on the internet. You will need to include the styles fancyhdr.sty and changepage.sty also, which can be found inside the example package or under www.ctan.org . Possible document options are: \texttt{english}. For choosing a language, see section~\ref{sprache}.\linebreak \clearpage For the correct naming of the captions use the following commands: \begin{verbatim} \usepackage[figurename=Fig.,tablename=Tab.,small]{caption} [2016/04/22] \renewcommand{\lstlistingname}{List.} \end{verbatim} In English texts use \texttt{figurename} : \texttt{Fig.}. The numbering of your article will be done by the editor. With the help of the command: \begin{verbatim} \setcounter{page}{11} \end{verbatim} you can set the start number of the page counter if you need to change it on your own. If \texttt{lstlisting} is used you have to include listings.sty Please make use of the default macros of the class \texttt{article}. If you have to define macros on your own, you should put them into \texttt{.sty}-files to ease to combination of articles later on. \subsection{Language} \label{sprache} Both German and English are supported by this documents class. German is the default. For completely English written articles you need to set the document option \texttt{english}. To switch language within the text, use \verb|\selectlanguage| from the Babel-Package. This package will be loaded by the \texttt{lni}-class -- there is no need to load it again. \texttt{lni} uses the word separation rules of the new German spelling. The shortcut is \texttt{ngerman} (but not \texttt{german}). If your \LaTeX\ does not support \texttt{ngerman}, you have to change your system (see \texttt{www.dante.de}). To write the complete text in English set the document option: \begin{verbatim} \documentclass[english]{lni} \end{verbatim} Then \LaTeX uses English words for fix text components (e.g. `Literaturverzeichnis' to `References'). Therefore you also have to delete the command: \begin{verbatim} \renewcommand{\refname}{Literaturverzeichnis} \end{verbatim} As said before, do not forget to change the abbreviation of figures to \texttt{Fig.}: \begin{verbatim} \usepackage[figurename=Fig.,tablename=Tab.,small]{caption} [2016/04/22] \end{verbatim} Additional language specific classes can be used manually. This document uses for example: \begin{verbatim} \usepackage{latin1} \end{verbatim} \subsection{Title, Authors, Abstract and Keywords} The title is stored in \verb|\title|. Authors are defined within \verb|\author|. The title itself can be set by \verb|\maketitle|. Information on the authors are given inside footnotes(Faculty, Address, Email) \verb|\footnote| within \verb|\author|. The following lines will set to document information for this document: \begin{verbatim} \author{Firstname1 Lastname1 \footnote{...} \ and ...} \title{The title} \begin{document} \maketitle \setcounter{footnote}{2} \begin{abstract} Abstract Text. \end{abstract} \begin{keywords} Keywords, Text. \end{keywords} \end{verbatim} The command \verb|\renewcommand{\refname}{Literaturverzeichnis}| sets the title of the bibliography to "Literaturverzeichnis". For English documents the command has to be removed to get "References". The command \verb|\setcounter{footnote}{2}| resets the counter of the footnotes for cases the multiple authors with footnotes are used. \subsection{Text structure} A variety of parameters for text structures were redefined within the \texttt{lni}-class. To apply these changes you will need to use the exact same commands. The layout for flowing text is the defaule. Section titles are set with \verb|\section|, subsections with \verb|\subsection|. Footnotes can be set with \verb|\footnote|.\footnote{Layout is defined within the document class} \begin{itemize} \item Enumerations are done help of the \verb|\itemize| environment. \item The formatting is predefined within the \texttt{lni}-class. \begin{itemize} \item Enumerations should have at least 2 levels. \end{itemize} \end{itemize} \begin{enumerate} \item Numbered enumerations are done help of the \verb|\enumerate| environment. \begin{enumerate} \item The formatting is predefined within the \texttt{lni}-class. \end{enumerate} \end{enumerate} \subsection{Figures} Figures are included with default \LaTeX-commands. You have to insert the caption \verb|\caption| right after the figure definition but before the \verb|\centering|-command to ensure correct centering of the figure. (Please avoid using \verb|\begin{center}...|\verb|\end{center}| in the context of figures which can lead to an unwanted output. The positioning of the figure should be done by \texttt{[htb]}. Figure ~\ref{logo} is an example for that. \begin{verbatim} \begin{figure}[htb] \centering \includegraphics[width=2cm]{gilogo} \caption{\label{logo}Icon of GI} \end{figure} \end{verbatim} \begin{figure}[htb] \centering \includegraphics[width=2cm]{gilogo} \caption{\label{logo}Icon of GI} \end{figure} If possible, use the setting \texttt{[h]}, to allow \LaTeX to shift your picture automatically, instead of using \texttt{t-top} for the beginning or \texttt{b-bottom} for the bottom of the page to avoid unwanted spacing above and below the figure. Other figure styles as \texttt{subfigure} have not been tested yet. \subsection{Tables} Tables are done with default \LaTeX-commands. Insert the table caption \verb|\caption| right after the table definition and use \verb|\centering| before the definition. \begin{verbatim} \begin{table}[htb] \centering \begin{tabular}{l l l} \hline Heading Layers & Example & font size and type\\ \hline Title (left justified) & The title... & 14 pt, bold\\ \hline Heading 1 & 1 Introduction & 12 pt, bold\\ \hline Heading 2 & 2.1 Title & 10 pt, bold\\ \hline \end{tabular} \caption{\label{tab1}The types of headings} \end{table} \end{verbatim} Aligning tables is done with \verb|[htb]|. Table~\ref{tab1} shows an example for that. \begin{table}[htb] \centering \begin{tabular}{l l l} \hline Heading & Example & Font size and type \\ \hline Title (left aligned) & The title... & 14 pt, bold\\ Heading 1 & 1 Introduction & 12 pt, bold\\ Heading 2 & 2.1 Title & 10 pt, bold\\ \hline \end{tabular} \caption{\label{tab1}The headings} \end{table} \subsection{Program code} The LNI template demands you to indent the listing. Therefore the \texttt{lni} document class defines the \texttt{verbatim}-environment. \begin{verbatim} public class Hello { public static void main (String[] args) { System.out.println("Hello World!"); } } \end{verbatim} As an alternative you can also use the \texttt{lstlisting}-environment. \begin{verbatim} \lstset{basicstyle=\ttfamily} \begin{lstlisting} [captionpos=b, caption=Description, label=L1, xleftmargin=0.5cm] ... \end{lstlisting} \end{verbatim} Listing~\ref{L1} shows an example, the was created with the \texttt{lstlisting}-environment. \lstset{basicstyle=\ttfamily} \begin{lstlisting} [captionpos=b, caption=Description, label=L1, xleftmargin=0.5cm] public class Hello { public static void main (String[] args) { System.out.println("Hello World!"); } } \end{lstlisting} \subsection{Formulas and Equations} The environments \texttt{equation} and \texttt{eqnarray} ensure correct indent and numbering of formulas. \begin{verbatim} \begin{equation} 1=4-3 \end{equation} \begin{eqnarray} 2=7-5\\ 3=2-1 \end{eqnarray} \end{verbatim} creates... \begin{equation} 1=4-3 \end{equation} and \begin{eqnarray} 2=7-5\\ 3=2-1 \end{eqnarray} \subsection{Bibliography} The \texttt{lni}-class comes with an integrated \texttt{lnig}-bibliography style. There is no need to additionally add \verb|\bibliographystyle{lni}|. You can add the bibliography as follows: \begin{verbatim} \section{Introduction} \label{sec:Intro} \vskip-3mm Implementation of biometric authentication on mobile devices in the recent years has lead to an almost universally ubiquitous presence of biometrics in our daily lives. Starting with the fingerprint sensor of the iPhone 5s in 2013, more than 700 mobile devices have since supported this kind of authentication, with many manufacturers employing other biometric characteristics: iris in Samsung Galaxy S8 or Microsoft Lumia 950, and recently also face in 3D with Apple iPhone X's Face ID. Today, biometric authentication is used for unlocking a phone, but also for protecting financial assets in payment systems, \emph{e.g.,} Apple Pay. With this reliance upon mobile identity, secure and convenient authentication methods are crucial, hence the recently increasing interest in biometric authentication for mobile. Biometric traits such as face and fingerprint have already been given considerable attention in the scientific community, therefore, the main contributions of our paper include:\\ {\bf (1) a multimodal biometric database -- \textit{MobiBits}, comprising representations of five different biometric characteristics, acquired with sensors embedded in commercially available, consumer-grade mobile phones,} \\ {\bf (2) a novel use of thermal imaging enabled smartphone, adding a new dimension to typical, visible spectrum images of face and hand, offering additional cues that can be utilized, \emph{e.g.,} for Presentation Attack Detection,}\\ {\bf (3) experiments employing commercial and academic methods, which provide benchmark results of recognition performance for the introduced datasets.}\\ According to our knowledge, our dataset offers the largest number of biometric characteristics represented in a single database, and employs the richest collection of data acquisition scenarios, which are trying to mimic those of potential real-world applications. \vspace{-3mm} \section{Related work} \label{sec:Related} \vskip-3mm \textbf{Iris. } Iris recognition, usually carried out with specialized devices operating in near infrared (NIR), poses several challenges when implemented on mobile -- most importantly, the need to utilize visible light images. Raja {\it et al.} investigated visible spectrum iris recognition on mobile devices by employing deep sparse filtering \cite{KiranSparse2014} and K-means clustering \cite{KiranKmeans}, being able to achieve equal error rate (EER) of 0.31\%. Trokielewicz {\it et al.} showed that high quality images acquired with an iPhone 5s can be successfully used with existing commercial and academic iris matchers, with FTE of 0\%, and close-to-perfect correct recognition rates, and introduced a dataset of high quality iris images \cite{TrokielewiczVisibleISBA2016}. Cross-spectral iris recognition between mobile phone samples and typical NIR images is studied in \cite{TrokielewiczBartuziJTIT}, with EER$\simeq2\%$. \\ \textbf{Handwritten signatures. } With advantages such as ease of use, familiarity, and social acceptability, signature biometrics has the potential of mobile use. On a smartphone, one can acquire on-line handwritten signatures (X,Y) coordinates in time, as well as pressure (selected phones). On-line signature recognition methods can be divided into two groups: nonparametric and parametric. The most popular method from the first group is Dynamic Time Warping (DTW) \cite{DTWsignatureBlanco2, DTW_Putz2006}, which normalizes signatures and matches the two samples. EERs achieved in experiments with drawing tablets ranged from 0.6 \% to 3.4\% for random forgeries and from 5.4\% to 17.18\% for skilled forgeries. The most common parametric method are Hidden Markov Models \cite{HMMsignatureVan, HMMsignatureTolosana}. These methods determine the probability of sample belonging to the learned model of transitions between observation states. EERs range from 4.6\% to 7.3\% for skilled forgeries, whereas the average for random forgeries EER$\simeq$3\%.\\ \textbf{Face. } In 2012, the bi-modal MOBIO database was published \cite{MOBIO}, including experiments for face and speaker biometrics running on a Nokia N93i smartphone. Fusing both characteristics resulted in EER$\simeq$10\%. Half error rates were achieved using the same database and a range of different methods in the ICB 2013 Face Recognition Evaluation \cite{ICB2013Face}. Mobile face recognition with locally executed implementations has recently gained interest due to the iPhone X, which employs 3D face recognition.\\ \textbf{Voice. } Due to its convenience in some applications and increasing accuracy, text-independent speaker recognition can be a natural choice for mobile authentication systems. The bi-modal MOBIO database \cite{MOBIO}, contains a collection of voice samples captured with a Nokia N93i. This database was also used in the ICB 2013 Speaker Recognition Evaluation \cite{ICB2013Voice}, resulting in encouraging error rates of 5\% EER.\\ \textbf{Hand. } Hand images can supply information on both hand geometry and texture. The authors of \cite{Geometry_mobile} developed a biometric recognition method based on features extracted from hand silhouette and its contour, obtaining EER=3.7\%. According to the works of Zhang {\it et al.} and Sun {\it et al.} \cite{Zhang03onlinepalmprint, Sun_2005_Palmprint}, large areas of the palmar side of the hand provide enough personal information for the identity authentication, even with low-resolution images of less than 100 dpi. Hand could be a useful for biometric authentication thanks to simple acquisition process using the built-in camera on a mobile phone without an additional sensor. The most popular feature extraction methods utilize a bank of Gabor filters \cite{Kim_palmprint_mobile, Franzgrote_palmprint_mobile}, and SIFT descriptors \cite{Choras_palmprint_mobile}, with best EER=0.79\% obtained by Kim {\it et al.} \cite{Kim_palmprint_mobile}. \textbf{Available mobile biometric datasets. } The {\bf MobBIO} database by Sequeira {\it et al.} \cite{MobBio_db} contains data acquired from 105 volunteers with an Asus Transformer Pad TF 300 tablet. It includes 16 voice samples, 8 eye images and 16 face images captured in different lighting conditions. The {\bf BioSecure} database by Ortega-Garcia {\it et al.} has been collected at several universities participating in the BioSecure project \cite{BioSecure_db}. It contains data collected in two acquisition sessions from 713 volunteers, each of them providing 4 frontal face images, 12 fingerprint samples, 18 voice recordings, and 25 handwritten signatures (genuine and skilled forgeries). The {\bf MBMA} database \cite{MMB_Arnowitx_db} contains three characteristics (voice, face, signature) collected in two sessions with four 4 different mobile devices. The first session was used for system development, with samples acquired from 100 volunteers. Each volunteer provided 5 face images, 3 voice records and 6 handwritten signatures. Data from the second session was acquired from 32 people and it contains 4 samples of voice recordings, 3 face images and 8 signatures. The {\bf Face-Teeth-Voice} collection introduced in \cite{KimFaceTeethVoice2010} gathers 1000 biometric samples: face images, teeth images, and voice recordings in an experiment involving 50 people, hence 20 samples per person, all obtained in a single session. Finally, the {\bf I-Am} database from \cite{AbateArmandEarMobile2017} comprises a combination of physical and behavioral biometrics in the form of ear shape images and accelerometer/gyroscope data, obtained from 100 volunteers in 1 to 3 acquisition sessions. The database collects 300 ear shape samples, and 600 accelerometer/gyroscope data samples. These datasets, including the {\bf MOBIO} dataset described in the previous paragraphs, are summarized in Table \ref{Tab: database_comp}. \begin{table}[t!] \renewcommand{\arraystretch}{1.0} \centering \footnotesize \resizebox{\linewidth}{!}{ \begin{tabular}{>{\raggedright\arraybackslash}m{0.11\linewidth}>{\raggedright\arraybackslash}m{0.12\linewidth}>{\raggedright\arraybackslash}m{0.1\linewidth}>{\raggedright\arraybackslash}m{0.12\linewidth}>{\raggedright\arraybackslash}m{0.16\linewidth}>{\raggedright\arraybackslash}m{0.09\linewidth}>{\raggedright\arraybackslash}m{0.10\linewidth}>{\raggedright\arraybackslash}m{0.08\linewidth}} \hline \textit {} & \cellcolor{blue!30} \textbf{\emph{MobiBits}} & \textit{MobBIO} & \textit{MBMA} & \textit{BioSecure} & \textit{FTV} & \textit{I-Am} & \textit{MOBIO}\\ \hline\hline {\bf Volunteers} & \cellcolor{blue!30} 53 & 105 & 100 & 713 & 50 & 100 & 150\\\hline {\bf Acquisition} \linebreak {\bf sessions} & \cellcolor{blue!30} 3 & 1 & 2 & 2 & 1 & 1--3 & 12\\\hline {\bf Devices used} & \cellcolor{blue!30} Huawei Mate S \linebreak Huawei P9 Lite \linebreak CAT S60& Asus \linebreak Transformer \linebreak Pad TF 300 & iPhone 4s \linebreak Galaxy S2 \linebreak iPad 2 \linebreak Motorola Xoom & Samsung Q1 \linebreak Philips SPC900NC Webcam \linebreak HP iPAQ hx2790 PDA & HP iPAQ rw6100 & Samsung \linebreak Galaxy S4 & Nokia N93i \linebreak MacBook\\\hline {\bf Biometric} \linebreak {\bf characteristics} \linebreak {\bf included} & \cellcolor{blue!30} {\bf signatures} \linebreak {\bf voice} \linebreak {\bf face} \linebreak {\bf iris} \linebreak {\bf hand} & {\bf voice} \linebreak {\bf face} \linebreak {\bf iris} & {\bf voice} \linebreak {\bf signatures} \linebreak {\bf face} & {\bf voice} \linebreak {\bf signatures} \linebreak {\bf face} \linebreak {\bf fingerprints} & \textbf{face} \linebreak \textbf{teeth} \linebreak \textbf{voice} & \textbf{arm gestures} \linebreak \textbf{ear shape} & \textbf{face} \linebreak \textbf{voice} \\ \hline \end{tabular}} \caption{Comparison between existing mobile multimodal biometric databases the \textit{MobiBits} database. } \label {Tab: database_comp} \end{table} \vspace{-3mm} \section{Database characteristics} \label{sec:Database} \vskip-3mm The \emph{MobiBits} multimodal mobile biometric database includes data collected from 53 volunteers (20 female and 33 male), using three different smartphones. The age of subjects ranged from 14 to 71 years. The data were collected in 3 sessions organized during 3 following months. Data collection took place twice in each acquisition session, separated by approximately 15 minutes. All samples were acquired in typical office conditions with air conditioning set to $24^o$C. Other factors that might have influenced the results, such as gender, age, health condition, environmental conditions before the measurement, time from last meal, were recorded in the metadata. For further information on how to get access to the data please contact the authors at: \url{<EMAIL>} Three smartphones equipped with custom data acquisition software and different technical specifications and capabilities were used for data collection: Huawei Mate S, Huawei P9 Lite, and CAT s60, with the following accessories: an Adonit Dash 2 stylus for signatures to get a more precise contact with the display, hot pillows, and cooling gel compresses were used to simulate different environmental conditions \begin{figure} \centering \includegraphics[width=\linewidth]{characteristics_eg} \caption{Selected samples from the MobiBits database. {\bf Left:} genuine signatures and skilled forgeries, iris images, and hand images (thermal and visible light). {\bf Right:} visible light and thermal face images.}. \label{examples} \vspace*{-0.3cm} \end{figure} \textbf{ON-LINE HANDWRITTEN SIGNATURES. } The on-line handwritten signatures were recorded in real time and the order of the signature components is recorded by Huawei Mate S (with pressure-sensitive screen). Their representations contain $(x,y)$ plane coordinates and pressure values for several points on the display surface, all as a function of time. The database contains $40$ genuine signatures and $20$ skilled forgeries per person. \textbf{VOICE RECORDINGS. } The voice samples were captured using a Huawei P9 Lite smartphone in a regular office environment, with no artificial noise added. All speakers were speaking Polish language. Samples were recorded during three sessions of unconstrained speech and reading (sample rate: 44.1$kHz$, duration: 0:01 - 1:10 min). \textbf{FACE IMAGES. } Face images were collected in three different acquisition sessions using a CAT s60 mobile phone. This smartphone allowed collection of two types of images: photos in visible light with a resolution of $480 \times 640$ pixels and thermal images of $240 \times 320$ pixels. Each session includes at least two photos for each of s six poses: frontal images, left and right semi-profile images, left and right profile images and a 'selfie' image. \textbf{IRIS AND PERIOCULAR. } Rear camera (13 Mpx) of the Huawei Mate S device has been used to capture images of irises (Session 1) and face focused on the eyes region (Session 2 and 3). Data collection was carried out in a typical office setting with artificial light sources. Flash was enabled during the first and the third session, and disabled during the second session to simulate different, real-world conditions of authentication. \textbf{HAND IMAGES. } For hand data, images of palmar and dorsal side of both left and right hand were collected. CAT s60 phone with built-in thermal camera was used for the image acquisition. According to the current state of the art, thermal images have never been used in mobile biometrics. Due to this fact, hand images were collected according to scenario which allows the temperature dynamics analyses to stimulate rich research ideas regarding this fascinating, yet largely unstudied biometric characteristic. We collected hand images: supported by glass stand and without, after cooling, after warning and with no temperature influence. One session - {\it Extra Session}, used 13 Mpx camera, for more accurate images of the hand texture. \vspace{-3mm} \section{Database evaluation: tools, protocol, and performance metrics} \label{sec:Evaluation} \vskip-3mm For the evaluation of the \textit{MobiBits} database we performed benchmark calculations of the recognition accuracy for all characteristics, using a proprietary PLDA/i-vector solution for voice recordings, DTW method for signatures, VeriLook for face images, IriCore for the iris images and VGG-based CNN approach for hand images. {\bf Dynamic Time Warping} (DTW) algorithm calculates an optimal warping path between two given time series is calculated, and then used for comparison \cite{DTW_Putz2006}. {\bf VeriLook} is a face recognition technology offered by Neurotechnology \cite{VeriLook}, which uses a set of robust image processing algorithms, including deep neural networks. It allows face recognition with non-frontal images, however, the default allowed rotation angles are modest. {\bf IriCore} is an iris recognition SDK developed by IriTech \cite{IriCore}, with the exact algorithm not disclosed. As this method is fine-tuned to work with iris images compliant with the ISO/IEC 19794:2011 standard \cite{ISO}, pre-processing of photos was performed with $640\times 480$ cropping and grayscale conversion of the red channel, which is said improve the visibility of the iris texture in heavily pigmented irises \cite{TrokielewiczVisibleISBA2016, TrokielewiczBartuziJTIT}. {\bf PLDA/i-vector voice recognition} is our proprietary solution based on state-of-the-art PLDA method \cite{PLDAPrince, Ivectors} with 40 mean and variance normalized MFCC features extracted from every signal frame, a 256-component, gender-independent background model, 64-dimensional total variability subspace, and 64-dimensional PLDA model. The results were normalized using cohort symmetric score normalization \cite{DehakCohorts}. Prior to feature extraction, additional spectral subtraction voice activity detection was performed to remove non-speech periods \cite{Mak2010RobustVA}. The system was trained exclusively on the MOBIO dataset. {\bf VGG-16-Hand} is a method based on the well-known convolutional network VGG-16 model \cite{VGGSimonyanCNNsForRecognition2014}, with weights fine-tuned on a dataset of hand images from the \textit{Extra Session} with flash enabled (cf. Section \ref{sec:Database}), and its bottleneck layers modified to reflect the number of output classes. IriCore and VeriLook engines performed quality checks prior to feature extraction and biometric template creation. Since some samples were not accepted, {\it failure-to-enroll rates (FTEs)} were calculated to express the ratio of rejected samples to all samples. Each biometric characteristic and each fusion model was tested in a verification scenario. Averaged Receiver Operating Characteristics (ROCs) and mean Equal Error Rates (EERs) were used to present the verification accuracy. These performance metrics were calculated for comparison scores obtained by performing all possible comparisons within the data, excluding the within-session ones, as these would involve comparing highly correlated data. Please note that thermal images of hands and those of faces are not used for comparisons here, as we are not aware of any recognition methods that would be capable of efficient processing of such samples. Instead, our intent was to provide them as datasets that are complementary to these of visible light images, so that they can be utilized for other research, such as designing robust methods for Presentation Attack Detection (PAD). \begin{table}[!] \renewcommand{\arraystretch}{1.25} \centering \footnotesize \resizebox{\linewidth}{!}{ \begin{tabular}{>{\raggedright\arraybackslash}m{0.09\linewidth}|>{\centering\arraybackslash}m{0.04\linewidth}>{\centering\arraybackslash}m{0.04\linewidth}>{\centering\arraybackslash}m{0.05\linewidth}|>{\centering\arraybackslash}m{0.04\linewidth}>{\centering\arraybackslash}m{0.04\linewidth}>{\centering\arraybackslash}m{0.05\linewidth}|>{\centering\arraybackslash}m{0.04\linewidth}>{\centering\arraybackslash}m{0.04\linewidth}>{\centering\arraybackslash}m{0.05\linewidth}|>{\centering\arraybackslash}m{0.04\linewidth}>{\centering\arraybackslash}m{0.04\linewidth}>{\centering\arraybackslash}m{0.05\linewidth}|>{\centering\arraybackslash}m{0.04\linewidth}>{\centering\arraybackslash}m{0.04\linewidth}>{\centering\arraybackslash}m{0.05\linewidth}} & \multicolumn{3}{c|}{{\bf VOICE}} & \multicolumn{3}{c|}{{\bf SIGNATURE}} & \multicolumn{3}{c|}{{\bf FACE}} & \multicolumn{3}{c|}{{\bf IRIS}} & \multicolumn{3}{c}{{\bf HAND}}\\ & classes & samples & FTE & classes & samples & FTE & classes & samples & FTE & classes & samples & FTE & classes & samples & FTE\\\hline \hline {\bf Session 1 }& 51 & 406 & 0.00\% & 51 & 1020 & 0.00\% & 51 & 778 & 45.89\% & 49 & 497 & 14.69\% & 49 & 2255 & 0.00\%\\ {\bf Session 2 }& 46 & 190 & 0.00\% & 42 & 420 & 0.00\% & 47 & 1005 & 42.00\% & 46 & 525 & 10.48\% & 49 & 1508 & 0.00\%\\ {\bf Session 3 }& 48 & 624 & 0.00\% & 50 & 500 & 0.00\% & 47 & 1105 & 40.90\% & 47 & 2082 & 12.92\% & 49 & 1740 &0.00\%\\ \hline \end{tabular}} \caption{A summary of the number of subjects, images and FTE rate for each characteristic.} \label{fte} \end{table} \vspace{-3mm} \section{Results and discussion} \label{sec:Results} \vskip-3mm FTEs calculated for all tested characteristics are presented in Table \ref{fte}. High FTE values for the face engine may be explained with difficulties in detecting and processing profile images by the VeriLook software, as the profile and semi-profile images constituted around 60\% of the total image count. Iris enrollment errors can be a result of using mixed quality grayscale images converted from RGB images, instead of high quality NIR images recommended for the IriCore software. Other problems may be related to: iris image noise, reflections on the eye, lashes, squinted eyes. The voice recognition engine, the CNN for hand images and the DTW method did not perform any quality checks, hence zero FTEs. The ROC curves together with respective EER values are shown in \texttt{Figure} \ref{roc_curves}. The best single characteristic results can be achieved with face recognition, which allows verification accuracy with EER=$2.32\%$. The worst result was obtained for signatures - skilled forgeries, EER=$18.44\%$. High equal error rate for the irises is related to differences in the quality of the pictures, as high quality pictures obtained with flash enabled are compared against low-quality, no-flash pictures. \begin{figure}[h!] \centering \includegraphics[width=1\linewidth]{ROCs} \caption{ROC curves plotted for each individual biometric characteristic. EER values are also shown.} \label{roc_curves} \end{figure} \vspace{-3mm} \section{Conclusions} \label{sec:Conclusions} \vskip-2mm The most important deliverable of this paper is the multimodal mobile biometric database -- MobiBits, comprising samples of five different biometric characteristics, collected using three different mobile devices, including a novel type of samples: thermal images of hands and faces, acquired using a thermal sensor equipped mobile phone, which we think can be a valuable contribution for studies involving presentation attack detection methods. A comprehensive set of experiments conducted on the data is reported to show the example benchmark accuracy that can be achieved on the dataset using selected commercial and academic recognition solutions. The {MobiBits} database is offered publicly at no cost for non-commercial research purposes. We hope that this will constitute a worthy addition to the mobile biometric datasets available for the biometrics community, and will provide an incentive for further research in the field of mobile biometrics. \vspace{-5mm} \section*{Acknowledgement} \vskip-4mm The authors are greatful to NASK for the support by grant agreement no. 3/2017. The authors would like to cordially thank Dominika Szwed for her help with building the database used in this study. \vskip-4cm {\scriptsize \bibliographystyle{lnig}
\section{Introduction} The problem of non-vanishing and sign changes of the Fourier coefficients of modular forms over a number field is an active area of research in number theory. For modular forms over $\mathbb{Q}$, there had been extensive study of these problems by several mathematicians (cf. ~\cite{Mur83},~\cite{KM14},~\cite{GKR15}). For modular forms over totally real number fields, a similar study has been initiated recently in~\cite{MT14},~\cite{KK}. In~\S\ref{Sec0}, we shall recall the definition of Hilbert modular forms, their Fourier coefficients, and we will introduce some notations. In~\S\ref{Sec1}, we shall study the simultaneous non-vanishing of Fourier coefficients of distinct primitive forms at powers of prime ideals (cf. Theorem~\ref{maintheorem3} in the text). In~\cite{GKP}, the authors proved that if $f$ and $g$ are two Hecke eigenforms of integral weights with $a_f(n), a_g(n) \in \mathbb{R}$, respectively, then for all but finitely many primes $p$, the set $\{m\in \mathbb{N} \mid a_f(p^m)a_g(p^m)\neq 0 \}$ has positive density. In~\cite[Theorem 3.1]{KK}, the authors extended this result to Hilbert primitive forms over $K$, by showing that the set in~\eqref{non-vanishingset} has positive density. In this article, we improve this result by showing that this density is at least $\frac{1}{2}$, when $[K:\mathbb{Q}]$ is odd. In fact, we will show that the density can either be only $\frac{1}{2}$ or $1$. The proof of this theorem is completely different from that of Theorem in~\textit{loc. cit.}. Our proof depends on a generalization of the lemma~\cite[Lemma 2.2]{KRW07} or~\cite[Lemma 2.5]{MM07} to Hilbert modular forms (cf. Proposition~\ref{1:2} in the text). In~\S\ref{Sec2}, we shall study the sign change results for Fourier coefficients of primitive forms over $K$ at powers of prime ideals, where $[K:\mathbb{Q}]$ is odd. In Proposition~\ref{Sign_Changes_Prime_Fixed}, for almost all prime ideals $\mathfrak{p}$, we show that the Fourier coefficients at $\mathfrak{p}^r(r \in \mathbb{N})$ change signs infinitely often. In Theorem~\ref{Sign_Changes_exponent_Fixed}, we show that a similar result hold by fixing an exponent and varying over prime ideals. Let $a_f(n),a_g(n)\in \mathbb{R}$ be the Fourier coefficients of two non-zero cusp forms $f, g$, respectively, of same level but different weights. In~\cite[Theorem 1]{GKR15}, the authors showed that if $a_f(1)a_g(1) \neq 0$, then $a_f(n)a_g(n)(n \in \mathbb{N})$ change signs infinitely many often. In~\cite[Theorem 3.1]{KK}, the authors extend this result to Hilbert modular forms. In this article, we have improved the conditions of theorem in~\textit{loc. cit.}, so that it can be applied to a broader class of modular forms. \section{Preliminaries} \label{Sec0} Let $F$ be a totally real number field and let $\mathcal{O}_F$ denote the integral closure of $\mathbb{Z}$ inside $F$. In this section, we shall recall the basic definition of Hilbert modular forms over $F$ and it's Fourier coefficients for all integral ideals $\mathfrak{m} \subseteq \mathcal{O}_F$ (for more details, see~\cite{Gar90},~\cite{Fre90}). Let $k=(k_1,\dots, k_n)\in \mathbb{N}^n$. For a non-archimedean place $\mathfrak{p}$ of $F$, let $F_\mathfrak{p}$ denote the completion of $F$ at $\mathfrak{p}$. Let $\mathfrak{D}_F$ denote the absolute different of $F$. Let $\mathfrak{a}$ and $\mathfrak{b}$ be integral ideals of $F$, and define a subgroup $K_\mathfrak{p}(\mathfrak{a}, \mathfrak{b})$ of $\mathrm{GL}_2(F_\mathfrak{p})$ as \[ K_\mathfrak{p}(\mathfrak{a}, \mathfrak{b})=\left\{\left(\begin{matrix} a & b \\ c & d \end{matrix}\right)\in \mathrm{GL}_2(F_\mathfrak{p})\, : \, \begin{matrix} a\in \mathcal{O}_\mathfrak{p}, & b\in \mathfrak{a}_\mathfrak{p}^{-1}\mathfrak{D}_\mathfrak{p}^{-1}, & \\ c\in \mathfrak{b}_\mathfrak{p}\mathfrak{D}_\mathfrak{p}, & d\in\mathcal{O}_\mathfrak{p}, & |ad-bc|_\mathfrak{p}=1\end{matrix}\right\},\] where the subscript $\mathfrak{p}$ means the $\mathfrak{p}$-parts of given ideals. Furthermore, we put \[ K_0(\mathfrak{a}, \mathfrak{b})=\mathrm{SO}(2)^n\cdot\prod_{\mathfrak{p}<\infty}K_\mathfrak{p}(\mathfrak{a}, \mathfrak{b}) \quad \text{and} \quad W(\mathfrak{a}, \mathfrak{b})=\mathrm{GL}_2^+(\mathbb{R})^nK_0(\mathfrak{a}, \mathfrak{b}).\] In particular, if $\mathfrak{a}=\mathcal{O}_F$, then we simply write $K_\mathfrak{p}(\mathfrak{b}):=K_\mathfrak{p}(\mathcal{O}_F, \mathfrak{b})$, $W(\mathfrak{b}):=W(\mathcal{O}_F, \mathfrak{b})$, etc. Then, we have the following disjoint decomposition of $\mathrm{GL}_2(\mathbb{A}_F)$: \begin{equation}\label{eqn:decomp} \mathrm{GL}_2(\mathbb{A}_F)=\cup_{\nu=1}^h\mathrm{GL}_2(F)x_\nu^{-\iota} W(\mathfrak{b}), \end{equation} where $\displaystyle x_\nu^{-\iota} =\left(\begin{matrix} t_\nu^{-1} & \\ & 1\end{matrix}\right)$ with $\{t_\nu\}_{\nu=1}^h$ taken to be a complete set of representatives of the narrow class group of $F$. We note that such $t_\nu$ can be chosen so that the infinity part $t_{\nu, \infty}$ is $1$ for all $\nu$. For each $\nu$, we also put \begin{align*} \Gamma_\nu(\mathfrak{b}) &= \mathrm{GL}_2(F)\cap x_\nu W(\mathfrak{b})x_\nu^{-1} \\ &= \left\{ \pmat{a}{t_\mu^{-1}b}{t_\nu c}{d}\in\mathrm{GL}_2(F): \, \begin{matrix} a\in \mathcal{O}_\mathfrak{p}, & b\in \mathfrak{a}_\mathfrak{p}^{-1}\mathfrak{D}_\mathfrak{p}^{-1}, & \\ c\in \mathfrak{b}_\mathfrak{p}\mathfrak{D}_\mathfrak{p}, & d\in\mathcal{O}_\mathfrak{p}, & |ad-bc|_\mathfrak{p}=1\end{matrix}\right\}. \end{align*} Let $\psi$ be a Hecke character of $\mathbb{A}_F^\times$ whose conductor divides $\mathfrak{b}$ and $\psi_\infty$ is of the form \[ \psi_\infty(x)={\rm sgn}(x_\infty)^k|x_\infty|^{i\mu},\] with $\mu\in\mathbb{R}^n$ and $\sum_{j=1}^n \mu_j=0$. We let $M_k(\Gamma_\nu(\mathfrak{b}), \psi_\mathfrak{b}, \mu)$ denote the space of all functions $f_\nu$ that are holomorphic on $\mathfrak{h}^n$ and at cusps, satisfying \[ f_\nu ||_k \gamma=\psi_\mathfrak{b}(\gamma)\det \gamma^{i\mu/2}f_\nu \] for all $\gamma$ in $\Gamma_\nu(\mathfrak{b})$. We note that such a function $f_\nu$ has a Fourier expansion \[ f_\nu(z)=\sum_{\xi\in F}a_\nu(\xi) \exp(2\pi i \xi z)\] where $\xi$ runs over all the totally positive elements in $t_\nu^{-1}\mathcal{O}_F$ and $\xi=0$. A Hilbert modular form is a cusp form, if for all $\gamma \in \mathrm{GL}^+_2(F)$, the constant term of $f||_k\gamma$ in its Fourier expansion is $0$, and the space of cusp forms with respect to $\Gamma_{\nu}(\mathfrak{b})$ is denoted by $M_k(\Gamma_\nu(\mathfrak{b}), \psi_\mathfrak{b}, \mu)$. Now, put $\mathbf{f}:=(f_1,\dots,f_h)$ where $f_\nu$ belongs $M_k(\Gamma_\nu(\mathfrak{b}), \psi_\mathfrak{b}, \mu)$ for each $\nu$, and define $\mathbf{f}$ to be a function on $\mathrm{GL}_2(\mathbb{A}_F)$ as \[ \mathbf{f}(g)=\mathbf{f}(\gamma x_\nu^{-\iota}w):=\psi_\mathfrak{b}(w^\iota)\det w_\infty^{i\mu/2}(f_\nu||_k w_\infty)(i\!\! i)\] where $\gamma x_\nu^{-\iota}w\in\mathrm{GL}_2(F)x_\nu^{-\iota}W(\mathfrak{b})$ as in (\ref{eqn:decomp}), and $w^\iota:=\omega_0(^t w)\omega_0^{-1}$ with $\displaystyle \omega_0=\left(\begin{matrix} & 1 \\ -1 & \end{matrix}\right)$. The space of such $\mathbf{f}$ is denoted as $M_k(\psi_\mathfrak{b}, \mu)=\prod_\nu M_k(\Gamma_\nu(\mathfrak{b}), \psi_\mathfrak{b}, \mu)$. Furthermore, the space consisting of all $\mathbf{f}=(f_1,\dots,f_h)\in M_k(\psi_\mathfrak{b}, \mu)$ satisfying \[ \mathbf{f}(sg)=\psi(s)\mathbf{f}(g) \quad \text{for any}\, s\in \mathbb{A}_F^\times \quad \text{and}\quad x\in\mathrm{GL}_2(\mathbb{A}_F)\] is denoted as $M_k(\mathfrak{b},\psi)$. If $f_\nu \in S_k(\Gamma_\nu(\mathfrak{b}), \psi_\mathfrak{b}, \mu)$ for each $\nu$, then the space of such $\mathbf{f}$ is denoted by $S_k(\mathfrak{b},\psi)$. Let $\mathfrak{m}$ be an integral ideal of $F$ and write $\mathfrak{m}=\xi t_\nu^{-1}\mathcal{O}_F$ with a totally positive element $\xi$ in $F$. Then, we define the Fourier coefficients of $\mathbf{f}$ as \begin{equation}\label{eqn:coeff} C(\mathfrak{m},\mathbf{f}) :=\begin{cases} N(\mathfrak{m})^{\frac{k_0}{2}}a_\nu(\xi)\xi^{-(k+i\mu)/2} \quad & \text{if}\quad \mathfrak{m}=\xi t_\nu^{-1}\mathcal{O}_F\subset \mathcal{O}_F \\ 0 & \text{if} \quad \mathfrak{m} \, \text{is not integral} \end{cases} \end{equation} where $k_0=\max \{k_1,\dots,k_n\}$. Throughout this article, by a primitive form $\mathbf{f}$ over $F$ of level $\mathfrak{b}$, with character $\chi$ and weight $k$, we mean $\mathbf{f}$ is a normalized Hilbert Hecke eigenform in $S_k^{\mrm{new}}(\mathfrak{b},\chi)$ (cf. for the theory of new forms, please refer to~\cite{Shi78}). We let $F$ (resp., $K$) to denote a totally real number field (resp., of odd degree). Let $\mathbf{P}$ (resp., $\mathbb{P}$) denote the set of all prime ideals of $\mathcal{O}_F$ (resp., odd inertia degree). We shall use the same notations $\mathbf{P}$ (resp., $\mathbb{P}$) for prime ideals (resp., odd inertia degree) of $\mathcal{O}_K$ as well and it shall be clear from the context. Observe that, by ramification theory, for any prime $p \in \mathbb{Z}$, there exists a prime ideal $\mathfrak{p} \subseteq \mathcal{O}_K$ over $p$ with odd inertia degree. Furthermore, if $K$ is Galois, then every prime ideal of $\mathcal{O}_K$ has odd inertia degree. \subsection{Sato-Tate equi-distribution theorem} In this section, we shall state the Sato-Tate equi-distribution theorem for non-CM primitive forms $\mathbf{f}$ (cf.~\cite[Theorem 3.3]{KKT18} which is a re-formulation of~\cite[Corollary 7.17]{BGG11} for $\mathbf{f}$) in a way that shall be useful in our context. Let $\mathbf{f}$ be a primitive form over $F$ of level $\mathfrak{c}$, with trivial character and weight $2k$. For any ideal $\mathfrak{a} \subseteq \mathcal{O}_F$, define $\beta(\mathfrak{a},\mathbf{f}) := \frac{C(\mathfrak{a},\mathbf{f})}{{N(\mathfrak{a})}^\frac{2k_0-1}{2}}$. By Deligne's bound for $\mathbf{f}$, for any prime ideal $\mathfrak{p} \nmid \mathfrak{c} \mathfrak{D}_F$, we have $\beta(\mathfrak{p},\mathbf{f}) \in [-2,2]$. Hence, we can write \begin{equation} \label{theta} \beta(\mathfrak{p},\mathbf{f}) = 2 \cos \theta_\mathfrak{p}(\mathbf{f}), \end{equation} for some $\theta_\mathfrak{p}(\mathbf{f}) \in [0, \pi]$. Now, we shall recall the Sato-Tate equi-distribution theorem of Barnet-Lamb, Gee, and Geraghty (\cite[Corollary 7.17]{BGG11}). \begin{thm} \label{5.5} Let $\mathbf{f}$ be a non-CM primitive form over $F$ of level $\mathfrak{c}$, with trivial character and weight $2k$. Then $\{\theta_\mathfrak{p}(\mathbf{f})\}_{\mathfrak{p} \in \mathbf{P}, \mathfrak{p} \nmid \mathfrak{c}\mathfrak{D}_F}$ is equi-distributed in $[0,\pi]$ with respect to $\mu_{\mathrm{ST}}=\frac{2}{\pi}{\sin}^2\theta d\theta$. In other words, for any sub-interval $I \subseteq [0,\pi]$, we have \begin{equation} \lim_{x\to \infty} \frac{\# \{ \mathfrak{p}\in \mathbf{P} \mid \mathfrak{p}\nmid\mathfrak{c}\mathfrak{D}_F, \mathrm{N}(\mathfrak{p})\leq x, \theta_\mathfrak{p}(\mathbf{f})\in I \}}{\# \{ \mathfrak{p}\in \mathbf{P} \mid \mathrm{N}(\mathfrak{p}) \leq x \}} = \mu_{\mathrm{ST}}(I) = \frac{2}{\pi}\int_I {\sin}^2 \theta d\theta \end{equation} i.e., the natural density of $S=\{\mathfrak{p} \in \mathbf{P} \mid \mathfrak{p}\nmid\mathfrak{c}\mathfrak{D}_F, \theta_\mathfrak{p}(\mathbf{f})\in I \}$ is $\mu_{\mathrm{ST}}(I)$. \end{thm} \section{Non-vanishing of Fourier coefficients at prime powers} \label{Sec1} In this section, we shall prove a result concerning the simultaneous non-vanishing of Fourier coefficients of primitive forms at prime powers. Before proving this result, we prove an important proposition, which a generalization of~\cite[Lemma 2.2]{KRW07} or ~\cite[Lemma 2.5]{MM07} to $K$. \begin{prop}\label{1:2} Let $\mathbf{f}$ be a primitive form over $K$ of level $\mathfrak{c}$, with character $\chi$ and weight $2k$ Then there exists an integer $M_\mathbf{f} \geq 1$ with $N(\mathfrak{c})\mid M_\mathbf{f}$ such that for any prime $p \nmid M_\mathbf{f}$ and for any prime ideal $\mathfrak{p} \in \mathbb{P}$ over $p$, we have either $C(\mathfrak{p},\mathbf{f}) = 0$ or $C(\mathfrak{p}^r,\mathbf{f}) \neq 0$ for all $r \geq 1$. \end{prop} \begin{proof} Let $p$ be a prime number such that $p \nmid N(\mathfrak{c})$. Let $\mathfrak{p} \in \mathbb{P}$ be a prime ideal of $\mathcal{O}_K$ over $p$ and $\mathfrak{p} \nmid \mathfrak{c}$. If $C(\mathfrak{p},\mathbf{f})=0$, then there is nothing prove. If $C(\mathfrak{p}, \mathbf{f}) \neq 0$, then we need to show that $C(\mathfrak{p}^r,\mathbf{f}) \neq 0$ for all $r\geq 2$, except for finitely many prime ideals $\mathfrak{p} \in \mathbb{P}$. Suppose that $C(\mathfrak{p}, \mathbf{f}) \neq 0$ but $C(\mathfrak{p}^r,\mathbf{f}) = 0$ for some $r\geq 2$. Since $\mathbf{f}$ is a primitive form, then by Hecke relations, we have \begin{equation*} C(\mathfrak{p}^{m+1}, \mathbf{f}) = C(\mathfrak{p},\mathbf{f})C(\mathfrak{p}^m,\mathbf{f}) - \chi(\mathfrak{p})N(\mathfrak{p})^{2k_0-1} C(\mathfrak{p}^{m-1},\mathbf{f}). \end{equation*} These relations can be re-interpreted as \begin{equation} \sum_{r=0}^\infty C(\mathfrak{p}^r,\mathbf{f})X^r = \frac{1}{1-C(\mathfrak{p},\mathbf{f})X+\chi(\mathfrak{p}) N(\mathfrak{p})^{2k_0-1}X^2}. \end{equation} Suppose that \begin{equation*} 1-C(\mathfrak{p},\mathbf{f})X+\chi(\mathfrak{p}) N(\mathfrak{p})^{2k_0-1}X^2 = (1- \alpha(\mathfrak{p})X)(1-\beta(\mathfrak{p})X). \end{equation*} By comparing the coefficients, we get that \begin{equation*} \alpha(\mathfrak{p}) + \beta(\mathfrak{p}) = C(\mathfrak{p}, \mathbf{f}) \ \ \ \ \ \ \mathrm{and} \ \ \ \ \ \ \alpha(\mathfrak{p})\beta(\mathfrak{p}) = \chi(\mathfrak{p})N(\mathfrak{p})^{2k_0-1} \neq 0, \end{equation*} since $\mathfrak{p} \nmid \mathfrak{c}$ and hence $\chi(\mathfrak{p}) \neq 0$. If $\alpha(\mathfrak{p}) = \beta(\mathfrak{p})$, then \begin{equation*} C(\mathfrak{p}^r,\mathbf{f}) = (r+1)\alpha(\mathfrak{p})^r\neq 0, \end{equation*} which cannot happen for any $r \geq 2$. So, $\alpha(\mathfrak{p})$ cannot be equal to $\beta(\mathfrak{p})$. Then by induction, for any $r \geq 2$, we have the following \begin{equation*} C(\mathfrak{p}^r,\mathbf{f}) = \frac{\alpha(\mathfrak{p})^{r+1} - \beta(\mathfrak{p})^{r+1}}{\alpha(\mathfrak{p})- \beta(\mathfrak{p})}. \end{equation*} In this case, we have \begin{equation*} C(\mathfrak{p}^r,\mathbf{f}) = 0 \ \ \mathrm{if\ and\ only\ if} \ \ \Bigg(\frac{\alpha(\mathfrak{p})}{\beta(\mathfrak{p})}\Bigg)^{r+1} = 1, \end{equation*} which implies that the ratio $\frac{\alpha(\mathfrak{p})}{\beta(\mathfrak{p})}$ is a root of unity. Since $C(\mathfrak{p},\mathbf{f}) \neq 0$, we get that $\alpha(\mathfrak{p}) = \zeta \beta(\mathfrak{p})$ where $\zeta$ is a root of unity and $\zeta \ne -1$ . By the product relation, we get that $\alpha(\mathfrak{p})^2= \zeta\chi(\mathfrak{p}){{N(\mathfrak{p})}^{2k_0-1}}$, hence $\alpha(\mathfrak{p}) = \pm \gamma {N(\mathfrak{p})}^{{(2k_0-1)}/2} $, where $\gamma^2 = \zeta \chi(\mathfrak{p})$. Therefore, \begin{equation*} C(\mathfrak{p},\mathbf{f}) = (1+\zeta^{-1})\alpha(\mathfrak{p}) = \pm \gamma (1+\zeta^{-1}){N(\mathfrak{p})^{(2k_0-1)/2}} \ne 0. \end{equation*} In particular, $\mathbb{Q}(\gamma (1+\zeta^{-1})N(\mathfrak{p})^\frac{2k_0-1}{2}) \subseteq \mathbb{Q}(\mathbf{f})$, where $\mathbb{Q}(\mathbf{f})$ is the field generated by $\{C(\mathfrak{m},\mathbf{f})\}_{\mathfrak{m} \subseteq \mathcal{O}_K}$ and by the values of the character $\chi$. Since $\mathfrak{p} \in \mathbb{P}$, $N(\mathfrak{p})= p^{f}$, where $f \in \mathbb{N}$ odd. Hence, we have \begin{equation}\label{5.1} \mathbb{Q}(\gamma(1+\zeta^{-1})p^{\frac{f(2k_0-1)}{2}}) \subseteq \mathbb{Q}(\mathbf{f}). \end{equation} Since $2k_0-1$, $f$ are odd, we have that \begin{equation}\label{5.2} \mathbb{Q}(\gamma(1+\zeta^{-1})\sqrt{p}) \subseteq \mathbb{Q}(\mathbf{f}). \end{equation} By~\cite[Proposition 2.8]{Shi78}, the field $\mathbb{Q}(\mathbf{f})$ is a number field. Hence, the number of such primes $p$ are finite. Take $M_\mathbf{f}$ to be the product of all such primes $p$ and $N(\mathfrak{c})$. Thus, for any prime $p\nmid M_\mathbf{f}$ and for any prime ideal $\mathfrak{p} \in \mathbb{P}$ over $p$, we have either $C(\mathfrak{p},\mathbf{f}) = 0$ or $C(\mathfrak{p}^r,\mathbf{f})\neq 0$ for all $r\geq 1$. \end{proof} Observe that, the above proposition holds only for primes of $\mathbb{P}$. This is because for primes of $\mathbf{P} \setminus \mathbb{P}$, in the above proof, ~\eqref{5.1} does not imply~\eqref{5.2}. In this case, we may not be able to say that the number of such primes are finite. However, if $K$ is Galois over $\mathbb{Q}$, then the above proposition can be re-stated as: \begin{lem} Let $\mathbf{f}$ be as in Proposition~\ref{1:2}. If $K$ is Galois over $\mathbb{Q}$, then there exists an integer $M_\mathbf{f} \geq 1$ with $N(\mathfrak{c})\mid M_\mathbf{f}$ such that for any prime $p \nmid M_\mathbf{f}$ and for any prime ideal $\mathfrak{p} \in \mathbf{P}$ over $p$, we have either $C(\mathfrak{p},\mathbf{f}) = 0$ or $C(\mathfrak{p}^r,\mathbf{f}) \neq 0$ for all $r \geq 1$. \end{lem} Now, we are in a position to state our main result of this section, which improves the result~\cite[Theorem 3.2]{KK}. \begin{thm} \label{maintheorem3} Let $\mathbf{f}$ and $\mathbf{g}$ be two primitive forms over $K$ and of levels $\mathfrak{c}_1,\mathfrak{c}_2$, with characters $\chi_1 \ \mathrm{and} \ \chi_2$ and weights $2k,2l$, respectively. For any prime $p \nmid M_\mathbf{f} M_\mathbf{g}$, for any prime ideal $\mathfrak{p} \in \mathbb{P}$ over $p$, the set \begin{equation} \label{non-vanishingset} A_{\mathfrak{p}} := \{m\in \mathbb{N}| C(\mathfrak{p}^m,\mathbf{f})C(\mathfrak{p}^m,\mathbf{g}) \neq 0\} \end{equation} contains $2\mathbb{N}$, where $M_\mathbf{f}$ and $M_\mathbf{g}$ are as in Lemma~\ref{1:2} for $\mathbf{f},\mathbf{g}$, respectively. Moreover, the natural density of the set $A_{\mathfrak{p}}$ is either $\frac{1}{2}$ or $1$. \end{thm} \begin{proof} For any prime $p\nmid M_\mathbf{f} M_\mathbf{g}$, let $\mathfrak{p} \in \mathbb{P}$ be a prime ideal over $p$. If $C(\mathfrak{p}, \mathbf{f})C(\mathfrak{p}, \mathbf{g}) \ne 0$, then by Lemma~\ref{1:2}, we have that $$\{m\in \mathbb{N}| C(\mathfrak{p}^m,\mathbf{f})C(\mathfrak{p}^m,\mathbf{g}) \neq 0\} = \mathbb{N}.$$ In this case, the natural density of $A_{\mathfrak{p}}$ is $1$. Suppose at least one of $C(\mathfrak{p}, \mathbf{f})$ or $C(\mathfrak{p}, \mathbf{g})$ is zero, say $C(\mathfrak{p},\mathbf{f})=0$. By the Hecke relations for the primitive form $\mathbf{f}$ \begin{equation}\label{Hecke} C(\mathfrak{p}^m,\mathbf{f}) = -\chi_1(\mathfrak{p})N(\mathfrak{p})^{2k_0-1}C(\mathfrak{p}^{m-2},\mathbf{f}), \end{equation} where $\chi_1(\mathfrak{p}) \neq 0$, since $\mathfrak{p}\nmid \mathfrak{c}_1$. Hence, we see that the vanishing or non-vanishing of $C(\mathfrak{p}^m, \mathbf{f})$ depends only on $m \pmod 2$. Therefore, $C(\mathfrak{p}^{2m+1},\mathbf{f}) = 0$ (resp., $C(\mathfrak{p}^{2m},\mathbf{f}) \ne 0$) as $C(\mathfrak{p},\mathbf{f})=0$ (resp., $C(\mathfrak{p}^2, \mathbf{f}) \neq 0$) for all $m \geq 1$. Hence, we have that $$\{m\in \mathbb{N} \mid C(\mathfrak{p}^m,\mathbf{f}) \neq 0\} = 2\mathbb{N}.$$ Arguing similarly for the primitive form $\mathbf{g}$, we see that the set $\{m\in \mathbb{N}| C(\mathfrak{p}^m,\mathbf{g}) \neq 0\}$ is either $\mathbb{N}$ or $2\mathbb{N}$ depends on whether $C(\mathfrak{p},\mathbf{g}) \ne 0$ or $C(\mathfrak{p},\mathbf{g})= 0$, respectively. So any of these cases, we get that $$\{m\in \mathbb{N}| C(\mathfrak{p}^m,\mathbf{f})C(\mathfrak{p}^m,\mathbf{g}) \neq 0\} = 2\mathbb{N}.$$ In this case, the natural density of $A_{\mathfrak{p}}$ is $\frac{1}{2}$. This proves the Theorem. \end{proof} In the view of above theorem, it is a natural question to ask is given a $\mathfrak{p} \in \mathbb{P}$, how often the density of $A_{\mathfrak{p}}$ is $1$? The following proposition settles this question. \begin{prop} \label{2.3.4} Let $\mathbf{f}$ and $\mathbf{g}$ be same as in Theorem~\ref{maintheorem3}. If $\mathbf{f},\mathbf{g}$ are non-CM eigenforms, then there exists a set $S \subseteq \mathbb{P}$ with natural density is $0$ such that \begin{equation} \label{density} A_{\mathfrak{p}}=\{ m\in \mathbb{N} \mid C(\mathfrak{p}^m, \mathbf{f})C(\mathfrak{p}^m,\mathbf{g}) \neq 0 \} = \mathbb{N} \end{equation} for all prime ideals $\mathfrak{p} \in \mathbb{P}$ outside of $S$. \end{prop} \begin{proof} Define the set $S^{\prime} = \{ \mathfrak{p} \in \mathbb{P} \mid C(\mathfrak{p}, \mathbf{f})C(\mathfrak{p}, \mathbf{g}) = 0\}$. Clearly, we have $$\{ \mathfrak{p} \in \mathbb{P} \mid C(\mathfrak{p}, \mathbf{f}) = 0\} \subseteq S^{\prime} \subseteq \{ \mathfrak{p} \in \mathbb{P} \mid C(\mathfrak{p}, \mathbf{f}) =0 \} \cup \{ \mathfrak{p} \in \mathbb{P} \mid C(\mathfrak{p}, \mathbf{g}) =0 \}.$$ By Theorem~\ref{5.5}, the natural density of $\{ \mathfrak{p} \in \mathbf{P} \mid C(\mathfrak{p}, \mathbf{f}) = 0\}$ is $0$ and hence the natural density of $\{ \mathfrak{p} \in \mathbb{P} \mid C(\mathfrak{p},\mathbf{f}) =0 \}$ is $0$. Similarly, for the eigenform $\mathbf{g}$ as well. Hence, the natural density of $S^{\prime}$ is $0$. Therefore, the natural density of the set $S = S^{\prime} \cup \{ \mathfrak{p} \in \mathbb{P} \mid \mathfrak{p} \mid p \ \mathrm{and} \ p\mid M_\mathbf{f} M_\mathbf{g} \}$ is $0$. For any $\mathfrak{p} \not \in S$, by Lemma~\ref{1:2}, we have $C(\mathfrak{p}^m, \mathbf{f}) C(\mathfrak{p}^m, \mathbf{g}) \neq 0$ for all $m \geq 1$. \end{proof} We remark that, in the above result, if we assume $K$ is Galois, then~\eqref{density} holds for density $1$ set of primes in $\mathbf{P}$ (because, in this case $\mathbb{P}=\mathbf{P}$). \section{Sign changes of Hilbert modular forms} \label{Sec2} In this section, we shall study the sign change results for the Fourier coefficients of primitive forms, and later we study the simultaneous sign changes for the Fourier coefficients of two non-zero Hilbert modular forms of different integral weights. \subsection{Sign changes} In ~\cite[Theorem 1.1]{MT14}, the authors show that a non-zero Hilbert cusp form with real Fourier coefficients change signs infinitely often. In the next proposition, for primitive forms, we show that for almost all the primes $\mathfrak{p} \in \mathbb{P}$, the Fourier coefficients $\{C(\mathfrak{p}^r,\mathbf{f})\}_{r\in \mathbb{N}}$ change signs infinitely often. \begin{prop} \label{Sign_Changes_Prime_Fixed} Let $\mathbf{f}$ be a primitive form over $K$ of level $\mathfrak{c}$, trivial character and weight $2k$. Then, for all but finitely many $\mathfrak{p} \in \mathbb{P}$, the Fourier coefficients $\{C(\mathfrak{p}^r,\mathbf{f})\}_{r \in \mathbb{N}}$ change signs infinitely often. \end{prop} \begin{proof} Let $\mathfrak{p} \in \mathbb{P}$ be a prime ideal such that $C(\mathfrak{p}^r,\mathbf{f}) \geq 0$ for all $r \gg 0$ (a similar argument holds in the other case as well). Since $\mathbf{f}$ is primitive, by Hecke relations, we have \begin{equation*} C(\mathfrak{p}^{m+1}, \mathbf{f}) = C(\mathfrak{p},\mathbf{f})C(\mathfrak{p}^m,\mathbf{f}) - N(\mathfrak{p})^{2k_0-1} C(\mathfrak{p}^{m-1},\mathbf{f}). \end{equation*} These Hecke relations can be re-interpreted as \begin{equation} \sum_{r=0}^\infty C(\mathfrak{p}^r,\mathbf{f})X^r = \frac{1}{1-C(\mathfrak{p},\mathbf{f})X + N(\mathfrak{p})^{2k_0-1}X^2}. \end{equation} Suppose that \begin{equation*} 1-C(\mathfrak{p},\mathbf{f})X+ N(\mathfrak{p})^{2k_0-1}X^2 = (1- \alpha(\mathfrak{p})X)(1-\beta(\mathfrak{p})X). \end{equation*} Then \begin{equation}\label{222} \sum_{r=0}^{\infty} C(\mathfrak{p}^r,\mathbf{f})X^r = (1- \alpha(\mathfrak{p})X)^{-1}(1-\beta(\mathfrak{p})X)^{-1}, \end{equation} Comparing the coefficients we have $$\alpha(\mathfrak{p}) + \beta(\mathfrak{p}) = C(\mathfrak{p}, \mathbf{f}) \ \ \mathrm{and} \ \ \alpha(\mathfrak{p})\beta(\mathfrak{p}) = N(\mathfrak{p})^{2k_0-1},$$ where \begin{equation}\label{224} \alpha(\mathfrak{p}), \beta(\mathfrak{p}) = \frac{C(\mathfrak{p},\mathbf{f}) \pm \sqrt{C(\mathfrak{p},\mathbf{f})^2 - 4N(\mathfrak{p})^{2k_0-1}}}{2}. \end{equation} For $s\in \mathbb{C}$, replacing $X$ by $N(\mathfrak{p})^{-s}$ in ~\eqref{222}, we get that \begin{equation}\label{223} \sum_{r=0}^{\infty}C(\mathfrak{p}^r,\mathbf{f})N(\mathfrak{p})^{-sr} = (1- \alpha(\mathfrak{p})N(\mathfrak{p})^{-s})^{-1}(1-\beta(\mathfrak{p})N(\mathfrak{p})^{-s})^{-1}. \end{equation} The above Dirichlet series converges for $\mrm{Re}(s) \gg 0$ and the coefficients are non-negative except for finitely many terms. By Landau's theorem for Dirichlet series with non-negative terms, we get the series~\eqref{223} is either converges everywhere or it has a singularity at the real point of its abscissa of convergence. The series has a pole at $s\in \mathbb{C}$ for which $N(\mathfrak{p})^s = \alpha(\mathfrak{p})$ or $N(\mathfrak{p})^s = \beta(\mathfrak{p})$ holds, hence the first case is not possible. Then the only possibility is that the series has a singularity at the real point of its abscissa of convergence. In particular, one of (and hence both of) $\alpha(\mathfrak{p})$ or $\beta (\mathfrak{p})$ must be real. Hence, we get that ${C(\mathfrak{p},\mathbf{f})}^2 \geq 4N(\mathfrak{p})^{2k_0-1}$. However, by Deligne's bound for $\mathbf{f}$, we have \begin{equation}\label{Dbound} {C(\mathfrak{p},\mathbf{f})}^2 \leq 4N(\mathfrak{p})^{2k_0-1}. \end{equation} Therefore, \begin{equation} \label{225} C(\mathfrak{p},\mathbf{f}) = \pm 2N(\mathfrak{p})^{\frac{2k_0-1}{2}} \in \mathbb{Q}(\mathbf{f}). \end{equation} Since $\mathfrak{p} \in \mathbb{P}$, by~\eqref{225}, we get $\sqrt{p} \in \mathbb{Q}(\mathbf{f})$, which can only happen for finitely many primes $p$. This proves the lemma. \end{proof} In~\cite{KM14}, Kohnen and Martin remarked that the sign change results for the Fourier coefficients can also be proved by using sign changes of $\sin(\theta)$. We elaborate this remark and reprove the above result. For this, we need to recall the following lemma (cf. by~\cite[Proposition 5.1]{KK} for a proof). \begin{lem} Let $\mathbf{f}$ be a primitive form over $F$ of level $\mathfrak{c}$, with trivial character and weight $2k$. For any prime ideal $\mathfrak{p} \nmid \mathfrak{c} \mathfrak{D}_F$, let $\theta_\mathfrak{p}(\mathbf{f}) \in [0,\pi]$ be defined as in~\eqref{theta}. Then, for any $m \geq 1$, we have \begin{equation}\label{normalized} \beta(\mathfrak{p}^m,\mathbf{f}) = \begin{cases} (-1)^m(m+1) & \mathrm{if} \ \theta_\mathfrak{p}(\mathbf{f}) = \pi,\\ m+1 & \mathrm{if} \ \theta_\mathfrak{p}(\mathbf{f}) = 0,\\ \frac{\sin((m+1)\theta_\mathfrak{p}(\mathbf{f}))}{\sin\theta_\mathfrak{p}(\mathbf{f})} & \mathrm{if} \ 0<\theta_\mathfrak{p}(\mathbf{f}) < \pi. \end{cases} \end{equation} \end{lem} Now, we shall give another proof of Proposition~\ref{Sign_Changes_Prime_Fixed}. \begin{proof} For any $\mathfrak{p} \in \mathbb{P}$, if $\theta_\mathfrak{p}(\mathbf{f}) = 0$ or $\pi$, then $C(\mathfrak{p},\mathbf{f}) = \pm 2N(\mathfrak{p})^{\frac{2k_0-1}{2}} \in \mathbb{Q}(\mathbf{f})$, which can happen only for finitely many $\mathfrak{p} \in \mathbb{P}$. So, without loss of generality, we can assume that $0<\theta_\mathfrak{p}(\mathbf{f}) < \pi$, hence $\sin(\theta_\mathfrak{p}(\mathbf{f}))>0$. By~\eqref{normalized}, we have $$C(\mathfrak{p}^m,\mathbf{f})\gtrless0 \iff \sin2\pi (m+1)\frac{\theta_\mathfrak{p}(\mathbf{f})}{2\pi}\gtrless 0.$$ Let $x=\frac{\theta_\mathfrak{p}(\mathbf{f})}{2\pi}$. For any $j \in \mathbb{N}$, the lengths of the intervals $(\frac{2j}{2x}, \frac{(2j +1)}{2x})$ and $(\frac{(2j-1)}{2x}, \frac{2j}{2x} )$ are bigger than $1$, as $\frac{1}{2x} > 1$. Hence, there exists $n_j, m_j \in \mathbb{Z}$ such that $n_j+1 \in (\frac{2j}{2x}, \frac{2j +1}{2x})$ and $m_j +1 \in ( \frac{2j-1}{2x}, \frac{2j}{2x})$. Therefore, we have $\sin ((n_j+1)\theta_\mathfrak{p}(\mathbf{f})) >0$ and $\sin((m_j+1)\theta_\mathfrak{p}(\mathbf{f})) <0$. This completes the proof. \end{proof} In the above proposition, for a prime $\mathfrak{p} \in \mathbb{P}$, we have studied the sign changes for $\{C(\mathfrak{p}^r,\mathbf{f})\}_{r \in \mathbb{N}}$. Now, for a fixed $r \in \mathbb{N}$, we are interested in studying the sign changes for $\{C(\mathfrak{p}^r,\mathbf{f})\}_{\mathfrak{p} \in \mathbf{P}}$. For primitive forms over $\mathbb{Q}$, this question has been studied in~\cite[Theorem 1.1]{MKV18}. In fact, they have computed the natural densities of these sets depending on $r$ is even or odd. In this next theorem, we shall show that a similar result holds for primitive forms over $F$, essentially by following the same approach. So, we shall state the theorem and sketch a proof of it. To state it, we shall need the notion of natural density for a subset of prime ideals. \begin{dfn} Let $F$ be a number field and $S \subseteq \mathbf{P}$ be a subset of prime ideals of $\mathcal{O}_F$. The natural density of $S$ defined as $$d(S)= \lim_{x\to \infty} \frac{\# \{\mathfrak{p} \in S \mid \mathrm{N}(\mathfrak{p}) \leq x\}}{\# \{\mathfrak{p} \in \mathbf{P} \mid \mathrm{N}(\mathfrak{p})\leq x\}},$$ if the limit exists. \end{dfn} \begin{thm} \label{Meher} \label{Sign_Changes_exponent_Fixed} Let $\mathbf{f}$ be a non-CM primitive form over $F$ of level $\mathfrak{c}$, with trivial character and weight $2k$. For any $m \geq 1$, we define $$\mathbf{P}(m)_{\gtrless 0} = \{\mathfrak{p} \in \mathbf{P} \mid \mathfrak{p} \nmid \mathfrak{c} \mathfrak{D}_F, C(\mathfrak{p}^m,\mathbf{f}) \gtrless 0\}.$$ \begin{enumerate} \item If $m \equiv 1 \pmod 2$, then $$d(\mathbf{P}(m)_{>0})= d(\mathbf{P}(m)_{<0}) = \frac{1}{2}.$$ \item If $m \equiv 0 \pmod 2$, then $$d(\mathbf{P}(m)_{> 0}) = \frac{m+2}{2(m+1)} -\frac{1}{2\pi}\tan \Bigg(\frac{\pi}{m+1}\Bigg), \ \mrm{and}$$ $$d(\mathbf{P}(m)_{<0}) = \frac{m}{2(m+1)} + \frac{1}{2\pi}\tan \Bigg(\frac{\pi}{m+1}\Bigg).$$ \end{enumerate} In particular, then for any $m\in \mathbb{N}$, the sequence $\{C(\mathfrak{p}^m,\mathbf{f})\}_{\mathfrak{p}\in \mathbf{P}}$ changes sign infinitely often. \end{thm} \begin{proof} By Theorem~\ref{5.5}, the natural density of $T= \{\mathfrak{p} \in \mathbf{P} \mid \theta_\mathfrak{p}(\mathbf{f}) = 0, \pi \} \cup \{\mathfrak{p} \in \mathbf{P} \mid \mathfrak{p} \mid \mathfrak{c} \mathfrak{D}_F\}$ is zero. By~\eqref{normalized}, we have the following equality $$\mathbf{P}(m)_{\gtrless 0} = \{ \mathfrak{p} \in \mathbf{P} \mid \mathfrak{p} \not \in T, \sin((m+1)\theta_\mathfrak{p}(\mathbf{f})) \gtrless 0\}.$$ If $m\equiv 0 \pmod 2$, then $$ \sin ((m+1)\theta_\mathfrak{p}(\mathbf{f})) >0 \Leftrightarrow \theta_\mathfrak{p}(\mathbf{f}) \in S:= \bigcup_{j= 0}^\frac{m}{2} \Bigg(\frac{2j\pi}{m+1}, \frac{(2j+1)\pi}{m+1} \Bigg),$$ and $$ \sin ((m+1)\theta_\mathfrak{p}(\mathbf{f})) <0 \Leftrightarrow \theta_\mathfrak{p}(\mathbf{f}) \in \bigcup_{j= 1}^\frac{m}{2} \Bigg(\frac{(2j-1)\pi}{m+1}, \frac{2j\pi}{m+1} \Bigg).$$ By Theorem~\ref{5.5}, the density of $\mathbf{P}(m)_{>0}$ exists and $d(\mathbf{P}(m)_{>0}) = \mu_{\mathrm{ST}}(S)$, where $\mu_{\mathrm{ST}}(S) = \frac{2}{\pi}\int_S {\sin}^2tdt$. The explicit calculation of $\mu_{\mrm{ST}}(S)$ is exactly the same as that of~\cite[Theorem 1.1]{MKV18}. Again by Theorem~\ref{5.5}, we see that the natural density of $\{\mathfrak{p} \in \mathbf{P} \mid \mathfrak{p}\nmid \mathfrak{c} \mathfrak{D}_F, C(\mathfrak{p}^m,\mathbf{f})=0\}$ is $0$, hence we have $$d(\mathbf{P}(m)_{<0}) = 1- d(\mathbf{P}(m)_{>0}).$$ In the case of $m \equiv 1 \pmod 2$, a similar calculation in \textit{loc.cit.} works as well. \end{proof} \subsection{Simultaneous sign changes} In~\cite[Theorem 3.1]{KK}, the authors proved that, if $C(\mathcal{O}_F,\mathbf{f})C(\mathcal{O}_F,\mathbf{g}) \neq 0$, then there exists infinitely many integral ideals such that the product of the Fourier coefficients of $\mathbf{f}$ and $\mathbf{g}$ is positive (resp., negative). Now, we shall state the main theorem this section. \begin{thm} \label{maintheorem} Let $\mathbf{f}$ and $\mathbf{g}$ be non-zero Hilbert cusp forms over $F$ of level $\mathfrak{c}$, trivial character and different integral weights $k$, $l$, respectively. Assume that for every ideal $\mathfrak{n} \subseteq \mathcal{O}_F$, there exists an ideal $\mathfrak{r} \subseteq \mathcal{O}_F$ such that $(\mathfrak{n},\mathfrak{r})=1$ such that $C(\mathfrak{r},\mathbf{f})C(\mathfrak{r},\mathbf{g}) \neq 0$. Then there exist infinitely many ideals $\mathfrak{m} \subseteq \mathcal{O}_F$ such that $C(\mathfrak{m},\mathbf{f}) C(\mathfrak{m},\mathbf{g})>0$ and infinitely many ideals $\mathfrak{m} \subseteq \mathcal{O}_F$ such that $C(\mathfrak{m},\mathbf{f})C(\mathfrak{m},\mathbf{g})<0$. \end{thm} \begin{remark} In the above theorem, the condition of simultaneous non-vanishing of Fourier coefficients is required only to ensure that the $L$-function in~\eqref{positive:cofficients} is non-zero, otherwise there is no other reason for this assumption. \end{remark} The main idea in the proof of Theorem~\ref{maintheorem} comes from~\cite[Theorem 1.5]{KM18}, which mainly uses the following theorem of Pribitkin~\cite{Pri08}. \begin{thm} \label{lem1} Let $F(s) = \sum_{n=1}^{\infty} a_n e^{-s\lambda_n}$ be a non-trivial general Dirichlet series which converges somewhere, where the sequence $\{a_n\}_{n=1}^{\infty}$ is complex and the exponent sequence $\{\lambda_n\}_{n=1}^{\infty}$ is real and strictly increasing to $\infty$. If the function $F$ is holomorphic on the whole real line and has infinitely many real zeros, then there exist infinitely many $n \in \mathbb{N}$ such that $a_n > 0$ (resp., $a_n < 0$). \end{thm} The following proposition is a melange of~\cite[Proposition 2.3]{Shi78} and~\cite[Page 124]{Pan91}. \begin{prop} For any integral ideal $\mathfrak{q}\subseteq \mathcal{O}_F$ and every $\mathbf{f}\in S_k(\mathfrak{c}, \psi)$, there exists a unique element $\mathbf{f}|\mathfrak{q}$ of $S_k(\mathfrak{q}\mathfrak{c}, \psi)$ such that $$C(\mathfrak{m},\mathbf{f}|\mathfrak{q})=C(\mathfrak{q}^{-1}\mathfrak{m},\mathbf{f}),$$ and there exists an unique element $\mathbf{f}|U(\mathfrak{q})$ of $S_k(\mathfrak{q}\mathfrak{c},\psi)$ such that $$C(\mathfrak{m},\mathbf{f}|U(\mathfrak{q}))=C(\mathfrak{q}\mathfrak{m},\mathbf{f}).$$ \end{prop} Before we proceed to prove Theorem~\ref{maintheorem}, we need the following proposition to construct new Hilbert modular forms out of the existing modular form with some prescribed vanishing of Fourier coefficients at certain ideals (cf.~\cite[Proposition 4.5]{KK} for a proof). \begin{prop} \label{Key-Proposition} Let $\mathbf{f}\in S_k(\mathfrak{c},\psi)$ and $\mathfrak{q}$ be an integral ideal of $\mathcal{O}_F$. Then $\mathbf{g}=\mathbf{f}-(\mathbf{f}|U(\mathfrak{q}))|\mathfrak{q}$ is a Hilbert cusp form of weight $k$ and level $\mathfrak{q}^2\mathfrak{c}$. Further, it has the property that $C(\mathfrak{m}\mathfrak{q},\mathbf{g})=0$ and $C(\mathfrak{m},\mathbf{g})=C(\mathfrak{m},\mathbf{f})$, if $(\mathfrak{m},\mathfrak{q})=1$. \end{prop} Now, we are ready to prove Theorem~\ref{maintheorem}. \begin{proof} First, we shall show that there exist infinitely many $\mathfrak{m}\subseteq\mathcal{O}_F$ such that \begin{equation} \label{negative} C(\mathfrak{m},\mathbf{f})C(\mathfrak{m},\mathbf{g})<0. \end{equation} A similar proof works for the other case as well, by replacing $\mathbf{f}$ by $-\mathbf{f}$. If~\eqref{negative} is not true, then there exist an ideal $\mathfrak{m}^\prime\subseteq\mathcal{O}_F$ such that \begin{equation}\label{positive} C(\mathfrak{m},\mathbf{f})C(\mathfrak{m},\mathbf{g})\geq 0 \end{equation} for all $\mathfrak{m}\subseteq\mathcal{O}_F$ with $N(\mathfrak{m})\geq N(\mathfrak{m}^\prime)$. Set $\mathfrak{n}:=\prod_{N(\mathfrak{p})\leq N(\mathfrak{m}^\prime)} \mathfrak{p}$, where $\mathfrak{p}$ are prime ideals of $\mathcal{O}_F$. Suppose $\mathbf{f}_1$ and $\mathbf{g}_1$ are Hilbert modular cusp forms obtained from $\mathbf{f}$ and $\mathbf{g}$ respectively, by applying the Proposition~\ref{Key-Proposition} to $\mathbf{f}$ and $\mathbf{g}$ with the ideal $\mathfrak{n}$. Clearly, $\mathbf{f}_1$ and $\mathbf{g}_1$ are also Hilbert cusp forms of level $k$ and $l$ respectively, and of level $\mathfrak{c}_1= \mathfrak{q}^2\mathfrak{c}$. For $s\in\mathbb{C}$ with $\mathrm{Re}(s)\gg 1$, the Rankin-Selberg $L$-function of $\mathbf{f}_1$ and $\mathbf{g}_1$ is defined by \begin{equation}\label{positive:cofficients} R_{\mathbf{f}_1,\mathbf{g}_1}(s):=\sum_{\mathfrak{m}\subseteq\mathcal{O}_F,(\mathfrak{m},\mathfrak{n})=1} \frac{C(\mathfrak{m},\mathbf{f})C(\mathfrak{m},\mathbf{g})}{N(\mathfrak{m})^s}. \end{equation} In above summation $C(\mathfrak{m},\mathbf{f})C(\mathfrak{m},\mathbf{g})\geq 0$, since, if $N(\mathfrak{m})\leq N(\mathfrak{m}^\prime)$ then $\mathfrak{m}=\prod_{\mathfrak{p}_i|\mathfrak{n}}\mathfrak{p}_i^{e_i}$ implies $(\mathfrak{m},\mathfrak{n})\neq1$. The Rankin-Selberg $L$-function $R_{f_1,g_1}(s)$ is a non-zero function since there exists $\mathfrak{m}$ with $(\mathfrak{m},\mathfrak{n})=1$ such that $C(\mathfrak{m},\mathbf{f})C(\mathfrak{m},\mathbf{g}) \neq 0$, by hypothesis. For $\mathrm{Re}(s)\gg 1$, we set $$L_{\mathbf{f}_1,\mathbf{g}_1}(s):=\zeta_F^{\mathfrak{c}_1}(2s-(k_0+l_0)+2)R_{\mathbf{f}_1,\mathbf{g}_1}(s),$$ where $\zeta_F^{\mathfrak{c}_1}(s)=\prod_{\mathfrak{p}|\mathfrak{c}_1, \mathfrak{p}:\text{prime}}(1-N(\mathfrak{p})^{-s})\zeta_F(s)$, where $\zeta_F(s)=\sum_{\mathfrak{m}\subseteq\mathcal{O}_F}N(\mathfrak{m})^{-s}$ is Dedekind zeta function of $F$. By the Euler expansion of Dedekind zeta function of $F$, we get that \begin{align*} \zeta_F^{\mathfrak{c}_1}(s) =&\prod_{\mathfrak{p}|\mathfrak{c}_1, \mathfrak{p}:\text{prime}}(1-N(\mathfrak{p})^{-s})\prod_{\mathfrak{p}:\text{prime}}(1-N(\mathfrak{p})^{-s})^{-1}\\ &=\sum_{\mathfrak{m}\subseteq\mathcal{O}_F,(\mathfrak{m},\mathfrak{c}_1)=1}\frac{1}{N(\mathfrak{m})^{s}}=\sum_{n=1}^{\infty}\frac{a_n(\mathfrak{c}_1)}{n^s}, \end{align*} where $a_n(\mathfrak{c}_1)$ is the number of integral ideals of norm $n$ that are co-prime to $\mathfrak{c}_1$. Hence, we can write $$L_{\mathbf{f}_1,\mathbf{g}_1}(s)=\sum_{n=1}^{\infty}\frac{a_n(\mathfrak{c}_1)n^{k_0+l_0-2}}{n^{2s}}\sum_{\mathfrak{m}\subseteq\mathcal{O}_F,(\mathfrak{m},\mathfrak{n})=1} \frac{C(\mathfrak{m},\mathbf{f})C(\mathfrak{m},\mathbf{g})}{N(\mathfrak{m})^s}.$$ Now, we can re-write $$L_{\mathbf{f}_1,\mathbf{g}_1}(s)=\sum_{m=1}^\infty\frac{\mathfrak{b}_m^{\mathfrak{c}_1}(\mathbf{f}_1,\mathbf{g}_1)}{m^s}= \sum_{m=1}^{\infty}{\mathfrak{b}_m^{\mathfrak{c}_1}(\mathbf{f}_1,\mathbf{g}_1) e^{-s \log m}},$$ where $$\mathfrak{b}_m^{\mathfrak{c}_1}(\mathbf{f}_1,\mathbf{g}_1)=\sum_{n^2|m}\left(a_n(\mathfrak{c}_1)n^{k_0+l_0-2}\sum_{(\mathfrak{m},\mathfrak{n})=1,N(\mathfrak{m})=m/n^2}C(\mathfrak{m},\mathbf{f})C(\mathfrak{m},\mathbf{g})\right).$$ Define, for any $j$, $k_j^{\prime} := k_0 - k_j$, and similarly, define $l_j^{\prime}$. Now, look at the complete $L$-function, defined by the product $$\Lambda_{\mathbf{f}_1,\mathbf{g}_1}(s)= \prod_{j=1}^n \Gamma\left(s+1+ \frac{k_j-l_j-k_0-l_0}{2}\right)\Gamma\left(s-\frac{k^{\prime}_j+l^{\prime}_j}{2}\right)L_{\mathbf{f}_1,\mathbf{g}_1}(s)$$ can be continued to a holomorphic function on the whole plane, since the weights are different (cf.~\cite[Proposition 4.13]{Shi78}). As the $\Gamma$-function is extended by analytic continuation to all complex numbers except the non-positive integers, where the function has simple poles, we get that that function $L_{\mathbf{f}_1,\mathbf{g}_1}(s)$ is also entire and has infinitely many real zeros because the $\Gamma$-factors have poles at non-positive integers. By Landau's Theorem for Dirichlet series with non-negative coefficients, it follows that the Dirichlet series $L_{\mathbf{f}_1,\mathbf{g}_1}(s)$ converges everywhere. By Theorem~\ref{lem1}, there exist infinitely many $m \in \mathbb{N}$ such that $\mathfrak{b}_m^{\mathfrak{c}_1}(\mathbf{f}_1,\mathbf{g}_1) > 0 $ and there exist infinitely many $m \in \mathbb{N}$ such that $\mathfrak{b}_m^{\mathfrak{c}_1}(\mathbf{f}_1,\mathbf{g}_1) < 0$. This is a contradiction to the fact $\mathfrak{b}_m^{\mathfrak{c}_1}(\mathbf{f}_1,\mathbf{g}_1)\geq 0$ for all $m$ (this is because, by~\eqref{positive}, $C(\mathfrak{m},\mathbf{f})C(\mathfrak{m},\mathbf{g})\geq 0$ for all $(\mathfrak{m},\mathfrak{n})=1$). This completes the proof of Theorem~\ref{maintheorem}. \end{proof} In the following proposition, we compute the natural density of $n\in \mathbb{N}$ such that the product $C(\mathfrak{p}^n,\mathbf{f})C(\mathfrak{p}^n,\mathbf{g})$ have the same sign (resp., opposite sign). For primitive forms over $\mathbb{Q}$, this a result due to Amri (cf. ~\cite[Theorem 1.1]{Amr18}). \begin{prop} \label{Amri} Let $\mathbf{f},\mathbf{g}$ be two distinct non-CM primitive forms over $F$ of levels $\mathfrak{c}_1,\mathfrak{c}_2$, with trivial characters, and weights $2k,2l$, respectively. For any prime ideal $\mathfrak{p} \in \mathbf{P}$ with $\mathfrak{p} \nmid \mathfrak{c}_1 \mathfrak{c}_2 \mathfrak{D}_F$, let $\theta_\mathfrak{p}(\mathbf{f}), \theta_\mathfrak{p}(\mathbf{g}) \in [0,\pi]$ be defined as in~\eqref{theta}. Then, for a natural density $1$ set of primes $\mathfrak{p} \in \mathbf{P}$, the linear independence of $1, \frac{\theta_\mathfrak{p}(\mathbf{f})}{2\pi}, \frac{\theta_\mathfrak{p}(\mathbf{g})}{2\pi}$ over $\mathbb{Q}$ implies $$ \lim_{x \to \infty} \frac{\# \{n\leq x : C(\mathfrak{p}^n,\mathbf{f})C(\mathfrak{p}^n,\mathbf{g})\gtrless 0\} }{x} = \frac{1}{2}. $$ \end{prop} \begin{proof} By Theorem~\ref{5.5}, the natural density $\mathfrak{p} \in \mathbf{P}$ such that $\theta_\mathfrak{p}(\mathbf{f}),\theta_\mathfrak{p}(\mathbf{g}) \in \{0,\pi\}$ is zero. Let $\mathfrak{p} \in \mathbf{P}$ be a prime ideal such that $\theta_\mathfrak{p}(\mathbf{f}),\theta_\mathfrak{p}(\mathbf{g}) \in (0,\pi)$. If $1, \frac{\theta_\mathfrak{p}(\mathbf{f})}{2\pi}, \frac{\theta_\mathfrak{p}(\mathbf{g})}{2\pi}$ are linearly independent over $\mathbb{Q}$, the sequence $\{(n\frac{\theta_\mathfrak{p}(\mathbf{f})}{2\pi},n\frac{\theta_\mathfrak{p}(\mathbf{g})}{2\pi})\}_{n\in \mathbb{N}}$ is uniformly distributed $\pmod 1$ in $\mathbb{R}^2$ (cf.~\cite[Theorem 6.3]{KN74}). Now, the rest of the proof is similar to that of~\cite[Theorem 1.1]{Amr18}. \end{proof} In the above result, instead of $F$, if we work over $K$, then one can show the same result holds for all but finitely many primes $\mathfrak{p} \in \mathbb{P}$, instead of density $1$ set of primes $\mathfrak{p} \in \mathbf{P}$. In this case, we can even drop the assumption on $\mathbf{f},\mathbf{g}$ being non-CM. \bibliographystyle{plain, abbrv}
\section{Introduction} The problem of automatically synthesizing digital circuits from logical specifications was first proposed by \acite{Church57}. In \citeyear{pnu-ros-popl89}, \citeauthor{pnu-ros-popl89} examined the problem of synthesizing strategies for reactive systems, proposing Linear Temporal Logic (\ensuremath{\mathsf{LTL}}\xspace) \cite{pnueli77} as the specification language. In a nutshell, \ensuremath{\mathsf{LTL}}\xspace is used to express temporally extended properties of infinite state sequences (called traces), and the aim of \ensuremath{\mathsf{LTL}}\xspace synthesis is to produce a winning strategy, i.e. a function that assigns values to the state variables under the control of the system at every time step, in such a way that the induced infinite trace is guaranteed to satisfy the given \ensuremath{\mathsf{LTL}}\xspace formula, no matter how the environment sets the remaining state variables. In 2015, \citeauthor{deg-var-ijcai15} introduced the problem of $LTL_{f}$~\emph{synthesis} in which the specification is described in a variant of \ensuremath{\mathsf{LTL}}\xspace interpreted over finite traces \cite{DBLP:conf/ijcai/GiacomoV13}. Finite interpretations of \ensuremath{\mathsf{LTL}}\xspace have long been exploited to specify temporally extended goals and preferences in AI automated planning (e.g., \cite{BacchusK00,bai-bac-mci09}). In contrast to \ensuremath{\mathsf{LTL}}\xspace\ synthesis, which produces programs that run in perpetuity, \ensuremath{\mathsf{LTL_{f}}}\xspace synthesis is concerned with the generation of terminating programs. Two natural and important application domains are automated synthesis of business processes, including web services; and automated synthesis of robot controllers, in cases where program termination is desired. Despite recent work on \ensuremath{\mathsf{LTL_{f}}}\xspace synthesis, there is little written on the nature and form of the \ensuremath{\mathsf{LTL_{f}}}\xspace specifications and how this relates to the successful and nontrivial realization of strategies for such specifications. \ensuremath{\mathsf{LTL_{f}}}\xspace synthesis is conceived as a game between the environment and an agent. The logical specification that defines the problem must not only define the desired behavior that execution of the strategy should manifest -- what we might loosely think of as the \emph{objective} of the strategy, but must also define the context, including % any \emph{assumptions} about % the environment's behavior % upon which realization of the objective is predicated. As we show in this work, if % assumptions about environment behavior are not appropriately taken into account, specifications can either be impossible to realize or can be realized trivially by allowing the agent to violate assumptions upon which guaranteed realization of the objective is predicated. We further examine the problem of how to construct specifications where the realization of an objective comes with a quality measure, and where strategies provide guarantees with respect to these measures. The addition of quality measures is practically motivated. In some instances we may have an objective that can be realized in a variety of ways of differing quality (e.g., my automated travel assistant may find a myriad of ways for me to get to KR2018 -- some more preferable than others!). Similarly, we may have multiple objectives that are mutually unachievable and we may wish to associate a quality measure with their individual realization (e.g., I'd like my home robot to do the laundry, wash dishes, and cook dinner before its battery dies, but dinner is most critical, followed by dishes). In this paper we explore finite \ensuremath{\mathsf{LTL}}\xspace synthesis with environment assumptions and quality guarantees. In doing so, we uncover % important observations regarding the form and nature of \ensuremath{\mathsf{LTL_{f}}}\xspace synthesis specifications, how resulting strategies are computed, and the nature of the guarantees we can provide regarding the resulting strategies. In Section \ref{sec:synth-env-ass} we examine the problem of \ensuremath{\mathsf{LTL_{f}}}\xspace synthesis with environment assumptions, introducing the notion of \emph{constrained \ensuremath{\mathsf{LTL_{f}}}\xspace synthesis} in Section \ref{sec:constrained}. In Section \ref{sec:alg-cltlf-synth}, we propose algorithms for constrained \ensuremath{\mathsf{LTL_{f}}}\xspace synthesis, including a reduction to Deterministic B\"{u}chi Automata games for the fragment of environment constraints that are conjunctions of safe and co-safe \ensuremath{\mathsf{LTL}}\xspace formulae. In Section \ref{sec:high-quality-synth}, we examine the problem of augmenting constrained \ensuremath{\mathsf{LTL_{f}}}\xspace synthesis with quality measures. We adopt a specification language, \ensuremath{\mathsf{LTL_{f}[\mathcal{F}]}}\xspace, proposed by \cite{AlmagorKRV17} and define a new notion of optimal strategies. In Section \ref{sec:alg-high-qual-synth}, we provide algorithms for computing high-quality strategies for constrained \ensuremath{\mathsf{LTL_{f}}}\xspace synthesis. % Section \ref{sec:conclusion} summarizes our technical contributions. Some proofs are deferred to the appendix. This paper (without the appendix proofs) will appear in the \emph{Proceedings of the 16th International Conference on Principles of Knowledge Representation and Reasoning} (KR 2018). \section{Preliminaries} We recall the syntax and semantics of linear temporal logic for both infinite and finite traces, as well as the basics of finite state automata and the link between \ensuremath{\mathsf{LTL}}\xspace\ and automata. \subsection{Linear Temporal Logic (\ensuremath{\mathsf{LTL}}\xspace)} Given a set $\PV$ of propositional variables, \ensuremath{\mathsf{LTL}}\xspace formulae are defined as follows: \[ \varphi \coloneqq \top ~\vert~ \bot ~\vert~ p \mid \neg \varphi \mid \varphi_1 \land \varphi_2 \mid \varphi_1 \lor \varphi_2 \mid \ltlnext{} \varphi \mid \varphi_1 \ltluntil{}{} \varphi_2 \mid \varphi_1 \ltlrelease{}{} \varphi_2 \] where $p \in \PV$. Here $\neg$, $\wedge$, and $\vee$ are the usual Boolean connectives, and $\ltlnext{}$ (next), $\ltluntil{}{} $ (until), and $\ltlrelease{}{}$ (release) are temporal operators. The formula $\ltlnext{} \varphi$ states that $\varphi$ must hold in the next timepoint, $\varphi_1 \ltluntil{}{} \varphi_2$ stipulates that $\varphi_1$ must hold until $\varphi_2$ becomes true, and $\varphi_1 \ltlrelease{}{} \varphi_2$ expresses that $\varphi_2$ remain true until and including the point in which $\varphi_1$ is made true (or forever if $\varphi_2$ never becomes true). % For concision, we do not include logical implication ($\rightarrow$), eventually ($\ltleventually{}$, `sometime in the future') and always ($\ltlalways{}$, `at every point in the future') in the core syntax, but instead view them as abbreviations: $\alpha \rightarrow \beta \coloneqq \neg \alpha \lor \beta$, $\ltleventually{} \varphi \coloneqq \top \ltluntil{}{} \varphi$ and and $\ltlalways{} \varphi \coloneqq \bot \ltlrelease{}{} \varphi $. \ensuremath{\mathsf{LTL}}\xspace\ formulae are traditionally interpreted over \emph{infinite traces} $\trace$, i.e., infinite words over the alphabet $2^\PV$. Intuitively, an infinite trace $\trace$ describes an infinite % sequence of (time)steps, with the $i$-th symbol in $\trace$, written $\trace(i)$, specifying the propositional symbols that hold at step~$i$. We use $\trace \sqsubseteq \trace'$ to indicate that $\trace$ is a prefix of $\trace'$. We define what it means for an infinite trace $\trace$ to \emph{satisfy an \ensuremath{\mathsf{LTL}}\xspace formula $\varphi$ at step $i$}, denoted $\trace\models_i \varphi$: \begin{itemize}[noitemsep,topsep=0pt] \item $\trace\models_i \top$, $\trace\not\models_i \bot$, and $\trace \models_i p$ iff $p \in \trace(i)$, for each $p\in\PV$; \item $\trace\models_i \neg \varphi$ iff $\trace\not\models_i \varphi$; \item $\trace\models_i \varphi_1\land\varphi_2$ iff $\trace\models_i \varphi_1$ and $\trace\models_i \varphi_2$; \item $\trace\models_i \varphi_1\lor\varphi_2$ iff $\trace\models_i \varphi_1$ or $\trace\models_i \varphi_2$; \item $\trace\models_i \ltlnext{} \varphi$ iff $\trace\models_{i+1}\varphi$; \item $\trace\models_i \varphi_1\ltluntil{}\varphi_2$ iff there exists $j \geq i$ such that $\trace\models_j \varphi_2$, and for each $i \leq k < j$, $\trace\models_k\varphi_1$; \item $\trace\models_i \varphi_1\ltlrelease{}\varphi_2$ iff for all $j \geq i$ either $\trace \models_j \varphi_2$ or there exists $i \leq k < j$ such that $\trace \models_k \varphi_1$. \end{itemize} A formula $\varphi$ is \emph{satisfied in $\trace$}, written $\trace \models \varphi$, if $\trace\models_1 \varphi$. Two formulas $\varphi$ and $\psi$ are \emph{equivalent} if $\trace \models \varphi$ iff $\trace \models \psi$ for all traces $\pi$. Observe that, in addition to the usual Boolean equivalences, we have the following: $\varphi_1 \ltluntil{} \varphi_2 \equiv \neg (\neg \varphi_1 \ltlrelease{} \neg\varphi_2)$ and $\neg \ltlnext{} \varphi \equiv \ltlnext{} \neg \varphi$. We consider two well-known syntactic fragments of~\ensuremath{\mathsf{LTL}}\xspace. The \emph{safe fragment} is defined as follows \cite{DBLP:journals/fac/Sistla94}: \[ \varphi \coloneqq \top \mid \bot \mid p \mid \neg p \mid \varphi_1 \land \varphi_2 \mid \varphi_1 \vee \varphi_2 \mid \ltlnext{} \varphi \mid \varphi_1 \ltlrelease{}{} \varphi_2 \] The complementary \emph{co-safe fragment} is similarly defined, using $\ltluntil{}{}$ in place of % $\ltlrelease{}{}$. It is known that if $\varphi$ is a safe formula and $\trace \not \models \varphi$, then there is a finite \emph{bad prefix} $\trace_b \sqsubseteq \trace$ such that $\trace' \not \models \varphi$ for every infinite trace $\trace'$ with $\trace_b \sqsubseteq \trace'$. Similarly, if $\varphi$ is a co-safe formula and $\trace \models \varphi$, then there exists a finite \emph{good prefix} $\trace_g \sqsubseteq \trace$ such that $\trace' \models \varphi$ for every infinite trace $\trace'$ with $\trace_g \sqsubseteq \trace'$. This means that violation of safe formulae and satisfaction of co-safe formulae can be shown by exhibiting a suitable finite prefix \cite{DBLP:journals/fmsd/KupfermanV01}. In this paper, our main focus will be on a more recently studied \emph{finite version of \ensuremath{\mathsf{LTL}}\xspace}, denoted \ensuremath{\mathsf{LTL_{f}}}\xspace \cite{DBLP:conf/ijcai/GiacomoV13}, in which formulae are interpreted over \emph{finite traces} (finite words over $2^\PV$). We will reuse the notation $\trace(i)$ ($i$-th symbol) % and introduce the notation $|\trace|$ for the length of~$\trace$. % \ensuremath{\mathsf{LTL_{f}}}\xspace\ has precisely the same syntax as \ensuremath{\mathsf{LTL}}\xspace\ and the same semantics for the propositional constructs, but it differs in its interpretation of the temporal operators: \begin{itemize}[noitemsep,topsep=0pt] \item $\trace\models_i \ltlnext{} \varphi$ iff $|\trace|> i$ and $\trace\models_{i+1}\varphi$; \item $\trace\models_i \varphi_1\ltluntil{}\varphi_2$ iff there exists $i \leq j \leq |\pi|$ such that $\trace\models_j \varphi_2$, and $\trace\models_k\varphi_1$, for each $i \leq k < j$; \item $\trace\models_i \varphi_1\ltlrelease{}\varphi_2$ iff for all $i \leq j \leq |\pi|$ either $\trace \models_j \varphi_2$ or there exists $i \leq k < j$ such that $\trace \models_k \varphi_1$ \end{itemize} We introduce % the \emph{weak next} operator ($\ltlweaknext{}$) as an abbreviation: $\ltlweaknext{} \varphi \coloneqq \ltlnext{} \varphi \vee \neg \ltlnext{} \top$. Thus, $\ltlweaknext{} \varphi $ holds if $\varphi$ holds in the next time step or we have reached the end of the trace. Over finite traces, $\neg \ltlnext{} \varphi \not \equiv \ltlnext{} \neg \varphi$, but we do have $\neg \ltlweaknext{} \varphi \equiv \ltlnext{} \neg \varphi$. As before, we say that $\varphi$ is satisfied in $\trace$, written $\trace \models \varphi$, if $\trace\models_1 \varphi$. Note that we can unambiguously use the same notation for \ensuremath{\mathsf{LTL}}\xspace\ and \ensuremath{\mathsf{LTL_{f}}}\xspace\ so long as we specify whether the considered trace is finite or infinite. \subsection{Finite State Automata} We recall that a \emph{non-deterministic finite-state automaton (NFA)} is a tuple $\C{A} = \langle \Sigma, Q, \delta, Q_0, \QF{} \rangle$, where $\Sigma$ is a finite alphabet of \emph{input symbols}, $Q$ is a finite set of \emph{states}, $Q_0 \subseteq Q$ is a set of \emph{initial states}, $\QF{} \subseteq Q$ is a set of \emph{accepting states}, and $\delta: Q \times \Sigma \rightarrow 2^Q$ is the \emph{transition} function. NFAs are evaluated on \emph{finite} words, i.e.\ elements of $\Sigma^*$. A \emph{run} of $\C{A}$ on a word $w = \theta_1 \cdots \theta_n$ is a sequence $q_0\cdots q_n$ of states, such that $q_0 \in Q_0$, and $q_{i+1} \in \delta(q_i,\theta_{i+1})$ for all $0 \leq i < n$. A run $q_0\cdots q_n$ is \emph{accepting} if $q_n \in \QF{}$, and $\C{A}$ \emph{accepts} $w$ if some run of $\C{A}$ on $w$ is accepting. The \emph{language} of an automaton $\C{A}$, denoted $\C{L}(\C{A})$, is the set of words accepted by $\C{A}$. \emph{Deterministic finite-state automata} (DFAs) are NFAs in which $|Q_0|=1$ and $|\delta(q,\theta)| = 1$ for all $(q,\sigma) \in Q \times \Sigma$. When $\C{A}$ is a \DFA, we write $\delta: Q \times \Sigma \rightarrow Q$ and $q' = \delta(q,\theta)$ in place of $q' \in \delta(q,\theta)$, and when $Q_0=\{q_0\}$, we will simply write $q_0$ (without the set notation). For every \NFA $\C{A}$, there exists a \DFA that accepts the same language as $\C{A}$ and whose size is at most single exponential in the size of $\C{A}$. The \emph{powerset construction} is a well-known technique to \emph{determinize} NFAs \cite{DBLP:journals/ibmrd/RabinS59}. \emph{Non-deterministic B\"uchi automata} (\text{NBA}\xspace) are defined like NFAs but evaluated on \emph{infinite} words, that is, elements of~$\Sigma^\omega$. % A \emph{run} of $\C{A}$ on an infinite word $w = \theta_1 \theta_2 \cdots$ is a sequence $\rho = q_0 q_1 q_2 \cdots$ of states, such that $q_0 \in Q_0$, and $q_{i+1} \in \delta(q_i,\theta_{i+1})$ for every $i \geq 0$. A run $\rho$ is \emph{accepting} if $\mathsf{inf}(\rho) \cap \QF{} \neq \emptyset$, where $\mathsf{inf}(\rho)$ is the set of states that appear infinitely often in $\rho$. We say that an \text{NBA}\xspace $\C{A}$ \emph{accepts} $w$ if some run of $\C{A}$ on $w$ is accepting. Analogous definitions apply to \emph{deterministic} B\"uchi automata (DBAs). We will also consider \emph{deterministic finite-state transducers} (also called Mealy machines, later abbreviated to `transducers'), given by tuples $\C{T} = \langle \Sigma, \Omega, Q, \delta, \omega, q_0 \rangle$, where $\Sigma$ and $\Omega$ are respectively the \emph{input and output alphabets}, $Q$ is the set of states, $\delta: Q \times \Sigma \rightarrow Q$ is the transition function, $\omega: Q \times \Sigma \rightarrow \Omega$ is the \emph{output function}, and $q_0$ the initial state. The run of $\C{T}$ on % $w = \theta_1 \theta_2 \ldots \in \Sigma^\omega$ is an infinite sequence of states $q_0 q_1 q_2 \ldots$ with $q_{i+1} \in \delta(q_i,\theta_{i+1})$ for every $i \geq 0$, and the \emph{output sequence} of $\C{T}$ on $w$ is $\omega(q_0, \theta_1) \omega(q_1,\theta_2) \ldots$. Given an \ensuremath{\mathsf{LTL_{f}}}\xspace formula $\varphi$, one can construct an \NFA that accepts precisely those finite traces $\trace$ with $\trace \models \varphi$ (e.g. \cite{deg-var-ijcai15}). For every safe formula $\varphi_s$ (resp.\ co-safe formula $\varphi_c$), one can construct an \NFA % that accepts all bad prefixes of $\varphi_s$ (resp.\ good prefixes of $\varphi_c$) \cite{DBLP:journals/fmsd/KupfermanV01}. In these constructions, the \NFA\/s are worst case single exponential in the size of the formula. By determinizing these \NFA\/s, we can obtain \DFA\/s of double-exponential size that recognize the same languages. % \section{\ensuremath{\mathsf{LTL}}\xspace\ and \ensuremath{\mathsf{LTL_{f}}}\xspace\ Synthesis} \label{sec:synth-env-ass} To set the stage for our work, we recall the definition of \ensuremath{\mathsf{LTL}}\xspace\ synthesis in the infinite and finite trace settings and the relationship between planning and synthesis. \subsection{LTL Synthesis} An \emph{\ensuremath{\mathsf{LTL}}\xspace specification} is a tuple $\synthproblem{}$ where $\varphi$ is an \ensuremath{\mathsf{LTL}}\xspace formula over \emph{uncontrollable} variables $\mathcal{X}$ and \emph{controllable} variables $\mathcal{Y}$. A \emph{strategy} % is a function $\sigma: (2^{\mathcal{X}})^* \rightarrow 2^{\mathcal{Y}}$. The \emph{infinite trace induced by $\mathbf{X}=\set{X_i}_{i \geq 1} \in (2^{\C{X}})^\omega$ and % $\sigma$} is \[ \inftracestrat{\sigma}{\mathbf{X}}=\left(X_1 \cup \sigma(X_1)\right) \left(X_2 \cup \sigma(X_1 X_2)\right) \ldots \] The set of all infinite traces induced by $\sigma$ is denoted $\inftraces{\sigma}= \{\inftracestrat{\sigma}{\mathbf{X}}\mid \mathbf{X} % \in (2^{\C{X}})^\omega \}$. The \emph{realizability} problem % $\synthproblem{}$ consists in determining whether there exists a \emph{winning strategy}, i.e., a strategy $\sigma$ such that $\trace \models \varphi$ for every $\trace \in \inftraces{\sigma}$. The \emph{synthesis} problem is to compute such a winning strategy when one exists. \ensuremath{\mathsf{LTL}}\xspace synthesis can be viewed % as a 2-player game between the environment ($\mathcal{X}$) and the agent ($\mathcal{Y}$). In each turn, the environment makes a move by selecting $X_i \subseteq \mathcal{X}$, and the agent replies by selecting $Y_i \subseteq \mathcal{Y}$. The aim is to find a strategy $\sigma$ for the agent that guarantees the resulting trace satisfies $\varphi$. \subsection{Finite LTL Synthesis} We now recall \ensuremath{\mathsf{LTL_{f}}}\xspace realizability and synthesis, where % the specification formula is interpreted on finite traces. An \emph{\ensuremath{\mathsf{LTL_{f}}}\xspace specification} is a tuple $\synthproblem{}$, where $\varphi$ is an \ensuremath{\mathsf{LTL_{f}}}\xspace formula over \emph{uncontrollable} variables $\mathcal{X}$ and \emph{controllable} variables $\mathcal{Y}$. A \emph{strategy} % is a function $\sigma: (2^{\mathcal{X}})^* \rightarrow 2^{\mathcal{Y} \cup \{\mathsf{end}\}}$ such that for each infinite sequence $\mathbf{X}=\set{X_i}_{i \geq 1} \in (2^{\C{X}})^\omega$ of subsets of $\C{X}$, there is exactly one integer $n_{\sigma,\mathbf{X}}\geq 1$ with $\mathsf{end} \in \sigma(X_1\cdots X_{n_{\sigma,\mathbf{X}}})$. The induced infinite trace $\inftracestrat{\sigma}{\mathbf{X}}$ is defined as before, and the \emph{finite trace induced by $\mathbf{X}$ and % $\sigma$} is \[ \tracestrat{\sigma}{\mathbf{X}}=\left(X_1 \cup \sigma(X_1)\right) \ldots \left(X_{n_{\sigma,\mathbf{X}}} \cup \sigma(X_1\cdots X_{n_{\sigma,\mathbf{X}}})\right) \] but with $\mathsf{end}$ removed from $\sigma(X_1\cdots X_{n_{\sigma,\mathbf{X}}})$. The set of all \emph{finite traces induced by $\sigma$} is denoted $\fulltraces{\sigma}= \{\tracestrat{\sigma}{\mathbf{X}}\mid \mathbf{X} \in (2^{\C{X}})^\omega\}$. A finite trace $\trace$ is \emph{compatible with $\sigma$} if $\trace \sqsubseteq \trace'$ for some $\trace' \in \fulltraces{\sigma}$, with $\compat{\sigma}$ (`p' for `partial') % the set of all such traces. We call $\sigma$ a winning strategy for an \ensuremath{\mathsf{LTL_{f}}}\xspace\ specification $\synthproblem{}$ if $\trace \models \varphi$ for every $\trace \in \fulltraces{\sigma}$. The realizability and synthesis problems for \ensuremath{\mathsf{LTL_{f}}}\xspace % are then defined % in the same way as for \ensuremath{\mathsf{LTL}}\xspace. \paragraph{Comparison with prior formulations} Prior work on \ensuremath{\mathsf{LTL_{f}}}\xspace synthesis defined strategies as functions $\sigma: (2^{\mathcal{X}})^* \rightarrow 2^{\mathcal{Y}}$ that do not explicitly indicate the end of the trace \cite{deg-var-ijcai15,zhu-etal-ijcai17,cam-bai-mui-mci-icaps18}. In these works, % a strategy $\sigma$ is winning iff for each $\trace \in \inftraces{\sigma}$ there exists some finite prefix $\trace' \sqsubseteq \trace$ such that $\pi' \models \varphi$. Note that in general, multiple prefixes $\trace'$ that satisfy $\varphi$ may exist. % We believe that it is cleaner mathematically to be precise about which trace is produced, and it will substantially simplify our technical developments. The two definitions give rise to the same notion of realizability, and existing results and algorithms for \ensuremath{\mathsf{LTL_{f}}}\xspace\ synthesis transfer to our slightly different setting. \subsection{Planning as \ensuremath{\mathsf{LTL_{f}}}\xspace\ Synthesis}\label{sec:planning} It has been observed % that different forms of automated planning can be recast as \ensuremath{\mathsf{LTL_{f}}}\xspace\ synthesis (see e.g. \cite{deg-var-ijcai15,DIppolitoRS18,cam-bai-mui-mci-ccai18}). We recall that planning problems are specified in terms of a set of \emph{fluents} (i.e., atomic facts whose value may change over time), a set of \emph{actions} which can change the state of the world, an \emph{action theory} whose axioms give the \emph{preconditions} and \emph{effects} of the actions (i.e., which fluents must hold for an action to be executable, and how do the fluents change as a result of performing an action), a description of the \emph{initial state}, and a \emph{goal}. In classical planning, actions are deterministic (i.e. there is a unique state resulting from performing an action in a given state), and the aim is to produce a sequence of actions leading from the initial state to a goal state. In \emph{fully observable non-deterministic} (FOND) planning, actions have non-deterministic effects, meaning that there may be multiple possible states that result from performing a given action in a given state (with the effect axioms determining which states are possible results). Strong solutions are \emph{policies} (i.e., functions % that map states into actions) that guarantee eventual achievement of the goal. We briefly describe how FOND planning can be reduced to \ensuremath{\mathsf{LTL_{f}}}\xspace\ synthesis,\footnote{Our high-level presentation combines elements of the reductions in \cite{deg-var-ijcai15,cam-bai-mui-mci-icaps18}. Its purpose is to illustrate the general form and components of an \ensuremath{\mathsf{LTL_{f}}}\xspace\ encoding of planning (not to provide the most efficient encoding).} as the reduction crucially relies on the use of environment assumptions. We will use the set $\C{F}$ of fluents as the uncontrollable variables, and the set of actions $\C{A}$ for the controllable variables. The high-level structure of the \ensuremath{\mathsf{LTL_{f}}}\xspace\ specification formula is: $\Phi = (\Psi_\mathit{init} \land \Psi_\mathit{eff}) \rightarrow (\Psi_\mathit{pre} \land \Psi_\mathit{goal})$ Intuitively, $\Phi$ states that under the assumption that the environment sets % the fluents in accordance with the initial state and effect axioms (captured by $\Psi_\mathit{init}$ and $\Psi_\mathit{eff}$), the agent can choose a single action per turn ($\Psi_\mathit{one}$) in such a way that the preconditions are obeyed ($\Psi_\mathit{pre}$) and the goal is achieved ($\Psi_\mathit{goal}$). We set % $\Psi_\mathit{goal}=\ltleventually{(\gamma \land \neg\ltlnext{\top})}$, where $\gamma$ is a propositional formula over $\C{F}$ describing goal states. The formula $\Psi_\mathit{one}=\Box \psi_\mathit{one}$ with $\psi_\mathit{one} =\ensuremath{ (\ltlnext{\top} \leftrightarrow \bigvee_{a\in\act{}} a) \land \bigwedge_{a,a'\in\act, a\neq a'} ( \neg a \vee \neg {a'}) } $ enforces that a single action is performed at each step. The formula $\Psi_\mathit{pre}$ can be defined as $\Box \bigwedge_{a \in \C{A}} (a \rightarrow \rho_a)$, where $\rho_a$ is a propositional formula over $\C{F}$ (typically, a conjunction of literals) that gives the preconditions of $a$. The formula $\Psi_\mathit{init}$ will simply be the conjunction of literals over $\C{F}$ corresponding to the initial state. Finally, % $\Psi_\mathit{eff}$ will be a conjunction of formulae of the form \begin{equation} \Box \left( (\kappa \wedge a \wedge \rho_a \wedge \psi_\mathit{one}) \rightarrow \ltlweaknext{} \beta \right) \end{equation} where $a \in \C{A}$, and $\kappa$ and $\beta$ are propositional formulas over $\C{F}$. Intuitively, the latter formula states that if the current state verifies $\kappa$ and action $a$ is correctly performed by the agent (i.e. the preconditions are met and no other action is simultaneously performed) then the next state must satisfy $\beta$. We discuss later why it is important to include $\rho_a \wedge \psi_\mathit{one}$. \def\Psi_\mathit{env}^\mathit{cat}{\Psi_\mathit{env}^\mathit{cat}} \def\Psi_\mathit{robot}^\mathit{cat}{\Psi_\mathit{robot}^\mathit{cat}} \subsection{Illustrative Example}\label{sec:bigexample} We now give a concrete example of an \ensuremath{\mathsf{LTL_{f}}}\xspace\ synthesis problem, which illustrates the importance of environment assumptions. Consider synthesizing a high-level control strategy for your Roomba-style robot vacuum cleaner. You want the robot to clean the living room ($LR$) and bedroom ($BR$) when they are dirty, but you don't want it to vacuum a room while your cat is there (the robot scares her). We now describe how this problem can be formalized as \ensuremath{\mathsf{LTL_{f}}}\xspace\ synthesis. Taking inspiration from the encoding of planning, we will use $\{clean(z), catIn(z) \mid z \in \{LR, BR\}\}$ (the fluents\footnote{We use notation reminiscent of first-order logic to enhance readability, but the variables (e.g. $clean(LR)$) are propositional.} in our scenario) as the set of uncontrollable variables, and take the robot's actions $\{vac(BR), vac(LR)\}$ as the controllable variables. As was the case for planning, it is natural to conceive of the specification as having the form of an implication $\Psi_\mathit{env}^\mathit{cat} \rightarrow \Psi_\mathit{robot}^\mathit{cat}$, with $\Psi_\mathit{env}^\mathit{cat}$ describing the rules governing the environment's behavior and $\Psi_\mathit{robot}^\mathit{cat}$ the desired % behavior of the robot. % We define $\Psi_\mathit{robot}^\mathit{cat}$ as the conjunction of: % \begin{itemize}[noitemsep,topsep=0pt] \item for $z \in \{LR, BR\}$, the formula $\Box (vac(z) \rightarrow \rho_\mathit{vac(z)})$, with $\rho_\mathit{vac(z)} = \neg clean(z) \wedge \neg catIn(z)$ the precondition of $vac(z)$ (we can only vacuum dirty cat-free rooms); \item $\Box (\neg vac(LR) \vee \neg vac(BR))$ (we cannot vacuum in two places at once); \item $\ltleventually{(clean(LR) \wedge clean(BR))}$ (our goal: both rooms clean). \end{itemize} We let $\varphi_{vac(z)}= vac(z) \wedge \rho_\mathit{vac(z)} \wedge \neg vac(z')$ (with $z'$ the other room) encode a correct execution of $vac(z)$, and let $\Psi_\mathit{env}^\mathit{cat}$ be a conjunction of the following: \begin{itemize}[noitemsep,topsep=0pt] \item for $z \in \{LR, BR\}$: $\Box \left(clean(z) \vee \varphi_{vac(z)}\rightarrow \ltlweaknext{clean(z)}\right)$ (if room $z$ is currently clean, or if the robot correctly performs action $vac(z)$, then room $z$ is clean in the next state\footnote{For simplicity, we assume once a room is clean, it stays clean. }) \item for $z \in \{LR, BR\}$: $\Box \left( \neg clean(z) \wedge \neg vac(z) \rightarrow \ltlweaknext{\neg clean(z)} \right)$ (a room can only become clean if it is vacuumed); \item $\Box (\neg catIn(LR) \vee \neg catIn(BR))$ and $\Box(catIn(LR) \vee catIn(BR))$ (the cat is in exactly one of the rooms). \end{itemize} As the reader may have noticed, while the assumptions in $\Psi_\mathit{env}^\mathit{cat}$ are necessary, they are not sufficient to ensure realizability, as the cat may stay forever in a dirty room. If we further assume that the cat eventually leaves each of the rooms ($\varphi_\mathit{leaves} =\ltleventually{\neg catIn(BR)} \wedge \ltleventually{\neg catIn(LR)} $), there is an obvious solution: vacuum a cat-free room, and then simply wait until the other room is cat-free and then vacuum it. However, rather unexpectedly, adding $\varphi_\mathit{leaves}$ to $\Psi_\mathit{env}^\mathit{cat}$ makes the specification $\Psi_\mathit{env}^\mathit{cat} \rightarrow \Psi_\mathit{robot}^\mathit{cat}$ realizable in a trivial and unintended way: by ending execution in the first move, $\neg \Psi_\mathit{env}^\mathit{cat}$ trivially holds in the resulting length-1 trace~$\pi$. Indeed, there are three possibilities: (i) $\pi \models catIn(BR)$ (so $\pi \not \models \ltleventually{\neg catIn(BR)}$), (ii) $\pi \models catIn(LR)$ (so $\pi \not \models \ltleventually{\neg catIn(LR)}$), or (iii) $\pi \models \neg catIn(LR) \wedge \neg catIn(BR)$ (so $\pi \not \models \left (\Box(catIn(LR) \vee catIn(BR)) \right)$). Clearly, this length-1 strategy is not the strategy that we wanted to synthesize. In Section \ref{sec:constrained}, we propose a new framework for handling environment assumptions which avoids the generation of such trivial strategies and makes it possible to find the desired strategies. \section{Constrained \ensuremath{\mathsf{LTL_{f}}}\xspace\ Synthesis}\label{sec:constrained} To the aim of properly handling environment assumptions, we introduce a generalization of \ensuremath{\mathsf{LTL_{f}}}\xspace\ synthesis, % in which the assumptions are separated from the rest of the specification formula and given a different interpretation. Essentially, the idea is that the environment is allowed to satisfy the assumption over the whole infinite trace, rather than on the finite prefix chosen by the agent. This can be accomplished using \ensuremath{\mathsf{LTL}}\xspace\ semantics for the environment assumption, but keeping \ensuremath{\mathsf{LTL_{f}}}\xspace\ semantics for the formula describing the objective. % Formally, a \emph{constrained \ensuremath{\mathsf{LTL_{f}}}\xspace specification} is a tuple $\constrainedproblem{}$, where $\mathcal{X}$ and $\mathcal{Y}$ are the uncontrollable and controllable variables, $\varphi$ is an \ensuremath{\mathsf{LTL_{f}}}\xspace\ formula over $\mathcal{X} \cup \mathcal{Y}$, and $\ensuremath{\alpha}$ is an \ensuremath{\mathsf{LTL}}\xspace formula over $\mathcal{X} \cup \mathcal{Y}$. Here $\varphi$ describes the desired agent behavior when the environment behaves so as to satisfy $\ensuremath{\alpha}$. We will henceforth call $\varphi$ the \emph{objective}, and will refer to $\ensuremath{\alpha}$ as the (environment) \emph{assumption} or \emph{constraint} (as it acts to constrain the allowed environment behaviors). A \emph{strategy for \constrainedproblem{}} is a function $\sigma: (2^{\mathcal{X}})^* \rightarrow 2^{\mathcal{Y} \cup \{\mathsf{end}\}}$ such that for each infinite sequence $\mathbf{X}=\set{X_i}_{i \geq 1} \in (2^{\C{X}})^\omega$ of subsets of $\C{X}$, there is \emph{at most} one integer $n_{\sigma,\mathbf{X}}\geq 1$ with $\mathsf{end} \in \sigma(X_1\cdots X_{n_{\sigma,\mathbf{X}}})$. If none exists, we write $n_{\sigma,\mathbf{X}} = \infty$. To account for traces that do not contain $\mathsf{end}$, we redefine $\fulltraces{\sigma}$ as follows: $\{\tracestrat{\sigma}{\mathbf{X}}\mid \mathbf{X} \in (2^{\C{X}})^\omega \text{ and } n_{\sigma,\mathbf{X}}<\infty\}$. A strategy $\sigma$ is an \emph{$\ensuremath{\alpha}$-strategy} if for every $\mathbf{X} \in (2^{\C{X}})^\omega$, either $n_{\sigma,\mathbf{X}} < \infty$ or $\inftracestrat{\sigma}{\mathbf{X}} \not \models \ensuremath{\alpha}$, i.e. $\sigma$ terminates on every trace that satisfies~$\ensuremath{\alpha}$. A \emph{winning strategy} (w.r.t. \constrainedproblem{}) is an $\ensuremath{\alpha}$-strategy such that $\trace \models \varphi$ for every $\trace \in \fulltraces{\sigma}$. In other words, winning strategies are those that guarantee the satisfaction of the objective $\varphi$ under the assumption that the environment behaves in a way that constraint $\ensuremath{\alpha}$ is satisfied. The realizability and synthesis problems for constrained \ensuremath{\mathsf{LTL_{f}}}\xspace specifications are defined as before, using this notion of winning strategy. Because the constraints are interpreted using infinite \ensuremath{\mathsf{LTL}}\xspace\ semantics, we are now able to correctly handle liveness constraints % ($\ltleventually{\psi}$) and fairness constraints as studied in \ensuremath{\mathsf{LTL}}\xspace synthesis ($\ltlalways{\ltleventually{\psi}}$) and FOND planning ($\ltlalways{\ltleventually{\psi_1}} \rightarrow \ltlalways{\ltleventually{\psi_2}} $) \cite{DIppolitoRS18}. \begin{example} Returning to our earlier example, consider the constrained synthesis problem with assumption $\Psi_\mathit{env}^\mathit{cat}$ (which includes $\varphi_\mathit{leaves}$) and objective $\Psi_\mathit{robot}^\mathit{cat}$. The obvious strategy (vacuum dirty rooms as soon as they are cat-free) gives rise to a winning strategy, in which we output $\mathsf{end}$ if we manage to clean both rooms, and otherwise, produce an infinite trace without $\mathsf{end}$ in which $\Psi_\mathit{env}^\mathit{cat}$ is not true. Trivial strategies that terminate immediately will \emph{not} be winning strategies, as there will be infinite traces that satisfy the constraint but where the length-1 finite trace falsifies the objective. \end{example} We remark that % if we are not careful about how we write the constraint $\ensuremath{\alpha}$, we may unintentionally allow the agent to block the environment from fulfilling $\ensuremath{\alpha}$. \begin{remark} Suppose that instead of using Equation 1 to encode the effects of actions, we employ the simpler $\Box \left( (\kappa \wedge a) \rightarrow \ltlweaknext{} \beta \right)$. While intuitive, this alternative formulation does not properly encode % FOND planning, as the specification may be realized in an unintended way: by performing multiple actions with conflicting effects, or a single action whose precondition is not satisfied, the agent can force the environment to satisfy a contradictory set of formulae $\beta$ in the next state, causing the assumption to be violated. \end{remark} \acite{ChatterjeeHJ08} discuss this phenomenon in the context of \ensuremath{\mathsf{LTL}}\xspace synthesis, and suggest that a reasonable environment constraint is one which is \emph{realizable for the environment}. We note that the constraints we considered in Section \ref{sec:synth-env-ass} all satisfy this property. \subsubsection{Correspondence with Finite LTL Synthesis} We begin by observing that (plain) \ensuremath{\mathsf{LTL_{f}}}\xspace\ synthesis is a special case of constrained \ensuremath{\mathsf{LTL_{f}}}\xspace\ synthesis in which one uses the trivial constraint $\top$ for the environment assumption: \begin{theorem}\label{thm:reduction} Every winning strategy $\sigma$ for the \ensuremath{\mathsf{LTL_{f}}}\xspace\ specification $\langle \C{X}, \C{Y}, \varphi \rangle$ is a winning strategy for the constrained \ensuremath{\mathsf{LTL_{f}}}\xspace\ specification $\langle \C{X}, \C{Y}, \top, \varphi \rangle$, and vice-versa. In particular, $\langle \C{X}, \C{Y}, \varphi \rangle$ is realizable iff $\langle \C{X}, \C{Y}, \top, \varphi \rangle$ is realizable. \end{theorem} A natural question is whether a reduction in the other direction exists. Indeed, it is well-known that in the infinite setting, assume-guarantee \ensuremath{\mathsf{LTL}}\xspace\ synthesis\footnote{Here we refer to assume-guarantee synthesis as considered in \cite{ChatterjeeHJ08,AlmagorKRV17}, where given a pair $(\ensuremath{\alpha}, \varphi)$, the aim is to construct a strategy such that every induced infinite trace either violates $\ensuremath{\alpha}$ or satisfies $\varphi$. This is different from the assume-guarantee synthesis of \cite{ChatterjeeH07}, in which N agents each have their own goals, and the objective is for each agent to satisfy its own goals.} with an assumption $\ensuremath{\alpha}$ and objective $\varphi$ corresponds to classical \ensuremath{\mathsf{LTL}}\xspace\ synthesis w.r.t.\ $\ensuremath{\alpha} \rightarrow \varphi$ (that is, the two synthesis problems have precisely the same winning strategies). The following negative result shows that a simple reduction via implication does not work in the finite trace setting: \begin{theorem}\label{thm:implication-fails} There exists an unrealizable constrained \ensuremath{\mathsf{LTL_{f}}}\xspace specification $\C{S}=\langle \C{X}, \C{Y}, \ensuremath{\alpha}, \varphi \rangle$ such that the \ensuremath{\mathsf{LTL_{f}}}\xspace\ specification $\C{S}_\rightarrow = \langle \C{X}, \C{Y}, \ensuremath{\alpha} \rightarrow \varphi \rangle$ is realizable. \end{theorem} \begin{proof} Consider the constrained \ensuremath{\mathsf{LTL_{f}}}\xspace specification $\C{S}=\langle \set{x,x'}, \set{y}, \ensuremath{\alpha}, \varphi\rangle$ with $\ensuremath{\alpha}=\neg x \wedge \ltleventually{x}$ and $\varphi= \ltleventually{(x' \!\wedge y)}$. We claim that $\C{S}$ is unrealizable. Indeed, take any $\mathbf{X}=X_1 X_2 \ldots$ such that $x \not \in X_1$, $x \in X_2$, and $x' \not \in X_i$ for all $i \geq 1$. Then no matter which strategy $\sigma$ is used, the infinite trace $\inftracestrat{\sigma}{\mathbf{X}}$ will satisfy $\ensuremath{\alpha}$, and the induced finite trace $\tracestrat{\sigma}{\mathbf{X}}$, if it exists, will falsify $\varphi$ (as $x'$ never holds). Next consider % $\C{S}_\rightarrow = \langle \set{x}, \set{y}, \ensuremath{\alpha} \rightarrow \varphi \rangle$, and observe that $\ensuremath{\alpha} \rightarrow \varphi \equiv x \vee (\Box \neg x) \vee \ltleventually{(x' \!\wedge y)}$. A simple winning strategy exists: output $\mathsf{end}$ in the first time step. Indeed, % every induced trace has length 1 and hence trivially satisfies $x \vee \Box \neg x$. % \end{proof} With the next theorem, we observe a more fundamental difficulty in reducing constrained \ensuremath{\mathsf{LTL_{f}}}\xspace\ synthesis problems to standard \ensuremath{\mathsf{LTL_{f}}}\xspace\ synthesis: winning strategies for constrained problems may need an \emph{unbounded} number of time steps to realize the specification, a phenomenon that does not occur in standard \ensuremath{\mathsf{LTL_{f}}}\xspace synthesis. \begin{theorem}\label{thm:no_reduction} An \ensuremath{\mathsf{LTL_{f}}}\xspace\ specification is realizable iff it admits a \emph{bounded} winning strategy, i.e.\ a strategy for which there exists % $B > 0$ such that every induced finite trace has length at most $B$. % There exist realizable constrained \ensuremath{\mathsf{LTL_{f}}}\xspace\ specifications that do not possess any bounded winning strategy. \end{theorem} \begin{proof} A straightforward examination of the \ensuremath{\mathsf{LTL_{f}}}\xspace\ synthesis algorithm\footnote{The algorithm can be easily modified to output $\mathsf{end}$ once $\varphi$ has been satisfied to match our definition of strategy. } in \cite{deg-var-ijcai15} shows that when % $\langle \mathcal{X}, \mathcal{Y}, \varphi\rangle$ is realizable, the produced strategy guarantees achievement of $\varphi$ in a number of time steps bounded by the number of states in a DFA for $\varphi$. For the second point, consider the constrained \ensuremath{\mathsf{LTL_{f}}}\xspace specification $\C{S}=\langle \set{x}, \set{y}, \ltleventually{x}, \ltluntil{\neg y\ }{(x \land y)} \rangle$. Observe that % $\C{S}$ is realizable, as it suffices to output $\neg y$ until the first $x$ is read, then output $\{y,\mathsf{end}\}$. Assume for a contradiction that there is a winning strategy $\sigma$ for $\C{S}$ and constant $B > 0$ such that $n_{\sigma,\mathbf{X}}\leq B$ for every $\mathbf{X} \in \C{X}^\omega$. Define $\mathbf{X}^B = X_1^B X_2^B \ldots $ as follows: $X_i^B=\{x\}$ if $i=B+1$ and % $X_i^B=\emptyset$ otherwise. The induced trace $\pi = \tracestrat{\sigma}{\mathbf{X}^B}$ has length at most $B$ and hence does not contain $x$. It follows that $\pi \not \models \varphi$, contradicting our assumption that $\sigma$ is a winning strategy. \end{proof} While the implication-based approach does not work in general, we show that it can be made to work for environment assumptions that belong to the safe fragment: \begin{theorem}\label{thm:safe_reduction} When $\ensuremath{\alpha}$ is a safe formula, the constrained \ensuremath{\mathsf{LTL_{f}}}\xspace\ specification $\C{S}=\constrainedproblem{}$ is realizable iff the \ensuremath{\mathsf{LTL_{f}}}\xspace specification $\C{S}'=\langle \mathcal{X}, \mathcal{Y}, \ensuremath{\alpha}' \rightarrow \varphi \rangle$ is realizable, where $\ensuremath{\alpha}'$ is % obtained from $\ensuremath{\alpha}$ by replacing every occurrence of $\ltlnext{\psi}$ by $\ltlweaknext{\psi}$. \end{theorem} \begin{proof}[Proof sketch] Let $\sigma'$ be a winning strategy for $% \langle \mathcal{X}, \mathcal{Y}, \ensuremath{\alpha}' \rightarrow \varphi \rangle$, with $\ensuremath{\alpha}$ a safe formula. To define a winning strategy $\sigma$ for $% \constrainedproblem{}$, we set $\sigma(X_1\cdots X_n)$ equal to \begin{itemize}[noitemsep,topsep=0pt] \item $\sigma(X_1 \cdots X_n) \setminus \{\mathsf{end}\}$, when $\mathsf{end} \in \sigma(X_1 \cdots X_n)$ and \newline $(X_1 \cup \sigma(X_1)) \ldots (X_n \cup \sigma(X_1\cdots X_n)) \not \models \ensuremath{\alpha}'$; \item $\sigma(X_1 \cdots X_n)$, otherwise. \end{itemize} For the other direction, given a winning strategy $\sigma$ for $\constrainedproblem{}$, % we can define a winning strategy $\sigma'$ for % $\langle \mathcal{X}, \mathcal{Y}, \ensuremath{\alpha}' \rightarrow \varphi \rangle$ by setting $\sigma'(X_1\cdots X_n)$ equal to \begin{itemize} \item $\sigma(X_1\cdots X_n) \cup \set{\mathsf{end}}$, if $(X_1 \cup \sigma(X_1)) \ldots (X_n \cup \sigma(X_1\cdots X_n))$ is a bad prefix for $\ensuremath{\alpha}$, and $\mathsf{end} \not \in \sigma'(X_1\cdots X_k)$ for $k < n$; \item $ \sigma(X_1\cdots X_n) \setminus \set{\mathsf{end}}$, if $\mathsf{end} \in \sigma'(X_1\cdots X_k)$ for some $k < n$; \item $\sigma'(X_1\cdots X_n)= \sigma(X_1\cdots X_n)$, otherwise.\qedhere \end{itemize} \end{proof} The following example shows that it is essential in the preceding theorem to use $\ensuremath{\alpha}' \rightarrow \varphi$ rather than $\ensuremath{\alpha} \rightarrow \varphi$: \begin{example} If we let $\ensuremath{\alpha}=\Box(\neg x \vee \ltlnext{x})$ % and $\varphi = \neg x \wedge y$, then the constrained specification $\constrainedproblem{}$ is not realizable (as the environment can output $x$ in the first step), but the \ensuremath{\mathsf{LTL_{f}}}\xspace\ specification $\langle \mathcal{X}, \mathcal{Y}, \ensuremath{\alpha} \rightarrow \varphi \rangle$ is realizable with a strategy that outputs $\{y, \mathsf{end}\}$ in the first step. Indeed, if the environment outputs $x$, then $\neg \ensuremath{\alpha} \equiv \ltleventually{(x \wedge \neg \ltlnext{x})}$ holds in the induced length-1 trace; if we have $\neg x$ instead, then $\varphi$ holds. % \end{example} Note however that the negative result in the general case (Theorem \ref{thm:implication-fails}) continues to hold if $\ensuremath{\alpha}' \rightarrow \varphi$ is used instead of $\ensuremath{\alpha} \rightarrow \varphi$, since the formulas in that proof do not involve $\ltlnext{}$. Another interesting observation is the environment assumptions $\Psi_\mathit{init}$ and $\Psi_\mathit{eff}$ used to encode the initial state and action effects in planning are safe formulas. This explains why these constraints can be properly encoded in \ensuremath{\mathsf{LTL_{f}}}\xspace\ using implication and $\ltlweaknext{}$ rather than $\ltlnext{}$. We note that if we encode planning using constrained \ensuremath{\mathsf{LTL_{f}}}\xspace\ synthesis, then we can use $\ltlnext{}$ in the effect axioms, which is arguably more natural. \subsubsection{Reduction to LTL Synthesis} \def\tau{\tau} Every \ensuremath{\mathsf{LTL_{f}}}\xspace formula $\varphi$ over % $\C{P}$ can be polynomially transformed into an % \ensuremath{\mathsf{LTL}}\xspace formula $\varphi_{\mathsf{inf}}$ over % $\C{P} \cup \set{\mathsf{alive}}$ such that % $\pi \models \varphi_{\mathsf{inf}}$ iff $\pi' \models \varphi$ for some finite prefix $\trace' \sqsubseteq \trace$ \cite{DBLP:conf/ijcai/GiacomoV13}. Intuitively, % $\mathsf{alive}$ holds for the duration of the (simulated) finite trace. Formally, $\varphi_{\mathsf{inf}} \coloneqq \tau(\varphi) \land \mathsf{alive} \land \left( \ltluntil{\mathsf{alive}}{(\ltlalways{\neg \mathsf{alive}})} \right)$, where: \begin{center} $ \tau(p) = p % \quad \tau(\neg \varphi) = \neg \tau(\varphi) \quad \tau(\varphi_1 \land \varphi_2) =\tau(\varphi_1) \land \tau(\varphi_2)$\\ $ \tau(\ltlnext{\varphi}) = \ltlnext{(\mathsf{alive} \land \tau(\varphi))} \hfill \tau(\ltluntil{\varphi_1}{\varphi_2}) = \ltluntil{\tau(\varphi_1)}{(\mathsf{alive} \land \tau(\varphi_2))} $ \end{center} We extend this transformation as follows: \begin{align*} \psi_{\mathsf{end}} &\coloneqq \ltlalways{(\mathsf{end} \leftrightarrow \mathsf{alive} \land \ltlnext{\neg \mathsf{alive}})} \land \ltlalways{(\mathsf{end} \rightarrow \ltlnext{\ltlalways{ \neg \mathsf{end}}})} \\ \psi_{\ensuremath{\alpha}, \varphi} &\coloneqq \psi_{\mathsf{end}} \land \left ((\ensuremath{\alpha} \vee \ltleventually{\mathsf{end}}) \rightarrow \varphi_{\mathsf{inf}}\right) \end{align*} Here $\psi_{\mathsf{end}}$ forces the agent to trigger variable $\mathsf{end}$ when the end of the trace is simulated and also ensures that $\mathsf{end}$ occurs at most once. Formula $\psi_{\ensuremath{\alpha}, \varphi}$ ensures that $\varphi_{\mathsf{inf}}$ is satisfied -- i.e., a finite trace that satisfies $\varphi$ and ends is simulated -- when either the environment assumption $\ensuremath{\alpha}$ holds or $\mathsf{end}$ occurs. \begin{theorem}\label{reduction-infinite} The constrained \ensuremath{\mathsf{LTL_{f}}}\xspace\ specification $\C{S}=\constrainedproblem{}$ is realizable iff \ensuremath{\mathsf{LTL}}\xspace\ specification $\C{S}^\infty=\langle \mathcal{X}, \mathcal{Y} \cup \set{\mathsf{alive},\mathsf{end}}, \psi_{\ensuremath{\alpha}, \varphi} \rangle$ is realizable. Moreover, for every winning strategy $\sigma$ for $\C{S}^\infty$, the strategy $\sigma'$ defined by $\sigma'(X_1\cdots X_n) \coloneqq \sigma(X_1 \cdots X_n) \setminus \set{\mathsf{alive}}$ is a winning strategy for $\C{S}$. \end{theorem} \section{Algorithms for Constrained \ensuremath{\mathsf{LTL_{f}}}\xspace\ Synthesis} \label{sec:alg-cltlf-synth} \ensuremath{\mathsf{LTL}}\xspace and \ensuremath{\mathsf{LTL_{f}}}\xspace realizability are both 2EXP-complete \cite{pnu-ros-popl89,deg-var-ijcai15}, and we can show the same holds for constrained \ensuremath{\mathsf{LTL_{f}}}\xspace\ problems. The upper bound exploits the reduction to \ensuremath{\mathsf{LTL}}\xspace\ (Theorem \ref{reduction-infinite}), and the lower bound is inherited from (plain) \ensuremath{\mathsf{LTL_{f}}}\xspace synthesis, which is a special case of constrained \ensuremath{\mathsf{LTL_{f}}}\xspace\ synthesis (Theorem \ref{thm:reduction}). \begin{theorem}\label{thm:complexity} Constrained \ensuremath{\mathsf{LTL_{f}}}\xspace realizability (resp.\ synthesis) is 2EXP-complete (resp.\ in 2EXP). \end{theorem} It follows from Theorem \ref{thm:complexity} that the reduction to infinite \ensuremath{\mathsf{LTL}}\xspace\ realizability and synthesis yields worst-case optimal algorithms. However, we argue that the reduction to LTL % does not provide a practical approach. Indeed, while \ensuremath{\mathsf{LTL}}\xspace\ and \ensuremath{\mathsf{LTL_{f}}}\xspace\ synthesis share the same worst-case complexity, recent experiments have shown that \ensuremath{\mathsf{LTL_{f}}}\xspace\ is much easier to handle in practice \cite{zhu-etal-ijcai17}. Indeed, state-of-the-art approaches to \ensuremath{\mathsf{LTL}}\xspace synthesis rely on first translating the \ensuremath{\mathsf{LTL}}\xspace\ formula into a suitable infinite-word automata, then solving a two-player game on the resulting automaton. The computational bottleneck is the complex transformations of infinite-word automata, for which no efficient implementations exist. % Recent approaches to \ensuremath{\mathsf{LTL_{f}}}\xspace\ synthesis also adopt an automata-game approach, but \ensuremath{\mathsf{LTL_{f}}}\xspace\ formulae require only finite-word automata (NFAs and DFAs), which can be manipulated more efficiently. The preceding considerations motivate us to explore an alternative approach to constrained \ensuremath{\mathsf{LTL_{f}}}\xspace synthesis, which involves a reduction to \text{DBA}\xspace games. Importantly, the \text{DBA}\xspace\ can be straightforwardly constructed from DFAs for the constraint and objective formulae, allowing us to sidestep the difficulties of manipulating infinite-word automata. \subsection{\text{DBA}\xspace for Constrained Specifications} \label{dba-construction} For the rest of this section, we assume $\ensuremath{\alpha} = \ensuremath{\alpha}_s \land \ensuremath{\alpha}_c$, where $\ensuremath{\alpha}_s$ is a safe formula and $\ensuremath{\alpha}_c$ is a co-safe formula\footnote{ If we want to have \emph{only} a safe (resp.\ co-safe) constraint, it suffices to use a trivial constraint $\ensuremath{\alpha}_c=\top$ (resp.\ $\ensuremath{\alpha}_s = \bot \ltlrelease{}{}(p \vee \neg p)$). }, both defined over $\C{X}\cup \C{Y}$. Safe and co-safe formulae are well-known \ensuremath{\mathsf{LTL}}\xspace\ fragments \cite{DBLP:journals/fmsd/KupfermanV01} of proven utility. Safe formulas are prevalent in \ensuremath{\mathsf{LTL}}\xspace\ % specifications and a key part of the encoding of planning as \ensuremath{\mathsf{LTL_{f}}}\xspace\ synthesis (see Section \ref{sec:planning}); the usefulness of co-safe formulas can be seen from our example (Section \ref{sec:bigexample}) and their adoption in work on robot planning (see e.g.\ \cite{DBLP:conf/aaai/LahijanianAFKV15}). Our aim % is to construct a \text{DBA}\xspace that accepts infinite traces $\pi$ over $2^{\C{X}\cup \C{Y} \cup \set{\mathsf{end}}}$ such that either (i) $\pi$ contains a single occurrence of $\mathsf{end}$ which induces a finite prefix $\pi'$ with $\pi' \models \varphi$, or (ii) $\pi$ doesn't contain $\mathsf{end}$ and $\pi \not \models \ensuremath{\alpha}_s \wedge \ensuremath{\alpha}_c$. Such a \text{DBA}\xspace $\C{A}^{\alpha_s, \alpha_c}_{\varphi}$ % can be defined by combining three DFAs: $\C{A}_s = \langle 2^\PV, Q_s, \delta_s, (q_0)_s, \QF{s} \rangle$ accepts the bad prefixes of $\ensuremath{\alpha}_s$; $\C{A}_c = \langle 2^\PV, Q_c, \delta_c, (q_0)_c, \QF{c} \rangle$ accepts the good prefixes of $\ensuremath{\alpha}_c$; and $\C{A}_g = \langle 2^\PV, Q_g, \delta_g, (q_0)_g, \QF{g} \rangle$ accepts models of $\varphi$. Recall that these DFAs can be built in double-exponential time. Formally, we let $\C{A}^{\alpha_s, \alpha_c}_{\varphi} = \langle 2^{\C{P}\cup \{\mathsf{end}\}}, Q, \delta, q_0, \QF{}\rangle$, where $Q$, $q_0$, and $\QF{}$ are defined as follows: % \begin{itemize}[noitemsep,topsep=0pt] \item $Q \coloneqq \left ((Q_s\cup\{q_{\mathsf{bad}}\}) \times (Q_c\cup\{q_{\mathsf{good}}\}) \times Q_g) \right)\cup \{q_\top, q_\bot\} $ \item $q_0 \coloneqq ((q_0)_{s}, (q_0)_{c}, (q_0)_{g})$ \item $\QF{} \coloneqq \{(q_s,q_c,q_g) \in Q \mid q_s = q_\mathsf{bad} \text{ or } q_c\neq q_\mathsf{good} \} \cup \{q_\top\}$ \end{itemize} For `regular' symbols $\theta \in 2^{\C{P}}$ (i.e., $\mathsf{end} \not \in \theta$), we set $\delta((q_s,q_c,q_g), \theta)=(\delta_s^*(q_s,\theta), \delta_c^*(q_c,\theta), \delta_g(q_g, \theta))$ where: { \small \begin{align*} \delta_s^*(q_s,\theta) &= \begin{cases} q_\mathsf{bad}, & \text{if } q_s = q_\mathsf{bad} \text{ or } \delta_s(q_s,\theta) \in \QF{s}\\ \delta_s(q_s,\theta),& \text{otherwise} \end{cases}\\ \delta_c^*(q_c,\theta) &= \begin{cases} q_\mathsf{good}, & \text{if } q_c = q_\mathsf{good} \text{ or } \delta_c(q_c,\theta) \in \QF{c}\\ \delta_c(q_c,\theta),& \text{otherwise} \end{cases} \end{align*}} For $\theta$ with $\mathsf{end} \in \theta$, we set $\delta((q_s,q_c,q_g), \theta)=q_\top$ if $\delta_g(q_g,\theta) \in \QF{g}$, and $\delta((q_s,q_c,q_g), \theta)=q_\bot$ in all other cases. % Accepting state $q_\top$ is quasi-absorbing: $\delta(q_\top, \theta) = q_\top$ when $\mathsf{end} \not\in \theta$, and $\delta(q_\top, \theta) = q_\bot$ otherwise. This forces winning strategies to output variable $\mathsf{end}$ at most once. Finally, $q_\bot$ is an absorbing state: $\delta(q_\bot, \theta) = q_\bot$ for every $\theta \in 2^{\C{P} \cup \{\mathsf{end}\}}$. \begin{theorem}\label{dba-thm} The \text{DBA}\xspace $\C{A}^{\alpha_s, \alpha_c}_{\varphi}$ accepts infinite traces $\pi$ such that either: (i) $\pi(1)\cdots\pi(n) \models \varphi$ and $\mathsf{end}$ occurs only in $\pi(n)$, or (ii) $\pi \not\models \ensuremath{\alpha}_s \wedge \ensuremath{\alpha}_c$ and $\mathsf{end}$ does not occur in $\pi$. $\C{A}^{\alpha_s, \alpha_c}_{\varphi}$ can be constructed in double-exponential time in $|\ensuremath{\alpha}_s| + |\ensuremath{\alpha}_c| + |\varphi|$. \end{theorem} \subsection{\text{DBA}\xspace Games}\label{ssec:dba-games} Once a % specification has been converted into a \text{DBA}\xspace, realizability and synthesis can be reduced to \text{DBA}\xspace\ games. We briefly recall next the definition of such games and how winning strategies can be computed. A \emph{\text{DBA}\xspace (or B\"{u}chi) game} (see e.g.\ \cite{ChatterjeeHenzingerPiterman06_AlgorithmsForBuchiGames}) is a two-player game given by a tuple $\langle \C{X}, \C{Y}, \C{A} \rangle$, where $\C{X}$ and $\C{Y}$ are disjoint finite sets of variables and $\C{A}$ is a \text{DBA}\xspace with alphabet $2^{\C{X} \cup \C{Y}}$. A \emph{play} % is an infinite sequence of rounds, where in each round, Player I selects % $X_i \subseteq \C{X}$, then Player II % selects % $Y_i \subseteq \C{Y}$. A play is winning if it yields a word $(X_1 \cup Y_1) (X_2 \cup Y_2) \ldots $ that belongs to $\mathcal{L}(\C{A})$. A game is \emph{winning} if there exists a strategy $\sigma: (2^{\mathcal{X}})^* \rightarrow 2^{\mathcal{Y}}$ such that for every infinite sequence $X_1 X_2 \ldots \in \C{X}^\omega$, the word $(X_1 \cup \sigma(X_1)) (X_2 \cup \sigma(X_1 X_2)) \ldots$ obtained by following $\sigma$ belongs to $ \mathcal{L}(\C{A})$. In this case, we call $\sigma$ a \emph{winning strategy}. Existence of a winning strategy for a DBA game $\C{G} = \langle \C{X}, \C{Y}, \C{A} \rangle$ based upon $\C{A} = \langle 2^{\C{X}\cup \C{Y}}, Q, \delta, q_0, \QF{}\rangle$ can be determined by computing the winning region of $\C{G}$. This is done in two steps. First, we compute the set $RA(\C{G})$ of \emph{recurring accepting} states, i.e. those $q \in \QF{}$ such that Player II has a strategy from state $q$ to revisit $\QF{}$ % infinitely often. Next, we define the \emph{winning region} $Win(\C{G})$ of $\C{G}$ as those states in $q \in Q$ for which Player II has a strategy for reaching a state in $RA(\C{G})$. The sets $RA(\C{G})$ and $Win(\C{G})$ can be computed in polynomial time by utilizing the \emph{controllable predecessor} operator: $\mathsf{CPre}(S) = \{q \in Q \mid \forall X \subseteq \C{X}\, \exists Y \subseteq \C{Y}: \delta(q,X\cup Y) \in S\}$. We set $\mathsf{Reach}^{0}(S) = S$ and $\mathsf{Reach}^{i+1}(S) = \mathsf{Reach}^{i}(S) \cup \mathsf{CPre}(\mathsf{Reach}^{i}(S))$. Intuitively, $\mathsf{Reach}^i(S)$ contains those states from which Player II has a strategy for reaching (or returning to) $S$ in at most $i$ rounds. The limit $\lim_i \mathsf{Reach}^i(S)$ exists because $\mathsf{Reach}^{i}(S) \subseteq \mathsf{Reach}^{i+1}(S)$, and convergence is achieved in a finite number of iterations bounded by $|Q|$. To compute $RA(\C{G})$, we set $S_{\!1} = \QF{}$ and let $S_{\!k+1}=S_{\!k} \cap \lim_i \mathsf{Reach}^i(S_k)$. The set $S_{\!k}$ contains those accepting states from which Player II has a strategy for visiting $S_{\!k}$ no less than $k$ times. The limit $\lim_k S_k$ exists because $S_{\!k} \subseteq S_{\!k+1}$, and convergence is achieved in a finite number of iterations bounded by $|\QF{}|$. $RA(\C{G})$ is the finite limit of $S_{\!k}$, and the set $Win(\C{G})$ is then the finite limit of $\mathsf{Reach}^i(RA(\C{G}))$. It is easy to see that $Win(\C{G})$ can be computed in polynomial time w.r.t.\ the size of the DBA $\C{A}$. The following well-known result shows how we can use $Win(\C{G})$ to decide if $\C{G}$ is winning. \begin{theorem}\label{thm:winning} $\C{G}$ is winning iff $q_0 \in Win(\C{G})$. \end{theorem} We sketch the proof of the right-to-left implication here, since it will be needed for later results. We suppose that $q_0 \in Win(\C{G})$ and show how to construct a transducer $\C{T}_\C{G}$ that implements a winning strategy. % Intuitively, the transducer's output function ensures that the transducer stays within $Win(\C{G})$, always reducing the `distance' to $RA(\C{G})$. More precisely, we can define $\C{T}_\C{G}$ as $\langle 2^\C{X}, 2^\C{Y}, Q, \delta', \omega, q_0 \rangle$, where: the set of states $Q$ and initial state $q_0$ are the same as for the DBA $\C{A}$, and the transition function $\delta'$ mirrors the transition function $\delta$ of $\C{A}$: $\delta'(q, X) = \delta(q,X \cup \omega(q,X))$. We define the output function $\omega$ as follows: \begin{itemize}[noitemsep,topsep=0pt] \item Case 1: there exists $Y^*$ such that $\delta(q, X \cup Y^*) \in Win(\C{G})$. In this case, we let $\omega(q,X)$ be any\footnote{Several $Y$ may satisfy the conditions, and choosing \emph{any} such $Y$ yields a suitable transducer. Alternatively, one can use nondeterministic transducers (called \emph{strategy generators} in \cite{deg-var-ijcai15}) to encode a family of deterministic transducers. } $Y \in 2^\C{Y}$ such that (a) $\delta(q, X \cup Y) \in \mathsf{Reach}^{i+1}(RA(\C{G}))$, and (b) there is no $Y'$ with $\delta(q, X \cup Y') \in \mathsf{Reach}^i(RA(\C{G}))$. \item Case 2: no such $Y^*$ exists. We let $\omega(q,X)$ be any $Y \in 2^\C{Y}$. \end{itemize} According to this definition, after reading $X$, the transducer $\C{T}_\C{G}$ chooses an output symbol $Y$ that allows the underlying automaton $\C{A}$ to transition from the current state via $X \cup Y$ to a state in $Win(\C{G})$ (if some such symbol exists). Moreover, among the immediately reachable winning states, preference is given to those that are closest to $RA(\C{G})$, i.e. those belonging to $\mathsf{Reach}^{i}(RA(\C{G}))$ for the minimal value $i$. \subsection{Constrained \ensuremath{\mathsf{LTL_{f}}}\xspace\ Synthesis via \text{DBA}\xspace Games} Given a constrained \ensuremath{\mathsf{LTL_{f}}}\xspace synthesis specification \constrainedproblem{} with $\ensuremath{\alpha} = \ensuremath{\alpha}_s \land \ensuremath{\alpha}_c$, we proceed as follows: \begin{enumerate}[noitemsep,topsep=0pt] \item Construct the \text{DBA}\xspace\ game $\C{G}^{\ensuremath{\alpha}_s, \ensuremath{\alpha}_c}_{\varphi} = \langle \C{X}, \C{Y} \cup \{\mathsf{end}\}, \C{A}^{\alpha_s, \alpha_c}_{\varphi}\rangle$. \item Determine whether $\C{G}^{\ensuremath{\alpha}_s, \ensuremath{\alpha}_c}_{\varphi} $ is winning: build $Win(\C{G}^{\ensuremath{\alpha}_s, \ensuremath{\alpha}_c}_{\varphi} )$ and check whether $((q_0)_{s}, (q_0)_{c}, (q_0)_{g}) \in Win(\C{G}^{\ensuremath{\alpha}_s, \ensuremath{\alpha}_c}_{\varphi} )$. \item If $\C{G}^{\ensuremath{\alpha}_s, \ensuremath{\alpha}_c}_{\varphi} $ is not winning, return `unrealizable'. \item Otherwise, compute a winning strategy for $\C{G}^{\ensuremath{\alpha}_s, \ensuremath{\alpha}_c}_{\varphi}$ using the transducer from Section \ref{ssec:dba-games}. \end{enumerate} Using Theorems \ref{dba-thm} and \ref{thm:winning}, we can show that this method is correct and yields optimal complexity: \begin{theorem}\label{thm:correct-constrained} Consider a constrained \ensuremath{\mathsf{LTL_{f}}}\xspace specification $\C{S}=$\agproblem{\ensuremath{\alpha}_s \wedge \ensuremath{\alpha}_c}{\varphi} where $\ensuremath{\alpha}_s$ (resp.\ $\ensuremath{\alpha}_c$) is a safe (resp.\ co-safe) formula. Then: \begin{itemize}[noitemsep,topsep=0pt] \item $\C{S}$ is realizable iff the \text{DBA}\xspace game $\C{G}^{\ensuremath{\alpha}_s, \ensuremath{\alpha}_c}_{\varphi}$ is winning; \item Every winning strategy for $\C{G}^{\ensuremath{\alpha}_s, \ensuremath{\alpha}_c}_{\varphi}$ is a winning strategy for $\C{S}$, and vice-versa; \item Deciding whether $\C{G}^{\ensuremath{\alpha}_s, \ensuremath{\alpha}_c}_{\varphi}$ is winning, and constructing a winning strategy when one exists, can be done in 2EXP. \end{itemize} \end{theorem} \section{Synthesis of High-Quality Strategies} \label{sec:high-quality-synth} This section explores the use of a quantitative specification language to compare strategies based upon how well they satisfy the specification. We adopt the \ensuremath{\mathsf{LTL_{f}[\mathcal{F}]}}\xspace language from \cite{AlmagorBK16} and propose a new more refined way of defining optimal strategies. \subsection{The Temporal Logic \ensuremath{\mathsf{LTL_{f}[\mathcal{F}]}}\xspace} We recall here the language \ensuremath{\mathsf{LTL_{f}[\mathcal{F}]}}\xspace\ proposed by \acite{AlmagorBK16}. The basic idea is that instead of a formula being either totally satisfied or totally violated by a trace, a value between 0 and 1 will indicate its \emph{degree of satisfaction}. In order to allow for different ways of aggregating formulae, the basic \ensuremath{\mathsf{LTL}}\xspace\ syntax is augmented with a set $\Fmc \subseteq \{f: [0,1]^k\rightarrow [0,1] \mid k \in \mathbb{N} \}$ of functions, with the choice of which functions to include in $\Fmc$ being determined by the application at hand. Formally, the set of \ensuremath{\mathsf{LTL_{f}[\mathcal{F}]}}\xspace\ formulae is obtained by adding $f(\varphi_1, \ldots, \varphi_k)$ to the grammar for $\varphi$, for every $f \in \Fmc$. We assign a \emph{satisfaction value} to every \ensuremath{\mathsf{LTL_{f}[\mathcal{F}]}}\xspace\ formula, finite trace $\trace$, and time step $1 \leq i \leq |\trace|$, as follows\footnote{We omit $\vee$ and $\ltlrelease{}{}$, as they can be defined using $\neg$, $\wedge$, and $\ltluntil{}{}$.}: {\small \begin{align*} \eval{\trace}{\top}{i}&= 1 \quad \eval{\trace}{\bot}{i}=0 \quad \eval{\trace}{p}{i} = \begin{cases} 1 & \mbox{if } p \in \trace(i)\\ 0 & \mbox{otherwise} \end{cases}\\ \eval{\trace}{\neg \varphi}{i} &= 1 - \eval{\trace}{ \varphi}{i} \\ \eval{\trace}{\varphi_1 \wedge \varphi_2}{i} &= \min\{\eval{\trace}{ \varphi_1}{i}, \eval{\trace}{ \varphi_2}{i}\}\\ \eval{\trace}{\ltlnext{} \varphi}{i}&= \eval{\trace}{\varphi}{i+1}\\ \eval{\trace}{f(\varphi_1, \ldots, \varphi_k)}{i}&= f(\eval{\trace}{\varphi_1}{i}, \ldots, \eval{\trace}{\varphi_k}{i})\\ \eval{\trace}{\varphi_1 \ltluntil{}{} \varphi_2}{i}&= \max_{i \leq i' \leq |\trace|} \left\{ \min \left\{ \eval{\trace}{\varphi_2}{i'}, \min_{i \leq j < i'} \{ \eval{\trace}{\varphi_1}{j} \}\right\} \right \} \end{align*}} The (satisfaction) value of $\varphi$ on $\trace$, written $\eval{\trace}{\varphi}{}$, is $\eval{\trace}{\varphi}{1}$. We define $V(\varphi) \subseteq [0,1]$ as the set of values $\eval{\trace}{\varphi}{i}$, ranging over all traces $\trace$ and steps $1 \leq i \leq |\trace|$. The following proposition, proven by \cite{AlmagorBK16}, shows that an \ensuremath{\mathsf{LTL_{f}[\mathcal{F}]}}\xspace\ formula can take on only exponentially many different values. \begin{proposition}\label{exp-values} For every \ensuremath{\mathsf{LTL_{f}[\mathcal{F}]}}\xspace\ formula $\varphi$, $|V(\varphi)| \leq 2^{|\varphi|}$. \end{proposition} The functions $f$ allow us to capture a diversity of methods for combining a set of potentially competing objectives (including classical preference aggregation methods like weighted sums and lexicographic ordering). \begin{example} For illustration purposes, consider two variants of our robot vacuum example, with specifications $\varphi_1$ and $\varphi_2$, in which the goal $\ltleventually{} ( clean(LR) \land clean(BR))$ is replaced by $\ltleventually{} ( clean(LR) )$ and $\ltleventually{} ( clean(BR))$, respectively. We can include in $\C{F}$ a binary weighted sum operator $sum_{0.3,0.7}$, where % the satisfaction value of $sum_{0.3,0.7}(\varphi_1, \varphi_2)$ on trace $\pi$ is 0.3 if $\pi \models \varphi_1 \land \neg \varphi_2$, 0.7 if $\pi \models \neg \varphi_1 \land \varphi_2$, 1 if $\pi \models \varphi_1 \land \varphi_2$, and zero otherwise. We can thus express that we'd like to clean both rooms, but give priority to the bedroom. \end{example} \subsection{Defining Optimal Strategies} Henceforth, we consider a \emph{constrained synthesis \ensuremath{\mathsf{LTL_{f}[\mathcal{F}]}}\xspace problem} \constrainedproblem{}, defined as before % except that now $\varphi$ is an \ensuremath{\mathsf{LTL_{f}[\mathcal{F}]}}\xspace\ formula. Such formulae assign satisfaction values to traces, allowing us to rank traces according to the extent to which they satisfy the expressed preferences. It remains to lift this preference order to strategies. Perhaps the most obvious way to rank strategies is to consider the minimum value of any trace induced by the strategy, preferring strategies that can guarantee the highest worst-case value. This is the approach adopted by \cite{AlmagorBK16} for \ensuremath{\mathsf{LTL[\mathcal{F}]}}\xspace\ synthesis. We formalize it for constrained \ensuremath{\mathsf{LTL_{f}[\mathcal{F}]}}\xspace\ synthesis as follows: {\color{purple} } \begin{definition}\label{def:bgv} The \emph{best guaranteed value} of strategy $\sigma$, denoted $\wcv{\sigma}$, is the minimum value of $\eval{\trace}{\varphi}{}$ over all % $\trace \in \fulltraces{\sigma}$ (or 0 if $\fulltraces{\sigma} = \emptyset$). A strategy $\sigma$ is \emph{\opt\ w.r.t.\ $(\ensuremath{\alpha},\varphi)$} if it is a $\ensuremath{\alpha}$-strategy and no $\ensuremath{\alpha}$-strategy $\sigma'$ exists with $\wcv{\sigma'} > \wcv{\sigma}$. \end{definition} Optimizing for the best guaranteed value seems natural, % but can be insufficiently discriminative. Consider a simple scenario with $\C{X}=\{x\}$ and $\C{Y}=\{y\}$. If the environment plays $x$, then we get value $0$ no matter what, and if $\neg x$ is played, a value of $1$ is achieved by playing $y$, and $0$ if $\neg y$ is played. Clearly, we should prefer to play $y$ after $\neg x$, % yet the strategy that plays $\neg y$ following $\neg x$ is \opt, since like every strategy, its bgv is 0. This motivates us to introduce a stronger, context-aware, notion of optimality: \begin{definition} Given % a strategy $\sigma$, trace $\trace \in \compat{\sigma}$ % that does not contain $\mathsf{end}$, and $X \in 2^\mathcal{X}$, the \emph{best guaranteed value of $\sigma$ starting from $\trace \! \cdot \! X$}, written $\wcvstart{\sigma}{\trace,X}$, is the minimum of $\eval{\trace'}{\varphi}{}$ over all traces $\trace' \in \fulltraces{\sigma}$ such that $\pi \cdot (X\cup Y) \sqsubseteq \pi'$ for some $Y \in \mathcal{Y}$ (or 0 if no such trace exists). A strategy $\sigma$ is a \emph{strongly \opt\ w.r.t.\ $(\ensuremath{\alpha},\varphi)$} if it is an $\ensuremath{\alpha}$-strategy, and there is no $\ensuremath{\alpha}$-strategy $\sigma'$, trace $\trace \in \compat{\sigma} \cap \compat{\sigma'}$ without $\mathsf{end}$, and $X \in 2^\mathcal{X}$ such that $\wcvstart{\sigma'}{\trace,X} > \wcvstart{\sigma}{\trace,X}$. \end{definition} Strongly \opt strategies take advantage of any favorable situation during execution to improve the best worst-case value. In the preceding example, they allow us to say that the first strategy is better than the second. \section{Algorithms: High-Quality \ensuremath{\mathsf{LTL_{f}}}\xspace Synthesis} \label{sec:alg-high-qual-synth} In this section, we present novel techniques to compute \opt % and strongly \opt strategies for a constrained \ensuremath{\mathsf{LTL_{f}[\mathcal{F}]}}\xspace\ synthesis problem $\constrainedproblem{}$. As in Section \ref{dba-construction}, we focus on the case where $\ensuremath{\alpha}$ is a conjunction $\ensuremath{\alpha}_s \wedge \ensuremath{\alpha}_c$ of safe and co-safe formulae. \subsection{Automaton for \ensuremath{\mathsf{LTL_{f}[\mathcal{F}]}}\xspace}\label{ss:aut-ltlff} It has been shown in \cite{AlmagorBK16} how to construct, for a given \ensuremath{\mathsf{LTL_{f}[\mathcal{F}]}}\xspace\ formula $\varphi$ and set of values $\mathcal{V} \subseteq [0,1]$, an \NFA $\C{A}_{\varphi, \mathcal{V}} = \langle 2^\PV, Q, \delta, Q_0, F\rangle$ that accepts finite traces $\pi$ with $\eval{\trace}{\varphi}{} \in \mathcal{V}$. We briefly recall the construction here. We denote by $sub(\varphi)$ the set of subformulas of~$\varphi$, and let $C_\varphi$ be the set of functions $g: sub(\varphi) \rightarrow [0,1]$ such that $g(\psi) \in V(\psi)$ for all $\psi \in sub(\varphi)$. $Q$ contains all \emph{consistent} functions in $C_\varphi$, where a function $g$ is consistent if, for every $\psi \in sub(\varphi)$, the following hold: \begin{itemize}[noitemsep,topsep=0pt] \item if $\psi = \top$, then $g(\psi) = 1$, and if $\psi = \bot$, then $g(\psi) = 0$ \item if $\psi \in \C{P}$ then $g(\psi) \in \{0,1\}$ \item if $\psi = f(\psi_1,\ldots,\psi_k))$, then $g(\psi) = f(g(\psi_1), \ldots, g(\psi_k))$ \end{itemize} The transition function $\delta$ is such that $g' \in \delta(g,\sigma)$ whenever: \begin{itemize}[noitemsep,topsep=0pt] \item $\sigma = \set{p \in \C{P} \mid g(p) = 1}$ \item $g(\ltlnext \psi_1) = g'(\psi_1)$ for every $\ltlnext \psi_1 \in sub(\varphi))$ \item $g(\ltluntil{\psi_1}{\psi_2}) = \max\set{g(\psi_2), \min\set{g(\psi_1), g'(\ltluntil{\psi_1}{\psi_2})}}$ for every $\ltluntil{\psi_1}{\psi_2} \in sub(\varphi)$ \end{itemize} Finally, the set of initial states is $Q_0 = \set{q \in Q \mid g(\varphi) \in \mathcal{V}}$, and $F = \set{ g \mid g(\psi_2) = g(\ltluntil{\psi_1}{\psi_2}) \text{ for all } \ltluntil{\psi_1}{\psi_2} \in sub(\varphi)} \cap \set{ g \mid g(\ltlnext{\psi}) = 0 \text{ for all } \ltlnext{\psi} \in sub(\varphi)}$. % The NFA $\C{A}_{\varphi,\mathcal{V}}$ can be constructed in single-exponential time, and $\C{L}(\C{A}_{\varphi,\mathcal{V}}) = \{\pi \mid \eval{\trace}{\varphi}{} \in \mathcal{V}\}$ \cite{AlmagorBK16}. By determinizing $\C{A}_{\varphi,\mathcal{V}}$, we obtain a DFA $\hat{\C{A}}_{\varphi,\mathcal{V}}$ that accepts the same language and can be constructed in double-exponential time. In what follows, $\mathcal{V}$ will always take the form $[b,1]$, so we'll use $\hat{\C{A}}_{\varphi \geq b}$ in place of $\hat{\C{A}}_{\varphi, [b,1]}$. \subsection{Synthesis of \opt strategies} \label{ssec:algo-bgv} We describe how to construct a \opt strategy. First note that given $b \in [0,1]$, we can construct a DBA $\C{A}_{\varphi \geq b}^\ensuremath{\alpha}$ that recognizes traces such that either (i) $\ensuremath{\alpha} =\ensuremath{\alpha}_s \wedge \ensuremath{\alpha}_c$ is violated and $\mathsf{end}$ does not occur, % or (ii) $\mathsf{end}$ occurs exactly once and the induced finite trace $\pi$ is such that $\eval{\trace}{\varphi}{} \geq b$. Indeed, we simply reuse the construction from Section \ref{dba-construction}, replacing the DFA $\C{A}_{g}$ with the DFA $\hat{\C{A}}_{\varphi \geq b}$. % We next observe that an $\ensuremath{\alpha}$-strategy $\sigma$ with $\wcv{\sigma} \geq b$ exists iff the DBA game $\langle \C{X}, \C{Y} \cup \{\mathsf{end}\}, \C{A}_{\varphi \geq b}^\ensuremath{\alpha} \rangle$ is winning. Thus, by iterating over the values in $V(\varphi)$ in descending order, we can determine the maximal $b^*$ for which an $\ensuremath{\alpha}$-strategy $\sigma$ with $\wcv{\sigma} \geq b^*$ exists. A \opt\ strategy can be computed by constructing a winning strategy for the \text{DBA}\xspace game $\langle \C{X}, \C{Y} \cup \{\mathsf{end}\}, \C{A}_{\varphi \geq b^*}^\ensuremath{\alpha} \rangle$, using the approach in Section \ref{ssec:dba-games}. As there are only exponentially many values in $V(\varphi)$ (Prop.\ \ref{exp-values}), the overall construction takes double-exponential time. \begin{theorem}\label{thm:opt_strategies} A \opt strategy can be constructed in double-exponential time. % \end{theorem} \defv{v} \defv^+{v^+} \newcommand\autval[1]{\C{A}_{\geq #1}^\ensuremath{\alpha}} \newcommand\winoptgen{ Win(\C{A}_{\varphi \geq \bgval}^\assume,\C{A}_{\varphi \geq \optval}^\assume)} \def\C{A}_{\varphi \geq \bgval}^\assume{\C{A}_{\varphi \geq v}^\ensuremath{\alpha}} \def\C{A}_{\varphi \geq \optval}^\assume{\C{A}_{\varphi \geq v^+}^\ensuremath{\alpha}} \newcommand\winoptgeni[1]{Win^{#1}(\C{A}_{\varphi \geq \bgval}^\assume,\C{A}_{\varphi \geq \optval}^\assume)} \subsection{Synthesis of strongly \opt strategies} To compute a strongly \opt stategy, we build a transducer that runs in parallel DBAs $\C{A}_{\geq b}^\ensuremath{\alpha}$ for different values~$b$, and selects outputs symbols so as to advance within the `best' applicable winning region. This idea can be formalized as follows. As in Section \ref{ssec:algo-bgv}, we first determine the maximal $b^* \in V(\varphi)$ for which a $\ensuremath{\alpha}$-strategy $\sigma$ with $\wcv{\sigma} \geq b^*$ exists, and set $B= V(\varphi) \cap [b^*,1]$. % In the process, we will compute, for each $b \in B$, the sets $Win(\C{G}_{b})$ and $RA(\C{G}_{b})$ for the DBA game $\C{G}_{b} = \langle \C{X}, \C{Y}, \C{A}_{\geq b}^\ensuremath{\alpha} \rangle$ based on the DBA $\autval{b}=\langle 2^{\C{P}\cup \{\mathsf{end}\}}, Q_b, \delta_b, q_0^{b}, F_{b}\rangle$. In the sequel, we will assume that the elements of $B$ are ordered as follows: $b_1 < b_2 \ldots < b_m$, with $b^* = b_1$ and $b_m=1$. We now proceed to the definition of the desired transducer $\C{T}^\mathsf{str}=\langle 2^\C{X}, 2^{\C{Y} \cup \{\mathsf{end}\}}, Q_\mathsf{str}, \delta_\mathsf{str}, \omega_\mathsf{str}, q_0^\mathsf{str} \rangle$, % obtained by taking the cross product of the set of DBAs $\autval{b}$ with $b \in B$, in order to keep track of the current states in these automata: \begin{itemize}[noitemsep,topsep=0pt] \item $q_0^\mathsf{str} = (q_0^{b_1}, q_0^{b_2}, \ldots, q_0^{b_m})$ and $Q_\mathsf{str} = Q_{b_1} \times \ldots \times Q_ {b_m}$ \item $\delta_\mathsf{str}((q_1, \ldots, q_m), X)= (\delta_{b_1}(q_1,X \cup Y), \ldots, \delta_{b_m}(q_m,X \cup Y))$, where $Y= \omega_\mathsf{str}((q_1, q_2, \ldots, q_m),X)$ \end{itemize} After reading $X$, the output function identifies the maximal value $b \in B$ such that current state $q_b$ of $\autval{b}$ can transition, via some symbol $X \cup Y$, into a state in $Win(\C{G}_{b})$, and it returns the same output as the transducer $\C{T}_{\C{G}_b}$ in state $q_b$: \begin{itemize}[noitemsep,topsep=0pt] \item $\omega_\mathsf{str}((q_1, \ldots, q_m), X)= \omega_b(q_b,X)$, where $b= \mathsf{max}(\{v \in B\mid \exists Y\, \delta_v(q_v,X \cup Y) \in Win(\C{G}_{v})\})$ \end{itemize} We note that the transducer $\C{T}_{\C{G}_b}$ can be defined as in Section \ref{ssec:dba-games} even when $q_0^b \not \in Win(\C{G}_{b})$, but it only returns `sensible' outputs when it transitions to $Win(\C{G}_{b})$. \begin{theorem}\label{thm:strong-opt} $\C{T}^\mathsf{str}$ implements a strongly \opt strategy and can be constructed in double-exponential time. % \end{theorem} \section{Discussion and Concluding Remarks} \label{sec:conclusion} It has been widely remarked in the (infinite) LTL synthesis literature that environment assumptions are ubiquitous: the existence of winning strategies is almost always predicated on some kind of environment assumption. This was observed in the work of \cite{ChatterjeeHJ08}, % motivating the introduction of the influential assume-guarantee synthesis model, and in work on rational synthesis \cite{fis-kup-lus-tacas10}, where the environment is assumed to act as a rational agent, and synthesis necessitates finding a Nash equilibrium. Interesting reflections on the role of assumptions in \ensuremath{\mathsf{LTL}}\xspace synthesis, together with a survey of the relevant literature, can be found in \cite{DBLP:journals/corr/BloemEJK14}. In this paper, we explored the issue of handling environment assumptions in \ensuremath{\mathsf{LTL_{f}}}\xspace synthesis \cite{DBLP:conf/ijcai/GiacomoV13}, the counterpart of \ensuremath{\mathsf{LTL}}\xspace synthesis for programs that terminate. Our starting point % was the observation that the standard approach to handling assumptions in \ensuremath{\mathsf{LTL}}\xspace synthesis (via logical implication) fails in the finite-trace setting. % This led us to propose an extension of \ensuremath{\mathsf{LTL_{f}}}\xspace\ synthesis % that explicitly accounts for environment assumptions. The key insight underlying the new model of \emph{constrained \ensuremath{\mathsf{LTL_{f}}}\xspace\ synthesis} is that while the synthesized program must realize the objective in a finite number of steps, the environment continues to exist after the program terminates, so environment assumptions should be interpreted under infinite \ensuremath{\mathsf{LTL}}\xspace\ semantics. We studied the relationships holding between constrained \ensuremath{\mathsf{LTL_{f}}}\xspace\ synthesis and (standard) \ensuremath{\mathsf{LTL_{f}}}\xspace\ and \ensuremath{\mathsf{LTL}}\xspace\ synthesis. In particular, we identified a fundamental difficulty in reducing constrained \ensuremath{\mathsf{LTL_{f}}}\xspace\ synthesis to \ensuremath{\mathsf{LTL_{f}}}\xspace\ synthesis -- the former problem can require unbounded strategies, while bounded strategies suffice for the latter. Nevertheless, when the constraints were restricted to the safe \ensuremath{\mathsf{LTL}}\xspace fragment, a reduction from constrained \ensuremath{\mathsf{LTL_{f}}}\xspace synthesis to \ensuremath{\mathsf{LTL_{f}}}\xspace synthesis is possible. Interestingly, this explains why planning -- more naturally conceived as a constrained \ensuremath{\mathsf{LTL_{f}}}\xspace synthesis problem -- can also be encoded as \ensuremath{\mathsf{LTL_{f}}}\xspace synthesis. The connection between synthesis and planning has been remarked in several works (see e.g., \cite{deg-var-ijcai15,DIppolitoRS18,cam-bai-mui-mci-icaps18,cam-bai-mui-mci-ccai18,cam-mui-bai-mci-ijcai18}). We also showed how to reduce constrained \ensuremath{\mathsf{LTL_{f}}}\xspace synthesis to (infinite) \ensuremath{\mathsf{LTL}}\xspace synthesis, which provides a worst-case optimal means of solving constrained \ensuremath{\mathsf{LTL_{f}}}\xspace synthesis problems, in the general case, using (infinite) \ensuremath{\mathsf{LTL}}\xspace synthesis tools. % In the case where our constraint is comprised of a conjunction of safe and co-safe formulae, we showed that the constrained \ensuremath{\mathsf{LTL_{f}}}\xspace synthesis problem can be reduced to DBA games and the winning strategy determined from the winning region. % What makes our approach interesting is that the DBA is constructed via manipulation of DFAs, much easier to handle in practice than infinite-word automata. We next turned our attention to the problem of augmenting constrained \ensuremath{\mathsf{LTL_{f}}}\xspace synthesis with quality measures. We were motivated by practical concerns surrounding the ability to differentiate and synthesize high-quality strategies in settings where we may have a collection of mutually unrealizable objective formulae and % alternative strategies of differing quality. Our work builds on results for the infinite case, e.g., \cite{AlmagorBK16,AlmagorKRV17,kupferman-qualsurvey16} with and without environment assumptions. We adopted \ensuremath{\mathsf{LTL_{f}[\mathcal{F}]}}\xspace % as our language for specifying quality measures. While the syntax of \ensuremath{\mathsf{LTL_{f}[\mathcal{F}]}}\xspace is utilitarian, many more compelling preference languages are reducible to this core language. We defined two different notions of optimal strategies -- bgv-optimal and strongly bgv-optimal. The former adapts a similar definition in \cite{AlmagorBK16} and the latter originates with us. We focused again on % assumptions that can be expressed as conjunctions of safe and co-safe formulae and provided algorithms to compute bgv- and strongly bgv-optimal strategies with optimal (2EXP) complexity. % Proper handling of environment assumptions and quality measures, together with the design of efficient algorithms for such richer specifications, is essential to putting \ensuremath{\mathsf{LTL_{f}}}\xspace synthesis into practice. The present paper makes several important advances in this direction and also suggests a number of interesting topics for future work including: the study of other types of assumptions in the finite-trace setting (e.g. rational synthesis), the exploitation of more compelling KR languages for specifying preferences, and the exploration of further ways of comparing and ranking strategies (perhaps incorporating notions of cost or trace length). \subsection*{Relation to Conference Version} This paper appears in the Proceedings of the 16th International Conference on Knowledge Representation and Reasoning (KR 2018) without the appendix proofs. The body of this paper is the same as the KR 2018 paper, except that a minor typographic error in the translation of \ensuremath{\mathsf{LTL}}\xspace into \ensuremath{\mathsf{LTL_{f}}}\xspace (the definition of $\tau(\ltluntil{\varphi_1}{\varphi_2}) $ on page 6), which originally appeared in \cite{DBLP:conf/ijcai/GiacomoV13} and was repeated in the KR 2018 paper, has been corrected. \subsection*{Acknowledgements} This work was partially funded by the Natural Sciences and Engineering Research Council of Canada (NSERC) and the ANR project GoAsQ (ANR-15-CE23-0022). \begin{small}
\section{INTRODUCTION} In quantum field theory, thermal background effects are incorporated through the radiative corrections. Renormalization of gauge theories [1-2] at finite temperature [3-11] requires the renormalization of gauge parameters of the corresponding theory. The propagation of particles and the electromagnetic properties of media are also known to modify in the framework of real-time formalism [7-9]. Masses of particles are shown to increase with temperature at the one-loop level [11-22], the two-loop level [23-26] and presumably to all loop levels [27]. At the higher-loop level, the loop integrals have a combination of cold and hot terms which appear due to the overlapping propagator terms in the matrix element. Higher loop calculations are too cumbersome to be performed analytically using the perturbation theory. Order by order cancellations of singularities [12] cannot be shown in the imaginary time formalism. Therefore, the effective potential approach at finite temperature [28] is used to study the overall effects. However, renormalizability can only be tested in detail when order-by-order cancellation of singularities [29] is shown in real-time formalism. \bigskip However, the gauge bosons acquire dynamically generated mass due to plasma screening effect [16-19], at the one-loop level. It helps to determine the changes in electromagnetic properties of a hot medium. In hot gauge theories $m_{e}$ is the electron mass and corresponds to $10^{10}$ K. The vacuum polarization tensor in order $\alpha$ (the QED coupling parameter) does not acquire any hot corrections from hot photons in the heat bath [16] because of the absence of self-interaction of photons in QED. The photon can only interact with the medium in the presence of electrons, which decouple at high temperatures ($\geq 1MeV or 10^{10} K$). Some of the QED parameters have already been calculated for such systems. The effective value of the electric charge increases due to the interaction of charge in the medium and consequently leads to modifications in electromagnetic properties of a medium due to the enhancement in QED coupling. These type of calculations are discussed up to the two loop level. These QED couplings at high density can change an ordinary fluid in a relativistic plasma and give a nonzero value of dynamically generated mass [16-19], which can be treated as a plasma screening mass and causes Debye shielding. We calculate the Debye shielding length of QED plasma as a function of temperature for a QED system which can be identified as QED plasma. \bigskip In this paper, we use the renormalization scheme of QED in real-time formalism to calculate the parameters of QED plasma in terms of thermally corrected renormalized values of electric charge, mass and wavefunction of electron [29]. These thermal contributions to the fundamental parameters of the theory help to determine the effective parameters of the theory under given statistical conditions. In the real-time formalism, all the calculations are done in the rest frame of the heat-bath to re-establish covariance at the cost of Lorentz invariance [7, 20]. The particle propagators include temperature dependent (hot) term in addition to the temperature independent (cold) term [5]. At the higher loop level, the loop integrals involve an overlap of hot and cold terms in particle propagators. This makes the situation cumbersome and getting rid of these singularities needs much more involved calculations. Sometimes $\delta (0)$ type pinch singularities appear in Minkowski space. Cancellation of singularities is not obvious, and this entire scheme works perfectly fine for $T<4m_e$ up to the two loop level [26-28]. \bigskip In the next section, we discuss the vacuum polarization tensor in different ranges of temperature up to the second order in $\alpha$. Section III is comprised of the calculation of the plasma parameters up to the two-loop levels. The plasma screening mass and plasma frequencies up to the second order in alpha are discussed in section IV. We conclude this paper by the discussions of application of these results to certain physical systems in section V. \section{VACUUM POLARIZATION TENSOR IN QED} The lowest order vacuum polarization diagram of QED is given in Fig. 1 and is essential to prove the renormalizability of QED at the lowest level of perturbation theory. This diagram mainly contributes to the QED coupling, which is not affected at low energies. \begin{figure}[!hth] \begin{center} \begin{tabular}{c} \mbox{\includegraphics[width=2.0 in,angle=0] {Presentation1.jpg}} \end{tabular} \end{center} \caption{First order vacuum polarization diagram in QED: Photon produces a virtual electron loop during propagation which can couple with the electrons of the medium.} \end{figure} The vacuum polarization tensor of QED as a function of photon momentum p and the loop momentum k is expressed as: \begin{eqnarray} \Pi _{\mu \nu }(p) &=&e^{2}\int \frac{d^{4}k}{(2\pi )^{4}} \gamma _{\mu }S_{\beta }(k)\gamma _{\nu}S_{\beta }(k+p) \end{eqnarray} and the fermion propagator is replaced by the thermally corrected propagator to incorporate thermal effects. The thermal propagator of QED is calculated using the fermion propagator, \begin{eqnarray} S_{\beta}(k) = \not k [\frac{1}{k^2+{m_e}^2}+2\pi n_F(k)] \nonumber \end{eqnarray} with the fermion distribution function, \begin{eqnarray} n_F(k)=\frac {1}{e^{\beta k}+1} \nonumber \end{eqnarray} \bigskip in usual notations. The absence of a photon propagator in Eq.(1) corresponds to the lack of hot electrons in the propagating medium causing the lack of thermal contribution at low temperature. Whereas, at the two loop level, there is an overlap of electron and photon propagators and the electron loops in vacuum can pick up thermal corrections from hot photons in the background through cold electron loops as well. These small contributions do not exceed the expansion parameter of the perturbation series before the decoupling of neutrinos take place. In the presence of neutrinos, after decoupling, they can interact with radiation [30-32] and the relevant electroweak processes cannot be ignored. \bigskip The vacuum polarization tensor of photon at the two-loop level gives the second order hot corrections to charge renormalization constant of QED at low temperature. Second order corrections to the vacuum polarization are mainly described by three diagrams given in Figure 2. These contributions are calculated from QED vertex type corrections Fig. (2a) and the electron self mass type corrections of Fig. (2b) inside the vacuum polarization tensor. In Fig. (2c), the mass counter term has to be included in the vacuum polarization to cancel singularities. \begin{figure}[!hth] \begin{center} \begin{tabular}{c} \mbox{\includegraphics[width=4in,angle=0] {Presentation2.jpg}} \end{tabular} \end{center} \caption{Second order vacuum polarization diagrams in QED. It includes second order corrections due to : (a) QED vertex corrections , (b) electron selfmass and (c) is the counter-term.} \end{figure} The diagrams in Fig.2 are used to calculate the second order thermal contributions to the vacuum polarization tensor due to the hot photon loops at low temperature, i.e., $T\ll m_{e}$ . In this scheme of calculations, the vacuum polarization tensor of photon in Fig. (2a) is given by \begin{eqnarray} \Pi _{\mu \nu }^{a}(p) &=&e^{4}\int \frac{d^{4}k}{(2\pi )^{4}}\int \frac d^{4}l}{(2\pi )^{4}}tr[\gamma _{\mu }S_{\beta }(k)\gamma _{\rho }D_{\beta}^{_{\rho _{\sigma }}}(l)S_{\beta }(k+l) \nonumber \\ &&\gamma _{\nu }S_{\beta }(k+l-p)\gamma _{\rho }S_{\beta }(k-p)], \end{eqnarray} while Fig.(2b) is \begin{eqnarray} \Pi _{\mu \nu }^{b}(p) &=&e^{4}\int \frac{d^{4}k}{(2\pi )^{4}}\int \frac d^{4}l}{(2\pi )^{4}}tr[\gamma _{\mu }S_{\beta }(k)\gamma _{\rho }D_{\beta}^{_{\rho _{\sigma }}}(l) \nonumber \\ &&S_{\beta }(k+l)\gamma _{\sigma }S_{\beta }(k)\gamma _{\nu }S_{\beta }(p-k)].\ \end{eqnarray} where the photon propagator is given as, \begin{eqnarray} D^{\mu\nu}_{\beta}(l)= [\frac{g^{\mu\nu}}{k^2+{m_e}^2}+2\pi n_B(l)] \nonumber \end{eqnarray} with the photon distribution function, \begin{eqnarray} n_B(l)=\frac {1}{e^{\beta l}-1}. \nonumber \end{eqnarray} \bigskip Renormalization of QED is established by order-by-order cancellation of singularities [23-26]. Therefore the contributions of all of the same loop-order diagrams are required to be added together to demonstrate the cancellation of singularities. Due to the choice of the rest-frame of the heatbath, Lorentz invariance breaks (to maintain gauge invariance) in real-time formalism. For this purpose, we need to get rid of hot divergences appearing due to the presence of the hot loops without distributing them over the cold loops. The energy integration has to be performed before 3- momenta integrals. Once the energy integration is done, the three dimensional momentum integrals can even be performed using the techniques of covariant field theory in vacuum. \bigskip Due to the imposed covariance in the propagators, physically measurable contributions to the couplings can be obtained in terms of longitudinal and transverse components of the polarization tensor through the contraction of vacuum polarization tensor $\Pi _{\mu \nu }$ with $g^{\mu\nu}$ in Minkowski space. As a result of this calculation, we obtain a nonzero value of the longitudinal component ($\Pi_L$) due to the coupling of photon to the medium through the dynamically generated mass. \bigskip Contraction of the 4-velocity of the heatbath $u^\mu$ with the polarization tensor $\Pi _{\mu \nu }$ gives the longitudinal and transverse components of this tensor while the photon is propagating through the medium and is calculated as: \begin{equation} u^{\mu }u^{\nu }\Pi _{\mu \nu }(p,T)=-\frac{2\alpha ^{2}T^{2}}{3}(1+\frac{p_{0}^{2}}{2m^{2}}), \end{equation} and \begin{equation} g^{\mu \nu }\Pi _{\mu \nu }(p,T)=\frac{\alpha ^{2}T^{2}}{3}. \end{equation} Moreover, the longitudinal and the transverse components of the vacuum polarization tensor that can be calculated from Eqs. (2) and (3) are: \begin{eqnarray} \Pi _{L}(p,T) &=&-\frac{p^{2}}{|\mathbf{p}|^{2}}u^{\mu }u^{\nu }\Pi _{\mu \nu }(p,T) \nonumber \\ &=&\frac{2\alpha ^{2}T^{2}p^{2}}{3|\mathbf{p}|^{2}}(1+\frac{p_{0}^{2}}{2m^{2}}), \end{eqnarray} and \bigskip \begin{eqnarray} \Pi _{T}(p,T) &=&-\frac{1}{2}[\Pi _{L}(p,T)-g^{\mu \nu }\Pi _{\mu \nu}^{b}(p,T)] \nonumber \\ &=&\frac{\alpha ^{2}T^{2}}{3}[\frac{1}{2}-\frac{p^{2}}{|\mathbf{p}|^{2}}(1+\frac{p_{0}^{2}}{2m^{2}})]. \end{eqnarray} These components of the vacuum polarization tensor are used to determine the electromagnetic properties of a medium with hot photons and electrons. Light is transverse in nature in vacuum and even in a medium at normal temperatures and densities. However, the nonzero value of the longitudinal component in Eq.(6) indicates that a temperature dependent longitudinal component arises due to the self-interaction of photons at high temperature, which is greater than $10^9$ K and may exist in the early universe or inside stars. This longitudinal component indicates the coupling of a photon with the medium through virtual photons and gives rise to a dynamically generated mass of photon. This dynamically generated mass can be referred to as the plasma shielding mass and photon may be treated as a plasmon due to this distinct behavior. This behavior is observed at high densities [18, 33, 34] at the one loop level as well but we ignore it at the two loop level here. \section{ELECTROMAGNETIC PROPERTIES OF A MEDIUM} The QED coupling becomes temperature dependent due to the dynamically generated temperature dependent mass of photon. Since the photon couples with the medium through vacuum polarization, it picks up thermal corrections from the higher order coupling of radiation (photon) with matter (electron) in the medium. As a result of this interaction, QED coupling start to increase with the rise of temperature. \subsection{Low temeprature properties} One loop corrections are only possible when $T\geq 10^{10}K$ which is enough energy for a photon to produce an electron-positron pair during its propagation and let the virtual electrons couple with the medium. Using the standard method of evaluation of charge renormalization constant of QED [26], the electron charge renormalization constant can be expressed as a quadratic function of temperature in the units of electron mass. \begin{equation} Z_{3}=1+\frac{\alpha ^{2}T}{6m^{2}}^{2}. \end{equation} Absence of the first order term in $\alpha$ corresponds to the absence of the photon loops [16, 23, 29] in the first order diagram in Fig.1(as expected). The corresponding value of the QED coupling constant comes out to be \begin{equation} \alpha _{R}=\alpha (T=0)(1+\frac{\alpha ^{2}T^{2}}{6m^{2}}). \end{equation} The electromagnetic properties of media depend on the coupling of photon with the medium and are determined using techniques of quantum statistical mechanics. Then the parameters of the electromagnetic theory become a function of statistical variables such as temperature and chemical potential. One-loop corrections are not modified at low temperatures, whereas the second order corrections minutely contribute at low temperature. Incorporating the thermal loops, longitudinal and transverse components of the wavenumber due to the plasma screening mass of photon show a quadratic temperature dependence. For this purpose, we take the limit $|\mathbf{p}|\longrightarrow 0$\ to obtain \begin{equation} \kappa _{L}^{2}\longrightarrow \lim_{|\mathbf{p}|\longrightarrow 0}\Pi _{L}(0,|\mathbf{p}|,T)=\frac{2\alpha ^{2}T^{2}}{3m^2}, \end{equation} \begin{equation} \kappa _{T}^{2}\longrightarrow \lim_{|\mathbf{p}|\longrightarrow 0}\Pi _{T}(0,|\mathbf{p}|,T)=\frac{\alpha ^{2}T^{2}}{2m^2}. \end{equation} On the other hand if we set $p_{0}=0$ with $|\mathbf{p}|\longrightarrow 0$ the thermal contribution to the photon frequencies are given as: \begin{equation} \omega _{L}^{2}\longrightarrow \lim_{|\mathbf{p}|\longrightarrow 0}\Pi _{L}(| \mathbf{p}|,|\mathbf{p}|,T)=0, \end{equation} \begin{equation} \omega _{T}^{2}\longrightarrow \lim_{|\mathbf{p}|\longrightarrow 0}\Pi _{T}(| \mathbf{p}|,|\mathbf{p}|,T)=\frac{\alpha ^{2}T^{2}}{6m^2}. \end{equation} The difference between the longitudinal and transverse components of the vacuum polarization tensor in the limit $p^{2}\longrightarrow 0$, measures the dynamically generated mass of the photon. Electromagnetic properties of a medium change due to this radiatively generated effective mass. \subsection{High temeprature properties} At very high temperatures when ($T\geq10^{10}$ K or $T\geq m_e$), the two-loop level contribution of the order of $T^2/m^2_e$ is given as \smallskip \begin{equation} Z_{3}=1+\frac{2\alpha T^2}{3m^2} +\frac{\alpha ^{2}T^2}{6m^{2}}+O\left( \frac{T^4}{m^4}\right). \end{equation} \smallskip and in the limit $|\mathbf{p}|\longrightarrow 0$, we get \begin{equation} \kappa _{L}^{2}\longrightarrow \lim_{|\mathbf{p}|\longrightarrow 0}\Pi _{L}(0,|\mathbf{p}|,T)=\frac{4\alpha T^{2}}{3m^2} + \frac{2\alpha ^{2}T^{2}}{3m^2}+O\left( \frac{T^4}{m^4}\right). \end{equation} \begin{equation} \kappa _{T}^{2}\longrightarrow \lim_{|\mathbf{p}|\longrightarrow 0}\Pi _{T}(0,|\mathbf{p}|,T)=\frac{\alpha^{2} T^{2}}{2m^2}+O\left( \frac{T^4}{m^4}\right). \end{equation} It can be clearly seen from Eq.(10) that there is no first order thermal contribution to $\kappa_T$ at low temperatures, whereas Eq. (15) has an $\alpha$ dependent term. On the other hand if we set $p_{0}=0$ with $|\mathbf{p}|\longrightarrow 0$, we obtain \begin{equation} \omega _{L}^{2}\longrightarrow \lim_{|\mathbf{p}|\longrightarrow 0}\Pi _{L}(| \mathbf{p}|,|\mathbf{p}|,T)=0, \end{equation} \begin{equation} \omega _{T}^{2}\longrightarrow \lim_{|\mathbf{p}|\longrightarrow 0}\Pi _{T}(| \mathbf{p}|,|\mathbf{p}|,T)=\frac{\alpha T^{2}}{6m^2}+\frac{\alpha ^{2}T^{2}}{6m^2}+O\left( \frac{T^4}{m^4}\right). \end{equation} It shows that at low energies, the longitudinal contributuion to frequencies vanishes at the first loop level. Therefore, the plasma parameters can be found from the longitudinal behavior of photon. \section{Debye Shielding in QED Plasma} The plasma parameters in QED are calculated from $\kappa_L$ from equations (10) and (15) for the relevant ranges of temperature. Then Debye length is inversely proportional to $\kappa_L$ such that \begin{equation} \lambda_D=\frac {1}{\kappa_L} \end{equation} giving the plasma screeninng length as, \begin{equation} \lambda_D=\sqrt{\frac {3}{2}} \frac{m}{\alpha T} \end{equation} for low temperature. This shows that the plasma length will decrease with the rise in temperature, if everything else remains constant. However, this expression will be modified for extremely high temperatures and Eq. (15) will be substituted for $\kappa_L$ giving, \begin{equation} \lambda_D=\left[\frac{4\alpha T^{2}}{3m^2} + \frac{2\alpha ^{2}T^{2}}{3m^2}+O(T^4)\right]^{-2} \end{equation} The dominent contribution to the Debye shielding is also due to the first order effect. The corresponding mass of the plasmon can be calculated from $k^2=\kappa^2-\omega^2$ \section{RESULTS\ AND DISCUSSIONS} We have previously noticed [16] that the low temperature (T$\leq m_e$) effects on the vacuum polarization tensor vanish because of the absence of hot electron background. The selfmass of electron is thermally corrected due to the radiation background. However, we have found that thermal corrections to vacuum polarization tensor are nonzero at the higher loop level even at low temperatures because the cold electron loops can overlap with the hot radiation loops and pick up tiny thermal corrections. \bigskip It is worth mentioning that the sizeable thermal corrections at high temperatures (T$\geq m_e$) are not always strong enough to create QED plasma. High temperatures indicate large kinetic energy and the interaction may still be weak enough to treat the system as an ideal gas. However, if the temperature is large and the volume is small, the mutual interaction between electrons is negligibly small as compared to thermal energy of particles. Therefore, a detailed study is required to understand the behavior of such systems which may have a plasma phase for a short time at some particular temperature. However, due to the exponential dependence on temperature, we can use high or low temperature limits for smaller changes due to the quadratic dependence in above equations (see Eqns.10-18). \bigskip Thermal corrections, which lead to the modifications in electromagnetic properties of a medium itself are expected to give larger contribution at higher loop levels. However, most of these terms are finite and the order by order cancellation of singularities [12] is observed through the addition of all the same order diagrams. However, the renormalization of the theory can only be proved if covariant hot integrals are evaluated before the cold divergent integrals on the mass shell. Once the hot loop energies are integrated out, the usual vacuum techniques of Feynman parameterization and dimensional regularization can be applied to get rid of vacuum singularities. It is also worth-mentioning that all the hot corrections give a similar $T^{2}$ dependence. The incorrect order of integration gives an increased order of T due to the overlap with the vacuum divergences. This unusual behaviour of hot integrals induces additional temperature dependent divergences due to the overlap of hot and cold terms. Whereas, the usual regularization techniques of vacuum theory like dimensional regularization would only be valid in a covariant framework. Higher order terms may then violate renormalizability with the inverted order of integration. \bigskip The presence of the statistical contribution of the photon propagator modifies the vacuum polarization and hence the electron charge which leads to changes (though small) in the electromagnetic properties of the hot medium even at low temperatures. Mass, wavefunction, and charge of electron are renormalized [29] in the presence of heat bath. These renormalized values give the dynamically generated mass of photon and its effective charge in such a background modifying dielectric constant and magnetic permeability of a hot medium[29]. The longitudinal component of vacuum polarization tensor $\Pi_L$ vanishes at low temperature as $p^{2}\longrightarrow 0$. However, the transverse component has an extremely small additional thermal contribution and Eq. (7) reduces to, \begin{equation} \Pi _{T}(p)=\frac{\alpha ^{2}T^{2}}{6}, \end{equation} It is worth-mentioning that in the real-time formalism, the propagator has two additive terms, the vacuum term and the temperature dependent hot term. Therefore, in the second order perturbation theory we get a purely hot term ($~\alpha^2 T^4/m^4$), purely cold terms (~$T^0$) and the overlapping hot and cold terms ($~\alpha^2 T^2/m^2$). These terms can only be obtained in this formalism at the two-loop level. So, the overall result comes out to be a combination of all of these terms. For example, Eq.(9) can be written as, \begin{equation} \alpha _{R}=\alpha (T=0)(1+ \frac{\alpha ^{2}T^{2}}{6m^{2}}+O(\frac{T^{4}}{m^{4}})). \end{equation} We restrict ourselves in the temperature range where the last term ($~\alpha^2 T^4/m^4$), is sufficiently smaller than the second term ($~\alpha^2 T^2/m^2$), and Masood's abc functions ($a_i(m\beta)$) can be evaluated for the extreme values. The leading order contribution at low T is based on the perturbative expansion in QED and the first term should be proportional to $T^2/m^2$ in this expansion. The damping factor $exp(-m/T)$ appears in the effective action when all the contributing terms are included simultaneously. We look at all these terms one by one and work for sufficiently small range of temperature (for a few MeV) to get the simple and approximate results to evaluate some physically measurable parameters. We ignore the magnetic field effect in this calculation. It is reasonable to demonstrate the renormalizability of QED at low temperature. High densities and magnetic field, contributing to the potential energy, change the scenario [30-34] and the plasmon effect may be studied at higher temperatures but higher order effects with high magnetic field are still to be investigated. \bigskip A comparison of the one loop and two loops contributions of the transverse component of the photon frequency is shown in Figure 3. It is clear that the second order contribution (broken line) is very small as compared to the first order (solid line) contribution. \bigskip \begin{figure}[!hth] \begin{center} \begin{tabular}{c} \mbox{\includegraphics[width=4in,angle=0] {3TwoLoopPlasma.jpg}} \end{tabular} \end{center} \caption{Comparison between the first order and second order contributions to the square of photon transverse frequency $\omega_T^2$.} \end{figure} A similar behavior is seen between the first order and second order contribution of the longitudinal component of the wavenumber and is shown in Figure 4. It is clear that the second order contribution (broken line) is significantly small as compared to the first order (solid line) contribution. It is evident from Figs, (3) and (4) that the wavenumber of photon gets a much larger thermal contribution than the frequency. However, everything remains smaller than 1 up to the temperatures of 4MeV or so, and this temperature is expected a little before nucleosynthesis in the early universe. \begin{figure}[!hth] \begin{center} \begin{tabular}{c} \mbox{\includegraphics[width=4in,angle=0] {4TwoLoopPlasma.jpg}} \end{tabular} \end{center} \caption{Comparison between the first order and second order contributions to the square of the longitudinal component of the wavenumber $\kappa_L^2$.} \end{figure} A comparison between Figs.3 and 4 shows that the thermal contributions to $\kappa _L^2$ are smaller than the $\omega _T^2$. We compare the two loop contributions of $\kappa _L$ and $\omega _T$ in Fig. 5. \begin{figure}[!hth] \begin{center} \begin{tabular}{c} \mbox{\includegraphics[width=4in,angle=0] {5TwoLoopPlasma.jpg}} \end{tabular} \end{center} \caption{Comparison between the first order and second order contributions to $\kappa _L$ and $\omega _T$.} \end{figure} It has been shown that the QED coupling behaves the same way in Fig.6. The one-loop thermal correction is much more dominant as compared to the second order contribution which shows the validity of these calculations to prove the renormalizability of the theory. Moreover it indicates the validity of the calculational scheme in this range. Fig.6 shows a comparison between two loop contributions with the corresponding second order contributions of the charge renormalization constant. However, the temperature dependent contribution is smaller than other parameters. \bigskip \begin{figure}[!hth] \begin{center} \begin{tabular}{c} \mbox{\includegraphics[width=4in,angle=0] {6TwoLoopPlasma.jpg}} \end{tabular} \end{center} \caption{Comparison between the first order and second order contributions.} \end{figure} Another interesting outcome of these calculations is Debye shielding in QED plasma, which is plotted as a function of temperature in Fig.7. A comparison between the first order and the second order in $\alpha$ terms clearly demonstrates (Fig.7) that the smaller values correspond to the first order term.It indicates the range of temperatures where plasma phase can exist in QED. \bigskip \begin{figure}[!hth] \begin{center} \begin{tabular}{c} \mbox{\includegraphics[width=6in,angle=0] {7TwoLoopPlasma.jpg}} \end{tabular} \end{center} \caption{Comparison between the first order and second order contributions.} \end{figure} In this paper, the first two orders and the second order contributions are compared to validate the renormalizability of QED between $m_e\leq T\leq10m_e$. For this purpose, we plotted the charge renormalization parameter of QED comparing the first two order contributions and the second order contribution only. The quadratic temperature dependence of QED parameters dominates in the proposed temperature range and ensures the validity of renormalizability of QED. The vacuum polarization components, squares of longitudinal and transverse components of photon frequency and momentum are all quadratic functions of temperature. However, the first order contributions indicate the existence of plasmon due to the dominant radiative self-coupling of photon in this region of temperature, which is found a little before nucleosynthesis and existed throughout the nucleosynthesis. Higher temperature behavior breaks this plasma shielding due to high kinetic energy and photons do not have the ability to couple with the medium at lower temperatures. Therefore the plasmon does not exist outside this range of temperature unless the magnetic field or high density contributions [18,33,34] are incorporated. \bigskip \section{REFERENCES} \begin{enumerate} \item See for example: C. Itzykson and J. B. Zuber, \textit{Quantum Field Theory }(McGraw- Hill Inc., 1990). \item Schwinger, J. Math. Phys.\textbf 2 (1961) 407; J. Schwinger, Lecture Notes of Brandeis University Summer Institute (1960). \item Joseph I.Kapusta and Charles Gale, \textit{Finite Temperature Field Theory Principles and AApplications}( Cambridge Monographs on Mathematical Physics, 1994). \item S. Weinberg Phys. Rev.\textbf{ D9}, (1974)3357. \item L. Dolan and R. Jackiw, Phys. Rev. \textbf{D9}, (1974) 3320. \item C. Bernard, Phys. Rev. \textbf{D9}, (1974)3312. \item J. F. Donoghue and B. R. Holstein, Phys. Rev. \textbf{D28}, (1983)340; \textbf{D29}, (1983)3004(E) \item P. Landsman and Ch G. Weert, Phys. Rep. \textbf{145},(1987)141 and the references therein. \item R. Kobes, Phys.Rev.\textbf{D42}, (1990) 562. \item W.Dittrich, Phys.Rev.\textbf{ D19}, 2385 (1979). \item P.H. Cox, W.S. Hellman and A.Yildiz, Ann. Phys. \textbf{154}, 211 (1984). \item T. Kinoshita, J. Math. Phys. \textbf3 (1962) 650; T. D. Lee and M. Nauenberg, Phys. Rev. \textbf{133} (1964) 1549. \item A.Weldon, Phys. Rev.\textbf{D26}, (1982)1394. \item A.Weldon, Phys. Rev.\textbf{D26}, (1982)2789. ; \item J. F. Donoghue, B. R. Holstein, and R. W. Robinett, Ann. Phys. (N.Y.)\textbf{164}, (1985)233. \item K. Ahmed and Samina S. Masood, Ann. Phys. (N.Y.) \textbf{207}, (1991) 460. \item Samina S.Masood, Euro. Phys. J. C (2017) 77: 826. https://doi.org/10.1140/epjc/s10052-017-5398-0 \item Samina Masood and Iram Saleem, IJMPA. (2017) 32: 17500816. \item H. Gies Phys. Rev.\textbf{ D61} (2000) 085021, hep-ph/9909500). \item K. Ahmed and Samina Saleem (Masood), Phys. Rev. \textbf{D35}, (1987)1861. \item K. Ahmed and Samina Saleem (Masood), Phys. Rev. \textbf{D35}, (1987)4020. \item Samina Saleem (Masood),\ Phys. Rev. \textbf{D36}, (1987)2602. \item Mahnaz Qader (Haseeb), Samina S. Masood, and K. Ahmed, Phys. Rev. \textbf{D44}, (1991)3322. \item Mahnaz Qader (Haseeb), Samina S. Masood, and K. Ahmed,,\textit{\ }Phys. Rev. \textbf{D46}, (1992)5633. \item Mahnaz Haseeb and Samina S. Masood, Phys. Lett. \textbf{704},(2011)66. \item Mahnaz Haseeb and Samina S. Masood, IJMPA \textbf{30},(2015)1550198. \item Duane A.Dicus, David Dawn and Edward W.Kolb, Nucl. Phys.\textbf{B223}, 525(1981). \item G. A. Hajj and P. M. Stevenson, \textbf{37}. (1988) 413. \item Samina Masood, Phys.Res.Int 2014, 48913(2014)1 (arXiv:1407.1414) \item See for example Ref.[8,9], Samina S. Masood, Phys. Rev. \textbf{D48}, (1993)3250; \item Samina S.Masood, Astroparticle Physics \textbf{4}, (1995)189 . \item Samina Masood,JHEPGC , Vol.01 No.01(2015), Article ID:56270,12 (arXiv:1506.01284 [hep-ph]) \item Samina S. Masood, Phys. Rev. \textbf{D44}, (1991)3943. \item Samina S.Masood, Phys. Rev. \textbf{D47}, (1993)648. \end{enumerate} \end{document}
\section{} \usepackage{graphicx,epstopdf} \expandafter\let\csname equation*\endcsname\relax \expandafter\let\csname endequation*\endcsname\relax \usepackage{amsmath} \usepackage{graphicx} \usepackage{amsfonts} \usepackage{color} \usepackage{dcolumn} \usepackage{bm} \usepackage{amssymb} \usepackage{hyperref} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \begin{document} \newcommand{\text{\normalfont\AA}}{\text{\normalfont\AA}} \newcommand{\braket}[3]{\bra{#1}\;#2\;\ket{#3}} \newcommand{\projop}[2]{ \ket{#1}\bra{#2}} \newcommand{\ket}[1]{ |\;#1\;\rangle} \newcommand{\bra}[1]{ \langle\;#1\;|} \newcommand{\iprod}[2]{ \langle#1|#2\rangle} \newcommand{\intl}[2]{\int\limits_{#1}^{#2}} \newcommand{\logt}[1]{\log_2\left(#1\right)} \newcommand{\mc}[1]{\mathcal{#1}} \newcommand{\mb}[1]{\mathbb{#1}} \newcommand{\cx}[1]{\tilde{#1}} \newcommand{\nonumber}{\nonumber} \newcommand{\langle}{\langle} \newcommand{\rangle}{\rangle} \newcommand{\big \langle}{\big \langle} \newcommand{\big \rangle}{\big \rangle} \newcommand{\partial}{\partial} \newcommand{\cmnt}[2]{\textbf{\#\#}{\color{#1}#2}\textbf{\#\#}} \newcommand{\mb{L}_{\bar{\kappa}}}{\mb{L}_{\bar{\kappa}}} \newcommand{\mb{L}}{\mb{L}} \newcommand{\mb{A}}{\mb{A}} \newcommand{|\Delta|^{3/4}}{|\Delta|^{3/4}} \newcommand{f}{f} \newcommand{\chi}%\mathfrak{z}}{\chi \def\begin{equation}{\begin{equation}} \def\end{equation}{\end{equation}} \def\begin{eqnarray}{\begin{eqnarray}} \def\end{eqnarray}{\end{eqnarray}} \newcommand{\eqa}[1]{\begin{align}#1\end{align} \newcommand{\mbf}[1]{\mathbf{#1}} \newcommand{{i\mkern1mu}}{{i\mkern1mu}} \newcommand{\widesim}[2][1.5]{ \mathrel{\overset{#2}{\scalebox{#1}[1]{$\sim$}}} } \newcommand{\alpha}{\alpha} \newcommand{\theta}{\theta} \newcommand{\beta}{\beta} \newcommand{\phi}{\phi} \newcommand{\RN}[1] \textup{\uppercase\expandafter{\romannumeral#1}}% } \title[Fractional equation description of an open anomalous heat conduction set-up]{Fractional diffusion equation description of an open anomalous heat conduction set-up \author[1]{Aritra Kundu$^1$, C\'edric Bernardin$^2$, Keji Saito$^3$, Anupam Kundu$^4$, Abhishek Dhar$^5$} \address{$^{1,4,5}$International Centre for Theoretical Sciences, Bengaluru, India\\$^2$Universit\'e C\^ote d'Azur, CNRS, LJADNice Cedex 02, France\\$^3$Department of Physics, Keio University, Yokohama 223-8522, Japan} \ead{<EMAIL>,<EMAIL>,<EMAIL>,\\$^4$anupam.<EMAIL>,<EMAIL>, } \vspace{10pt} \begin{indented} \item[]\today \end{indented} \begin{abstract} We provide a stochastic fractional diffusion equation description of energy transport through a finite one-dimensional chain of harmonic oscillators with stochastic momentum exchange and connected to Langevian type heat baths at the boundaries. By establishing an unambiguous finite domain representation of the associated fractional operator, we show that this equation can correctly reproduce equilibrium properties like Green-Kubo formula as well as non-equilibrium properties like the steady state temperature and current. In addition, this equation provides the exact time evolution of the temperature profile. Taking insights from the diffusive system and from numerical simulations, we pose a conjecture that these long-range correlations in the steady state are given by the inverse of the fractional operator. We also point out some interesting properties of the spectrum of the fractional operator. All our analytical results are supplemented with extensive numerical simulations of the microscopic system. \end{abstract} \section{Introduction} \label{intro} Energy transport across an extended system is a fundamental non-equilibrium phenomena which is often described by the phenomenological Fourier law. This law leads to the heat equation for the evolution of the temperature field $T(y,t)$, which in one dimension is given by \begin{equation} \partial_t T(y,t) = ({\kappa}/c) \partial_y^2 T(y,t), \label{heat-diff} \end{equation} where $c$ is the specific heat capacity and ${\kappa}$ the heat conductivity (assumed, for simplicity to be temperature independent). This equation plays a central role in understanding heat transport through macroscopic materials in several contexts. However, various studies have established that for a large class of one and two dimensional systems with momentum conservation, energy transport is not diffusive but super-diffusive --- this is referred to as anomalous transport \cite{Lepri2016a,Lepri2003,Dhar2008}. There are several signatures of anomalous transport which include the super-diffusive spreading of localized heat pulses and the form of spatio-temporal correlations in equilibrium set-up as well as diverging thermal conductivity in non-equilibrium (boundary driven) set-up . Unlike diffusive transport, currently there are no general framework to understand these features of anomalous transport completely except for a recent development based on non-linear fluctuating hydrodynamics theory \cite{VanBeijeren2012,Spohn2014,Mendl2013,Popkov2016}. This theory, based on some phenomenological assumptions, provides a framework to understand the super-diffusive energy transport in a wide class of one-dimensional anharmonic classical Hamiltonian systems such as the Fermi-Pasta-Ulam-Tsingou (FPUT) system and hard-particle gases \cite{VanBeijeren2012,Spohn2014,Popkov2016,Mendl2013,Narayan2002,Das2014}. One picture that has emerged from many studies is that, for systems with anomalous transport, the standard heat diffusion equation has to be replaced by some fractional diffusion equation \cite{Lepri2016a,Bernardin2012,Lepri2009,Lepri2010,Delfini2010,Jara2015,Bernardin2016}. A particular model of anomalous transport where some rigorous results have been obtained is that of the harmonic chain whose Hamiltonian dynamics is supplemented by a stochastic part that keeps the conservation laws (volume, energy, momentum) intact --- we will refer this model as the harmonic chain momentum exchange (HCME) model. For the infinite HCME system, it was shown exactly that at equilibrium the energy current autocorrelation has a $\sim t^{-1/2}$ decay \cite{Basile2006}. It was also shown that, in contrast to Eq.~\eqref{heat-diff}, in infinite volume, the evolution of a localized energy perturbation $e(y,t)$, is described by a non-local fractional diffusion equation $\partial_t e(y,t) = -\bar{\kappa}(-\Delta)^{3/4} e(y,t)$, where $\bar{\kappa}$ is some constant which depends on microscopic parameters \cite{Jara2015}. The fractional Laplacian operator $(-\Delta)^{3/4}$ in the infinite space is defined by its Fourier spectrum: $|q|^{3/2}$ which for the normal Laplacian operator $-\Delta \equiv -\partial^2_y$ is $q^2$. While most of the studies in HCME model consider evolution in infinite systems, it is also of interest to study transport across a finite system connected to two reservoirs of different temperatures at its two ends. For diffusive systems in this set-up, the heat equation continues to describe both non-equilibrium steady state (NESS) and time-dependent properties. However, for anomalous transport, it is a priori not clear how to write a corresponding evolution equation in a finite domain. Since we expect this evolution to be governed by a fractional Laplacian which is a non-local operator, it is difficult to guess its representation in a finite system from its representation in the infinite system. Note that in the finite system one has to include the effects of the boundary conditions which are important as the operator itself is non-local. Hence, extending its definition to a finite domain is a non-trivial problem. Several studies have addressed this problem of obtaining and studying fractional diffusion description in finite domain \cite{Viswanathan2000,Zoia2007, PrivateCommunication2015}. In this paper we study heat transfer across the HCME model connected to two reservoirs at its two ends. It has been observed and proved that in this model, heat current scaling with system size is anomalous and the steady state temperature profile is inherently non-linear \cite{Lepri2016a,Lepri2009,Cividini2017}. In the present work we provide a fractional equation description of the anomalous heat transfer both in the stationary as well as in the non-stationary state. Using this fractional description we derive new results related to evolution of temperature profile, equilibrium current fluctuations and to two point correlations in NESS. Below we summarise the main results of our work along with the plan of the paper: \begin{itemize} \item In Sec.~\eqref{sec:Model} we first review previous studies on the HCME model. These studies show that the macroscopic time evolution of two-point correlations is described by a set of coupled local linear PDEs \cite{Lepri2009,Lepri2010}. Starting from these PDEs, it can be shown that they naturally give rise to an evolution equation for the temperature profile $T(y, \tau)$ \[ \partial_\tau T(y,\tau)=-\bar \kappa~\mathbb L T(y,\tau), \] governed by a fractional Laplacian $\mathbb L$ defined in a finite domain, where $\tau$ is a scaled time (see later). The operator $\mathbb L$ is defined in the domain $0 \leq y \leq 1$ through it's action \[\mathbb L \phi_n(y) = \lambda_n^{3/4} \phi_n(y)\] on the complete Neumann basis $\iprod {y}{\phi_n}=\phi_n(y)=\sqrt{2}\cos(n \pi y)$ for $n \ge 1$ and $\iprod{y}{\phi_0}=\phi_0(y)=1$ with $\lambda_n=(n\pi)^2$. Using this representation, we show that one can recover the exact results \cite{Lepri2009} for the steady state temperature and current profiles in the HCME. \item Next in Sec.~\eqref{sec:timeevolution} we discuss the time evolution of the temperature profile, starting from an arbitrary initial profile, to the long-time NESS profile. In order to solve the fractional diffusion equation with Dirichlet boundary conditions for arbitrary time we are required to find the eigenvalues and eigenvectors of the fractional operator $\mathbb L$ with Dirichlet boundary conditions. We describe an efficient procedure to compute this eigensystem. We also provide a detailed discussion of some properties of the eigensystem that distinguish them from the eigensystem of the normal Laplacian operator with the same boundary conditions. \item Inspired by the fluctuating equations for energy evolution in diffusive systems\cite{Bernardin2012a,Spohn2012}, in Sec.~\eqref{sec:Noise} we extend the definition of the fractional equation to include fluctuations and noise in equilibrium such that fluctuation-dissipation relation holds locally. \item Using the fluctuating fractional equation description, in Sec.~\eqref{sec:GreenKubo}, we first verify the validity of the equilibrium Green-Kubo relation in finite systems where we encounter some interesting mathematical identities that we establish numerically. This motivates and enables us to study the long-range correlations in NESS in Sec.~\eqref{sec:Longrange}, where we propose a conjecture on the relation between these correlations and the Green's function of the operator $\mb{L}$. \item Finally, in Sec.~\eqref{sec:conc} we conclude our paper. \end{itemize} % \section{Definition of Model and survey of earlier results} \label{sec:Model} We consider the so-called harmonic chain momentum exchange model (HCME), which considers an added stochastic component in the usual Hamiltonian dynamics of a harmonic chain. The stochastic part is such that it preserves volume, momentum and energy conservation but the other conserved variables of the harmonic chain are no longer conserved. Thus the stochastic model restores ergodicity while preserving the important conservation laws. Here we are interested in the open system where the system is driven by two Langevin-type heat baths. Specifically we consider a system consisting of $N$ particles and attached to two heat baths. The Hamiltonian plus heat bath part of the dynamics is described by the following equations \eqa{ \dot{q}_i =& ~p_i~,~~\dot{p}_i = \omega^2(q_{i+1}-2q_{i} + q_{i-1}), ~~ 1<i<N, \nonumber \\ \dot{p}_1=& ~ \omega^2(q_{2}-2q_{1}) -\lambda p_1 + \sqrt{2\lambda T_L} \eta_L, \label{eq:eom} \\ \dot{p}_N=& ~ \omega^2(q_{N-1}-2q_{N}) -\lambda p_N + \sqrt{2\lambda T_R} \eta_R ~,\nonumber } % where $\{q_i,p_i\}$, $i=1,2\ldots,N$, are the positions and momenta of the particles, $T_L, T_R$ are the temperatures of the left and the right Langevin baths and $\eta_L,\eta_R$ are Gaussian white noise terms. Additionally there is a stochastic noise, such that the momenta of nearest neighbour particles are exchanged ({\emph{i.e} $p_{i+1} \leftrightarrow p_{i}$) at a rate $\gamma$. For this model the two point correlation functions satisfy a closed set of equations. Following \cite{Lepri2010} let us denote the possible correlation matrices by ${\bf U}_{i,j}=\langle q_i q_j \rangle$,${\bf V}_{i,j}=\langle p_i p_j \rangle$, and ${\bf Z}_{i,j}=\langle q_i p_j \rangle$. One can show that the time evolution of these correlation functions is given by linear equations involving only these set of correlations and source terms arising from the boundary driving \cite{Lepri2010}. Let us also define the correlation ${\bf z}^+_{i,j}=\left({\bf Z}_{i,j}-{\bf Z}_{i-1,j}+{\bf Z}_{j,i}-{\bf Z}_{j-1,i} \right)/2$. The most interesting physical observables involve the correlations $T_i={\bf V}_{ii}$, which can be taken as the definition of local temperature and the energy current $J=\omega^2 {\bf z}^+_{i,i+1} +(\gamma/2)~({\bf V}_{i+1,i+1}-{\bf V}_{i,i})$. In the $N \to \infty$ limit, one observes that the fields $T_i$ and ${\bf z}^+_{i,j}$ have the scaling forms $T_i(t) = T(i/N,t/N^{3/2})$ and ${\bf z}^+_{i,j} = \frac{1}{\sqrt{N}} C(|i-j|)/{N}^{1/2},(i+j)/(2N),t/N^{3/2})$. In terms of the following scaling variables $x=|i-j|/{N}^{1/2}, y=(i+j)/(2N), \tau=t/N^{3/2}$, it has been shown in \cite{Lepri2010} that the fields $T(y,\tau)$ and $C(x,y,\tau)$ satisfy the following coupled set of PDEs: \eqa{ \gamma^2 \partial_x^4 C(x,y,\tau) &= \omega^2 \partial_y^2 C(x,y,\tau), \nonumber \\ \partial_y T(y,\tau) &= -2 \gamma \partial_x C(x,y,\tau)|_{x\to0}, \label{PDE}\\ \partial_\tau T(y,\tau) &= \omega^2 \partial_y C(x,y,\tau)|_{x\to0}, \nonumber } with boundary conditions $C(x,0,\tau)=C(x,1,\tau)=0,C(\infty,y,\tau)=0, \partial_x^3C(0,y,\tau)=0$ and $T(0,\tau)=T_L$ and $T(1,\tau)=T_R$ where, the domain of variables are $x \in [0,\infty)$ and $y \in [0,1]$ [note that in \cite{Lepri2010} $y \in (-1,1)$]. To study the time-evolution of the fields $C(x,y,\tau)$ and $T(y,\tau)$, one has to subtract the steady state solutions $C_{ss}(x,y)$ and $T_{ss}(y)$ of the above equations (whose explicit forms are given in \cite{Lepri2009}). The boundary conditions suggest that one expand the difference fields using the complete Dirichlet basis $\iprod {y} {\alpha_n} =\alpha_n(y) = \sqrt{2}\sin(n \pi y)$ for $n\ge 1$ \eqa{ C(x,y,\tau) -C_{ss}(x,y)= \sum_{n=1}^\infty \hat{C}_n(x,\tau) \alpha_n(y) \label{Cexp},\\ T(y,\tau) -T_{ss}(y)= f(y,\tau)=\sum_{n=1}^\infty \hat{f}_n(\tau) \alpha_n(y)~. \label{Texp} } Following \cite{Lepri2010} one then gets (see \ref{app:matrixrep}) the following matrix equation for the evolution of the components $f_n$: \eqa{ \dot{\hat{f}}_n =&-\bar{\kappa} \sum_{k=1}^\infty \mb{L}_{nk} \hat{f}_k,~~~~n=1,2,\ldots,\infty,~ \\ ~\text{where}, ~ &\mb{L}_{nk}= \left[\mc{T} \Lambda^{3/4} \mc{T^\dagger} \right]_{nk}, \label{Lnk} } with $\mc{T}_{nl}=\iprod{\alpha_n}{\phi_l}=\int_0^1 dy \alpha_n(y) \phi_l(y)$, where $\phi_m(y) = \sqrt{2}\cos(m \pi y)$ for $m > 0$, $\phi_0(y) = 1$ and $\Lambda_{m l} = \lambda_{m}\delta_{m l}$ is a diagonal matrix with $\lambda_n=(n\pi)^2$. The constant $\bar{\kappa} = {\omega^{3/2}}/{(2\sqrt{2 \gamma})}$. Therefore, the function $f(x,\tau)$ with homogeneous boundaries $f(0,\tau) = f(1,\tau) = 0$ satisfies, \eqa{ \partial_\tau f(y,\tau) = -\bar{\kappa} \mb{L} f(y,\tau)\label{fde1} .} From Eq. \eqref{Lnk}, one notices that $\mb L_{nk}$ can be written as \[\mb{L}_{nk}=\bra{\alpha_n}\mb{L} \ket{\alpha_k}=\bra{\alpha_n}\left[\sum_{m=0}^\infty \lambda_m^{3/4} \ket{\phi_m}\bra{\phi_m}\right] \ket{\alpha_k},~~\forall~~n,k= 1,2,\ldots, \infty\] which allows us to identify the action of the operator $\mb L$ acting on the set of basis functions $\phi_m$ (which satisfy Neumann boundary conditions): \eqa{\mb L \ket{\phi_m}= \lambda_m^{3/4} \ket{\phi_m}~. \label{L-in-phi}} It is important to notice that the above representation of the operator $\mathbb L$ is not the ``spectral fractional Laplacian with Dirichlet boundary conditions" which would consist to replace $\phi_n$ by $\alpha_n$ in \eqref{L-in-phi}. This definition has been mentioned in \cite{Lepri2016a} and a more mathematically rigorous derivation has been obtained \cite{PrivateCommunication2015}. The above results imply that the temperature field $T(y,\tau)$ evolves according to the fractional equation \eqa{ \partial_\tau T(y,\tau) = -\bar{\kappa} \mb{L} T(y,\tau)= -\mb{L}_{\bar{\kappa}} T(y,\tau)~, \label{fde} } where we have defined $\mb{L}_{\bar{\kappa}}=\bar{\kappa} \mb{L}$ and the steady state is required to satisfy the condition $\mb{L}_{\bar{\kappa}} T_{ss}(y) = 0$. To describe the evolution of the temperature profile, one is specifically interested in finding the eigenvectors of the operator $\mb L$ which satisfy Dirichlet boundary conditions. This can be obtained by diagonalizing the infinite-dimensional matrix in Eq.~(\ref{Lnk}). Let the eigenvector components of this matrix be denoted by $\psi^{(m)}_n$, corresponding to eigenvalue $\mu_n$, so that $\sum_k \mb L_{mk} \psi^{(k)}_n= \mu_n \psi^{(m)}_n$. Then the eigenvector in the position basis is given by $\psi_n(y)=\sum_m \psi_n^{(m)} \alpha_m(y)$. In Sec.~\ref{sec:timeevolution} we provide an alternate and more efficient method of computing eigenvalues and eigenvectors. This method involves finding roots of a transcendental equation and avoids diagonalization of infinite dimensional matrices. We also discuss various properties of the spectrum there. We now describe several results that follow for the steady state and the time evolution towards it. \subsection{Steady state results} Let us write the steady state temperature in the form \begin{equation} T_{ss}(y) = \overline{T} + \delta T ~\Theta(y), \end{equation} where $\overline{T} = {(T_L+T_R)}/{2}$, $\delta T = T_L -T_R$ and the function $\theta(y)$ satisfies the boundary conditions, $\Theta(0) = 1/2$, $\Theta(1) = -1/2$~. Then expanding $\Theta(y) = \sum_n \hat{\Theta}_n \phi_n(y) $, the stationarity condition $\mb{L}_{\bar{\kappa}} \Theta =0 $ along with Eq.~\eqref{L-in-phi} gives \eqa{ \sum_n \lambda_n^{3/4} \hat{\Theta}_n \phi_n=0. \label{stateq} } Now we note the identities (see \ref{app:cossumidentity}), which have to be understood in a distributional sense: \eqa{ \sum_{n\; odd} \phi_n(y) = 0,~ \sum_{n\; even} \phi_n(y) = -{1}/{\sqrt{2}} \label{cosid}.} Using these and the boundary conditions $\Theta(0)=-\Theta(1) = \frac{1}{2}$ we finally get \eqa{ \Theta(y) &= \sum_{n \; odd} \frac{c}{\lambda_m^{3/4}} \phi_m(y), \nonumber \\ {\rm with}~~c&= \frac{\pi^{3/2}}{[\sqrt{8} -1] \zeta(3/2)}, } where $\zeta(s)$ is the Riemann-Zeta function. The temperature profile matches with the one presented in \cite{Lepri2016a,Lepri2009, Cividini2017}: \eqa{ T_{ss}(y) =& \overline{T} + \delta T \frac{ \pi^{3/2}}{[\sqrt{8}-1 ] \zeta(3/2)} \sum_{n \; odd} \frac{\phi_n(y)}{\lambda_n^{3/4}}. \label{eq:steadystate}} A comparison of the above equation with the microscopic simulation of the system Eq.~\eqref{eq:eom} in Fig.~\eqref{fig:tempprofile} shows a very good agreement. The systematic differences are due to finite size effects, as was already noted in \cite{Lepri2009}. % We next consider the steady state current. First, we observe that the fractional Laplacian $\mb{L}_{\bar{\kappa}}$ can be expressed in the form of a divergence, namely in the form $\mb{L}_{\bar{\kappa}}=\bar{\kappa} \partial_y \mb{A}$ where the operator $\mb{A}$ is defined through the following action on Neumann basis vectors \eqa{ \mb{A} \phi_n(y) = \lambda_n^{1/4} \alpha_n(y)~.\label{eq:current} } We then see that \eqref{fde} is in the form of a continuity equation $\partial_\tau T(y,\tau)= -\partial_y j(y,\tau)$ with the non-local energy current defined as $j(y,\tau)=\bar{\kappa} \mb{A} T(y,\tau)$. Using this definition of the current and the steady state temperature profile in \eqref{eq:steadystate} we immediately get the steady state current as \eqa{ \frac{j}{\delta T}= \frac{\bar{\kappa} \mb{A} T_{ss}(y)}{\delta T} = \frac{\bar{\kappa} c}{2 \sqrt{2}}~, \label{eq:sscurrent} } where we used the identity $\sum_{n \in {\rm odd}} \alpha_n(y)/\lambda_n^{1/2}=1/(2 \sqrt{2})$ \eqref{app:cossumidentity}. Note that this gives us the scaled current while the actual current is given by $J=j/\sqrt{N}$, in agreement with results obtained in \cite{Lepri2009}. \begin{figure} \centering \includegraphics[width=0.7\linewidth]{./Temp_compare_3-eps-converted-to.pdf} \caption{Temperature profile from Eq.~\eqref{eq:steadystate}(solid black line) compared with direct numerical simulations of microscopic system for system sizes $N = 128,256,512$. In the inset the difference between Eq.~\eqref{eq:steadystate} and numerical simulations is plotted for various system size. } \label{fig:tempprofile} \end{figure} \section{Time evolution of temperature profile}\label{sec:timeevolution} The fractional Laplacian equation \eqref{fde} allow us to study the time evolution of the temperature profile, starting from given initial and boundary conditions, and the eventual approach to the steady state at large times. Here we address the problem of describing the system's time evolution. As before, the temperature profile at any time $\tau$ in the form $ T(y,\tau)=T_{ss}(y)+f(y,\tau) $, where again $f(y,\tau)$ satisfies Eq.~\eqref{fde} but with vanishing Dirichlet boundary conditions, $f(0,\tau) = f(1,\tau) = 0$. Let $\{ \psi_n\}$ be the eigenvectors with corresponding eigenvalues $\mu_1 < \mu_2 < \mu_3 \dots$ of $\mb{L}$ , satisfying the equation \eqa{ \mb{L} \psi_n(y) = \mu_n \psi_n(y) \label{eq:fraceval} } and boundary conditions $\psi_n(0)=\psi_n(1)=0$. It can be shown that the operator $\mb{L}$ has a non-degenerate and positive spectrum (see below). We can then immediately write the solution for $f(y,\tau)$ as \eqa{f(y,\tau) = \sum_{n=1} \hat{f}_n(0) e^{-\bar{\kappa}\mu_n \tau } \psi_n(y), \label{eq:timeevolution} \\ ~ {\rm where} ~~ \hat{f}_n(0) = \int_{0}^{1} dy ~f(y,0) \psi_n(y), \nonumber } are ``fractional-Fourier coefficients" for the initial field $f(y,0)$. In the first section we outlined the procedure followed in \cite{Lepri2010} to find the Dirichlet eigenfunctions expanding the eigenfunctions $\psi_n$ in the orthogonal basis of $\{ \alpha_l \}_{l\ge 1}$ as $\psi_n(y) = \sum_{l\ge 1} \xi_{nl} \alpha_l(y)$. We show here that much simplification and better accuracy is achieved if one expands $\psi_n$ directly in the Neumann basis $\{\phi_m\}_{m\ge 0}$. \eqa{ {\psi}(y) = \sum_m \hat{\chi}%\mathfrak{z}}_m {\phi_m}(y). } From Eq.~\eqref{eq:fraceval}, and using the definition of $\mb{L}$ in Eq.~\eqref{L-in-phi}, we have \eqa{ \sum_{m\ge 0} (\mu - \lambda_m^{3/4}) \hat{\chi}%\mathfrak{z}}_m {\phi_m}(y) = 0. \label{eigeqn} } There are two sets of solution for this equation. The first set is given by \eqa{ \hat{\chi}%\mathfrak{z}}_0= - \frac{b}{\sqrt{2}\mu},~ \hat{\chi}%\mathfrak{z}}_{2k} = \frac{b}{\lambda_{2k}^{3/4} - \mu},~~ k \ge 1,~~ \hat{\chi}%\mathfrak{z}}_{2k+1} = 0,~~ k \ge 0~, \label{SolS1} } where we have made use of the identity $\sum_{m=1}^\infty \phi_{2m}(x)=-1/\sqrt{2}$. The second solution set is given by \eqa{ \hat{\chi}%\mathfrak{z}}_{2k+1} = \frac{b}{\lambda_{2k+1}^{3/4} - \mu},~~ k \ge 0, ~~~ \hat{\chi}%\mathfrak{z}}_{2k} = 0,~~ k \ge 0,\label{SolS2} } where we have used the identity $\sum_{m=0}^\infty \phi_{2 m+1}(y)=0$ \eqref{app:cossumidentity}. So far, $b$ and $\mu$ are un-determined. We now use the Dirichlet boundary condition $\psi(0) = \hat{\chi}%\mathfrak{z}}_0 + \sqrt{2} \sum_{k\ge1} \hat{\chi}%\mathfrak{z}}_{2k} + \sum_{k\ge0} \hat{\chi}%\mathfrak{z}}_{2k+1} = 0$. From our first solution set Eq.~\eqref{SolS1} we then get the following equation satisfied by $\mu$ \eqa{ \sum_{k\ge1} \frac{1}{\lambda_{2k}^{3/4} - \mu} = \frac{1}{2\mu}~. \label{eq:eval1} } Similarly, from the second solution set Eq.~\eqref{SolS2}, we get \eqa{ \sum_{k\ge0} \frac{1}{\lambda_{2k+1}^{3/4} - \mu} = 0~. \label{eq:eval2} } The solution of either of the above two equations gives us the required eigenvalue, while Eqs.~\eqref{SolS1}-\eqref{SolS2} provide us with the corresponding eigenfunction, with the constant $b$ fixed by normalization. We label the first set of solutions by $\mu_{2n+1},\psi_{2n+1}$, $n\ge 0$ and the second set by $\mu_{2n},\psi_{2n+2}$, $n\ge 0$. From the structure of the eigenvalue equations it is clear that the roots are ordered set of numbers such that $\lambda_{2n}^{3/4} < \mu_{2n+1} < \lambda_{2n+2}^{3/4}$ and $\lambda_{2n-1}^{3/4} < \mu_{2n} < \lambda_{2n+1}^{3/4}$. % Finally, introducing the notation, $\iprod{f}{g} = \int_0^1 dx' f(x')g(x')$, such that $\iprod{x}{\psi_n} = \int_0^1 dx \delta(x-x')\psi_n(x') = \psi_n(x)$, the eigenvectors can now be written explicitly as \eqa{ \ket{\psi_{2n+1}} &= D_{2n+1} \left( -\frac{1}{\sqrt{2}\mu_{2n+1}}\ket{\phi_0} + \sum_{m\ge1} \frac{1}{\lambda_{2m}^{3/4} -\mu_{2n+1}} \ket{\phi_{2m}} \right), \\ \ket{\psi_{2n+2}} &= D_{2n+2} \left( \sum_{m\ge0} \frac{1}{\lambda_{2m+1}^{3/4} -\mu_{2n+2}} \ket{\phi_{2m+1}} \right) , \label{eveceta} } where $D_{n}$, found from the normalizing condition $\iprod{\psi_{n}}{\psi_{n}} =1$, is explicitly given as, \eqa{ D_{2n+1} &= \left[\frac{1}{2\mu^2_{2n+1}} + \sum_{m\ge1} \frac{1}{(\lambda_{2m}^{3/4} -\mu_{2n+1})^2}\right]^{-1/2},\nonumber\\ D_{2n+2} &= \left[\sum_{m\ge0} \frac{1}{(\lambda_{2m+1}^{3/4} -\mu_{2n+2})^2}\right]^{-1/2}~. } Thus, as promised, we have managed to obtain a much efficient method for computing the Dirichlet spectrum of the fractional operator $\mb{L}$. The roots of the eigenvalue equations \eqref{eq:eval1}-\eqref{eq:eval2} are solved numerically using Newton-Raphson method scanning in between these intervals. This procedure gives a fast and efficient way to compute the eigenvector while avoiding diagonalizing infinite dimensional matrices. For large $k$, we have, $\mu_k \approx \lambda_k^{3/4}$. This procedure can be generalized to a fractional operator defined through the equation \eqa{ \mb{L}^{(\beta)} \phi_n(y) = \lambda_n^{\beta} \phi_n(y), \label{Lbeta} } for arbitrary $\beta$. For diffusive case ($\beta = 1$) one can obtain exact results and recover the expected result $\mu^{(\beta=1)}_{k} = \pi^2 k^2$ and $\psi_k(y)=\alpha_k(y)$. \subsection{Properties of Dirichlet eigensystem of the fractional operator in bounded domain} \begin{figure} \centering \includegraphics[width=0.7\linewidth]{./Eigenvalues_v2-eps-converted-to.pdf} \caption{Eigenvalues computed from Eq.~\eqref{eq:eval1} and \eqref{eq:eval2} plotted (blue dots) in log-log scale. Number of basis state used to approximate the function is $600$. For large $n$, $\mu_n \sim (n\pi)^{3/2}$, i.e. the Dirichlet and Neumann eigenvalues are same. For small $n$ there is a systematic difference between the two. A straight line of exponent $x^{3/2}$ (black dot) is plotted alongside. In the inset we plot, $\log(1-\mu_n/\lambda_n^{3/4})$ vs $\log(n)$, which characterizes the difference between the Dirichlet and Neumann boundary eigenvalues. For large $n$ the value of this function goes to zero with slope $1$, suggesting he difference between the two decreases linearly with $n$. The red dashed line shows that it decays with an inverse power law of exponent $1$. } \label{fig:eigenvals} \end{figure} \begin{figure} \centering \includegraphics[width=0.7\linewidth]{./eigenvectors_large_3-eps-converted-to.pdf} \caption{The first six eigenvectors of fractional operator, $\psi_n(y)$, (black) as compared to corresponding eigenfunctions of Laplacian i.e. $\sin$ functions (blue dotted). The eigenstates are different from corresponding $\sin$ functions near the boundaries even for large $n$. These eigenfunctions are computed by summing over $600$ basis states.} \label{fig:eigenvectors} \end{figure} The numerical values of the computed eigenvalues are plotted in Fig.~\eqref{fig:eigenvals} in log-log scale, where we find that for large $n$ $\mu_n \approx (n \pi)^{3/2}$, while for smaller values $n$, there is a systematic deviation from the scaling due to the fact we are now working in a bounded domain. The first three eigenvalues ($\mu_n$) are approximately $\mu_1 \approx 2.75,\mu_2 \approx 12.02, \mu_3 \approx 24.22$. The first eigenvalue we have $|\mu_1-\pi^{3/2}|/\pi^{3/2} \approx 0.5046$ (see inset in Fig.~\eqref{fig:eigenvals}). This eigenvalue spectrum is expected to be identical to that in \cite{Lepri2010}, upto a constant factor (see discussion in previous section). The first few numerically computed eigenvectors are shown in Fig.~\eqref{fig:eigenvectors}. The eigenvectors are similar to $\sin$ functions but have divergent derivatives near the left and right boundaries. In order to compare it with corresponding $\sin$ functions, we plot in Fig.~\eqref{fig:eigenvectorsprop} the overlap of integral between $\psi_n(y)$ and $\sqrt{2}\sin(n \pi y)$ defined as $I_n=1- \int_0^1 \psi_n(y)\sqrt{2}\sin(n \pi y) ~dy$. This increases and saturates to a particular value, suggesting that the wave functions are quite different from $\sin$ functions even for large $n$. Also the eigenfunctions show a non-analytic behavior at the boundaries, for example near the left boundary one finds $\lim_{y\to 0^+}\psi_n(y) \sim \sqrt{y}$ (see Fig.~\ref{fig:eigenvectorsprop}b), in contrast to $\sin$-functions for which $\lim_{y\to 0^+}\sin(n \pi y) \sim y$. \begin{figure} \centering \includegraphics[width=0.47\linewidth]{./overlap-eps-converted-to.pdf} \includegraphics[width=0.47\linewidth]{./boundary_scaling_3-eps-converted-to.pdf} \caption{(a)(Left) To quantify the similarity between $\psi_n(y)$ and $\sqrt{2} \sin(n \pi y)$, we plot the overlap integral, $I_n=1- \int_0^1 \psi_n(y)\sqrt{2}\sin(n \pi y) ~dy$ . For large $n$ this seems to be saturating to a finite value, suggesting that the eigenfunctions $\psi_n$ are quite different from $\sin$ functions. (b)(right) Scaling at boundaries of the eigenvectors in log-log scale shows that at the boundaries, the wave-function scales as $\sqrt{y}$. } \label{fig:eigenvectorsprop} \end{figure} The eigenspectrum of fractional operator in bounded domain has been discussed earlier in the literature, using somewhat phenomenological approaches \cite{Zoia2007,Buldyrev2001,Buldyrev2001a,Chen2004}. It is not clear if those approaches can be related to that presented in this paper. \subsection{Comparison of time evolution formula with numerical simulations of the HCME model} We now compare the prediction from Eq.~\eqref{eq:timeevolution}, with $\bar{\kappa} =1/(2\sqrt{2})$, with results from direct microscopic simulations, described by Eq.~\eqref{eq:eom} with the additional stochastic exchange dynamics. Initially the system of size $N$ is prepared in a step initial condition, given by \eqa{T_i &= T_L ,~ 1\le i <N/2, \nonumber\\ &= T_R,~ N/2\le i\le N+1. } At large times it reaches a steady state described by Eq.~\eqref{eq:steadystate}. At various intermediate times, we plot the function $\Theta(y,\tau) = T(y,\tau) - \overline{T} = T_{ss}(y)+f(y,\tau) - \overline{T}$, such that $\Theta(0,\tau) = 1/2 =-\Theta(1,\tau)$. In Fig.~\eqref{fig:timeevolution} we show the temperature profile at intermediate times from microscopic simulation with scaled space ($y=i/N$) and times ($\tau=t/N^{3/2}$) for various system sizes. We note that with increasing system size, the data converges to the prediction from Eq.~\eqref{eq:timeevolution}. The difference between the numerical profiles and the predicted theoretical profile is shown in the inset. As we increase the system size, this difference systematically decreases. We also demonstrate that using standard Dirichlet $\sin$-functions, instead of the $\psi$-functions, leads to significant differences, especially near the boundaries. \begin{figure} \centering \includegraphics[width=0.45\linewidth]{./evolve_3-eps-converted-to.pdf} \includegraphics[width=0.45\linewidth]{./evolve_sin_3-eps-converted-to.pdf} \caption{The time evolution of temperature starting from an initial step profile. The function $\Theta(y,\tau) = T(y,\tau) - \overline{T} = T_{ss}(y) + f(y,\tau) -\overline{T}$ is plotted and compared with numerical simulations. In the left figure, dashed lines indicate simulation results for the time-evolution, for system sizes $N=128$ (red), $N=256$ (blue), $N=512$ (magenta). The solid lines at different scaled times ($\tau$) are generated from Eq.~\eqref{eq:timeevolution} by summing over $600$ basis states. (right) The same, but now with the theoretical curves computed using the $\sin$-functions instead of the $\psi$-functions, and eigenvalues $\lambda_n^{3/4}$ instead of $\mu_n$. We notice that they do not match well with simulations, specially the deviations are prominent near the two boundary.} \label{fig:timeevolution} \end{figure} \section{Adding noise satisfying fluctuation dissipation to describe equilibrium fluctuations in finite system} \label{sec:Noise} In \cite{Bernardin2012a}, the harmonic chain with random momentum flips (HCMF model) was studied. In the HCMF, the stochastic dynamics flips the momentum of the particle and is embedded in the Hamiltonian dynamics such that the macroscopic dynamics is diffusive. It was shown that the equilibrium energy fluctuations $e(x,t)=E(x,t)-\langle E(x,t)\rangle$, where $E(x,t)$ is the local energy of the system at time $t$, satisfies the noisy diffusion equation $\partial_t e(x,t) = \partial_{x}^2e(x,t) + \partial_x( D T(x,t) \eta(x,t))$, with $\eta$ a space-time mean zero white noise. As a note of caution, from here onwards, we use a different notation than that of the previous sections with $\{x,y\} \in [0,1]$, and $t$ is, in general, referred to a scaled time. The aim of this section is to establish a fractional fluctuating equation for the HCME model, which has anomalous diffusion properties. Using this equation, we establish a Green-Kubo formula relating the equilibrium current fluctuations to the non-equilibrium current. Next, we discuss the long-range correlations and conjecture a form for the long-range correlations of energy and test it using simulations. The generalized equation, which we hypothesize in equilibrium at temperature $T$ is \eqa \partial_t \ket{e_t} &= -\mb{L}_{\bar{\kappa}} \ket{e_t} + \sqrt{ 2 \bar{\kappa}} \nabla (B T \ket{\eta_t}), \label{eq:fluctuatingeq} } where $\eta(x,t)$ is a white Gaussian noise with $\big \langle \eta(x)\big \rangle=0$, $\big \langle \eta(x,t) \eta(y,t') \big \rangle = \delta(x-y)\delta(t-t')$ and $ \mb{L}_{\bar{\kappa}}$ is the fractional Laplacian as defined in Eq.~\eqref{fde}. The explicit form for the operator $BB^\dagger$ is established through the requirement that energy fluctuations must respect the fluctuation dissipation (FD) in equilibrium. We define the Green function satisfying \eqa{\partial_t G_t = -\mb{L}_{\bar{\kappa}} G_t, ~ \langle x| G_0 |x' \rangle= G^{xx'}_0=\delta(x-x'), \label{eq:greenfunction}} with Dirichlet boundary conditions in $x \in [0,1]$. This can then be easily expressed in terms of the basis states $\{\psi_n\}_{n\ge 1}$ as $ G^{xx'}_t = \sum_{n=1} \psi_n(x)\psi_n(x') e^{-\bar{\kappa} \mu_n t} $. The long-time solution to Eq.~\eqref{eq:fluctuatingeq} is then given by \eqa{e(x,t)=& \sqrt{ 2 \bar{\kappa}} \int_{-\infty}^t ds \braket{x}{G_{t-s}}{\nabla (BT\eta_s)},\nonumber\\ =&- \sqrt{ 2 \bar{\kappa}} \int_{-\infty}^t ds \braket{x}{\nabla G_{t-s}}{(BT\eta_s)}.} % The equal time correlation function in equilibrium defined as $C_{\rm eq}(x,y) = \big \langle e(x,t) e(y,t) \big \rangle $ then is given as \eqa{C_{\rm eq}(x,y) =& 2 \kappa \int_{-\infty}^t ds ~\int_{-\infty}^t ds' \big \langle \braket{x}{\nabla G_{t-s}}{BT\eta_s} \braket{\eta_{s'} T B^\dagger }{\nabla G_{t-s'}}{y} \big \rangle ,\nonumber \\ =& ~ 2\bar{\kappa} T^2 \int_{-\infty}^t ds ~ \braket{x}{\nabla G_{t-s}BB^{\dagger}\nabla G_{t-s} } {y},\\ =& - 2\bar{\kappa} T^2 \int_{-\infty}^t ds \braket{x}{ G_{t-s}\nabla BB^{\dagger}\nabla G_{t-s} } {y} ,\nonumber} where the statistical average is used and we integrate out the space time white noise to give $ \big \langle \iprod{x'}{ B\eta_s}\iprod{\eta_{s'} B^\dagger}{y'} \big \rangle = \big \langle {B\eta(s)} B\eta (s') \big \rangle = \delta(s-s') BB^\dagger(x',y')$ followed by an integration by parts. Here, the big angles, $\big \langle \dots \big \rangle$ denote average over space-time white noise profiles whereas $\langle..|$ and $|..\rangle$ denote the bra-ket notation, \emph{e.g.} $\langle x|e \rangle =e(x,t)$. If we identify $ -\bar{\kappa} \nabla BB^{\dagger}\nabla = \mb{L}_{\bar{\kappa}}$, and using Eq.~\eqref{eq:greenfunction} we recover FD relation in equilibrium \eqa{ C_{\rm eq}(x,y) =& ~ T^2 \int_{-\infty}^t ds ~\left( \braket{x}{ G_{t-s}\mb{L}_{\bar{\kappa}} G_{t-s} }{y} + \braket{y}{ G_{t-s}\mb{L}_{\bar{\kappa}} G_{t-s} }{x} \right),\nonumber \\ =&~ T^2 \int_{-\infty}^t ds ~\partial_s \braket{ x}{G_{t-s}G_{t-s} }{y} = ~T^2 \delta(x-y), } where we used the fact that changing $x \leftrightarrow y$ would not change the correlation function due to time reversal symmetry of the microscopic dynamics. The operator $BB^\dagger$ can consistently be defined on a function $g(x)$, expanded in $\{\alpha_n\}_{n\ge 1}$ basis, as $g(x) = \sum_n \hat{g}_n \alpha_n(x)$. Again, using the definition of $\mb{L}_{\bar{\kappa}}=-\bar{\kappa} \nabla BB^{\dagger}\nabla$ in Eq.~\eqref{L-in-phi}, we define the symmetric operator $BB^\dagger$ as, \eqa{ \int_0^1 dx' BB^\dagger(x,x') g(x') = \sum_{n=1}^{\infty} \frac{1}{(\lambda_n)^{1/4}} \hat{g}_n \alpha_n(x). \label{eq:BBdagger}} % Note that we do not assume anything about the form of the operator $B$, which would be important if we were to study non-equilibrium phenomena where temperature is not constant in space. The connection between the $\mathbb{L}$ operator with the $BB^\dagger$ allows one to identify the current (through continuity equation) as \[ j(x,t)= -\bar{\kappa} \int_0^1 dx'~ BB^\dagger(x,x') \partial_{x'}e(x',t). \] Note that the above equation is a linear response relation, but in contrast to the diffusive case, this relation is non-local. Such non-local linear response relation have recently been reported in \cite{Cividini2017}, where an alternate series representation of the kernel $BB^\dagger(x,x')$ has been provided for HCME model with general boundary conditions. In \ref{app:BBdaggergen}, we show that the spectral representation in Eq.~\eqref{eq:BBdagger} is completely consistent with the series representation in \cite{Cividini2017} for fixed boundary condition. \subsection{Spatio-temporal equilibrium energy correlations} We compute the two time spatio-temporal energy correlations in equilibrium defined as $C_{\rm eq}(x,t,y,t') = \big \langle e(x,t) e(y,t') \big \rangle$ and show that at large times it is given in terms of the Green functions. The two time correlations can be analogously written down as, % \eqa{C_{\rm eq}(x,t,y,t') =&2 \bar{\kappa} \int_{-\infty}^t ds ~\int_{-\infty}^{t'} ds' \big \langle \braket{x}{\nabla G_{t-s}}{BT\eta_s} \braket{\eta_{s'} T B^\dagger }{\nabla G_{t'-s'}}{y} \big \rangle ,} % % % % Taking $t > t'$, and performing the $t$ integral we have, \eqa{ C_{\rm eq}(x,t,y,t') =& ~ -2 \bar{\kappa} T^2 \int_{-\infty}^{t'} ds ~ \braket{x}{ G_{t-s}\nabla BB^{\dagger}\nabla G_{t'-s} } {y} \theta (t-t') , \nonumber } where $\theta(t)$ is the Heaviside theta function. Proceeding as before and identifying $-\bar{\kappa} \nabla BB^{\dagger}\nabla = \mb{L}_{\bar{\kappa}}$ and interchanging $x,y$ \eqa{C_{\rm eq}(x,t,y,t') =& ~T^2 \int_{-\infty}^{t'} ds \left( \braket{x}{ G_{t-s}\mb{L}_{\bar{\kappa}} G_{t'-s} }{y} + \braket{y}{ G_{t-s}\mb{L}_{\bar{\kappa}} G_{t'-s} }{x} \right),\nonumber \\ =&~ T^2 \int_{-\infty}^{t'} ds \partial_s \braket{ x}{G_{t-s}G_{t'-s} }{y} = ~T^2 G^{xy}_{t-t'}\theta(t-t'). } Along with a similar term for $t<t'$, we can write the two time correlations as, \eqa{C_{\rm eq}(x,t,y,t') = \bra{x} T^2 G_{t-t'} \theta (t-t') + T^2 G_{t'-t} \theta (t'-t) \ket{y} \label{eq:twotimeenergycorr}.} \subsection{Current fluctuations in equilibrium}\label{sec:GreenKubo} Here we define the fluctuating current in the system and then establish Green-Kubo relation for the system connecting the equilibrium current fluctuations and non-equilibrium current in the system. We expect that since the total energy in the isolated system is conserved, the energy flow across the system must be in continuity form $\partial_t e(x,t) + \partial_x j(x,t) = 0 $. Along with the definition of current in Eq.~\eqref{eq:current}, the fluctuating current operator is defined as, \eqa{\ket{ j_t} = \bar{\kappa} \mb{A} \ket{e_t} - \sqrt{2\bar{\kappa}} \ket{B T \eta_t} . \label{eq:fluccurrent}} From previous section, it follows that the definition of current operator as $\mb{A} = -BB^\dagger \nabla$. We also note that since the current operator is odd in derivatives, the adjoint current operator has the property, $\mb A^\dagger = -\mb A$. Now we expect that \cite{Kundu2009} the second moment of equilibrium total current fluctuations is related to the current in NESS through the Green-Kubo formula. A precise statement is: \eqa{ \lim_{\tau \to \infty} \frac{\langle q^2 \rangle_{\delta T=0}}{2\tau T^2 } = \lim_{\delta T \to 0} \frac{j}{\delta T}, \label{eq:GKformulaA} } where $q(\tau) = \int_{0}^{\tau}dt \int_0^1 dx j(x,t) $. In order to verify this relation, we first express $\langle q^2 \rangle$, in terms of the integrals of the unequal time current correlations: \eqa{ \frac{\langle q^2 \rangle_{\delta T=0}}{\tau } =& \frac{1}{\tau } \int_{0}^{\tau} dt \int_{0}^{\tau} dt' \int_0^1 dx \int_0^1 dy \big \langle j(x,t) j(y,t')\big \rangle .\label{eq:GKformula} } \\ Using Eq.~\eqref{eq:fluccurrent} the current correlations can be split into four parts: \eqa{ \big\langle j(x,t) j(y,t')\big\rangle =& \underbrace{\bar{\kappa}^2 \big \langle \bra{x} \mb{A} \projop{e_t}{e_{t'}} \mb{A}^\dagger \ket{y}\big \rangle}_{\RN{1}} + \underbrace{2 \bar{\kappa} T^2 \braket{x}{B B^\dagger}{y}}_{\RN{2}}\delta(t-t') \label{eq:currentcorrtwotime} \\ -& \underbrace{\sqrt{2} \bar{\kappa}^{3/2} \big \langle \braket{x} {\mb{A}}{e_t}\iprod{\eta_{t'}T B^\dagger }{y} \big \rangle}_{\RN{3}} -\underbrace{\sqrt{2} \bar{\kappa}^{3/2} \big \langle \iprod{x}{BT\eta_t }\braket{e_{t'}}{\mb{A}^\dagger}{y} \big \rangle}_{\RN{4}} .\nonumber } Part $\RN{3}$ in the above equation can be simplified to \eqa{ \sqrt{2} \bar{\kappa}^{3/2} \big \langle\braket{x} {\mb{A}}{e_t}\iprod{\eta_{t'}T B^\dagger}{y} \big \rangle = &~ 2\bar{\kappa}^2 \int_{-\infty}^t ds \big \langle \braket{x} {\mb{A} G_{t-s}} { \nabla (BT \eta_s)} \iprod{\eta_{t'}T B^\dagger}{y} \big \rangle ,\nonumber \\ =& - T^2 2\bar{\kappa}^2 \braket{x} {(\mb{A} \nabla G_{t-t'})BB^\dagger}{y} \theta(t-t'),\nonumber \\ =& T^2 2\bar{\kappa}^2 \bra{x} \mb{A} G_{t-t'} \mb{A}^\dagger \ket{y} \theta(t-t'). } Similarly part $\RN{4}$ is given by \eqa{ \sqrt{2} \bar{\kappa}^{3/2} \big \langle\iprod{x}{BT\eta_t }\braket{e_{t'}}{\mb{A}^\dagger}{y} \big \rangle = &~ 2\bar{\kappa}^2 T^2 \int_{-\infty}^{t'} ds \big \langle \iprod{x}{ B \eta_{t}} \braket { \eta_s (\nabla B)^\dagger } { G_{t'-s} \mb{A}^\dagger}{y} \big \rangle ,\nonumber \\ =& -T^2 2\bar{\kappa}^2 \braket{x} {BB^\dagger \nabla G_{t'-t} \mb{A}^\dagger}{y} \theta(t'-t),\nonumber \\ =& T^2 2\bar{\kappa}^2 \braket{x} {\mb{A} G_{t'-t}\mb{A}^\dagger}{y} \theta(t'-t),\nonumber } while part $\RN{1}$, on using \eqref{eq:twotimeenergycorr}, gives \eqa{ \bar{\kappa}^2 \big \langle \bra{x} \mb{A} \projop{e_t}{e_{t'}} \mb{A}^\dagger \ket{y} \big \rangle=T^2 \bar{\kappa}^2\left[ \bra{x} \mb{A} G_{t-t'}\mb{A}^\dagger \theta (t-t') + \mb{A} G_{t'-t} \mb{A}^\dagger \theta (t'-t) \ket{y}\right]. } We see that $\RN{3}+\RN{4} = 2 \RN{1}$. The first term explicitly gives, \eqa{ \RN{1}=& \bar{\kappa}^2 \int_0^1 dx' \int_0^1 dy' \mb{A}(x,x')\big \langle e_t(x')e_{t'}(y') \big \rangle \mb{A}^\dagger(y',y), \nonumber \\ =& \bar{\kappa}^2 T^2 \int_0^1 dx' \int_0^1 dy' \mb{A}(x,x') \mb{A}(y,y')G_{|t-t'|}(x',y'), \nonumber \\ =& \bar{\kappa}^2 T^2 \sum_{n,l,l'} \hat{\chi}%\mathfrak{z}}_{nl}\hat{\chi}%\mathfrak{z}}_{nl'} (\lambda_{l} \lambda_{l'})^{1/4} e^{-\bar{\kappa} \mu_n |t-t'|} \alpha_l(x) \alpha_{l'}(y).} Therefore, the contribution of the parts $\RN{1}-\RN{3}-\RN{4}=-\RN{1}$ in \eqref{eq:GKformula} gives, after doing the space and time integrals: \eqa{ \int_{0}^{\tau}dt' \int_{0}^{\tau}dt \int_0^1 dx \int_0^1 dy ~(-\RN{1}) = -16\bar{\kappa}^2 T^2 \sum_n \sum_{ll' \; odd}\frac{1}{ \bar{\kappa} \mu_n} \left[ \tau +\frac{(e^{-\mu_n \tau} -1)}{\mu_n}\right] \hat{\chi}%\mathfrak{z}}_{nl}\hat{\chi}%\mathfrak{z}}_{nl'} (\lambda_{l} \lambda_{l'})^{-1/4}. } On using \eqref{eq:BBdagger}, the contribution of part $\RN{2}$ in \eqref{eq:GKformula} gives \eqa{ \int_{0}^{\tau}dt' \int_{0}^{\tau}dt \int_0^1 dx \int_0^1 dy (\RN{2}) =& 2 \bar{\kappa} T^2 \int_{0}^{\tau}dt' \int_{0}^{\tau}dt \int_0^1 dx \int_0^1 dy BB^\dagger(x,y)\delta(t-t'), \nonumber \\ =& ~2 \bar{\kappa} T^2 \tau \int_0^1 dx \int_0^1 dy \sum_{n} \frac{\alpha_n(x) \alpha_n(y)}{ \lambda_n^{1/4}}, \nonumber\\ =& 16 \bar{\kappa} T^2 \tau \sum_{n \; odd} \frac{1}{ \lambda_n^{5/4}}. } Combining the above results we finally have \eqa{ \lim_{\tau \to \infty} \frac{\langle q^2 \rangle_{\delta T=0}}{2\tau T^2 } = \bar{\kappa} \left( 8\sum_{n \; odd} \frac{1}{ \lambda_n^{5/4}} - \sum_n \sum_{ll' \; odd}\frac{8}{ \mu_n} \frac{\hat{\chi}%\mathfrak{z}}_{nl}\hat{\chi}%\mathfrak{z}}_{nl'} }{ (\lambda_{l} \lambda_{l'})^{1/4}}\right) . \label{eq:currfluc} } The first summation yields $0.5050\ldots$ and the second yields $\approx 0.0931$, hence we get \eqa{ \lim_{\tau \to \infty} \frac{\langle q^2 \rangle_{\delta T=0}}{2T^2\tau} \approx 0.4119\bar{\kappa} , } which, up to numerical accuracy is consistent with the numerical value of steady state current ($j/\delta T = 0.4124\bar{\kappa}$) we found in \eqref{eq:sscurrent}, thus validating the Green-Kubo formula in \eqref{eq:GKformulaA}. Note that in order to get the expected scaling in system size $N$, we need to put in the appropriate length scaling of the eigenvalues and eigenfunctions, for example $\lambda_n \to \lambda_n/N^2$ and $\mu_n \to \mu_n /N^{3/2}$). We also need to consider the integrated current $Q(\tau) = \int_{0}^{\tau}dt \int_0^N dx j(x,t) $ and then one gets $\lim_{\tau \to \infty} \frac{\langle Q^2 \rangle_{\delta T=0}}{2T^2\tau} \approx \frac{ 0.4119\bar{\kappa}}{\sqrt{N}}$ and $\frac{J}{\delta T} = \frac{j}{ \sqrt{N} \delta T}\approx \frac{0.4124\bar{\kappa}}{\sqrt{N}}$. \begin{figure} \centering \includegraphics[width=0.75\linewidth]{./Green-Kubo-Microscopic2-eps-converted-to.pdf} \caption{For the microscopic HCME model, we compute the two quantities, $J/\delta T$ computed from non-equilibrium simulations connected to heat baths and $ <Q^2>/(2 \tau T^2)$ computed from equilibrium simulations, are plotted as a function of $N$. The black dashed curve is for the theoretical current with appropriate scaling as given in Eq.~\eqref{eq:sscurrent}. We find that for small $N$, these two do not match, and the difference between the two decays as $1/N$ (inset), which is due to the contribution of current from the stochastic part. This signifies that at large $N$, Green-Kubo holds while for small $N$, it fails.} \label{fig:greenkubo} \end{figure} { The above verification of the Green-Kubo identity was obtained using the fluctuating fractional diffusion equation, which is valid in the limit of large system size. A natural question is as to whether the identity is true even for a small chain with the microscopic dynamics (HCME), as would be expected from the fluctuation theorem. In Fig.~\eqref{fig:greenkubo}, we present a numerical comparison of the equilibrium current fluctuations, with the non-equilibrium current, both computed from the microscopic model for finite systems. We see clear evidence that for small $N$, the Green-Kubo relation is violated in the HCME model. We also find that the difference between the fluctuation and response parts decreases with system size as $\sim 1/N$. Somewhat surprisingly, the numerically obtained fluctuations (from HCME simulations) are very close to the response computed from the fractional diffusion equation description. A possible reason for the failure of the fluctuation theorem for small systems could be that in this model, the Hamiltonian part of the current (which goes as $1/\sqrt{N}$), and the stochastic part of the current ($\sim 1/N$) have different time-reversal symmetries.} \subsection{General fractional power} In this section, we discuss a possible generalization of the results of the previous section for the Green-Kubo identity to the case of arbitrary fractional power $\beta$ of the Laplacian. There is currently no known microscopic model in which heat transfer can be described by a fractional equation with arbitrary $\beta$ --- nevertheless it is an interesting exercise as it leads to some general mathematical identities involving Riemann-zeta functions. Using the definition of fractional Laplacian in Eq.~\ref{Lbeta}, namely through the operation $\mb{L}^{(\beta)} \phi_n(x) = \lambda_n^{\beta} \phi_n(x)$, we can proceed in a similar way as for the $\beta=3/4$ case and compute steady state properties in NESS as well as equilibrium current fluctuations. Corresponding to Eq.~\eqref{eq:sscurrent} we then get \eqa{ \frac{j}{\delta T}= \frac{1}{8 \left(2^{2\beta}-1 \right) (2\pi) ^{-2\beta } \zeta (2\beta )}, \label{eq:gennessj} } and corresponding to Eq.~\eqref{eq:currfluc} we get \eqa{ \lim_{\tau \to \infty} \frac{\langle q^2 \rangle_{\delta T=0}}{2\tau T^2 } = 8 \left(1-2^{2 \beta -4}\right) \pi ^{2 \beta -4} \zeta (4-2\beta ) - \sum_{n \; even} \sum_{ll' \; odd}\frac{8}{ \mu_n^{(\beta)}} \frac{ \hat{\chi}%\mathfrak{z}}_{nl}^{(\beta)}\hat{\chi}%\mathfrak{z}}_{nl'}^{(\beta)} }{ (\lambda_{l} \lambda_{l'})^{1-\beta}}, \label{eq:genjfluc}} where due to structure of $\hat{\chi}%\mathfrak{z}}^{(\beta)}_{n,l}$, only the terms with even $n$ survives for odd $l$. This is computed as before but now with power $\beta$ and is explicitly given as \eqa{ \hat{\chi}%\mathfrak{z}}^{(\beta)}_{2k+2,2m+1} &=\frac{D^{(\beta)}_{2k+2}}{\lambda_{2m+1}^{\beta} -\mu^{(\beta)}_{2k+2}} , ~~~ k,m \ge 0~, \\ {\rm where}~~ D^{(\beta)}_{2k+2} &= \left[\sum_{m\ge0} \frac{1}{(\lambda_{2m+1}^{\beta}-\mu^{(\beta)}_{2k+2})^2}\right]^{-1/2}, } and $\{\mu_{2n}^{(\beta)}\}_{n \ge 1}$ are the ordered roots of the equation \eqa{ \sum_{k\ge0} \frac{1}{\lambda_{2k+1}^{\beta} - \mu^{(\beta)}} = 0~. } All the coefficients in the above expressions are explicit and we have evaluated numerically the right hand sides of Eqs.~(\ref{eq:gennessj},~\ref{eq:genjfluc}) for values of $\beta \in (0.5,1.5)$. In Fig.~\eqref{fig:genfrac}, we plot these quantities and find that they are very close to each other, hence verifying the Green-Kubo formula Eq.~(\ref{eq:GKformulaA}) for general $\beta$. The differences arise from numerical error due to truncation of series and also use of a finite number of basis functions. For $\beta=1$, this leads to diffusive results for which the double summation can be computed explicitly. Conversely, on the basis of the validity of the Green-Kubo formula we are then led to conjecture a mathematical identity between the right hand sides of Eqs.~(\ref{eq:gennessj},~\ref{eq:genjfluc}). For $\beta < 1/2$, one has a non-convergent series summation in Eq.~\eqref{eq:genjfluc}, which leads to a breakdown of the identity in this form. This corresponds to defining zeta function for power less than $1$, and possibly analytic continuation could extend the definition to other values of $\beta$. We believe that the relation holds true at least in the open interval $\beta \in (1/2,3/2)$. However, proving it remains an open problem. \begin{figure} \centering \includegraphics[width=0.75\linewidth]{./general_s.pdf} \caption{The numerically evaluated expressions in Eq.~\eqref{eq:gennessj} and Eq.~(\ref{eq:genjfluc}) are plotted as a function of general fractional power $\beta$. The two quantities match numerically to a very good precision. The relative error between the two is plotted in the inset.} \label{fig:genfrac} \end{figure} \subsection{Long range correlations in NESS}\label{sec:Longrange} For a noneqlibrium current carrying steady state, it is expected that fluctuations across the system will develop non-zero long-range correlations. These long-range correlations is a distinguishing feature of non-equilibrium systems with conservative dynamics \cite{Garrido1990}. In some diffusive lattice gas as well as some Hamiltonian systems, these long-range correlations have been studied \cite{Spohn1983,Bodineau2008,Bertini2007,Derrida2007,Bernardin2012a}. The energy correlation in the velocity flip model (HCMF) in NESS is defined as $C_{NESS}(x,y) = \langle e(x,t) e(y,t) \rangle $, where the average is taken in NESS (as $t \to \infty $). It was shown that $C_{NESS}(x,y) = \delta T ^2 \Delta ^{-1} (x,y)$, where $\Delta$ is the Laplacian operator with Dirichlet boundary conditions. From the definition of fluctuating fractional equation in equilibrium, it is tempting to extend the definition of fluctuating fractional equation to non-equilibrium case, where the temperature is space-dependent: \eqa \partial_t \ket{e_t} &= -\mb{L}_{\bar{\kappa}} \ket{e_t} + \sqrt{ 2 \bar{\kappa}} \nabla (B T_{NESS} \ket{\eta_t}), \label{eq:fluctuatingeqneq} } We note that there is an ambiguity regarding the relative position of the operator $B$ and $T_{NESS}$, and also with the definition for operator $B$ and $B^\dagger$ separately. If we anyway proceed with a naive replacement of $T $ by $T_{NESS}(x)$ in Eq.~\eqref{eq:fluctuatingeq}, to get \eqref{eq:fluctuatingeqneq}, we can perform the computation of $C_{NESS}(x,y)$ and find that this does not agree with the results from direct simulations. However, in analogy to the HCMF model, we conjecture that the NESS energy correlations $C_{NESS}(x,y)$ are given (upto a constant factor $\nu$) by the inverse of the fractional Laplacian (in Dirichlet basis): \eqa{\delta T^2 \mb{C}(x,y) = \frac{ \delta T^2}{\nu} \mb{L}^{-1} = \frac{ \delta T^2}{\nu}\sum_{n\ge 1} \frac{\psi_n(x)\psi_n(y)}{\mu_n}, \label{eq:lrcorr} } where we have defined $\delta T^2 \mb{C}(x,y)=C_{NESS}(x,y)-T_{NESS}(x)^2\delta(x-y)$, with the local same-site correlation $T_{NESS}(x)^2\delta(x-y)$ subtracted from correlations. {\bf Numerical verification of Eq.~\eqref{fig:LongRangeCorrelations}}: We simulate the microscopic system in non-equilibrium with two Langevian heat baths kept at different temperature. After the system is in the steady state, we compute $\mb{C}(x,y) = N \langle e(i/N)e(j/N)\rangle $ where $e(i/N)=E(i/N)-\langle E(i/N)\rangle$. In Fig.~\eqref{fig:LongRangeCorrelations} we compare our conjectured form from Eq.~ \eqref{eq:lrcorr} with the results from microscopic simulations. We see that with the constant $\nu \approx 3.77$, the two numerical curves (for $y=1/4$ and $y=1/2$) match well with the inverse of fractional Laplacian. The constant $\nu$ is related to the total energy fluctuations in the system at NESS as \eqa{\int_0^1 dx \int_0^1 dy \frac{ \delta T^2}{\nu} \mb{L}^{-1}(x,y) + \int_0^1 dx T^2_{NESS}(x) = \int_0^1 dx \int_0^1 dy ~ C_{NESS}(x,y)=\big \langle \Delta E_{tot}^2\big \rangle_{NESS}. \nonumber } By evaluating the integrals on the LHS and finding the RHS from numerical simulations in the NESS, we can use the above equation to independently evaluate $\nu$. We find that the fluctuations $\big \langle \Delta E_{tot}^2\big \rangle_{NESS}$, obtained from simulations in NESS, converges very slowly and with the final accessed simulation time {($2 \times 10^9$ time with $10^8$ samples)} we estimate $3.51 \le \nu \le 4.2$. The value $\nu \approx 3.77$, obtained by fitting the long range correlations data from simulation, is well within the limits of the above estimate. We have tested (see \ref{app:longrangetests}) that the constant $\nu$ does not change substantially with $\delta T$ and $\bar{T}$, within the numerical accuracy and finite size effects. We note in \ref{app:longrangetests}, that if we did the same computation with $\sin(n \pi x)$ basis, then the results would differ significantly. We close this section by making a comment that proving our conjecture on the equality between the long-range correlations and the inverse fractional operator is an open question. \begin{figure} \centering \includegraphics[width=0.45\linewidth]{25_Long_range_2-eps-converted-to.pdf} \includegraphics[width=0.45\linewidth]{./50_Long_range_2-eps-converted-to.pdf} \caption{Non-equilibrium energy correlation function $\mb{C}(x,y) $ in steady state of Harmonic chain momentum exchange model for $y=1/4$ (left figure) and $y=1/2$ (right figure). The system size considered here are for $N=128,256$ with $T_L=2, T_R=1$ . The inverse of the fractional Laplacian (summed up to 600 basis states) and with an arbitrary constant factor ($\nu=3.77$), is plotted (black solid) along with the simulation results. } \label{fig:LongRangeCorrelations} \end{figure} \section{Conclusions} \label{sec:conc} We have shown that in a particular analytically tractable model of heat conduction in one dimension, the macroscopic evolution of energy in an open system is governed by the fractional diffusion equation. This gives us a definition of the fractional operator in a finite domain and also gives a meaning to the fractional operator in terms of linear PDE's (similar to the harmonic extension of a fractional operator). We describe an efficient procedure to numerically construct the eigenspectrum of this operator. In terms of this operator, we compute the steady state and time evolution of temperature field, which we compare with microscopic simulations of the system. We defined the fluctuating fractional equation and used it to verify the Green-Kubo relation in the system. We also generalize the Green-Kubo for general fractional power which leads to some general mathematical identity involving zeta functions. This identity is verified numerically. We also conjecture that the long-range correlations are given by the inverse of a fractional operator. Proving this conjecture in Eq.~\eqref{eq:lrcorr}, as well as finding the correct equation to replace Eq.~\eqref{eq:fluctuatingeqneq} are open problems. The other interesting question would be to consider the use of the fractional operator in studying the dynamics of other Hamiltonian systems such as the FPUT model and also the HCME model with other boundary conditions. Another very interesting aspect is to study the usefulness of the eigensystem of the fractional operators in studying other applications where the underlying dynamics can be modelled as Levy flights or Levy walks. \section{Acknowledgments} The authors are very grateful to G. Basile, T. Komorowski and S. Olla to send them their unpublished notes \cite{PrivateCommunication2015} on which a part of this work is based. Aritra Kundu would like to thank the hospitality of Nice Sophia-Antipolis University Laboratoire Dieudonn\'e and Institut Henri Poincar\'e - Centre Emile Borel during the trimester ``Stochastic Dynamics Out of Equilibrium" where part of the work was done. This work benefited from the support of the project EDNHS ANR-14-CE25-0011 of the French National Research Agency (ANR), and also in part by the International Centre for Theoretical Sciences (ICTS) during a visit for participating in the program Non-equilibrium statistical physics (Code: ICTS/Prog-NESP/2015/10). C\'edric Bernardin thanks the French National Research Agency (ANR) for its support through the grant ANR-15-CE40-0020-01 (LSD) and the European Research Council (ERC) under the European Union's Horizon 2020 research and innovative programme (grant agreement No 715734). Anupam Kundu (AK) would like to acknowledge the support from DST grant under project No. ECR/2017/000634. AK, AD and CB would like to acknowledge the support from the project 5604-2 of the Indo-French Centre for the Promotion of Advanced Research (IFCPAR). KS was supported by JSPS Grants-in-Aid for Scientic Research (JP16H02211 and JP17K05587). \section{References} % % \input{MainText_arxiv_v16.bbl
\section{Introduction} The rapid growth in technology, has increased the opportunity for longitudinal human behavioral studies \cite{miluzzo2008sensing,bang2008toward,aldwin2007stress,StudentLife2014,choudhury2008mobile}. Today's densely instrumented world offers tremendous opportunities for continuous acquisition and analysis of multi-variant time series data that provides a multimodal characterization of an individual's actions. Integrating different sensor technologies to enable continuous, unobtrusive sensing of individual physiological states, their activity, and their environmental and social contexts is challenging. There have been several studies collected multimodal in real-world. StudentLife is a 10-week study on 48 Dartmouth undergraduate and graduate students using passive and mobile sensor data to infer wellbeing, academic performance and behavioral trends \cite{StudentLife2014}. The Dartmouth College research team was able to predict GPA using activity, conversational interaction, mobility, and self-reported emotion and stress data over the semester. SNAPSHOT is a 30-day study on MIT undergraduates using mobile sensors and surveys to understand sleep, social interactions, affect, performance, stress and health \cite{3-2}. RealityMining is a 9-month study on 75 MIT Media Laboratory students, using mobile sensor data to track the social interactions and networkings \cite{3-3}. The friends-and-families study collects data from 130 adult members of a young family community to study fitness intervention and social incentives \cite{aharony2011social}. We designed an experiment to examine the complex interplay between individual differences, job performance, and well-being with varying cognitive, affective and social demands. More than 200 nurses were instrumented with different sensors during their work shift for a duration of 1 to 2 months. The next challenge in these type of studies would be how to fuse noisy, incomplete, and heterogeneous bio-behavioral data from sensors operating in different modalities and temporal resolution scales, and to extract features for analysis and predictive purposes. All these data sources are often collected from small set of participants in natural condition, continuously and over long periods of time. Therefore, they are potentially heterogeneous, sparse, in high dimensional regime and have systematically missing values. Aggregating the data over the time dimension, or matricizing the tensor, Partial Least Squares (PLS) regression \cite{pls} and Principal Component Analysis (PCA) \cite{20} would particularly appropriate for these high dimension tasks. While PCA find the direction with highest variation, independent of dependent variable, PLS considers both the independent and dependent variables by projecting them to the low dimensional latent variables space. For the purpose of interpretability, we are looking for techniques such as higher order PCA and PLS which can be applied directly to N-way data. We are interested in prediction of a certain set of behaviors from these multi-way data. Latent user factor matrix obtained from unsupervised tensor decomposition approaches can be used as the extracted features with any conventional regression method. However, there is no guarantee these new features, however there is no guarantee for having any predictability power for the target variable of interest. We are interested in supervised embedding technique to overcome this challenge. Previously \cite{hoff2015multilinear} has looked at tensor regression problem for relational longitudinal data. \cite{Tao2007Supervised} supervised tensor learning for classification problem, extended SVM and MPM. With join CP decomposition of input and target variable, NPLS is one of the widely used methods for higher order regression problems, \cite{}. \cite{zhao2013higher} improve the predictability performance and \cite{hou2017fast} make it faster for large scale data with developing a sequential low-rank tensor regression framework. Several works later work on the scalability and speed of HOPLS \cite{}. HOPLS was designed for Y with number of dimension more than 1. We are the most similar to NPLS, as the analysis of NPLS weights and NPLS regression coefficients allows data patterns, feature correlation and covariance structure to be depicted. Later \cite{favilla2013assessing} propose an extension of the Variable Importance in Projection (VIP) parameter to multi-way arrays in order to highlight the most relevant features to predict the studied dependent variable and have presented examples for interpretative purposes. Here we propose a supervised embedding to latent space, which find the weights of latent components for all three dimensions similar to NPLS. We also combine it with variable selection by using the component activation power. We can then use any linear or non-linear regression function for the prediction task. The framework for our method is depicted in Figure \ref{fig:workflow}. Basically we first use covariance matrix of input and target variable and find the feature importance vector, and then we select the top K important features and apply supervised factorization in reduced sized tensor. \begin{figure*}[h] \centering \includegraphics[width=0.65\textwidth]{image/model.png} \caption{Framework from tensor $X$ to prediction $\hat{y}$.} \label{fig:workflow} \end{figure*} \subsection*{Contributions} \begin{itemize} \item A large-scale "in the wild" experimental studies that collect bio-behavioral data from subjects who are facing challenging cognitive, social, and affective demands in their natural settings. \item Proposed a tensor-input/vector-output Recursive Tensor Embedding (STE) algorithm for high dimension multi-way (tensor) noisy data \item Variable selection using components' activation is united with supervised embedding \item Validation of recovered latent patterns via prediction performance over synthetic data and two real world datasets \end{itemize} \section{Data Collection} Tracking Individual Performance with Sensors study, tracks nurses performance, wellbeing and physiological state for duration of 2 months. We developed a smartphone application called TILES for collecting data from more than 200 nurses during their work shift. It is a 4-week study conducted during spring and summer 2018 on 201 nurses. The dataset can be divided into four sections: sensory data, health variables, psychometrics and job performances. Sensory data includes HRV metrics collected via OM sensors, Fitbit collects Hear rate and steps. Psychometrics have pre-surveys of Big Five personality \cite{2-2}, positive and negative affect schedule (PANAS) \cite{2-8}, Pittsburgh sleep quality index (PSQI) \cite{2-5} and ... . \section{Methodology} \subsection{Notation and definitions} A wide range of real-world datasets are multi-way, e.g. in neuroscience \cite{1}, complex networks \cite{2}, social networks \cite{2}, etc. A mathematical representation of such data is tensor, $\mathcal{X} \in \mathbb{R}^{I_1 \times ... \times I_N}$, when element ($i_1,i_2,...,i_N$) of an $N$th (number of dimensions) order tensor is denoted by $x_{i_1}$ . Table \ref{tab:notation} provides a summary of the notations. In this work we are dealing with temporal data, presented in terms of 3-way tensors. NPLS is higher order PLS regression which preserves the structure of the data by avoiding vectorization of the data. For independent and dependent tensors of observation $ \mathcal{X} \in \mathbb{R}^{I \times J \times K}$ and $Y \in I \times 1 $, the NPLS iteratively constructs the linear relationship by projecting them to the space of latent variables similar to the PLS way. In this section we discuss the model that we will use to analyze a 3-way longitudinal human behavioral data. For $I$ individuals, with $J$ variables for a duration of $K$ time frames, tensor $\mathcal{X} \in \mathbb{R}^{I \times J \times K } $ will be created. Entry $x_{ijk}$ of this tensor corresponds to the $i^{th}$ person in the $j^{th}$ variable at the $k^{th}$ time unit. Table \ref{tab:notation} summarizes our notation throughout this paper. Ordinary Partial Least Squares regression \cite{pls} is an iterative procedure to estimate a linear relationship between a vector of independent (input) variables and a vector of dependent (output) variables on the basis of observation matrices $X \in N \times n$ and $Y \in N \times m : Y = XB + D$ , where $B \in n \times m$ is the matrix of linear coefficients, and $D \in N \times m$ is the matrix of noise. To build the model, the observations are iteratively projected into the low dimensional spaces of latent variables while trying to explain the maximum of variance of $X$ and $Y$ simultaneously: $X = TP^T + E$ , $Y = UQ^T + F$; where $T = [t_1 , … , t_R ] \in N \times F$ and $U = [u_1 , … , u_R ] \in N \times F$ are the matrices of the latent variables (scores), $P = [p_1 , … , p_R ] \in n \times R$ and $Q = [q_1 , … , q_R ] \in m \times R$ are the matrices of the loading vectors (projectors), E and F are residual matrices, and F is the number of iterations (factors). The PLS approach is particularly well suited for high dimensional data due to its efficient dimensional reduction technique. Multi-way Partial Least Squares (NPLS) regression is an algorithm in the PLS-family that is adopted to the case of tensor variables \cite{npla}. \begin{table} \centering \caption{Table of Symbols.} \begin{tabular}{c|c} \hline \hline Symbol & Definition \\ \hline \hline $\mathcal{X},\mathrm{X},\mathbf{x},\mathrm{x}$ & Tensor, matrix, column vector, scaler\\ \hline $ \mathbf{x} \in \mathbb{R}^{I\times 1} $ & Definition of an I-dimensional vector \\ \hline $\circ$ & Outer product \\\hline $||.||$ & Frobenius norm \\ \hline \hline \end{tabular} \label{tab:notation} \end{table} \subsection{Variable Selection} \subsection{supervised tensor decomposition} The extraction of meaningful patterns of behavior can be carried out by taking full advantage of tensor decomposition techniques. Let us consider a dataset composed by individuals, whose daily behavior (walking, running, talking, etc. during the day) has been recorded over time. To uncover groups of individuals with similar correlated trajectories, identification of lower-dimensional factors is required. Once the dataset is represented in the tensor form, we can perform tensor decomposition to discover the hidden lower dimension structure of the data. Here, we use the CANDECOMP/PARAFAC decomposition \cite{carroll1970analysis,harshman1970foundations}, which will decompose the tensor $\mathcal{X} \in R^{I \times J \times K}$ into sum of rank-one tensors, called components, Figure \ref{fig:cp}. Also we add the non-negativity constraints to each factor matrix in order to find interpretable components. \begin{align*} \mathcal{X} \approx \hat{\mathcal{X} } = \sum_{r=1}^{R} \lambda_r \mathbf{u}_r \circ \mathbf{v}_r \circ \mathbf{t}_r \end{align*} where $\lambda_r$ are the values of the tensor core $L = diag(\Lambda)$, and the outer product $\mathbf{u}_r~o~\mathbf{v}_r~o~\mathbf{t}_r$ corresponds to the $r^{th}$ component of rank-R estimation. $\mathbf{U}, \mathrm{V}, \mathrm{T}$ are the factor matrices with their columns containing rank-1 factors, $\mathbf{u}_r, \mathbf{v}_r$, and $\mathbf{t}_r$, respectively. Imposing the non-negativity constraints makes the factorization results interpretable. I the simulations, STE, and NPLS were used to model the data in a tensor form, when PLS is used on a mode-1 matricized version of the same tensor. To compare the predictability, we compare root mean square error (RMSE), coefficient of determination $R^2$ and pearson correlation $\rho$. \ref{alg:euclid} \subsection{Supervised Tensor Embedding} \begin{algorithm} \caption{Supervised Tensor Embedding}\label{alg:STE} \begin{algorithmic}[1] \State input: $\mathcal{X}$ independent tensor, $y$ dependent variable \State parameters: $R$ - decomposition rank \State output: $U,T,V$ \State Center $\mathcal{X}$ and $\mathbf{y}$ \State ${\mathcal{X}}_{rem} = \mathcal{X}$ \For{r = 1:R} \State Calculate $Z = COV<\mathcal{X}_{rem},\mathbf{y}>$ \State $\mathbf{t}_r,\mathbf{v}_r \leftarrow SVD(Z)$ \State $\mathbf{u} \leftarrow \mathbf{t},\mathbf{v}$ \State $\mathbf{X_{R=1}} \leftarrow \mathbf{t},\mathbf{v}$ \State $\mathcal{X}_{rem} = \mathcal{X}_{rem} - \mathcal{X}$ \EndFor \end{algorithmic} \end{algorithm} \subsection{Variable Selection} For variable selection we take the latent factor matrix V and extract the variable importance as following: \begin{equation*} FI_i = \sum_{r=1}^{R} \mathbf{v}^2_{ri} \end{equation*} \subsection{Regression model} \begin{algorithm} \caption{Supervised Tensor Embedding with Time Series Selection}\label{alg:STE} \begin{algorithmic}[1] \State input: $\mathcal{X}$ independent tensor, $y$ dependent variable \State parameters: $K$ - number of variables, $R$ - decomposition rank , f()- regression function \State output: $\hat{y}$ \State Compute component activation for each sensory variable using alg1 \State Form a reduced data tensor consisting of only time series whose activation power is among top K variables \State Compute latent variables using alg2 \State Use latent variables in a regression model to predict outcome $\hat{y} = f(U)$ \State Pick K and parameter of model $f(.)$ by cross validation \end{algorithmic} \end{algorithm} \section{Experimental result} I the simulations, STE, and NPLS were used to model the data in a tensor form, when PLS is was used on a mode-1 matricized version of the same tensor. To compare the predictability, we compare root mean square error (RMSE), coefficient of determination $R^2$ and and spearman correlation $\rho$. \subsection{Synthetic data} To quantitatively benchmark our algorithm, an extensive comparative exploration has been performed on synthetic datasets to evaluate the prediction performance under different conditions with respect to data structure, noise levels, correlation between features. For parameter selection, the number of latent vectors (R) and number of selected variables (K) were chosen based on cross-validation. To reduce random fluctuations, evaluations were performed over 50 validation datasets generated repeatedly according to the same criteria. To construct the input tensors and target vectors, random factor matrices with entries following standard normal distribution are generated and a tensor is formed based on a CP model. We generate random factor matrices $U \in R^{N \times R}$ , $T \in R^{I \times R}$ and $V \in R^{J \times R}$ , and form a third-order tensor $\mathcal{X} \in R^{N \times I \times J}$ based on a CP model. Gaussian noise is later added to the tensor, i.e., $\mathcal{X} \in R^{N \times I \times J}$, where $\mathcal{X} \in R^{N \times I \times J}$ responds to the random noise tensor and $\eta$ is used to adjust the noise level. Similarly, we generate a factor matrix $\mathcal{X} \in R^{N \times I \times J}$ and form vector $\mathcal{X} \in R^{N \times I \times J}$ . The matrix $N \in R^{I \times R}$ is a matrix with entries drawn from the standard normal distribution and is used to introduce differing amounts of noise in the data. In our experiments, we use three different noise levels, i.e., $\eta$ = 0.1, 0.25 and 0.35, and the true number of factors is $R$ = 3. \ref{meshplots} \begin{figure}[h] \label{meshplots} \centering \begin{subfigure}{.25\textwidth} \centering \includegraphics[width=0.9\textwidth]{image/romesh9db.png} \end{subfigure}% \begin{subfigure}{.25\textwidth} \centering \includegraphics[width=0.9\textwidth]{image/romesh3db.png} \end{subfigure} \begin{subfigure}{.25\textwidth} \centering \includegraphics[width=0.9\textwidth]{image/romesh6db.png} \end{subfigure}% \begin{subfigure}{.25\textwidth} \centering \includegraphics[width=0.9\textwidth]{image/romesh9db.png} \end{subfigure} \caption{Held-out performance of STE at different noise levels versus the number of latent variables (R) and number of selected variables (K). (-9db: $\lambda=0.5$, -9db: $\lambda=0.5$,-9db: $\lambda=0.5$,-9db: $\lambda=0.5$} \end{figure} \subsection{Real data} Our goal in this paper is understanding whether using supervised decomposition we can find the low-dimensional structure of daily life from wearable devices, which correlated with self-reported target variables better than unsupervised decomposition. We test our model on two real world datasets, TILES ans StudentLife. \subsubsection*{TILES} We will use the pre-survey scores as dependent variables. Each time unit comprise one day worth of data, and is divided into four time bins, bedtime (midnight-6 am), morning (6 am-12 pm), afternoon (12 pm-6 pm), and evening (6 pm-midnight). We extract a set of statistics such as mean, standard deviation, kurtosis, etc. from each times series from OMSignal and Fitbit, in each time bin. At the end, we organize our data as tensor $\mathcal{X}$ with $I=200$ individuals, $J=650$ variables and $K=31$ days. Only x\% of the tensor is missing, which we imputed by filling them with the mean value. \subsubsection*{StudentLife} StudentLife is a 10-week study conducted during 2013 spring semester on 48 Dartmouth students (30 undergraduate and 18 graduate students). From raw sensory data, activity (stationary, walk, run and unknown), audio (silence, voice, noise and unknown), and conversation has been inferred. Each time unit comprise one day worth of data, and is divided into four time bins, bedtime (midnight-6 am), morning (6 am-12 pm), afternoon (12 pm-6 pm), and evening (6 pm-midnight). We extract duration (minutes) of running, walking, stationary, silence, voice, noise, and dark, per time-bin in each day. Frequency of each behavior and number of changes in each behavior (e.g. from walking to running) for each time-bin has been also captured. From GPS and WiFi, number of unique locations visited, and from Bluetooth number of unique near by devices per time-bin are added to the variable set. We normalize all the variables to have the same range $[0,1]$ to avoid variables with large values (e.g. duration in minutes) dominate the analysis. At the end, we organize our data as tensor $\mathcal{X}$ with $I=48$ individuals, $J=85$ variables and $K=66$ days. Only 5\% of the tensor is missing, which we imputed by filling them with the mean value. \subsection*{Results} We tested our model for 20 different target variables with basic NPLS and STE with variable selection. \begin{table*} \begin{center} \caption{Personality traits prediction} \begin{tabular}{||c | c | c | c | c | c ||} \hline & Agreeableness & Openness & Conscientiousness & Extraversion & Neuroticism\\ [0.5ex] \hline\hline $ \rho$ & & & & & \\ \hline $R^{2}$ & & & & & \\ \hline \hline $ \rho$ - NPLS& & & & & \\ \hline $R^{2}$ - NPLS& & & & & \\ \hline \end{tabular} \end{center} \label{personality} \end{table*} \begin{table*} \begin{center} \caption{Job performance and cognitive abilitys prediction} \begin{tabular}{||c | c | c | c | c | c | c | c ||} \hline & ITP & IRB & IOD-ID & IOD-OD & OCB & Shipley abstract & Shipely vocabulary\\ [0.5ex] \hline\hline $R^{2}$ & & & & & & & \\ \hline $\rho$ & & & & & & & \\ \hline \end{tabular} \end{center} \label{job_cognitive} \end{table*} \begin{table*} \begin{center} \caption{TILES: Emotion and health variable prediction} \begin{tabular}{||c | c | c | c | c | c | c ||} \hline & Positive affect & Negative affect & Anxiety & Alchohol usage & Excercise & Sleep quality\\ [0.5ex] \hline\hline $R^{2}$ & 0.35 & 0.20 & 0.19 & 0.17 & 0.29& 0.06\\ \hline $\rho$ & 0.59 & 0.49 & 0.47 & 0.48& 0.54 & 0.23\\ \hline \end{tabular} \end{center} \label{emotion_health} \end{table*} \begin{table*} \begin{center} \caption{Student Life: performance and emotion} \begin{tabular}{||l | c | c | c | c | c ||} \hline & GPA & Stress & Depression & Florishing & Sleep quality\\ [0.5ex] \hline\hline $\rho$& 0.54 & 0.40 & 0.39 & 0.32 &0.30 \\ \hline $R^{2}$ & 0.29 R & 0.16 & 0.12 & 0.10 RF &0.05 \\ \hline \hline $\rho$ - NPLS & 0.40 & 0.47 & 0.31 & 0.23 &0.09 \\ \hline $R^{2}$ - NPLS & 0.12 & 0.20 & -0.01 & 0.02 &-0.14\\ \hline \end{tabular} \end{center} \label{emotion_health} \end{table*} \begin{table*} \begin{center} \caption{StudentLife: personality traits prediction} \begin{tabular}{||l | c | c | c | c | c ||} \hline & Agreeableness & Neuroticism & Conscientiousness & Extraversion & Openness\\ [0.5ex] \hline\hline $\rho$ & 0.43 & 0.48 & 0.56 & 0.45 & 0.49 \\ \hline $R^{2}$ & 0.06 & 0.21 & 0.31 & 0.20 & 0.19 \\ \hline \hline $ \rho$ - NPLS & 0.09 & 0.33 & 0.40 & 0.13 & 0.33 \\ \hline $R^{2}$- NPLS & -0.17 & 0.11 & 0.13 & 0.0 & -0.07 \\ \hline \end{tabular} \end{center} \label{personality} \end{table*} \subsection{Case study: Interpretability of the model} \section{Conclusions and Future work} Rich multimodal data collected from wearables devices (e.g. Fitbit), mobile phones, online social networks, etc. become increasingly available to reconstruct digital trails and study human behavior. In this paper, we adopt two real world datasets \textit{TILES} and \textit{StudentLife}, using passive and mobile sensors, with the goal of inferring wellbeing, performance, and personality. We employ the supervised learning framework based on \textit{supervised tensor embedding} to find latent space highly correlated with target variable of interest. This type of decomposition can uncover latent user factors which are strong predictor of target variables. Further we explore how variable selection can improve the prediction performance and propose a robust variable selection frame work. Next, we plan to implement supervised predictions of individuals' performance and personality directly from different modalities, such as social media activity, location, audio. \section{Introduction} Rapid improvements in sensor technology have made continuous, unobtrusive sensing of individuals practical by providing temporal streams of individual physiological and psychological states, physical activity, and social and environmental context ~\cite{ghandeharioun2017objective,miluzzo2008sensing,bang2008toward,aldwin2007stress,StudentLife2014,choudhury2008mobile,Wang:2018:TDD:3200905.3191775}. Such data has, in turn, created opportunities for enhanced understanding of factors contributing to mental health and wellbeing, including in the workplace. Several past studies collected multi-modal data from individuals in real-world settings in order to infer psychological and health states. For example, the 10-week StudentLife study of Dartmouth undergraduate and graduate students used passive and mobile sensor data to study wellbeing, academic performance and behavioral trends \cite{StudentLife2014,Wang:2018:TDD:3200905.3191775}. SNAPSHOT, a 30-day study on MIT undergraduates, used mobile sensors and surveys to understand sleep, social interactions, affect, performance, stress and health \cite{3-2}. RealityMining, a 9-month study of 75 MIT Media Laboratory students, used mobile sensor data to track the social interactions and networking \cite{3-3}. The friends-and-families study collected data from 130 adult members of a young family community to study fitness intervention and social incentives \cite{aharony2011social}. In contrast, our work focuses on individuals in the workplace. Specifically, the present paper is based on a study that examines the complex interplay between individual differences, job performance, and well-being in jobs with varying cognitive, affective and social demands, measured both at the workplace (and to some extent, complemented, outside the workplace). More than 50 clinical and other hospital staff were instrumented and assessed with a variety of wearable and environmental sensors during their work shift for a duration of four weeks. Sensors data are typically collected from participants in their natural settings, continuously and over extended time periods. Therefore, the resulting data are heterogeneous, sparse, and high-dimensional, with many, often hand-crafted, features. Feature engineering, however, quickly becomes burdensome, especially when there is more than one target variable to model in human behavioral studies, e.g., five personality traits, stress, depression, performance etc. Deep learning has recently been successfully used for feature extraction from audio, images, social networks and other spatio-temporal data \cite{Wang:2016:SDN:2939672.2939753,jia2014caffe,le2011learning}. However, these models require many samples (instances) for training the models, which is not often feasible in some longitudinal studies. For these high dimension tasks with small number of samples, dimensionality reduction techniques, such as Partial Least Squares (PLS) regression \cite{pls} or Principal Component Analysis (PCA)~\cite{pca} are often used. While PCA finds a linear combination of features with highest variation, independent of the target variable, PLS considers both the independent and dependent variables by projecting them onto a low dimensional latent variable space. Latent features obtained from unsupervised tensor decompositio ~\cite{carroll1970analysis,harshman1970foundations} can be used as features with any conventional regression method to predict target variables. However, it is unlikely that these new features will have predictive power for all target constructs of interest. To address this challenge, we would like to embed the data into a latent space using \emph{supervised decomposition} methods, which couple dependent and independent variables in the decomposition step. With the increasing demands of problems that involve higher-order data, classification and regression methods which predict the target variable directly from N-way input have been receiving increasing attention \cite{hoff2015multilinear,Tao2007Supervised,wu2013supervised,yu2016learning,haupt2017near,eliseyev2012l1,eliseyev2013recursive,zhao2013kernelization,zhou2013tensor,hou2016common}. These methods have been widely applied in neural signal processing, image and video processing and, even in chemistry. We would like to use these methods to predict well-being, performance and affect from multimodal, dynamic sensor data collected in real world workplace settings. To achieve this goal, we propose a method for supervised embedding, which finds the latent components combined with a feature selection step. Any regression function can be used next for the prediction task. \begin{figure*}[h] \centering \includegraphics[width=0.90\textwidth]{image/frame_work_ste.png} \caption{Left: Framework from tensor $X$ to prediction $\hat{y}$, Right: Supervised Tensor Embedding (STE) model. This process will be repeated for $r=1,2,..,R$. At each iteration the rank one model $\mathcal{X}_{model}$ will be extracted and subtracted from the $\mathcal{X}_{rem}$.} \label{fig:workflow} \end{figure*} \subsection*{Contributions} \begin{itemize} \item A novel tensor-input/vector-output Tensor Embedding (STE) algorithm for high dimension multi-way (tensor) noisy data \item Variable selection using components' activation is united with supervised embedding \item Validation of recovered latent patterns via prediction performance on two real world multimodal behavioral datasets including our recent ``in the wild" experimental study that collected bio-behavioral data from subjects in challenging cognitive, social, and affective demands in their natural hospital workplace (and outside work) settings. \end{itemize} \section{Related Work} The supervised tensor learning for classification problems proposed in \cite{Tao2007Supervised} extends support vector machines (SVM) and minimax probability machines (MPM) to N-way data. Another body of work runs linear regression directly on N-way data and finds N-way coefficient tensor $\mathcal{W}$, where $\mathbf{y} = <\mathcal{X},\mathcal{W}> + \epsilon$, \cite{yu2016learning,haupt2017near,guo2012tensor}. Previously \cite{hoff2015multilinear} has looked at tensor regression problem for relational longitudinal data. With a joint CP decomposition of input and target variables, NPLS is one of the widely used methods for higher order regression problems, \cite{npls}. The work in \cite{zhao2013higher} has proposed higher order partial least squares model (HOPLS) with joint orthogonal block Tucker decomposition to improve the predictability performance of NPLS by extraction of latent components based on subspace approximation rather than on low-rank approximation. However, HOPLS also performs poor under high level of noise and also is designed for target variable with number of dimensions more than one, e.g., 3D hand movement prediction. The recursive N-way partial least squares (RNPLS) \cite{eliseyev2013recursive} processes the tensor sequences by unifying a recursive calculation scheme with the N-way data representation of NPLS for real time applications and later recursive exponentially weighted (REW-NPLS) improves the performance of RNPLS \cite{eliseyev2017recursive}. In this paper we propose a supervised embedding into latent space, which finds the weights of latent components with joint CP decomposition of independent tensor and dependent target variable. While NPLS combines the projection of data in lower dimension latent space with a linear regression model, we are interested in supervised embedding which then can be combined with any regression/classification function for subsequent prediction tasks. Although the tensor decomposition will down-weight irrelevant and noisy features, discarding these features will reduce the contamination in the prediction, \cite{kuhn2013applied}. The work in \cite{eliseyev2012l1} develops an L-1 penalized NPLS algorithm, applied to sparse BCI calibration systems. Variable Importance in Projection (VIP) was proposed by \cite{favilla2013assessing} in order to highlight the most relevant features in NPLS. Here we use the activation of features across all components after joint decomposition of dependent and independent variables as the importance measure of the features. After selecting top features, in a second iteration, we apply STE on a reduced sized tensor and regenerate the latent factors. \section{Method for Tensor Regression} In this section, we present our supervised learning model that is constituted by three steps: (i) supervised tensor embedding (STE), (ii) feature selection, and (iii) regression. We start with some definitions and notation. \subsection{Notation and Definitions} A convenient mathematical representation of multi-modal data is a tensor, $\mathcal{X} \in \mathbb{R}^{I_1 \times ... \times I_P}$. The unfolded tensor in mode $d$ is defined as $X_{(d)} \in \mathbb{R}^{I_d \times I_1 ...I_{d-1}I_{d+1}... I_P}$. The d-mode vector product of a tensor $\mathcal{X}$ with vector $\mathrm{y}$ is defined as $\mathcal{Z} = \mathcal{X} \bar{\times}_1 \mathbf{y}$, where $z_{i_1 i_2... i_{d-1} i_{d+1}...i_P} = \sum_{i_d=1}^{I_d} x_{i_1i_2...i_P} y_{i_d}$. Table \ref{tab:notation} summarizes the notation used throughout this paper. For $N$ individuals, with $I$ time units and $J$ features, tensor $\mathcal{X} \in \mathbb{R}^{N \times I \times J} $ will be created. Entry $x_{nij}$ of this tensor corresponds to the $i^{th}$ feature of $n^{th}$ individual at the $j^{th}$ time unit. The covariance matrix Z is defined as Z $= <\mathcal{X},\mathbf{y}> = \mathcal{X} \bar{\times}_1 \mathbf{y}$, where $z_{ij} = \sum_{n=1}^{N} x_{nij} y_{n}$. The CP decomposition, will decompose the tensor $\mathcal{X} \in R^{N \times I \times J}$ into sum of rank-one tensors, called components: $\mathcal{X} = \sum_{r=1}^{R} \lambda_r \mathbf{u}_r \circ \mathbf{t}_r \circ \mathbf{f}_r $, where $\lambda_r$ are the values of the tensor core $L = diag(\Lambda)$, and the outer product $\mathbf{u}_r~\circ~\mathbf{t}_r~\circ~\mathbf{f}_r$ corresponds to the $r^{th}$ component of rank-R estimation. \begin{table} \centering \caption{Table of Symbols.} \begin{tabular}{c|c} \hline \hline Symbol & Definition \\ \hline \hline $\mathcal{X},\mathrm{X},\mathbf{x},\mathrm{x}$ & Tensor, matrix, column vector, scaler\\ \hline $ \mathbf{x} \in \mathbb{R}^{I} $ & Definition of an I-dimensional vector \\ \hline $\circ$ & Outer product \\\hline $\otimes$ & Kronecker product \\\hline $\mathcal{X} \bar{\times}_1 \mathbf{y}$ & d-mode vector product \\ \hline \hline \end{tabular} \label{tab:notation} \end{table} \subsubsection{Supervised Tensor Embedding}\label{STE} We are interested in finding the latent user factors of the tensor data, such that they can be of good predictive ability of the target variables of interest. Decomposition of the collected data in an unsupervised way can help find underlying structure, however these latent user factors may not necessarily have high correlation with all different human behavior aspects of interest and may only explain a subset. By applying supervised decomposition for each target variable, we would like to find the latent factors which correlate with it the most. Then we can use any regression function $g(.)$ on the obtained user latent matrix U to estimate $\hat{y}$. Our work builds upon the idea of N-way PLS \cite{npls}, where the algorithm constructs a model of both $\mathcal{X}$ and $\mathbf{y}$ for each component and then the models are subtracted from both $\mathcal{X}$ and $\mathbf{y}$ iteratively. We are interested in extracting rank one models from $\mathcal{X}$ iteratively, and finding the latent factors highly correlated with $\mathbf{y}$, without fitting a prediction model. For this purpose we start with building the cross-covariance matrix Z, (line 7, \ref{alg1}). The goal is finding $\mathbf{t}$ and $\mathbf{f}$ such that $\mathbf{u}$ has maximum correlation with $\mathbf{y}$. It is equivalent to solving $\max_{\mathbf{t},\mathbf{f}} \sum_{i=1}^{I} \sum_{j=1}^{J} z^2_{ij} t_i f_j $ and the answer for this problem is the first set of normalized vectors from a singular value decomposition on Z (line 8, \ref{alg1}), \cite{npls}. When $\mathbf{t}$ and $\mathbf{f}$ are extracted, we can find $\mathbf{u} = \mathcal{X} \times_1 (\mathbf{t} \otimes \mathbf{f})$. From the three latent factors, we can reconstruct the rank-1 model $\mathcal{X}_{model}$. This process will be repeated $R$ times, at each iteration a rank-1 component will be extracted from data and $\mathcal{X}_{rem}$ will be created, Fig. \ref{fig:workflow}-right. After finding the latent factors U, F and T, we can look at the importance of the features and discard the irrelevant features, then again we find the latent factors on the reduced dataset. \begin{algorithm} \caption{Supervised Tensor Embedding} \label{alg1} \begin{algorithmic}[1] \State input: $\mathcal{X}$ independent tensor, $y$ dependent variable \State parameters: $R$ - decomposition rank \State output: U, T, F \State Center $\mathcal{X}$ and $\mathbf{y}$ \State ${\mathcal{X}}_{rem} = \mathcal{X}$ \For{r = 1:R} \State $\mathbf{t}_r,\mathbf{f}_r \leftarrow $SVD(Z) \State $\mathbf{t}_r \leftarrow \mathbf{t}_r/||\mathbf{t}_r||,\mathbf{f}_r \leftarrow \mathbf{f}_r/||\mathbf{f}_r||$ \State $\mathbf{u}_r \leftarrow \mathcal{X}_{rem} \bar{\times}_1 (\mathbf{t}_r \otimes \mathbf{f}_r)$ \State $\mathcal{X}_{model} = \mathbf{u}_r \circ \mathbf{t}_r \circ \mathbf{f}_r$ \State $\mathcal{X}_{rem} = \mathcal{X}_{rem} - \mathcal{X}_{model}$ \EndFor \end{algorithmic} \end{algorithm} \subsubsection{Feature Selection} Given different desired target variables for the same input, not all the features are equally informative for the different targets. Therefore, a proper feature selection can improve predictability of the reduced sized input data. Although the STE model down weights the irrelevant features, it does not discard them. As a result, it is possible that a large number of irrelevant features can still contaminate the predictions. We use feature activation in the latent factors and drop the uninformative features. The feature activation vector defines the importance of each feature for the specific prediction task. We use the latent factor matrix F and extract the feature importance as following: \vspace{-3mm} \begin{equation*} FI_i = \sum_{r=1}^{R} f^2_{ri},~~~~ i=1,2,...,J \end{equation*} Given the feature importance score, any desired technique can be applied for feature selection. In this paper we have chosen filter methods and we pick top $K$ features and discard the others. \begin{figure*}[!htb] \centering \includegraphics[width=0.95\textwidth]{image/sl_bar7.png} \vspace{-4mm} \caption{Prediction performance (top:$R^2$, bottom: pearson correlation $\rho$) across different target variables, using STR, NPLS, PLS, CP methods.} \label{fig:SL} \end{figure*} \subsubsection{Regression model} Previously we introduced our supervised decomposition algorithm to obtain the user latent factors with high correlation with target variable of interest and then defined feature importance to discard irrelevant features. The latent factors can be used for exploration of active features, temporal trends and similar users given a certain target variable. Furthermore, we can apply any regression function $g(.)$ for inference of dependent variable. The parameter of our model would be number of features to keep, number of components, and parameters of the regression function $g(.)$, algorithm \ref{alg2}. \begin{algorithm} \caption{Supervised Tensor Regression}\label{alg2} \begin{algorithmic}[1] \State input: $\mathcal{X}$ independent tensor, $y$ dependent variable \State parameters: $K$ - number of features, $R$ - decomposition rank , $g(.)$- regression model \State output: $\hat{y}$ \State Compute component activation for each sensory variable using STE \State Form a reduced data tensor $\mathcal{X}_{reduced}$ consisting of only time series whose activation power is among top K variables \State Compute latent variables using STE \State Use user latent variables in a regression model to predict outcome $\hat{y} = g(U)$ \State Pick K and parameter of model $g(.)$ by cross validation \end{algorithmic} \end{algorithm} \section{Results} Our goal is to understand whether supervised decomposition can find the low-dimensional structure of daily life from wearable devices that better correlates with target behavioral constructs. We test our models along with CP, NPLS and PLS on two real world datasets described below. STR, CP, and NPLS were used to model the data in a tensor form, where PLS was used on a mode-1 matricized version of the same tensor. To compare the predictability, we compare coefficient of determination $R^2$ and pearson correlation $\rho$ obtained from each method. Because we have a small number of samples, we present the results on test set in a nested cross-validation, when in the train-validation set we tune the parameter of the model and then we present the result on test set. For STR method, we test different regression functions , with and without feature selection and we present the best result. Later in Figs. \ref{meshplots_studentlife} and \ref{svr_ridge}, we investigate the effect of feature selection and choice of regression function. We have repeated each experiment 20 times and have reported mean value for $R^2$ and $\rho$. In the bar graphs standard deviation is also reported. \subsection{StudentLife Data} StudentLife is a 10-week study conducted during 2013 spring semester on 48 Dartmouth students (30 undergraduate and 18 graduate students), \cite{StudentLife2014}. Psychometric data were collected from student via a pre-Assessment and post-assessment Survey. GPA was also collected at the end of the semester, which will be used as a measure of students academic performance. The other surveys include Big Five Inventory (BFI), Positive Affect and Negative Affect Schedule (PANAS), Perceived Stress scale \cite{cohen1983global}, UCLA loneliness scale \cite{russell1996ucla}, (PHQ9) \cite{kroenke2002phq}, flourishing scale \cite{diener2010new}, (VR12) \cite{vr12} measuring students of wellbeing, and Pittsburgh Sleep Quality Index (PSQI) \cite{b27} as a measure of health. \begin{figure*}[!htb] \centering \includegraphics[width=0.95\textwidth]{image/tl_bar7.png} \vspace{-4mm} \caption{Prediction performance (top:$R^2$, bottom: pearson correlation $\rho$) across different target variables, using STR, NPLS, PLS and CP.} \label{fig:tiles_bar} \end{figure*} Using the raw sensor data collected from students, physical activity (stationary, walk, run and unknown) and audio activity (silence, voice, noise and unknown) have been inferred. To create our tensor, each time unit comprises one day worth of data, and is divided into four time bins, bedtime (midnight-6 am), morning (6 am-12 pm), afternoon (12 pm-6 pm), and evening (6 pm-midnight). We extract duration (minutes) of running, walking, stationary, silence, voice, noise, and dark, per time-bin in each day. Frequency and number of changes in each behavior (e.g. from walking to running) for each time-bin has been also captured. From GPS and WiFi, the number of unique locations visited, and from Bluetooth, the number of unique nearby devices per time-bin are added to the variable set. We normalize all the variables across time dimension to have the same range $[0,1]$ to avoid variables with large values (e.g. duration in minutes) dominate the analysis. At the end, we organize our data as tensor $\mathcal{X}$ with $N=46$ individuals, $I=108$ features and $K=63$ days. Only 5\% of the tensor is missing, which we imputed by filling them with the mean value. Numbers of samples for different targets varies from 30 to 46, as not every participant had answered all the surveys. Figure \ref{fig:SL} presents the results for StudentLife dataset. In Figure \ref{fig:SL} we can see that $R^2$ has improved significantly for some of the target variables, e.g. negative effect, flourishing and sleep quality. Also it is worth mentioning that we are using only passively collected data for all prediction tasks, without using any EMA or self-report values by the participants as the features. \subsection{TILES Data} \label{tiles_data} Tracking Individual Performance with Sensors ({TILES}) study, is an ongoing research study of workplace performance which measures physical activity, social interaction, physiological state of employees (such as nurses) in a large university hospital setting. The study aims to collect data from more than 300 participants over a 10-week period during the spring, summer and fall of 2018. It includes sensor and health data, psychometrics and job performance measures. Sensor data were collected from garment-based wearable sensors (OmSignal) and wristbands (Fitbit). OmSignal is a Biometric Smartwear company that produces smart under shirts and bras. Their garments include health sensors embedded into the fabric that measure biometric data in real-time and can relay this information to the participant's smartphone. OMsignal sensor provides information such as heart rate, heart rate variability (HRV), breathing, and accelerometery (to provide sitting position, foot movement and more). Fitbit collects heart rate, steps, sleep and cardio information. Participants were asked to wear their Fitbit 24/7. However, they were instructed to wear OmSignal sensors only during their work shifts. It is worth mentioning that clinical staff in this study work a minimum of 3 days per week (in 12 hour shifts), which can be any day during weekdays or weekend. Also some belong to day shift and others to night-shift, which would be 7am-7pm or 7pm-7am, respectively. Psychometric data were collected from participants via pre- and post study surveys. These surveys measured job performance, cognitive ability, personality, affect, and health state and are used as our groundtruth in the models. More specifically, the target variables we predict in this dataset include the In-Role Behavior Scale \cite{b16}, Individual Task Proficiency Scale \cite{b17}, Shipley 2 \cite{b20}, Big Five Inventory (BFI) \cite{b21}, Positive Affect and Negative Affect Schedule (PANAS) \cite{b22}, State-Trait Anxiety Inventory (STAI) \cite{b23}, Alcohol use Disorders Identification Test (AUDIT) \cite{b24}, International Physical Activity Questionnaire (IPAQ) \cite{b26}, and Pittsburgh Sleep Quality Index (PSQI) \cite{b27}. For the experiments reported in this paper, we use the pre-survey scores provided by the participants (clinical staff in a large hospital) as the target variables for TILES dataset. Similar to the previous dataset, each time unit comprises one day's worth of data, and is divided into four time bins: bedtime (midnight-6 am), morning (6 am-12 pm), afternoon (12 pm-6 pm), and evening (6 pm-midnight). We extract a set of statistics such as mean, standard deviation, kurtosis, etc. from each time series from the OMSignal and Fitbit sensor streams, in each time-bin. TILES is an ongoing project and we have data for about 50 participants in the first wave of the data collected in spring which we use in this paper. We organize the data as tensor $\mathcal{X}$ with $I=50$ individuals, $J=1225$ features and $K=30$ days. About 60\% of the tensor is missing, which we imputed by filling them with the mean value for each time series. We tested our model for 15 different target variables in comparison with PLS, NPLS and CP plus a regression function. Similar to StudentLife dataset, we divided the data into train, validation and test set, and performed nested cross validation and report the result on test set, Fig. \ref{fig:tiles_bar}. \subsection{Analysis} Looking at 29 different predictions across two datasets, STR outperforms the other three methods in 21 tasks. Some of the constructs were not predictable with any of approaches which can be due to the lack of appropriate features, or inadequate feature engineering. Also it is possible tensor tri-linear models are not suitable for modeling those constructs, as by applying the no-free-lunch idea to all sorts of scientific problems it has been shown that different type of algorithms may work well for different type of problems, \cite{munoz2017instance}. The improvement in performance by STR comes from the partial contribution of 1) change in the deflation of $y$, 2) choice of regression function or 3) feature selection. In NPLS model, at each iteration, the estimated part of $y$ will be subtracted from it. By not subtracting the explained variation from $y$ every iteration, the cost would be higher correlation among the features. However, it will not come at the cost of less accurate performance for all constructs. In order to understand the effect of deflation of y, we use a simple ordinary least square model as regression function of STR with no feature selection on the time series and compare it with NPLS. For 10 target variables out of 29 total, both $R^2$ and $\rho$ improved. As another contribution, by separating the embedding and regression steps in STR model, the latent features can be tested and paired with the most appropriate regression function to improve the performance. For example, for negative affect from StudentLife dataset and shipley abstract from TILES, we have applied Ridge and linear SVM as two different regression models, which we can see SVR will lead to 4\% improvement in both $R^2$ and $\rho$, Fig. \ref{svr_ridge}. \begin{figure}[!htb] \centering \begin{tabular}{|*{8}{c|}} \hline \multicolumn{1}{|>{}c|}{} & \multicolumn{2}{c|}{negative affect} & \multicolumn{2}{c|}{shipely abs} \\ \arrayrulecolor{black} \cline{2-5} \multicolumn{1}{|>{}c|}{} & SVR & Ridge & SVR & Ridge \\ \hline r2 & 0.31 & 0.27 & 0.19 & 0.15 \\ \cline{1-4} \hline ro & 0.57 & 0.53 & 0.44 & 0.39 \\ \cline{1-4} \hline \end{tabular} \vspace{-1mm} \caption{The effect of using different regression models is present by two examples; StudentLife: negative affect, TILES: shipley abs} \label{svr_ridge} \end{figure} \begin{figure}[h] \centering \begin{subfigure}{.25\textwidth} \centering \includegraphics[width=0.9\textwidth]{image/fs_r2_2.png} \end{subfigure}% \begin{subfigure}{.25\textwidth} \centering \includegraphics[width=0.9\textwidth]{image/fs_ro_2.png} \end{subfigure} \begin{subfigure}{.25\textwidth} \centering \includegraphics[width=0.9\textwidth]{image/ipaq_r2_tiles_1.png} \end{subfigure}% \begin{subfigure}{.25\textwidth} \centering \includegraphics[width=0.9\textwidth]{image/ipaq_ro_tiles_1.png} \end{subfigure} \vspace{-3mm} \caption{Prediction performance (left: average $R^2$, right: average pearson correlation) versus number of latent factors (R) and number of selected features (K) for StudentLife: flourishing (top) and TILES: negative affect (bottom).} \label{meshplots_studentlife} \end{figure} Parameter selection effect has been demonstrated in Fig. \ref{meshplots_studentlife}, for $R^2$ and $\rho$ versus number of components and number of selected features. The best result for negative effect from StudenLife dataset is obtained at $K=50$ and $R=4$. Also we can see the effect of number of features $K$ and model rank $R$, Fig. \ref{meshplots_studentlife}. \subsection{Case Study: Student Performance} In this section we look at the temporal patterns obtained from different supervised decomposition tasks. One interesting observation is that GPA's first latent temporal factor increases towards end of the semester and depression's first latent temporal factor start decreasing around after mid-semester. The duration of being physically stationary in the afternoon, evening and midnight, the duration of audio silence, and the number of detected on-campus wifi locations are among the top features of the first latent factor of GPA. This inferred latent component can be an indicator of studying in a quiet environment (the studying factor). To obtain a better understanding of the correlation between depression and performance, we first looked at depression latent factor. The top activated features include running, walking during evening, duration of conversation in the morning, and the number of on-campus wifi locations. This latent behavior has features related to school engagement activity. We name it as "diminished interest in activities", as the temporal trend decreases over the second half of the semester, Fig. \ref{tempral_pattern_gpa}, green graph. For the students that have higher value in this latent factor, there was a higher chance of depression. The user latent factor of "diminished interest in activities" has a correlation of -0.9 with the studying user latent factor. It can mean that students who grow depressive symptoms over the semester have lower performance at the end of the semester. Recently in another study \cite{Wang:2018:TDD:3200905.3191775}, it has been observed that depression has negative correlation with the slope of the duration of time students spent in study places during the semester on-campus. \begin{figure}[h] \centering \begin{subfigure}{.5\textwidth} \centering \includegraphics[width=0.8\textwidth]{image/depression_gpa.png} \end{subfigure}% \vspace{-4mm} \caption{Temporal pattern of first temporal components associated with GPA and first temporal components associated with depression.} \label{tempral_pattern_gpa} \end{figure} \section{Conclusions and Future work} Rich multimodal data collected from wearable sensors (e.g. Fitbit), mobile phones, online social networks, etc is becoming increasingly available to reconstruct digital trails and study human behavior. In this paper, we use two real world datasets---TILES and StudentLife---collected using passive and mobile sensors, with the goal of inferring wellbeing, performance, and personality traits. We developed a learning framework based on \textit{supervised tensor embedding} to find latent space that is highly correlated with target variables of interest. This type of decomposition can uncover latent user factors which are strong predictors of target variables. Further we explore how variable selection can improve the prediction performance and propose a robust variable selection frame work. One limitation of our work is that the framework captures only linear structure. Another limitation in using prediction performance as a metric for selection of best rank and $K$ (number of top features). We plan to use kernel methods for nonlinear projection and defining information theoretic metrics for best embedding. Feature selection can be extended to be applied on latent features too. Also, as TILES study is an ongoing project, we plan to implement supervised predictions of individuals' performance and personality directly from different modalities, such as social media activity, location, audio. \section*{Acknowledgements} \bibliographystyle{aaai} \balance
\section{Introduction} We are given a set $J = \{1, 2, \dots,n\}$ of jobs to be scheduled on a set $M = \{1, 2, \dots,m\}$ of identical parallel machines. Each job $j \in J$ has a processing time $p_j$ and a penalty weight $w_j$. A schedule is feasible if each job is assigned to a unique machine and processed without preemption, and each machine processes at most one job at a time. Let $C_j$ define the completion time of job $j$, our goal is to find a feasible schedule for which the total weighted completion time, $\sum_{j=1}^{n} w_j C_j$, is a minimum. The problem is denoted as $P||\sum w_jC_j$ as in the three-field classification of \cite{Graham1979}. In the following, we suppose that processing times and penalty weights take integer values. The $P||\sum w_jC_j$ was proven to be $\mathcal{NP}$-hard by \cite{Bruno1974}. Despite being a classical production scheduling problem, with real-world applications, it has not received much attention in {the literature} and cannot be considered a well solved problem. To the best of our knowledge, state-of-the-art exact methods for the $P||\sum w_jC_j$ are the branch-and-bound algorithms developed by \cite{AzizogluandKirca19999b}, \cite{ChenandPowell1999} and \cite{vandenAkkeretal1999}, the last two of which make use of column generation techniques {to solve the relaxed problem at each node}. Aside from these works, the $P||\sum w_jC_j$ can be solved by adapting mathematical formulations originally developed for similar one machine or unrelated parallel machines problems. Among these formulations, we mention the {\em time indexed} (TI) \emph{mixed integer linear programming} (MILP) model by \cite{SousaWolsey1992}, the {convex integer quadratic programming} model by \cite{Skutella2001} {and the preemptive TI model by \cite{BulbulandSen2017}. According to our tests, these methods fail in solving some $P||\sum w_jC_j$ benchmark instances involving just 100 jobs. In this paper, we solve exactly large-size instances of the $P||\sum w_jC_j$ by focusing on the development of \emph{arc-flow} (AF) formulations. AF formulations represent the problem as a capacitated network with side constraints, and consist of a MILP model with a pseudo-polynomial number of variables and constraints. AF formulations have been used to model many combinatorial optimization problems (see, e.g., \citealt{W77} and \citealt{ValeriodeCarvalho1999}), and have recently obtained successful results on important areas such as bin packing and cutting stock problems (see, e.g., the recent survey by \citealt{Delorme2016}). \rev{For the area of scheduling, we are only aware of a very recent publication by \cite{MradAndSouayah2018} that presents an AF formulation for the problem of minimizing makespan on identical parallel machines.} In our work, we first propose a straight AF formulation, and then enhance it through a set of techniques that aim at reducing the number of variables and constraints by combining established \rev{reduction procedures} from the literature with some specific features of the $P||\sum w_j C_j$. This results in a powerful method that solves to proven optimality {large instances and provide low optimality gaps for very large instances.} The remainder of this paper is organized as follows. In the next Section \ref{sec:litreview}, we review the main literature, whereas in Section \ref{sec:mathform} we adapt to the $P||\sum w_j C_j$ some mathematical formulations {from the literature}. In Section \ref{sec:AF}, we present the straight and enhanced AF formulations. In Section \ref{sec:results}, we provide the outcome of extensive computational experiments and finally, in Section \ref{sec:conclusion}, we present some concluding remarks. \section{Literature review} \label{sec:litreview} {The $P||\sum w_jC_j$ is a generalization of $1||\sum C_j$, $1||\sum w_jC_j$ and $P||\sum C_j$, which are all solvable in polynomial time using the well known \emph{shortest processing time} (SPT) rule, or the {\em weighted shortest processing time} (WSPT) rule of \cite{Smith1956}. The WSPT rule sorts jobs according to non-increasing $w_j/p_j$. The $P||\sum w_jC_j$, on the contrary, is a difficult problem, and was proven to be $\mathcal{NP}$-hard even with just two machines ($P2||\sum w_jC_j$, see \citealt{Bruno1974}).} The literature on the $P||\sum w_jC_j$ focused on the development of early heuristic methods and exact {\em branch-and-bound} (B\&B) algorithms. \cite{Eastman1964} proposed a heuristic that uses a variant of the WSPT rule. \cite{Kawaguchi1986} showed that such heuristic guarantees a solution whose total weighted completion time is not worse than $(\sqrt{2}+1)/2$ times the optimal solution value. \cite{ElmaghrabyPark1974} proposed a B\&B based on the use of lower bounds and properties of optimal solutions. \rev{\cite{Sarinetal1988} improved the work by \cite{ElmaghrabyPark1974}, by proposing a new branching scheme that substantially reduces the number of schedules to be evaluated in the B\&B tree.} They solved instances with up to 30 jobs and 5 machines. \cite{BelouadahandPotts1994} incorporated Lagrangian relaxation in a B\&B based on a TI formulation, solving instances with up to 30 jobs and 8 machines. Another B\&B was designed by \cite{AzizogluandKirca19999b}, who used the same branching scheme of \cite{Sarinetal1988}, but enriched it with the lower bound of \cite{Webster1995}, solving instances with up to $35$ jobs and $5$ machines. \cite{ChenandPowell1999} tackled the $P||\sum w_j C_j$, the $Q||\sum w_j C_j$ and the $R||\sum w_j C_j$ by means of a \emph{set covering} (SC) formulation where each column corresponds to a single machine schedule. To deal with the large number of feasible schedules, they developed a {\em branch-and-price} (B\&P) method in which at each node of an enumeration tree a valid lower bound was obtained by column generation. In the same year, \cite{vandenAkkeretal1999} independently developed a similar B\&P. They focused only on the $P||\sum w_j C_j$, and obtained slightly better results than \cite{ChenandPowell1999} by branching on completion times instead of branching on variables that indicate whether a certain job is processed immediately after another job. Their B\&P solved $P||\sum w_j C_j$ instances with up to 100 jobs and 10 machines. \rev{Very recently, \cite{KowalczykandLeus2018} extended the method of \cite{vandenAkkeretal1999} by investigating the use of stabilization techniques, a generic branching rule (see \citealt{RyanandFoster1981}), and a {zero-suppressed binary decision diagram} approach (see \citealt{Minato1993}) for solving the pricing subproblem.} \cite{SousaWolsey1992} proposed a TI formulation to solve single machine scheduling problems with general objective function. Their formulation originates from early works on scheduling (see, e.g., \citealt{Bowman1959} and \citealt{PritskerEtAl1969}) and is easily adaptable to multiple machine problems. Recent literature focused on the related $R||\sum w_jC_j$, which considers unrelated parallel machines. \cite{Skutella2001} proposed a {\emph{convex integer quadratic programming} (CIQP)} relaxation as the basis for an approximation algorithm. In his approach, the problem is formulated as an integer quadratic programming model with $n \times m$ assignment variables. Then, integrality is relaxed and the objective function is convexified to obtain a CIQP relaxation that can be solved in polynomial time. Finally, the relaxed solution is transformed in a feasible solution by applying a randomized rounding method. Later on, \cite{PlateauandRiosSolis2010} embedded the CIQP relaxation by \cite{Skutella2001} in a branch-and-bound algorithm to obtain an exact approach. \cite{BulbulandSen2017} proposed a Benders decomposition method based on a TI formulation. Their formulation accepts preemptive solutions, but is proven to yield non-preemptive optimal solutions because of the use of tailored coefficients in the objective function. Their method obtained better results than those produced by the CIQP formulation. We also highlight the recent works by \cite{Rodriguezetal2012, Rodriguezetal2013}, who developed metaheuristic algorithms based on {GRASP} and iterated greedy paradigms, \rev{and tested them on instances having either unrelated or uniform machines. Note that we cannot compare with the literature on these instances, as our methods are specifically tailored for the case of identical machines.} We conclude this section by referring the interested reader to the review by \cite{LiandYang2009} on models, relaxations and algorithms for minimizing weighted completion times on parallel machines. Another review of models for parallel machines scheduling problems, which includes a computational evaluation of MILP models, was proposed by \cite{UnluandMason2010}. They classified the formulations into four different types according to the characteristics of their variables (TI variables, network variables, assignment variables, and positional date variables), and concluded that TI formulations tend to perform better than the others. \rev{A very recent review on preemptive models for scheduling problems with controllable processing times has been presented by \cite{SSS18}, who also included a section on methods based on flow computations.} \section{Existing mathematical formulations} \label{sec:mathform} In this section, we provide an overview of mathematical formulations for the $P||\sum w_jC_j$ that we obtained by adapting models originally presented for related problems. \subsection{Sousa and Wolsey's time indexed formulation}\label{TI} The TI formulation by \cite{SousaWolsey1992} was originally designed to deal with the problem of sequencing jobs over the time on a single machine subject to resource constraints. As previously highlighted, this formulation can be modified to consider parallel machines and weighted completion time as follows: \begin{align} (\mbox{TI}) \quad \min {\sum_{j \in J} \sum_{t = 0}^{T-p_j} w_j t x_{jt}} + \sum_{j \in J} w_j p_j \label{FO:TI}\\ \text{st.} \sum_{t = 0}^{T - p_j} x_{jt} = 1 & && j \in J \label{constr1:TI}\\ \sum_{j \in J} { \sum_{s = \max\{0, t+1-p_j\}}^{\min\{t,T+1-p_j\}} } x_{i s} \leq m & && t = 0,\dots,T-1 \label{constr2:TI}\\ x_{jt} \in \{0,1\} & && j \in J, t = 0, \dots, T-p_j \label{constr3:TI} \end{align} where $x_{jt}$ is a binary decision variable taking value $1$ if job $j$ starts its processing at time $t$, $0$ otherwise. The time horizon is defined by $T$ and should be sufficiently large to ensure optimality {and as short as possible to avoid the creation of unnecessary variables}. The objective function \eqref{FO:TI} seeks the minimization of the total weighted completion time. Note that we expressed the completion time of a job as the sum of starting time and processing time, formally using $C_j = \sum_t t x_{jt} + p_j$. The term $\sum_j w_jp_j$ is a constant and is thus irrelevant for the formulation. Constraints \eqref{constr1:TI} ensure that each job is processed exactly once. Constraints \eqref{constr2:TI} forbid overlapping among the jobs {by imposing that at most $m$ jobs are executed in parallel at any time. Constraints} \eqref{constr3:TI} define the variables' domain. Model \eqref{FO:TI}--\eqref{constr3:TI} contains a pseudo-polynomial number of variables, a common characteristic of TI formulations, which amounts to $\mathcal{O}(nT)$. \subsection{Skutella's convex integer quadratic programming formulation} \label{sec:CQP} The idea behind the method of \cite{Skutella2001} is to formulate the $R||\sum w_jC_j$ as an integer quadratic program and then convexify the objective function. His formulation uses $n \times m$ integer assignment variables and can be adapted to the $P||\sum w_jC_j$ as follows: \begin{align} (\mbox{CIQP}) \quad \min \sum_{j\in J} w_j C_j \label{FO:CQP}\\ \text{st.} \sum_{k \in M} x_{j}^{k} = 1 & && j \in J \label{constr1:CQP}\\ C_j = \sum_{k \in M} x_{j}^{k} \left( \frac{1+x_{j}^{k}}{2}p_j + \sum_{i \in J, i \prec j}x_{i}^{k}p_i \right) & && j \in J \label{constr2:CQP}\\ x_{j}^{k} \in \{0,1\} & && j \in J, k \in M\label{constr3:CQP} \end{align} where $x_j^k = 1$ if job $j$ is scheduled on machine $k$, $0$ otherwise. The notation $i \prec j$ in \eqref{constr2:CQP} means that either $(w_i/p_i > w_j/p_j)$ or $(w_i/p_i = w_j/p_j$ and $i < j)$. This is used to take into account that the jobs are scheduled on each machine by non-increasing order of $w_j/p_j$, i.e., by following the WSPT rule. The relaxation obtained by dropping integrality constraints from \eqref{constr3:CQP} can be solved easily. Indeed, \cite{Skutella2001} showed that $x_j^k = 1/m$ $\forall j \in J$ and $k \in M$ is an optimal solution to this relaxation when the machines are identical. The optimal integer solution {of model \eqref{FO:CQP}--\eqref{constr3:CQP}} can be obtained by invoking a commercial CIQP solver {such as CPLEX or Gurobi (as done by \citealt{PlateauandRiosSolis2010} for the $R||\sum w_jC_j$). \subsection{B{\"u}lb{\"u}l and {\c{S}}en's preemptive time indexed formulation}\label{sec:PeemptionTI} \cite{BulbulandSen2017} modeled the preemptive version of the $R||\sum w_jC_j$ by means of a \emph{preemptive time indexed} (PTI) formulation making use of $n \times m \times T$ continuous variables and $n \times m$ binary variables. Then, they proved that it is always possible to devise a non-preemptive solution having the same objective value of the optimal PTI preemptive one, concluding that the PTI model is optimal also for the (non-preemptive) $R||\sum w_jC_j$. Their formulation can be adapted to the $P||\sum w_jC_j$ as follows: \begin{align} (\mbox{PTI}) \quad \min \sum_{j \in J} \sum_{t = 1}^{T} \sum_{k \in M} \frac{w_j}{p_j}\left(t + \frac{p_j - 1}{2}\right) x_{jkt} \label{FO:PTI}\\ \text{s.t. } \sum_{t = 1}^{T} x_{jkt} = p_j y_{jk} & && j \in J, k \in M \label{constr1:PTI}\\ \sum_{j \in J} x_{jkt} \leq 1 & && k \in M, t = 1,\dots,T \label{constr2:PTI}\\ \sum_{k \in M} y_{jk} = 1 & && j \in J \label{constr3:PTI}\\ x_{jkt} \geq 0 & && j \in J, k \in M, t = 1,\dots,T \label{constr4:PTI}\\ y_{jk} \in \{0,1\} & && j \in J, k \in M \label{constr5:PTI} \end{align} where $x_{jkt}$ are continuous variables representing the quantity of job $j$, i.e., the number of unit-length parts of job $j$, which is finished at time $t$ on machine $k$, and $y_{jk}$ takes value $1$ if job $j$ is assigned to machine $k$, $0$ otherwise. Constraints \eqref{constr1:PTI} state that all unit-length parts of job $j$ must be processed on the same machine. Constraints \eqref{constr2:PTI} ensure that each machine processes at most one job at a time. Constraints \eqref{constr3:PTI} guarantee that each job is assigned to exactly one machine. Constraints \eqref{constr4:PTI} and \eqref{constr5:PTI} give the variables' domains. To tackle the pseudo-polynomial number of variables and constraints in the aforementioned model, the authors proposed a Benders decomposition approach. Their idea is to start by first solving a master problem composed by variables $y$ and constraints \eqref{constr3:PTI} and \eqref{constr5:PTI}, and obtain a solution $\bar{y}$. Then, solving a set of $m$ subproblems, each for a machine, that use the $\bar{y}$ solution but only involve variables $x$ and constraints \eqref{constr1:PTI}, \eqref{constr2:PTI} and \eqref{constr4:PTI}. The subproblems either deliver an optimal $P||\sum w_jC_j$ solution, or some optimality Benders cuts to be added to the master problem. This process is reiterated until proof of optimality or some stopping criteria are met. \subsection{Set covering formulation} \label{sec:SC} \emph{Set covering} (SC) formulations are widely used to model combinatorial optimization problems as covering problems. \cite{vandenAkkeretal1999} followed this idea and modeled the $P||\sum w_jC_j$ by using an SC formulation having an exponential number of variables. Let $S$ be a set containing all feasible schedules for a single machine, let $a_{js}$ be a binary coefficient indicating whether job $j \in J$ is included or not in schedule $s$, and let $x_s$ be a binary variable assuming value $1$ if schedule $s \in S$ is selected, $0$ otherwise. The $P||\sum w_jC_j$ can be modeled as: \begin{align} (\mbox{SC}) \quad \min \sum_{s \in S} c_s x_s \label{FO:SC}\\ \text{s.t. } \sum_{s \in S} x_s = m \label{constr1:SC}\\ \sum_{s \in S} a_{js} x_{s} = 1 & && j \in J \label{constr2:SC}\\ x_s \in \{0,1\} & && s \in S \label{constr3:SC} \end{align} Constraints \eqref{constr1:SC} state that exactly $m$ schedules are selected. Constraints \eqref{constr2:SC} ensure that each job is processed once, and constraints \eqref{constr3:SC} impose variables to be binary. As model \eqref{FO:SC}--\eqref{constr3:SC} has an exponential number of variables, the authors solved it with a branch-and-price algorithm. In particular, they solved each node of an enumeration tree by means of a column generation method, which looks for negative cost schedules by invoking a tailored \rev{ {\it dynamic programming} (DP) algorithm}. They performed branching by considering the minimum completion time of a fractional job. Let $\bar x$ be the current solution and $\bar S \subseteq S$ the set of schedules associated with positive $\bar x$ values. A fractional job is defined as a job $j$ for which $\sum_{s \in \bar S} C_j(s) \bar x_s > \min \{C_j(s) | \bar x_s > 0\}$, where $C_j(s)$ is the completion time of job $j$ in schedule $s$. Note that \cite{ChenandPowell1999} also proposed a branch-and-price algorithm to solve model \eqref{FO:SC}--\eqref{constr3:SC}, but, differently from \cite{vandenAkkeretal1999}, they performed branching directly on the $x$ variables. \section{Arc-flow formulations} \label{sec:AF} We first present a straight formulation, and then enhance \rev{it} with reduction procedures. \subsection{Straight arc-flow formulation} \label{subsec:SAF} AF formulations are an established combinatorial optimization technique that models problems by using flows on a capacitated network (see, e.g., \citealt{W77}). When applied to machine scheduling problems, \rev{the flow obtained by solving an AF formulation} can be easily decomposed into paths (see \citealt{AMO93}), so that each path corresponds to a schedule of activities on a machine. AF formulations make use of a pseudo-polynomial number of variables and constraints, and are thus related to the TI formulations that we previously described. The research effort behind AF is, however, to try to reduce as much as possible the required number of variables and constraints, thus keeping the size of the model as small as possible while preserving optimality. In our work, we follow the recent literature on AF, that, starting from \cite{ValeriodeCarvalho1999}, used these techniques to obtain good computational results on cutting and packing problems (see, e.g., \citealt{Delorme2016} for an updated survey), but we take into account issues that are typical of the scheduling field. Our AF formulation models the $P||\sum w_jC_j$ as the problem of finding $m$ independent paths that start from a source node $0$, end at a destination node $T$, and cover all the jobs. {For the sake of clarity, we start by presenting the very basic model, and focus later (in Algorithm \ref{alg:PandA}) on a first reduction of variables and constraints that is based on the WSPT sorting. Our very basic AF formulation} uses a direct acyclic multigraph $G = (N,A)$. The set of vertices $N \subseteq \{0, 1, \dots, T\}$ can be initially considered as the set of {\em normal patterns} (for which we refer to the seminal papers by \citealt{H72} and \citealt{CW77}, and to the recent discussion in \citealt{CI16}), i.e., the set of all the feasible combinations of jobs' processing times whose resulting value is between 0 and $T$. Let $J_{+} = J \cup \{0\}$ include the original set of jobs plus a dummy job $0$ {having $p_0 = 0$ and $w_0 = 0$.} The set of arcs is partitioned as $A = \cup_{j \in J_{+}} A_{j}$. Each $A_{j}$ represents the set of {\em jobs arcs} associated with job $j \in J$, and, {for the moment, let us define it} as $A_j = \{ (q,r,j): {r-q=p_j} \text{ and } q \in N \}$. In addition, $A_0$ represents the set of {\em loss arcs}, that are used to model the amount of idle time between the end of activities and $T$ on a machine, and is defined as $A_0 = \{ (q,T,0): q \in N\}$. Let us also use $\delta^{+}(q) \subseteq A$, respectively $\delta^{-}(q) \subseteq A$, to define the subset of arcs that emanate from, respectively enter, a given node $q \in N$. A feasible $P||\sum w_jC_j$ solution can be represented as a set of $m$ paths in $G$, each corresponding to a machine schedule that start in 0 and make use of jobs arcs and of possibly one last loss arc to reach $T$. To formulate the $P||\sum w_jC_j$ as an AF, we associate with each job arc $(q,r,j) \in A$ a variable $x_{qrj}$ that has a twofold meaning: for jobs arcs $(q,r,j) \in A_j$, $x_{qrj}$ takes value 1 if job $j$ is scheduled at start time $q$, 0 otherwise; for loss arcs $(q,T,0) \in A_0$, $x_{qT0}$ gives the \rev{number} of paths that end with arc $(q,T,0)$, i.e., that contain activities that finish at time $q$. The $P||\sum w_jC_j$ can then be modeled as: \begin{align} (\mbox{AF}) \quad \min \sum_{(q,r,j) \in A} w_j q x_{qrj} + \sum_{j \in J} w_j p_j \label{FO:AF}\\ \sum_{(q,r,j) \in \delta^{+}(q)} x_{qrj} - \sum_{(p,q,j) \in \delta^{-}(q)} x_{pqj} = \left\{ \begin{array}{l l} m, & \quad \text{ if $q = 0$}\\ -m, & \quad \text{ if $q = T$}\\ 0, & \quad \text{otherwise} \end{array}\right. & && q \in N\label{constr1:AF}\\ \sum_{(q,r,j) \in A} x_{qrj} \geq 1 & && j \in J \label{constr2:AF}\\ x_{qrj} \in \{0,1\} & && (q,r,j) \in A \setminus A_0 \label{constr3:AF}\\ 0 \leq x_{qT0} \leq m & && { (q,T,0) \in A_0} \label{constr4:AF} \end{align} The objective function \eqref{FO:AF} minimizes the sum of the weighted completion times. Constraints \eqref{constr1:AF} impose both flow conservation at each node and the use of exactly $m$ paths. Constraints \eqref{constr2:AF} impose all jobs to be scheduled, whereas constraints \eqref{constr3:AF} and \eqref{constr4:AF} give the variables' domains. Note that variables associated to loss arcs do not need to be defined as integers. A first, simple but very important rule can be used to decrease the number of {variables and constraints in the model}. As previously discussed, in any optimal solution of the $P||\sum w_jC_j$ the jobs are sequenced on each machine by following the WSPT rule. Consequently, only arcs fulfilling this sorting rule can be considered (the first job in the order can only start in 0, the second job can start in 0 or right after the first job, and so on). The procedure that we implemented to build the underlying AF multi-graph, given in Algorithm \ref{alg:PandA}, takes this fact into consideration, producing a first reduction {of the size of sets $N$ and $A$, and hence of the number of variables and constraints in the formulation}. The procedure initializes the set of nodes and arcs to the empty set. It then considers one job $j$ at a time, according to the WSPT rule, to create the $A_j$ sets at steps 4--7. The sets of nodes and of loss arcs are constructed at steps 8--9, and the overall set of arcs at step 10. \begin{algorithm}[htb] \caption{Construction of the AF multi-graph}\label{alg:PandA} \begin{algorithmic}[1] \Procedure {Create\_Patterns\_and\_Arcs}{$T$} \State {\bf{initialize}} $P[0 \dots T] \gets 0;$ {\footnotesize {\color{gray} \Comment $P$: array of size $T+1$}} \State {\bf{initialize}} $N \gets \emptyset; A[0 \dots n] \gets \emptyset;$ {\footnotesize {\color{gray} \Comment $N$: set of {vertices}; $A$: set of arcs}} \State $P[0] \gets 1;$ \For {$j \in J$ according to the WSPT rule} \For {$t \gets T - p_j$ down to $0$} \If {$P[t] = 1$} $P[t + p_j] \gets 1; \rev{A[j] \gets A[j]} \cup \{(t, t + p_j,j)\}; $ {\footnotesize {\color{gray} \Comment \rev{$A[j]$}: set of job arcs of $j$}} \EndIf \EndFor \EndFor \For {$t \gets 0$ to $T$} \If {$P[t] = 1$} {$N \gets N \cup \{t\}$}; $\rev{A[0] \gets A[0]} \cup \{(t, T, 0)\}$ {\footnotesize {\color{gray} \Comment \rev{$A[0]$}: set of loss arcs}} \EndIf \EndFor \State $A \gets \cup_{j \in J+} \rev{A[j]}$ \State \bf{return} $N, A$ \EndProcedure \end{algorithmic} \end{algorithm} To ease comprehension, we present a simple example with 4 jobs, 2 machines, and $T = 8$ {(\rev{details on how to compute a strict value of $T$ are given} in Section \ref{sec:method} below)}. The characteristics of the 4 jobs and their sorting according to the WSPT rule are given in Figure \ref{fig:Ex1Alg1a}. The AF multi-graph built by Algorithm \ref{alg:PandA} is given in Figure \ref{fig:Ex1Alg1b}, and contains 9 vertices, 11 job arcs, and 7 loss arcs. An optimal solution is provided in Figure \ref{fig:Ex1Alg1c}, where we highlight the 2 paths corresponding to the machine schedules. \begin{figure}[htb] \centering \subfloat[Input data ($T=8$)]{ \label{fig:Ex1Alg1a} \footnotesize \begin{tabular}{ccccH} \toprule $j$ & $p_{j}$ & $w_{j}$ & $w_{j}/p_{j}$ &{WSPT rank} \\ \cmidrule(r){1-1} \cmidrule(r){2-5} 1 & 2 & 4 & 2.00 & 1\\ 2 & 5 & 7 & 1.40 & 2\\ 3 & 1 & 1 & 1.00 & 3\\ 4 & 4 & 3 & 0.75 & 4\\ \bottomrule \end{tabular} }\\ \subfloat[AF formulation]{ \label{fig:Ex1Alg1b} \centering \begin{tikzpicture}[thick, scale=0.90, every node/.style={transform shape}, >=stealth', dot/.style = {draw, fill = white, circle, inner sep = 0pt, minimum size = 4pt}] \draw[very thin, color=black!50] (0,0) -- (16,0) \node (nT) at (16,0.5){T};\draw[color=red] (16,0.35) -- (16,-0.35); \node (n0) at (0,-0.5){$0$}; \draw[very thin, color=black!50] (0,0.2) -- (0,-0.2);\draw[color=black] (0,0.35) -- (0,-0.35); \node (n1) at (2,-0.5){$1$};\draw[very thin, color=black!50] (2,0.2) -- (2,-0.2); \node (n2) at (4,-0.5){$2$};\draw[very thin, color=black!50] (4,0.2) -- (4,-0.2); \node (n3) at (6,-0.5){$3$};\draw[very thin, color=black!50] (6,0.2) -- (6,-0.2); \node (n4) at (8,-0.5){$4$};\draw[very thin, color=black!50] (8,0.2) -- (8,-0.2); \node (n5) at (10,-0.5){$5$};\draw[very thin, color=black!50] (10,0.2) -- (10,-0.2); \node (n6) at (12,-0.5){$6$};\draw[very thin, color=black!50] (12,0.2) -- (12,-0.2); \node (n7) at (14,-0.5){$7$};\draw[very thin, color=black!50] (14,0.2) -- (14,-0.2); \node (n8) at (16,-0.5){$8$}; \draw[red, double, line width=0.1mm, ->] (0,0) to [out=40,in=140] (4,0); \draw[black, thin, ->] (0,0) to [out=-40,in=-140] (10,0); \draw[black, thin, ->] (4,0) to [out=-40,in=-140] (14,0); \draw[red, dotted, ->] (0,0) to [out=-50,in=-120] (2,0); \draw[red, dotted, ->] (4,0) to [out=-50,in=-120] (6,0); \draw[red, dotted, ->] (10,0) to [out=-50,in=-120] (12,0); \draw[red, dotted, ->] (14,0) to [out=-50,in=-120] (16,0); \draw[black, dashdotted, thin, ->] (0,0) to [out=40,in=140] (8,0); \draw[black, dashdotted, thin, ->] (2,0) to [out=40,in=140] (10,0); \draw[black, dashdotted, thin, ->] (4,0) to [out=40,in=140] (12,0); \draw[black, dashdotted, thin, ->] (6,0) to [out=40,in=140] (14,0); \draw[gray, dashed, thin, ->] (2,0) to [out=-40,in=-140] (16,0); \draw[gray, dashed, thin, ->] (4,0) to [out=-40,in=-140] (16,0); \draw[gray, dashed, thin, ->] (6,0) to [out=-40,in=-140] (16,0); \draw[gray, dashed, thin, ->] (8,0) to [out=-40,in=-140] (16,0); \draw[gray, dashed, thin, ->] (10,0) to [out=-40,in=-140] (16,0); \draw[gray, dashed, thin, ->] (12,0) to [out=-40,in=-140] (16,0); \draw[gray, dashed, thin, ->] (14,0) to [out=-40,in=-140] (16,0); \draw[red, double, line width=0.1mm, -](0,-1.5) to (1,-1.5);\node (j2) at (1.7,-1.5){\footnotesize{job 1}}; \draw[black, thin, -](0,-1.8) to (1,-1.8);\node (j1) at (1.7,-1.8){\footnotesize{job 2}}; \draw[red, dotted, -](0,-2.1) to (1,-2.1);\node (j3) at (1.7,-2.1){\footnotesize{job 3}}; \draw[black, dashdotted, thin, -](0,-2.4) to (1,-2.4);\node (j4) at (1.7,-2.4){\footnotesize{job 4}}; \draw[gray, dashed, thin, -](0,-2.7) to (1,-2.7);\node (j0) at (1.7,-2.7){\footnotesize{loss arcs}}; \end{tikzpicture} }\\ \subfloat[Optimal solution value = 67]{ \label{fig:Ex1Alg1c} \centering \begin{tikzpicture}[thick, scale=0.90, every node/.style={transform shape}, >=stealth', dot/.style = {draw, fill = white, circle, inner sep = 0pt, minimum size = 4pt}] \draw[very thin, color=black!50] (0,0) -- (16,0) \node (nT) at (16,0.5){T};\draw[color=red] (16,0.35) -- (16,-0.35); \node (n0) at (0,-0.5){$0$}; \draw[very thin, color=black!50] (0,0.2) -- (0,-0.2);\draw[color=black] (0,0.35) -- (0,-0.35); \node (n1) at (2,-0.5){$1$};\draw[very thin, color=black!50] (2,0.2) -- (2,-0.2); \node (n2) at (4,-0.5){$2$};\draw[very thin, color=black!50] (4,0.2) -- (4,-0.2); \node (n3) at (6,-0.5){$3$};\draw[very thin, color=black!50] (6,0.2) -- (6,-0.2); \node (n4) at (8,-0.5){$4$};\draw[very thin, color=black!50] (8,0.2) -- (8,-0.2); \node (n5) at (10,-0.5){$5$};\draw[very thin, color=black!50] (10,0.2) -- (10,-0.2); \node (n6) at (12,-0.5){$6$};\draw[very thin, color=black!50] (12,0.2) -- (12,-0.2); \node (n7) at (14,-0.5){$7$};\draw[very thin, color=black!50] (14,0.2) -- (14,-0.2); \node (n8) at (16,-0.5){$8$}; \draw[red, double, line width=0.1mm, ->] (0,0) to [out=40,in=140] (4,0); \draw[black, thin, ->] (0,0) to [out=-40,in=-140] (10,0); \draw[red, dotted, ->] (4,0) to [out=-50,in=-120] (6,0); \draw[black, dashdotted, thin, ->] (6,0) to [out=40,in=140] (14,0); \draw[gray, dashed, thin, ->] (10,0) to [out=-40,in=-140] (16,0); \draw[gray, dashed, thin, ->] (14,0) to [out=-40,in=-140] (16,0); \draw[red, double, line width=0.1mm, -](0,-1.5) to (1,-1.5);\node (j2) at (1.7,-1.5){\footnotesize{job 1}}; \draw[black, thin, -](0,-1.8) to (1,-1.8);\node (j1) at (1.7,-1.8){\footnotesize{job 2}}; \draw[red, dotted, -](0,-2.1) to (1,-2.1);\node (j3) at (1.7,-2.1){\footnotesize{job 3}}; \draw[black, dashdotted, thin, -](0,-2.4) to (1,-2.4);\node (j4) at (1.7,-2.4){\footnotesize{job 4}}; \draw[gray, dashed, thin, -](0,-2.7) to (1,-2.7);\node (j0) at (1.7,-2.7){\footnotesize{loss arcs}}; \end{tikzpicture} } \caption{Example of AF formulation} \label{fig:Ex1Alg1} \end{figure} \rev{We now notice a relevant property of the AF formulation. \begin{proposition} The AF formulation \eqref{FO:AF}--\eqref{constr4:AF} is equivalent to the TI formulation \eqref{FO:TI}--\eqref{constr3:TI}. \end{proposition} \begin{proof} Our proof uses arguments similar to that adopted in \cite{ValeriodeCarvalho2002} for the proof of his Proposition 5.1 (which shows the equivalence of the AF and TI formulations for the cutting stock problem). To simplify the reasoning, we consider a basic AF formulation in which the vertices set $N$ contains all nodes from $0$ to $T$ (i.e., we do not apply the reduction due to the normal patterns) and the arc set contains all the job and loss arcs. Moreover, we substitute the `$\geq$' sign in \eqref{constr2:AF} with the `$=$' sign, without loosing optimal solutions because any solution selecting more than one arc for the same job can be improved by choosing only one of these arcs. Remind that the three indices of the $x$ variables in AF are introduced to simplify the writing of the model, but only two indices are necessary. Indeed, job arc $(q,r,j)$ is introduced only when $r = q+p_j$, and hence $x_{qrj}$ is set to one, in AF, if job $j$ starts at time $q$, as $x_{jt}$ is set to one, in TI, when job $j$ starts at time $t$. Using this observation one can see that the objective functions \eqref{FO:AF} and \eqref{FO:TI} are equivalent. Both constraints \eqref{constr2:AF} in AF (with the `$=$' sign) and constraints \eqref{constr1:TI} in TI impose that a single starting time for each job $j$ is chosen. We conclude the proof by showing that the remaining constraints in AF and TI are equivalent, by using an unimodular transformation, similar to the one in \cite{ValeriodeCarvalho2002}. To better understand this transformation we refer to the example of Figure \ref{fig:Ex1Alg1}, having two machines, four jobs and an upper bound $T=8$ for the completion of all jobs. In Figure \ref{fig:UT_ti} we report the constraint matrix of constraints \eqref{constr2:TI} in TI, while in Figure \ref{fig:UT_af} we report the constraint matrix of the flow conservation constraints \eqref{constr1:AF} in AF (note that in the TI matrix we added an empty row corresponding to $t=T$, for easier comparison with the AF matrix). In the TI matrix we have a column for each starting time of each job. In the AF formulation the first part of the matrix refers to the job arcs, while the last part report on the loss arcs used to model the empty space in the machines. In the first part of the two matrices there is a column by column correspondence: variable $x_{qrj}$ in AF defines a possible starting time of job $j$ at time $q$, exactly as variable $x_{jq}$ do in TI. Consider the AF constraint matrix and, for each $t=0,\dots, T$, let us substitute the $t$-th flow conservation constraint with the sum of the first $t+1$ constraints \eqref{constr1:AF}, thus obtaining an equivalent constraint matrix. The resulting matrix is depicted in Figure \ref{fig:UT_afut}. One can note that the first part of the new constraint matrix is identical to the first part of the TI matrix. In the second part we have the same r.h.s. as in TI, but equal sign instead of `$\leq$' sign. However, each constraint $t$ is completed with the sum of the first $t+1$ loss arcs: $\sum_{q=0}^t x_{qT0}$, thus giving at least one slack variable available for each constraint. It follows that the new matrix is equivalent to the TI matrix, which conclude the proof. \end{proof}} \begin{figure}[htbp] \centering \scriptsize \setlength{\tabcolsep}{0.5mm} \subfloat[Time-indexed formulation]{ \label{fig:UT_ti} \rev{ \begin{tabular}{r|p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}|p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}} \toprule \multicolumn{1}{l|}{$t$} & \multicolumn{1}{l}{\begin{sideways}$x_{10}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{2 0}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{30}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{40}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{11}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{21}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{31}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{41}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{12}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{22}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{32}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{42}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{13}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{23}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{33}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{43}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{14}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{24}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{34}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{44}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{15}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{25}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{35}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{45}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{16}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{26}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{36}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{46}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{17}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{27}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{37}$\end{sideways}} & \multicolumn{1}{l|}{\begin{sideways}$x_{47}$\end{sideways}} & & & & & & & & & & \multicolumn{1}{l}{\begin{sideways}\end{sideways}} \\ \midrule 0 & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & $\leq$ & \multicolumn{1}{r}{2} \\ 1 & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & $\leq$ & \multicolumn{1}{r}{2} \\ 2 & & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & & & & & & & & & & & & & & & & & & & & & & & & & & & & $\leq$ & \multicolumn{1}{r}{2} \\ 3 & & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & & & & & & & & & & & & & & & & & & & & & & & & $\leq$ & \multicolumn{1}{r}{2} \\ 4 & & \multicolumn{1}{r}{1} & & & & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & & & & & & & & & & & & & & & & & & & & $\leq$ & \multicolumn{1}{r}{2} \\ 5 & & & & & & \multicolumn{1}{r}{1} & & & & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & & & & & & & & & & & & & & & & & & $\leq$ & \multicolumn{1}{r}{2} \\ 6 & & & & & & & & & & \multicolumn{1}{r}{1} & & & & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & & & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & & & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & & & & & & & & & & & & & & $\leq$ & \multicolumn{1}{r}{2} \\ 7 & & & & & & & & & & & & & & \multicolumn{1}{r}{1} & & & & & & \multicolumn{1}{r}{1} & & & & & \multicolumn{1}{r}{1} & & & & & & \multicolumn{1}{r}{1} & & & & & & & & & & $\leq$ & \multicolumn{1}{r}{2} \\ 8 & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & $\leq$ & \multicolumn{1}{r}{0} \\ \bottomrule \multicolumn{43}{l}{}\\ \end{tabular} } }\\ \subfloat[Arc-flow formulation]{ \label{fig:UT_af} \rev{ \begin{tabular}{r|p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}|p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}} \toprule \multicolumn{1}{l|}{$q$} & \multicolumn{1}{l}{\begin{sideways}$x_{021}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{05 2}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{013}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{044}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{131}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{162}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{123}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{154}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{241}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{272}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{233}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{264}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{351}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{382}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{343}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{374}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{461}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{492}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{453}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{484}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{571}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{5102}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{563}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{594}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{681}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{6112}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{673}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{6104}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{791}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{7122}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{783}$\end{sideways}} & \multicolumn{1}{l|}{\begin{sideways}$x_{7114}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{080}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{180}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{280}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{380}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{480}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{580}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{680}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{780}$\end{sideways}} & & \multicolumn{1}{l}{\begin{sideways}\end{sideways}} \\ \midrule 0 & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & & & & & & & & & & & & & & & & & & & & & & & & & & & & \multicolumn{1}{r}{1} & & & & & & & & = & \multicolumn{1}{r}{2} \\ 1 & & & \multicolumn{1}{r}{-1} & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & & & & & & & & & & & & & & & & & & & & & & & & & \multicolumn{1}{r}{1} & & & & & & & = & \multicolumn{1}{r}{0} \\ 2 & \multicolumn{1}{r}{-1} & & & & & & \multicolumn{1}{r}{-1} & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & & & & & & & & & & & & & & & & & & & & & & \multicolumn{1}{r}{1} & & & & & & = & \multicolumn{1}{r}{0} \\ 3 & & & & & \multicolumn{1}{r}{-1} & & & & & & \multicolumn{1}{r}{-1} & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & & & & & & & & & & & & & & & & & & & \multicolumn{1}{r}{1} & & & & & = & \multicolumn{1}{r}{0} \\ 4 & & & & \multicolumn{1}{r}{-1} & & & & & \multicolumn{1}{r}{-1} & & & & & & \multicolumn{1}{r}{-1} & & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & & & & & & & & & & & & & & & & \multicolumn{1}{r}{1} & & & & = & \multicolumn{1}{r}{0} \\ 5 & & \multicolumn{1}{r}{-1} & & & & & & \multicolumn{1}{r}{-1} & & & & & \multicolumn{1}{r}{-1} & & & & & & \multicolumn{1}{r}{-1} & & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & & & & & & & & & & & & & & & \multicolumn{1}{r}{1} & & & = & \multicolumn{1}{r}{0} \\ 6 & & & & & & \multicolumn{1}{r}{-1} & & & & & & \multicolumn{1}{r}{-1} & & & & & \multicolumn{1}{r}{-1} & & & & & & \multicolumn{1}{r}{-1} & & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & & & & & & & & & & & & \multicolumn{1}{r}{1} & & = & \multicolumn{1}{r}{0} \\ 7 & & & & & & & & & & \multicolumn{1}{r}{-1} & & & & & & \multicolumn{1}{r}{-1} & & & & & \multicolumn{1}{r}{-1} & & & & & & \multicolumn{1}{r}{-1} & & & & \multicolumn{1}{r}{1} & & & & & & & & & \multicolumn{1}{r}{1} & = & \multicolumn{1}{r}{0} \\ 8 & & & & & & & & & & & & & & \multicolumn{1}{r}{-1} & & & & & & \multicolumn{1}{r}{-1} & & & & & \multicolumn{1}{r}{-1} & & & & & & \multicolumn{1}{r}{-1} & & \multicolumn{1}{r}{-1} & \multicolumn{1}{r}{-1} & \multicolumn{1}{r}{-1} & \multicolumn{1}{r}{-1} & \multicolumn{1}{r}{-1} & \multicolumn{1}{r}{-1} & \multicolumn{1}{r}{-1} & \multicolumn{1}{r}{-1} & = & \multicolumn{1}{r}{-2} \\ \bottomrule \multicolumn{43}{l}{}\\ \end{tabular}% } }\\ \subfloat[Arc-flow formulation after unimodular transformation]{ \label{fig:UT_afut} \rev{ \begin{tabular}{r|p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}|p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}p{2.5mm}} \toprule \multicolumn{1}{l|}{$q$} & \multicolumn{1}{l}{\begin{sideways}$x_{021}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{05 2}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{013}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{044}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{131}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{162}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{123}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{154}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{241}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{272}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{233}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{264}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{351}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{382}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{343}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{374}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{461}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{492}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{453}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{484}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{571}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{5102}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{563}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{594}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{681}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{6112}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{673}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{6104}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{791}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{7122}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{783}$\end{sideways}} & \multicolumn{1}{l|}{\begin{sideways}$x_{7114}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{080}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{180}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{280}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{380}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{480}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{580}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{680}$\end{sideways}} & \multicolumn{1}{l}{\begin{sideways}$x_{780}$\end{sideways}} & & \multicolumn{1}{l}{\begin{sideways}\end{sideways}} \\ \midrule 0 & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & & & & & & & & & & & & & & & & & & & & & & & & & & & & \multicolumn{1}{r}{1} & & & & & & & & = & \multicolumn{1}{r}{2} \\ 1 & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & & & & & & & & & & & & & & & & & & & & & & & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & & & & & & = & \multicolumn{1}{r}{2} \\ 2 & & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & & & & & & & & & & & & & & & & & & & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & & & & & = & \multicolumn{1}{r}{2} \\ 3 & & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & & & & & & & & & & & & & & & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & & & & = & \multicolumn{1}{r}{2} \\ 4 & & \multicolumn{1}{r}{1} & & & & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & & & & & & & & & & & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & & & = & \multicolumn{1}{r}{2} \\ 5 & & & & & & \multicolumn{1}{r}{1} & & & & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & & & & & & & & & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & & = & \multicolumn{1}{r}{2} \\ 6 & & & & & & & & & & \multicolumn{1}{r}{1} & & & & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & & & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & & & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & & & & & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & & = & \multicolumn{1}{r}{2} \\ 7 & & & & & & & & & & & & & & \multicolumn{1}{r}{1} & & & & & & \multicolumn{1}{r}{1} & & & & & \multicolumn{1}{r}{1} & & & & & & \multicolumn{1}{r}{1} & & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & \multicolumn{1}{r}{1} & = & \multicolumn{1}{r}{2} \\ 8 & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & = & \multicolumn{1}{r}{0} \\ \bottomrule \end{tabular} } } \caption{\rev{Illustration of the equivalence between TI and AF on the example of Figure \ref{fig:Ex1Alg1}}} \label{fig:UT} \end{figure} \subsection{Enhanced arc-flow formulation}\label{sec:method} In this section, we show how to further reduce the number of variables and constraints required by the AF formulation \eqref{FO:AF}--\eqref{constr4:AF}, improving its computational behavior while preserving optimality. The size of the AF formulation linearly depends from the horizon $T$, thus, a proper time horizon estimation is necessary. To this aim, we notice that \cite{vandenAkkeretal1999} considered the properties of an optimal schedule, originally developed by \cite{ElmaghrabyPark1974}, and remarked that there exists at least an optimal solution for which ``the last job on any machine is completed between time $H_{\min} = \frac{1}{m}\sum_{j \in J} p_j - \frac{(m-1)}{m}p_{\max}$ and $H_{\max} = \frac{1}{m}\sum_{j \in J} p_j + \frac{(m-1)}{m}p_{\max}$", where $p_{\max} = \max\nolimits_{j\in J} p_j$. On the basis of this statement, we can use $H_{\max}$ to set $T$ as \begin{equation}\label{eq:T} T = \left\lfloor\frac{1}{m}\sum\nolimits_{j\in J} p_j + \frac{(m-1)}{m} p_{\max} \right\rfloor\\ \end{equation} We can then use the value of $H_{\min}$ to limit the number of loss arcs. As the last job on any machine is completed at or after $H_{\min}$, we can create only loss arcs starting from vertices $q \in N$ with $q \geq \lceil H_{\min} \rceil$. We further increase this bound by considering Property 1 in \cite{AzizogluandKirca19999b}, thus obtaining \begin{equation} \label{eq:Tbar_b} T' = \left\lceil\frac{1}{m}\sum\nolimits_{j\in J} p_j - \frac{ \sum_{k = 1}^{m-1}\bar{p}_k }{m} \right\rceil\\ \end{equation} where $\bar{p}$ is an array containing the processing times of all jobs $j \in J$ in non-increasing order. Since $\sum_{k = 1}^{m-1}\bar{p}_k \leq (m-1)p_{\max}$ holds, the value in \eqref{eq:Tbar_b} is not less than $H_{\min}$. Our next enhancement relies on the creation of a so-called \emph{time window} $[a_j, b_j]$ for each job $j \in J$. By using once more the properties of an optimal schedule in \cite{vandenAkkeretal1999}, we derive an earliest possible start time $a_j$ and a latest possible start time $b_j$ that guarantee the existence of an optimal solution. The values of $a_j$ and $b_j$ are based on the property that, if $w_j \geq w_k$ and $p_j \leq p_k$ for a certain pair of jobs $j$ and $k$, then there exists an optimal solution in which $j$ starts not later than $k$. The time windows are computed as follows. For each $j \in J$, we first define $\mathcal{P}_j = \{ k \in J: k < j, w_k \geq w_j, p_k \leq p_j \}$ and $\mathcal{L}_j = \{ k \in J: k > j, w_k \leq w_j, p_k \geq p_j \}$. Following the aforementioned property, there exists an optimal schedule in which all jobs in $\mathcal{P}_j$ start no later than $j$, so, if $\mathcal{P}_j$ contains at least $m$ elements, one may conclude that at least $|\mathcal{P}_j|-m+1$ jobs in $\mathcal{P}_j$ are finished before $j$ starts being processed. Consequently, if $|\mathcal{P}_j| < m$ we set $a_j = 0$, otherwise we set $a_j = \lceil \rho_j/m \rceil$, where $\rho_j$ is the sum of the $|\mathcal{P}_j|-m+1$ smallest processing times. In an analogous mode, one can note that there is an optimal solution in which $j$ starts no later than the jobs in $\mathcal{L}_j$. Consequently, for each job $j \in J$ a maximum starting time can be set as $b_j = T - \left\lceil \left(\sum_{k \in \mathcal{L}_j} p_k + p_j \right)/m \right\rceil$. In addition, if $\mathcal{L}_j = \emptyset$ then, as stated in \cite{BelouadahandPotts1994}, one can set ${b}_j = \lceil \left(\sum_{k \in J} p_k - p_j\right)/m \rceil$. The next procedure that we propose attempts to reduce the number of arcs by grouping together identical jobs. To this aim, we merge together all jobs $j \in J$ having identical $p_j$ and $w_j$ values into {\em job types}. Let $J^{\prime} = \{1, 2, \dots,n^{\prime}\}$ be the resulting set of job types, and $d_j$ be the number of jobs contained in each job type. With respect to the original AF formulation, this change involve creating a different set of arcs $A^{\prime}$ and replacing the original binary variables with integer variables, as shown next. This allows to reduce consistently the number of symmetries in the model. The time windows for each job type $j \in J^{\prime}$ are simply obtained by setting $a_j = \min \{a_k: k \in J, p_k = p_j, w_k = w_j\}$ and $b_j = \max \{b_k: k \in J, p_k = p_j, w_k = w_j\}$. We then create only arcs that start in a time $q \in [a_j, b_j]$, for each job type $j \in J^{\prime}$. Our {\em enhanced arc flow formulation} (EAF) is then: \begin{align} (\mbox{EAF}) \quad \min \sum_{(q,r,j) \in A'} w_j q x_{qrj} + \sum_{j \in J'} w_j p_j \label{FO:EAF}\\ \sum_{(q,r,j) \in \delta'^{+}(q)} x_{qrj} - \sum_{(p,q,j) \in \delta'^{-}(q)} x_{pqj} = \left\{ \begin{array}{l l} m, & \quad \text{ if $q = 0$}\\ -m, & \quad \text{ if $q = T$}\\ 0, & \quad \text{otherwise} \end{array}\right. & && q \in N'\label{constr1:EAF}\\ \sum_{(q,r,j) \in A'} x_{qrj} \geq d_j & && j \in J' \label{constr2:EAF}\\ x_{qrj} \in \{0,\dots,d_j\} & && (q,r,j) \in A' \setminus A'_0\label{constr3:EAF}\\ 0 \leq x_{qT0} \leq m & && { (q,T,0) \in A'_0} \label{constr4:EAF} \end{align} The EAF model \eqref{FO:EAF}--\eqref{constr4:EAF} is based on a reduced multigraph $G'=(N', A')$, in which both sets of nodes and arcs are obtained by applying the above reductions criteria from the original graph $G$ used for AF. The EAF model considers the set of job types $J'$ instead of that of jobs $J$ in AF, and consequently adopts an integer variable $x_{qrj}$ giving the \rev{number of jobs of type} $j$ that are scheduled from $q$ to $r=q+p_j$. Each variable of this \rev{type might take a value} at {most} $d_j$, as stated in constraints \eqref{constr3:EAF}. \rev{Constraints} \eqref{constr1:EAF} impose flow conservation on the $m$ paths, and constraints \eqref{constr2:EAF} impose demand to be satisfied. The way in which the EAF multi-graph $G'$ is built is shown in Algorithm \ref{alg:PandA_2}, which updates the previous Algorithm \ref{alg:PandA} used for AF. The procedure initializes the sets $N'$ and $A'$ of nodes and arcs, respectively, to the empty set. It then considers at steps 4--9 one job type $j$ at a time, according to the WSPT rule, and creates the $A^{\prime}_j$ sets keeping into account that each job type $j$ contains $d_j$ identical jobs and should start at a $q \in [a_j,b_j]$. \begin{algorithm}[htb] \caption{Construction of the EAF multi-graph} \label{alg:PandA_2} \begin{algorithmic}[1] \Procedure {CreatePatterns\_and\_Arcs}{$T$} \State {\bf{initialize}} $P[0 \dots T] \gets 0;$ {\footnotesize {\color{gray} \Comment $P$: array of size $T+1$}} \State {\bf{initialize}} $N' \gets \emptyset; A'[0 \dots n] \gets \emptyset;$ {\footnotesize {\color{gray} \Comment $N'$: set of {vertices}; $A'$: set of arcs}} \State $P[0] \gets 1;$ \For {$j \in J'$ according to the WSPT rule} \For {$t \gets b_j$ down to $a_j$} \If {$P[t] = 1$} \For {$q \gets 1$ to $d_j$} \If { {$t + q p_j \leq b_j$} } { $P[t + q p_j] \gets 1; \rev{A'[j] \gets A'[j]} \cup \{(t, t + q p_j,j)\}$}; \EndIf \EndFor \EndIf \EndFor \EndFor \For {$t \gets 0$ to $T$} \If {$P[t] = 1$} \State {$N' \gets N' \cup \{t\}$}; \If {$T' \leq t { < T} $} {$\rev{A'[0] \gets A'[0]} \cup \{(t,T,0)\}$;} {\footnotesize {\color{gray} \Comment \rev{$A'[0]$}: set of loss arcs}} \EndIf \EndIf \EndFor \State ${A^{\prime} \gets \cup_{j \in J+} \rev{A^{\prime}[j]}}$ \State \bf{return} ${N^{\prime},A^{\prime} }$ \EndProcedure \end{algorithmic} \end{algorithm} \section{Computational experiments} \label{sec:results} The discussed models have been coded in C++ and solved using Gurobi Optimizer 7.0. The experiments were performed by using a single thread on a PC equipped with an Intel Xeon E5530 $2.40$ GHz quad-core processor and $20$GB of RAM, running under Ubuntu $14.04.5$ LTS. We first discuss the \rev{benchmark instances used for the experiments}, then present an upper bounding procedure devised to speed up the convergence of the models, and finally we present an extensive computational evaluation. \subsection{Benchmark instances}\label{subsec:instances} In our experiments, we considered \rev{two benchmark sets of instances.} \rev{The first set is derived from the one} proposed by \cite{BulbulandSen2017} for the $R||\sum w_jC_j$. Their set is made by instances with $n \in \{30, 100, 400, 1000\}$ and $m \in \{2,4,6,8,16,30\}$. Processing times $p_{j}^{k}$ (i.e., processing time of job $j$ in machine $k$) were drawn according to a uniform distribution $U[1,p_{\max}]$, where $p_{\max} \in \{20, 100\}$, and penalty weights $w_j$ were created using a uniform distribution $U[1,20]$. For each combination of $(n,m,p_{\max})$, except when $n =30$ and $m \in \{16, 30\}$, $10$ instances were created, resulting in a set of $440$ instances which is now available at \url{ http://people.sabanciuniv.edu/bulbul/papers/Bulbul_Sen_Rm_TWCT_data-results_JoS_2016.rar}. We adapted these instances to the $P||\sum w_jC_j$ by imposing the processing time of each job $j$ to be equal to its processing time on the first unrelated machine in the $R||\sum w_jC_j$ (i.e., $p_j = p_j^1$ $\forall j$). To better evaluate the performance of the models on large instances, we used the procedure adopted by \cite{BulbulandSen2017} {to create a new additional set with $n = 700$, obtaining in this way a total of 560 instances.} \rev{The second set has been proposed by \cite{KowalczykandLeus2018} and consists of $2400$ instances with $n \in \{20, 50, 100, 150\}$ and $m \in \{3, 5, 8, 10, 12\}$. The instances are divided into six different classes according to the distribution of processing times and weights. For each class and each combination of $(n,m)$, $20$ instances were created.} \subsection{Upper bound by iterated local search}\label{subsec:UB} To start the model with a valid upper bound, we developed a modified version of the {\emph{iterated local search}} (ILS) based metaheuristic of \cite{KramerS2015}. The original method consists of a multi-start ILS for general earliness-tardiness scheduling problems on unrelated machines, and incorporates special structures to reduce the complexity for exploring the neighborhoods. In general words, the ILS by \cite{KramerS2015} is composed by constructive, local search and perturbation phases. We modified the construction and local search phases to take into account that in the $P||\sum w_jC_j$ all machine schedules follow the WSPT rule. That resulted in a speed up of the algorithm. The initial solutions, which are obtained either randomly or by a {{greedy randomized adaptive search procedure}} \rev{(GRASP)}, are now sorted according to the WSPT rule on each machine. \rev{The two main differences with respect to \cite{KramerS2015} regard the GRASP construction procedure and the local search phase. For the GRASP, we initially sort jobs according to the WSPT rule instead of performing a random sorting. In addition, at the end of the procedure we consider each machine in turn and sort the jobs that have been assigned to it by using once more the WSPT rule.} \rev{Regarding the local search, \cite{KramerS2015} employed a randomized variable neighborhood descent (RVND) procedure (see \citealt{MladenovicHansen1997}). In our modified version, the intra-machine neighborhood structures have been replaced by a simple WSPT sorting procedure, which is invoked at the end of each inter-machine neighborhood search, as depicted in Algorithm \ref{alg:RVND}.} \rev{The ILS was adopted to provide an initial feasible solution for all our methods below as follows. It was not executed for small-size instances having $n \leq 100$ jobs. It was instead executed for 100 seconds for medium-size instances with $100 < n < 400$ jobs, and for 300 seconds for large-size instances with $n \geq 400$ jobs.} \begin{algorithm}[ht] \caption{RVND} \label{alg:RVND} \begin{algorithmic}[1] \Procedure {RVND}{$\pi$} {\footnotesize {\color{gray} \Comment $\pi$ is the input solution}} \State {\bf{initialize}} $L = L_0;$ \label{alg:line_listRVND} {\footnotesize {\color{gray} \Comment $L_0$: list containing all inter-machines neighborhood structures}} \While {$L \neq \emptyset$} \State {select a neighborhood $N \in L$ at random;} \State {find $\pi'\in N$, the best neighbor solution of $\pi$;} \For {$k \gets 1$ to $m$} {sort jobs in $\pi'[k]$} according to WSPT; \label{alg:line_sortRVND} \EndFor \If{$f(\pi') < f(\pi)$} {\footnotesize {\color{gray} \Comment $f(\pi)$ represents the cost of solution $\pi$}} \State {$\pi'\gets \pi'$;} \State {\bf{reinitialize} $L;$} \Else \State {$L \gets L \setminus \{N\}$;}{\footnotesize {\color{gray} \Comment remove $N$ from $L$}} \EndIf \EndWhile \State \bf{return} $\pi$ \EndProcedure \end{algorithmic} \end{algorithm} \subsection{Computational results on benchmark set 1}\label{subsec:experiments} In Tables \ref{tab:res_p20} and \ref{tab:res_p100} we compare the performance of formulations \rev{CIQP (model \eqref{FO:CQP}--\eqref{constr3:CQP}), PTI (model \eqref{FO:PTI}--\eqref{constr5:PTI}), TI (model \eqref{FO:TI}--\eqref{constr3:TI}), SC (model \eqref{FO:SC}--\eqref{constr3:SC}), AF (model \eqref{FO:AF}--\eqref{constr4:AF}) and EAF (model \eqref{FO:EAF}--\eqref{constr4:EAF})}. To solve SC, we reimplemented the B\&P by \cite{vandenAkkeretal1999}. \rev{For instances with more than 100 jobs, each} method received as initial cutoff the upper bound \rev{produced by the ILS algorithm that we developed using the time limit detailed at the end of} Section \ref{subsec:UB}. Table \ref{tab:res_p20} summarizes the results that we obtained for the instances with $p_{\max} = 20$, whereas Table \ref{tab:res_p100} focuses on the case where $p_{\max} = 100$. For each group of $10$ instances defined by the couple $(n,m)$ and for each attempted method, we report the number of instances for which at least the root node of the model was solved, {\#root} (not reported for CIPQ and PTI) \rev{and} the number of optimal solutions found, {\#opt}. \rev{In columns t(s) we report the average execution time in seconds for the 10 instances in the line. If for some of these instances either time or memory limit has been reached, then we consider the entire time limit in the computation of the average t(s) value. Note that we directly write \emph{t.lim}, respectively \emph{m.lim}, when the time limit, respectively memory limit, has been reached on all the 10 instances in the line. Note also that, to facilitate direct comparison among the methods, t(s) does not contain the time required for running the ILS.} A ``-'' indicates that the value in the entry is not available because the model was not run on that group of instances. For AF and EAF we also report the average gap per million, computed as gap$_{\text{pm}}$=$10^6(U-L)/U$, with $U$ and $L$ being, respectively, the best upper and lower bound value obtained in the run (a ``-'' is reported \rev{when no valid $L$ is obtained, i.e., when even the LP relaxation of the model was not solved due to time or memory limits)}. \begin{table}[htbp] \centering \caption{Results for \rev{set 1 instances with $p_{\max}=20$ (time limit = 300 seconds, ILS time not included)}} \scriptsize \setlength{\tabcolsep}{0.4mm} \rev{ \begin{tabular}{lrrrrrrrrrrrrrrrrrrrrrrrrr} \toprule \multirow{3}[6]{*}{$n$} & \multirow{3}[6]{*}{$m$} & & \multicolumn{13}{c}{Existing formulations} & & \multicolumn{9}{c}{New formulations} \\ \cmidrule{4-16}\cmidrule{18-26} & & & \multicolumn{2}{c}{CIQP} & & \multicolumn{2}{c}{PTI} & & \multicolumn{3}{c}{SC} & & \multicolumn{3}{c}{TI} & & \multicolumn{4}{c}{AF} & & \multicolumn{4}{c}{EAF} \\ \cmidrule{4-5}\cmidrule{7-8}\cmidrule{10-12}\cmidrule{14-16}\cmidrule{18-21}\cmidrule{23-26} & & & {\#opt} & {t(s)} & & {\#opt} & {t(s)} & & {\#root} & {\#opt} & {t(s)} & & {\#root} & {\#opt} & {t(s)} & & {\#root} & {\#opt} & {t(s)} & {gap$_\text{pm}$} & & {\#root} & {\#opt} & {t(s)} & {gap$_\text{pm}$} \\ \midrule \multirow{4}[2]{*}{30} & 2 & & 10 & 1.1 & & 10 & 11.1 & & 10 & 10 & 0.2 & & 10 & 10 & 1.2 & & 10 & 10 & 0.1 & 0.0 & & 10 & 10 & 0.0 & 0.0 \\ & 4 & & 1 & 278.1 & & 8 & 165.9 & & 10 & 10 & 0.1 & & 10 & 10 & 0.5 & & 10 & 10 & 0.1 & 0.0 & & 10 & 10 & 0.0 & 0.0 \\ & 6 & & 0 & t.lim & & 3 & 240.1 & & 10 & 10 & 0.0 & & 10 & 10 & 0.2 & & 10 & 10 & 0.0 & 0.0 & & 10 & 10 & 0.0 & 0.0 \\ & 8 & & 0 & t.lim & & 3 & 243.9 & & 10 & 10 & 0.0 & & 10 & 10 & 0.2 & & 10 & 10 & 0.0 & 0.0 & & 10 & 10 & 0.0 & 0.0 \\ \midrule \multirow{6}[2]{*}{100} & 2 & & 0 & t.lim & & 0 & t.lim & & 9 & 0 & t.lim & & 10 & 10 & 199.8 & & 10 & 10 & 1.6 & 0.0 & & 10 & 10 & 0.9 & 0.0 \\ & 4 & & 0 & t.lim & & 0 & t.lim & & 10 & 3 & 276.5 & & 10 & 10 & 65.3 & & 10 & 10 & 2.1 & 0.0 & & 10 & 10 & 0.4 & 0.0 \\ & 6 & & 0 & t.lim & & 0 & t.lim & & 10 & 10 & 101.3 & & 10 & 10 & 29.5 & & 10 & 10 & 0.5 & 0.0 & & 10 & 10 & 0.4 & 0.0 \\ & 8 & & 0 & t.lim & & 0 & t.lim & & 10 & 10 & 15.9 & & 10 & 10 & 19.3 & & 10 & 10 & 0.4 & 0.0 & & 10 & 10 & 0.3 & 0.0 \\ & 16 & & 0 & t.lim & & 0 & t.lim & & 10 & 10 & 2.2 & & 10 & 10 & 3.9 & & 10 & 10 & 0.1 & 0.0 & & 10 & 10 & 0.1 & 0.0 \\ & 30 & & 0 & t.lim & & 0 & t.lim & & 10 & 10 & 0.4 & & 10 & 10 & 1.2 & & 10 & 10 & 0.1 & 0.0 & & 10 & 10 & 0.1 & 0.0 \\ \midrule \multirow{6}[2]{*}{400} & 2 & & 0 & t.lim & & 0 & t.lim & & 0 & 0 & t.lim & & 0 & 0 & m.lim & & 10 & 10 & 15.0 & 0.0 & & 10 & 10 & 4.8 & 0.0 \\ & 4 & & 0 & t.lim & & 0 & t.lim & & 0 & 0 & t.lim & & 0 & 0 & m.lim & & 10 & 10 & 29.3 & 0.0 & & 10 & 10 & 17.0 & 0.0 \\ & 6 & & 0 & t.lim & & 0 & t.lim & & 0 & 0 & t.lim & & 0 & 0 & m.lim & & 10 & 10 & 32.3 & 0.0 & & 10 & 10 & 13.2 & 0.0 \\ & 8 & & 0 & t.lim & & 0 & t.lim & & 0 & 0 & t.lim & & 0 & 0 & m.lim & & 10 & 10 & 33.7 & 0.0 & & 10 & 10 & 10.6 & 0.0 \\ & 16 & & 0 & t.lim & & 0 & t.lim & & 0 & 0 & t.lim & & 0 & 0 & m.lim & & 10 & 10 & 16.2 & 0.0 & & 10 & 10 & 3.5 & 0.0 \\ & 30 & & 0 & t.lim & & 0 & t.lim & & 10 & 0 & t.lim & & 10 & 3 & 272.9 & & 10 & 10 & 3.9 & 0.0 & & 10 & 10 & 0.9 & 0.0 \\ \midrule \multirow{6}[2]{*}{700} & 2 & & - & - & & - & - & & - & - & - & & - & - & - & & 10 & 6 & 191.3 & 0.1 & & 10 & 10 & 66.8 & 0.0 \\ & 4 & & - & - & & - & - & & - & - & - & & - & - & - & & 10 & 7 & 220.2 & 0.4 & & 10 & 10 & 56.9 & 0.0 \\ & 6 & & - & - & & - & - & & - & - & - & & - & - & - & & 10 & 4 & 240.6 & 1.7 & & 10 & 10 & 55.4 & 0.0 \\ & 8 & & - & - & & - & - & & - & - & - & & - & - & - & & 10 & 6 & 185.0 & 1.9 & & 10 & 10 & 86.4 & 0.0 \\ & 16 & & - & - & & - & - & & - & - & - & & - & - & - & & 10 & 9 & 202.3 & 0.2 & & 10 & 10 & 20.3 & 0.0 \\ & 30 & & - & - & & - & - & & - & - & - & & - & - & - & & 10 & 10 & 39.9 & 0.0 & & 10 & 10 & 3.1 & 0.0 \\ \midrule \multirow{6}[2]{*}{1000} & 2 & & - & - & & - & - & & - & - & - & & - & - & - & & 10 & 0 & t.lim & 0.3 & & 10 & 10 & 105.9 & 0.0 \\ & 4 & & - & - & & - & - & & - & - & - & & - & - & - & & 10 & 0 & t.lim & 1.5 & & 10 & 10 & 89.6 & 0.0 \\ & 6 & & - & - & & - & - & & - & - & - & & - & - & - & & 10 & 3 & 287.2 & 2.1 & & 10 & 10 & 139.6 & 0.0 \\ & 8 & & - & - & & - & - & & - & - & - & & - & - & - & & 10 & 3 & 278.7 & 1.8 & & 10 & 10 & 91.6 & 0.0 \\ & 16 & & - & - & & - & - & & - & - & - & & - & - & - & & 10 & 0 & 300.0 & 8.6 & & 10 & 10 & 64.2 & 0.0 \\ & 30 & & - & - & & - & - & & - & - & - & & - & - & - & & 10 & 4 & 264.3 & 8.2 & & 10 & 10 & 24.0 & 0.0 \\ \midrule total/avg & & & 11 & 288.5 & & 24 & 266.3 & & 109 & 83 & 156.0 & & 110 & 103 & 54.0 & & 280 & 212 & 105.2 & 1.0 & & 280 & 280 & 30.6 & 0.0 \\ \bottomrule \end{tabular}% } \label{tab:res_p20} \end{table \begin{table}[htbp] \centering \caption{Results for \rev{set 1 instances with $p_{\max}=100$ (time limit = 300 seconds, ILS time not included)}} \scriptsize \setlength{\tabcolsep}{0.37mm} \rev{ \begin{tabular}{lrrrrrrrrrrrrrrrrrrrrrrrrr} \toprule \multirow{3}[6]{*}{$n$} & \multirow{3}[6]{*}{$m$} & & \multicolumn{13}{c}{Existing formulations} & & \multicolumn{9}{c}{New formulations} \\ \cmidrule{4-16}\cmidrule{18-26} & & & \multicolumn{2}{c}{CIQP} & & \multicolumn{2}{c}{PTI} & & \multicolumn{3}{c}{SC} & & \multicolumn{3}{c}{TI} & & \multicolumn{4}{c}{AF} & & \multicolumn{4}{c}{EAF} \\ \cmidrule{4-5}\cmidrule{7-8}\cmidrule{10-12}\cmidrule{14-16}\cmidrule{18-21}\cmidrule{23-26} & & & {\#opt} & {t(s)} & & {\#opt} & {t(s)} & & {\#root} & {\#opt} & {t(s)} & & {\#root} & {\#opt} & {t(s)} & & {\#root} & {\#opt} & {t(s)} & {gap$_\text{pm}$} & & {\#root} & {\#opt} & {t(s)} & {gap$_\text{pm}$} \\ \midrule \multirow{4}[2]{*}{30} & 2 & & 10 & 0.8 & & 10 & 115.0 & & 10 & 10 & 0.2 & & 10 & 10 & 73.3 & & 10 & 10 & 0.5 & 0.0 & & 10 & 10 & 0.3 & 0.0 \\ & 4 & & 0 & t.lim & & 0 & t.lim & & 10 & 10 & 0.1 & & 10 & 10 & 18.6 & & 10 & 10 & 0.3 & 0.0 & & 10 & 10 & 0.2 & 0.0 \\ & 6 & & 0 & t.lim & & 0 & t.lim & & 10 & 10 & 0.0 & & 10 & 10 & 6.9 & & 10 & 10 & 0.2 & 0.0 & & 10 & 10 & 0.2 & 0.0 \\ & 8 & & 0 & t.lim & & 0 & t.lim & & 10 & 10 & 0.0 & & 10 & 10 & 4.4 & & 10 & 10 & 0.2 & 0.0 & & 10 & 10 & 0.1 & 0.0 \\ \midrule \multirow{6}[2]{*}{100} & 2 & & 0 & t.lim & & 0 & t.lim & & 0 & 0 & t.lim & & 0 & 0 & m.lim & & 10 & 10 & 10.7 & 0.0 & & 10 & 10 & 7.6 & 0.0 \\ & 4 & & 0 & t.lim & & 0 & t.lim & & 10 & 3 & 257.2 & & 0 & 0 & m.lim & & 10 & 10 & 36.5 & 0.2 & & 10 & 10 & 25.9 & 0.2 \\ & 6 & & 0 & t.lim & & 0 & t.lim & & 10 & 4 & 224.5 & & 0 & 0 & m.lim & & 10 & 10 & 14.5 & 0.0 & & 10 & 10 & 8.3 & 0.0 \\ & 8 & & 0 & t.lim & & 0 & t.lim & & 10 & 3 & 239.7 & & 0 & 0 & t.lim & & 10 & 10 & 8.1 & 0.0 & & 10 & 10 & 10.3 & 0.0 \\ & 16 & & 0 & t.lim & & 0 & t.lim & & 10 & 8 & 86.9 & & 9 & 6 & 264.0 & & 10 & 10 & 2.5 & 0.0 & & 10 & 10 & 1.5 & 0.0 \\ & 30 & & 0 & t.lim & & 0 & t.lim & & 10 & 10 & 1.7 & & 10 & 10 & 49.3 & & 10 & 10 & 0.6 & 0.0 & & 10 & 10 & 0.5 & 0.0 \\ \midrule \multirow{6}[2]{*}{400} & 2 & & 0 & t.lim & & 0 & t.lim & & 0 & 0 & t.lim & & 0 & 0 & m.lim & & 10 & 0 & t.lim & 0.6 & & 10 & 10 & 264.6 & 0.0 \\ & 4 & & 0 & t.lim & & 0 & t.lim & & 0 & 0 & t.lim & & 0 & 0 & m.lim & & 10 & 2 & 292.5 & 2.6 & & 10 & 10 & 180.7 & 0.0 \\ & 6 & & 0 & t.lim & & 0 & t.lim & & 0 & 0 & t.lim & & 0 & 0 & m.lim & & 10 & 7 & 272.2 & 2.6 & & 10 & 10 & 176.6 & 0.0 \\ & 8 & & 0 & t.lim & & 0 & t.lim & & 0 & 0 & t.lim & & 0 & 0 & m.lim & & 10 & 9 & 233.3 & 1.0 & & 10 & 10 & 177.5 & 0.0 \\ & 16 & & 0 & t.lim & & 0 & t.lim & & 0 & 0 & t.lim & & 0 & 0 & m.lim & & 10 & 8 & 181.4 & 4.6 & & 10 & 10 & 111.8 & 0.0 \\ & 30 & & 0 & t.lim & & 0 & t.lim & & 0 & 0 & t.lim & & 0 & 0 & m.lim & & 10 & 10 & 94.6 & 0.0 & & 10 & 10 & 64.1 & 0.0 \\ \midrule \multirow{6}[2]{*}{700} & 2 & & - & - & & - & - & & - & - & - & & - & - & - & & 0 & 0 & t.lim & - & & 9 & 0 & t.lim & 0.8 \\ & 4 & & - & - & & - & - & & - & - & - & & - & - & - & & 6 & 0 & t.lim & 3.2 & & 9 & 0 & t.lim & 3.3 \\ & 6 & & - & - & & - & - & & - & - & - & & - & - & - & & 6 & 0 & t.lim & 5.5 & & 10 & 0 & t.lim & 5.5 \\ & 8 & & - & - & & - & - & & - & - & - & & - & - & - & & 10 & 0 & t.lim & 8.4 & & 10 & 0 & t.lim & 8.4 \\ & 16 & & - & - & & - & - & & - & - & - & & - & - & - & & 10 & 0 & t.lim & 16.0 & & 10 & 0 & t.lim & 16.0 \\ & 30 & & - & - & & - & - & & - & - & - & & - & - & - & & 10 & 0 & t.lim & 28.5 & & 10 & 0 & t.lim & 28.4 \\ \midrule \multirow{6}[2]{*}{1000} & 2 & & - & - & & - & - & & - & - & - & & - & - & - & & 0 & 0 & m.lim & - & & 0 & 0 & m.lim & - \\ & 4 & & - & - & & - & - & & - & - & - & & - & - & - & & 0 & 0 & m.lim & - & & 0 & 0 & m.lim & - \\ & 6 & & - & - & & - & - & & - & - & - & & - & - & - & & 0 & 0 & m.lim & - & & 0 & 0 & m.lim & - \\ & 8 & & - & - & & - & - & & - & - & - & & - & - & - & & 7 & 0 & t.lim & 6.4 & & 9 & 0 & t.lim & 6.4 \\ & 16 & & - & - & & - & - & & - & - & - & & - & - & - & & 10 & 0 & t.lim & 13.5 & & 10 & 0 & t.lim & 13.5 \\ & 30 & & - & - & & - & - & & - & - & - & & - & - & - & & 10 & 0 & t.lim & 23.0 & & 10 & 0 & t.lim & 23.0 \\ \midrule total/avg & & & 10 & 289.3 & & 10 & 288.4 & & 90 & 68 & 181.9 & & 53 & 53 & 102.4 & & 229 & 136 & 165.9 & 4.8 & & 247 & 160 & 149.2 & 4.2 \\ \bottomrule \end{tabular}% } \label{tab:res_p100} \end{table}% The results show that EAF clearly outperforms all other methods on the attempted instances. It solves to proven optimality all instances with $p_{\max} = 20$ and all instances with $p_{\max} = 100$ and $n \leq 400$, so $440$ out of the $560$ tested instances. The version without enhancements, AF, solves all the instances with up to $400$ jobs for $p_{\max} = 20$ and up to $100$ jobs for $p_{\max} = 100$, for a total of $348$ out of $560$ instances. This proves that the enhancements presented in Section \ref{sec:method} are very effective. For the unsolved instances, the gaps are extremely small, \rev{amounting to just a few units} per million on average. The B\&P implemented to solve SC fails in solving some instances with just 100 jobs, which is coherent with the results in \cite{vandenAkkeretal1999}. The same happens for TI, which fails in solving instances with 100 jobs when $p_{\max} = 100$ and $m$ is small. The performance of both CIPQ and PTI is very poor, but that could be explained by the fact that the two models were originally developed for the $R||\sum w_jC_j$, and hence do not exploit the symmetries induced by the identical machines. The main advantage of CIPQ is related to its polynomial size, but it optimally solves only few instances with just $30$ jobs. For what concerns PTI, it is worth mentioning that it was solved by means of a Benders decomposition method in \cite{BulbulandSen2017}, as discussed in Section \ref{sec:PeemptionTI}. The authors provided us with the results obtained by their method on our $P||\sum w_jC_j$ instances. Unfortunately, these were worse on average that those obtained by the direct solution of the PTI model by means of the Gurobi solver. This, once more, can be imputed to the fact that their method was developed for the case of unrelated machines. \rev{We conducted further experiments by running the models under larger time limits up to one hour. The summary of the results that we obtained is presented in Table \ref{tab:new_opts}, which shows, for each model and for each time limit, the number of optimal solutions found under the different time limits. Once more, it can be observed that AF and EAF clearly outperform the other methods. It can also be seen that the enhancements discussed in Section \ref{sec:method} are indeed effective, because EAF solved to proven optimality all instances with $p_{\max} = 20$ in less than $300$ seconds, whereas AF did not solve two of them within $1$ hour. Concerning the instances with $p_{\max} = 100$, by increasing the time limit from $300$ to $3600$ seconds, AF was able to solve $61$ instances more, including all the unsolved instances with $n = 400$, whereas EAF solved $62$ more, including $48$ out of $60$ instances with $n=700$ that where not solved within $300$ seconds. In total, EAF was able to optimally solve $502$ out of $560$ instances. } \begin{table} \caption{\rev{Number of optimal solutions found under different time limits}} \centering \subfloat[\rev{$p_{\max} = 20$ (280 instances)}]{ \centering \scriptsize \setlength{\tabcolsep}{0.75mm} \rev{ \begin{tabular}{rrrrrrrrrrrrr} \toprule \multirow{2}{0.7cm}{time limit} & & \multicolumn{11}{c}{Formulation} \\ \cmidrule{3-13} & & CQIP & & PTI & & SC & & TI & & AF & & EAF \\ \cmidrule{1-1}\cmidrule{3-3}\cmidrule{5-5}\cmidrule{7-7}\cmidrule{9-9}\cmidrule{11-11}\cmidrule{13-13} 300 & & 11 & & 24 & & 83 & & 103 & & 212 & & 280 \\ 600 & & 12 & & 28 & & 86 & & 110 & & 247 & & 280 \\ 900 & & 12 & & 31 & & 89 & & 110 & & 254 & & 280 \\ 1200 & & 12 & & 32 & & 90 & & 110 & & 260 & & 280 \\ 1500 & & 13 & & 32 & & 90 & & 110 & & 265 & & 280 \\ 1800 & & 14 & & 32 & & 90 & & 110 & & 268 & & 280 \\ 2100 & & 14 & & 32 & & 90 & & 110 & & 272 & & 280 \\ 2400 & & 15 & & 32 & & 92 & & 110 & & 275 & & 280 \\ 2700 & & 15 & & 32 & & 95 & & 110 & & 276 & & 280 \\ 3000 & & 15 & & 32 & & 98 & & 110 & & 276 & & 280 \\ 3300 & & 15 & & 32 & & 98 & & 110 & & 277 & & 280 \\ 3600 & & 15 & & 32 & & 99 & & 110 & & 278 & & 280 \\ \bottomrule \end{tabular}% } \label{tab:new_opts_pmax_20}% }\quad \subfloat[\rev{$p_{\max} = 100$ (280 instances)}]{ \centering \scriptsize \setlength{\tabcolsep}{0.75mm} \rev{ \begin{tabular}{rrrrrrrrrrrrr} \toprule \multirow{2}{0.7cm}{time limit} & & \multicolumn{11}{c}{Formulation} \\ \cmidrule{3-13} & & CQIP & & PTI & & SC & & TI & & AF & & EAF \\ \cmidrule{1-1}\cmidrule{3-3}\cmidrule{5-5}\cmidrule{7-7}\cmidrule{9-9}\cmidrule{11-11}\cmidrule{13-13} 300 & & 10 & & 10 & & 68 & & 53 & & 136 & & 160 \\ 600 & & 11 & & 10 & & 70 & & 60 & & 150 & & 169 \\ 900 & & 12 & & 10 & & 73 & & 61 & & 168 & & 178 \\ 1200 & & 13 & & 10 & & 73 & & 61 & & 173 & & 180 \\ 1500 & & 13 & & 10 & & 74 & & 62 & & 179 & & 192 \\ 1800 & & 14 & & 10 & & 76 & & 64 & & 180 & & 200 \\ 2100 & & 15 & & 10 & & 77 & & 65 & & 183 & & 206 \\ 2400 & & 15 & & 10 & & 77 & & 66 & & 184 & & 210 \\ 2700 & & 15 & & 10 & & 78 & & 68 & & 188 & & 213 \\ 3000 & & 15 & & 10 & & 78 & & 68 & & 192 & & 216 \\ 3300 & & 15 & & 10 & & 79 & & 68 & & 194 & & 219 \\ 3600 & & 15 & & 10 & & 80 & & 69 & & 197 & & 222 \\ \bottomrule \end{tabular}% } \label{tab:new_opts_pmax_100}% } \label{tab:new_opts}% \end{table} Time indexed formulations, such as PTI, TI, AF and EAF, have a pseudo-polynomial size, and hence may require large amounts of memory when the time horizon grows. It can be noticed indeed that all of them do not solve some instances due to memory limit. In this sense, TI starts to run out of memory for instances with only $100$ jobs, PTI is able to deal with instances with up to $400$ jobs (although cannot optimally solve them due to time limit), whereas AF and EAF deal with instances with up to $1000$ jobs. This better behavior can be justified by the difference in the number of variables required by models. This fact is graphically highlighted in Figure \ref{fig:var_reduction}, which presents the average number of variables in thousands, per group of instances having the same $n$. The reduction of AF and even more EAF with respect to the plain TI model is evident. {This effect can be observed more in details in Table \ref{tab:res_var}, which reports, for each group of instances having same $n$ and $m$, the number of variables in thousands, var(thousands), and the percentage reduction of variables from one model to the next, {red(\%)}.} \begin{figure}[!h] \centering \subfloat[$p_{\max}=20$]{\includegraphics[width=0.49\textwidth]{p20.pdf}\label{fig:var_pmax20}} \hfill \subfloat[$p_{\max}=100$]{\includegraphics[width=0.49\textwidth]{p100.pdf}\label{fig:var_pmax100}} \caption{Impact of the proposed enhancements on the number of variables} \label{fig:var_reduction} \end{figure} From Table \ref{tab:res_var}, it is possible to notice that for the instances with $p_{\max}=20$ reductions of about 30\% are obtained by AF over TI, and of even 80\% by EAF over AF. This allows to move from an average of about $7 \times 10^5$ TI variables to just $1 \times 10^5$ EAF variables. Concerning the instances with $p_{\max}=100$, EAF formulates the problem using, on average, $50\%$ less variables than AF, which in turns uses 30\% less variables than TI. The results also indicates that, as the instance grows, the reductions become \rev{larger}. \begin{table}[!h] \centering \caption{Variables (in thousands) required by the main pseudo-polynomial formulations} \scriptsize \setlength{\tabcolsep}{0.5mm} \begin{tabular}{lrrrrrrrrrrrrrrrrrrrr} \toprule \multicolumn{1}{c}{\multirow{3}[5]{*}{$n$}} & \multicolumn{1}{c}{\multirow{3}[5]{*}{$m$}} & \multicolumn{9}{c}{$p_{\max}=20$} & & \multicolumn{9}{c}{$p_{\max}=100$} \\ \cmidrule(){3-11} \cmidrule(){13-21} & & \multicolumn{5}{c}{{var(thousands)}} & & \multicolumn{3}{c}{red(\%)} & & \multicolumn{5}{c}{{var(thousands)}} & & \multicolumn{3}{c}{red(\%)} \\ \cmidrule(){3-7} \cmidrule(){9-11} \cmidrule(){13-17} \cmidrule(){19-21} & & \multicolumn{1}{r}{TI} & & \multicolumn{1}{r}{AF} & & \multicolumn{1}{r}{EAF} & & \multicolumn{1}{r}{AF {\emph vs} TI} & & \multicolumn{1}{r}{EAF {\emph vs} AF} & & \multicolumn{1}{r}{TI} & & \multicolumn{1}{r}{AF} & & \multicolumn{1}{r}{EAF} & & \multicolumn{1}{r}{AF {\emph vs} TI} & & \multicolumn{1}{r}{EAF {\emph vs} AF} \\ \cline{3-3} \cline{5-5} \cline{7-7} \cline{9-9} \cline{11-11} \cline{13-13} \cline{15-15} \cline{17-17} \cline{19-19} \cline{21-21} \hline \multirow{4}{*}{30} & 2 & 4.8 & & 3.0 & & 1.8 & & 37.5 & & 41.0 & & 20.8 & & 11.8 & & 7.6 & & 43.2 & & 35.5 \\ & 4 & 2.6 & & 1.8 & & 1.3 & & 29.2 & & 29.4 & & 11.9 & & 7.8 & & 5.7 & & 34.4 & & 27.4 \\ & 6 & 1.8 & & 1.3 & & 1.0 & & 24.8 & & 28.6 & & 8.4 & & 5.8 & & 4.5 & & 31.3 & & 21.2 \\ & 8 & 1.4 & & 1.1 & & 0.8 & & 22.2 & & 24.8 & & 6.7 & & 4.6 & & 3.7 & & 32.4 & & 19.6 \\ \hline \multirow{6}{*}{100} & 2 & 51.9 & & 31.4 & & 17.0 & & 39.5 & & 46.0 & & 253.9 & & 150.7 & & 89.7 & & 40.7 & & 40.5 \\ & 4 & 27.6 & & 20.1 & & 10.8 & & 27.0 & & 46.5 & & 128.0 & & 90.5 & & 58.3 & & 29.2 & & 35.6 \\ & 6 & 17.7 & & 13.6 & & 7.6 & & 23.5 & & 44.2 & & 90.1 & & 69.8 & & 44.2 & & 22.5 & & 36.6 \\ & 8 & 13.7 & & 11.1 & & 6.7 & & 19.3 & & 39.9 & & 66.4 & & 51.9 & & 33.7 & & 21.9 & & 35.0 \\ & 16 & 7.5 & & 6.4 & & 4.1 & & 13.9 & & 36.3 & & 36.1 & & 29.7 & & 21.8 & & 17.8 & & 26.5 \\ & 30 & 4.4 & & 3.8 & & 2.7 & & 12.1 & & 30.4 & & 21.7 & & 18.7 & & 14.1 & & 13.8 & & 24.4 \\ \hline \multirow{6}{*}{400} & 2 & 843.2 & & 509.4 & & 185.7 & & 39.6 & & 63.5 & & 4088.9 & & 2409.8 & & 1291.0 & & 41.1 & & 46.4 \\ & 4 & 424.3 & & 309.1 & & 108.0 & & 27.2 & & 65.1 & & 2017.3 & & 1418.7 & & 726.3 & & 29.7 & & 48.8 \\ & 6 & 282.6 & & 220.6 & & 75.8 & & 21.9 & & 65.7 & & 1360.9 & & 1034.0 & & 530.2 & & 24.0 & & 48.7 \\ & 8 & 213.2 & & 172.6 & & 60.8 & & 19.0 & & 64.8 & & 1040.4 & & 827.6 & & 429.4 & & 20.5 & & 48.1 \\ & 16 & 106.9 & & 92.6 & & 34.4 & & 13.4 & & 62.9 & & 533.0 & & 456.4 & & 247.8 & & 14.4 & & 45.7 \\ & 30 & 60.2 & & 54.6 & & 22.4 & & 9.4 & & 59.0 & & 290.0 & & 256.2 & & 151.4 & & 11.7 & & 40.9 \\ \hline \multirow{6}{*}{700} & 2 & 2539.6 & & 1520.0 & & 418.7 & & 40.1 & & 72.5 & & 12613.7 & & 7437.6 & & 3720.1 & & 41.0 & & 50.0 \\ & 4 & 1282.9 & & 930.0 & & 240.6 & & 27.5 & & 74.1 & & 6114.2 & & 4336.5 & & 2073.8 & & 29.1 & & 52.2 \\ & 6 & 874.3 & & 680.5 & & 170.7 & & 22.2 & & 74.9 & & 4161.0 & & 3191.1 & & 1464.8 & & 23.3 & & 54.1 \\ & 8 & 654.0 & & 528.4 & & 132.2 & & 19.2 & & 75.0 & & 3148.3 & & 2514.4 & & 1140.7 & & 20.1 & & 54.6 \\ & 16 & 326.9 & & 284.2 & & 75.2 & & 13.1 & & 73.5 & & 1582.9 & & 1355.0 & & 639.9 & & 14.4 & & 52.8 \\ & 30 & 177.4 & & 160.9 & & 45.7 & & 9.3 & & 71.6 & & 859.6 & & 766.9 & & 386.1 & & 10.8 & & 49.6 \\ \hline \multirow{6}{*}{1000} & 2 & 5216.2 & & 3129.4 & & 671.1 & & 40.0 & & 78.6 & & 25320.3 & & 14942.6 & & 7020.6 & & 41.0 & & 53.0 \\ & 4 & 2626.0 & & 1902.1 & & 378.1 & & 27.6 & & 80.1 & & 12725.0 & & 9083.5 & & 3980.6 & & 28.6 & & 56.2 \\ & 6 & 1757.3 & & 1369.4 & & 267.0 & & 22.1 & & 80.5 & & 8445.0 & & 6673.8 & & 2853.3 & & 21.0 & & 57.2 \\ & 8 & 1314.7 & & 1063.1 & & 207.7 & & 19.1 & & 80.5 & & 6327.7 & & 5051.4 & & 2090.2 & & 20.2 & & 58.6 \\ & 16 & 664.4 & & 579.4 & & 115.4 & & 12.8 & & 80.1 & & 3212.8 & & 2742.8 & & 1154.8 & & 14.6 & & 57.9 \\ & 30 & 359.4 & & 326.5 & & 69.6 & & 9.2 & & 78.7 & & 1711.3 & & 1531.0 & & 688.2 & & 10.5 & & 55.1 \\ \hline \multicolumn{2}{c}{total/avg} & 709.2 & & 497.4 & & 119.0 & & 29.9 & & 76.1 & & 3435.6 & & 2365.3 & & 1098.6 & & 31.2 & & 53.6 \\ \hline \end{tabular} \label{tab:res_var} \end{table} \subsection{\rev{Computational results on benchmark set 2}}\label{sec:newResults} \rev{Very recently, \cite{KowalczykandLeus2018} improved the branch-and-price method of \cite{vandenAkkeretal1999} by introducing the use of stabilization techniques, generic branching, and a {\em zero-suppressed binary decision diagram} (ZDDs) for solving the pricing subproblem. By combining these techniques, they devised three main methods: the first, named VHV-DP, uses the branching scheme and the DP in \cite{vandenAkkeretal1999}, but includes stabilization; the second, VHV-ZDD, also uses the branching scheme of \cite{vandenAkkeretal1999} and stabilization, but solves the pricing subproblem with the the ZDDs technique; the third, RF-ZDD, differs from the second by the fact that the branching decisions follow the generic scheme of \cite{RyanandFoster1981}. The three methods were computationally tested on the benchmark set 2 described in Section \ref{subsec:instances}.} \rev{We performed experiments by running for 600 seconds our best mathematical formulation, namely, EAF, on the same instances and compared our results with those obtained by \cite{KowalczykandLeus2018}. As in the previous section, for instances involving more than 100 jobs EAF used the ILS of Section \ref{subsec:UB} to obtain an initial solution. According to the single thread results in \url{https://www.cpubenchmark.net/}, the processor used by \cite{KowalczykandLeus2018}, an Intel Core i7-3770 $3.40$ GHz, is about $1.9$ times faster than our Intel Xeon E5530 $2.40$ GHz processor.} \rev{The results that we obtained are presented in Tables \ref{tab:resnew_Class_I_II}, \ref{tab:resnew_Class_III_IV} and \ref{tab:resnew_Class_V_VI}. Columns {\#opt} and {t(s)} represent, for each method, class and group of $20$ instances, the number of instances solved to proven optimality and the average computational time, respectively.} \rev{Concerning RF-ZDD, VHV-ZDD and VHV-DP, the t(s) values report the average times in \cite{KowalczykandLeus2018} (i.e., not multiplied by 1.9), but now include in the computation of the average the entire time limit value ($3600$ seconds) for those instances that were not solved to proven optimality.} \rev{The three methods by \cite{KowalczykandLeus2018} obtained good results but could not solve all instances to proven optimality. In general, VHV-DP was able to solve more instances than RF-ZDD and VHV-ZDD, whereas RF-ZDD proved to be less time consuming on average. We can observe from the tables that our ILS+EAF algorithm generally outperformed the other methods. Indeed, it could solve all $2400$ instances within the time limit and usually very quickly (only 10 instances required more than 300 seconds, and the slowest case required 395 seconds). Instances with up to 100 jobs were solved in a matter of seconds. Instances with 150 jobs required longer times, also due to the 100 seconds allowed for the ILS execution. The instances from class VI represent the most challenging testbed for ILS+EAF, nevertheless they were all solved in about 50 seconds on average.} \begin{table}[htbp] \centering \caption{\rev{Results on set 2 instances -- Classes I and II}} \scriptsize \setlength{\tabcolsep}{0.5mm} \rev{ \begin{tabular}{llrrrrrrrrrrrrrrrrrrrrrrrr} \toprule \multirow{3}[6]{*}{$n$} & \multicolumn{1}{r}{\multirow{3}[6]{*}{$m$}} & & \multicolumn{11}{c}{Class I} & & \multicolumn{11}{c}{Class II} \\ \cmidrule{4-14}\cmidrule{16-26} & & & \multicolumn{2}{c}{RF-ZDD} & & \multicolumn{2}{c}{VHV-ZDD} & & \multicolumn{2}{c}{VHV-DP} & & \multicolumn{2}{c}{ILS+EAF} & & \multicolumn{2}{c}{RF-ZDD} & & \multicolumn{2}{c}{VHV-ZDD} & & \multicolumn{2}{c}{VHV-DP} & & \multicolumn{2}{c}{ILS+EAF} \\ \cmidrule{4-5}\cmidrule{7-8}\cmidrule{10-11}\cmidrule{13-14}\cmidrule{16-17}\cmidrule{19-20}\cmidrule{22-23}\cmidrule{25-26} & & & \#opt & t(s) & & \#opt & t(s) & & \#opt & t(s) & & \#opt & t(s) & & \#opt & t(s) & & \#opt & t(s) & & \#opt & t(s) & & \#opt & t(s) \\ \midrule \multirow{5}[2]{*}{20} & \multicolumn{1}{r}{3} & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.1 \\ & \multicolumn{1}{r}{5} & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.1 \\ & \multicolumn{1}{r}{8} & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 \\ & \multicolumn{1}{r}{10} & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 \\ & \multicolumn{1}{r}{12} & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 \\ \midrule \multirow{5}[2]{*}{50} & \multicolumn{1}{r}{3} & & 20 & 1.9 & & 20 & 1.2 & & 20 & 1.1 & & 20 & 0.0 & & 20 & 0.7 & & 20 & 0.6 & & 20 & 0.7 & & 20 & 0.9 \\ & \multicolumn{1}{r}{5} & & 20 & 0.9 & & 20 & 0.5 & & 20 & 0.6 & & 20 & 0.0 & & 20 & 0.6 & & 19 & 180.6 & & 20 & 0.6 & & 20 & 0.7 \\ & \multicolumn{1}{r}{8} & & 20 & 0.4 & & 20 & 0.2 & & 20 & 0.2 & & 20 & 0.0 & & 20 & 0.4 & & 19 & 180.3 & & 19 & 180.3 & & 20 & 0.6 \\ & \multicolumn{1}{r}{10} & & 20 & 0.3 & & 20 & 0.1 & & 20 & 0.1 & & 20 & 0.0 & & 20 & 0.3 & & 20 & 0.2 & & 20 & 0.2 & & 20 & 0.5 \\ & \multicolumn{1}{r}{12} & & 20 & 0.1 & & 20 & 0.1 & & 20 & 0.1 & & 20 & 0.0 & & 20 & 0.1 & & 20 & 0.1 & & 20 & 0.1 & & 20 & 0.3 \\ \midrule \multirow{5}[2]{*}{100} & \multicolumn{1}{r}{3} & & 20 & 62.7 & & 20 & 59.8 & & 20 & 64.5 & & 20 & 0.2 & & 20 & 23.0 & & 20 & 37.6 & & 20 & 34.0 & & 20 & 9.4 \\ & \multicolumn{1}{r}{5} & & 19 & 210.3 & & 20 & 31.5 & & 20 & 32.5 & & 20 & 0.2 & & 20 & 56.0 & & 19 & 286.4 & & 18 & 415.1 & & 20 & 8.4 \\ & \multicolumn{1}{r}{8} & & 19 & 194.4 & & 20 & 7.0 & & 20 & 7.1 & & 20 & 0.1 & & 20 & 53.2 & & 20 & 133.6 & & 20 & 101.0 & & 20 & 5.0 \\ & \multicolumn{1}{r}{10} & & 19 & 189.3 & & 20 & 3.7 & & 20 & 3.8 & & 20 & 0.1 & & 20 & 41.4 & & 20 & 18.1 & & 20 & 17.9 & & 20 & 4.6 \\ & \multicolumn{1}{r}{12} & & 20 & 7.3 & & 20 & 2.2 & & 20 & 2.1 & & 20 & 0.1 & & 20 & 50.8 & & 20 & 74.8 & & 20 & 75.0 & & 20 & 2.9 \\ \midrule \multirow{5}[2]{*}{150} & \multicolumn{1}{r}{3} & & 18 & 873.8 & & 20 & 1162.0 & & 20 & 1123.4 & & 20 & 100.4 & & 20 & 362.3 & & 15 & 1590.9 & & 17 & 1147.7 & & 20 & 127.0 \\ & \multicolumn{1}{r}{5} & & 20 & 323.8 & & 20 & 813.9 & & 20 & 813.6 & & 20 & 100.2 & & 16 & 1438.2 & & 16 & 1485.2 & & 15 & 1656.8 & & 20 & 137.7 \\ & \multicolumn{1}{r}{8} & & 18 & 475.6 & & 20 & 275.9 & & 20 & 261.5 & & 20 & 100.2 & & 17 & 1035.5 & & 16 & 1641.0 & & 16 & 1624.3 & & 20 & 126.0 \\ & \multicolumn{1}{r}{10} & & 20 & 85.5 & & 20 & 117.4 & & 20 & 132.1 & & 20 & 100.1 & & 16 & 1273.3 & & 16 & 1183.7 & & 17 & 1168.7 & & 20 & 110.0 \\ & \multicolumn{1}{r}{12} & & 20 & 52.8 & & 20 & 53.0 & & 20 & 54.8 & & 20 & 100.1 & & 18 & 599.4 & & 20 & 348.9 & & 20 & 356.4 & & 20 & 105.8 \\ \midrule \multicolumn{2}{l}{total/avg} & & 393 & 124.0 & & 400 & 126.4 & & 400 & 124.9 & & 400 & 25.1 & & 387 & 246.8 & & 380 & 358.1 & & 382 & 338.9 & & 400 & 32.0 \\ \bottomrule \end{tabular}% } \label{tab:resnew_Class_I_II}% \end{table}% \begin{table}[htbp] \centering \caption{\rev{Results on set 2 instances -- Classes III and IV}} \scriptsize \setlength{\tabcolsep}{0.5mm} \rev{ \begin{tabular}{llrrrrrrrrrrrrrrrrrrrrrrrr} \toprule \multirow{3}[6]{*}{$n$} & \multicolumn{1}{r}{\multirow{3}[6]{*}{$m$}} & & \multicolumn{11}{c}{Class III} & & \multicolumn{11}{c}{Class IV} \\ \cmidrule{4-14}\cmidrule{16-26} & & & \multicolumn{2}{c}{RF-ZDD} & & \multicolumn{2}{c}{VHV-ZDD} & & \multicolumn{2}{c}{VHV-DP} & & \multicolumn{2}{c}{ILS+EAF} & & \multicolumn{2}{c}{RF-ZDD} & & \multicolumn{2}{c}{VHV-ZDD} & & \multicolumn{2}{c}{VHV-DP} & & \multicolumn{2}{c}{ILS+EAF} \\ \cmidrule{4-5}\cmidrule{7-8}\cmidrule{10-11}\cmidrule{13-14}\cmidrule{16-17}\cmidrule{19-20}\cmidrule{22-23}\cmidrule{25-26} & & & \#opt & t(s) & & \#opt & t(s) & & \#opt & t(s) & & \#opt & t(s) & & \#opt & t(s) & & \#opt & t(s) & & \#opt & t(s) & & \#opt & t(s) \\ \midrule \multirow{5}[2]{*}{20} & \multicolumn{1}{r}{3} & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 \\ & \multicolumn{1}{r}{5} & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 \\ & \multicolumn{1}{r}{8} & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 \\ & \multicolumn{1}{r}{10} & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 \\ & \multicolumn{1}{r}{12} & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 \\ \midrule \multirow{5}[2]{*}{50} & \multicolumn{1}{r}{3} & & 20 & 2.1 & & 20 & 4.0 & & 20 & 4.2 & & 20 & 0.1 & & 20 & 0.7 & & 20 & 0.7 & & 20 & 1.0 & & 20 & 0.5 \\ & \multicolumn{1}{r}{5} & & 20 & 1.1 & & 20 & 1.9 & & 20 & 2.0 & & 20 & 0.1 & & 20 & 1.2 & & 20 & 2.1 & & 20 & 2.6 & & 20 & 0.2 \\ & \multicolumn{1}{r}{8} & & 20 & 0.6 & & 20 & 0.6 & & 20 & 0.6 & & 20 & 0.1 & & 20 & 0.4 & & 20 & 0.5 & & 20 & 0.6 & & 20 & 0.1 \\ & \multicolumn{1}{r}{10} & & 20 & 0.4 & & 20 & 0.4 & & 20 & 0.5 & & 20 & 0.1 & & 20 & 0.4 & & 20 & 0.5 & & 20 & 0.6 & & 20 & 0.1 \\ & \multicolumn{1}{r}{12} & & 20 & 0.2 & & 20 & 0.2 & & 20 & 0.2 & & 20 & 0.1 & & 20 & 0.1 & & 20 & 0.1 & & 20 & 0.2 & & 20 & 0.1 \\ \midrule \multirow{5}[2]{*}{100} & \multicolumn{1}{r}{3} & & 20 & 41.5 & & 20 & 158.8 & & 20 & 162.3 & & 20 & 1.0 & & 20 & 69.7 & & 20 & 186.7 & & 20 & 169.1 & & 20 & 17.5 \\ & \multicolumn{1}{r}{5} & & 20 & 22.4 & & 20 & 109.5 & & 20 & 103.7 & & 20 & 0.8 & & 20 & 33.3 & & 20 & 147.8 & & 20 & 159.3 & & 20 & 11.6 \\ & \multicolumn{1}{r}{8} & & 20 & 10.7 & & 20 & 40.8 & & 20 & 39.3 & & 20 & 0.4 & & 20 & 14.8 & & 20 & 44.3 & & 20 & 47.1 & & 20 & 1.2 \\ & \multicolumn{1}{r}{10} & & 20 & 7.1 & & 20 & 20.5 & & 20 & 20.0 & & 20 & 0.3 & & 20 & 9.7 & & 20 & 31.5 & & 20 & 34.8 & & 20 & 1.0 \\ & \multicolumn{1}{r}{12} & & 20 & 6.1 & & 20 & 12.2 & & 20 & 12.4 & & 20 & 0.2 & & 19 & 186.9 & & 20 & 18.4 & & 20 & 20.4 & & 20 & 0.4 \\ \midrule \multirow{5}[2]{*}{150} & \multicolumn{1}{r}{3} & & 20 & 430.2 & & 20 & 1508.3 & & 20 & 1517.5 & & 20 & 100.6 & & 20 & 973.5 & & 16 & 2529.2 & & 20 & 2108.4 & & 20 & 108.7 \\ & \multicolumn{1}{r}{5} & & 20 & 166.6 & & 20 & 965.5 & & 20 & 1063.9 & & 20 & 100.5 & & 20 & 383.7 & & 20 & 1281.3 & & 20 & 1239.4 & & 20 & 104.0 \\ & \multicolumn{1}{r}{8} & & 20 & 71.9 & & 20 & 504.8 & & 20 & 517.1 & & 20 & 100.3 & & 20 & 164.3 & & 20 & 612.9 & & 20 & 648.8 & & 20 & 101.9 \\ & \multicolumn{1}{r}{10} & & 20 & 51.1 & & 20 & 360.9 & & 20 & 361.6 & & 20 & 100.4 & & 20 & 93.3 & & 20 & 358.6 & & 20 & 429.6 & & 20 & 101.8 \\ & \multicolumn{1}{r}{12} & & 20 & 36.8 & & 20 & 224.4 & & 20 & 245.2 & & 20 & 100.2 & & 20 & 69.0 & & 19 & 458.2 & & 20 & 287.1 & & 20 & 101.0 \\ \midrule \multicolumn{2}{l}{total/avg} & & 400 & 42.4 & & 400 & 195.6 & & 400 & 202.5 & & 400 & 25.3 & & 399 & 100.1 & & 395 & 283.6 & & 400 & 257.4 & & 400 & 27.5 \\ \bottomrule \end{tabular}% } \label{tab:resnew_Class_III_IV}% \end{table}% \begin{table}[htbp] \centering \caption{\rev{Results on set 2 instances -- Classes V and VI}} \scriptsize \setlength{\tabcolsep}{0.5mm} \rev{ \begin{tabular}{llrrrrrrrrrrrrrrrrrrrrrrrr} \toprule \multirow{3}[6]{*}{$n$} & \multicolumn{1}{r}{\multirow{3}[6]{*}{$m$}} & & \multicolumn{11}{c}{Class V} & & \multicolumn{11}{c}{Class VI} \\ \cmidrule{4-14}\cmidrule{16-26} & & & \multicolumn{2}{c}{RF-ZDD} & & \multicolumn{2}{c}{VHV-ZDD} & & \multicolumn{2}{c}{VHV-DP} & & \multicolumn{2}{c}{ILS+EAF} & & \multicolumn{2}{c}{RF-ZDD} & & \multicolumn{2}{c}{VHV-ZDD} & & \multicolumn{2}{c}{VHV-DP} & & \multicolumn{2}{c}{ILS+EAF} \\ \cmidrule{4-5}\cmidrule{7-8}\cmidrule{10-11}\cmidrule{13-14}\cmidrule{16-17}\cmidrule{19-20}\cmidrule{22-23}\cmidrule{25-26} & & & \#opt & t(s) & & \#opt & t(s) & & \#opt & t(s) & & \#opt & t(s) & & \#opt & t(s) & & \#opt & t(s) & & \#opt & t(s) & & \#opt & t(s) \\ \midrule \multirow{5}[2]{*}{20} & \multicolumn{1}{r}{3} & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 \\ & \multicolumn{1}{r}{5} & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 \\ & \multicolumn{1}{r}{8} & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 \\ & \multicolumn{1}{r}{10} & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 \\ & \multicolumn{1}{r}{12} & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 & & 20 & 0.0 \\ \midrule \multirow{5}[2]{*}{50} & \multicolumn{1}{r}{3} & & 20 & 1.5 & & 20 & 1.8 & & 20 & 1.9 & & 20 & 1.2 & & 20 & 2.3 & & 20 & 3.4 & & 20 & 2.7 & & 20 & 2.3 \\ & \multicolumn{1}{r}{5} & & 20 & 1.5 & & 20 & 2.3 & & 20 & 3.0 & & 20 & 0.7 & & 20 & 1.4 & & 20 & 1.8 & & 20 & 1.8 & & 20 & 1.2 \\ & \multicolumn{1}{r}{8} & & 20 & 0.3 & & 20 & 0.6 & & 20 & 0.7 & & 20 & 0.2 & & 20 & 1.0 & & 20 & 0.7 & & 20 & 0.9 & & 20 & 0.8 \\ & \multicolumn{1}{r}{10} & & 20 & 0.4 & & 20 & 0.4 & & 20 & 0.6 & & 20 & 0.1 & & 20 & 1.1 & & 20 & 0.7 & & 20 & 0.7 & & 20 & 0.4 \\ & \multicolumn{1}{r}{12} & & 20 & 0.2 & & 20 & 0.2 & & 20 & 0.2 & & 20 & 0.1 & & 20 & 1.1 & & 20 & 1.0 & & 20 & 0.8 & & 20 & 0.4 \\ \midrule \multirow{5}[2]{*}{100} & \multicolumn{1}{r}{3} & & 19 & 314.0 & & 20 & 359.5 & & 20 & 290.4 & & 20 & 46.8 & & 20 & 78.7 & & 20 & 242.5 & & 20 & 200.1 & & 20 & 73.0 \\ & \multicolumn{1}{r}{5} & & 20 & 55.0 & & 20 & 180.4 & & 20 & 200.7 & & 20 & 17.2 & & 20 & 37.8 & & 20 & 126.7 & & 20 & 112.8 & & 20 & 22.8 \\ & \multicolumn{1}{r}{8} & & 19 & 197.8 & & 18 & 497.5 & & 18 & 408.9 & & 20 & 2.3 & & 20 & 25.2 & & 20 & 58.0 & & 20 & 44.6 & & 20 & 24.9 \\ & \multicolumn{1}{r}{10} & & 20 & 12.9 & & 20 & 35.2 & & 20 & 39.5 & & 20 & 3.6 & & 20 & 22.7 & & 20 & 32.7 & & 20 & 32.2 & & 20 & 8.1 \\ & \multicolumn{1}{r}{12} & & 18 & 368.1 & & 18 & 379.3 & & 19 & 209.4 & & 20 & 1.0 & & 20 & 19.0 & & 20 & 20.8 & & 20 & 18.8 & & 20 & 17.8 \\ \midrule \multirow{5}[2]{*}{150} & \multicolumn{1}{r}{3} & & 20 & 1538.0 & & 14 & 3086.7 & & 20 & 2508.5 & & 20 & 120.9 & & 20 & 800.0 & & 18 & 3028.9 & & 20 & 2662.2 & & 20 & 233.1 \\ & \multicolumn{1}{r}{5} & & 20 & 584.1 & & 20 & 1488.4 & & 19 & 1467.4 & & 20 & 107.2 & & 20 & 398.4 & & 20 & 1751.4 & & 20 & 1434.7 & & 20 & 178.5 \\ & \multicolumn{1}{r}{8} & & 19 & 498.7 & & 18 & 1053.2 & & 18 & 1022.9 & & 20 & 106.4 & & 20 & 257.7 & & 20 & 691.6 & & 20 & 633.1 & & 20 & 145.3 \\ & \multicolumn{1}{r}{10} & & 20 & 164.4 & & 20 & 422.1 & & 20 & 541.1 & & 20 & 103.1 & & 20 & 210.4 & & 20 & 439.3 & & 20 & 406.3 & & 20 & 151.8 \\ & \multicolumn{1}{r}{12} & & 19 & 272.2 & & 20 & 291.8 & & 20 & 402.0 & & 20 & 101.7 & & 20 & 192.7 & & 20 & 303.6 & & 20 & 265.7 & & 20 & 135.1 \\ \midrule \multicolumn{2}{l}{total/avg} & & 394 & 200.5 & & 388 & 390.0 & & 394 & 354.9 & & 400 & 30.6 & & 400 & 102.5 & & 398 & 335.2 & & 400 & 290.9 & & 400 & 49.8 \\ \bottomrule \end{tabular}% } \label{tab:resnew_Class_V_VI}% \end{table}% \section{Conclusions} \label{sec:conclusion} In this work, we have proposed pseudo-polynomial arc-flow (AF) formulations to solve the problem of scheduling a set of jobs on a set of identical parallel machines by minimizing the total weighted completion time. A first straight AF model already benefits from the fact that schedules follow a {weighted shortest processing time} (WSPT) rule on each machine. A second enhanced AF model (EAF) improves AF by embedding further reduction techniques. EAF needs on average less than $50\%$ of the variables required by AF, and, in some cases, this number drops to less than $20\%$. Computational experiments showed that EAF is very effective and solves instances with up to $1000$ jobs and $30$ machines, performing much better than direct time-indexed formulations and even advanced branch-and-price methods. Still, troubles might arise when the processing times of the jobs assume large values, and more research is envisaged to solve large instances of this type, possibly involving heuristics and column generation methods. An interesting future research direction also involves the application of the discussed techniques to problems with release dates and/or setup times. In such cases, optimal solutions might nor respect the WSPT sorting, and thus these problems might be very challenging for AF models. In general, in the scheduling area much work has been done on time-indexed formulations, but the application of AF models is new and could lead to large computational benefits in the solution of many problems. \section*{Acknowledgments} This research was funded by the CNPq - Conselho Nacional de Desenvolvimento Cient{\'i}fico e Tecnol{\'o}gico, Brazil, grant No. 234814/2014-4, and by Universit{\`a} degli Studi di Modena e Reggio Emilia, project FAR 2015 - Applicazioni della Teoria dei Grafi nelle Scienze, nell'Industria e nella Societ{\`a}. We thank Kerem B\"{u}lb\"{u}l and Halil {\c{S}en} for kindly providing us with additional computation results, {and Daniel Kowalczyk and Roel Leus for sharing the instances of benchmark set 2.} \rev{We also thank three anonymous referees whose comments greatly improved the quality of the paper.} \bibliographystyle{mmsbib}
\section{Introduction} \label{sec:orgba31b8b} \label{intro} There is a class of algorithmic techniques that are employed to find the best option from a finite set of possibilities \(\mathcal{X}\). Many such algorithms scan solutions from \(\mathcal X\) successively and evaluate their quality according to some objective function \(f: \mathcal X \rightarrow \mathbb{R}^1\). In the process of solving an optimization problem, an algorithm produces a time-ordered sample of visited solutions and the corresponding objective values, \(\mathcal{S}=\{(x_1, f(x_1)), \ldots, (x_m, f(x_m): x_i \in \mathcal X, i=\overline{1,m}\}\). Is there anything to learn from these samples about the properties of the optimal solutions? For example, what is the probability that the component \(j\) is equal to one in some optimal solution, given the specific time-ordered sample. Clearly, the answer to this question depends on the algorithm that produced the sample, as well as on the particular problem instance. The samples produced by a random search may not be as useful as those generated by a more advanced algorithm. Furthermore, larger data samples can provide better information to support statistical inferences. We take a machine learning approach to the above questions and formulate the ``learning problem'' as a binary classification problem in Section \ref{ml.bin}. We apply logistic regression and explore the quality of the model predictions on a set of scheduling benchmarks, utilizing data samples generated by the tabu search \citep{Glover-1997-tabu-searc}. Section \ref{gta} demonstrates how to make use of the solution samples to boost the performance of the tabu search. We conclude in Section \ref{conclusions} with the potential extensions of this research. The contributions presented in this paper are as follows. \begin{itemize} \item The paper describes a general statistical learning model for binary optimization and establishes an efficient implementation based on logistic regression. \item We empirically explore the computational performance of the logistic regression model on the job shop scheduling problem instances. \item We provide a simple extension of tabu search that includes the proposed learning component. We demonstrate that such an extension is easy to implement, yet can provide a significant boost to the computational performance. \item A novel framework for comparing optimization algorithms based on the concept of probability dominance is introduced, which provides intuitive and statistically sound tools for the experimental analysis of optimization algorithms. \end{itemize} \section{Literature Review} \label{sec:org3951365} The machine learning community has produced a tremendous amount of successful applications in recent years, ranging from image recognition to autonomous driving and outplaying humans in complex games. This spree of newsworthy results renewed the interest in combining the perspectives of artificial intelligence and operations research. Interestingly, many of the recent publications trace the ideas summarized by \citet{glover1986future} more than 30 years ago. In particular, the paper outlines a ``learning experiment'', which consists of an extensive data collection on a given class of problems, followed by a search for hidden patterns to enhance the solution process. The earliest application of this idea to the job shop scheduling problem was explored by \citet{Crowston-1964-prob-param}, where the authors conduct a learning experiment to derive probabilistic and parametric scheduling rules. The contributions that followed can be roughly partitioned into three groups. The first group uses learning experiments to tune optimization algorithms, which can be very sensitive to the choice of internal parameters. Such calibration requires computationally expensive experimentation, and many approaches automate this process using controlled experimentation \citep{hutter2009paramils,Adenso-Diaz-2006-fine-tunin,Birattari-2002-racing-algo}. The second group of publications considers the problem of matching problem instances to algorithms and their parameters. These are rooted in the idea that some algorithms perform well on certain instances but not others, so the goal is to exploit such situations by choosing from the set of available options. For example, one might construct a portfolio of available algorithms and make use of a large representative set of instances to build a prediction model that links problem features to the performance of available algorithms. These predictions are used to choose an algorithm from the portfolio on a per-instance basis, in order to achieve efficient performance on average when solving a sequence of optimization instances \citep{Xu-2008-satzil,Malitsky-2013-algor-portf,Streeter-2012-new-techn}. A general overview of the algorithm selection as well as a benchmark library for algorithm selection is discussed by \citet{bischl2016aslib}. Other researchers took this idea even further and use selection procedures to adjust parameters and subroutines dynamically during the search process. In the context of branch and bound algorithms, the dynamic selection of branching heuristics was explored by \citet{di2016dash}. \citet{nannicini2011probing} used a support vector machine (SVM) classifier to guess whether the probing algorithm should be applied on a given node of the branch-and-bound tree. The third group of publications, which is the closest to the ideas proposed in this paper, uses learning experiments to synthesize new optimization procedures. For example, \citep{alvarez2017machine} used supervised learning to design a new branching strategy that is trained to imitate strong branching. Similarly, \citet{khalil2016learning} outlined procedures that predict strong branching scores to accelerate the branching process. A node selection procedure was derived by \citet{he2014learning} using machine learning. A comprehensive overview of the machine learning applications for mixed integer programming solvers was performed by \citet{lodi2017learning}. Furthermore, \citet{dilkina2017comments} and \citet{louveaux2017comments} made comments on the survey and provided some future directions for intelligent branch-and-bound for mixed integer programming. \citet{kruber2017learning} developed a supervised learning approach to choose the best possible reformulation for decomposition. The experiments on structured instances showed a meaningful improvement on performance. \citet{basso2017random} used an unsupervised learning model to identify strong decomposition candidates. In the context of deep learning, the design of an optimization algorithm was defined as a learning problem by \citet{andrychowicz2016learning}, where an algorithm learns the structure of optimization problems. Through learning, the algorithm automatically tunes its parameters to optimize the performance on a particular class of optimization problems. \section{Binary Classification for Binary Optimization} \label{sec:orgc4c9526} \label{ml.bin} A binary optimization problem can be formally expressed as \begin{equation}\label{general.binary.model} \begin{array}{cc} \text{minimize } f(x) \\ \text{s.t. } x \in \mathcal X \subset \{0,1\}^n, \end{array} \end{equation} where the objective function \(f\) is an arbitrary function, and \(\{0,1\}^n \cap \mathcal X \neq \emptyset\). Since each component of a feasible vector \(x\) is either 0 or 1, the index set \(\overline{1,n} \equiv \{1,\ldots,n\}\) can be partitioned into two subsets based on an optimal solution \(x^*\) to the problem (\ref{general.binary.model}). The first subset includes all indexes \(j\) for which \(x^*_j\) is equal to one, while the remaining indexes are assigned to the second subset. Formally, these classes are denoted \(\mathcal C^1=\{j | x_j^*=1\}\) and \(\mathcal C^0=\{j | x_j^*=0\}\), \(j\in \overline{1,n}\). Note that there are as many such partitions as there are optimal solutions. \looseness=-1 Here we focus on the iterative methods, which transition from one solution to another, generate a sequence of binary solutions, and evaluate the corresponding objective function values. Consider a set of such solutions, \(\{x^1, \ldots, x^m\}\subseteq \mathcal X\), discovered after time \(t\). For \(j\in \overline{1,n}\), let \(I_j(t)\) denote a time-ordered list of pairs formed by the \(j\text{-th}\) components of these solutions and the corresponding objective values: \begin{equation*} I_j(t)=[ (x^1_j, f(x^1)), (x^2_j,f(x^2)), \ldots, (x^m_j, f(x^m))]. \end{equation*} Assuming that every run of the algorithm produces a different vector \(I_j(t)\), we would like to classify \(j\) either as belonging to \(\mathcal C_1\) or \(\mathcal C_0\). In other words, we would like to build a prediction model that would map vectors \(I_j(t)\), \(j \in \overline{1,n}\), into the interval [0,1], estimating a conditional probability \(P(j\in \mathcal C^1 | I_j(t))\). If there are no consistent patterns in \(I_j(t)\), the model should return probabilities close to 0.5, otherwise the probabilities should get closer to the ends of the interval [0,1], yielding predictions about the optimal solution components. Clearly, the model depends on a particular algorithm that produced the vector \(I_j(t)\), as well as on the time \(t\) used to collect the data sample. Consider the decomposition of \(I_j(t)\) into two sequences, \(I_j^1(t)\) and \(I_j^0(t)\), where \begin{align*} I_j^1(t)=\{ (x^k_j, f(x^k)): (x^k_j, f(x^k))\in I_j(t), x^k_j=1\},\\ I_j^0(t)=\{ (x^k_j, f(x^k)): (x^k_j, f(x^k))\in I_j(t), x^k_j=0\}. \end{align*} Here, \(I_j^1(t)\) describes all visited solutions with the component \(j\) equal to one, and \(I_j^0(t)\) corresponds to the objectives of solutions with the component \(j\) equal to zero. One of the sequences may be larger than the other, which makes it difficult to parametrize the model. To avoid this, one can downsample (remove) the entries in the larger sequence to match the size of the smaller sequence. Any data point in the data set for our binary classification problem can be described as \begin{center} \begin{tabular}{|cc|c|} \hline Input & & Output\\ \hline \(I_j^1(t)\) & \(I_j^0(t)\) & x\(^{\text{*}}_{\text{j}}\)\\ \hline \end{tabular} \end{center} Hence, we arrived at a binary classification problem, which can be solved by a variety of statistical methods (e.g., logistic regression, decision trees, random forests, neural networks). In the following discussion, we focus on the classification based on the logistic regression method. Logistic regression is a special case of a generalized linear model \citep{Agresti-2002-logis-reg}, and it is one of the most widely used statistical techniques for discrete data analysis. It can describe a relationship between one dependent binary variable and one or more nominal, ordinal, or interval independent variables. In other words, for a binary output variable \(Y\) and an input vector \(X\), the model predicts the conditional probability \(p(Y=1|X) \equiv h_{\theta}(X)\). The hypothesis function \(h_{\theta}\) in the logistic regression is given by the sigmoid function \begin{equation}\label{hypo.logreg} h_{\theta}(X) = \frac{1}{1+e^{-(\theta_0 + \theta X)}} \end{equation} When fitting (\ref{hypo.logreg}) to a particular dataset \(\{X^i,Y^i\}\), the parameter \(\theta\) can be obtained via the maximum likelihood method \citep{Kleinbaum-2010-maxim-likel}: \begin{equation*} \theta^* = \arg \max \prod_{i} h_{\theta}(X^i)^{Y^i} (1-h_{\theta}(X^i))^{1-Y^i} \end{equation*} Now, the logistic regression hypothesis for our binary classification problem \(h_{\theta(t)}( I_j(t) )\) can be stated as \begin{equation} \label{HF.full} h_{\theta(t)}( I_j(t) ) =\frac{1}{1+\exp{\left[\displaystyle \sum_{ (1,f(x_k))\in I_j^1(t) } \theta(t)f(x_k)-\displaystyle \sum_{ (0,f(x_k))\in I_j^0(t) } \theta(t) f(x_k)\right]}} \end{equation} Note that there is a single parameter in this model, \(\theta(t)\in \mathbb{R}^1\). There are multiple reasons for this restriction. First, assume that each variable \(x_j\) in (\ref{general.binary.model}) is substituted with \(x^{new}_j=\mathbf{1}-x_j\). Clearly, this substitution would not change the optimal objective. However, the terms in (\ref{HF.full}) would switch from one sum to another. Hence, by using the same parameter \(\theta(t)\) for the left summation and for the right summation, we guarantee that the equivalent encodings would produce the same model. Similarly, if there was a different parameter \(\theta(t)\) for each of the terms in summations, the order in which the solutions were visited would matter. However, we would like to avoid this temporal dependence by using a single parameter \(\theta(t)\). Lastly, all vectors \(I_j(t)\) are treated similarly to avoid reliance on the naming conventions, so the index \(j\) in \(I_j(t)\) does not play any role in predictions. As a result, the data for different solution components can be merged by simply concatenating the information vectors, \(I_j(t)\), \(j\in \overline{1,n}\), and their corresponding labels, \(\mathcal C_1\) or \(\mathcal C_0\), into a single data set. The size of \(I_j(t)\) changes with every new solution, and the optimal value of \(\theta(t)\) may change for different sizes of \(I_j(t)\). To avoid this, we can project \(I_j(t)\) to a smaller, fixed dimension. For example, such reduction can be achieved using the minimum function. Denote the resulting values by \(D^1_j(t)\) and \(D^0_j(t)\): \begin{align} \label{D1D0} \begin{split} D^1_j(t)&=\min( \{ f(x_j^k) | (x_j^k, f(x^k)) \in I_j(t), x_j^k=1\}) \\ D^0_j(t)&=\min( \{ f(x_j^k) | (x_j^k, f(x^k)) \in I_j(t), x_j^k=0\}) \end{split} \end{align} This provides us with the reduced information vector \(I^R_j(t)=[D^1_j(t), D^0_j(t)]\in \mathbb R^2\). Clearly, instead of storing \(I_j(t)\) in the memory for these calculations, \(I_j^R(t)\) can be updated directly every time the algorithm finds a new feasible solution. The corresponding reduced logistic regression model is described using the hypothesis \begin{equation}\label{HF.compact} h_{\theta(t)}( D^1_j(t) , D^0_j(t) ) =\frac{1}{1+\exp{\left(\theta(t) [D^1_j(t) - D^0_j(t)]\right)}} \end{equation} \looseness=-1 To clarify the classification problem, consider an example of the training data in Table \ref{table.logreg}. Two independent variables, \(D^1(t)\) and \(D^0(t)\) are used to predict whether the corresponding component in an optimal solution is equal to zero or one, with the ground truth values in column \texttt{opt}. To collect the training data for columns \(D^1(t)\) and \(D^0(t)\), the algorithm runs repeatedly for time \(t\) and reports the best objective for each solution component. Note that an algorithm may never encounter certain solution components with a value of zero (or one). In this case, we omit the corresponding rows from the data set, and the model prediction is fixed to 0.5 for those components. \begin{table}[htbp] \caption{An example of the training data for the logistic regression model. \label{table.logreg}} \centering \begin{tabular}{|c|c|c|} \hline D\(^{\text{1}}\)(t) & D\(^{\text{0}}\)(t) & opt\\ \hline 1395 & 1366 & 0\\ 1368 & 1400 & 1\\ 1366 & 1438 & 1\\ 1373 & 1366 & 0\\ 1379 & 1365 & 0\\ 1365 & 1389 & 1\\ \hline \end{tabular} \end{table} The model predictions for the component \(j\) are solely based on the difference between the best objective found with \(x_j=1\) and the best found objective with \(x_j=0\). Figure \ref{fig:regression.example} shows the predicted probabilities as a function of this difference. \begin{figure}[!ht] \centering \includegraphics[width=0.8\textwidth]{logistic-example.png} \caption{Logistic regression predictions for different values of the regression parameter $\theta$.} \label{fig:regression.example} \end{figure} In practice, the model (\ref{HF.compact}) can be tuned for a representative set of optimization problems, for which optimal or high-quality reference solutions are already established. Then the tuned model can be applied to new problem instances without known solutions, assuming that the new instances are ``similar'' to the problem set used to parametrize the model. The hypothesis functions (\ref{HF.full}) and (\ref{HF.compact}) first appeared in the context of the Global Equilibrium Search \citep{Shilo:1999}, which has shown excellent performance on a variety of classic combinatorial problems: job shop scheduling \citep{Pardalos:2006}, weighted maximum satisfiability \citep{Shylo:2008a}, quadratic unconstrained binary optimization \citep{Pardalos:2008}, and the maximum cut problem \citep{Shylo:2010,Shylo:2011a}, to name a few. Interestingly, these formulas were derived by \citet{Shilo:1999} by assuming the Boltzmann's distribution over the set of all feasible solutions, without any reference to the logistic regression or maximum likelihood estimation. In the next section, we explore the empirical distribution of the optimal regression parameter \(\theta(t)\) for different values of the time threshold \(t\) for a set of job shop scheduling instances \citep{Jain:1999}, and apply an iterative algorithm based on tabu search \citep{Nowicki:1996} to collect the training data. The choice of the tabu search is motivated by the wide domain of successful applications in the literature, while the job shop scheduling problem captures many complexities common to binary optimization domains. \subsection{Computational Experiment: Logistic Regression for Binary Optimization} \label{sec:orgffcc0d7} \label{log.comp.sec} Note that the optimal regression parameter \(\theta(t)\) in (\ref{HF.compact}) depends on a specific training dataset, which in our case, is generated by an optimization algorithm solving a problem instance for a fixed number of iterations. To collect the data, we need to choose an optimization algorithm, specific problem instances to solve, and a time threshold for data collection. The proposed framework was tested using the tabu search algorithm \citep{Glover-1997-tabu-searc} applied to the job shop scheduling problem. As a general purpose technique, the tabu method does not use any problem specific features of the job shop scheduling formulation and mainly relies on exploring the search space through a sequence of local moves. Hence, the following discussion should be viewed as a proof of concept, and is neither limited to the job shop scheduling problem, nor to the tabu search. The same methodology can be applied to any iterative binary optimization algorithm. \subsubsection{Problem Instances} \label{sec:org978feae} In the job shop scheduling problem, there is a set \(M=\{M_1,M_2,\ldots,M_m\}\) of machines and a set \(O=\{\sigma_1,\ldots,\sigma_{N}\}\) of operations. To complete operation \(\sigma_i\in O\), it has to be processed by the specific machine \(M(\sigma_i)\in M\) for time \(p(\sigma_i)\). Additionally, there are precedence constraints between operations defined by a set \(\mathcal{P}\) of ordered pairs, so if \((\sigma_i,\sigma_j)\in \mathcal{P}\), then \(\sigma_i\) has to be finished before starting \(\sigma_j\). If two operations are linked by the precedence constraint, we say that they belong to the same job. The objective is to find a processing order of operations to minimize the largest completion time. For any two operations \(\sigma_i\) and \(\sigma_j\) that are processed by the same machine, either \(\sigma_i\) or \(\sigma_j\) is processed first. Let \(x_{(i,j)}\) denote a binary variable that determines the order between \(\sigma_i\) and \(\sigma_j\). If there are \(n\) operations assigned to the same machine, we would need \(n\cdot(n-1)/2\) binary variables to define their processing sequence. Let \(I\) denote a set of all binary variable indexes, \(I=\{ (i,j): \sigma_i,\sigma_j \in O, i<j, M(\sigma_i)=M(\sigma_j)\}\), and let \(x\) denote a binary vector comprised of all \(x_{(i,j)}\) variables. Then the earliest completion time for the schedules defined by \(x\) can be found by solving the following problem. \begin{align} \begin{split} \text{minimize } C_{max}(x) := \max\limits_{\sigma_i \in O}[s(\sigma_i)+p(\sigma_i)] & \label{obj}\\ \text{subject to }& \\ s(\sigma_i)\geq 0 \mbox{, } \forall \sigma_i\in O &\\ s(\sigma_j)\geq s(\sigma_i)+p(\sigma_i) \mbox{, } \forall (\sigma_i,\sigma_j)\in \mathcal{P}&\\ s(\sigma_i)\geq s(\sigma_j) + p(\sigma_j) - C\cdot x_{(i,j)}, \forall (i,j)\in I\\ s(\sigma_j)\geq s(\sigma_i) + p(\sigma_i) - C\cdot (1-x_{(i,j)}), \forall (i,j)\in I. \end{split} \end{align} Here \(s(\sigma_i)\) provides the start time of the operation \(\sigma_i\), and \(C_{max}\) is often referred to as the makespan of the schedule represented by start times of operations from \(O\). The constant \(C\) is a large positive number, which can be set to \(\sum_{\sigma_i\in O} p(\sigma_i)\). If the problem is infeasible, the optimal objective is considered to be equal to infinity. Let \(C^*_{max}(x)\) denote the optimal objective of the problem (\ref{obj}), then the job shop scheduling problem can be defined as \begin{align*} \text{minimize } C^*_{max}(x) &\\ x_{(i,j)}\in \{0,1\}, & \forall (i,j)\in I. \end{align*} For the computational experiment we considered Taillard's benchmark problems. This problem set contains 80 randomly generated problems denoted by ta01-ta80 generated by \citet{Taillard:1993}. Optimal solutions are known for 58 problems from this class. In the literature the problems ta01-ta10 and ta51-ta80 are often reported as the easiest problems of the set, therefore we limited our testing to the remaining problems ta11-ta50. The ratio of jobs to machines in ta11-ta50 ranges from 1 to 2, and, as of now, no optimality proofs are known for instances with the ratio of 1.5. A constraint programming search algorithm developed by \citet{Vilim-2015-fail-direc} is among the few successful applications of generic search algorithms to these instances. It is also an integral part of the IBM ILOG CP Optimizer. The study of commercial MIP solvers (Gurobi, CPLEX and SCIP) by \citet{Ku-2016-mixed-integ} revealed that the problems ta11-ta50 are still out of their reach. \subsubsection{Optimization Algorithm} \label{sec:orgf65c4cc} \label{sec.tabu.search} Tabu search proposed by \citet{Glover:1989} is arguably one of the best standalone optimization approaches among those based on local search. Tabu search employs a short-term memory prohibition mechanism that prevents the revisiting of solution attributes that have been recently removed. Less commonly, tabu restrictions inhibit the removal of attributes that were recently introduced. In general, these two types of restrictions lead to different search trajectories and might be employed in parallel, however in the case of 0-1 optimization problems, they are equivalent. Through inhibition mechanisms and by enabling non-improving solution attributes, the tabu search method provides an almost effortless escape from local minima together with efficient exploration of the search space. Notably, many of the best algorithms for the job shop scheduling utilized a tabu search component \citep{Zhang-2008-very-fast,Goncalves-2013-exten-akers,Peng-2015-tabu-searc}. \begin{algorithm} \caption{Pseudocode of the tabu search algorithm. } \label{algo.tabu} \begin{algorithmic}[1] \Procedure{TabuAlgorithm}{$T_{min}$, $T_{max}$, $nepochs$, $niters$} \State generate a random solution $x^{min}$ \State $x^0 = x^{min}$ \label{tabu.line.revert} \State $tabuExp(j)=0$, $j=1,\ldots,|x^{min}|$; \Comment{initialize tabu status expiration} \For{$epoch=1$ to $nepochs$} \For{$iter=1$ to $niters$} \State $tenure \leftarrow$ generate a random integer from $[T_{min},T_{max}]$ \For{$x$ in $N(x^0)$} \label{tabu.line.scan1} \State $expir(x) = iter$ \label{tabu.line.status1} \For{$j$ in $\{j: x^0_j\neq x_j\}$} \State $expir(x) = \max(tabuExp(j), expir(x))$ \EndFor \If{$expir(x)>iter$} \State TabuSet = TabuSet $\cup \ x$ \EndIf \label{tabu.line.status2} \EndFor \label{tabu.line.scan2} \State NonTabuSet = $N(x^0)$ - TabuSet \If{NonTabuSet $\neq \emptyset$} \State $x^{new}= \arg \min \{f(x): x\in \text{NonTabuSet}\}$ \Comment{best non-tabu solution} \Else \State $x^{new} = \arg \min\{ expir(x): x\in N(x^0)\}$ \Comment{ tabu solution with earliest expiration} \EndIf \For{$j$ in $\{j: x^{new}_j\neq x^0_j\}$} \Comment{only look at the components that have changed} \State $tabuExp(j)=iter+tenure$ \EndFor \State $x^0=x^{new}$ \If{[$f(x^0)<f(x^{min})$]} \State $x^{min}=x^0$ \EndIf \EndFor \EndFor \Return $x^{min}$ \EndProcedure \end{algorithmic} \end{algorithm} Procedure \ref{algo.tabu} describes our implementation of the tabu search method. The vector \(tabuExp\) keeps track of the tabu status of solution components. For example, if \(tabuExp[5]=100\), then the fifth component of the solution vector is considered tabu, as long as the iteration counter is less than 100. If there are multiple solution components involved, the tabu status is defined by the component with the largest value of \(tabuExp\). The algorithm runs for a fixed number of epochs, each consisting of \(niters\) iterations. In each iteration the duration of the tabu tenure is set to a random integer in the interval \([T_{min},T_{max}]\) to prevent cycling. The algorithm scans through all the solutions in the neighborhood of the current solution \(x^0\) (Procedure \ref{algo.tabu}, lines \ref{tabu.line.scan1}-\ref{tabu.line.scan2}) to identify the set of prohibited/tabu solutions. The non-tabu solution with the best objective value is chosen as the next incumbent solution, using random tie-braking if necessary. If all of the solutions in the neighborhood are prohibited, then the algorithm chooses the solution with the earliest expiration of its tabu status. The best found solution is returned after the fixed number of search epochs. Note that there only two components of the algorithm that are problem specific: the neighborhood \(N(x)\) and the specific objective function \(f(x)\). In our case, the search is based on the N4-neighborhood for the job shop scheduling problem \citep{Blazewicz:1996}, which makes use of the critical path concept. The N4-neighborhood consists of solutions obtained by moving operations either to the beginning or to the end of their critical blocks. As for the objective, we minimize the makespan of the schedule as defined in (\ref{obj}). \subsubsection{Computational Results} \label{sec:org6a5a515} In the first set of experiments, we investigated the predictive potential of the logistic regression model (\ref{HF.compact}). The tabu search outlined in the previous section was used to solve Taillard's instances ta11-ta50. In total, we performed 20 runs, each run was limited to \(nepochs=200\) and each epoch consisted of \(niters=300,000\) iterations. The lower tenure range parameter \(T_{min}\) was set to 5 and \(T_{max}\) was set to 11. \looseness=-1 In every run we continuously updated the values \(D^1_j\) and \(D^0_j\) for each solution component \(j\) as defined in (\ref{D1D0}). Remember that these values are the best objectives found when the component \(j\) is equal to one and zero respectively, so each update to the vectors \(D^1_j\) and \(D^0_j\) takes \(O(|x|)\) steps, where \(|x|\) is the size of the binary solution vector. In order to decrease the time spent updating these structures, the updates were performed every 100 iterations or whenever the best known solution was improved. To provide the target/output values in the training data, the record solutions from \citep{optimizizer} were used. At each epoch, the algorithm provided a table of training data similar in structure to the one presented in Table \ref{table.logreg}. Using this table, at the end of each epoch we generated the maximum likelihood estimator for the logistic regression parameter \(\theta\) using the model (\ref{HF.compact}). Figure \ref{fig:regression} shows the average \(\theta\) values and the corresponding accuracy of the logistic regression model over 20 runs, along with the corresponding 95\% confidence intervals. \begin{figure}[!ht] \subfloat{% \includegraphics[width=0.5\textwidth]{accta11-ta20-tabu0.png} } \hfill \subfloat{% \includegraphics[width=0.5\textwidth]{accta21-ta30-tabu0.png} } \vfill \subfloat{% \includegraphics[width=0.5\textwidth]{accta31-ta40-tabu0.png} } \hfill \subfloat{% \includegraphics[width=0.5\textwidth]{accta41-ta50-tabu0.png} } \caption{Optimal regression parameter $\theta$ and the corresponding accuracy of the logistic regression model on the set of Taillard's instances ta11-ta50.} \label{fig:regression} \end{figure} The accuracy plots confirm that the best objective values \(D^1\) and \(D^0\) generated by the tabu search are relatively good predictors of the optimal solution values, with the average accuracy between 80\% and 95\%. Also, it is clear that the optimal regression parameter, as well as the model accuracy, tends to increase over time, until it reaches a saturation point when the algorithm is not able to find any improvements. Figure \ref{fig:histogram.theta} shows the overall distribution of the optimal regression parameter \(\theta\) on all the instances. Notice that the distribution of optimal \(\theta\) values is rather robust, and most of the optimal \(\theta\) values belong to the interval [0,1]. It is important to emphasize that this range is specific for the tabu search algorithm and job shop problem instances ta11-ta50, and other algorithms may produce completely different ranges. \begin{figure}[!ht] \centering \includegraphics[width=0.6\textwidth]{histogram-of-theta.png} \caption{Distribution of the optimal regression parameter $\theta$ on instances ta11-ta50.} \label{fig:histogram.theta} \end{figure} \subsubsection{Backbone Size} \label{sec:org5e2b10f} The results of this section can be explored from the perspective of the big-valley and backbone results developed by \citet{Watson:2001,Streeter:2006}. The normalized backbone size \(\rho\) of the problem instance is defined as a proportion of binary variables that assume the same value in all optimal solutions. By considering random instances with the number of jobs \(N\) and the number of machines \(M\), it was shown that the normalized backbone size \(\rho\) depends on the ratio of \(N/M\). In the limit, for \(N/M \rightarrow 0\) the normalized backbone size converges to 1, while for \(N/M \rightarrow \infty\) it converges to 0. Assume that in the best schedule generated by the tabu search, given the backbone size \(\rho\), the average number of variables that share common values with the backbone variables is \(p_b \rho\). Given an optimal solution, let \(p_o (1-\rho)\) denote the average number of non-backbone variables in the best schedule that share common values with that optimal solution. Then the average logistic regression accuracy \(A\) can be expressed as $$ A = p_b \rho + p_o(1-\rho), $$ where \(p_b\) and \(p_o\) can be viewed as measures of the algorithm performance. To explore this relationship, we conducted a test on the problem instance \texttt{ft10} \citep{Beasley-1990-or-librar}. Using an arbitrary optimal solution, we performed 20 one-minute runs of the tabu algorithm, and the logistic regression reached 98\% accuracy on average. Since the algorithm found an optimal solution in each run, we have \(p_b=1\). Assuming \(p_o\geq 0.5\), the above expression for accuracy yields \(\rho \leq 0.96\), thus providing an upper bound on the normalized backbone size. Note that \citet{Streeter:2006} calculated the exact normalized backbone size of 95\% for this instance. Next, we considered instances with a higher ratio of jobs to machines, and performed one-minute runs on five instances from \citep{Demirkol:1998}, dmu31-dmu35. In these problems the ratio of jobs to machines is equal to 3.33. For each instance, we ran the tabu search 20 times and the algorithm found an optimal solution in each of the one-minute runs. Using an arbitrary optimal solution, we calculated that the average logistic regression accuracy over all five instances was 0.61, which allow us to calculate an upper bound on the normalized backbone size, \(\rho\leq 0.23\). \section{Guided Tabu Algorithm} \label{sec:orgc60d28b} \label{gta} To tune the regression model for a specific problem instance, one needs to know an optimal or high-quality solution to that instance. When solving a new problem, the regression parameter has to be re-calibrated. Clearly, an optimal solution of the new problem instance is not available for such re-calibration, unless we solve the problem. Is it possible to use the logistic model from the previous section to boost the search process without knowing an optimal solution? Instead of finding the optimal regression parameter value, we generate a sequence of ``potential'' optimal values \(0=\theta_0\leq \theta_1\leq \ldots \leq \theta_K=1.0\), and scan through them one by one, generating model predictions. If the interval discretization is fine enough and a problem instance is similar to ta11-ta50, one of the \(\theta\) values may end up close to the optimal value, and the regression model will produce near-optimal predictions based on the available data. Next, we outline the Guided Tabu Algorithm (GTA), which combines the standard tabu method and the logistic regression model described in the previous section. The proposed algorithm borrows some ideas from the Global Equilibrium Search method introduced by \citet{Shilo:1999}. \subsection{Algorithm Description} \label{sec:orgef7b796} \label{gta.desc} \looseness=-1 Instead of using a single tabu tenure parameter, each component of a solution vector is assigned a separate tabu expiration parameter \(tabuExp(j)\), which provides the iteration at which the component's tabu status expires. These expiration times are updated whenever the component changes its value. By assigning large expiration times \(tabuExp(j)\) the algorithm attempts to preserve the current value of \(x_j\), while small expiration times \(tabuExp(j)\) will induce a faster rate of change for \(x_j\). The attribute-dependent tenures, where each solution attribute is assigned a separate tabu tenure value, has also been identified in earlier publications \citep{Glover:1993,Glover:1990a}. However, previous discussions of the attribute-dependent tenures mainly focused on the variability with respect to restrictive powers of different move attributes \citep{Glover:1993}, with an emphasis being placed on an idea that when using the same tabu tenure for all solution components, prohibition of certain solution attributes might have a stronger impact on the search process than prohibition of the others. From the previous section, the reduced logistic regression model uses two values, \(D^1_j\) and \(D^0_j\), to predict the probability \(p_j\) that \(x^*_j=1\) in an optimal solution \(x^*\): \begin{equation} p_j \equiv \frac{1}{1+e^{\theta D^1_j(t) - \theta D^0_j(t)}} \approx P( x^*_{j}=1). \label{calc.prob} \end{equation} Notice that every variable with a tabu status can be in one of two states: \(x_j=1\) or \(x_j=0\). By setting distinct tenure values for each of these states, we can assure that the ratio of overall time spend in each of them is proportional to \(p_j\) and \(1-p_j\), respectively. This ratio can be achieved by using the following rule for updating tabu status expiration. Given a standard tenure duration \(\mathcal T\), if a local move changes the value of component \(j\) from \(x_j\) to \(x^{new}_j\) at iteration \(iter\), we can update the tabu expiration of the component \(j\) as \begin{equation}\label{map.prob.to.tenure} tabuExp(j) = \left\{ \begin{array}{ll} iter+ \mathcal T \frac{p_j}{\max[\epsilon,1-p_j]} & \text{if } (x^{new}_j =1 \text{ and } p_j\geq 0.5),\\ iter + \mathcal T \frac{1-p_j}{\max[\epsilon,p_j]} & \text{if } ( x^{new}_j =0 \text{ and } p_j\leq 0.5),\\ \mathcal T & \text{otherwise.} \end{array} \right. \end{equation} This mapping assures that if, after a local move, the new value of the variable \(x^{new}_j\) is not consistent with the model prediction \(p_j\), then it will be assigned some standard tenure duration \(\mathcal T\). Otherwise, the variable is assigned a larger tenure in proportion to the ratio between \(p_j\) and \(1-p_j\) to promote a slower rate of change. The parameter \(\epsilon\) is a small constant that prevents division by zero (e.g., we use \(\epsilon = 10^{-4}\) in all computations). Procedure \ref{algo.gta} provides a description of the Guided Tabu Algorithm (GTA). Notice the similarities with the tabu search presented in Procedure \ref{algo.tabu}. Both algorithms operate for a number of epochs, each consisting of a fixed number of iterations. At each iteration, the algorithms scan through the neighborhood of the incumbent solution. The vector \(tabuExp\) keeps track of the tabu status of solution components. GTA uses additional data structures to keep track of the values \(D^1_j\) and \(D^0_j\) for each solution component. In order to decrease the computational overhead, the updates are performed every \(d\) iterations or whenever the best known solution is improved. After each update we calculate the probabilities according to (\ref{calc.prob}). These probabilities depend on the logistic regression parameter \(\theta\), which is defined as a function of the current iteration epoch: $$ \theta=\theta_{min}\cdot\exp\left(\frac{\theta_{max}}{\theta_{min}}\cdot \frac{epoch-1}{nepochs-2}\right) $$ The above expression assures that the values of \(\theta\) are log-uniformly distributed between \(\theta_{min}\) and \(\theta_{max}\). At iteration \(iter\), if the predictions provided by \(p_j\) are inconsistent with the new incumbent solution, the corresponding tabu expiration values are set based on the default tenure duration, \(tenure\). Otherwise, the algorithm assigns larger expiration values according to (\ref{map.prob.to.tenure}). \begin{algorithm} \caption{Pseudocode of the Guided Tabu Algorithm. } \label{algo.gta} \begin{algorithmic}[1] \Procedure{GuidedTabuAlgorithm}{$T_{min}$, $T_{max}$, $nepochs$, $niters$, $\theta_{min}$, $\theta_{max}$} \State $tabuExp(j)=0$, $j=1,\ldots,|x^0|$; \Comment{initialize tabu status expiration} \State generate a random solution $x^{min}$; set $x^0 = x^{min}$, $\theta = 0$ \For{$epoch=1$ to $nepochs$} \For{$iter=1$ to $niters$} \State $tenure \leftarrow$ generate a random integer from $[T_{min},T_{max}]$ \For{$x$ in $N(x^0)$} \State $expir(x) = iter$ \For{$j$ in $\{j: x^0_j\neq x_j\}$} \State $expir(x) = \max(tabuExp(j), expir(x))$ \EndFor \If{$expir(x)>iter$} \State TabuSet = TabuSet $\cup \ x$ \EndIf \EndFor \State NonTabuSet = $N(x^0)$ - TabuSet \If{NonTabuSet $\neq \emptyset$} \State $x^{new}= \arg \min \{f(x): x\in \text{NonTabuSet}\}$ \Comment{ best non-tabu solution} \Else \State $x^{new} = \arg \min\{ expir(x): x\in N(x^0)\}$ \Comment{ tabu solution with earliest expiration} \EndIf \If{$iter \bmod d = 0 $ or $f(x^0)<f(x^{min})$} \label{updateD1D0} \State update vectors $D^1$, $D^0$ \State calculate probabilities $p_j=1/\left(1+e^{\theta D^1_j(t) - \theta D^0_j(t)}\right)$, $j=1,\ldots,|x^0|$; \EndIf \label{endupdateD1D0} \For{$j$ in $\{j: x^{new}_j\neq x^0_j\}$} \Comment{only look at the components that have changed} \If{ ($x^{new}_j=1$ and $p_j\geq 0.5$) or ($x^{new}_j=0$ and $p_j\leq 0.5$)} \label{updateT} \State $tabuExp(j)=iter+tenure\cdot \frac{\max(p_j,1-p_j)}{\max[\epsilon,\min(p_j,1-p_j)]}$ \Else \State $tabuExp(j)=iter+tenure$ \EndIf \label{endupdateT} \EndFor \State $x^0=x^{new}$ \If{$f(x^0)<f(x^{min})$} \State $x^{min}=x^0$ \EndIf \EndFor \State{$\theta = \theta_{min} \exp\left(\frac{\theta_{max}}{\theta_{min}}\cdot \frac{epoch-1}{nepochs-2}\right)$} \label{log.spacing} \EndFor \Return $x^{min}$ \EndProcedure \end{algorithmic} \end{algorithm} \subsection{Computational Study} \label{sec:orge0f184b} In this section, we compare tabu and guided tabu algorithms to evaluate the impact of the logistic component. To provide intuitive and compact comparison, we introduce a new tool -- the probability dominance plots, which are based on the concept of probability dominance \citep{Wrather-1982-prob-domin}. These plots provide the answer to the following question: Given two algorithms, \(\mathcal A\) and \(\mathcal B\), a set of problem instances \(\mathcal C\), and the time threshold \(t\), what is the probability that the algorithm \(\mathcal A\) finds a better solution than the algorithm \(\mathcal B\) if each instance in \(\mathcal C\) is equally likely to be selected? \subsubsection{Experimental Design} \label{sec:org8a3f032} \begin{longtable}{|c|c|c|} \caption{\label{tab:orgb4f7ac1} Notation for comparing algorithms.} \\ \hline Problem & Algorithm \(\mathcal A\) & Algorithm \(\mathcal B\)\\ \hline \endfirsthead \multicolumn{3}{l}{Continued from previous page} \\ \hline Problem & Algorithm \(\mathcal A\) & Algorithm \(\mathcal B\) \\ \hline \endhead \hline\multicolumn{3}{r}{Continued on next page} \\ \endfoot \endlastfoot \hline \(c_1\) & \(X^{\mathcal A}_{c_1}:= (x^1_1, x^1_2, \ldots,x^1_{n_1})\) & \(X^{\mathcal B}_{c_1}:= (y^1_1, y^1_2, \ldots,y^1_{m_1})\)\\ \(c_2\) & \(X^{\mathcal A}_{c_2}:= (x^2_1, x^2_2, \ldots,x^2_{n_2})\) & \(X^{\mathcal B}_{c_2}:= (y^2_1, y^2_2, \ldots,y^2_{m_2})\)\\ \(\cdots\) & \(\cdots\) & \(\cdots\)\\ \(c_k\) & \(X^{\mathcal A}_{c_k}:= (x^k_1, x^k_2, \ldots,x^k_{n_k})\) & \(X^{\mathcal B}_{c_k}:= (y^k_1, y^k_2, \ldots,y^k_{m_k})\)\\ \hline \end{longtable} For a pairwise comparison, we consider two algorithms \(\mathcal A\) and \(\mathcal B\) and a set of benchmark instances \(\mathcal C\). We are interested in estimating the probability of \(\mathcal A\) being better than \(\mathcal B\) with respect to one-dimensional performance measure when presented with a random instance from \(\mathcal C\) (each instance is equally likely to be selected). To estimate this probability we repeatedly run \(\mathcal A\) and \(\mathcal B\) on each instance in \(\mathcal C\) and record corresponding performance measures for each run. Let \(X^{\mathcal A}_c\) denote a vector of performance measures obtained by repeatedly executing \(\mathcal A\) on a problem \(c\in \mathcal C\). The notation is clarified in Table \ref{tab:orgb4f7ac1}, where \(n_i\) corresponds to the total number of runs for \(\mathcal A\) on \(c_i\), and similarly \(m_i\) denotes number of runs for \(\mathcal B\) on \(c_i\). When the goal is to minimize the performance measure, the probability that \(\mathcal A\) outperforms \(\mathcal B\) on a problem \(c\) can be estimated as $$ \displaystyle P_{\mathcal A< \mathcal B|c}=\frac{\displaystyle \sum_{x\in X^{\mathcal A}_c } \sum_{y\in X^{\mathcal B}_c} 1_{x< y} (x,y)}{|X^{\mathcal A}_c|\cdot |X^{\mathcal B}_c|} $$ where \(1_{x< y}(x,y)\) is an indicator function \begin{equation*} 1_{x< y}(x,y) = \begin{cases} 1, & \text{if } x< y\\ 0, & \text{otherwise.} \end{cases} \end{equation*} The probability of \(\mathcal A\) outperforming \(\mathcal B\) on a random instance from \(\mathcal C\) is an average of \(P_{\mathcal A< \mathcal B|c}\) over all problems in \(\mathcal C\): \begin{equation*} P_{\mathcal A< \mathcal B|\mathcal C} = \frac{1}{|\mathcal C|}\sum_{c\in \mathcal C} P_{\mathcal A< \mathcal B|c} \end{equation*} The probability dominance plot shows the probabilities \(P_{\mathcal A< \mathcal B|\mathcal C}\), \(P_{\mathcal B< \mathcal A|\mathcal C}\) as a function of time, and the corresponding 95\% bootstrap confidence intervals \citep{Diciccio-1996-boots-confid-inter}. In the following computational experiments, the focus is on the best objectives found by the algorithms, but the same methodology can be applied to other measures of performance. The experimental data set and the code for generating the probability dominance plots are available on GitHub \citep{Shylo-2018-github-gtajob}. \subsubsection{Computational Results} \label{sec:org6fb4711} \looseness=-1 To evaluate the impact of the logistic regression component on the performance, the tabu search from Section \ref{log.comp.sec} and the Guided Tabu Algorithm from Section \ref{gta.desc} were used to solve Taillard's instances ta11-ta50. For both algorithms, we performed 20 runs on each problem instance, each run was limited to \(nepochs=200\) and each epoch consisted of \(niters=300,000\) iterations. The lower tenure range parameter \(T_{min}\) was set to 5 and \(T_{max}\) was set to 11 for both algorithms. The parameters \(\theta_{min}\) and \(\theta_{max}\) of GTA were set to 0.001 and 1.0, respectively. In GTA, the update frequency \(d\) was set to 100 iterations, and the parameter \(\epsilon\) in the tenure calculations was set to \(10^{-4}\). Figure \ref{fig:compta1150} shows the probability dominance plots with respect to the epoch numbers, using the best objective function values as the performance metric. As expected, in the initial epochs, when the logistic parameter \(\theta\) is small, GTA behaves identical to the standard tabu search, and the algorithms exhibit similar performance. However, as the time progresses, GTA is able to leverage information from the visited solutions to boost its performance. The average probability that the standard tabu search outperforms GTA after 200 epochs is less than 20\% on all problem instances. \begin{figure}[!ht] \subfloat{% \includegraphics[width=0.5\textwidth]{ta11-ta20-gtacurve-vs-tabu0.png} } \hfill \subfloat{% \includegraphics[width=0.5\textwidth]{ta21-ta30-gtacurve-vs-tabu0.png} }\\[-0.9cm] \vfill \subfloat{% \includegraphics[width=0.5\textwidth]{ta31-ta40-gtacurve-vs-tabu0.png} } \hfill \subfloat{% \includegraphics[width=0.5\textwidth]{ta41-ta50-gtacurve-vs-tabu0.png} } \caption{Probability dominance plots comparing GTA and Tabu algorithm on the set of Taillard's benchmarks ta11-ta50 with respect to the \it{number of iterations}.} \label{fig:compta1150} \end{figure} \begin{figure}[!ht] \subfloat{% \includegraphics[width=0.5\textwidth]{ta11-ta20-gtacurvetime-vs-tabutime-TIME.png} } \hfill \subfloat{% \includegraphics[width=0.5\textwidth]{ta21-ta30-gtacurvetime-vs-tabutime-TIME.png} }\\[-0.9cm] \vfill \subfloat{% \includegraphics[width=0.5\textwidth]{ta31-ta40-gtacurvetime-vs-tabutime-TIME.png} } \hfill \subfloat{% \includegraphics[width=0.5\textwidth]{ta41-ta50-gtacurvetime-vs-tabutime-TIME.png} } \caption{Probability dominance plots comparing GTA and Tabu algorithm on the set of Taillard's benchmarks ta11-ta50 with respect to the \it{run times}.} \label{fig:compta1150-time} \end{figure} Note that GTA spends more time in each epoch in order to evaluate \(D^1\) and \(D^0\). Though it is clear that the logistic component significantly improves computational performance in terms of solution quality, Figure \ref{fig:compta1150} does not provide much information about the actual run times. To check how the additional computations impact the time, we conducted an experiment, in which the duration of each run was fixed to 30 minutes and did not depend on the parameter \(nepochs\) (i.e., \(nepochs=\infty\)). All the parameters were identical to the previous experiment, except for the logistic parameter values. Instead of spacing them based on the current epoch number, line \ref{log.spacing} in Procedure \ref{algo.gta}, we updated the formula, so \(\theta\) is defined as a function of time. Given the threshold \(t^0\) (30 minutes in our computations), the parameter \(\theta\) at time \(t\) was calculated as \(\theta_{min} \exp\left(\frac{\theta_{max}}{\theta_{min}}\cdot \frac{t}{t^0}\right)\). Figure \ref{fig:compta1150-time} shows the corresponding probability dominance plots, which reveal that the tabu algorithm can be significantly improved by the logistic regression component. The next computation experiment focused on the problems introduced by \citet*{Demirkol:1998}. This set contains 80 problems, denoted as dmu01-dmu80. As of now, the optimal solutions are known for 26 of these problems. The latest upper and lower bounds for these instances are publicly available \citep{optimizizer}. We limited our study to the instances dmu41-dmu80, which seem to be the hardest among those studied in the job shop scheduling literature. In these instances, the set of machines is split into two groups, and every job has to be processed by the machines in the first group before being processed by the second group. This special routing structure seems to induce instances that are significantly harder than ta01-ta80. The number of binary variables in these problems range from 2850 to 24500 and the ratio between jobs and machines is between 1 and 3.3. Optimal solutions are not known for any of these problems. As of now, successful applications of the exact methods to these instances has never been reported in the literature. We used the same parameters as before, and the results of 20 GTA runs on each problem are presented in Figure \ref{fig:compdmu4180}. The results are similar to those presented for the Taillard's instances, with the exception of dmu71-dmu80, where the tabu search clearly outperforms GTA. Note that the probabilities diverge early on, which is different from all other instances. Clearly, the initial values of the logistic regression parameter are too large, causing premature fixation on early solutions with poor quality. To fix this issue, we changed \(\theta_{min}\) from 0.001 to 0.0001 and reran the experiment. Figure \ref{fig:compdmu7180-delay} shows the corresponding probability dominance plot. As observed on other instances, GTA traces the performance of the tabu search on early iterations and pulls away at the final epochs. \begin{figure}[!ht] \subfloat{% \includegraphics[width=0.5\textwidth]{dmu41-dmu50-gtacurve-vs-tabu0.png} } \hfill \subfloat{% \includegraphics[width=0.5\textwidth]{dmu51-dmu60-gtacurve-vs-tabu0.png} } \vfill \subfloat{% \includegraphics[width=0.5\textwidth]{dmu61-dmu70-gtacurve-vs-tabu0.png} } \hfill \subfloat{% \includegraphics[width=0.5\textwidth]{dmu71-dmu80-gtacurve-vs-tabu0.png} } \caption{Probability dominance plots comparing GTA and Tabu algorithm on the set of Demirkol's benchmarks dmu41-dmu80 with respect to the number of iterations.} \label{fig:compdmu4180} \end{figure} \begin{figure}[!ht]\centering \includegraphics[width=0.5\textwidth]{dmu71-dmu80-gtacurve0001-vs-tabu0.png} \caption{Probability dominance plots comparing GTA with $\theta_{min}=0.0001$ and Tabu algorithm on the set of Demirkol's benchmarks dmu71-dmu80 with respect to the number of iterations.} \label{fig:compdmu7180-delay} \end{figure} \looseness=-1 As a byproduct, our experiments with GTA on the Taillard's and Demirkol's instances provided solutions (the new upper bounds are in the brackets) that improved existing upper bounds for the following problems: ta48 (1937), dmu42-dmu44 (3390, 3441, 3475), dmu48-dmu49 (3763, 3710), dmu51 (4156), dmu53-dmu55 (4390, 4362, 4270), dmu57-dmu65 (5655, 4708, 4619, 4739, 5172, 5251, 5323, 5240, 5190), dmu67 (5779), dmu68 (5765), dmu70 (5889), dmu72-dmu77 (6473, 6153, 6196, 6807, 6792), dmu79 (6952), dmu80 (6673) \citep{optimizizer}. \section{Conclusions} \label{sec:org71a0c2f} \label{conclusions} Our results show that the samples of visited solutions may contain valuable information that can be exploited via binary classification. The proposed framework is not limited to job shop scheduling and can be easily extended to any binary optimization problem. Many efficient solvers are good at finding high quality solutions, but do no attempt to prove optimality. In view of our results, it seems plausible that the solutions scanned by these solvers can be harnessed for optimality proofs. For example, the predictions of the presented regression model can guide branching and node selection decisions in branch and bound methods. Many optimization approaches rely on tabu method, but often utilize external methods for diversification and intensification of the search. For example, multi-start tabu strategies repeatedly launch tabu procedure from different initial solutions, which are generated using a subset of high-quality solutions \citep{Peng-2015-tabu-searc}. The algorithm proposed in this paper uses the native parameter of tabu search, tabu tenure, to provide intensification and diversification without complications common to similar extensions. The algorithm is easy to implement, has a small number of parameters and has shown excellent performance on the available job shop benchmark instances. The guided tabu algorithm can be easily adapted for any binary optimization problem. \bibliographystyle{apalike}
\section{Graph-based models} Defining $D$ as the dataset of a Recommender System composed by the set of users $U$, the set of items $I$, the set of item features $F$ and all the relations among them. Defining $V = U \cup I \cup F$ as the set of vertices, $E \subseteq (U \times I) \cup (I \times U) \cup (I \times F) \cup (F \times I)$ as the set of edges and assigning to every edge a weight equal to the value of the relation between the nodes it connects, we can represent $D$ with a weighted tripartite graph $G = (V, E)$. Recommendations on $D$ can be provided exploiting random walks over $G$, accomplished by starting on a vertex and choosing randomly one of its neighbors at each step. We can represent $G$ with a square $|V| \times |V|$ adjacency matrix $A$, where every entry $A[i,j], i,j \in V$ represents the weight $w(i,j)$ of the edge that connects the node $i$ to $j$. Normalizing $A$ rowwise, we can compute the probability, or markovian, matrix P where $P[i,j]$ represents the probability of choosing any node $j \in V$ when standing in any node $i \in V$. To get the probability relative to random walks of length $l$, we can elevate $P$ to the power of $l$. Finally, recommendation lists are provided selecting, for each users, the items with highest probabilities. It has been shown in literature that short random walks achieve best performance in most situations\cite{cooper2014}. In particular, if we consider paths of length 3 over $G$, we can distinguish two types, starting from a user node: \begin{itemize} \item \textit{user-item-user-item}: a \textit{collaborative path} that exploits only interactions to reach the destination. Its results are obtained removing edges from items to features before elevating P. This approach has been called $P^3$\cite{cooper2014}. \item \textit{user-item-feature-item}: a \textit{content-based path} that exploits item features over other users' interactions to reach the destination. Its results are obtained removing edges from items to users before elevating $P$. \end{itemize} \section{Model simplification} In previous sections we stated that a graph-based random walk model uses only final user-item probabilities to produce recommendation lists, which means that of the whole 3 steps random walk result we only need the one referred to complete paths from users to items, that is represented by one single submatrix of $P$. This property allows to reduce the exponentiation of $P$ to a multiplication of three of its submatrices. We define four non-zero submatrices of $P$ that can be derived directly from the feedback matrix $URM^{|U| \times |I|}$ and the binary item content matrix $ICM^{|I| \times |F|}$: \begin{itemize} \item $P_{ui}$ probability to reach an item node from a user node \item $P_{iu}$: probability to reach a user node from an item node \item $P_{if}$: probability to reach a feature node from an item node \item $P_{fi}$: probability to reach an item node from a feature node \end{itemize} The estimated user-item probabilities used for recommendations, that we will call $URM'$, can be obtained with two different multiplications of these submatrices, depending on the nature of the path: \begin{itemize} \item \textit{Collaborative}: $ URM' = P_{ui} \odot P_{iu} \odot P_{ui} $ \item \textit{Content-based}: $ URM' = P_{ui} \odot P_{if} \odot P_{fi} $ \end{itemize} \section{Feature weighting model} We can introduce feature weights $w_f, f \in F$ over edges that connect items to features, obtaining a variant of $P_{if}$ that we will call $P'_{if}$. This way we can influence the probability to reach feature nodes and, consequently, other item nodes in the last steps of content-based paths. Note that weights have to be strictly positive, because they directly become probabilities. As we stated in previous sections, we want to exploit collaborative information to estimate feature weights, so, in order to do that, we want to obtain as similar results as possible between the collaborative path and the weighted content-based one. In other words we want that: \[ P_{ui} \odot P_{iu} \odot P_{ui} = P_{ui} \odot P'_{if} \odot P_{fi} \] \[ P_{iu} \odot P_{ui} = P'_{if} \odot P_{fi} \] Now we can define a regression problem over feature weights to solve the equation, minimizing the residual sum of squares with Stochastic Gradient Descent. Given two items $j,k \in I$, we can formalize the problem as: \[ \argmin_{w} \sum_{j \in I} \sum_{k \in I} ((P'_{if} \odot P_{fi})[j,k] - (P_{iu} \odot P_{ui})[j,k])^2 \] \section{Target matrix} We can state that our model is the solution to a regression problem where the target is a $|I| \times |I|$ probability matrix obtained with 3-step random walks following the collaborative path. We will refer to this solution as the hybrid path. However, we could use as target any probability matrix that contains collaborative information. In particular, we will see the results obtained using the $|I| \times |I|$ probability matrix of the $RP^3_\beta$\cite{paudel2017} approach, calculated adapting the popularity-based re-ranking procedure. We will refer to this alternative as the \textit{re-ranked} hybrid path. \section{Datasets} We tested our model on the well known Movielens 20M dataset, using genres and lemmatized 1 and 2-grams of user based tags as features, and on The Movies Dataset, publicly available on Kaggle\footnote{\url{https://www.kaggle.com/rounakbanik/the-movies-dataset}}, that adds to the Full Movielens dataset the editorial items metadata available on TMDb. To remove some noise, we applied some filters on both the datasets: we removed items and users with too few interactions, items with too few or too many features, and too rare features. We split each dataset for train and test, in order to keep a test set that could reproduce a cold start scenario. So we kept the 20\% of the items, chosen randomly, and all their ratings for the test set, while we used the remaining 80\% for the train phase. Then we split the training set in two more sets with the same 80-20 proportions, respectively for the training and the validation of the model. \section{Evaluation} For the evaluation we used three common metrics of Recommender Systems literature, that can highlight the accuracy of the model in prediction and ranking: we used the \textit{@5} variants of Recall, Mean Average Precision and Normalized Discounted Cumulative Gain. We compared the results obtained by different approaches: \begin{itemize} \item CBF: Content-based KNN algorithm with cosine similarity \item CBF-IDF: Content-based KNN algorithm with cosine similarity, using IDF to assign feature weights \item $CP^3$: 3-steps random walks following content-based path \item $HP^3$: 3-steps random walks following hybrid path \item $HP^3_R$: 3-steps random walks following hybrid re-ranked path \end{itemize} \section{Results} \begin{table} \centering \begin{tabular}{ | l | l | l | l | } \hline \thead{Algorithm} & \thead{Recall} & \thead{MAP} & \thead{NDCG} \\ \hline CBF & 0.10135 & 0.22026 & 0.13957\\ \hline CBF-IDF & 0.10147 & 0.21813 & 0.13941 \\ \hline \hline $CP^3$ & 0.08853 & 0.20617 & 0.12359 \\ \hline $HP^3$ & 0.09561 & 0.21323 & 0.13247 \\ \hline $HP^3_R$ & \textbf{0.10919} & \textbf{0.22826} & \textbf{0.14782} \\ \hline \end{tabular} \caption{Performance @5 of different algorithms on test set of Movielens 20M dataset, the baselines are on top. } \label{tab:test5_movielens} \begin{tabular}{ | l | l | l | l | } \hline \thead{Algorithm} & \thead{Recall} & \thead{MAP} & \thead{NDCG} \\ \hline CBF & 0.04850 & 0.08727 & 0.06594 \\ \hline CBF-IDF & 0.05033 & 0.08988 & 0.06720 \\ \hline \hline $CP^3$ & 0.05482 & 0.09987 & 0.07298 \\ \hline $HP^3$ & \textbf{0.06810} & \textbf{0.12176} & \textbf{0.09118} \\ \hline $HP^3_R$ & 0.06776 & 0.11934 & 0.09017 \\ \hline \end{tabular} \caption{Performance @5 of different algorithms on test set of The Movies Dataset, the baselines are on top.} \label{tab:test5_themovies} \vspace{-8mm} \end{table} Analyzing results summarized in Tables \ref{tab:test5_movielens} and \ref{tab:test5_themovies}, we can see that both the hybrid paths outperform the purely content-based one, which means that the collaborative information exploited is useful and increases performance. We can also notice that the target matrix influences the quality of the final model. In particular, the re-ranked path provides more reliable results, and its performance is higher than both Content-based KNN approaches on both datasets. The non re-ranked path, instead, is not able to reach CBF scores on Movielens 20M, but obtains the best results on The Movies Dataset. In conclusion, we can state that the model was able to outperform both non-weighted and IDF feature weighting approaches, showing the importance of collaborative information and proving to be a potentially good solution for cold-start scenarios. \section{Conclusion} We proposed a new approach to face the item cold-start problem of Recommender Systems. We have shown that it is possible to model a hybrid graph-based recommender exploiting collaborative information to estimate feature weights and improve quality of content-based recommendations. Future directions include validating this results on more datasets and baselines, as well as learning from other collaborative probability matrices.
\section*{TODO} \section{Introduction} By Fary's theorem \cite{fary,stein1951,wagner_bemerkungen}, every plane graph has a straight-line drawing. We are interested in straight-line drawings with the additional property that the face areas correspond to prescribed values. Particularly, we study \emph{area-universal} graphs for which all prescribed face areas can be realized by a straight-line drawing. Usually, in a \emph{planar} drawing, no two edges intersect except in common vertices. It is worthwhile to be slightly more generous and allow \emph{crossing-free} drawings, i.e., drawings that can be obtained as the limit of a sequence of planar straight-line drawings. Note that a crossing-free drawing of a triangulation is not planar (\emph{degenerate}) if and only if the area of at least one face vanishes. Moreover, we consider two crossing-free drawings of a plane graph as \emph{equivalent} if the cyclic order of the incident edges at each vertex and the outer face coincide. For a plane graph $G$, we denote the set of faces by $F$, and the set of inner faces by $F'$. An \emph{area assignment} is a function $\A\colon F'\to \mathbb \R_{\geq0}$. We say $G$ is \emph{area-universal} if for every area assignment $\A$ there exists an equivalent crossing-free drawing where every inner face $f\in F'$ has area $\A(f)$. We call such a drawing \emph{$\A$-realizing} and the area assignment $\A$ \emph{realizable}. \paragraph{Related Work.} Biedl and Ruiz Vel{\'{a}}zquez \cite{biedl} showed that planar partial 3-trees, also known as subgraphs of \emph{stacked triangulations} or \emph{Apollonian networks}, are area-universal. In fact, every subgraph of a plane area-universal graph is area-universal. Ringel \cite{ringel} gave two examples of graphs that have drawings where all face areas are of equal size, namely the octahedron graph and the icosahedron graph. Thomassen \cite{thomassen} proved that plane 3-regular graphs are area-universal. Moreover, Ringel \cite{ringel} showed that the octahedron graph is not area-universal. Kleist \cite{kleist1Journal} generalized this result by introducing a simple counting argument which shows that no Eulerian triangulation, different from $K_3$, is area-universal. Moreover, it is shown in \cite{kleist1Journal} that every 1-subdivision of a plane graphs is area-universal; that is, every area assignment of a plane graph has a realizing polyline drawing where each edge has at most one bend. Evans et al.\ \cite{kleistQuad,kleistPhD} present classes of area-universal plane quadrangulations. In particular, they verify the conjecture that plane bipartite graphs are area-universal for quadrangulations with up to 13 vertices. Particular graphs have also been studied: It is known that the square grid \cite{tableCartograms} and the unique triangulation on seven vertices \cite{BachelorThesis} are area-universal. Moreover, non-area-universal triangulations on up to ten vertices have been investigated in~\cite{Henning}. The computational complexity of the decision problem of area-universality for a given graph was studied by Dobbins et al.\ \cite{kleist2}. The authors show that this decision problem belongs to \textsc{Universal Existential Theory of the Reals} $(\FER)$, a natural generalization of the class \textsc{Existential Theory of the Reals} (\ER), and conjecture that this problem is also \FER-complete. They show hardness of several variants, e.g., the analogue problem of volume universality of simplicial complexes in three dimensions. In a broader sense, drawings of planar graphs with prescribed face areas can be understood as {\em cartograms}. Cartograms have been intensely studied for duals of triangulations \cite{cartogramsTs,deBerg07,BR-WADS11,Nagamochi} and in the context of rectangular layouts, dissections of a rectangle into rectangles \cite{Eppstein,felsner,Floorplans}. For a detailed survey of the cartogram literature, we refer to~\cite{NusratKobourovSurvery}. \paragraph{Our contribution.} In this work we present three characterizations of area-uni\-ver\-sal triangulations. We use these characterizations for proving area-universality of certain triangulations. Specifically, we consider triangulations with a vertex order, where (most) vertices have at least three neighbors with smaller index, called \emph{predecessors}. We call such an order a \emph{\pOrder}. For triangulations with a \pOrder, the realizability of an area assignment reduces to finding a real root of a univariate polynomial. If the polynomial is surjective, we can guarantee area-universality. In fact, this is the only known method to prove the area-universality of a triangulation besides the simple argument for plane 3-trees relying on $K_4$. We discover several interesting facts. First, to guarantee area-universality it is enough to investigate one area assignment. Second, if the polynomial is surjective for one plane graph, then it is for every embedding of the underlying planar graph. Consequently, the properties of one area assignment can imply the area-universality of all embeddings of a planar graph. This may indicate that area-universality is a property of planar graphs. We use the method to prove area-universality for several graph families including accordion graphs. To obtain an \emph{\graphClass graph} from the plane octahedron graph, we introduce new vertices of degree 4 by subdividing an edge of the central triangle. \cref{fig:funnyClass2} presents four examples of \graphClass graphs. Surprisingly, the insertion of an even number of vertices yields a non-area-universal graph while the insertion of an odd number of vertices yields an area-universal graph. Accordions with an even number of vertices are Eulerian and thus not area-universal \cite{kleist1Journal}. Consequently, area-universal and non-area-universal graphs may have a very similar structure. (In \cite{kleistPhD}, we use the method to classify small triangulations with \pOrder{}s on up to ten vertices.) \begin{figure}[hbt] \centering \includegraphics[page=1]{Figures} \caption{Examples of accordion graphs. A checkmark indicates area-universality and a cross non-area-universality.} \label{fig:funnyClass2} \end{figure} \paragraph{Organization.} We start by presenting three characterizations of area-universality of triangulations in \cref{sec:prelim}. In \cref{sec:poly}, we turn our attention to triangulations with \pOrder{}s and show how the analysis of one area assignment can be sufficient to prove area-universality of all embeddings of the given triangulation. Then, in \cref{sec:applications}, we apply the developed method to prove area-universality for certain graph families; among them we characterize the area-universality of \graphClass graphs. We end with a discussion and a list of open problems in \cref{sec:end}. \ifarxiv In \cref{app:2,app:3,app:applications} we present omitted proofs of \cref{sec:prelim,sec:poly,sec:applications}. \else For omitted proofs consider the appendices of the full version~\cite{kleist3Arx}. \fi \section{Characterizations of Area-Universal Triangulations}\label{sec:prelim} Throughout this section, let $T$ be a plane triangulation on $n$ vertices. A straight-line drawing of $T$ can be encoded by the $2n$ vertex coordinates, and hence, by a point in the Euclidean space $\R^{2n}$. We call such a vector of coordinates a \emph{vertex placement} and denote the set of all vertex placements encoding crossing-free drawings by $\D(T)$; we also write $\D$ if $T$ is clear from the context. It is easy to see that an $\A$-realizing drawing of a triangulation can be transformed by an affine linear map into an $\A$-realizing drawing where the outer face corresponds to any given triangle of correct total area $\Sigma \A:=\sum_{f\in F'}\A(f)$, where $F'$ denotes the set of inner faces as before. \begin{lemma}\emph{\cite[Obs. 2]{kleist1Journal}}\label{lem:outerFace} A plane triangulation $T$ with a realizable area assignment~$\A$, has an $\A$-realizing drawing within every given outer face of area $\Sigma\A$. \end{lemma} Likewise, affine linear maps can be used to scale realizing drawings by any factor. For any positive real number $\alpha\in\mathbb R$ and area assignment $\A$, let $\alpha \A$ denote the \emph{scaled area assignment} of $\A$ where $\alpha\A(f):=\alpha\cdot \A(f)$ for all $f\in F'$. \begin{lemma}\label{lem:scaling} Let $\A$ be an area assignment of a plane graph and $\alpha>0$. The scaled area assignment $\alpha\A$ is realizable if and only if $\A$ is realizable. \end{lemma} For a plane graph and $c>0$, let $\As^c$ denote the set of area assignments with a total area of $c$. \cref{lem:scaling} directly implies the following property. \begin{lemma}\label{lem:fixedTotal} Let $c>0$. A plane graph is area universal if all area assignments in~$\As^c$ are realizable. \end{lemma} \subsection{Closedness of Realizable Area Assignments} In \cite[Lemma 4]{kleist1Journal}, it is shown for triangulations that $\A\in \As^c$ is realizable if and only if in every open neighborhood of $\A$ in $\As^c$ there exists a realizable area assignment. For our purposes, we need a stronger version. Let $\As^{\leq c}$ denote the set of area assignments of~$T$ with a total area of at most $c$. For a fixed face $f$ of~$T$, $\As^{\leq c}|_{f\to a}$ denotes the subset of $\As^{\leq c}$ where $f$ is assigned to a fixed $a>0$. \begin{restatable}{proposition}{fillingStronger}\label{cor:fillinSTRONGER} Let $T$ be a plane triangulation and $c>0$. Then $\A\in\As^c$ is realizable if and only if for some face $f$ with $\A(f)>0$ every open neighborhood of $\A$ in $\As^{\leq 2c}|_{f\to \A(f)}$ contains a realizable area assignment. \end{restatable} Intuitively, \cref{cor:fillinSTRONGER} enables us not to worry about area assignments with bad but unlikely properties. In particular, area-universality is guaranteed by the realizability of a dense subset of $\As^c$. Moreover, this stronger version allows to certify the realizability of an area assignment by realizable area assignments with slightly different total areas. The proof of \cref{cor:fillinSTRONGER} goes along the same lines as in \cite[Lemma 4]{kleist1Journal}; it is based on the fact that the set of drawings of $T$ with a fixed face $f$ and a total area of at most $2c$ is compact. \subsection{Characterization by 4-Connected Components} For a plane triangulation $T$, a \emph{$4$-connected component} is a maximal $4$-connected subgraph of $T$. Moreover, we call a triangle $t$ of~$T$ \emph{separating} if at least one vertex of~$T$ lies inside $t$ and at least one vertex lies outside $t$; in other words, $t$ is not a face of $T$. \begin{restatable}{proposition}{connected}\label{lem:4connnected} A plane triangulation $T$ is area-universal if and only if every 4-connected component of $T$ is area-universal. \end{restatable} \begin{proof}[Sketch] The proof is based on the fact that a plane graph $G$ with a separating triangle $t$ is area-universal if and only if $G_\textsc{e}$, the induced graph by~$t$ and its exterior, and $G_\textsc{i}$, the induced graph by $t$ and its interior, are area-universal. In particular, \cref{lem:outerFace} allows us to combine realizing drawings of $G_\textsc{e}$ and $G_\textsc{i}$ to a drawing of $G$. \end{proof} \begin{rmk} Note that a plane 3-tree has no 4-connected component. (Recall that $K_4$ is 3-connected and a graph on $n>4$ vertices is 4-connected if and only if it has no separating triangle.) This is another way to see their area-universality. \end{rmk} \subsection{Characterization of Area-Universality by Polynomial Equations} \subsection{Characterization by Polynomial Equation System} Dobbins et al.\ \cite[Proposition 1]{kleist2} show a close connection of area-universality and equation systems: For every plane graph $G$ with area assignment $\A$ there exists a polynomial equation system $\mathcal E$ such that $\A$ is realizable if and only if $\mathcal E$ has a real solution. Here we strengthen the statement for triangulations, namely it suffices to guarantee the face areas; these imply all further properties such as planarity and the equivalent embedding. To do so, we introduce some notation. A plane graph $G$ induces an orientation of the vertices of each face. For a face $f$ given by the vertices $v_1 , \dots , v_k$, we say $f$ is \emph{counter clockwise (ccw)} if the vertices $v_1 , \dots , v_k$ appear in ccw direction on a walk on the boundary of $f$; otherwise $f$ is \emph{clockwise (cw)}. Moreover, the function $\area(f,D)$ measures the area of a face $f$ in a drawing $D$. For a ccw triangle $t$ with vertices $v_1, v_2, v_3$, we denote the coordinates of $v_i$ by $(x_i, y_i)$. Its area in~$D$ is given by the determinant \begin{linenomath*} \begin{equation}\label{eq:det} \Det(v_1,v_2,v_3):=\det\big(c(v_1),c(v_2),c(v_3)\big)=2\cdot \area (t,D), \end{equation} \end{linenomath*} where $c(v_i):=(x_i,y_i,1)$. Since the (complement of the) outer face $f_o$ has area $\Sigma \A$ in an $\A$-realizing drawing, we define $\A(f_o):=\Sigma \A$. For a set of faces $\tilde F\subset F$, we define the \emph{area equation system of $\tilde F$} as \begin{linenomath*} \begin{equation* \AreaEqA {\tilde F}:=\{\Det(v_i,v_j,v_k)=\A(f)\mid f\in \tilde F, f=:{(v_i,v_j,v_k)} \text{ ccw}\}. \end{equation*} \end{linenomath*} For convenience, we omit the factor of $2$ in each \emph{area equation}. Therefore, without mentioning it any further, we usually certify the realizability of $\A$ by a $\nicefrac{1}{2}\A$-real\-izing drawing. That is, if we say a triangle has area $a$, it may have area $\nicefrac{1}{2}a$. Recall that, by \cref{lem:scaling}, consistent scaling has no further implications. \begin{restatable}{proposition}{propThree}\label{thm:areaEqs} Let $T$ be a triangulation, $\A$ an area assignment, and $f$ a face of $T$. Then $\A$ is realizable if and only if $\AreaEqA{F\setminus \{f\}}$ has a real solution. \end{restatable} The key idea is that a (scaled) vertex placement of an $\A$-realizing drawing is a real solution of $\AreaEqA{F\setminus \{f\}}$ and vice versa. The main task is to guarantee crossing-freeness of the induced drawing; it follows from the following neat fact. \begin{restatable}{lemma}{ccPlanar}\label{lem:ccPlanar} Let $D$ be a vertex placement of a triangulation $T$ where the orientation of each inner face in $D$ coincides with the orientation in $T$. Then $D$ represents a crossing-free straight-line drawing of $T$. \end{restatable} A proof of \cref{lem:ccPlanar} can be found in \cite[in the end of the proof of Lemma 4.2]{windrose}. An alternative proof relies on the properties of the determinant, in particular, on the fact that for any vertex placement $D$ the area of the triangle formed by its outer vertices evaluates to \begin{equation}\label{eq:outerface} \area(f_o,D) = \sum_{f\in F'}\area(f,D). \end{equation} \cref{eq:outerface} shows that for every face $f\in F'$, the equation systems $\AreaEqA {F'}$ and $\AreaEqA {F\setminus \{f\}}$ are equivalent. This fact is also used for \cref{thm:areaEqs}. \begin{remark} In fact, \cref{lem:ccPlanar} and \cref{thm:areaEqs} generalize to \emph{inner triangulations}, i.e., $2$-connected plane graphs where every inner face is a triangle. \end{remark} \section{Area-Universality of Triangulations with \pOrder{}s}\label{sec:poly} We consider planar triangulations with the following property: An order of the vertices $(v_1,v_2,\dots,v_n)$, together with a set of \emph{predecessors} $\pred(v_i)\subset N(v_i)$ for each vertex $v_i$, is a \emph{\pOrder} if the following conditions are satisfied:\smallskip \begin{compactitem}[\ --] \item $\pred(v_i)\subseteq \{v_1,v_2,\dots, v_{i-1}\}$, i.e., the predecessors of $v_i$ have an index $<i$, \item $\pred(v_1)=\emptyset$, $\pred(v_2)=\{v_1\}$, $\pred(v_3)=\pred(v_4)=\{v_1,v_2\}$, and \item for all $i>4$: $|\pred(v_i)|=3$, i.e., $v_i$ has exactly three predecessors. \end{compactitem} \smallskip Note that $\pred(v_i)$ specifies a subset of preceding neighbors. Moreover, a \pOrder is defined for a planar graph independent of a drawing. We usually denote a \pOrder by $\Po$ and state the order of the vertices; the predecessors are then implicitly given by $\pred(v_i)$. \cref{fig:3orient} illustrates a \pOrder. \begin{figure}[hbt] \centering \includegraphics[page=2]{Figures} \caption{A plane 4-connected triangulation with a \pOrder \Po. In an \arVP constructed with \Po, all face areas are realized except for the two faces incident to the unoriented (dashed) edge $e_\Po$ of $\Or_\Po$ (\cref{lem:almostReal}).} \label{fig:3orient} \end{figure} We pursue the following one-degree-of-freedom mechanism to construct realizing drawings for a plane triangulation $T$ with a \pOrder $(v_1,v_2,\dots,v_n)$ and an area assignment~\A: \begin{compactitem} \item Place the vertices $v_1$, $v_2$, $v_3$ at positions realizing the area equation of the face $v_1v_2v_3$. Without loss of generality, we set $v_1=(0,0)$ and $v_2=(1,0)$. \item Insert $v_4$ such that the area equation of face $v_1v_2v_4$ is realized; this is fulfilled if $y_4$ equals $\A(v_1v_2v_4)$ while $x_4\in \mathbb{R}$ is arbitrary. The value $x_4$ is our variable. \item Place each remaining vertex $v_i$ with respect to its predecessors $\pred(v_i)$ such that the area equations of the two incident face areas are respected; the coordinates of $v_i$ are \emph{rational} functions of $x_4$. \item Finally, all area equations are realized except for two special faces $f_a$ and~$f_b$. Moreover, the face area of $f_a$ is a \emph{rational} function $\f$ of $x_4$. \item If $\f$ is \emph{almost surjective}, then there is a vertex placement~$D$ respecting all face areas and orientations, i.e., $D$ is a real solution of $\AreaEqA{F}$. \item By \cref{thm:areaEqs}, $D$ guarantees the realizability of $\A$. \item If this holds for \emph{enough} area assignments, then $T$ is area-universal. \end{compactitem} \subsection{Properties of \pOrder{}s} A \pOrder \Po of a plane triangulation $T$ induces an orientation $\mathcal O_\Po$ of the edges: For $w\in\pred(v_i)$, we orient the edge from $v_i$ to $w$, see also \cref{fig:3orient}. By \cref{lem:4connnected}, we may restrict our attention to 4-connected triangulations. We note that 4-connectedness is not essential for our method but yields a cleaner picture. \begin{restatable}{lemma}{obsEdge}\label{obs:edge} Let $T$ be a planar 4-connected triangulation with a \pOrder \Po. Then $\Or_\Po$ is acyclic, $\Or_\Po$ has a unique unoriented edge $e_\Po$, and $e_\Po$ is incident to $v_n$. \end{restatable} It follows that the \pOrder encodes all but one edge which is easy to recover. Therefore, the \pOrder of a planar triangulation $T$ encodes $T$. In fact, $T$ has a \pOrder if and only if there exists an edge $e$ such that $T-e$ is 3-degenerate. \paragraph{Convention.} Recall that a drawing induces an orientation of each face. We follow the convention of stating the vertices of inner faces ccw and of the outer face in cw direction. This convention enables us to switch between different plane graphs of the same planar graph without changing the order of the vertices. To account for our convention, we redefine $\A(f_o):=-\Sigma \A$ for the outer face~$f_o$. Then, for different embeddings, only the right sides of the \textsc{aeq}s change. \smallskip The next properties can be proved by induction and are shown in \cref{fig:predecessors}. \begin{restatable}{lemma}{construction}\label{lem:PolyMethodInsertion} Let $T$ be a plane 4-connected triangulation with a \pOrder \Po specified by $(v_1,v_2,\dots,v_n)$ and let $T_i$ denote the subgraph of $T$ induced by $\{v_1,v_2,\dots,v_i\}$. For $i\geq 4$, \begin{compactitem} \item $T_i$ has one 4-face and otherwise only triangles, \item $T_{i+1}$ can be constructed from $T_{i}$ by inserting $v_{i+1}$ in the 4-face of $T_{i}$, and \item the three predecessors of $v_i$ can be named $(p_\textsc{f},p_\textsc{m},p_\textsc{l})$ such that $p_\textsc{f}p_\textsc{m}v_i$ and $p_\textsc{m}p_\textsc{l}v_i$ are (ccw inner and cw outer) faces of $T_i$. \end{compactitem} \end{restatable} \begin{figure}[bh] \begin{minipage}[b]{.68\textwidth} \centering \includegraphics[page=3]{Figures} \caption{ Illustration of \cref{lem:PolyMethodInsertion}: (a) $T_4$, (b) $v_i$ is inserted in an inner 4-face, (c) $v_i$ is inserted in outer 4-face. } \label{fig:predecessors} \end{minipage} \hfill \begin{minipage}[b]{.225\textwidth} \centering \includegraphics[page=4]{Figures} \caption{Illustration of \cref{obs:uniquePos}.} \label{fig:uniquePos} \end{minipage} \end{figure} \begin{remark} For every (non-equivalent) plane graph $T'$ of $T$, the three predecessors $(p_\textsc{f},p_\textsc{m},p_\textsc{l})$ of $v_i$ in $T'$ and $T$ coincide. \end{remark} \begin{remark}\label{rmk:numberTriang} \cref{lem:PolyMethodInsertion} can be used to show that the number of 4-connected planar triangulations on $n$ vertices with a \pOrder is $ \Omega( \nicefrac{2^{n}}{n})$. \end{remark} \newpage \subsection{Constructing Almost Realizing Vertex Placements} Let $T$ be a plane triangulation with an area assignment $\mathcal A$. We call a vertex placement $D$ of $T$ \emph{almost $\A$-realizing} if there exist two faces $f_a$ and $f_b$ such that~$D$ is a real solution of the equation system $\AreaEqA{\tilde F}$ with $\tilde F:=F\setminus\{f_a,f_b\}$. In particular, we insist that the orientation and area of each face, except for $f_a$ and $f_b$ be correct, i.e., the area equations are fulfilled. Note that an \arVP does not necessarily correspond to a crossing-free drawing. \begin{obs}\label{cor:THEone} An almost $\A$-realizing vertex placement $D$ fulfilling the area equations of all faces except for $f_a$ and $f_b$, certifies the realizability of $\A$ if additionally the area equation of $f_a$ is satisfied. \end{obs} We construct \arVP{}s with the following lemma. \begin{lemma}\label{obs:uniquePos} Let $a,b\geq 0$ and let $q_\textsc{f},q_\textsc{m},q_\textsc{l}$ be three vertices with a non-collinear placement in the plane. Then there exists a unique placement for vertex $v$ such the ccw triangles $q_\textsc{f}q_\textsc{m}v$ and $q_\textsc{m}q_\textsc{l}v$ fulfill the area equations for $a$ and $b$, respectively. \end{lemma} \begin{proof} Consider \cref{fig:uniquePos}. To realize the areas, $v$ must be placed on a specific line $\ell_a$ and $\ell_b$, respectively. Note that $\ell_a$ is parallel to the segment $q_\textsc{f},q_\textsc{m}$ and $\ell_b$ is parallel to the segment $q_\textsc{m},q_\textsc{l}$. Consequently, $\ell_a$ and $\ell_b$ are not parallel and their intersection point yields the unique position for vertex $v$. The coordinates of $v$ are specified by the two equations $\Det(q_\textsc{f},q_\textsc{m},v)\stackrel{!}{=}a$ and $\Det(q_\textsc{m},q_\textsc{l},v)\stackrel{!}{=}b$. \end{proof} Note that if $\ell_a$ and $\ell_b$ are parallel and do not coincide, then there is no position for $v$ realizing the area equations of the two triangles. Based on \cref{obs:uniquePos}, we obtain our key lemma. \begin{restatable}{lemma}{almostReal}\label{lem:almostReal} Let $T$ be a plane 4-connected triangulation with a \pOrder \Po specified by $(v_1,v_2,\dots,v_n)$. Let $f_a,f_b$ be the faces incident to $e_\Po$ and $f_0:=v_1v_2v_3$. Then there exists a constant $c>0$ such that for a dense subset $\As_D$ of $\As^c$, every~$\A \in \As_D$ has a finite set $\B(\A)\subset\R$, rational functions $x_i(\cdot,\A)$, $y_i(\cdot,\A)$, $\mathfrak f(\cdot,\A)$ and a triangle $\triangle$, such that for all $x_4\in\R\setminus\B(\A)$, there exists a vertex placement $D(x_4)$ with the following properties:\smallskip \begin{compactenum}[(i)] \item $f_0$ coincides with the triangle $\triangle$, \item $D(x_4)$ is almost realizing, i.e., a real solution of $\AreaEqA{F\setminus\{f_a,f_b\}}$, \item every vertex $v_i$ is placed at the point $\big(x_i(x_4,\A),y_i(x_4,\A)\big)$, and \item the area of face $f_a$ in $D(x_4)$ is given by $\f(x_4,\A)$. \end{compactenum} \end{restatable} The idea of the proof is to use \cref{obs:uniquePos} in order to construct $D(x_4)$ inductively. Therefore, given a vertex placement $v_1, \dots, v_{i-1}$, we have to ensure that the vertices of $\pred(v_i)$ are not collinear. To do so, we consider algebraically independent area assignments. We say an area assignment $\A$ of $T$ is \emph{algebraically independent} if the set $\{\A(f)| f\in F'\}$ is algebraically independent over $\Q$. In fact, the subset of algebraically independent area assignments $\As_I$ of $\As^c$ is dense when $c$ is transcendental. We call the function $\f$, constructed in the proof of \cref{lem:almostReal}, the \emph{\lastfaceFun} of $T$ and interpret it as a function in $x_4$ whose coefficients depend on~$\A$. \subsection{Almost Surjectivity and Area-Universality} In the following, we show that almost surjectivity of the \lastfaceFun implies area-universality. Let $A$ and $B$ be sets. A function $f\colon A\to B$ is \emph{almost surjective} if $f$ attains all but finitely many values of $B$, i.e., $B\setminus f(A)$ is finite. \begin{theorem}\label{thm:area-univ} Let $T$ be a 4-connected plane triangulation with a \pOrder \Po and let $\As_D, \As^c,\f$ be obtained by \cref{lem:almostReal}. If the \lastfaceFun $\f$ is almost surjective for all area assignments in $\As_D$, then $T$ is area-universal. \end{theorem} \begin{proof} By \cref{lem:fixedTotal}, it suffices to show that every $\A\in\As_D$ is realizable. Let $f_0$ be the triangle formed by $v_1,v_2,v_3$ and $\As^+:=\As^{\leq 2c}|_{f_0\to \A(f_0)}$. By \cref{cor:fillinSTRONGER}, $\A$ is realizable if every open neighborhood of $\A$ in $\As^+$ contains a realizable area assignment. Let $f_a$ and $f_b$ denote the faces incident to $e_\Po$ and $a:=\A(f_a)$. \cref{lem:almostReal} guarantees the existence of a finite set $\mathcal B$ such that for all $x_4\in \R\setminus\B$, there exists an almost $\A$-realizing vertex placement $D(x_4)$. Since $\mathcal B$ is finite and $\f$ is almost surjective, for every $\varepsilon$ with $0<\varepsilon<c$, there exists $\tilde x \in \R\setminus \mathcal B$ such that $a\leq\f(\tilde x)\leq a+\varepsilon$, i.e., the area of face $f_a$ in $D(\tilde x)$ is between $a$ and $a+\varepsilon$. (If $f_a$ and $f_b$ are both inner faces, then the face $f_b$ has an area between $b-\varepsilon$ and $b$, where $b:=\A(f_b)$. Otherwise, if $f_a$ or $f_b$ is the outer face, then the total area changes and face $f_b$ has area between $b$ and $b+\varepsilon$.) Consequently, for some $\A'$ in the $\varepsilon$-neighborhood of $\A$ in $\As^+$, $D(\tilde x)$ is a real solution of $\AreaEq{\A'}{F\setminus\{f_b\}}$ and \cref{thm:areaEqs} ensures that $\A'$ is realizable. By \cref{cor:fillinSTRONGER}, $\A$ is realizable. Thus, $T$ is area-universal. \end{proof} To prove area-universality, we use the following sufficient condition for almost surjectivity. We say two real polynomials $p$ and $q$ are \emph{\crr} if they do not have common real roots. For a rational function $f:=\frac{p}{q}$, we define the \emph{max-degree} of $f$ as $\max\{|p|, |q|\}$, where $|p|$ denotes the degree of $p$. Moreover, we say $f$ is \crr if $p$ and $q$ are. The following property follows from the fact that polynomials of odd degree are surjective. \begin{restatable}{lemma}{surjective}\label{lem:surjective} Let $p,q\colon\mathbb R\to\mathbb R$ be polynomials and let $Q$ be the set of the real roots of~$q$. If the polynomials $p$ and $q$ are \crr and have odd max-degree, then the function $f\colon \mathbb R\backslash{Q}\to \mathbb R, \ f(x)=\frac{p(x)}{q(x)}$ is almost surjective. \end{restatable} For the final result, we make use of several convenient properties of algebraically independent area assignments. For $\A$, let $\f_\A$ denote the last face function and $d_1(\f_\A)$ and $d_2(\f_\A)$ the degree of the numerator and denominator polynomial of $\f_\A$ in $x_4$, respectively. Since $\f_\A$ is a function in $x_4$ whose coefficients depend on $\A$, algebraic independence directly yields the following property. \begin{restatable}{clm}{sameDegree}\label{obs:sameDegreeM} For two algebraically independent area assignments $\A,\A'\in \As_I$ of a 4-connected triangulation with a $\pOrder$ $\Po$, the degrees of the last face functions $\f_\A$ and $\f_{\A'}$ with respect to $\Po$ coincide, i.e., $d_i(\f_\A)=d_i(\f_{\A'})$ for $i\in[2]$. \end{restatable} In fact, the degrees do not only coincide for all algebraically independent area assignments, but also for different embeddings of the plane graph. For a plane triangulation $T$, let $T^*$ denote the corresponding planar graph and~$[T]$ the set (of equivalence classes) of all plane graphs of $T^*$. \begin{restatable}{clm}{sameDeg}\label{prop:sameDegM} Let $T$ be a plane $4$-connected triangulation with a \pOrder $\Po$. Then for every plane graph $T'\in[T]$, and algebraically independent area assignments $\A$ of $T$ and $\A'$ of $T'$, the last face functions $\f_\A$ and $\f'_{\A'}$ with respect to $\Po$ have the same degrees, i.e., $d_i(\f_\A)=d_i(\f'_{\A'})$ for $i\in[2]$. \end{restatable} This implies our final result: \begin{restatable}{corollary}{everyEmbedding}\label{thm:everyEmbedding} Let $T$ be a plane triangulation with a \pOrder $\Po$. If the \lastfaceFun~$\f$ of $T$ is \crr and has odd max-degree for one algebraically independent area assignment, then every plane graph in $[T]$ is area-universal. \end{restatable} \subsection{Proofs of the Degree-Lemmas}\label{sec:appendixUsefulLemmas} In this section, we present the pending proofs of the previous section. \nofactors* \begin{proof} The proof consists of two directions. For both recall the formulas for $\N^\circ_i$ and $\D_i$ given in \cref{eq:NomDen,eq:NomDen2}. Suppose that $\N^\circ_i$ and $\D_i$ have a common zero $z$. We think of $z$ as an algebraic function of ($a,a_5,b_5,\dots,a_i,b_i$). By \cref{obs:wiggle}, the variables $a_i$ and $b_i$ do not occur in $D_i$. Consequently, $z$ does not depend on $a_i$ and $b_i$, and is thus algebraically independent of $a_i$ and $b_i$. Since $\D_i=\D_\textsc{m} E_i$, by \cref{eq:NomDen2}, $z$ is a zero of at least one of $\D_\textsc{m}$ or $E_i$. We distinguish three cases. \smallskip Case 1: If $z$ is a zero of both, $\D_\textsc{m}$ and $E_i$, then \cref{eq:NomDen} simplifies to \[\N^\circ_i[z]=-(a_i+b_i)(\N^\circ_\textsc{m}\D_\textsc{f}\D_\textsc{l}F_i)[z]=0.\] By the assumption of being \crr, $z$ is neither a zero of $\N^\circ_\textsc{m}$ nor $F_i$. Hence, $z$ is a zero of $\D_\textsc{f}\D_\textsc{l}$. In conclusion, $z$ is a zero of $E_i$, $\D_\textsc{m}$ as well as $\D_\textsc{f}$ or $\D_\textsc{l}$ (or both). In other words, condition (i) is fulfilled.\smallskip Case 2: If $z$ is a zero of $\D_\textsc{m}$ and not of $E_i$, then \cref{eq:NomDen} reads as \[\N^\circ_i[z]=(\N^\circ_\textsc{m}(E_i-(a_i+b_i))\D_\textsc{f}\D_\textsc{l}F_i)[z]=0.\] Since $z,a_{i},b_{i}$ are algebraically independent, $\N^\circ_i[z]$ vanishes on each summand. However, $z$ is not a zero of $E_i$ by assumption of Case 2 and $z$ is not a zero of $\N^\circ_\textsc{m}$ since $\D_\textsc{m}$ and $\N^\circ_\textsc{m}$ are \crr. Thus, we arrive at a contradiction and this case does not occur.\smallskip Case 3: If $z$ is a zero of $E_i$ and not of $\D_\textsc{m}$, $z$ is not a zero of $F_i$; since $E_i$ and $F_i$ are \crr. Consequently, \cref{eq:NomDen} implies $(\D_\textsc{m}(a_i\N^\circ_\textsc{l}\D_\textsc{f}+b_i \N^\circ_\textsc{f}\D_\textsc{l}) - (a_i+b_i)\N^\circ_\textsc{m}\D_\textsc{f}\D_\textsc{l})[z]=0$. Reordering for $a_i$ and $b_i$ results in \[\big(a_i\D_\textsc{f}(\D_\textsc{m}\N^\circ_\textsc{l}-\N^\circ_\textsc{m}\D_\textsc{l}) + b_i\D_\textsc{l} (\D_\textsc{m} \N^\circ_\textsc{f} - \N^\circ_\textsc{m}\D_\textsc{f})\big)[z]=0.\] As argued above, $z$, $a_{i}$, and $b_{i}$ are algebraically independent, and thus $z$ is a zero of both summands. If $z$ is a zero of $\D_\textsc{f}$, then it is also a zero of $\D_\textsc{l}\D_\textsc{m} \N^\circ_\textsc{f}$. However, by assumption, it is not a zero of $\D_\textsc{m} \N^\circ_\textsc{f}$, and thus it is a zero of $\D_\textsc{l}$. Likewise, if $z$ is a zero of $\D_\textsc{l}$ then it follows that $z$ is also a zero of $\D_\textsc{f}$. Hence, (i) is satisfied. Thus, in the following we may assume that $z$ is not a zero of $\D_\textsc{f}\D_\textsc{l}$, but of both polynomials $(\N^\circ_\textsc{l}\D_\textsc{m}-\N^\circ_\textsc{m}\D_\textsc{l})$ and $( \N^\circ_\textsc{f}\D_\textsc{m} - \N^\circ_\textsc{m}\D_\textsc{f})$. This is condition (ii). \smallskip It remains to show the reverse direction. Since $z$ is a zero of $E_i$, it follows that $z$ is a zero of $\D_i$. By construction of our cases, $z$ was a zero of $\N^\circ_i$. Alternatively, it is easy to check that $z$ is also a zero of $\N^\circ_i$ as given in \cref{eq:NomDen} in all cases. Consequently, $z$ is a zero of both $\N^\circ_i$ and $\D_i$. \end{proof} \sameAngle* \begin{proof} Note that the irreducibility of $E_{i+1}$ and $F_{i+1}$ directly implies the irreducibility of $E_{i+2}$ and $F_{i+2}$: Since $F_{i+2}=F_{i+1}$, every zero of $F_{i+2}$ is a zero of $F_{i+1}$. Therefore, $z$ is a zero of $E_{i+2}$ and $F_{i+2}$ if and only if $z$ is a zero of $E_{i+1}$ and $F_{i+1}$. It remains to show that \[E_{i+2}\D_{i+1}=F_{i+2}\tilde \D_{i+2}.\] To do so, we will show that $\tilde \D_{i+1}$ is a factor of $\tilde \D_{i+2}$. By \cref{eq:tilde}, we obtain the following formula for $\tilde \D_{i+2}$: \begin{linenomath} \begin{align*} \tilde \D_{i+2 =& \Nx_{i+1}(\Ny_\textsc{l}\D_\textsc{f} -\Ny_\textsc{f}\D_\textsc{l})+ \Ny_{i+1}(\Nx_\textsc{f}\D_\textsc{l}-\Nx_\textsc{l}\D_\textsc{f}) +\D_{i+1}\textcolor{teal}{(\Nx_\textsc{l}\Ny_\textsc{f}-\Nx_\textsc{f}\Ny_\textsc{l})} \end{align*} \end{linenomath} The last summand is clearly divisible by $\D_{i+1}$ and, hence by $\tilde \D_{i+1}$. Therefore we focus on the first two summands, in which we replace $\N^\circ_{i+1}$ with the help of \cref{eq:NomDen} by \begin{linenomath} \begin{align*} \N^\circ_{i+1}&=F_{i+1}\D_i(a_{i+1}\N^\circ_\textsc{l}\D_\textsc{f}+b_{i+1}\N^\circ_\textsc{f}\D_\textsc{l}) + \N^\circ_iE_{i+2}. \end{align*} \end{linenomath} Replacing $\N^\circ_{i+1}$ by the above expressions and using \cref{eq:tilde} for $\tilde \D_{i+1}$, we obtain: \begin{linenomath*}\begin{align*} \Nx_{i+1}&(\Ny_\textsc{l}\D_\textsc{f} -\Ny_\textsc{f}\D_\textsc{l})+ \Ny_{i+1}(\Nx_\textsc{f}\D_\textsc{l}-\Nx_\textsc{l}\D_\textsc{f}) \\ =&(F_{i+1}\D_i[\textcolor{violet}{a_{i+1}\Nx_\textsc{l}\D_\textsc{f}}+\textcolor{magenta}{b_{i+1} \Nx_\textsc{f}\D_\textsc{l}}] +\Nx_iE_{i+2})(\Ny_\textsc{l}\D_\textsc{f} -\Ny_\textsc{f}\D_\textsc{l}) \\ +& (F_{i+1}\D_i[\textcolor{violet}{a_{i+1}\Ny_\textsc{l}\D_\textsc{f}}+\textcolor{magenta}{b_{i+1} \Ny_\textsc{f}\D_\textsc{l}}]+\Ny_iE_{i+2})(\Nx_\textsc{f}\D_\textsc{l}-\Nx_\textsc{l}\D_\textsc{f}) \\ =&{\D_\textsc{f}\D_\textsc{l}\D_iF_{i+1}(\Ny_\textsc{l}\Nx_\textsc{f}-\Ny_\textsc{f}\Nx_\textsc{l})(\textcolor{violet}{a_{i+1}}+\textcolor{magenta}{b_{i+1}})}\\& +E_{i+2}(\textcolor{orange}{\Nx_i(\Ny_\textsc{l}\D_\textsc{f} -\Ny_\textsc{f}\D_\textsc{l})+\Ny_i(\Nx_\textsc{f}\D_\textsc{l}-\Nx_\textsc{l}\D_\textsc{f})})\\ =&{\D_\textsc{f}\D_\textsc{l}\D_iF_{i+1}(\Ny_\textsc{l}\Nx_\textsc{f}-\Ny_\textsc{f}\Nx_\textsc{l})(a_{i+1}+b_{i+1})}\\& +\textcolor{teal}{E_{i+2}}(\textcolor{orange}{\tilde \D_{i+1}-\D_{i}(\Nx_\textsc{l}\Ny_\textsc{f}-\Nx_\textsc{f}\Ny_\textsc{l})}) \end{align*} \end{linenomath*} We remove the term $E_{i+2}\tilde \D_{i+1}$ which clearly divisible by $\tilde \D_{i+1}$. In the remainder we factor out $(\Nx_\textsc{f}\Ny_\textsc{l}-\Nx_\textsc{l}\Ny_\textsc{f})\D_i$ and recall the definitions of $E_{i+2}$ and $D_{i+1}$. It remains \begin{linenomath}\begin{align*} &{\D_\textsc{f}\D_\textsc{l}\textcolor{red}{\D_i}F_{i+1}\textcolor{red}{(\Nx_\textsc{f}\Ny_\textsc{l}-\Nx_\textsc{l}\Ny_\textsc{f})}(a_{i+1}+{b_{i+1}})}+E_{i+2}(\textcolor{red}{-\D_{i}(\Nx_\textsc{l}\Ny_\textsc{f}-\Nx_\textsc{f}\Ny_\textsc{l})})\\ &=\textcolor{red}{(\Nx_\textsc{f}\Ny_\textsc{l}-\Nx_\textsc{l}\Ny_\textsc{f})\D_i}(\D_\textsc{f}\D_\textsc{l}F_{i+1}(a_{i+1}+b_{i+1})+E_{i+2})\\ &=(\Nx_\textsc{f}\Ny_\textsc{l}-\Nx_\textsc{l}\Ny_\textsc{f})\D_iE_{i+1} =\textcolor{teal}{(\Nx_\textsc{f}\Ny_\textsc{l}-\Nx_\textsc{l}\Ny_\textsc{f})}\D_{i+1} \end{align*} \end{linenomath} By definition, $\D_{i+1}$ divisible by $\tilde \D_{i+1}$. The remainder consists of three summands, namely ${(\Nx_\textsc{l}\Ny_\textsc{f}-\Nx_\textsc{f}\Ny_\textsc{l})}+E_{i+2}+{(\Nx_\textsc{f}\Ny_\textsc{l}-\Nx_\textsc{l}\Ny_\textsc{f})}$. Note that the first and last summand of the remainder are canceling. Consequently, the remainder is $E_{i+2}$, i.e., $\tilde \D_{i+2}=\tilde \D_{i+1}E_{i+2}.$ This directly implies that $ F_{i+1}\tilde \D_{i+2}= F_{i+1}\tilde\D_{i+1}E_{i+2}=\D_{i+1}E_{i+2}$ and therefore finishes the proof. \end{proof} \degreesStacked* \begin{proof} Recall that, by definition $d^\circ_{i+2}=|\N^\circ_{i+2}|-|\D_{i+2}|$. Consequently, if the degree of $\N^\circ_{i+2}$ and $\D_{i+2}$ are as claimed, it follows directly that $d^\circ_{i+2}=d^\circ_{i+1}$. For $\circ\in\{x,y\}$, we define $m^\circ:=|\D_\textsc{f}|+|\D_\textsc{l}|+|F_{i+1}|+\max\{d^\circ_\textsc{l},d^\circ_\textsc{f}\}$. Together with \cref{lem:degrees}, the degrees can be expressed as follows: \begin{linenomath}\begin{align*} |\N^\circ_{j+1}| &=|\D_j|+\max\big\{m^\circ, d^\circ_j+M \big\}\\ |\D_{j+1}|&=|\D_j|+|E_{j+1}| \end{align*} \end{linenomath} This implies the following formula for $d_{j+1}^\circ$: \begin{linenomath}\begin{align*} d_{j+1}^\circ&=-|E_{j+1}|+\max\big\{m^\circ, d^\circ_i+ M \big\} \end{align*} \end{linenomath} Recall that by \cref{lem:sameAngle}, $E_{i+2}=E_{i+1}-(a_{i+1}+b_{i+1})\D_\textsc{f}\D_\textsc{l}F_j$ and $F_{i+2}=F_{i+1}$. Consequently, it holds that $|E_{i+2}| =M$ and with the above formula it follows that $|\D_{i+2}|=|\D_{i+1}|+|E_{i+2}|=|\D_{i+1}|+M$, as claimed. % For the numerator, we replace $d_{i+1}^\circ$ in $\N^\circ_{i+2}$: \begin{linenomath}\begin{align*} |\N^\circ_{i+2}| &=|\D_{i+1}|+\max\big\{m^\circ, d^\circ_{i+1}+M\big\}\\ &=|\D_{i+1}|+\max\bigg\{m^\circ, M-|E|+\max\big\{m^\circ, d^\circ_i+ M \big\}\bigg\}\\ &=|\D_{i+1}|+ M-|E|+\max\big\{m^\circ, d^\circ_i+ M \big\}\\ &=|\D_{i+1}|+ M+d_{i+1}^\circ \end{align*} \end{linenomath} By definition of $M$, $M-|E|$ is non-negative and hence, the outer-maximum in line 2 is attained for the second term. The last term in the third line is exactly $d_{i+1}^\circ$. Hence the numerator degree $|\N^\circ_{i+2}|$ is of the claimed form. \end{proof} \subsection{Analyzing the Coordinates and their Degrees}\label{sec:coordinates} Throughout this section, let $T$ be a plane 4-connected triangulation with a \pOrder and $\A$ an algebraically independent area assignment. We use \cref{lem:almostReal} to obtain an almost realizing drawing $D(x_4)$ and want to use \cref{lem:surjective} to guarantee almost surjectivity of the \lastfaceFun $\f$. Thus, we are interested in the max-degree of $\f$. As shown in \cref{lem:almostReal}, we can represent the coordinates $(x_i,y_i)$ of each vertex $v_i$ and the \lastfaceFun by rational functions. Specifically, we have a representation of $x_i$ and $y_i$ by polynomials $\Nx_i,\Ny_i,\D_i$ in $x_4$ such that \[x_i=\frac{\Nx_i}{\D_i} \text{\quad and \quad} y_i=\frac{\Ny_i}{\D_i}.\] Due to \cref{lem:surjective}, we aim for the fact that $\Nx_i$ and $\Ny_i$ are \crr with $\D_i$ and are interested in their degrees. As before, we denote the degree of a polynomial~$p$ by~$|p|$. Moreover, we say that a polynomial $p(x_1,\dots,x_k)$ \emph{depends} on $x_j$ if and only if $p(x_1,\dots,x_j,\dots,x_k)\neq p(x_1,\dots,0,\dots,x_k)$. \cref{eq:NomDen,eq:NomDen2} show: \begin{obs}\label{obs:wiggle} For $i\in\{4,\dots, n\}$, $\N^\circ_i$ depends on $a_i$ and $b_i$, while $\D_i$ does not. \end{obs} In order to study their degree, we define $d_i^\circ:=|\N^\circ_i|-|\D_i|$. \begin{lemma}\label{lem:degrees} Let $v_i$ be a vertex with the three predecessors $p_\textsc{f},p_\textsc{m},p_\textsc{l}$ in \Po. For the vertex coordinates of $v_i$ in $D(x_4)$, it holds that the (not necessarily \crr) polynomials $\N^\circ_i,\D_i,\tilde \D_i$, defined in \cref{eq:tilde,eq:NomDen,eq:NomDen2}, have the following degrees: \begin{linenomath} \begin{align*} |\N^\circ_i|=&|\D_\textsc{m}|+|\D_\textsc{f}|+|\D_\textsc{l}|+|F_i|\\ &+\max\big\{d^\circ_\textsc{l},d^\circ_\textsc{f}, d^\circ_\textsc{m}+\max\{|E_i|-|\D_\textsc{f}|-|\D_\textsc{l}|-|F_i|,0\}\big\}\\ |\D_i|=&|\D_\textsc{m}|+|E_i|=|\tilde \D_{i}|+|F_i|\\ |\tilde \D_{i}|=&|\D_\textsc{f}|+|\D_\textsc{m}|+|\D_\textsc{l}| \\&+\max\big\{ d^x_\textsc{f}+\max\{d^y_\textsc{m},d^y_\textsc{l}\}, d^x_\textsc{m}+\max\{d^y_\textsc{l},d^y_\textsc{f}\}, d^x_\textsc{l}+\max\{d^y_\textsc{f},d^y_\textsc{m}\}\big\} \end{align*} \end{linenomath} \end{lemma} \begin{proof} We need to determine the degrees of the polynomials in \cref{eq:tilde,eq:NomDen,eq:NomDen2}. Here we use the fact that for all polynomials $p,q$ which are not the $0$-polynomial it holds $|p\cdot q|=|p|+|q|.$ With the convention that $|0|=-\infty$, the above identity also holds for the $0$-polynomial. Moreover, unless $|p|=|q|$ and the leading coefficients are canceling, it holds that $|p+q|=\max\{|p|,|q|\}.$ By algebraic independence, cancellation of leading coefficients does not occur. \end{proof} However, in order to apply \cref{lem:surjective}, we also need that $\Nx_i$ and $\Ny_i$ are \crr with~$\D_i$. Therefore, we are interested in sufficient conditions. \begin{restatable}{lemma}{nofactors} \label{lem:nofactors} Let $\circ\in\{x,y\}$. Suppose $\N^\circ_j$ and $\D_j$ are \crr for all $j<i$. Then, $\N^\circ_i$ and $\D_i$ have a common zero $z$ if and only if the following properties hold \begin{compactitem} \item[-] $z$ is a zero of $E_i$ \item[-] $z$ is independent of $a_i$ and $b_i$ \end{compactitem} and additionally \begin{compactitem} \item [(i)] $z$ is a zero of at least two of $\{\D_\textsc{f},\D_\textsc{m},\D_\textsc{l}\}$ or \item [(ii)] $z$ is a zero of both of $\{\N^\circ_\textsc{l}\D_\textsc{m}-\N^\circ_\textsc{m}\D_\textsc{l},\N^\circ_\textsc{f}\D_\textsc{m}-\N^\circ_\textsc{m}\D_\textsc{f}\}$. \end{compactitem} \end{restatable} Due to their technicality, we have moved the proofs of \cref{lem:nofactors} and of the two following lemmas to \cref{sec:appendixUsefulLemmas}. Now, we study a more specific situation which occurs for \graphClass and double stacking graphs. \paragraph{Stacking on same angle} Recall that, by \cref{lem:PolyMethodInsertion}, vertex $v_i$ is inserted in a 4-face of $T_{i-1}$. In this section, we analyze the situation that in the \pOrder several vertices are repeatedly inserted in the same angle. In particular, we say vertices $v_{i+1}$ and $v_{i+2}$ are \emph{stacked on the same angle} if their first and last predecessors are identical and the middle predecessor of $v_{i+2}$ is $v_{i+1}$. Specifically, $v_{i+1}$ and $v_{i+2}$ have predecessors $(p_\textsc{f},v_i,p_\textsc{l})$ and $(p_\textsc{f},v_{i+1},p_\textsc{l})$, respectively. \cref{fig:stacking} illustrates two vertices which are stacked on the same angle. \begin{figure}[htb] \centering \includegraphics[page=3,scale=.75]{3orient} \caption{Vertices $v_{i+1}$ and $v_{i+2}$ are stacked on the same angle.} \label{fig:stacking} \end{figure} \begin{restatable}{lemma}{sameAngle}\label{lem:sameAngle} If $v_{i+1}$ and $v_{i+2}$ are stacked on the same angle in the \pOrder and $\N^\circ_{i+1}$ and $\D_{i+1}$ are \crr, then it holds that \begin{linenomath} \begin{align*} E_{i+2}&=E_{i+1}-(a_{i+1}+b_{i+1})\D_\textsc{f}\D_\textsc{l}F_{i+1}\\ F_{i+2}&=F_{i+1}. \end{align*} \end{linenomath} \end{restatable} For the proof of \cref{lem:sameAngle}, we refer to \cref{sec:appendixUsefulLemmas}. For the degrees, we obtain the following expressions. \begin{restatable}{lemma}{degreesStacked}\label{lem:degreesStacked} If $v_{i+1}$ and $v_{i+2}$ are stacked on the same angle in the \pOrder, and if $\N^\circ_{i+1}$,$\D_{i+1}$, and $\N^\circ_{i+2}$, $\D_{i+2}$ are \crr. Then, for $M:=\max\{|E_{i+1}|,|\D_\textsc{f}|+|\D_\textsc{l}|+|F_{i+1}|)\}$ and $\circ\in\{x,y\}$ it holds that \begin{linenomath} \begin{align*} |\N^\circ_{i+2}|&=|\D_{i+1}|+M+ d^\circ_{i+1}\\ |\D_{i+2}|&=|\D_{i+1}|+M. \end{align*} \end{linenomath} In particular, it holds that $d^\circ_{i+2}=d^\circ_{i+1}$ \end{restatable} For the proof of \cref{lem:degreesStacked}, we refer to \cref{sec:appendixUsefulLemmas}. \input{4appendix} \section{Applications}\label{sec:applications} We now use \cref{thm:area-univ} and \cref{thm:everyEmbedding} to prove area-universality of some classes of triangulations. The considered graphs rely on an operation that we call \emph{\diam}. Consider the left image of \cref{fig:diam}. Let $G$ be a plane graph and let $e$ be an inner edge incident to two triangular faces that consist of $e$ and the vertices $u_1$ and $u_2$, respectively. Applying a \emph{\diam of order $k$} on $e$ results in the graph $G'$ which is obtained from $G$ by subdividing edge $e$ with $k$ vertices, $v_1,\dots,v_k$, and inserting the edges $v_iu_j$ for all pairs $i\in[k]$ and $j\in[2]$. \cref{fig:diam} illustrates a \diam on $e$ of order 3. \begin{figure}[htb] \centering \includegraphics[page=5]{Figures} \caption{Obtaining $G'$ from $G$ by a \diam of order 3 on edge $e$.} \label{fig:diam} \end{figure} \subsection{\GraphClass graphs} An \graphClass graph can be obtained from the plane octahedron graph $\mathcal G$ by a \diam{}: Choose one edge of the central triangle of $\mathcal G$ as the \emph{special edge}. The \emph{\graphClass} graph $\acc{\ell}$ is the plane graph obtained by a \diam of order $\ell$ on the special edge of $\mathcal G$. Consequently, $\acc{\ell}$ has $\ell+6$ vertices. We speak of an \emph{even \graphClass} if $\ell$ is even and of an \emph{odd \graphClass} if $\ell$ is odd. \cref{fig:funnyClass2} illustrates the accordion graphs~$\acc{i}$ for $i\leq 3$. Note that $\acc{0}$ is $\mathcal G$ itself and $\acc{1}$ is the unique 4-connected plane triangulation on seven vertices. Due to its symmetry, it holds that $[\acc{\ell}]=\{\acc{\ell}\}$. \begin{restatable}{theorem}{accordions}\label{thm:accordion} The \graphClass\ graph \acc{\ell} is area-universal if and only if $\ell$ is odd. \end{restatable} \begin{proof}[Sketch] Performing a \diam of order $\ell$ on some plane graph changes the degree of exactly two vertices by $\ell$ while all other vertex degrees remain the same. Consequently, if $\ell$ is even, all vertices of $\acc{\ell}$ have even degree, and hence, $\acc{\ell}$ as an Eulerian triangulation is not area-universal as shown by the author in \cite[Theorem 1]{kleist1Journal}. It remains to prove the area-universality of odd \graphClass graphs with the help of \cref{thm:area-univ}. Consider an arbitrary but fixed algebraically independent area assignment $\A$. We use the \pOrder depicted in \cref{fig:acc} to construct an \arVP. We place the vertices $v_1$ at $(0,0)$, $v_2$ at $(1,0)$, $v_3$ at $(1,\Sigma\A)$, and $v_4$ at $(x_4,a)$ with $a:=\A(v_1v_2v_4)$. Consider also \cref{fig:acc}. \begin{figure}[htb] \centering \includegraphics[page=6]{Figures} \caption{ A \pOrder of an \graphClass graph (left) and an \arVP (right), where the shaded faces are realized. } \label{fig:acc} \end{figure} We use \cref{lem:almostReal} to construct an \arVP. Note that for all vertices $v_i$ with $i>5$, the three predecessors of $v_i$ are $p_\textsc{f}=v_3$, $p_\textsc{m}=v_{i-1}$ and $ p_\textsc{l}=v_4.$ One can show that the vertex coordinates of $v_i$ can be expressed as $x_i=\nicefrac{\Nx_i}{\D_i}$ and $y_i=\nicefrac{\Ny_i}{\D_i}$, where $\Nx_i,\Ny_i,\D_i$ are polynomials in~$x_4$. Moreover, the polynomials fulfill the following crucial properties. \begin{restatable}{lemma}{accDegree}\label{lem:accDegree} For all $i\geq 5$, it holds that $|\D_5|=1$ and \[|\Nx_{i+1}|=|\D_{i+1}|=|\Ny_{i+1}|+1=|\D_{i}|+1.\] \end{restatable} Consequently, $|\Nx_i|=|\D_i|$ is odd if and only if $i$ is odd. In particular, for odd~$\ell$, $|\Nx_n|=|\D_n|$ is odd since the number of vertices $n=\ell+6$ is odd. \begin{restatable}{lemma}{accCRR}\label{lem:accCRR} For all $i\geq 5$ and $\circ\in\{x,y\}$, it holds that $\N^\circ_i$ and $\D_i$ are \crr. \end{restatable} Consequently, the area of the ccw triangle $v_2v_3v_n$ in $D(x_4)$ is given by the \crr \lastfaceFun \[\f(x):= \Det(v_2,v_3,v_n)=\Sigma\A(1-x_n)=\Sigma\A\left(1-\frac{\Nx_n}{\D_n}\right) .\] Since $|\Nx_n|$ and $|\D_n|$ are odd, the max-degree of $\f$ is odd. Thus, \cref{lem:surjective} ensures that $\f$ is almost surjective. By \cref{thm:area-univ}, $\acc{\ell}$ is area-universal for odd $\ell$. \end{proof} This result can be generalized to double stacking graphs. \subsection{Double Stacking Graphs} Denote the vertices of the plane octahedron $\mathcal G$ by $ABC$ and $uvw$ as depicted in \cref{fig:doubleStacking}. The \emph{double stacking graph} \dS{\ell}{k} is the plane graph obtained from~$\mathcal G$ by applying a \diam{} of order $\ell-1$ on $Au$ and a \diam of order $k-1$ on $vw$. Note that \dS{\ell}{k} has $(\ell+k+4)$ vertices. Moreover, \dS{\ell}{1} is isomorphic to \acc{\ell-1}; in particular, \dS{1}{1} equals $\mathcal G$. Note that $[\dS{\ell}{k}]$ usually contains several (equivalence classes of) plane graphs. \begin{figure}[t b] \centering \includegraphics[page=7]{Figures} \caption{A double stacking graph $\dS{\ell}{k}$.} \label{fig:doubleStacking} \end{figure} \begin{restatable}{theorem}{doubleStacking}\label{thm:LKdoubleStacking} A plane graph in $[\dS{\ell}{k}]$ is area-universal if and only if $\ell \cdot k$ is even. \end{restatable} If $\ell \cdot k$ is odd, every plane graph in $[\dS{\ell}{k}]$ is Eulerian and hence not area-universal by \cite[Theorem 1]{kleist1Journal}. If $\ell \cdot k$ is even, we consider an algebraically independent area assignment of $\dS{\ell}{k}$, show that its \lastfaceFun is \crr and has odd max-degree. Then we apply \cref{thm:everyEmbedding}.\smallskip \cref{thm:LKdoubleStacking} implies that \begin{corollary}\label{cor:universal} For every $n\geq 7$, there exists a 4-connected triangulation on $n$ vertices that is area-universal. \end{corollary} \section{Proofs of \cref{sec:prelim}}\label{app:2} \subsection{Proof of \cref{cor:fillinSTRONGER}} \cref{cor:fillinSTRONGER} follows from the fact that set of vertex placements $\D^{\leq c}|_{f\to\vartriangle}$ of $T$ is compact, where $\D^{\leq c}|_{f\to\vartriangle}$ denotes the set of crossing-free vertex placements where $f$ coincides with a fixed triangle $\vartriangle$ of positive area and additionally the total area in each drawing does not exceed $c$. \begin{lemma}\label{lem:compact} Let $T$ be a plane triangulation $T$, let $f$ be some face of $T$, and $c\in \R_{>0}$. Then the set of vertex placements $\D^{\leq c}|_{f\to\vartriangle}$ of $T$ is compact. \end{lemma} \begin{proof} First note that closedness follows from the fact that we allow for degenerate drawings. Second, we show that $\D^{\leq c}|_{f\to\vartriangle}$ is bounded. If $f$ is the outer face, then clearly all inner vertex coordinates are bounded by the coordinates of $\vartriangle$. Hence, it remains to consider the case that $f$ is an inner face. By assumption, $\vartriangle$ has positive area and hence three sides which are pairwise not parallel. We show that all vertices lie inside a bounded region which consists of the intersection of three half spaces. For each side $s$ of $f$, we consider the line $\ell_s$ such that $s$ and any point of $\ell_s$ form a triangle of area $c$ that intersects $f$. Let $H_s$ denote the half space defined by $\ell_s$ that contains $f$. We claim that any drawing~$D$ in $\D^{\leq c}|_{f\to\vartriangle}$ lies in $H_s$. Suppose a vertex $v$ of $T$ lies outside $H_s$, then the triangle~$t'$ formed by $s$ and $v$ is contained in $D$ since the outer face is triangular and thus convex. However, the area of $t'$ exceeds $c$. Therefore all vertices lie within the intersection of the three half spaces $H_s$. \end{proof} Now we are ready to prove the proposition. \fillingStronger* \begin{proof} Suppose $\A\in\As$ is realizable, then clearly, $\A$ itself lies in every of its neighborhoods and serves as a certificate of a realizing drawing. Suppose every open neighborhood of $\A$ in $\As^{\leq 2c}|_{f\to \A(f)}$ contains a realizable area assignment. Hence, we may construct a sequence of realizable assignments~$(\A_i)_{i\in\mathbb N}$ converging to $\A$. Since $\A_i(f)=\A(f)$ for all $i$, \cref{lem:outerFace} allows to pick an $A_i$-realizing drawing $D_i$ such that the placement of $f$ coincides with a fixed triangle $\vartriangle$ of area $\A(f)$, i.e., $D_i\in\D^{\leq 2c}|_{f\to\vartriangle}$. By \cref{lem:compact}, the sequence $(D_i)_{i\in\mathbb N}$ is bounded. Therefore, by the Bolzano-Weierstrass theorem, $(D_i)_{i\in\mathbb N}$ contains a converging subsequence with limit $D$. By the compactness, $D$ is contained in $\D^{\leq 2c}|_{f\to\vartriangle}$ and thus yields a crossing-free drawing of $G$. Note that for every inner face $f'\in F'$ it holds that: \[\area(f',D)=\lim_{i\to\infty} \area(f',D_i)=\lim_{i\to\infty} \A_i(f')=\A(f').\] Consequently, $D$ guarantees that $\A$ is realizable. \end{proof} \subsection{Proof of \cref{lem:4connnected}} \connected* \begin{proof} If $T$ is area-universal, then also every subgraph and consequently all its 4-connected components are area-universal. % We prove the other direction by induction. For the induction base, note that on $n=3$ and $n=4$ vertices there exist unique triangulations, namely the complete graphs on three and four vertices, which are area-universal as stacked triangulations and have no 4-connected components. For the induction step consider a triangulation $T$ on $n>4$ vertices. Now we use the fact that a triangulation on $n>4$ vertices is 4-connected if and only if it has no separating triangle. If $T$ is 4-connected, then the statement is vacuous. So suppose~$T$ has a separating triangle $t$. Let $T_i$ denote the triangulation consisting of $t$ and its interior, and let $T_o$ denote the triangulation consisting of $t$ and its exterior, see also \cref{fig:4connected}. \begin{figure}[ht] \centering \includegraphics[page=1,width=.9\textwidth]{4connected} \caption{Decomposing a triangulation along separating triangles.} \label{fig:4connected} \end{figure} By assumption all 4-connected components of $T$, and thus also of $T_i$ and $T_o$, are area-universal. By induction it follows that $T_i$ and $T_o$ are area-universal. We show how to obtain a realizing drawing of $T$ for any area assignment $\A$ of $T$. For $T_o$, consider a realizing drawing $D_o$ of $\A_o$ where $\A_o(t)$ equals the sum of all faces in $T_i$ and $\A_o(f)=\A(f)$ for all other faces of $T_o$. Now, for $T_i$ consider a realizing drawing $D_i$ of $\A_i$, the restriction of $\A$ to $T_i$. By \cref{lem:outerFace}, we may assume that the outer face of $D_i$ coincides with $t$ in $D_o$. By construction, $A_o(t)=\Sigma A_i$ and hence the area of $t$ in $D_o$ coincides with the area of the outer triangle of $T_i$. Hence, the union of $D_o$ and $D_i$ yields an $\A$-realizing drawing of $T$. \end{proof} \newpage \subsection{Proof of \cref{thm:areaEqs}} \propThree* \begin{proof} The proof consists of two directions. If $\A$ is realizable, then the vertex placement of an $\nicefrac{1}{2}\A$-realizing drawing is a real solution of \AreaEqA{F\setminus \{f\}}. Recall that by \cref{lem:scaling}, $\A$ is realizable if $\nicefrac{1}{2}\A$ is. If \AreaEqA{F\setminus\{f\}} has a real solution $S$, $S$ yields a vertex placement $D$ satisfying $\A$ and preserving the orientation of all but one face $f$. It remains to show that $D$ corresponds to a crossing-free drawing. If $f$ is the outer face, then \cref{lem:ccPlanar} implies that $D$ is an equivalent straight-line drawing of $T$. \cref{eq:outerface} shows that for every face $f'\in F'$, the equation systems $\AreaEqA {F'}$ and $\AreaEqA {F\setminus \{f'\}}$ are equivalent. Consequently, we may assume that $f$ is the outer face $f_o$. Thus, it remains to prove \cref{eq:outerface}. Let $v_1,v_2,\dots, v_k$ denote the vertices of the outer face $f_o$ (of an inner triangulation) in counter clockwise orientation. Recall that $\Det(u,v,w)$ denotes the determinant of the homogeneous coordinates of $u,v,w$ as defined in \cref{eq:det}. Moreover, $\det(u,v)$ denotes the determinant of the 2-dimensional coordinates of $u$ and $v$. Then, by the properties of the determinant, for any vertex placement $D$ it holds that \begin{align*} 2\cdot \area(f_o,D)=&\sum_{i=2}^{k-1} \Det(v_1,v_i,v_{i+1})=\sum_{i=1}^{k-1} \det(v_i,v_{i+1})\\ =&\sum_{i=1}^{k-1} \det(v_i,v_{i+1})+\sum_{e=(u,v) \text{inner}} \big(\det(u,v)+\det(u,v)\big)\\ =& \sum_{f=(u,v,w)\in F'}\Det (u,v,w) = 2\cdot \sum_{f\in F'}\area(f,D). \end{align*} In the last line, we use the fact that every inner edge appears in both direction and every outer edge in one direction. Thus we can traverse each inner face in ccw direction. This fact is illustrated in \cref{fig:neatLemma}. \end{proof} \begin{figure}[bth] \centering \includegraphics[page=8]{Figures} \caption{Illustration of the proof of \cref{thm:areaEqs}.} \label{fig:neatLemma} \end{figure} \section{Proofs of \cref{sec:poly}}\label{app:3} Here we present the omitted proofs of \cref{sec:poly}. We start with the properties of \pOrder{}s. \obsEdge* \begin{proof} By definition of $\Or_\Po$ if an edge $(v_{i+1},v_j)$ is oriented from $v_{i+1}$ to $v_j$, then $i>j$. Hence the orientation is acyclic. In particular, no edge is oriented in two directions. The number of unoriented edges follows by double counting the edges of $T$. On the one hand, by Euler's formula, the number of edges in a triangulation is $|E|=3n-6$. On the other hand, the number of oriented edges $E_\uparrow$ is given by the sum of the outdegrees. $$|E_\uparrow|=\sum_{i=1}^n \outdeg(v_{i+1})= 0+1+2+2+3(n-4)=3n-7.$$ Hence, $|E|-|E_\uparrow|=1$ and thus there is exactly one edge $e$ without orientation. Observe that the last vertex $v_n$ in the \pOrder has indegree 0. If $T$ has minimum degree 4, then $e$ is incident to $v_n$; otherwise $v_n$ would be a vertex of degree 3. This is a contradiction. \end{proof} \construction* \begin{proof} We prove this statement by induction. For the induction base, note that~$T_4$ has three faces: the triangle $v_3v_2v_1$, the triangle $v_1v_2v_4$, and the 4-face $v_1v_4v_2v_3$. \cref{fig:predecessors}\,(a) depicts~$T_4$ for the case that $v_1v_2v_3$ is the outer face. By 4-connected\-ness, $v_3$ and $v_4$ cannot share an edge. Therefore, with this notation, the inner faces are ccw and the outer face is cw oriented -- independent of the choice of the outer face. Now we consider the induction step and insert $v_{i+1}$ in $T_i$. Since $T$ is 4-connected, $v_{i+1}$ can only be placed in the unique 4-face $f$ of $T_{i}$. Clearly, any three vertices of $f$ are consecutive on the boundary cycle of $f$. Hence, the predecessors of $v_{i+1}$ form a path of length three along $f$. We define $p_\textsc{m}$ as the middle vertex of this path. Naming the remaining predecessors by $p_\textsc{f}$ and $p_\textsc{l}$, $p_\textsc{f}p_\textsc{m}v_{i+1}$ and $p_\textsc{m}p_\textsc{l}v_{i+1}$ are (not necessarily correctly oriented) triangles in $T_{i+1}$. Since $T$ is 4-connected, these triangles of $T_{i+1}$ are faces in $T$ and thus also in $T_{i+1}$. Furthermore, $p_\textsc{f}v_{i+1}p_\textsc{l}w$ forms a 4-face of $T_{i+1}$ where $w$ is the vertex of $f$ which is not in $\pred(v_{i+1})$. For the correct orientation we distinguish two cases: If $f$ is an inner face, we define $p_\textsc{f}$ as the ccw first vertex (of the path of predecessors in $f$) and $p_\textsc{l}$ as the ccw last vertex. \cref{fig:predecessors}\,(b) illustrates this definition for the case that $f$ is an inner face. Otherwise, $f$ is the outer face and we define $p_\textsc{f}$ as the cw first vertex and $p_\textsc{l}$ the cw last vertex. This case is displayed in \cref{fig:predecessors}\,(c). Then, $p_\textsc{f}p_\textsc{m}v_{i+1}$ and $p_\textsc{m}p_\textsc{l}v_{i+1}$ are ccw faces in $T_{i+1}$ if and only if they are inner faces of~$T$. \end{proof} As mentioned in \cref{rmk:numberTriang}, \cref{lem:PolyMethodInsertion} can be used to obtain a lower bound on the number of 4-connected planar triangulations on $n$ vertices with a \pOrder. \begin{proposition} The number of 4-connected planar triangulations on $n$ vertices with a \pOrder is $ \Omega( \nicefrac{1}{n}\cdot 2^{n})$. \end{proposition} \begin{proof} Firstly, we show that a 4-connected triangulation $T$ on $n$ vertices has at most $9n\cdot 2^{n}$ different \pOrder{}s. We consider every \pOrder in the reverse order $v_n,...,v_1$. $T$ has at most $3n$ edges which may serve as the unique unoriented edge. Its deletion yields a 4-face. By \cref{lem:PolyMethodInsertion}, in every \pOrder for $i=n,...,5$ the vertex $v_i$ is a vertex incident to a 4-face in~$T_i$. Removing $v_i$ from $T_i$ yields a graph $T_{i-1}$ that has again a unique 4-face. It follows from \cref{obs:edge} that $v_i$ is a vertex of degree 3 in $T_i$. Consequently, all neighbors of $v_i$ in $T_i$ are the predecessors of $v_i$. \vspace{-15pt} \begin{figure}[h!] \begin{minipage}{.58\textwidth} \normalsize Consider \cref{fig:vertdeg3} and observe that two adjacent vertices of degree 3 on a 4-face $x_1y_1y_2x_2$ certify a separating triangle, unless $n\leq 5$: Since all other faces of $T_i$ are triangles, every pair of adjacent vertices has a common neighbor outside of the $4$-face. If $x_i$ has degree 3, the common neighbor of $x_iy_i$ and $x_1x_2$ coincides; we call it $z$. Thus, $zy_1y_2$ is a separating triangle unless $T_i$ contains only these five vertices. By 4-connectivity, each 4-face has at most two vertices of degree 3 for $i\geq 5$ and there are at most two choices for the vertex $v_i$. For $i=5$, the number of choices is upper bounded by the four vertices of the 4-cycle and for $i\leq 4$, by another four; two for $v_1,v_2$ and two for $v_3,v_4$. \end{minipage} \hfill \begin{minipage}{.35\textwidth} \centering \includegraphics[page=4]{3orient} \caption{Two adjacent vertices of degree three in a 4-face certify a separating triangle.} \label{fig:vertdeg3} \end{minipage} \end{figure} \vspace{-18pt} Consequently, for a specific unoriented edge, the number of vertex orderings is at most $2^{n-5}\cdot 4 \cdot 4=2^{n-1}$. This makes a total of at most $3n\cdot2^{n-1}$ different \pOrder{}s for a fixed triangulation. In order to build a 4-connected triangulation with a \pOrder $v_1,v_2,\dots, v_n$, we specify the middle predecessor $v_\textsc{m}$ of $v_i$ for $5\leq i\leq n$ from the 4-face of $T_{i-1}$. By \cref{lem:PolyMethodInsertion}, the remaining two predecessors of $v_i$ are the two neighbors of $v_\textsc{m}$ in the 4-face. Thus, we have four choices for $v_\textsc{m}$ in each step $i>5$. For $i=5$, neither $v_3$ nor $v_4$ can serve as the middle predecessor since this results in a separating triangle. Thus, we obtain at least $2\cdot 4^{n-5}$ different \pOrder{}s. By the above observation at most $3n\cdot2^{n-1}$ belong to the same triangulation. Hence there exist $\Omega(\nicefrac{1}{n}\cdot 2^{n})$ 4-connected planar triangulation on $n$ vertices. \end{proof} \subsection{Proof of \cref{lem:almostReal}}\label{app:Lemma} For the proof of \cref{lem:almostReal}, we introduce the concept of algebraically independent area assignments. A set of real numbers $\{a_1,a_2,\dots,a_k\}$ is \emph{algebraically independent} over $\Q$ if for each polynomial $p(x_1,x_2,\dots,x_k)$ with coefficients from $\Q$, different from the 0-polynomial, it holds that $p(a_1,a_2,\dots,a_k)\neq 0$. We say a face area assignment $\A$ of a plane graph $G$ is \emph{algebraically independent} if the set $\{\A(f)| f\in F'\}$ is algebraically independent over $\Q$. Note that then for all $f_0\in F'$ it holds that $\{\A(f)| f\in F'\setminus f_0\}\cup \{\Sigma \A\}$ is algebraically independent. For a transcendental $c$, we denote the subset of $\As^c$ consisting of all algebraically independent area assignments by $\As_I$ and show that $\As_I$ is a dense subset. \begin{clm}\label{lem:dense} If $c$ is transcendental $c$, then $\As_I$ is dense in $\As^c$. \end{clm} \begin{proof} We show by induction that the set of algebraically independent $k$-tuples is dense. Our proof is built upon the fact that the algebraic closure of a countable field is countable \cite[p. 343, Cor. B-2.41]{rotmanAlgebra}. For the induction base, we consider $k=1$. Since the algebraic closure of~$\Q$ is countable, its complement $\R\setminus \Q$ is dense in $\R$. Now we consider the induction step from $k-1$ to $k$. In order to show that the algebraically independent $k$-tuple are dense, it suffices to show that for each $a$ in $\R^n$ and each $\varepsilon$-ball $B$ of $a$, there exists an algebraically independent $b$ in $B$. By induction hypothesis, we find a $(b_2,\dots,b_k)$ with algebraically independent entries, that is arbitrarily close to $(a_2,\dots,a_k)$. Let $K$ denote the algebraic closure of $\Q(b_2,...,b_n)$, the smallest field containing $\Q$ and $\{b_2,\dots,b_k\}$. As a rational function field over $\Q$, the field $\Q(b_2,...,b_n)$ is countable. Thus, since the algebraic closure of a countable field is countable, $K$ is countable. Thus in each open neighborhood of $a_1$, there exists a $b_1$ in the complement of $K$. Therefore, in each $\varepsilon$-ball of $a=(a_1,\dots,a_n)$ there exists an algebraically independent $b=(b_1,\dots,b_n)$. \end{proof} Now, we are ready to prove the main lemma. \almostReal* \begin{proof} Let $c$ be transcendental. We show that the claim holds for $\As_D:=\As_I$. Thus, we consider an arbitrary $\A\in \As_I$ and think of $\A$ as an \emph{abstract} area assignment, where the prescribed areas are still variables. The idea of the proof is simple. Given a placement of $v_1, \dots, v_{i-1}$, we want to insert $v_i$ by \cref{obs:uniquePos}. Thus, we need to guarantee that the predecessors are not collinear. We rename the vertices $v_1,v_2,v_3,v_4$ such that the triangle $v_1v_3v_2$ and $v_1v_2v_4$ are ccw inner and cw outer faces. For simplicity, we can think of $f_0$ as being the outer face. However, the construction works in all settings. We place $v_1$ at $(0,0)$, $v_2$ at $(0,1)$ and set $y_3:=-\A(f_0)$; recall that for the outer face $f_o$ it holds that $\A(f_o):=-\Sigma \A$. We use the freedom to specify $x_3$ at a later state. This guarantees property (i). Furthermore, for $a:=\A(v_1v_2v_4)$ we place $v_4$ at $(x_4,a)$. Consequently, the face area of the triangle $v_1v_2v_4$ is realized for all choices of $x_4$. For property (ii), we show that for all but finitely many values of $x_4$, we obtain an almost $\A$-realizing vertex placement $D(x_4)$. By \cref{lem:PolyMethodInsertion}, the three predecessors of $v_i$ can be named $(p_\textsc{f},p_\textsc{m},p_\textsc{l})$ such that $p_\textsc{f}p_\textsc{m}v_i$ and $p_\textsc{m}p_\textsc{l}v_i$ are ccw inner or cw outer faces of $T$. By \cref{obs:uniquePos}, the vertex coordinates of $v_i$ follow directly from its three predecessors $p_\textsc{f},p_\textsc{m},p_\textsc{l}$ -- unless these are collinear. Denoting the coordinates of $p_i$ by $(x_i,y_i)$ and solving the area equations yields the following coordinates of $v_i$: \begin{linenomath} \begin{align}\label{eq:1} x_i&=x_\textsc{m}+\frac{a(x_\textsc{l} - x_\textsc{m})-b(x_\textsc{m} - x_\textsc{f})} { x_\textsc{f} (y_\textsc{m}-y_\textsc{l} )+x_\textsc{m}(y_\textsc{l} -y_\textsc{f}) + x_\textsc{l} (y_\textsc{f}-y_\textsc{m})} \end{align} \begin{align}\label{eq:2} y_i&=y_\textsc{m}+\frac{ a(y_\textsc{l} - y_\textsc{m})-b(y_\textsc{m} - y_\textsc{f})} { x_\textsc{f} (y_\textsc{m}-y_\textsc{l} )+x_\textsc{m}(y_\textsc{l} -y_\textsc{f}) + x_\textsc{l} (y_\textsc{f}-y_\textsc{m})} \end{align} \end{linenomath} Note that the predecessors are collinear if and only if the denominators of \cref{eq:1,eq:2} vanish. Assume for now, that we are considering a position for $x_4$ such that no triple of predecessors becomes collinear. For $i=5,\dots,n$, we place $v_i$ according to \cref{obs:uniquePos} and satisfy two new area equations. Together with the realized face area of the triangles $v_1v_2v_4$ and $v_1v_2v_3$, the number of realized face areas is \[2(n-4)+2=2n-6.\] Consequently, all but two face areas, namely $f_a$ and $f_b$, are realized and $D(x_4)$ is an \arVP. Let $\B(\A)$ denote the set of all $x_4$ where a triple of predecessors becomes collinear. We postpone to show that $\B(\A)$ is finite. It is sufficient to show that the denominator of each vertex is not the 0-polynomial. We prove this simultaneously with property (iii). \smallskip Now, we show (ii). For each vertex $v_i$, we wish to represent its coordinates $(x_i,y_i)$ in $D(x_4)$ by rational functions with a common denominator. Specifically, we aim for polynomials $\Nx_i,\Ny_i,\D_i$ in $x_4$, which are different from the 0-polynomial, such that \[x_i=\frac{\Nx_i}{\D_i} \text{\qquad\ and \ \qquad} y_i=\frac{\Ny_i}{\D_i}.\] Moreover, we assume that the leading coefficient of $\D_i$ is 1. We show the existence of such a representation by induction. Hence assume that we have such a representation of $v_1,\dots,v_{i-1}$. By the placement of the initial vertices, it holds that $\D_i:=1$ for all $i\in[4]$. Now, we consider the vertex $v_i$ with $i>4$. By \cref{lem:PolyMethodInsertion}, we denote the three predecessors of $v_i$ by $p_\textsc{f},p_\textsc{m},p_\textsc{l}$ such that the triangles $p_\textsc{f}p_\textsc{m}v_i$ and $p_\textsc{m}p_\textsc{l}v_i$ are ccw inner or cw outer faces of $T$; we call the prescribed face areas of the two triangles $a_i$ and $b_i$, respectively. \cref{eq:1,eq:2} yield the coordinates of vertex $v_i$ in $D(x_4)$. Since we will aim for the fact, that the representation is \emph{\crr}, that is the polynomials share no common real root, we are already here more careful. For the later argument, it is convenient to consider $v_5$ explicitly. By the 4-connectedness of $T$, neither $v_3$ nor $v_4$ is the middle predecessor of $v_5$. Thus, by symmetry, we may assume that $\pred(v_5)=\{v_1,v_4,v_3\}$ and \cref{eq:1,eq:2} simplify to \begin{linenomath} \begin{align}\label{eq:v5} x_5=\frac{a_5x_4+b_5x_3}{y_3x_4-ax_3} \qquad \text{ and } \qquad y_5=\frac{aa_5+b_5y_3}{y_3x_4-ax_3}. \end{align} \end{linenomath} Note that for $x_3=0$, the denominators of $x_5$ and $y_5$ would vary in a \crr representation. Thus, for $x_3\neq 0$, we define $\Nx_5:=x_4a_5+b_5x_3$, $\Ny_5:=aa_5+b_5$, $\D_5:=y_3x_4-ax_3$. Clearly, none of them is the 0-polynomial. Now, we consider the induction step for vertex $v_i$ with $i>5$. Note that, due to the 4-connectedness, $v_1$ is not a predecessor of $v_i$. \cref{eq:1,eq:2} yield the coordinates of vertex $v_i$ in the \arVP. By assumption, $\D_\textsc{f}\cdot\D_\textsc{m}\cdot\D_\textsc{l}$ is not the 0-polynomial, since none of its factors is the 0-polynomial. Therefore, we may expand the right term by $\D_\textsc{f}\cdot\D_\textsc{m}\cdot\D_\textsc{l}$. Using the representations $x_j=\nicefrac{\Nx_j}{\D_j}$ and $y_j=\nicefrac{\Ny_j}{\D_j}$ for $j\in\{\textsc{f,m,l}\}$ yields the following identities: \begin{linenomath} \begin{align} x_i&=\frac{\Nx_\textsc{m}}{\D_\textsc{m}}+\frac{\D_\textsc{m}(a_i\Nx_\textsc{l}\D_\textsc{f}+b_i \Nx_\textsc{f}\D_\textsc{l}) - (a_i+b_i)\Nx_\textsc{m}\D_\textsc{f}\D_\textsc{l}}{\tilde \D_i}\label{eq:X}\\[6pt] y_i&=\frac{\Ny_\textsc{m}}{\D_\textsc{m}}+\frac{\D_\textsc{m}( a_i\Ny_\textsc{l}\D_\textsc{f}+b_i \Ny_\textsc{f}\D_\textsc{l} ) -(a_i+b_i)\Ny_\textsc{m}\D_\textsc{f}\D_\textsc{l} { \tilde \D_{i}}\label{eq:Y} \end{align} \begin{equation}\label{eq:tilde} \text{with }\tilde \D_{i}:=\Nx_\textsc{f} (\Ny_\textsc{m}\D_\textsc{l}-\Ny_\textsc{l}\D_\textsc{m} )+\Nx_\textsc{m}(\Ny_\textsc{l}\D_\textsc{f} -\Ny_\textsc{f}\D_\textsc{l}) + \Nx_\textsc{l} (\Ny_\textsc{f}\D_\textsc{m}-\Ny_\textsc{m}\D_\textsc{f}). \end{equation} \end{linenomath} Note that the denominators of $x_i$ and $y_i$ are identical and the numerators are symmetric in the $x$- and $y$-coordinates of their predecessors, respectively. Hence, for $\circ\in\{x,y\}$, we define $\N^\circ_{i}$ to unify the notation. We wish to argue that $\tilde \D_i$ is not the 0-polynomial. The existence of distinct $j,k\in\{\textsc{f,m,l}\}$ such that neither $\N^x_j$ nor $\N^y_k$ are the 0-polynomial guarantees that one summand of $\tilde \D_i$ does not vanish. Note that such a pair does always exist since there are only two polynomials which might be the 0-polynomial, namely $\Ny_2$ and $\Nx_3$; here we use the fact that $v_1$ is no predecessor of any $v_i$ with $i>5$. We now expand to find the desired representations of $x_i$ and $y_i$. The denominator is the least common multiple of $\D_\textsc{m}$ and $\tilde\D_i$, none of which is the 0-polynomial. Thus, we define $E_i$ and $F_i$ to be \crr polynomials such that \begin{linenomath} \begin{equation}\label{eq:EF} \D_\textsc{m} E_i=\tilde \D_{i}F_i. \end{equation} \end{linenomath} In \cref{eq:X,eq:Y}, we expand the left summand by $E_i$ and the right summand by $F_i$. Then the coordinates of vertex $v_i$ can be expressed by \begin{linenomath} \begin{align}\label{eq:NomDen} \N^\circ_i&:=F_i\D_\textsc{m}(a_i\N^\circ_\textsc{l}\D_\textsc{f}+b_i \N^\circ_\textsc{f}\D_\textsc{l}) + \N^\circ_\textsc{m}(E_i-(a_i+b_i)\D_\textsc{f}\D_\textsc{l}F_i)\\\label{eq:NomDen2} \D_i&:=\D_\textsc{m} E_i=\tilde \D_{i}F_i \end{align} \end{linenomath} Thus, each coordinate of $v_i$ is a rational function in $x_4$, where the coefficients are polynomials in $\A$. Due to the algebraically independence of $\A$, the coefficients cannot vanish and $\D_i$ is not the 0-polynomial. Using the fact that $\D_\textsc{f}\cdot\D_\textsc{m}\cdot\D_\textsc{l}$ is not the 0-polynomial, any $\N^\circ_j$ with $j\in\{\textsc{f,m,l}\}$ which is not the 0-polynomial, certifies that $\N_i^\circ$ is not the zero polynomial. Recall that we already guaranteed the existence of distinct $j,k\in\{\textsc{f,m,l}\}$ such that neither $\N^x_j$ nor $\N^y_k$ are the 0-polynomial. Thus, such a pair also implies that $\N_i^\circ$ is not the zero polynomial for all choices of $\circ\in\{x,y\}$. Consequently, we have proved property (ii) and (iii). \smallskip Moreover, (iii) immediately implies (iv): The area of face $f_a$ can be expressed as the determinant of its three vertex coordinates. Thus, if the vertex coordinates are rational functions in $x_4$, so is the area of face $f_a$. \end{proof} We interpret $\f$ as a rational function in $x_4$ whose coefficients depend on $\A$. \subsection{Almost surjectivity and area-universality}\label{app:B2} We start by proving \cref{lem:surjective}. \surjective* \begin{proof} Let $c\in\mathbb R\backslash \{0\}$ and consider $g\colon \R\to\R, \ g(x):=p(x)-c q(x)$. The leading coefficients of the polynomials $p$ and $c\cdot q$ cancel for at most one choice of $c$. For all other values, the degree of $g$ is $\deg g= \max\{\deg p, \deg q\}$ and by assumption odd. Consequently, as a real polynomial of odd degree, $g$ has a real root $\tilde x$. If $q(\tilde x)\neq 0$, then \[g(\tilde x)=0\iff f(\tilde x)=c.\] Suppose $q(\tilde x)=0$. Then, $q(\tilde x)=0=g(\tilde x)=p(\tilde x)$. Hence $\tilde x$ is a zero of both $p$ and $q$. A contradiction to the assumption that $p$ and $q$ are \crr. \end{proof} Now, we aim to prove \cref{thm:everyEmbedding} which relies on several interesting properties of algebraically independent area assignments. In particular, it remains to show \cref{prop:sameDegM}. \sameDeg* \begin{proof} We assume that $v_1v_2v_3$ is the cw outer face of $T$ and $w_1w_2w_3$ is the cw outer face of $T'$. Then $v_1v_2v_3$ is a ccw inner face of $T'$ and $w_1w_2w_3$ is a ccw inner face of $T$. Compared to $T$, the orientation of the faces $v_1v_2v_3$ and $w_1w_2w_3$ in~$T'$ changes; while the orientation of all other faces remains: This is easily seen when considering the drawings on the sphere; which are obtained by one-point compactification of some point in the respective outer faces. Due to the 3-connectedness and Whitney’s uniqueness theorem, the drawings $T$ and $T'$ on the sphere are equivalent \cite{whitney1933-2}. Moreover, in the drawing of the sphere $v_1v_2v_3$ and $w_1w_2w_3$ are ccw. Then choosing one face as the outer face and applying a stereographic projection of the punctured sphere where a point of the outer face is deleted, results in a drawing in the plane where all faces remain ccw while the outer face becomes cw. With respect to the area assignment $\A$ of $T$, $v_1v_2v_3$ is assigned to the total area $-\Sigma \A$ and $w_1w_2w_3$ to some value~$c$. As an intermediate step we consider the area assignment~$\A''$ of $T'$ where all area assignments remain but $w_1w_2w_3$ obtains the total area $-\Sigma \A$ and $v_1v_2v_3$ some value $c$. Clearly, $\A''$ is algebraically independent since $\A$ is. Fortunately, the negative sign accounts for the fact that the orientation changes; constructing realizing drawings by \cref{lem:almostReal} $T$ and $T'$ are treated by the very same procedure. Thus, $\f'_{\A''}$ can be obtained from $\f_\A$ by swapping all occurrences of $c$ and $-\Sigma \A$. Consequently, the degrees of the denominator and numerator polynomials of the last face functions $\f_\A$ and $\f'_{\A''}$ coincide. Moreover, by \cref{obs:sameDegreeM}, the degrees of $\f'_{\A''}$ and $\f'_{\A'}$ coincide. \end{proof} Consequently, \cref{lem:surjective}, \cref{prop:sameDegM}, and \cref{thm:area-univ} imply \cref{thm:everyEmbedding}. \everyEmbedding* \begin{proof} If the \lastfaceFun $\f$ of $T$ has odd max-degree for some $\A\in \As_I$, then this holds true for all area assignments in $\As_I$ by \cref{obs:sameDegreeM}. Consequently, \cref{lem:surjective} guarantees that the \lastfaceFun $\f(\cdot,\A)$ is almost surjective for all $\A\in\As_I$. Since $\As_I$ is dense in $\As$ as proved in \cref{lem:dense}, \cref{thm:area-univ} implies the area-universality of $T$. For every other plane graph $T'\in[T]$, the \lastfaceFun $\f'$ has also odd maximum degree by \cref{prop:sameDegM}. Here we used the fact that~$\f'$ can be obtained from~$\f$ by exchanging two algebraically independent numbers. By the same reasoning, $\f'$ is also \crr. Thus, the above argument shows that $T'$ is area-universal. \end{proof} \section{Proofs of \cref{sec:applications}}\label{app:applications} Here we present the omitted proofs of \cref{sec:applications}. We start by helpful lemmas to analyze the coordinate functions and their degrees. \input{4CoordinateLemmasNotation} \newpage \subsection{Proof of \cref{thm:accordion}}\label{app:acc} \accordions* To complete the proof of \cref{thm:accordion}, we have to show \cref{lem:accDegree} and \cref{lem:accCRR}. \accDegree* \begin{proof} We denote the two face areas incident to $v_i$ and its predecessors by $a_i$ and $b_i$ for $i\geq5$, see \cref{fig:funnyClass1} for an illustration. \begin{figure}[htb] \centering \begin{subfigure}[t]{.45\textwidth} \centering \includegraphics[page=1,scale=.75]{funnyClass} \caption{A \pOrder of an \graphClass graph.} \label{fig:funnyClassA} \end{subfigure} \hfill \begin{subfigure}[t]{.45\textwidth} \centering \includegraphics[page=4,scale=.75]{funnyClass} \caption{An \arVP; the green faces are realized.} \label{fig:funnyClassB} \end{subfigure} \caption{Illustration of \cref{thm:accordion} and its proof.} \label{fig:funnyClass1} \end{figure} We show this claim by induction. For $v_5$, we have already evaluated the \crr vertex coordinates in \cref{eq:v5}. Thus, it holds that \[|\Nx_{5}|=|\D_{5}|=|\Ny_{5}|+1=1.\] For $\circ\in\{x,y\}$, we define $d_i^\circ:=|\N^\circ_i|-|\D_i|$. Consequently, it holds that $d_5^x=0$ and $d_5^y=-1$. Moreover, since $\D_\textsc{m}=1$, it holds that $F_5=1$ and $\D_5=E_5=\tilde \D_5$. Recall that all vertices $v_i$ with $i>5$, the three predecessors of $v_i$ are $p_\textsc{f}=v_3, \quad p_\textsc{m}=v_{i-1}\quad \text{and} \quad p_\textsc{l}=v_4.$ In other words, all vertices $v_i$ with $i>4$ are stacked on the same angle. Consequently, for all $i>5$, it holds that $|\N^\circ_\textsc{f}|=|\D_\textsc{f}|=|\D_\textsc{l}|=0$ and $d^x_\textsc{f}=d^y_\textsc{f}=0$, and $d^x_\textsc{l}=1, d^y_\textsc{l}=0$. Defining $M:=\max\{|E_5|,|\D_\textsc{f}|+|\D_\textsc{l}|+|F_5|\}=\max\{1,0\}=1$, we obtain for $v_i$, $i>5$, with the help of \cref{lem:degreesStacked}: \begin{linenomath} \begin{align*} |\Nx_{i+1}|&=|\D_{i}|+M+ d^x_{5}=|\D_{i}|+1\\ |\Ny_{i+1}|&=|\D_{i}|+M+ d^y_{5}=|\D_{i}|\\ |\D_{i+1}|&=|\D_{i}|+M=|\D_{i}|+1. \end{align*} \end{linenomath} \end{proof} \accCRR* \begin{proof} We show this by induction on $i$. The induction base is settled for $i=5$ since the polynomials in \cref{eq:v5} are \crr. Suppose, for a contradiction, that $\N^\circ_i$ and $\D_i$, share a common real root. Then, we are either in case (i) or (ii) of \cref{lem:nofactors}. The fact that $\D_\textsc{f}=\D_\textsc{l}=1$ excludes case (i). Thus, we are in case (ii). To arrive at the final contradiction, we work a little harder. Since $\D_\textsc{f}=\D_\textsc{l}=1$, there exists $z$ which is a zero of both $\{\N^\circ_\textsc{l}\D_\textsc{m}-\N^\circ_\textsc{m},\{\N^\circ_\textsc{f}\D_\textsc{m}-\N^\circ_\textsc{m}\}$. This implies that either $\D_\textsc{m}(z)=0$ or $\N^\circ_\textsc{l}(z)=\N^\circ_\textsc{f}(z)$. In the first case, $\D_\textsc{m}(z)=0$, it follows that $\N^\circ_\textsc{m}[z]=0$. This is an immediate contradiction to the fact that $\D_\textsc{m}$ and $\N^\circ_\textsc{m}$ are \crr. Thus it remains to consider the latter case, namely that $\N^\circ_\textsc{l}(z)=\N^\circ_\textsc{f}(z)$. For $\circ=y$, we immediately obtain a contradiction since $\Ny_\textsc{l}=a<\Sigma\A=\Ny_\textsc{f}$. For $\circ=x$ it follows that $z=1$ since $\Nx_\textsc{l}=x$, $\Nx_\textsc{f}=1$. Moreover, by \cref{lem:nofactors}, $z$ is a zero of $E_i$. Consequently, it suffices to show that $E_i[1]\neq 0$. In order to analyze the zeros of $E_i$, we define for $i\in \{5,\dots,n\}$ \[\alpha_i:=a +\sum_{j=5}^{i-1} (a_j+b_j).\] Recall that $E_5[x]=(\Sigma\A)x-a$ by \cref{eq:v5}. Thus, by \cref{lem:sameAngle}, it holds for $i\in \{5,\dots,n-1\}$ that \begin{equation}\label{eq:Ei} E_{i+1}[x]=E_i[x]-(a_i+b_i)=E_5[x]-\sum_{j=5}^{i} (a_j+b_j)=(\Sigma\A)x-\alpha_{i+1}. \end{equation} Since $\alpha_i<\Sigma\A$, it follows $E_i[1]\neq0$ that for all $i\geq 5$. Consequently, $\N^\circ_i$ and $\D_i$ are \crr. \end{proof} \subsection{Proof of \cref{thm:LKdoubleStacking}}\label{app:double} \doubleStacking* \begin{proof} We start to consider $\dS{\ell}{k}$. Note that the degree of all but four vertices is exactly four; namely, the degree of $B$ and $\ell$ is $k+3$, the degree of $v$ and $C$ is $\ell+3$. Thus, if both $\ell$ and $k$ are odd, then $\dS{\ell}{k}$ is Eulerian and thus not area-universal as shown in \cite[Theorem 1]{kleist1Journal}. Since the degree depends on the planar graph, all plane graphs in $[\dS{\ell}{k}]$ are Eulerian and not area-universal if $\ell\cdot k$ is odd. Assume that $\ell\cdot k$ is even. In order to show the area-universality of $\dS{\ell}{k}$, we consider the \pOrder $(A,B,C,v,1,\dots, \ell, 1'\dots, k')$ in which $k'C$ is the unique undirected edge. For an algebraically independent area assignment \A, we define $a:=\A(ABv)$ and place $v_3$ at $(1,\Sigma \A)$ and $v_4$ at $(x_4,a)$. Observe that the vertices $1,2,\dots \ell$ have the predecessors $C$ and $v$ and are locally identical to an \graphClass graph. Consequently, by \cref{lem:accDegree} and \cref{lem:accCRR}, the coordinates of vertex $\ell$ can be expressed by \crr polynomials $\N^\circ_\ell, \D_\ell$ with the degrees \[|\Nx_\ell|=|\Ny_\ell|+1=|\D_\ell|=\ell.\] Since $\D_v=1$ and $C_{1'}=E_{1'}\D_v=\tilde D_{1'} F_{1'}$ by definition, see \cref{eq:EF}, it follows that $E_{1'}=\tilde D_{1'}$ and $F_{1'}=1$. As we will see it holds that $|E_{1'}|=|\tilde D_{1'}|=\ell$; this implies that \[\max\{|E_{1'}|-|\D_\ell|-|\D_B|-|F_{1'}|,0\} =\max\{\ell-\ell-0-0,0\}=0.\] \begin{figure}[htb] \centering \begin{subfigure}{.47\textwidth} \centering \includegraphics[page=5,scale=.75]{funnyClass} \caption{A \pOrder of a \lkGraph.} \label{fig:funnyDoubleA} \end{subfigure} \hfill \begin{subfigure}{.48\textwidth} \centering \includegraphics[page=6,scale=.75]{funnyClass} \caption{An \arVP.} \label{fig:funnyDoubleB} \end{subfigure} \caption{Illustration of \cref{thm:LKdoubleStacking} and its proof.} \label{fig:funnyDouble} \end{figure} Note that $d^x_B=0$, $d^y_B=-\infty$, $d^x_v=1,$ $d^y_v=0$, $d^x_\ell=0$, and $d^y_\ell=-1$. \cref{lem:degrees} yields the following degrees: \[ |\Nx_{1'}|=\ell+1 \quad \text{ and }\quad |\Ny_{1'}|=|\D_{1'}|=|\tilde \D_{1'}|=\ell \] We will later show that these polynomials are \crr. Now, we proceed to compute the degrees of the vertex coordinates. Defining $M:=\max\{|E_{1'}|,|\D_{\ell}|+|\D_B|+|F_{1'}|)\}=\max\{\ell,\ell+0+0)\}=\ell$ and by \cref{lem:degreesStacked}, it follows for $j>1$ \begin{linenomath} \begin{align*} |\Nx_{j'}|&=|\D_{1'}|+(j-1)\cdot M+ d^x_{1'}=j\cdot\ell+1\\ |\Ny_{j'}|=|\D_{j'}|&=|\D_{1'}|+(j-1)\cdot M=j\cdot\ell. \end{align*} \end{linenomath} Assume for now, that the resulting polynomials are \crr. As our last face we choose the triangle $k'BC$. Then the \lastfaceFun $\f$ evaluates to \[\f(x):=\det(k',B,C)=1-x_{k'}=1-\frac{\Nx_{k'}}{\D_{k'}}.\] For the last vertex $k'$, the degree of the numerator, namely $k\cdot\ell+1$, exceeds the degree of the denominator $k\cdot \ell$ and is odd since $\ell\cdot k$ is even. Consequently, $\f$ has odd max-degree and is almost surjective by \cref{lem:surjective}. Consequently, \cref{thm:everyEmbedding} shows that every plane graph in $[\dS{\ell}{k}]$ is area-universal.\medskip It remains to guarantee that the polynomials are \crr. \begin{lemma} For all $j\geq 1$, it holds that $\N^\circ_{j'}$ and $\D_{j'}$ are \crr. \end{lemma} We prove this claim by induction and start with settling the base for $j=1$ using \cref{lem:nofactors}. Suppose by contradiction that $\N^\circ_{1'}$ and $\D_{1'}$ share a common zero $z$. The fact that $\D_\textsc{l}=\D_\textsc{m}=1$ excludes case~(i). Thus, case (ii) holds and, since $\D_\textsc{l}=\D_\textsc{m}=1$, $z$ is a zero of the simplified polynomials $(\N^\circ_\textsc{l}-\N^\circ_\textsc{m})$ and $(\N^\circ_\textsc{f}-\N^\circ_\textsc{m}\D_\textsc{f})$. Recall that $\Nx_\textsc{l}=1$ and $\Ny_\textsc{l}=0$. Thus for $\circ=y$, it follows that $z$ is a zero of $\Ny_\textsc{l}$ and thus also of $\Ny_\textsc{m}$. However, $\Ny_\textsc{m}=a>0$ yields a contradiction. For $\circ=x$, $\Nx_\textsc{l}=1$ and $\Nx_\textsc{m}=x$ imply that $z=1$. Consequently, it holds that $\Nx_\textsc{f}[1]-\D_\textsc{f}[1]=0$. Recall that in our case $\textsc{f}=\ell$. By \cref{obs:wiggle}, $\Nx_\textsc{f}=\Nx_\ell$ depends on $a_\ell$ while $\D_\textsc{f}$ does not. Consequently, $\Nx_\textsc{f}[1]$ and $\D_\textsc{f}[1]$ are polynomials in $\A$; due to the algebraic independence they cannot coincide. \medskip Now, we come to the induction step and suppose, for a contradiction, that $\N^\circ_{j'+1}$ and $\D_{j'+1}$ share a common real root $z$. By \cref{lem:nofactors} we distinguish two cases. In all cases $z$ is zero of $E_{j'+1}$. By \cref{lem:sameAngle}, we know that for $j\in[k-1]$ it holds that $E_{j'+1}=E_{j'}-(a_{j'}+b_{j'})\D_\ell.$ Together with $E_{1'}=a(\Nx_\ell-\D_\ell)+(1-x)\Ny_\ell$, we obtain \[E_{j'+1}=a\Nx_\ell+(1-x)\Ny_\ell-\left(a+\sum_{k=1}^j (a_{k'}+b_{k'})\right)\D_\ell.\] We claim that $z$ does not depend on $a_{j'}$ and $b_{j'}$. Then, it follows from the algebraic independence, that $z$ is a zero of both $a\Nx_\ell+(1-x)\Ny_\ell$ and $\D_\ell$. \medskip To prove this claim we distinguish the cases suggested by \cref{lem:nofactors}. Recall that the predecessor indices $\textsc{f,m,l}$ of $j'+1$ are given by $\ell,j',2$. If case (i) of \cref{lem:nofactors} holds, then $z$ is a zero of $\D_{\ell}$ and $\D_{j'}$ since $\D_2=1$. Then clearly $z$ does not depend on $a_{j'}$ and $b_{j'}$ since $\D_\ell$ does not. If case (ii) of \cref{lem:nofactors} holds, then $z$ is a zero of $\N^\circ_2\D_{j'}-\N^\circ_{j'}\D_2$ and $\N^\circ_{\ell}\D_{j'}-\N^\circ_{j'}\D_{\ell}$. We distinguish two cases for $\circ\in\{x,y\}$. For $\circ=y$, it holds that $\Ny_2=0$ and $\D_2=1$. Thus, it follows that $\Ny_{j'}[z]=0$ and $(\Ny_{\ell}\D_{j'})[z]=0$. Since $\Ny_{j'}$ and $\D_{j'}$ are \crr by the induction hypothesis, it holds that $\Ny_{\ell}[z]=0$. Then as a zero of $\Ny_{\ell}$, $z$ does neither depend on $a_{j'}$ nor on $b_{j'}$. For $\circ=x$, $\Nx_2=1$ and $\D_2=1$ imply that $\Nx_{j'}[z]=\D_{j'}[z]$ and $\D_{j'}[z](\Nx_{\ell}-\D_{\ell})[z]=0$. Since $\D_{j'}[z]\neq 0$, as otherwise $\Nx_{j'}$ and $\D_{j'}$ are not \crr, it holds that $\Nx_{\ell}[z]=\D_{\ell}[z]$. Using the last fact, $E_{j'+1}[z]$ simplifies to $(1-z)\Ny_\ell[z]-\left(\sum_{k=1}^j (a_{k'}+b_{k'})\right)\D_\ell[z]=0.$ This implies that \[\Nx_{\ell}[z] =\D_{\ell}[z] =\frac{1}{\sum_{k=1}^j (a_{k'}+b_{k'})}(1-z)\Ny_\ell[z].\] Since neither $\Nx_{\ell}$ nor $\D_{\ell}$ depend on $a_{k'}$ and $b_{k'}$, these three polynomial do not coincide at $z$ for small variations of $a_{k'}$. Thus for a dense set of algebraically independent area assignments, these three polynomials share no common real root. Consequently, we can assume that $z$ does not depend on $a_{j'}$ and $b_{j'}$ and thus $z$ is a zero of both $(a\Nx_\ell+(1-x)\Ny_\ell$) and $\D_\ell$. However, we show that this is not the case. \begin{clm} $\D_\ell$ and $(a\Nx_\ell+(1-x)\Ny_\ell)$ are \crr. \end{clm} Suppose $z$ is a zero of $\D_{\ell}$ and $a\Nx_\ell+(1-x)\Ny_\ell$. Recall that by \cref{eq:Ei} and since $\D_{i+1}=E_{i+1}D_i$ it follows for $i\in[\ell]$ for $i\in[\ell]$ it holds that \[E_{i}=x-\alpha_{i} \quad \text{ and } \quad \D_i=\prod_{j=1}^i E_j=\prod_{j=1}^{i} (x-\alpha_j).\] Therefore, the zero set of $\D_i$ is given by $\{\alpha_i\mid i\in [\ell]\}$. We define \[G_j[x]:=a\Nx_j[x]+(1-x)\Ny_j[x]\] and aim to show by induction on $j\in[\ell]$ that for all $i\leq j$: $G_j[\alpha_i]\neq 0$. Note that the claim is equivalent to $G_\ell[\alpha_i]\neq 0$ for all $i\leq \ell$. For the induction base, \cref{eq:v5} shows that $\N^x_{1}=a_1x+b_1$ and $\N^y_{1}=a_1a+b_1$. Consequently, it holds that $G_1[\alpha_1]=G_1[a]=a_1a+b_1\neq 0.$ By \cref{eq:NomDen}, for $i\in[\ell-1]$, the numerator polynomials can be expressed by $\N^\circ_{j}=\D_{j}(a_j\N^\circ_v+b_j) + \N^\circ_{j}E_{j+1}$. This yields \begin{linenomath} \begin{align*} G_j[\alpha_i]&=a\big(\D_j(a_j\Nx_v+b_j) + \Nx_jE_{j+1}\big)[\alpha_i]+(1-\alpha_i)\big(\D_j(a_j\Ny_v+b_j) + \Ny_j E_{j+1}\big)[\alpha_i]\\ &=\D_{j}[\alpha_i]\cdot(aa_j+b_j(1+a-\alpha_i))+ E_{j+1}[\alpha_i]\cdot\big(a\Nx_{j}[\alpha_i]+(1-\alpha_i)\Ny_{j}[\alpha_i]\big) \end{align*} \end{linenomath} If $i\leq j$, then the first summand vanishes since $\D_{j}[\alpha_i]=0$. The second summand does not vanish by induction and since $E_{j+1}[\alpha_i]=\alpha_i-\alpha_{j+1}<0$. For~$i=j+1$, the second term vanishes since $E_{j+1}[\alpha_{j+1}]=0$ and the first term does not vanish since both factors do not. Consequently, it holds that $G_\ell[\alpha_i]\neq 0$. This finishes both, the proof of the claim and the theorem. \end{proof} \section{Discussion and Open Problems}\label{sec:end} For triangulations with \pOrder{}s, we introduced a sufficient criterion to prove area-universality of all embeddings of a planar graph which relies on checking properties of one area assignments of one plane graph. We used the criterion to present two families of area-universal triangulations. Since area-universality is maintained by taking subgraphs, area-universal triangulations are of special interest. For instance, the area-universal double stacking graphs are used in~\cite{kleistQuad,kleistPhD} to show that all plane quadrangulations with at most 13 vertices are area-universal. The analysis of \graphClass graphs showns that area-universal and non-area-universal graphs can be structural very similar. The class of accordion graphs gives a hint why understanding area-universality seems to be a difficult problem. In conclusion, we pose the following open questions: \begin{compactitem} \item Is area-universality a property of plane or planar graphs? \item What is the complexity of deciding the area-universality of triangulations? \item Can area-universal graphs be characterized by \emph{local} properties? \end{compactitem} \paragraph{Acknowledgements} I thank Udo Hoffmann and Sven Jäger for helpful comments. \newpage
\section{Introduction}\label{s:i} \subsection{Generalities} A triangulation of a piecewise linear (PL) 4-manifold can be transformed into its any other triangulation by a finite sequence of \emph{Pachner moves}~\cite{Pachner,Lickorish}. Hence, it is natural to expect that a PL 4-manifold \emph{invariant} can be constructed if we have an \emph{algebraic realization} of Pachner moves---informally speaking, such formulas whose structure corresponds to these moves naturally. Such formulas are often called \emph{hexagon relations} (or, more generally, $(n+2)$-gon relations for $n$-manifolds, see, for instance,~\cite{DM}). A fruitful version of hexagon relation has been proposed in~\cite{bosonic,cubic}. In it, a \emph{two-component} `color'~$(x_t,y_t)$ is ascribed to every tetrahedron~$t$---3\nobreakdash-face of a triangulation. Thus, there appear ten variables on the 3-faces of each pentachoron (4\nobreakdash-simplex)~$u$ and it is required that these ten variables obey \emph{five} relations. Moreover, the variables $x_t,y_t$ in~\cite{bosonic,cubic} belonged to a field, and the relations were linear. As we will see below in this paper, this construction can work productively also, at least, for modules over ring~$\mathbb Z$, that is, \emph{abelian groups}. The most interesting manifold invariants appear if we use \emph{cohomology} of our hexagon relations (in perfect analogy with the fact that powerful invariants of \emph{knots} and their higher analogues are obtained from \emph{quandle} cohomology~\cite{CKS}). In~\cite{cubic}, we have calculated some `polynomial' cohomologies; one can see that they are very nontrivial, and give nontrivial manifold invariants. The nature of these polynomial cohomologies looks, at the moment, quite mysterious. At the same time, there is a hope that it can be clarified; compare, for instance, the study of polynomial \emph{quandle} cocycles in~\cite{CEF} and references therein. A natural desire is also to relate our cohomologies to known algebraic structures appearing in the study of 4-manifolds, or at least find parallels between them. \subsection{What we do in the present paper} We bring to light some parallels between one cocycle appearing in our work and the \emph{intersection form} of 4-manifolds (see textbooks~\cite{GS,Scorpan}). We construct a similar $\mathbb Z$-bilinear form in the framework of our theory. Further, we show that \emph{some} of nontrivial polynomial hexagon cocycles in finite characteristics found in~\cite{cubic} can be derived from this single $\mathbb Z$-bilinear form---to be exact, its modifications involving finite fields---using manipulations with Frobenius homomorphisms. \begin{ir} Not all polynomial cocycles could be obtained that way, at least by now! \end{ir} \subsection{Notational conventions}\label{ss:cnvs} Typically, we denote 2\nobreakdash-simplices---triangles---by the letter~$s$, 3\nobreakdash-simplices---tetrahedra---by the letter~$t$, and 4\nobreakdash-simplices---pentachora---by the letter~$u$. All vertices of any triangulated object are assumed to be \emph{numbered}. A triangle $s=ijk$ has vertices whose numbers are $i$, $j$ and~$k$. Moreover, when we denote a simplex by its vertices, these go, by default, in the \emph{increasing} order. For the above triangle~$s$, this means that $i<j<k$. \subsection{The content of the paper by sections} Below, \begin{itemize}\itemsep 0pt \item in Section~\ref{s:h}, we recall, very briefly, the notion of \emph{permitted colorings} of 3-faces satisfying the \emph{full hexagon}. One small new moment is that we formulate all this in terms of general abelian groups, \item in Section~\ref{s:c}, we introduce our $\mathbb Z$-bilinear hexagon cocycle, \item in Section~\ref{s:inv}, we describe two kinds of manifold invariants: the `probabilities' of the values that our bilinear `action' can take on a manifold, and just the action itself understood as an \emph{integral} bilinear form taken to within invertible $\mathbb Z$-linear transformations and adding zero direct summands, \item in Section~\ref{s:ff}, we recall polynomial cocycles over finite fields from~\cite{cubic} and show how \emph{some} of these can be reproduced using our bilinear form and `Frobenius tricks', \item in Section~\ref{s:if}, we explain why the usual intersection form of a 4-manifold can be seen as an analogue of our $\mathbb Z$-bilinear `action', \item and finally, in Section~\ref{s:d}, we give a very brief discussion of our results and some related intriguing questions. \end{itemize} \section{Hexagon relation}\label{s:h} \subsection{Colorings by an abelian group}\label{ss:col} Let $G$ be an abelian group. We will color tetrahedra~$t$---that is, triangulation 3-faces---by \emph{pairs} $(x_t,y_t)$ of elements $x_t,y_t\in G$, and call this simply \emph{$G$-coloring}. For a pentachoron~$u=ijklm$, we introduce two vector columns of height~$5$, corresponding to its 3-faces going in the inverse lexicographic order: \begin{equation}\label{xy} \mathsf x_u= \begin{pmatrix} x_{jklm}\\ x_{iklm}\\ x_{ijlm}\\ x_{ijkm}\\ x_{ijkl} \end{pmatrix},\quad \mathsf y_u= \begin{pmatrix} y_{jklm}\\ y_{iklm}\\ y_{ijlm}\\ y_{ijkm}\\ y_{ijkl} \end{pmatrix}. \end{equation} We also take the following matrix with integer entries from~\cite[Eqs.~{(5)~and~(6)}]{cubic}: \[ \mathcal R = \begin{pmatrix}0 & -2 & 1 & 1 & -2\\ 0 & -1 & 0 & 1 & -1\\ -1 & 2 & -2 & 0 & 1\\ -1 & 3 & -2 & -1 & 2\\ 0 & 1 & -1 & 0 & 0\end{pmatrix}. \] \begin{dfn} A coloring of (the 3-faces of) a pentachoron~$u$ is called \emph{permitted} if the following relation holds: \[ \mathsf y_u=\mathcal R\mathsf x_u. \] \end{dfn} \begin{dfn} A coloring of a triangulated piecewise linear 4-manifold~$M$ is called permitted if it induces permitted colorings on all its pentachora. \end{dfn} Permitted colorings of the initial and final configurations of any Pachner move are in good correspondence with each other. We say that they satisfy \emph{full set theoretic hexagon}. For exact formulations, the reader is referred to~\cite[{Sections 2 and~3}]{cubic}. \begin{remark} The fact that we are using here an arbitrary abelian group instead of a field in~\cite{cubic} brings nothing significantly new into our definitions and reasonings. \end{remark} \subsection{Double colorings}\label{ss:dc} One case of special importance is \emph{double coloring}. This is, by definition, a coloring in the sense of Subsection~\ref{ss:col} with $G$ being a direct sum of two abelian groups: \[ G = A \oplus B. \] In this case, we will use the following notations for the pairs of elements of each group: \[ (x_t,y_t)\in A^{\oplus 2},\quad (\xi_t,\eta_t)\in B^{\oplus 2}. \] Similarly to~\eqref{xy}, we introduce four columns: \[ \mathsf x_u= \begin{pmatrix} x_{jklm}\\ x_{iklm}\\ x_{ijlm}\\ x_{ijkm}\\ x_{ijkl} \end{pmatrix},\quad \mathsf y_u= \begin{pmatrix} y_{jklm}\\ y_{iklm}\\ y_{ijlm}\\ y_{ijkm}\\ y_{ijkl} \end{pmatrix},\quad \upxi_u= \begin{pmatrix} \xi_{jklm}\\ \xi_{iklm}\\ \xi_{ijlm}\\ \xi_{ijkm}\\ \xi_{ijkl} \end{pmatrix}\text{ \ \ and \ \ } \upeta_u= \begin{pmatrix} \eta_{jklm}\\ \eta_{iklm}\\ \eta_{ijlm}\\ \eta_{ijkm}\\ \eta_{ijkl} \end{pmatrix}, \] and a permitted double coloring of a pentachoron is of course such that \begin{equation}\label{ye} \mathsf y_u=\mathcal R\mathsf x_u, \qquad \upeta_u=\mathcal R\upxi_u. \end{equation} \section[A hexagon cocycle in the form of a $\mathbb Z$-bilinear form]{A hexagon cocycle in the form of a $\boldsymbol{\mathbb Z}$-bilinear form}\label{s:c} \begin{theorem} The following bilinear form: \begin{multline}\label{Phi} \Phi_u(\mathsf x_u, \upxi_u) = (x_{jklm}+y_{jklm}) \otimes (\xi_{ijkl}+\eta_{ijkl}) \\ = (x_{jklm}-2x_{iklm}+x_{ijlm}+x_{ijkm}-2x_{ijkl}) \otimes (\xi_{iklm}-\xi_{ijlm}+\xi_{ijkl}) \end{multline} is a nontrivial hexagon 4-cocycle. Here $u=ijklm$, and the form~$\Phi$ depends thus on a pair ``permitted $A$-coloring, permitted $B$-coloring'' (relations~\eqref{ye} are of course implied) and takes values in the abelian group $A\otimes B$. \end{theorem} \begin{proof} Direct calculation. \end{proof} \begin{ir} Recall (Subsection~\ref{ss:cnvs}) that our notational conventions imply that $i<j<k<l<m$, so $ijkl$ may be called the \emph{front} 3-face of pentachoron $u=ijklm$, while $jklm$---its \emph{rear} 3-face. The first line of~\eqref{Phi} shows that $\Phi_u$ is the product of two quantities belonging to these two 3-faces. This is especially interesting when compared with the manifold's \emph{intersection form}, see Section~\ref{s:if} below. \end{ir} \section{Invariants}\label{s:inv} \subsection{The action} For a triangulated oriented 4-manifold~$M$, maybe with boundary, we introduce the following \emph{action}, depending on a permitted coloring of~$M$: \begin{equation}\label{S} S = \sum_u \epsilon_u \Phi_u(\mathsf x_u, \upxi_u), \end{equation} where the sum goes over all triangulation pentachora~$u$, and $\epsilon_u=1$ if the orientation of~$u$ determined by the increasing order of its vertices coincides with its orientation induced from~$M$, and $\epsilon_u=-1$ otherwise. Below, in Subsections \ref{ss:subgr} and~\ref{ss:ibf}, we specialize this action for two interesting cases. \subsection{Subgroups of permitted colorings and probabilities of action values}\label{ss:subgr} \begin{theorem}\label{th:P} Let $A$ and~$B$ be as in Subsection~\ref{ss:dc} and, moreover, let them be \emph{finite}, and let a subgroup $F\subset A\oplus B$ be given. For each permitted $F$-coloring, action~$S$ takes some value $v\in A\otimes B$. Define the \emph{probability} of value~$v$ as \begin{equation}\label{P} \mathrm P(v) = \frac{\# (S=v)}{\# (\text{all permitted colorings})}, \end{equation} where $\#$ means the cardinality of a set; so, $\# (S=v)$ is the number of those permitted colorings where $S=v$, compare~\cite[{(19)}]{cubic}. Then, the probabilities\/ $\mathrm P(v)$ for all\/ $v\in A\otimes B$ are invariants of the piecewise linear manifold~$M$. \end{theorem} \begin{proof} It repeats the proof of \cite[Theorem~{4(i)}]{cubic}. \end{proof} We will see in Section~\ref{s:ff} how to choose subgroup~$F$ in order to obtain \emph{some} of polynomial actions in~\cite{cubic}. \subsection{Integral bilinear form}\label{ss:ibf} Set now simply $A=B=\mathbb Z$, and the subgroup $F=G=A\oplus B$. Then action~$S$ given by~\eqref{S} becomes an integral bilinear form. \begin{theorem}\label{th:Z} Let bilinear form~$S$ (depending on a pair of permitted integral colorings) be defined according to~\eqref{S},~\eqref{Phi} with integer variables $x_t$ and~$\xi_t$. Then $S$, taken to within a zero direct summand and an invertible $\mathbb Z$-linear transformation, is a piecewise linear 4-manifold invariant. \end{theorem} \begin{proof} First, we analyze what happens under any Pachner move. Everything goes in, essentially, the same way as in~\cite[Section~{3}]{cubic} (although, there was a \emph{field} in~\cite{cubic} instead of our current~$\mathbb Z$): \begin{itemize}\itemsep 0pt \item for a Pachner move 3--3, there is a bijective---and certainly $\mathbb Z$-linear---correspondence between the permitted $\mathbb Z$-colorings before and after this move, \item for a move 2--4, there appears one additional `$\mathbb Z$-degree of freedom': to each permitted coloring before the move there correspond colorings after the move, parameterized by~$\mathbb Z$, \item for a move 1--5, there appear, in a similar way, four additional `$\mathbb Z$-degrees of freedom', \item and for all Pachner moves, the value of~$S$ remains the same, after applying this correspondence, due to the cocycle property. \end{itemize} Finally, if we choose a different basis in the space (to be exact, free $\mathbb Z$-module) of permitted colorings, this will correspond, of course, to an invertible $\mathbb Z$-linear transformation applied to the form~$S$. \end{proof} \begin{theorem}\label{th:sym} For a closed oriented triangulated 4-manifold~$M$, the form~$S$ of Theorem~\ref{th:Z} is symmetric. \end{theorem} \begin{proof} To see this, we subtract from~\eqref{Phi} the same expression, but with interchanges $x_t\leftrightarrow \xi_t$, \ $y_t\leftrightarrow \eta_t$. It turns out that the result is a coboundary, in the sense of hexagon cohomology. Below we write this coboundary even in two different ways: \begin{align*} (x_{jklm}+y_{jklm}) & (\xi_{ijkl}+\eta_{ijkl}) - (\xi_{jklm}+\eta_{jklm})(x_{ijkl}+y_{ijkl}) \\ & = (x_{jklm}+y_{jklm})\eta_{jklm}-(x_{iklm}+y_{iklm})\eta_{iklm}+\dots\\ & = -y_{jklm}(\xi_{jklm}+\eta_{jklm})+y_{iklm}(\xi_{iklm}+\eta_{iklm})-\dots\,. \end{align*} Here the omission points mean, in both cases, three obvious similar summands, corresponding to the remaining 3-faces $ijlm$, $ijkm$ and~$ijkl$, and coming with alternating signs. Thus, the difference between $S$ and the same~$S$, but with the mentioned `Latin--Greek' interchanges, consists of summands belonging to triangulation tetrahedra, and, moreover, for a closed~$M$ they all cancel away. \end{proof} \begin{remark} Of course, if we know the integral bilinear form~$S$ of this Subsection, we can get also all the forms mentioned above and involving abelian groups, by using the tensor product operation. The reader will hopefully have no difficulty in writing the exact formulas. \end{remark} \section{Particular case: polynomial cocycles over finite fields}\label{s:ff} \subsection[Introducing dependence of~$\xi_t$ on~$x_t$ using Frobenius homomorphism]{Introducing dependence of~$\boldsymbol{\xi_t}$ on~$\boldsymbol{x_t}$ using Frobenius homomorphism}\label{ss:F} We continue to use the notations of Subsection~\ref{ss:dc}. Let $A=B=\mathbb F_{p^n}$, that is, the finite field of $p^n$ elements, and let $F\subset A\oplus B$ be generated by such pairs $(a,b)=(x_t,\xi_t)$ that $b=a^{p^m}$, where $m\in \mathbb N_0=\{0,1,2,\dots\}$. Also, we replace the tensor product in the definition~\eqref{Phi} of~$\Phi_u$ by the usual multiplication in~$\mathbb F_{p^n}$. Then, it is easy to see that the so defined~$\Phi_u$ yields in the standard way the action $S=\sum_u \epsilon_u \Phi_u$ whose probabilities~\eqref{P} are manifold invariants, and this~$\Phi_u$ is a polynomial of degree~$p^m+1$ in the five variables~$x_t$, where $t\subset u$. \begin{ir} Probabilities $\mathrm P(v)$ for $v\in A\otimes B$ may be more informative than those defined according to the previous paragraph (and also used in~\cite{cubic}), because $A\otimes B=A\otimes_{\mathbb Z} B$ is typically greater that just the field $\mathbb F_{p^n} = A\otimes_{\mathbb F_{p^n}} B$ where the action defined in the previous paragraph takes values. \end{ir} \begin{xmp} Let $p=2$, \ $n$~any natural number, and $m=0$. Then \eqref{Phi} becomes a homogeneous quadratic polynomial in the variables~$x_t$ in characteristic~2, namely \[ (x_{jklm}+x_{ijlm}+x_{ijkm})(x_{iklm}+x_{ijlm}+x_{ijkl}). \] This is the same polynomial as appears in~\cite[Eq.~{(22)}]{cubic}. \end{xmp} \begin{xmp} Let again $p=2$, \ $n$~any natural number, but now $m=1$. Then \eqref{Phi} becomes a homogeneous \emph{cubic} polynomial, namely \[ (x_{jklm}+x_{ijlm}+x_{ijkm})(x_{iklm}^2+x_{ijlm}^2+x_{ijkl}^2). \] This is the same polynomial as appears in~\cite[Eq.~{(24)}]{cubic}. \end{xmp} \subsection{Example of a cocycle that could not be obtained by the Frobenius trick} The following cubic cocycle in characteristic~2 could not (as yet) be obtained by the author using the above `Frobenius' or any similar trick: \begin{align} x_{iklm}x_{ijkm}x_{ijkl} + x_{iklm} & x_{ijlm}x_{ijkl} + x_{jklm}x_{ijlm}x_{ijkl} \nonumber \\ & + x_{jklm}x_{ijlm}x_{ijkm} + x_{jklm}x_{iklm}x_{ijkm}. \label{cubic-first} \end{align} This cocycle appears, and in more elegant notations, in~\cite[Eq.~{(23)}]{cubic}. \subsection{Double Frobenius trick}\label{ss:FF} One obvious generalization of the `Frobenius trick' of Subsection~\ref{ss:F} is to do it on both `Latin' and `Greek' variables. Namely, let now introduce variables~$\mathfrak x_t$ over the field $A=B=\mathbb F_{p^n}$, and let $F\subset A\oplus B$ consist of pairs $(a,b)=(x_t,\xi_t)$ parameterized by variables $c=\mathfrak x_t$ in such way that $a=c^{p^{m_1}}$ and $b=c^{p^{m_2}}$, where $m_1,m_2\in \mathbb N_0$. For a single pentahoron~$u$, we consider the five $\mathfrak x_t$, \ $t\subset u$, as independent variables, and for the whole manifold~$M$, variables~$\mathfrak x_t$ are assumed to have the same linear dependencies as either~$x_t$ or~$\xi_t$. Recall that these dependencies arise due to~\eqref{ye} and the fact the pair $(x_t,y_t)$ or $(\xi_t,\eta_t)$ for any tetrahedron~$t$ must be the same regardless of the pentachoron~$u\supset t$ where we used formula~\eqref{ye} (and there are of course two such~$u$ for a non-boundary~$t$). \begin{xmp} Let again $p=2$, \ $n$~any natural number, $m_1=1$ and $m_2=2$. Then \eqref{Phi} becomes a homogeneous polynomial of the \emph{sixth} degree, namely \[ (\mathfrak x_{jklm}^2+\mathfrak x_{ijlm}^2+\mathfrak x_{ijkm}^2)(\mathfrak x_{iklm}^4+\mathfrak x_{ijlm}^4+\mathfrak x_{ijkl}^4). \] The reader will hopefully have no problem in finding this polynomial also in an unnumbered formula in~\cite[{Subsection~5.1}]{cubic}. \end{xmp} Still, as of now, neither cocycle~\eqref{cubic-first} nor many other cocycles from~\cite{cubic} could be obtained using anything like these tricks. \section{Intersection form as a simple analogue of our construction}\label{s:if} This time, we color \emph{2-faces} $s=ijk$, \ $i<j<k$ (remember Subsection~\ref{ss:cnvs}), by elements~$x_{ijk}\in \mathbb Z$. \emph{Permitted colorings} are such where values $x_{ijk}$ make a \emph{cocycle}, that is, \[ x_{ijk} - x_{ijl} + x_{ikl} - x_{jkl} = 0 \] for any triangulation tetrahedron~$ijkl$. In analogy with Subsection~\ref{ss:dc}, we consider now \emph{double} colorings $(x_s,\xi_s)$, where $\xi_{ijk}\in \mathbb Z$ also make a cocycle. A simple calculation shows that the bilinear form \[ \varphi_{ijklm} = x_{ijk} \xi_{klm} \] well-known from the theory of the cup product, is (of course!) a hexagon cocycle. We introduce then the following simple `action' (with the same~$\epsilon_u$ as in~\eqref{S}): \[ S=\sum_u \epsilon_u \varphi_u, \] which is nothing but the well-known \emph{intersection form}~\cite{GS,Scorpan} of a 4-manifold. \section{Discussion of results}\label{s:d} Our integral bilinear form in Subsection~\ref{ss:ibf} may actually simply \emph{coincide} with the usual intersection form. At the moment, there are neither calculations that could disprove this conjecture, nor a theory that would prove it. Anyhow, what looks most interesting is that out form, together with `Frobenius tricks' from Section~\ref{s:ff}, yields \emph{some} but not all polynomial cocycles found in~\cite{cubic}. So, the nature of the remaining cocycles looks very intriguing.
\section{Introduction} Text summarization systems aim to generate natural language summaries that compress the information in a longer text. Approaches using neural networks have shown promising results on this task with end-to-end models that encode a source document and then decode it into an abstractive summary. Current state-of-the-art neural abstractive summarization models combine extractive and abstractive techniques by using pointer-generator style models which can copy words from the source document \citep{gu2016incorporating,see2017get}. These end-to-end models produce fluent abstractive summaries but have had mixed success in content selection, i.e. deciding what to summarize, compared to fully extractive models. \begin{figure}[t!] \begin{framed} \textbf{Source Document} \small{german chancellor angela merkel \notcopied{did} not \notcopied{look} too pleased about the weather during her \notcopied{annual} easter holiday \notcopied{in italy.} as britain \notcopied{basks} in \notcopied{sunshine} and temperatures of up to 21c, mrs merkel and her husband\notcopied{, chemistry professor joachim sauer,} had to settle for a measly 12 degrees. the chancellor and her \notcopied{spouse} have been spending easter on the small island of ischia, near naples in the mediterranean for over a \notcopied{decade.} \notcopied{not so sunny:} angela merkel \notcopied{and} her husband\notcopied{, chemistry professor joachim sauer,} are spotted on their \notcopied{annual} easter trip to the island of ischia\notcopied{,} near naples\notcopied{. the} couple \notcopied{traditionally} spend their holiday at the five-star miramare spa hotel on the south of the island \notcopied{, which comes} with its own private beach \notcopied{, and balconies overlooking the} ocean \notcopied{.}...} \textbf{Reference} \small{ \setlist{nolistsep} \begin{itemize}[align=left, leftmargin=*, noitemsep] \item angela merkel and husband spotted while on italian island holiday. \\ $\ldots$ \end{itemize}} \textbf{Baseline Approach} \small{ \setlist{nolistsep} \begin{itemize}[align=left, leftmargin=*, noitemsep] \item angela merkel and her husband, chemistry professor joachim sauer, are spotted on their annual easter trip to the island of ischia, near naples. \\ $\ldots$ \end{itemize}} \textbf{Bottom-Up Summarization} \small{ \setlist{nolistsep} \begin{itemize}[align=left, leftmargin=*, noitemsep] \item angela merkel and her husband are spotted on their easter trip to the island of ischia, near naples. \\ $\ldots$ \end{itemize} } \end{framed} \caption{Example of two sentence summaries with and without bottom-up attention. The model does not allow copying of words in \notcopied{gray}, although it can generate words. With bottom-up attention, we see more explicit sentence compression, while without it whole sentences are copied verbatim.} \label{fig:ex} \vspace{-3.5mm} \end{figure} There is an appeal to end-to-end models from a modeling perspective; however, there is evidence that when summarizing people follow a two-step approach of first selecting important phrases and then paraphrasing them~\citep{anderson1988teaching,jing1999decomposition}. A similar argument has been made for image captioning. \citet{anderson2017bottom} develop a state-of-the-art model with a two-step approach that first pre-computes bounding boxes of segmented objects and then applies attention to these regions. This so-called \textit{bottom-up} attention is inspired by neuroscience research describing attention based on properties inherent to a stimulus~\citep{buschman2007top}. Motivated by this approach, we consider \textit{bottom-up} attention for neural abstractive summarization. Our approach first selects a selection mask for the source document and then constrains a standard neural model by this mask. This approach can better decide which phrases a model should include in a summary, without sacrificing the fluency advantages of neural abstractive summarizers. Furthermore, it requires much fewer data to train, which makes it more adaptable to new domains.\looseness=-1 Our full model incorporates a separate content selection system to decide on relevant aspects of the source document. We frame this selection task as a sequence-tagging problem, with the objective of identifying tokens from a document that are part of its summary. We show that a content selection model that builds on contextual word embeddings~\citep{peters2018deep} can identify correct tokens with a recall of over 60\%, and a precision of over 50\%. To incorporate bottom-up attention into abstractive summarization models, we employ masking to constrain copying words to the selected parts of the text, which produces grammatical outputs. We additionally experiment with multiple methods to incorporate similar constraints into the training process of more complex end-to-end abstractive summarization models, either through multi-task learning or through directly incorporating a fully differentiable mask. Our experiments compare bottom-up attention with several other state-of-the-art abstractive systems. Compared to our baseline models of \citet{see2017get} bottom-up attention leads to an improvement in \acrshort{ROUGE-L} score on the \gls{CNNDM} corpus from 36.4 to 38.3 while being simpler to train. We also see comparable or better results than recent reinforcement-learning based methods with our MLE trained system. Furthermore, we find that the content selection model is very data-efficient and can be trained with less than 1\% of the original training data. This provides opportunities for domain-transfer and low-resource summarization. We show that a summarization model trained on \gls{CNNDM} and evaluated on the NYT corpus can be improved by over 5 points in \acrshort{ROUGE-L} with a content selector trained on only 1,000 in-domain sentences. \section{Related Work} There is a tension in document summarization between staying close to the source document and allowing compressive or abstractive modification. Many non-neural systems take a select and compress approach. For example, \citet{dorr2003hedge} introduced a system that first extracts noun and verb phrases from the first sentence of a news article and uses an iterative shortening algorithm to compress it. Recent systems such as \citet{durrett2016learning} also learn a model to select sentences and then compress them. In contrast, recent work in neural network based data-driven extractive summarization has focused on extracting and ordering full sentences~\citep{cheng2016neural,dlikman2016using}. \citet{nallapati2016classify} use a classifier to determine whether to include a sentence and a selector that ranks the positively classified ones. These methods often over-extract, but extraction at a word level requires maintaining grammatically correct output~\citep{cheng2016neural}, which is difficult. Interestingly, key phrase extraction while ungrammatical often matches closely in content with human-generated summaries~\citep{bui2016extractive}. A third approach is neural abstractive summarization with sequence-to-sequence models \cite{sutskever2014sequence,bahdanau2014neural}. These methods have been applied to tasks such as headline generation~\citep{rush2015neural} and article summarization~\citep{nallapati2016abstractive}. \citet{chopra2016abstractive} show that attention approaches that are more specific to summarization can further improve the performance of models. \citet{gu2016incorporating} were the first to show that a copy mechanism, introduced by \citet{vinyals2015pointer}, can combine the advantages of both extractive and abstractive summarization by copying words from the source. \citet{see2017get} refine this pointer-generator approach and use an additional coverage mechanism \citep{tu2016modeling} that makes a model aware of its attention history to prevent repeated attention. Most recently, reinforcement learning (RL) approaches that optimize objectives for summarization other than maximum likelihood have been shown to further improve performance on these tasks \citep{paulus2017deep,li2018actor, celikyilmaz2018deep}. \citet{paulus2017deep} approach the coverage problem with an intra-attention in which a decoder has an attention over previously generated words. However RL-based training can be difficult to tune and slow to train. Our method does not utilize RL training, although in theory this approach can be adapted to RL methods. Several papers also explore multi-pass extractive-abstractive summarization. \citet{nallapati2017summarunner} create a new source document comprised of the important sentences from the source and then train an abstractive system. \citet{liu2018generating} describe an extractive phase that extracts full paragraphs and an abstractive one that determines their order. Finally~\citet{zeng2016efficient} introduce a mechanism that reads a source document in two passes and uses the information from the first pass to bias the second. Our method differs in that we utilize a completely abstractive model, biased with a powerful content selector. Other recent work explores alternative approaches to content selection. For example, \citet{cohan2018discourse} use a hierarchical attention to detect relevant sections in a document, \citet{li2018guiding} generate a set of keywords that is used to guide the summarization process, and \citet{pasunuru2018multi} develop a loss-function based on whether salient keywords are included in a summary. Other approaches investigate the content-selection at the sentence-level. \citet{tan2017abstractive} describe a graph-based attention to attend to one sentence at a time, \citet{chen2018fast} first extract full sentences from a document and then compress them, and \citet{hsu2018unified} modulate the attention based on how likely a sentence is included in a summary. \section{Background: Neural Summarization} Throughout this paper, we consider a set of pairs of texts $(\mathcal{X}, \mathcal{Y})$ where $x \in \mathcal{X}$ corresponds to source tokens $x_1, \ldots, x_n$ and $y \in \mathcal{Y}$ to a summary $y_1, \ldots, y_m$ with $m \ll n$. Abstractive summaries are generated one word at a time. At every time-step, a model is aware of the previously generated words. The problem is to learn a function $f(x)$ parametrized by $\theta$ that maximizes the probability of generating the correct sequences. Following previous work, we model the abstractive summarization with an attentional sequence-to-sequence model. The attention distribution $p(a_j|x,y_{1:j-1})$ for a decoding step $j$, calculated within the neural network, represents an embedded soft distribution over all of the source tokens and can be interpreted as the current focus of the model. The model additionally has a copy mechanism~\citep{vinyals2015pointer} to copy words from the source. Copy models extend the decoder by predicting a binary soft switch $z_j$ that determines whether the model copies or generates. The copy distribution is a probability distribution over the source text, and the joint distribution is computed as a convex combination of the two parts of the model, \begin{align} \label{eq:copy} \begin{split} & p(y_j\ |\ y_{1:j\text{-}1}, x) = \\ &\ p(z_j~\texttt{=}~1\ |\ y_{1:j\text{-}1}, x) \times p(y_j\ |\ z_j~\texttt{=}~1, y_{1:j\text{-}1}, x) + \\ & \ p(z_j~\texttt{=}~0\ |\ y_{1:j\text{-}1}, x) \times p(y_j\ |\ z_j~\texttt{=}~0,y_{1:j\text{-}1}, x) \end{split} \end{align} \noindent where the two parts represent copy and generation distribution respectively. Following the \emph{pointer-generator} model of \citet{see2017get}, we reuse the attention $p(a_j|x,y_{1:j-1})$ distribution as copy distribution, i.e. the copy probability of a token in the source $w$ through the copy attention is computed as the sum of attention towards all occurrences of $w$. During training, we maximize marginal likelihood with the latent switch variable. \begin{figure}[t] \centering \includegraphics[width=.45\textwidth]{figs/bottom-up-attention-model} \caption{Overview of the selection and generation processes described throughout Section~\ref{sec:bua}.} \label{fig:bua} \end{figure} \section{Bottom-Up Attention} \label{sec:bua} We next consider techniques for incorporating a content selection into abstractive summarization, illustrated in Figure~\ref{fig:bua}. \subsection{Content Selection} \label{sec:content} We define the content selection problem as a word-level extractive summarization task. While there has been significant work on custom extractive summarization (see related work), we make a simplifying assumption and treat it as a sequence tagging problem. Let $t_1, \ldots, t_n$ denote binary tags for each of the source tokens, i.e. $1$ if a word is copied in the target sequence and 0 otherwise. While there is no supervised data for this task, we can generate training data by aligning the summaries to the document. We define a word $x_i$ as copied if (1) it is part of the longest possible subsequence of tokens $s = x_{i-j:i:i+k}$, for integers $j \leq i; k \leq (n-i)$, if $s \in x $ and $s \in y$, and (2) there exists no earlier sequence $u$ with $s = u$. We use a standard bidirectional LSTM model trained with maximum likelihood for the sequence labeling problem. Recent results have shown that better word representations can lead to significantly improved performance in sequence tagging tasks~\citep{peters2017semi}. Therefore, we first map each token $w_i$ into two embedding channels $e_i^{\textrm{(w)}}$ and $e_i^{\textrm{(c)}}$. The $e^{\textrm{(w)}}$ embedding represents a static channel of pre-trained word embeddings, e.g. GLoVE \citep{pennington2014glove}. The $e^{\textrm{(c)}}$ are contextual embeddings from a pretrained language model, e.g. ELMo \citep{peters2018deep} which uses a character-aware token embedding~\citep{kim2016character} followed by two bidirectional LSTM layers $h^{(1)}_{i}$ and $h^{(2)}_{i}$. The contextual embeddings are fine-tuned to learn a task-specific embedding $e_i^{\textrm{(c)}}$ as a linear combination of the states of each LSTM layer and the token embedding, \[ e^{\textrm{(c)}}_i = \gamma \times \sum_{\ell=0}^2 s_j \times h_{i}^{(\ell)}, \] \noindent with $\gamma$ and $s_{0,1,2}$ as trainable parameters. Since these embeddings only add four additional parameters to the tagger, it remains very data-efficient despite the high-dimensional embedding space. Both embeddings are concatenated into a single vector that is used as input to a bidirectional LSTM, which computes a representation $h_i$ for a word $w_i$. We can then calculate the probability $q_i$ that the word is selected as $\sigma(W_sh_i + b_s)$ with trainable parameters $W_s$ and $b_s$. \subsection{Bottom-Up Copy Attention} \label{sec:rest} Inspired by work in bottom-up attention for images~\citep{anderson2017bottom} which restricts attention to predetermined bounding boxes within an image, we use these attention masks to limit the available selection of the pointer-generator model. As shown in Figure~\ref{fig:ex}, a common mistake made by neural copy models is copying very long sequences or even whole sentences. In the baseline model, over 50\% of copied tokens are part of copy sequences that are longer than 10 tokens, whereas this number is only 10\% for reference summaries. While bottom-up attention could also be used to modify the source encoder representations, we found that a standard encoder over the full text was effective at aggregation and therefore limit the bottom-up step to attention masking. Concretely, we first train a pointer-generator model on the full dataset as well as the content selector defined above. At inference time, to generate the mask, the content selector computes selection probabilities $q_{1:n}$ for each token in a source document. The selection probabilities are used to modify the copy attention distribution to only include tokens identified by the selector. Let $a_j^i$ denote the attention at decoding step $j$ to encoder word $i$. Given a threshold $\epsilon$, the selection is applied as a hard mask, such that \[ p(\tilde{a}_j^i|x, y_{1:j-1}) = \begin{cases} p(a_j^i|x, y_{1:j-1}) & q_{i} > \epsilon \\ 0 & \textrm{ow. } \end{cases} \] \noindent To ensure that Eq.~\ref{eq:copy} still yields a correct probability distribution, we first multiply $p(\tilde{a}_j|x, y_{1:j-1})$ by a normalization parameter $\lambda$ and then renormalize the distribution. The resulting normalized distribution can be used to directly replace $a$ as the new copy probabilities. \subsection{End-to-End Alternatives} Two-step \textsc{Bottom-Up} attention has the advantage of training simplicity. In theory, though, standard copy attention should be able to learn how to perform content selection as part of the end-to-end training. We consider several other end-to-end approaches for incorporating content selection into neural training. Method 1: (\textsc{Mask Only}): We first consider whether the alignment used in the bottom-up approach could help a standard summarization system. Inspired by \citet{nallapati2017summarunner}, we investigate whether aligning the summary and the source during training and fixing the gold copy attention to pick the "correct" source word is beneficial. We can think of this approach as limiting the set of possible copies to a fixed source word. Here the training is changed, but no mask is used at test time. Method 2 (\textsc{Multi-Task}): Next, we investigate whether the content selector can be trained alongside the abstractive system. We first test this hypothesis by posing summarization as a multi-task problem and training the tagger and summarization model with the same features. For this setup, we use a shared encoder for both abstractive summarization and content selection. At test time, we apply the same masking method as bottom-up attention. Method 3 (\textsc{DiffMask}): Finally we consider training the full system end-to-end with the mask during training. Here we jointly optimize both objectives, but use predicted selection probabilities to softly mask the copy attention $p(\tilde{a}_j^i|x, y_{1:j-1}) = p(a_j^i|x, y_{1:j-1}) \times q_{i}$, which leads to a fully differentiable model. This model is used with the same soft mask at test time. \section{Inference} Several authors have noted that longer-form neural generation still has significant issues with incorrect length and repeated words than in short-form problems like translation. Proposed solutions include modifying models with extensions such as a coverage mechanism~\citep{tu2016modeling,see2017get} or intra-sentence attention~ \citep{cheng2016long,paulus2017deep}. We instead stick to the theme of modifying inference, and modify the scoring function to include a length penalty $lp$ and a coverage penalty $cp$, and is defined as $s(x,y) = \log p(y|x)/lp(x) + cp(x;y)$. \textit{Length:} To encourage the generation of longer sequences, we apply length normalizations during beam search. We use the length penalty by \citet{wu2016google}, which is formulated as \[ lp(y) = \frac{(5 + |y|)^\alpha}{(5+1)^\alpha}, \] \noindent with a tunable parameter $\alpha$, where increasing $\alpha$ leads to longer summaries. We additionally set a minimum length based on the training data. \textit{Repeats:} Copy models often repeatedly attend to the same source tokens, generating the same phrase multiple times. We introduce a new summary specific coverage penalty, \[ cp(x;y) = \beta \left(-n + \sum_{i=1}^n \max \left(1.0, \sum_{j=1}^{m} a^j_i \right)\right). \] \noindent Intuitively, this penalty increases whenever the decoder directs more than 1.0 of total attention within a sequence towards a single encoded token. By selecting a sufficiently high $\beta$, this penalty blocks summaries whenever they would lead to repetitions. Additionally, we follow \citep{paulus2017deep} and restrict the beam search to never repeat trigrams. \section{Data and Experiments} We evaluate our approach on the \gls{CNNDM} corpus~\citep{hermann2015teaching,nallapati2016abstractive}, and the NYT corpus~\citep{sandhaus2008new}, which are both standard corpora for news summarization. The summaries for the \gls{CNNDM} corpus are bullet points for the articles shown on their respective websites, whereas the NYT corpus contains summaries written by library scientists. \gls{CNNDM} summaries are full sentences, with on average 66 tokens ($\sigma=26$) and 4.9 bullet points. NYT summaries are not always complete sentences and are shorter, with on average 40 tokens ($\sigma=27$) and 1.9 bullet points. Following \citet{see2017get}, we use the non-anonymized version of the \gls{CNNDM} corpus and truncate source documents to 400 tokens and the target summaries to 100 tokens in training and validation sets. For experiments with the NYT corpus, we use the preprocessing described by~\citet{paulus2017deep}, and additionally remove author information and truncate source documents to 400 tokens instead of 800. These changes lead to an average of 326 tokens per article, a decrease from the 549 tokens with 800 token truncated articles. The target (non-copy) vocabulary is limited to 50,000 tokens for all models. The content selection model uses pre-trained GloVe embeddings of size 100, and ELMo with size 1024. The bi-LSTM has two layers and a hidden size of 256. Dropout is set to 0.5, and the model is trained with Adagrad, an initial learning rate of 0.15, and an initial accumulator value of 0.1. We limit the number of training examples to 100,000 on either corpus, which only has a small impact on performance. For the jointly trained content selection models, we use the same configuration as the abstractive model. \begin{table*}[t] \centering \rowcolors{2}{}{lightgray!10} \begin{tabular}{@{}llll@{}} \toprule Method & R-1 & R-2 & R-L \\ \midrule Pointer-Generator \citep{see2017get} & 36.44 & 15.66 & 33.42 \\ Pointer-Generator + Coverage \citep{see2017get} & 39.53 & 17.28 & 36.38 \\ ML + Intra-Attention \citep{paulus2017deep} & 38.30 & 14.81 & 35.49 \\ \midrule ML + RL \citep{paulus2017deep} & 39.87 & 15.82 & 36.90 \\ Saliency + Entailment reward \citep{pasunuru2018multi} & 40.43 & 18.00 & 37.10 \\ Key information guide network \citep{li2018guiding} & 38.95 & 17.12 & 35.68 \\ Inconsistency loss \citep{hsu2018unified} & 40.68 & 17.97 & 37.13 \\ Sentence Rewriting \citep{chen2018fast} & 40.88 & 17.80 & \textbf{38.54} \\\midrule Pointer-Generator (our implementation) & 36.25 & 16.17 & 33.41 \\ Pointer-Generator + Coverage Penalty & 39.12 & 17.35 & 36.12 \\ CopyTransformer + Coverage Penalty & 39.25 & 17.54 & 36.45 \\ Pointer-Generator + Mask Only & 37.70 & 15.63 & 35.49 \\ Pointer-Generator + Multi-Task & 37.67 & 15.59 & 35.47 \\ Pointer-Generator + DiffMask & 38.45 & 16.88 & 35.81 \\ Bottom-Up Summarization & \textbf{41.22} & \textbf{18.68} & 38.34 \\ Bottom-Up Summarization (CopyTransformer) & 40.96 & 18.38 & 38.16 \\ \bottomrule \end{tabular} \caption[Caption for LOF]{Results of abstractive summarizers on the \gls{CNNDM} dataset.\protect\footnotemark ~The first section shows encoder-decoder abstractive baselines trained with cross-entropy. The second section describes reinforcement-learning based approaches. The third section presents our baselines and the attention masking methods described in this work. } \label{tab:abs} \end{table*} For the base model, we re-implemented the Pointer-Generator model as described by \citet{see2017get}. To have a comparable number of parameters to previous work, we use an encoder with 256 hidden states for both directions in the one-layer LSTM, and 512 for the one-layer decoder. The embedding size is set to 128. The model is trained with the same Adagrad configuration as the content selector. Additionally, the learning rate halves after each epoch once the validation perplexity does not decrease after an epoch. We do not use dropout and use gradient-clipping with a maximum norm of 2. We found that increasing model size or using the Transformer~\citep{vaswani2017attention} can lead to slightly improved performance, but at the cost of increased training time and parameters. We report numbers of a Transformer with copy-attention, which we denote CopyTransformer. In this model, we randomly choose one of the attention-heads as the copy-distribution, and otherwise follow the parameters of the big Transformer by \citet{vaswani2017attention}. All inference parameters are tuned on a 200 example subset of the validation set. Length penalty parameter $\alpha$ and copy mask $\epsilon$ differ across models, with $\alpha$ ranging from $0.6$ to $1.4$, and $\epsilon$ ranging from $0.1$ to $0.2$. The minimum length of the generated summary is set to 35 for \gls{CNNDM} and 6 for NYT. While the Pointer-Generator uses a beam size of 5 and does not improve with a larger beam, we found that bottom-up attention requires a larger beam size of 10. The coverage penalty parameter $\beta$ is set to 10, and the copy attention normalization parameter $\lambda$ to 2 for both approaches. We use AllenNLP~\citep{gardner2018allennlp} for the content selector, and OpenNMT-py for the abstractive models~\citep{klein2017opennmt}.\footnote{Code and reproduction instructions can be found at \url{https://github.com/sebastianGehrmann/bottom-up-summary}}. \footnotetext{These results compare on the non-anonymized version of this corpus used by \citep{see2017get}. The best results on the anonymized version are R1:41.69 R2:19.47 RL:37.92 from \citep{celikyilmaz2018deep}. We compare to their DCA model on the NYT corpus.} \section{Results} Table~\ref{tab:abs} shows our main results on the \gls{CNNDM} corpus, with abstractive models shown in the top, and bottom-up attention methods at the bottom. We first observe that using a coverage inference penalty scores the same as a full coverage mechanism, without requiring any additional model parameters or model fine-tuning. The results with the CopyTransformer and coverage penalty indicate a slight improvement across all three scores, but we observe no significant difference between Pointer-Generator and CopyTransformer with bottom-up attention. We found that none of our end-to-end models lead to improvements, indicating that it is difficult to apply the masking during training without hurting the training process. The \emph{Mask Only} model with increased supervision on the copy mechanism performs very similar to the \emph{Multi-Task} model. On the other hand, bottom-up attention leads to a major improvement across all three scores. While we would expect better content selection to primarily improve ROUGE-1, the fact all three increase hints that the fluency is not being hurt specifically. Our cross-entropy trained approach even outperforms all of the reinforcement-learning based approaches in ROUGE-1 and 2, while the highest reported ROUGE-L score by \citet{chen2018fast} falls within the 95\% confidence interval of our results. Table~\ref{tab:nytres} shows experiments with the same systems on the NYT corpus. We see that the 2 point improvement compared to the baseline Pointer-Generator maximum-likelihood approach carries over to this dataset. Here, the model outperforms the RL based model by \citet{paulus2017deep} in ROUGE-1 and 2, but not L, and is comparable to the results of \cite{celikyilmaz2018deep} except for ROUGE-L. The same can be observed when comparing ML and our Pointer-Generator. We suspect that a difference in summary lengths due to our inference parameter choices leads to this difference, but did not have access to their models or summaries to investigate this claim. This shows that a bottom-up approach achieves competitive results even to models that are trained on summary-specific objectives. \begin{table}[t] \centering \rowcolors{2}{}{lightgray!10} \begin{tabular}{@{}llll@{}} \toprule Method & R-1 & R-2 & R-L \\ \midrule \small{ML*} & 44.26 & 27.43 & 40.41 \\ \small{ML+RL*} & 47.03 & 30.72 & \textbf{43.10} \\ \small{DCA$^\dagger$} & \textbf{48.08} & 31.19 & 42.33 \\ \small{Point.Gen. + Coverage Pen.} & 45.13 & 30.13 & 39.67 \\ \small{Bottom-Up Summarization} & 47.38 & \textbf{31.23} & 41.81 \\ \bottomrule \end{tabular} \caption{Results on the NYT corpus, where we compare to RL trained models. * marks models and results by \citet{paulus2017deep}, and $^\dagger$ results by \citet{celikyilmaz2018deep}. } \label{tab:nytres} \end{table} The main benefit of bottom-up summarization seems to be from the reduction of mistakenly copied words. With the best Pointer-Generator models, the precision of copied words is 50.0\% compared to the reference. This precision increases to 52.8\%, which mostly drives the increase in R1. An independent-samples t-test shows that this improvement is statistically significant with $t\text{=}14.7$ ($p<10^{-5}$). We also observe a decrease in average sentence length of summaries from 13 to 12 words when adding content selection compared to the Pointer-Generator while holding all other inference parameters constant. \paragraph{Domain Transfer} While end-to-end training has become common, there are benefits to a two-step method. Since the content selector only needs to solve a binary tagging problem with pretrained vectors, it performs well even with very limited training data. As shown in Figure~\ref{fig:auc_increase}, with only 1,000 sentences, the model achieves an AUC of over 74. Beyond that size, the AUC of the model increases only slightly with increasing training data. To further evaluate the content selection, we consider an application to domain transfer. In this experiment, we apply the Pointer-Generator trained on \gls{CNNDM} to the NYT corpus. In addition, we train three content selectors on 1, 10, and 100 thousand sentences of the NYT set, and use these in the bottom-up summarization. The results, shown in Table~\ref{tab:nyt}, demonstrates that even a model trained on the smallest subset leads to an improvement of almost 5 points over the model without bottom-up attention. This improvement increases with the larger subsets to up to 7 points. While this approach does not reach a comparable performance to models trained directly on the NYT dataset, it still represents a significant increase over the not-augmented \gls{CNNDM} model and produces summaries that are quite readable. We show two example summaries in Appendix~\ref{app:transfer-examples}. This technique could be used for low-resource domains and for problems with limited data availability. \begin{figure}[t] \centering \includegraphics[width=.45\textwidth]{figs/auc_increase} \caption{The AUC of the content selector trained on \gls{CNNDM} with different training set sizes ranging from 1,000 to 100,000 data points.} \label{fig:auc_increase} \end{figure} \begin{table}[t] \centering \rowcolors{2}{}{lightgray!10} \begin{tabular}{@{}lllll@{}} \toprule & AUC & R-1 & R-2 & R-L \\ \midrule CNNDM & & 25.63 & 11.40 & 20.55 \\ +1k & 80.7 & 30.62 & 16.10 & 25.32 \\ +10k & 83.6 & 32.07 & 17.60 & 26.75 \\ +100k & 86.6 & 33.11 & 18.57 & 27.69 \\ \bottomrule \end{tabular} \caption{Results of the domain transfer experiment. AUC numbers are shown for content selectors. ROUGE scores represent an abstractive model trained on \gls{CNNDM} and evaluated on NYT, with additional copy constraints trained on 1/10/100k training examples of the NYT corpus. } \label{tab:nyt} \end{table} \section{Analysis and Discussion} \begin{table}[t] \centering \rowcolors{2}{}{lightgray!10} \begin{tabular}{@{}lrrrr@{}} \toprule Method & R-1 & R-2 & R-L \\ \midrule LEAD-3 & 40.1 & 17.5 & 36.3 \\ \small{NEUSUM} \citep{zhou2018neural} & 41.6 & 19.0 & 38.0 \\ Top-3 sents (Cont. Select.) & 40.7 & \textbf{18.0} & 37.0 \\ \midrule Oracle Phrase-Selector & 67.2 & 37.8 & 58.2 \\ Content Selector & \textbf{42.0} & 15.9 & \textbf{37.3} \\ \bottomrule \end{tabular} \caption{Results of extractive approaches on the CNN-DM dataset. The first section shows sentence-extractive scores. The second section first shows an oracle score if the content selector selected all the correct words according to our matching heuristic. Finally, we show results when the Content Selector extracts all phrases above a selection probability threshold.} \label{tab:ext} \end{table} \paragraph{Extractive Summary by Content Selection?} \label{sec:ext} Given that the content selector is effective in conjunction with the abstractive model, it is interesting to know whether it has learned an effective extractive summarization system on its own. Table~\ref{tab:ext} shows experiments comparing content selection to extractive baselines. The LEAD-3 baseline is a commonly used baseline in news summarization that extracts the first three sentences from an article. Top-3 shows the performance when we extract the top three sentences by average copy probability from the selector. Interestingly, with this method, only 7.1\% of the top three sentences are not within the first three, further reinforcing the strength of the LEAD-3 baseline. Our naive sentence-extractor performs slightly worse than the highest reported extractive score by \citet{zhou2018neural} that is specifically trained to score combinations of sentences. The final entry shows the performance when all the words above a threshold are extracted such that the resulting summaries are approximately the length of reference summaries. The oracle score represents the results if our model had a perfect accuracy, and shows that the content selector, while yielding competitive results, has room for further improvements in future work. This result shows that the model is quite effective at finding important words (ROUGE-1) but less effective at chaining them together (ROUGE-2). Similar to \citet{paulus2017deep}, we find that the decrease in ROUGE-2 indicates a lack of fluency and grammaticality of the generated summaries. A typical example looks like this: \begin{quote} a man food his first hamburger wrongfully for 36 years. michael hanline, 69, was convicted of murder for the shooting of truck driver jt mcgarry in 1980 on judge charges. \end{quote} \noindent This particular ungrammatical example has a ROUGE-1 of 29.3. This further highlights the benefit of the combined approach where bottom-up predictions are chained together fluently by the abstractive system. However, we also note that the abstractive system requires access to the full source document. Distillation experiments in which we tried to use the output of the content-selection as training-input to abstractive models showed a drastic decrease in model performance. \begin{table}[t] \centering \rowcolors{2}{}{lightgray!10} \begin{tabular}{@{}lrrrr@{}} \toprule Data & \%Novel &Verb&Noun&Adj\\ \midrule \small{Reference} & 14.8 &30.9&35.5&12.3 \\ \small{Vanilla S2S} & 6.6 &14.5&19.7&5.1 \\ \small{Pointer-Generator} & 2.2 &25.7&39.3&13.9 \\ \small{Bottom-Up Attention} & 0.5 &53.3&24.8&6.5 \\ \bottomrule \end{tabular} \caption{\%Novel shows the percentage of words in a summary that are not in the source document. The last three columns show the part-of-speech tag distribution of the novel words in generated summaries.} \label{tab:copy} \end{table} \paragraph{Analysis of Copying} While Pointer-Generator models have the ability to abstract in summary, the use of a copy mechanism causes the summaries to be mostly extractive. Table~\ref{tab:copy} shows that with copying the percentage of generated words that are not in the source document decreases from 6.6\% to 2.2\%, while reference summaries are much more abstractive with 14.8\% novel words. Bottom-up attention leads to a further reduction to only a half percent. However, since generated summaries are typically not longer than 40-50 words, the difference between an abstractive system with and without bottom-up attention is less than one novel word per summary. This shows that the benefit of abstractive models has been less in their ability to produce better paraphrasing but more in the ability to create fluent summaries from a mostly extractive process. Table~\ref{tab:copy} also shows the part-of-speech-tags of the novel generated words, and we can observe an interesting effect. Application of bottom-up attention leads to a sharp decrease in novel adjectives and nouns, whereas the fraction of novel words that are verbs sharply increases. When looking at the novel verbs that are being generated, we notice a very high percentage of tense or number changes, indicated by variation of the word ``say'', for example ``said'' or ``says'', while novel nouns are mostly morphological variants of words in the source. Figure~\ref{fig:copy_length} shows the length of the phrases that are being copied. While most copied phrases in the reference summaries are in groups of 1 to 5 words, the Pointer-Generator copies many very long sequences and full sentences of over 11 words. Since the content selection mask interrupts most long copy sequences, the model has to either generate the unselected words using only the generation probability or use a different word instead. While we observed both cases quite frequently in generated summaries, the fraction of very long copied phrases decreases. However, either with or without bottom-up attention, the distribution of the length of copied phrases is still quite different from the reference. \begin{figure}[t] \centering \includegraphics[width=.45\textwidth]{figs/copy_len} \caption{For all copied words, we show the distribution over the length of copied phrases they are part of. The black lines indicate the reference summaries, and the bars the summaries with and without bottom-up attention.} \label{fig:copy_length} \end{figure} \paragraph{Inference Penalty Analysis} We next analyze the effect of the inference-time loss functions. Table~\ref{tab:inference-pen} presents the marginal improvements over the simple Pointer-Generator when adding one penalty at a time. We observe that all three penalties improve all three scores, even when added on top of the other two. This further indicates that the unmodified Pointer-Generator model has already learned an appropriate representation of the abstractive summarization problem, but is limited by its ineffective content selection and inference methods. \section{Conclusion} This work presents a simple but accurate content selection model for summarization that identifies phrases within a document that are likely included in its summary. We showed that this content selector can be used for a bottom-up attention that restricts the ability of abstractive summarizers to copy words from the source. The combined bottom-up summarization system leads to improvements in ROUGE scores of over two points on both the \gls{CNNDM} and NYT corpora. A comparison to end-to-end trained methods showed that this particular problem cannot be easily solved with a single model, but instead requires fine-tuned inference restrictions. Finally, we showed that this technique, due to its data-efficiency, can be used to adjust a trained model with few data points, making it easy to transfer to a new domain. Preliminary work that investigates similar bottom-up approaches in other domains that require a content selection, such as grammar correction, or data-to-text generation, have shown some promise and will be investigated in future work. \begin{table}[t] \centering \rowcolors{2}{}{lightgray!10} \begin{tabular}{@{}lrrr@{}} \toprule Data & R-1 &R-2 &R-L\\ \midrule \small{Pointer Generator} & 36.3 &16.2 &33.4 \\ \small{+ Length Penalty} & 38.0 &16.8 &35.0 \\ \small{+ Coverage Penalty} & 38.9 &17.2 &35.9 \\ \small{+ Trigram Repeat} & 39.1 &17.4 &36.1 \\ \bottomrule \end{tabular} \caption{Results on \gls{CNNDM} when adding one inference penalty at a time.} \label{tab:inference-pen} \end{table} \section*{Acknowledgements} We would like to thank Barbara J. Grosz for helpful discussions and feedback on early stages of this work. We further thank the three anonymous reviewers. This work was supported by a Samsung Research Award. YD was funded in part by a Bloomberg Research Award. SG was funded in part by NIH grant 5R01CA204585-02. \section{Introduction} Text summarization systems aim to generate natural language summaries that compress the information in a longer text. Approaches using neural networks have shown promising results on this task with end-to-end models that encode a source document and then decode it into an abstractive summary. Current state-of-the-art neural abstractive summarization models combine extractive and abstractive techniques by using pointer-generator style models which can copy words from the source document \citep{gu2016incorporating,see2017get}. These end-to-end models produce fluent abstractive summaries but have had mixed success in content selection, i.e. deciding what to summarize, compared to fully extractive models. \begin{figure}[t!] \begin{framed} \textbf{Source Document} \small{german chancellor angela merkel \notcopied{did} not \notcopied{look} too pleased about the weather during her \notcopied{annual} easter holiday \notcopied{in italy.} as britain \notcopied{basks} in \notcopied{sunshine} and temperatures of up to 21c, mrs merkel and her husband\notcopied{, chemistry professor joachim sauer,} had to settle for a measly 12 degrees. the chancellor and her \notcopied{spouse} have been spending easter on the small island of ischia, near naples in the mediterranean for over a \notcopied{decade.} \notcopied{not so sunny:} angela merkel \notcopied{and} her husband\notcopied{, chemistry professor joachim sauer,} are spotted on their \notcopied{annual} easter trip to the island of ischia\notcopied{,} near naples\notcopied{. the} couple \notcopied{traditionally} spend their holiday at the five-star miramare spa hotel on the south of the island \notcopied{, which comes} with its own private beach \notcopied{, and balconies overlooking the} ocean \notcopied{.}...} \textbf{Reference} \small{ \setlist{nolistsep} \begin{itemize}[align=left, leftmargin=*, noitemsep] \item angela merkel and husband spotted while on italian island holiday. \\ $\ldots$ \end{itemize}} \textbf{Baseline Approach} \small{ \setlist{nolistsep} \begin{itemize}[align=left, leftmargin=*, noitemsep] \item angela merkel and her husband, chemistry professor joachim sauer, are spotted on their annual easter trip to the island of ischia, near naples. \\ $\ldots$ \end{itemize}} \textbf{Bottom-Up Summarization} \small{ \setlist{nolistsep} \begin{itemize}[align=left, leftmargin=*, noitemsep] \item angela merkel and her husband are spotted on their easter trip to the island of ischia, near naples. \\ $\ldots$ \end{itemize} } \end{framed} \caption{Example of two sentence summaries with and without bottom-up attention. The model does not allow copying of words in \notcopied{gray}, although it can generate words. With bottom-up attention, we see more explicit sentence compression, while without it whole sentences are copied verbatim.} \label{fig:ex} \vspace{-3.5mm} \end{figure} There is an appeal to end-to-end models from a modeling perspective; however, there is evidence that when summarizing people follow a two-step approach of first selecting important phrases and then paraphrasing them~\citep{anderson1988teaching,jing1999decomposition}. A similar argument has been made for image captioning. \citet{anderson2017bottom} develop a state-of-the-art model with a two-step approach that first pre-computes bounding boxes of segmented objects and then applies attention to these regions. This so-called \textit{bottom-up} attention is inspired by neuroscience research describing attention based on properties inherent to a stimulus~\citep{buschman2007top}. Motivated by this approach, we consider \textit{bottom-up} attention for neural abstractive summarization. Our approach first selects a selection mask for the source document and then constrains a standard neural model by this mask. This approach can better decide which phrases a model should include in a summary, without sacrificing the fluency advantages of neural abstractive summarizers. Furthermore, it requires much fewer data to train, which makes it more adaptable to new domains.\looseness=-1 Our full model incorporates a separate content selection system to decide on relevant aspects of the source document. We frame this selection task as a sequence-tagging problem, with the objective of identifying tokens from a document that are part of its summary. We show that a content selection model that builds on contextual word embeddings~\citep{peters2018deep} can identify correct tokens with a recall of over 60\%, and a precision of over 50\%. To incorporate bottom-up attention into abstractive summarization models, we employ masking to constrain copying words to the selected parts of the text, which produces grammatical outputs. We additionally experiment with multiple methods to incorporate similar constraints into the training process of more complex end-to-end abstractive summarization models, either through multi-task learning or through directly incorporating a fully differentiable mask. Our experiments compare bottom-up attention with several other state-of-the-art abstractive systems. Compared to our baseline models of \citet{see2017get} bottom-up attention leads to an improvement in \acrshort{ROUGE-L} score on the \gls{CNNDM} corpus from 36.4 to 38.3 while being simpler to train. We also see comparable or better results than recent reinforcement-learning based methods with our MLE trained system. Furthermore, we find that the content selection model is very data-efficient and can be trained with less than 1\% of the original training data. This provides opportunities for domain-transfer and low-resource summarization. We show that a summarization model trained on \gls{CNNDM} and evaluated on the NYT corpus can be improved by over 5 points in \acrshort{ROUGE-L} with a content selector trained on only 1,000 in-domain sentences. \section{Related Work} There is a tension in document summarization between staying close to the source document and allowing compressive or abstractive modification. Many non-neural systems take a select and compress approach. For example, \citet{dorr2003hedge} introduced a system that first extracts noun and verb phrases from the first sentence of a news article and uses an iterative shortening algorithm to compress it. Recent systems such as \citet{durrett2016learning} also learn a model to select sentences and then compress them. In contrast, recent work in neural network based data-driven extractive summarization has focused on extracting and ordering full sentences~\citep{cheng2016neural,dlikman2016using}. \citet{nallapati2016classify} use a classifier to determine whether to include a sentence and a selector that ranks the positively classified ones. These methods often over-extract, but extraction at a word level requires maintaining grammatically correct output~\citep{cheng2016neural}, which is difficult. Interestingly, key phrase extraction while ungrammatical often matches closely in content with human-generated summaries~\citep{bui2016extractive}. A third approach is neural abstractive summarization with sequence-to-sequence models \cite{sutskever2014sequence,bahdanau2014neural}. These methods have been applied to tasks such as headline generation~\citep{rush2015neural} and article summarization~\citep{nallapati2016abstractive}. \citet{chopra2016abstractive} show that attention approaches that are more specific to summarization can further improve the performance of models. \citet{gu2016incorporating} were the first to show that a copy mechanism, introduced by \citet{vinyals2015pointer}, can combine the advantages of both extractive and abstractive summarization by copying words from the source. \citet{see2017get} refine this pointer-generator approach and use an additional coverage mechanism \citep{tu2016modeling} that makes a model aware of its attention history to prevent repeated attention. Most recently, reinforcement learning (RL) approaches that optimize objectives for summarization other than maximum likelihood have been shown to further improve performance on these tasks \citep{paulus2017deep,li2018actor, celikyilmaz2018deep}. \citet{paulus2017deep} approach the coverage problem with an intra-attention in which a decoder has an attention over previously generated words. However RL-based training can be difficult to tune and slow to train. Our method does not utilize RL training, although in theory this approach can be adapted to RL methods. Several papers also explore multi-pass extractive-abstractive summarization. \citet{nallapati2017summarunner} create a new source document comprised of the important sentences from the source and then train an abstractive system. \citet{liu2018generating} describe an extractive phase that extracts full paragraphs and an abstractive one that determines their order. Finally~\citet{zeng2016efficient} introduce a mechanism that reads a source document in two passes and uses the information from the first pass to bias the second. Our method differs in that we utilize a completely abstractive model, biased with a powerful content selector. Other recent work explores alternative approaches to content selection. For example, \citet{cohan2018discourse} use a hierarchical attention to detect relevant sections in a document, \citet{li2018guiding} generate a set of keywords that is used to guide the summarization process, and \citet{pasunuru2018multi} develop a loss-function based on whether salient keywords are included in a summary. Other approaches investigate the content-selection at the sentence-level. \citet{tan2017abstractive} describe a graph-based attention to attend to one sentence at a time, \citet{chen2018fast} first extract full sentences from a document and then compress them, and \citet{hsu2018unified} modulate the attention based on how likely a sentence is included in a summary. \section{Background: Neural Summarization} Throughout this paper, we consider a set of pairs of texts $(\mathcal{X}, \mathcal{Y})$ where $x \in \mathcal{X}$ corresponds to source tokens $x_1, \ldots, x_n$ and $y \in \mathcal{Y}$ to a summary $y_1, \ldots, y_m$ with $m \ll n$. Abstractive summaries are generated one word at a time. At every time-step, a model is aware of the previously generated words. The problem is to learn a function $f(x)$ parametrized by $\theta$ that maximizes the probability of generating the correct sequences. Following previous work, we model the abstractive summarization with an attentional sequence-to-sequence model. The attention distribution $p(a_j|x,y_{1:j-1})$ for a decoding step $j$, calculated within the neural network, represents an embedded soft distribution over all of the source tokens and can be interpreted as the current focus of the model. The model additionally has a copy mechanism~\citep{vinyals2015pointer} to copy words from the source. Copy models extend the decoder by predicting a binary soft switch $z_j$ that determines whether the model copies or generates. The copy distribution is a probability distribution over the source text, and the joint distribution is computed as a convex combination of the two parts of the model, \begin{align} \label{eq:copy} \begin{split} & p(y_j\ |\ y_{1:j\text{-}1}, x) = \\ &\ p(z_j~\texttt{=}~1\ |\ y_{1:j\text{-}1}, x) \times p(y_j\ |\ z_j~\texttt{=}~1, y_{1:j\text{-}1}, x) + \\ & \ p(z_j~\texttt{=}~0\ |\ y_{1:j\text{-}1}, x) \times p(y_j\ |\ z_j~\texttt{=}~0,y_{1:j\text{-}1}, x) \end{split} \end{align} \noindent where the two parts represent copy and generation distribution respectively. Following the \emph{pointer-generator} model of \citet{see2017get}, we reuse the attention $p(a_j|x,y_{1:j-1})$ distribution as copy distribution, i.e. the copy probability of a token in the source $w$ through the copy attention is computed as the sum of attention towards all occurrences of $w$. During training, we maximize marginal likelihood with the latent switch variable. \begin{figure}[t] \centering \includegraphics[width=.45\textwidth]{figs/bottom-up-attention-model} \caption{Overview of the selection and generation processes described throughout Section~\ref{sec:bua}.} \label{fig:bua} \end{figure} \section{Bottom-Up Attention} \label{sec:bua} We next consider techniques for incorporating a content selection into abstractive summarization, illustrated in Figure~\ref{fig:bua}. \subsection{Content Selection} \label{sec:content} We define the content selection problem as a word-level extractive summarization task. While there has been significant work on custom extractive summarization (see related work), we make a simplifying assumption and treat it as a sequence tagging problem. Let $t_1, \ldots, t_n$ denote binary tags for each of the source tokens, i.e. $1$ if a word is copied in the target sequence and 0 otherwise. While there is no supervised data for this task, we can generate training data by aligning the summaries to the document. We define a word $x_i$ as copied if (1) it is part of the longest possible subsequence of tokens $s = x_{i-j:i:i+k}$, for integers $j \leq i; k \leq (n-i)$, if $s \in x $ and $s \in y$, and (2) there exists no earlier sequence $u$ with $s = u$. We use a standard bidirectional LSTM model trained with maximum likelihood for the sequence labeling problem. Recent results have shown that better word representations can lead to significantly improved performance in sequence tagging tasks~\citep{peters2017semi}. Therefore, we first map each token $w_i$ into two embedding channels $e_i^{\textrm{(w)}}$ and $e_i^{\textrm{(c)}}$. The $e^{\textrm{(w)}}$ embedding represents a static channel of pre-trained word embeddings, e.g. GLoVE \citep{pennington2014glove}. The $e^{\textrm{(c)}}$ are contextual embeddings from a pretrained language model, e.g. ELMo \citep{peters2018deep} which uses a character-aware token embedding~\citep{kim2016character} followed by two bidirectional LSTM layers $h^{(1)}_{i}$ and $h^{(2)}_{i}$. The contextual embeddings are fine-tuned to learn a task-specific embedding $e_i^{\textrm{(c)}}$ as a linear combination of the states of each LSTM layer and the token embedding, \[ e^{\textrm{(c)}}_i = \gamma \times \sum_{\ell=0}^2 s_j \times h_{i}^{(\ell)}, \] \noindent with $\gamma$ and $s_{0,1,2}$ as trainable parameters. Since these embeddings only add four additional parameters to the tagger, it remains very data-efficient despite the high-dimensional embedding space. Both embeddings are concatenated into a single vector that is used as input to a bidirectional LSTM, which computes a representation $h_i$ for a word $w_i$. We can then calculate the probability $q_i$ that the word is selected as $\sigma(W_sh_i + b_s)$ with trainable parameters $W_s$ and $b_s$. \subsection{Bottom-Up Copy Attention} \label{sec:rest} Inspired by work in bottom-up attention for images~\citep{anderson2017bottom} which restricts attention to predetermined bounding boxes within an image, we use these attention masks to limit the available selection of the pointer-generator model. As shown in Figure~\ref{fig:ex}, a common mistake made by neural copy models is copying very long sequences or even whole sentences. In the baseline model, over 50\% of copied tokens are part of copy sequences that are longer than 10 tokens, whereas this number is only 10\% for reference summaries. While bottom-up attention could also be used to modify the source encoder representations, we found that a standard encoder over the full text was effective at aggregation and therefore limit the bottom-up step to attention masking. Concretely, we first train a pointer-generator model on the full dataset as well as the content selector defined above. At inference time, to generate the mask, the content selector computes selection probabilities $q_{1:n}$ for each token in a source document. The selection probabilities are used to modify the copy attention distribution to only include tokens identified by the selector. Let $a_j^i$ denote the attention at decoding step $j$ to encoder word $i$. Given a threshold $\epsilon$, the selection is applied as a hard mask, such that \[ p(\tilde{a}_j^i|x, y_{1:j-1}) = \begin{cases} p(a_j^i|x, y_{1:j-1}) & q_{i} > \epsilon \\ 0 & \textrm{ow. } \end{cases} \] \noindent To ensure that Eq.~\ref{eq:copy} still yields a correct probability distribution, we first multiply $p(\tilde{a}_j|x, y_{1:j-1})$ by a normalization parameter $\lambda$ and then renormalize the distribution. The resulting normalized distribution can be used to directly replace $a$ as the new copy probabilities. \subsection{End-to-End Alternatives} Two-step \textsc{Bottom-Up} attention has the advantage of training simplicity. In theory, though, standard copy attention should be able to learn how to perform content selection as part of the end-to-end training. We consider several other end-to-end approaches for incorporating content selection into neural training. Method 1: (\textsc{Mask Only}): We first consider whether the alignment used in the bottom-up approach could help a standard summarization system. Inspired by \citet{nallapati2017summarunner}, we investigate whether aligning the summary and the source during training and fixing the gold copy attention to pick the "correct" source word is beneficial. We can think of this approach as limiting the set of possible copies to a fixed source word. Here the training is changed, but no mask is used at test time. Method 2 (\textsc{Multi-Task}): Next, we investigate whether the content selector can be trained alongside the abstractive system. We first test this hypothesis by posing summarization as a multi-task problem and training the tagger and summarization model with the same features. For this setup, we use a shared encoder for both abstractive summarization and content selection. At test time, we apply the same masking method as bottom-up attention. Method 3 (\textsc{DiffMask}): Finally we consider training the full system end-to-end with the mask during training. Here we jointly optimize both objectives, but use predicted selection probabilities to softly mask the copy attention $p(\tilde{a}_j^i|x, y_{1:j-1}) = p(a_j^i|x, y_{1:j-1}) \times q_{i}$, which leads to a fully differentiable model. This model is used with the same soft mask at test time. \section{Inference} Several authors have noted that longer-form neural generation still has significant issues with incorrect length and repeated words than in short-form problems like translation. Proposed solutions include modifying models with extensions such as a coverage mechanism~\citep{tu2016modeling,see2017get} or intra-sentence attention~ \citep{cheng2016long,paulus2017deep}. We instead stick to the theme of modifying inference, and modify the scoring function to include a length penalty $lp$ and a coverage penalty $cp$, and is defined as $s(x,y) = \log p(y|x)/lp(x) + cp(x;y)$. \textit{Length:} To encourage the generation of longer sequences, we apply length normalizations during beam search. We use the length penalty by \citet{wu2016google}, which is formulated as \[ lp(y) = \frac{(5 + |y|)^\alpha}{(5+1)^\alpha}, \] \noindent with a tunable parameter $\alpha$, where increasing $\alpha$ leads to longer summaries. We additionally set a minimum length based on the training data. \textit{Repeats:} Copy models often repeatedly attend to the same source tokens, generating the same phrase multiple times. We introduce a new summary specific coverage penalty, \[ cp(x;y) = \beta \left(-n + \sum_{i=1}^n \max \left(1.0, \sum_{j=1}^{m} a^j_i \right)\right). \] \noindent Intuitively, this penalty increases whenever the decoder directs more than 1.0 of total attention within a sequence towards a single encoded token. By selecting a sufficiently high $\beta$, this penalty blocks summaries whenever they would lead to repetitions. Additionally, we follow \citep{paulus2017deep} and restrict the beam search to never repeat trigrams. \section{Data and Experiments} We evaluate our approach on the \gls{CNNDM} corpus~\citep{hermann2015teaching,nallapati2016abstractive}, and the NYT corpus~\citep{sandhaus2008new}, which are both standard corpora for news summarization. The summaries for the \gls{CNNDM} corpus are bullet points for the articles shown on their respective websites, whereas the NYT corpus contains summaries written by library scientists. \gls{CNNDM} summaries are full sentences, with on average 66 tokens ($\sigma=26$) and 4.9 bullet points. NYT summaries are not always complete sentences and are shorter, with on average 40 tokens ($\sigma=27$) and 1.9 bullet points. Following \citet{see2017get}, we use the non-anonymized version of the \gls{CNNDM} corpus and truncate source documents to 400 tokens and the target summaries to 100 tokens in training and validation sets. For experiments with the NYT corpus, we use the preprocessing described by~\citet{paulus2017deep}, and additionally remove author information and truncate source documents to 400 tokens instead of 800. These changes lead to an average of 326 tokens per article, a decrease from the 549 tokens with 800 token truncated articles. The target (non-copy) vocabulary is limited to 50,000 tokens for all models. The content selection model uses pre-trained GloVe embeddings of size 100, and ELMo with size 1024. The bi-LSTM has two layers and a hidden size of 256. Dropout is set to 0.5, and the model is trained with Adagrad, an initial learning rate of 0.15, and an initial accumulator value of 0.1. We limit the number of training examples to 100,000 on either corpus, which only has a small impact on performance. For the jointly trained content selection models, we use the same configuration as the abstractive model. \begin{table*}[t] \centering \rowcolors{2}{}{lightgray!10} \begin{tabular}{@{}llll@{}} \toprule Method & R-1 & R-2 & R-L \\ \midrule Pointer-Generator \citep{see2017get} & 36.44 & 15.66 & 33.42 \\ Pointer-Generator + Coverage \citep{see2017get} & 39.53 & 17.28 & 36.38 \\ ML + Intra-Attention \citep{paulus2017deep} & 38.30 & 14.81 & 35.49 \\ \midrule ML + RL \citep{paulus2017deep} & 39.87 & 15.82 & 36.90 \\ Saliency + Entailment reward \citep{pasunuru2018multi} & 40.43 & 18.00 & 37.10 \\ Key information guide network \citep{li2018guiding} & 38.95 & 17.12 & 35.68 \\ Inconsistency loss \citep{hsu2018unified} & 40.68 & 17.97 & 37.13 \\ Sentence Rewriting \citep{chen2018fast} & 40.88 & 17.80 & \textbf{38.54} \\\midrule Pointer-Generator (our implementation) & 36.25 & 16.17 & 33.41 \\ Pointer-Generator + Coverage Penalty & 39.12 & 17.35 & 36.12 \\ CopyTransformer + Coverage Penalty & 39.25 & 17.54 & 36.45 \\ Pointer-Generator + Mask Only & 37.70 & 15.63 & 35.49 \\ Pointer-Generator + Multi-Task & 37.67 & 15.59 & 35.47 \\ Pointer-Generator + DiffMask & 38.45 & 16.88 & 35.81 \\ Bottom-Up Summarization & \textbf{41.22} & \textbf{18.68} & 38.34 \\ Bottom-Up Summarization (CopyTransformer) & 40.96 & 18.38 & 38.16 \\ \bottomrule \end{tabular} \caption[Caption for LOF]{Results of abstractive summarizers on the \gls{CNNDM} dataset.\protect\footnotemark ~The first section shows encoder-decoder abstractive baselines trained with cross-entropy. The second section describes reinforcement-learning based approaches. The third section presents our baselines and the attention masking methods described in this work. } \label{tab:abs} \end{table*} For the base model, we re-implemented the Pointer-Generator model as described by \citet{see2017get}. To have a comparable number of parameters to previous work, we use an encoder with 256 hidden states for both directions in the one-layer LSTM, and 512 for the one-layer decoder. The embedding size is set to 128. The model is trained with the same Adagrad configuration as the content selector. Additionally, the learning rate halves after each epoch once the validation perplexity does not decrease after an epoch. We do not use dropout and use gradient-clipping with a maximum norm of 2. We found that increasing model size or using the Transformer~\citep{vaswani2017attention} can lead to slightly improved performance, but at the cost of increased training time and parameters. We report numbers of a Transformer with copy-attention, which we denote CopyTransformer. In this model, we randomly choose one of the attention-heads as the copy-distribution, and otherwise follow the parameters of the big Transformer by \citet{vaswani2017attention}. All inference parameters are tuned on a 200 example subset of the validation set. Length penalty parameter $\alpha$ and copy mask $\epsilon$ differ across models, with $\alpha$ ranging from $0.6$ to $1.4$, and $\epsilon$ ranging from $0.1$ to $0.2$. The minimum length of the generated summary is set to 35 for \gls{CNNDM} and 6 for NYT. While the Pointer-Generator uses a beam size of 5 and does not improve with a larger beam, we found that bottom-up attention requires a larger beam size of 10. The coverage penalty parameter $\beta$ is set to 10, and the copy attention normalization parameter $\lambda$ to 2 for both approaches. We use AllenNLP~\citep{gardner2018allennlp} for the content selector, and OpenNMT-py for the abstractive models~\citep{klein2017opennmt}.\footnote{Code and reproduction instructions can be found at \url{https://github.com/sebastianGehrmann/bottom-up-summary}}. \footnotetext{These results compare on the non-anonymized version of this corpus used by \citep{see2017get}. The best results on the anonymized version are R1:41.69 R2:19.47 RL:37.92 from \citep{celikyilmaz2018deep}. We compare to their DCA model on the NYT corpus.} \section{Results} Table~\ref{tab:abs} shows our main results on the \gls{CNNDM} corpus, with abstractive models shown in the top, and bottom-up attention methods at the bottom. We first observe that using a coverage inference penalty scores the same as a full coverage mechanism, without requiring any additional model parameters or model fine-tuning. The results with the CopyTransformer and coverage penalty indicate a slight improvement across all three scores, but we observe no significant difference between Pointer-Generator and CopyTransformer with bottom-up attention. We found that none of our end-to-end models lead to improvements, indicating that it is difficult to apply the masking during training without hurting the training process. The \emph{Mask Only} model with increased supervision on the copy mechanism performs very similar to the \emph{Multi-Task} model. On the other hand, bottom-up attention leads to a major improvement across all three scores. While we would expect better content selection to primarily improve ROUGE-1, the fact all three increase hints that the fluency is not being hurt specifically. Our cross-entropy trained approach even outperforms all of the reinforcement-learning based approaches in ROUGE-1 and 2, while the highest reported ROUGE-L score by \citet{chen2018fast} falls within the 95\% confidence interval of our results. Table~\ref{tab:nytres} shows experiments with the same systems on the NYT corpus. We see that the 2 point improvement compared to the baseline Pointer-Generator maximum-likelihood approach carries over to this dataset. Here, the model outperforms the RL based model by \citet{paulus2017deep} in ROUGE-1 and 2, but not L, and is comparable to the results of \cite{celikyilmaz2018deep} except for ROUGE-L. The same can be observed when comparing ML and our Pointer-Generator. We suspect that a difference in summary lengths due to our inference parameter choices leads to this difference, but did not have access to their models or summaries to investigate this claim. This shows that a bottom-up approach achieves competitive results even to models that are trained on summary-specific objectives. \begin{table}[t] \centering \rowcolors{2}{}{lightgray!10} \begin{tabular}{@{}llll@{}} \toprule Method & R-1 & R-2 & R-L \\ \midrule \small{ML*} & 44.26 & 27.43 & 40.41 \\ \small{ML+RL*} & 47.03 & 30.72 & \textbf{43.10} \\ \small{DCA$^\dagger$} & \textbf{48.08} & 31.19 & 42.33 \\ \small{Point.Gen. + Coverage Pen.} & 45.13 & 30.13 & 39.67 \\ \small{Bottom-Up Summarization} & 47.38 & \textbf{31.23} & 41.81 \\ \bottomrule \end{tabular} \caption{Results on the NYT corpus, where we compare to RL trained models. * marks models and results by \citet{paulus2017deep}, and $^\dagger$ results by \citet{celikyilmaz2018deep}. } \label{tab:nytres} \end{table} The main benefit of bottom-up summarization seems to be from the reduction of mistakenly copied words. With the best Pointer-Generator models, the precision of copied words is 50.0\% compared to the reference. This precision increases to 52.8\%, which mostly drives the increase in R1. An independent-samples t-test shows that this improvement is statistically significant with $t\text{=}14.7$ ($p<10^{-5}$). We also observe a decrease in average sentence length of summaries from 13 to 12 words when adding content selection compared to the Pointer-Generator while holding all other inference parameters constant. \paragraph{Domain Transfer} While end-to-end training has become common, there are benefits to a two-step method. Since the content selector only needs to solve a binary tagging problem with pretrained vectors, it performs well even with very limited training data. As shown in Figure~\ref{fig:auc_increase}, with only 1,000 sentences, the model achieves an AUC of over 74. Beyond that size, the AUC of the model increases only slightly with increasing training data. To further evaluate the content selection, we consider an application to domain transfer. In this experiment, we apply the Pointer-Generator trained on \gls{CNNDM} to the NYT corpus. In addition, we train three content selectors on 1, 10, and 100 thousand sentences of the NYT set, and use these in the bottom-up summarization. The results, shown in Table~\ref{tab:nyt}, demonstrates that even a model trained on the smallest subset leads to an improvement of almost 5 points over the model without bottom-up attention. This improvement increases with the larger subsets to up to 7 points. While this approach does not reach a comparable performance to models trained directly on the NYT dataset, it still represents a significant increase over the not-augmented \gls{CNNDM} model and produces summaries that are quite readable. We show two example summaries in Appendix~\ref{app:transfer-examples}. This technique could be used for low-resource domains and for problems with limited data availability. \begin{figure}[t] \centering \includegraphics[width=.45\textwidth]{figs/auc_increase} \caption{The AUC of the content selector trained on \gls{CNNDM} with different training set sizes ranging from 1,000 to 100,000 data points.} \label{fig:auc_increase} \end{figure} \begin{table}[t] \centering \rowcolors{2}{}{lightgray!10} \begin{tabular}{@{}lllll@{}} \toprule & AUC & R-1 & R-2 & R-L \\ \midrule CNNDM & & 25.63 & 11.40 & 20.55 \\ +1k & 80.7 & 30.62 & 16.10 & 25.32 \\ +10k & 83.6 & 32.07 & 17.60 & 26.75 \\ +100k & 86.6 & 33.11 & 18.57 & 27.69 \\ \bottomrule \end{tabular} \caption{Results of the domain transfer experiment. AUC numbers are shown for content selectors. ROUGE scores represent an abstractive model trained on \gls{CNNDM} and evaluated on NYT, with additional copy constraints trained on 1/10/100k training examples of the NYT corpus. } \label{tab:nyt} \end{table} \section{Analysis and Discussion} \begin{table}[t] \centering \rowcolors{2}{}{lightgray!10} \begin{tabular}{@{}lrrrr@{}} \toprule Method & R-1 & R-2 & R-L \\ \midrule LEAD-3 & 40.1 & 17.5 & 36.3 \\ \small{NEUSUM} \citep{zhou2018neural} & 41.6 & 19.0 & 38.0 \\ Top-3 sents (Cont. Select.) & 40.7 & \textbf{18.0} & 37.0 \\ \midrule Oracle Phrase-Selector & 67.2 & 37.8 & 58.2 \\ Content Selector & \textbf{42.0} & 15.9 & \textbf{37.3} \\ \bottomrule \end{tabular} \caption{Results of extractive approaches on the CNN-DM dataset. The first section shows sentence-extractive scores. The second section first shows an oracle score if the content selector selected all the correct words according to our matching heuristic. Finally, we show results when the Content Selector extracts all phrases above a selection probability threshold.} \label{tab:ext} \end{table} \paragraph{Extractive Summary by Content Selection?} \label{sec:ext} Given that the content selector is effective in conjunction with the abstractive model, it is interesting to know whether it has learned an effective extractive summarization system on its own. Table~\ref{tab:ext} shows experiments comparing content selection to extractive baselines. The LEAD-3 baseline is a commonly used baseline in news summarization that extracts the first three sentences from an article. Top-3 shows the performance when we extract the top three sentences by average copy probability from the selector. Interestingly, with this method, only 7.1\% of the top three sentences are not within the first three, further reinforcing the strength of the LEAD-3 baseline. Our naive sentence-extractor performs slightly worse than the highest reported extractive score by \citet{zhou2018neural} that is specifically trained to score combinations of sentences. The final entry shows the performance when all the words above a threshold are extracted such that the resulting summaries are approximately the length of reference summaries. The oracle score represents the results if our model had a perfect accuracy, and shows that the content selector, while yielding competitive results, has room for further improvements in future work. This result shows that the model is quite effective at finding important words (ROUGE-1) but less effective at chaining them together (ROUGE-2). Similar to \citet{paulus2017deep}, we find that the decrease in ROUGE-2 indicates a lack of fluency and grammaticality of the generated summaries. A typical example looks like this: \begin{quote} a man food his first hamburger wrongfully for 36 years. michael hanline, 69, was convicted of murder for the shooting of truck driver jt mcgarry in 1980 on judge charges. \end{quote} \noindent This particular ungrammatical example has a ROUGE-1 of 29.3. This further highlights the benefit of the combined approach where bottom-up predictions are chained together fluently by the abstractive system. However, we also note that the abstractive system requires access to the full source document. Distillation experiments in which we tried to use the output of the content-selection as training-input to abstractive models showed a drastic decrease in model performance. \begin{table}[t] \centering \rowcolors{2}{}{lightgray!10} \begin{tabular}{@{}lrrrr@{}} \toprule Data & \%Novel &Verb&Noun&Adj\\ \midrule \small{Reference} & 14.8 &30.9&35.5&12.3 \\ \small{Vanilla S2S} & 6.6 &14.5&19.7&5.1 \\ \small{Pointer-Generator} & 2.2 &25.7&39.3&13.9 \\ \small{Bottom-Up Attention} & 0.5 &53.3&24.8&6.5 \\ \bottomrule \end{tabular} \caption{\%Novel shows the percentage of words in a summary that are not in the source document. The last three columns show the part-of-speech tag distribution of the novel words in generated summaries.} \label{tab:copy} \end{table} \paragraph{Analysis of Copying} While Pointer-Generator models have the ability to abstract in summary, the use of a copy mechanism causes the summaries to be mostly extractive. Table~\ref{tab:copy} shows that with copying the percentage of generated words that are not in the source document decreases from 6.6\% to 2.2\%, while reference summaries are much more abstractive with 14.8\% novel words. Bottom-up attention leads to a further reduction to only a half percent. However, since generated summaries are typically not longer than 40-50 words, the difference between an abstractive system with and without bottom-up attention is less than one novel word per summary. This shows that the benefit of abstractive models has been less in their ability to produce better paraphrasing but more in the ability to create fluent summaries from a mostly extractive process. Table~\ref{tab:copy} also shows the part-of-speech-tags of the novel generated words, and we can observe an interesting effect. Application of bottom-up attention leads to a sharp decrease in novel adjectives and nouns, whereas the fraction of novel words that are verbs sharply increases. When looking at the novel verbs that are being generated, we notice a very high percentage of tense or number changes, indicated by variation of the word ``say'', for example ``said'' or ``says'', while novel nouns are mostly morphological variants of words in the source. Figure~\ref{fig:copy_length} shows the length of the phrases that are being copied. While most copied phrases in the reference summaries are in groups of 1 to 5 words, the Pointer-Generator copies many very long sequences and full sentences of over 11 words. Since the content selection mask interrupts most long copy sequences, the model has to either generate the unselected words using only the generation probability or use a different word instead. While we observed both cases quite frequently in generated summaries, the fraction of very long copied phrases decreases. However, either with or without bottom-up attention, the distribution of the length of copied phrases is still quite different from the reference. \begin{figure}[t] \centering \includegraphics[width=.45\textwidth]{figs/copy_len} \caption{For all copied words, we show the distribution over the length of copied phrases they are part of. The black lines indicate the reference summaries, and the bars the summaries with and without bottom-up attention.} \label{fig:copy_length} \end{figure} \paragraph{Inference Penalty Analysis} We next analyze the effect of the inference-time loss functions. Table~\ref{tab:inference-pen} presents the marginal improvements over the simple Pointer-Generator when adding one penalty at a time. We observe that all three penalties improve all three scores, even when added on top of the other two. This further indicates that the unmodified Pointer-Generator model has already learned an appropriate representation of the abstractive summarization problem, but is limited by its ineffective content selection and inference methods. \section{Conclusion} This work presents a simple but accurate content selection model for summarization that identifies phrases within a document that are likely included in its summary. We showed that this content selector can be used for a bottom-up attention that restricts the ability of abstractive summarizers to copy words from the source. The combined bottom-up summarization system leads to improvements in ROUGE scores of over two points on both the \gls{CNNDM} and NYT corpora. A comparison to end-to-end trained methods showed that this particular problem cannot be easily solved with a single model, but instead requires fine-tuned inference restrictions. Finally, we showed that this technique, due to its data-efficiency, can be used to adjust a trained model with few data points, making it easy to transfer to a new domain. Preliminary work that investigates similar bottom-up approaches in other domains that require a content selection, such as grammar correction, or data-to-text generation, have shown some promise and will be investigated in future work. \begin{table}[t] \centering \rowcolors{2}{}{lightgray!10} \begin{tabular}{@{}lrrr@{}} \toprule Data & R-1 &R-2 &R-L\\ \midrule \small{Pointer Generator} & 36.3 &16.2 &33.4 \\ \small{+ Length Penalty} & 38.0 &16.8 &35.0 \\ \small{+ Coverage Penalty} & 38.9 &17.2 &35.9 \\ \small{+ Trigram Repeat} & 39.1 &17.4 &36.1 \\ \bottomrule \end{tabular} \caption{Results on \gls{CNNDM} when adding one inference penalty at a time.} \label{tab:inference-pen} \end{table} \section*{Acknowledgements} We would like to thank Barbara J. Grosz for helpful discussions and feedback on early stages of this work. We further thank the three anonymous reviewers. This work was supported by a Samsung Research Award. YD was funded in part by a Bloomberg Research Award. SG was funded in part by NIH grant 5R01CA204585-02.
\section{Introduction} The Croatian Physical Society organizes the annual Summer school for young physicists [1], intended to reward elementary and high school students for their accomplishments on the national physics competitions. The schools typically consists of half-day lectures combined with workshops, experiments or games that take place during leisure hours. For the last three editions of the summer schools, we developed a variant of the popular game "Pictionary" as a small competition for the students. ``Physionary'', as we named the variant, has proven to be very successful in entertaining the students, not only during the evenings intended for the competition, but also during the rest of leisure time. \section{Game description} ``Physionary'' is a game loosely derived and expanded from the commercially-distributed ``Pictionary''. A similar game was developed earlier for University biology students [2], however, we expanded further on the game since we found it beneficial to do so. The students are divided into groups based on their age and are given a number of cards, each containing 6 terms from elementary or high school physics. The terms are taken from indices of physics curricula or physics manuals and divided into 5 sets of cards, one for each high school grade and one for elementary school grades. A dice is thrown to randomly select the ordinal number of the term on the card. A one minute timer is started and one of the students from each group is required to draw the term found on his/her card, while the rest of the group has to guess what term it is. If the team accomplishes this within the given time allotment, they receive a point. Several rounds are played this way before the pace of the game is then made faster by decreasing the available time for drawing. After a predetermined number of rounds played in this manner, the second phase of the game begins. In this phase, the students don't draw the terms but instead try to ``act out'' the term given on their cards, as it is usually done in charades. This is also done within a given time allotment, typically set to a minute. This game turned out not to be only entertaining, but also highly educational. Sometimes, a specific term may not be recognized by some of the members of a certain group. However, we noticed that the said term is quickly taken in by those members, as evidenced by their future recognition of that, as well as similar terms. Once the students start to communicate concepts pictorially, they move from their definitions and try to use everyday examples to convey them to their group. We have also noticed that a sense of connection between various terms is formed, since the students find it beneficial to explain a new term with the help of terms that they have already drawn on paper - they simply circle the term that was already guessed by the group. Finally, the students were often found drawing graphs and diagrams, which is a skill they need to develop in physics, but are often not motivated to do so. \begin{wrapfigure}[16]{r}{0.3\textwidth} \begin{center} \includegraphics[width=0.28\textwidth]{pictionary.png} \end{center} \caption{An example of a playing card.} \end{wrapfigure} \section{Conclusion} We have expanded on the known popular party games to create an effective and entertaining physics learning tool. The skills developed during game play seem to be beneficial to the students and the terms they are required to draw or act out are taken from their curricula. The students seem to develop another important skill during the game - using simple physical concepts in everyday situations, which is a skill they are most often found lacking. In what follows, we present a selection of 10 terms (out of 850) from each of the 5 sets of cards. We have limited the selection to 10 terms since we expect that different countries will have differing curricula, so we thought it best that everyone interested made their own sets of cards. \section*{References} [1] http://www.hfd.hr/ljetna\_skola/\newline [2] Kathleen A. Parson, John S. Miles, ``Bio-Pictionary -- a scientific party game which helps to develop pictorial communication skills'', Journal of Biological Education, 28:1, 17-18, DOI:10.1080/00219266.1994.9655358 \newpage \begin{center} \begin {table}[H] \begin{tabular}{ |c|c|c|c|c| } \hline \bf elementary & \bf 1st grade &\bf 2nd grade &\bf 3rd grade &\bf 4th grade \\ \hline heat insulator & joule & diffusion & diffraction & plasma \\ surface area & frequency & capacitor & rainbow & atom \\ power & dynamics & inductivity & standing wave & antiparticle \\ mass & buoyancy & linear expansion & intensity & semiconductor \\ sliding friction & unit & Lorentz force & sound & fractal \\ Solar energy & fluid & work & rotation & boson \\ pulley & projectile motion & ideal gas & length contraction & red giant \\ molecule & cosmic speed & insulator & phase & mass defect \\ cavity & energy & interaction & lens & butterfly effect \\ electricity & Galileo & isobar & light guide & quark \\ \hline \end{tabular} \caption {A sample from the terms given on the ``Physionary'' cards, sorted in 5 classes according to students' grade.} \label{tab:title} \end {table} \end{center} \end{document}
\section{Introduction} The coupling of spontaneous electric, magnetic, and elastic orders within single-phase materials, known as multiferroics, could provide a platform for a new generation of memory devices combining non-volatile storage with efficient switching mechanisms~\cite{cheong2007multiferroics, khomskii2009trend, fiebig2016evolution}.This unique technological promise can only be fulfilled by achieving an exquisite control over \emph{multiferroic domains}, which form as a direct consequence of spontaneous symmetry breaking. Furthermore, from an experimental perspective the intrinsic properties of a prototypical device can be obscured by the presence of multiple domains, and would ideally be demonstrated within a single-domain architecture. Although exploiting particular combinations of domains can be advantageous~\cite{martin2008nanoscale, seidel2009conduction, heron2011electric}, their population and the exact location of the domain boundaries must be controlled with great precision to realise the full potential of multiferroic materials. A classic illustration of this challenge is provided by \ce{BiFeO3} (BFO), one of the most studied multiferroics ~\cite{sando2014bifeo3}. At room temperature, BFO is at the same time ferroelectric, ferroelastic and antiferromagnetic (cycloidal)~\cite{kubel1990structure, sosnowska1982spiral}. Below the ferroelectric phase transition $T_\mathrm{C} \sim \SI{1100}{\kelvin}$, BFO has a polar R3c perovskite structure with a rhombohedral distortion along the (pseudocubic) $[111]_\mathrm{pc}$ direction~\cite{michel1969atomic}. This allows for four possible ferroelastic domains, (labelled r$_{\text{1--4}}$ according to the notation of Streiffer \emph{et al.}~\cite{streiffer1998domain}), each corresponding to the distortion being along each of the $\langle 111\rangle_\mathrm{pc}$ pseudocubic body diagonals, as shown in \cref{fig:characterisation}(a). Within each of these ferroelastic domains, there are two possible ferroelectric domains, r$_i^+$ and r$_i^-$, with the polarisation $\mathbf{P}$ along the $\pm [111]_\mathrm{pc}$ directions~\cite{zavaliche2006multiferroic}. Magnetic ordering occurs below $T_\mathrm{N} \sim \SI{640}{\kelvin}$, where the \ce{Fe} spins order with a long-period cycloidal magnetic structure. This breaks three-fold rotational symmetry and, for each ferroelectric domain, results in three symmetry equivalent $\mathbf{k}$ domains, with magnetic propagation vectors $\mathbf{k}_1 = (\delta, \delta, 0)_\mathrm{h}$, $\mathbf{k}_2 = (\delta, -2 \delta, 0)_\mathrm{h}$, and $\mathbf{k}_3 = (-2\delta, \delta, 0)_\mathrm{h}$, where the subscript $\mathrm{h}$ denotes the hexagonal setting and $\delta \sim 0.0045$ at room-temperature in the bulk~\cite{sosnowska1982spiral}. In fact, it has been recently reported that the structure of both bulk~\cite{sosnowska2012monoclinic} and thin film~\cite{waterfieldprice2016coherent, kan2010effect} BFO is monoclinic with broken three-fold symmetry. In this case, these monoclinic domains are coupled one-to-one to the magnetic $\mathbf{k}$-domains, resulting in three possible \emph{magnetostructural} domains. Each of these magnetostructural domains can support two possible directions of the magnetic polarity $\boldsymbol{\lambda}$, which is defined as $\boldsymbol{\lambda} = \mathbf{k} \times (\mathbf{S}_i \times \mathbf{S}_j)$, where $\mathbf{S}_i$ and $\mathbf{S}_j$ are spins on adjacent sites along the direction of $\mathbf{k}$, and can be thought of as characterising the ``sense of rotation'' of the cycloidal structure. It is understood that the magnetic polarity is directly coupled to the ferroelectric polarisation via the direct Dzyaloshinskii--Moriya interaction~\cite{johnson2013x}, giving combined ferroelectric/magnetopolar domains. In summary there are: \vspace{-0.2cm} \begin{equation*} \overbrace{N_\mathrm{Ferroelastic}}^{4} \times \overbrace{N_\mathrm{Ferroelectric/Magnetopolar}}^{2} \times \overbrace{N_\mathrm{Magnetostructural}}^{3} \end{equation*} $= 24$ possible domain variants. In epitaxial films, the relative proportion of these domains can be manipulated. For instance, the ferroelastic domain populations of BFO may be tailored through certain choices of film orientation, substrate symmetry and miscut~\cite{giencke2014tailoring}. BFO films grown in the $(001)_\mathrm{pc}$ orientation on cubic \ce{SrTiO3} (STO) substrates, typically display all four ferroelastic domains. The number of ferroelastic variants can be reduced to two by growing BFO on a lower symmetry substrate, for example orthorhombic $(001)_\mathrm{pc}$-\ce{TbScO3} (TSO)~\cite{folkman2009stripe}. Alternatively, using a $(001)_\mathrm{pc}$-STO substrate miscut by \SI{4}{\degree} towards the $[100]_\mathrm{pc}$ direction favours the two ferroelastic domains with their rhombohedral distortion along the miscut direction~\cite{jang2009domain} and, similarly, a miscut towards $[110]_\mathrm{pc}$ instead results in a single ferroelastic domain~\cite{giencke2014tailoring}. A ferroelastic monodomain may also be achieved by growing a $(111)_\mathrm{pc}$-oriented film on an STO substrate, results in a single ferroelastic domain, with its rhombohedral distortion aligned with the $(111)_\mathrm{pc}$ surface-normal direction~\cite{kan2010effect}. The ferroelectric domain population can be controlled by applying an electric field or by including a metallic \ce{SrRuO3} buffer layer between the substrate and the BFO film, which screens the depoling field of the BFO and results in the electrical polarisation favouring directions with a downward component (into the film)~\cite{fong2006stabilization}. Although controlling the ferroelectric domain populations at growth is relatively straightforward, BFO-based ferroelectric devices are plagued by polarisation fatigue and electrical breakdown problems~\cite{baek2011nature}. This has been attributed to a nondeterministic, multistage switching process that causes the film to break up into multiple ferroelastic domains resulting in charged domain walls and domain pinning~\cite{zou2012mechanism}. Even though they can be grown as a ferroelectric monodomain, this issue is most pronounced in the $(111)_\mathrm{pc}$-oriented films, as this orientation preserves the intrinsic three-fold symmetry of the crystal structure, making all possible switching pathways equally likely. By contrast, antiferromagnetic domains are more difficult to manipulate, because, unlike ferromagnets and ferroelastics, antiferromagnets do not couple to a uniform conjugated field. Yet, achieving this control is crucial, because most device configurations include a ferromagnetic overlayer that is exchange-coupled to antiferromagnetic spins. Although some control of propagation vectors using electric field~\cite{lee2008single} and high magnetic fields~\cite{bordacs2018magnetic} has been demonstrated, a robust method to bias a single propagation vector has yet to be found. Previously, single-magnetic-domain BFO had only been achieved in ultrathin, $(001)_\mathrm{pc}$-oriented films grown on a \ce{NdGaO3} substrate~\cite{kuo2016single} where films above a threshold thickness of $\sim \SI{5}{\nano\metre}$ were found to revert to a multidomain state. The recent discovery of a very strong magneto-elastic coupling~\cite{waterfieldprice2016coherent} in BFO affords a potentially new ``handle'' on magnetic domains. For example, we have previously shown that $(001)_\mathrm{pc}$-BFO films on miscut STO consist of a single antiferromagnetic domain~\cite{saenrang2017deterministic}, because the propagation vector oriented in the plane of the film is favoured over the other two. By contrast, for $(111)_\mathrm{pc}$-oriented BFO films grown on STO, the high symmetry of the substrate makes magnetic domain control extremely challenging. Typical $(111)_\mathrm{pc}$-oriented BFO films consist of a mosaic of magnetoelastic domains at the sub-micron scale, in which the three magnetic domains are equally represented~\cite{waterfieldprice2016coherent}. In this Article, we demonstrate the ability to bias the growth of a given structural, ferroelastic, ferroelectric, and magnetic domain, in a \SI{1}{\micro\metre}-thick $(111)_\mathrm{pc}$-oriented BFO film by breaking three-fold symmetry with an orthorhombic TSO substrate. Remarkably, the substrate is able to bias the growth of a majority magneto-structural domain, in spite of the fact that most of the film is relaxed away from the substrate lattice parameters. After multiple switches of the ferroelectric polarisation, the majority of the sample (about \SI{80}{\percent}) remains in the same ferroelastic and magnetoelastic state, while about \SI{19}{\percent} of the sample converts to a specific alternate ferroelastic domain as a result of a more deterministic switching mechanism. Nonresonant x-ray magnetic scattering (NXMS) with polarisation analysis was employed to determine the magnetic polarity of the film and to observe its inversion after ferroelectric switching. \section{Experimental details} \SI{1}{\micro\metre}-thick epitaxial films of $(111)_\mathrm{pc}$-oriented BFO films were grown using double-gun off-axis sputtering~\cite{brewer2017uniform} onto a TSO substrate oriented with the $(110)_\mathrm{o}$ direction specular (the subscript o indicates the $Pnma$ orthorhombic setting). This direction approximates the $(111)_\mathrm{pc}$ direction of a simple perovskite, but has an in-plane anisotropy due to the orthorhombicity. The BFO layer grows such that the $\mathbf{a}_\mathrm{h}$ axis is antiparallel to the $\mathbf{c}_\mathrm{o}$ axis of the TSO substrate. Before depositing the BFO layer, a \SI{30}{\nano\metre}-thick \ce{SrRuO3} (SRO) layer was deposited on the TSO substrate by \SI{90}{\degree} off-axis sputtering. The role of this layer is twofold: firstly, it elastically biases the film to grow as a ferroelectric monodomain~\cite{fong2006stabilization}, and secondly, it acts as a bottom electrode. After the BFO was grown, $\SI{500}{\micro\metre} \times \SI{200}{\micro\metre} \times \SI{10}{\nano\metre}$ \ce{Pt} top electrodes were patterned on the film surface using photolithography. This setup allows switching of the ferroelectric polarisation under the electrodes along the $(111)_\mathrm{pc}$ direction (out-of-plane). \SI{1}{\micro\metre}-thick, $(111)_\mathrm{pc}$-oriented BFO films where similarly grown on $(111)_\mathrm{pc}$-oriented STO substrates, details of which can be found in \cite{waterfieldprice2016coherent}. The films grown both on TSO and STO substrates show excellent ferroelectric characteristics (see Supplemental Material S-III~\cite{suppl}) with remnant polarisations of $\SI{108}{\micro\coulomb\per\centi\metre}$ and $\SI{110}{\micro\coulomb\per\centi\metre}$, respectively, comparable to the highest values reported for BFO films~\cite{das2006synthesis}. \begin{figure}[!ht] \includegraphics[width=0.46\textwidth]{characterisation_figure_v3.png} \caption{\textbf{Effect of switching on ferroelastic domains of BFO/TSO.} (a) Schematic depiction of the unique $[111]_\mathrm{pc}$ axes in each of the four ferroelastic domains, shown in the pseudocubic unit cell viewed along the $\mathbf{b}^*_\mathrm{h}$ direction. The $[111]_\mathrm{pc}$ axes are labelled r$_\text{1--4}$ with the $+/-$ superscript denoting the corresponding ferroelectric domain (see text). The crystallographic relationship between the hexagonal and pseudocubic BFO unit cells and the orthorhombic TSO unit cell is indicated by the black axes. Rocking curve scans of the (b) $(111)_\mathrm{pc}$ reflection of the majority r$_1$ ferroelastic domain and (c) $(\bar{1}11)_\mathrm{pc}$, $(11\bar{1})_\mathrm{pc}$, and $(1\bar{1}1)_\mathrm{pc}$ reflections corresponding to each of the minority r$_2$, r$_3$ and r$_4$ domains, respectively. Data for the as-grown FE$\downarrow$ and switched FE$\uparrow$ states are shown by the dark circles and light triangles, respectively. Fits to the data are shown by the solid lines and the dotted light-red lines in (b) show the two peak profiles contributing to the intensity in the FE$\uparrow$ state. The reciprocal space map shown in the inset is based on laboratory data (see Supplemental Material S-I~\cite{suppl} for more details), on which we indicated the position of the scans in (b) and (c).}\label{fig:characterisation} \end{figure} The synchrotron x-ray measurements, including both the structural characterisation and nonresonant x-ray magnetic scattering (NXMS) measurements, were performed on beamline I16, Diamond Light Source (UK) using a six-circle kappa diffractometer in reflection geometry. Additional measurements were performed on a Rigaku SmartLab four-circle laboratory-based x-ray diffractometer fitted with a copper K$_\alpha$ x-ray source (see Supplemental Material S-I). For both structural characterisation and NXMS measurements, the incident synchrotron x-ray beam energy was tuned to \SI{4.9}{\kilo\electronvolt}, which is off-resonance of all chemical elements present in the sample. This energy is high enough that air scattering is minimal, while the NXMS signal can still be relatively easily separated from multiple scattering processes. Conversion of the incident x-ray polarisation from linear to circular was achieved using a \SI{100}{\micro\meter}-thick diamond quarter-wave plate. For the NXMS measurements, the scattered x-ray polarisation was determined using a pyrolytic-graphite polarisation-analyser crystal, scattering at the (004) reflection. The x-ray beam size at the sample was adjusted by means of slits from $\sim \SI{300}{\micro\metre} \times \SI{50}{\micro\metre}$ to $\sim \SI{50}{\micro\metre} \times \SI{50}{\micro\metre}$ to allow a variable area of the sample, including a small spot under the electrodes, to be illuminated. For all the NXMS measurements, we used an avalanche photodiode detector, positioned after the polarisation-analyser crystal, while the structural characterisation measurements were performed using a Pilatus photon-counting area detector. Single-crystal neutron diffraction measurements were performed on the WISH instrument at ISIS, the UK pulsed Neutron and Muon Spallation Source. The neutron beam size at the sample position was $\sim \SI{20}{\milli\metre} \times \SI{40}{\milli\metre}$, thus illuminating the entire film. All the NXMS and neutron diffraction measurements were taken at room temperature. \section{Results and Discussion} \subsection{Structural and magnetic characterisation of the unswitched sample} \begin{figure}[ht] \includegraphics[width=0.47\textwidth]{rsms_v2.png} \caption{\textbf{Magnetic x-ray and neutron diffraction reciprocal space maps of BFO/STO and BFO/TSO.} Reciprocal space maps about the $(009)_\mathrm{h}$ position measured by NXMS with linearly-polarised incident x-rays for (a) BFO/STO and (b) BFO/TSO. Reciprocal space maps about the $(003)_\mathrm{h}$ position measured by neutron diffraction for (c) BFO/STO and (d) BFO/TSO. The BFO/STO neutron data in (c) are reproduced from \cite{waterfieldprice2016coherent} and x-ray data in (a) were measured on the same sample using the method described in \cite{waterfieldprice2016coherent}. The expected positions of the magnetic satellite peaks for the two different substrates are indicated by the dashed circles. The white circle in the lower-left corner of (c) and (d) indicates the instrumental resolution of the neutron measurements (the x-ray resolution is smaller than the pixel size). Due to the lower sensitivity of the single-crystal neutron measurements to the lattice parameters, the neutron data have been scaled to the lattice parameters determined from the higher-resolution x-ray measurements. The reciprocal lattice directions (in the hexagonal setting) are indicated by the translucent black arrows. All measurements were taken at room temperature.}\label{fig:rsms} \end{figure} The ferroelastic domain population of the unswitched sample (FE$\downarrow$) was determined from reciprocal space scans measured on beamline I16, in which 2-dimensional images from the Pilatus detector were collected as a function of the rocking angle $\omega$. Intensities integrated along particular lines in reciprocal space (corresponding to rocking curves) are shown in \cref{fig:characterisation}(b, c), while corresponding 2D laboratory data are reported in Supplemental Material S-I~\cite{suppl}. The four possible ferroelastic domains are labelled r$_\text{1--4}$, as shown in \cref{fig:characterisation}(a). The r$_1$ domain has its rhombohedral axis aligned perpendicular to the film, so that the $(111)_\mathrm{pc}$ reflection is surface-normal. The $(\bar{1}11)_\mathrm{pc}$, $(\bar1\bar{1}1)_\mathrm{pc}$ and $(11\bar{1})_\mathrm{pc}$ reflections of the r$_\text{2-4}$ domains are nearby in reciprocal space but have a slightly shorter $d$-spacing and form a triangle around the $(hhh)_\mathrm{pc}$ axis of the r$_1$ domain, indicative of coherent twinning. Note that, by the geometry of the measurement, this triangle is projected into a single arc in the reciprocal space map shown in the inset of \cref{fig:characterisation}(b). Almost \SI{96}{\percent} of the sample was found to be in the r$_1$ domain, which has a narrow rocking curve (\cref{fig:characterisation}(b)) with $\Delta\omega_\mathrm{FWHM} \sim$ 0.1$^\circ$. The r$_2$ population was $\sim \SI{3.7}{\percent}$, which is significantly greater than for films grown on STO. The rocking curves of the minority domains r$_\text{2--4}$ (\cref{fig:characterisation}(c)) were somewhat broader ($\Delta\omega_\mathrm{FWHM} \sim$ 0.2$^\circ$) than for r$_1$. \begin{table}[b] \centering \caption{Ferroelastic domain fractions for the as-grown FE$\downarrow$ and switched, FE$\uparrow$ state, obtained from least-squares regression to data shown in \cref{fig:characterisation}.} \label{tab:domains} \begin{ruledtabular} \begin{tabular}{l l l l l l} & \multicolumn{5}{c}{Domain populations (\%)}\\[0.5ex] State & r$_1$ & r$_1^\prime$ & r$_2$ & r$_3$ & r$_4$ \\[0.5ex] \hline\\[-2ex] FE$\downarrow$ & 95.77(2) & - & 3.77(7) & 0.31(2) & 0.14(1) \\[0.5ex] FE$\uparrow$ & 46.73(41) & 33.61(100) & 18.12(16) & 0.77(5) & 0.76(4) \\[0.5ex] \end{tabular} \end{ruledtabular} \end{table} Next, we probed the magnetic structure of the majority (r$_1$) ferroelastic domain by NXMS and neutron diffraction. We measured the magnetic satellite reflections corresponding to the long-range incommensurate magnetic ordering, which occur near the $\mathbf{N} = (0, 0, 3(2n + 1))_\mathrm{h}$ reciprocal lattice positions at which (Thomson) charge scattering is forbidden due to the c-glide. The diffraction pattern expected from each of the magnetic $\mathbf{k}$-domains is a pair of peaks at positions $\mathbf{N}\pm\mathbf{k}_i$, where $\mathbf{k}_i$ is the propagation vector of the corresponding magnetic domain. Hence, if populations of all three magnetic domains are illuminated, one should observe a star of six satellite peaks. For $(111)_\mathrm{pc}$-oriented BFO films grown on STO, we have previously shown that these six peak merge in pairs to form a triangle of peaks, due to the presence of magnetostructural domains on a sub-micron scale~\cite{waterfieldprice2016coherent} (NXMS and neutron diffraction data from STO-grown samples are reproduced in \cref{fig:rsms}(a) and (c)). \Cref{fig:rsms}(b) shows a reciprocal space map of the TSO-grown sample measured by NXMS about the $\mathbf{N} = (009)_\mathrm{h}$ reciprocal lattice position measured in a region of the film in its as-grown `virgin' state. These data were collected using linearly-polarised incident light with $\mathbf{E}$ normal to the scattering plane whilst only detecting scattered light with $\mathbf{E}$ in the scattering plane (polarisation analyser angle of $\eta = \SI{90}{\degree}$). In sharp contrast with the BFO/STO data, we observe only a \emph{single pair of satellite peaks} at positions $\mathbf{N} \pm \mathbf{k}_2$. Therefore, in the region of the film illuminated by the x-ray spot, r$_1$ ferroelastic domains support a single magnetic domain. We repeated this measurement at several sample locations over two identically grown BFO/TSO films and obtained identical results at all positions. To further test this magnetoelastic coupling, we measured an equivalent, unswitched film using neutron diffraction, and the corresponding reciprocal space map about the $(003)_\mathrm{h}$ position is shown in \cref{fig:rsms}(d). Given that the neutron beam illuminates the entire sample, this verifies that all r$_1$ domains comprise a magnetic monodomain. Fitting a theoretical intensity calculation to both the x-ray and neutron data simultaneously yields a propagation vector of $\delta = \SI{0.0042(1)}{\per\angstrom}$. The propagation vector of the cycloidal domain is $\mathbf{k}_2$, which is aligned along the $[001]_\mathrm{o}$ direction of the TSO substrate. We also note the absence of any diffuse tails of intensity extending between the two satellite peaks and the $(009)_\mathrm{h}$ position, as is seen in $(111)_\mathrm{pc}$-oriented BFO films grown on STO substrates~\cite{waterfieldprice2016coherent}. This indicates that the magnetic structure is largely coherent throughout the film and is consistent with the hypothesis that the small domain size in the multidomain BFO/STO films is an important factor in the disorder resulting in the diffuse scattering observed in those films. Given that these films are grown as FE monodomains, one expects that the magnetic structure constitutes a monodomain not only in terms of having a single propagation vector, but also a single magnetic polarity. The magnetic polarity is further explored in \cref{sec:NXMS}. Although time-inversion/phase-slip domains may still be present, these would not affect the ability of the BFO film to exchange-couple to a ferromagnetic overlayer. \subsection{Structural and magnetic characterisation of the switched sample} Additional structural and magnetic diffraction data were collected under an electrode, which was electrically switched a single half-cycle of the ferroelectric hysteresis loop (FE$\uparrow$). Rocking curves of the four ferroelastic domains are reported in \cref{fig:characterisation}(b, c) with the same conventions as for the unswitched sample. There are two main effects to be remarked: firstly, part of the intensity is transferred from the r$_1$ to the r$_2$ domain, and, secondly, the $(111)_\mathrm{pc}$ reflection of the r$_1$ domain broadens. After switching, the r$_1$ intensity is well modelled with a sharp peak (which we continue to label r$_1$) centred at the same position, and with a similar width to the unswitched peak but approximately half the intensity, plus a broader peak, which we will refer to as r$_1^\prime$, shifted $\sim$ 0.1$^\circ$ to higher $\omega$. The presence of this broad peak indicates that a significant fraction of the sample has become misaligned with respect to the surface normal during the switching process. Both the bulk ferroelectric measurements (see Supplemental Material S-I) and the NMXS polarimetry data (see \cref{sec:NXMS}), indicate that the electric polarisation has been switched in most of the sample under the electrode. The relative ferroelastic domain populations for the unswitched and switched states are listed in \cref{tab:domains}, and we see that over half the population of the r$_1$ domain has been lost, most of which has moved into r$_1^\prime$ and r$_2$, and that domain populations of r$_3$ and r$_4$ have increased only slightly. The skewed populations of the r$_\text{2--4}$ domains after switching has important implications for the FE switching mechanism. It has been demonstrated that \SI{180}{\degree} switching in $(111)_\mathrm{pc}$-BFO films occurs via a stochastic, multi-step switching path consisting of three \SI{71}{\degree} switching events via the intermediate FE/ferroelastic states~\cite{baek2011nature}. In said study, Baek \emph{et al.} report that, after many switching cycles of $(111)_\mathrm{pc}$-BFO/STO, they observe equal populations of the three intermediate ferroelastic domains. This is consistent with the fact that three non-surface-normal BFO ferroelastic domains are symmetry equivalent by the three-fold axis of the $(111)_\mathrm{pc}$-STO substrate. In the present case, the TSO substrate has imposed a \emph{preferential switching pathway} through the r$_2$ domain. This also follows naturally from symmetry considerations, as the orientation of the r$_\text{2-4}$ domains with respect to the orthorhombic $\mathbf{c}_\mathrm{o}$ axis breaks the symmetry between r$_2$ (tilted perpendicularly to $\mathbf{c}_\mathrm{o}$) and r$_3$/r$_4$ (tilted along directions containing equal and opposite components parallel to $\mathbf{c}_\mathrm{o}$). The magnetic reflections of the switched state were found to be significantly broader (see Supplemental Material S-III), consistent with the reduced crystalline quality of the film upon switching i.e. size effects from smaller ferroelastic domains and the introduction of structural disorder. \begin{figure*}[t] \includegraphics[width=\textwidth]{eta_scans_90_fig.png} \caption{\textbf{Polarisation dependence of the NXMS intensity of the $\pm \mathbf{k}_2$ satellite peaks.} Reciprocal space scans through the $(009)_\mathrm{h} \pm \mathbf{k}_2$ peaks of a BFO/TSO film measured in the unswitched (a--c) and switched (d--f) states with incident linear horizontal (left), circular left (middle) and circular right (right) polarised x-rays, as indicated. The circles show the experimentally measured intensities and the solid lines show the results of a least-squares refinement of the scattered intensity for a single cycloidal domain. All measurements were taken at room temperature.}\label{fig:eta_scans}. \end{figure*} \subsection{NMXS polarimetry}\label{sec:NXMS} To further probe the magnetic structure of the BFO/TSO monodomain film, we measured the polarisation dependence of the magnetic scattering. Here, our approach is very similar to that employed for the STO sample~\cite{waterfieldprice2016coherent}. Using linear horizontal and left/right circular polarised incident x-rays, we measured reciprocal space scans through both $\mathbf{N} \pm \mathbf{k}_2$ magnetic satellite peaks as a function of polarisation analyser angle. These measurements are highly sensitive to both the plane of rotation and magnetic polarity of the cycloidal magnetic structure~\cite{waterfieldprice2016coherent}. A model parameterised in terms of the cycloid plane, propagation vector, magnetic polarity, a small multiple scattering peak at the $(009)_\mathrm{h}$ position, peak parameters, a (polarisation dependent) constant background and a depolarisation factor, was fit to the data (see Supplemental Material S-II~\cite{suppl} for more details). \Cref{fig:eta_scans}a-c show selected reciprocal space scans measured with a polarisation analyser angle of $\eta = \SI{90}{\degree}$, with the result of the above least-squares refinement shown as solid lines. The theoretical intensity ratio of the two diffraction peaks, for incident circularly polarised x-rays and at this polarisation analyser angle, is given by (see Supplemental Material S-II~\cite{suppl}) \begin{equation} \frac{I_\mathrm{+\mathbf{k}_2}}{I_\mathrm{-\mathbf{k}_2}} \approx \frac{1 + \beta\gamma}{1 - \beta\gamma} \label{eqn:intensity_ratio} \end{equation} where the $\gamma = +1$ or $-1$ for left-circular and right-circular polarised light, respectively. The sign of the magnetic polarity is parameterised by $\beta = -[(\boldsymbol{\lambda} \cdot \hat{\mathbf{n}})/|\boldsymbol{\lambda}|]$, where $\hat{\mathbf{n}}$ is the film surface normal. In agreement with previous studies both on bulk single crystals~\cite{johnson2013x} and films (grown on STO substrates)~\cite{waterfieldprice2017electrical}, we find experimentally that $\beta = -1$ for the FE\,$\downarrow$ state, such that the magnetic polarity is aligned antiparallel to the FE polarization. The model fits the data extremely well, with a reduced chi-squared statistic of $\chi_\nu = 1.24$ and we thus find that the data is most consistent with a cycloidal magnetic structure with spins rotating in a plane containing the $[001]_\mathrm{h}$ (out-of-plane) direction and the $\mathbf{k}_2$ (in-plane) propagation vector direction, i.e., the same magnetic structure as for the bulk \cite{sosnowska1982spiral, johnson2013x}. These scans further corroborate that the r$_1$ domain is a monodomain in the magnetic polarity, as the opposite magnetic polarity would have the opposite circular polarisation dependence. To test the response of the magnetic structure to \SI{180}{\degree} electrical switching within the majority r$_1$/r$_1^\prime$ domain~\footnote{Note that we are primarily sensitive to the r$_1$ domain, but, as can be seen from \cref{fig:characterisation}(b), there will be some finite contribution from r$_1^\prime$ scattering to the same point in reciprocal space.}, we measured the NXMS signal from regions of the film that have been switched into the FE$\uparrow$ state. \Cref{fig:eta_scans}d--f show, for a region of the film switched into the FE$\uparrow$ state, reciprocal space scans through the $\mathbf{N} \pm \mathbf{k}_2$ magnetic satellite peaks measured with incident linear horizontal, circular left, circular right polarised x-rays, respectively. It is clear that the polarisation dependence of the scattered intensity for left-/right-circular polarised x-rays is inverted between the two FE polarisation states and, as expected, the linear polarisation dependence remains the same. A simultaneous fit of the polarisation analyser scans including both the switched and unswitched data demonstrated a \SI{79(4)}{\percent} switch of the magnetic polarity from the as-grown FE$\downarrow$ state to the switched FE$\uparrow$ state. When performing an equivalent measurement on a multi-$\mathbf{k}$-domain $(111)_\mathrm{pc}$-BFO/STO film, we observed a \SI{93(1)}{\percent} switch of the magnetic polarity upon inverting the ferroelectric polarisation~\cite{waterfieldprice2017electrical}. In both cases, it is possible that the unswitched fraction is due to pinned FE$\downarrow$ domains at the SRO/BFO interface, or that some of the film relaxed back in to the FE$\downarrow$ state, and the magnitude of these effects was enhanced by the TSO substrate. \section{Conclusion} In summary, by using anisotropic epitaxial strain from an orthorhombic TSO substrate in the growth of $(111)_\mathrm{pc}$-oriented BFO films, we found that we were able to bias the growth of a majority ferroelastic domain. We then demonstrated that this ferroelastic domain supported a single magnetic cycloidal $\mathbf{k}$-domain. Using x-ray polarimetry, we were able to confirm that this magnetic domain was also of a single cycloidal magnetic polarity. As for previous samples grown on STO substrates~\cite{waterfieldprice2017electrical}, we were able to locally address a prototypical device structure and found that the magnetic polarity is inverted upon reversal of the FE polarisation. Finally, we found that, by using the orthorhombic TSO substrate, we were able to bias a preferential FE switching pathway, a critical ingredient if one is to achieve deterministic operation of a BFO-based device. \section*{Acknowledgements} The authors would like to thank Pascal Manuel for assistance with the neutron diffraction measurements. We acknowledge Diamond Light Source for time on Beam line I16 under Proposals MT15087-1 and MT17291-1. The work done at the University of Oxford (N.W.P., A.M.V., R.D.J., F.P.C., and P.G.R.) was funded by EPSRC grant No. EP/M020517/1, entitled “Oxford Quantum Materials Platform Grant.” The work at University of Wisconsin-Madison (W.S., J.S., and C.B.E) was supported by the Army Research Office through grant W911NF-13-1-0486. R.D.J. acknowledges support from a Royal Society University Research Fellowship.
\section{Introduction \& Background} \label{sec:intro} Modern vehicles rely on scores of embedded computers called electronic control units (ECUs) that control and facilitate communication of sub-systems by broadcasting messages over a few controller area network (CAN) buses. Since ECUs control most vehicle functions, adversarial manipulation of CAN signals have potentially severe consequences. CAN protocol is bereft of basic security features, e.g., encryption and authentication, and therefore vehicle CANs are exposed to exploitation. The now-mandatory OBD-II port gives direct access to CANs. In addition the proliferation of vehicle interfaces, e.g., V2X, cellular, and WiFi, increases the attack surface. Multiple researchers have demonstrated remote access to CANs \cite{checkoway2011comprehensive, miller2015remote, woo2015practical} causing life-threatening manipulations, most notably, the remote Jeep hack of Miller \& Valasek \cite{miller2015remote}. Consequently, recent research has focused on identifying CAN vulnerabilities and providing defensive capabilities. Many previous works have proposed changing CAN standards to incorporate security, e.g., \cite{szilagyi2010low, lin2012cyber, groza2013efficient}, but most are unadopted as they require costly evolution of standards and hardware. A notable exception, Brown et al.~\cite{brown2018can}, proposed message control firmware implemented in each ECU, a solution presumably cheap to retrofit. We pursue after-market, vehicle-agnostic security solutions that do not require hardware changes. Developing vehicle-agnostic solutions is especially challenging for passenger vehicles because there is no publicly available translation from in-vehicle network data to vehicle functions. Further, CAN-to-function mappings vary per model. In short, even though packets are observable, there is no existing way to automatically know what mechanisms they control. This is a primary roadblock to defending CANs and calls for data analytics approaches to pioneer vehicle-agnostic detection and prevention capabilities \cite{jaynes2016automating, moore2017modeling, moore2018data, miller2013adventures} \subsection{Related CAN IDS Work} Of the research to build intrusion detection systems (IDSs) for the currently-adopted CAN systems, there is a natural trichotomy: \begin{enumerate}[leftmargin = *] \item \textbf{Rule-based IDS:} Early works involve rule-based detectors, an analogue of signature-based detection in enterprise security. These can detect simple signal-injection attacks, (sophisticated but very limited) bus-off attacks (see Cho et al.~\cite{cho2016error}), and potentially ECU reprogramming \cite{muter2010structured, hoppe2008security, hoppe2009applying}. \item \textbf{Frequency-based IDS:} Important CAN messages are sent redundantly with fixed frequency. The next trend in the CAN IDS research literature is to exploit the regular frequency of important CAN messages. Frequency anomalies have been explored to detect and prevent signal-injection attacks and potentially ECU reprogramming ~\cite{moore2017modeling, gmiden2016intrusion, song2016intrusion}. \item \textbf{ECU-fingerprinting IDS:} After publication of the Jeep hack \cite{miller2015remote}, in which some ECUs were silenced and others controlled to send spoofed messages in lieu of the silenced ECUs, CAN IDS research transitioned to more sophisticated methods all focused on automatic ECU identification as a stepping stone to IDS. (No sender/receiver information is included in CAN packets). These detectors use data-driven techniques to classify which ECU sent each message by exploiting timing or voltage signatures ~\cite{cho2016fingerprinting, leeotids, choi2018identifying}. These can detect signals that originate from the wrong transmitter. \end{enumerate} Miller \& Valasek \cite{miller2013adventures, miller2015remote} exhibited the capability to compromise and control an ECU. It follows that Stuxnet-style attacks (see \cite{langner2011stuxnet}) on the CANs are possible and the logical next step for sophisticated adversaries. Specifically, ECU-authentic attacks, in which manipulated messages are sent from the expected ECU at the expected time, are possible. Such capabilities are exhibited by after-market ``chipping'', performance-tuning kits that reprogram ECUs. Albeit currently unseen, such attacks are not detectable by any above IDS, although possibly by one IDS that does not fit into the above trichotomy; Ganesan et al. \cite{2017-01-1654} use pairwise correlation of fixed values (e.g., speed, pedal angle) from CAN data and extra sensors to encode simple relationships and detect injection attacks. We build on this idea\textemdash using more sophisticated techniques to model subtle, nonlinear relationships in CAN data without needing to know it's functional meaning\textemdash with the goal of eventually proving these hypothetical attacks will be accurately detected. \subsection{Novel Approach \& Contributions} To identify currently undetectable CAN manipulations, we present a transformational approach to CAN IDS. Our approach uses data-driven techniques to first learn, then exploit the shape\textemdash geometric and topological properties\textemdash of the CAN data to identify attacks. A vehicle's signals share necessary correlations because they communicate properties of a physical system. For a simple example, speedometer angle is highly correlated with the wheels' speed, but negatively correlated with braking. As modern vehicles comprise many complex, interacting systems, we expect more subtle and complicated relationships. Our hypotheses are that the naturally high-dimensional, time-varying CAN data will lie on a learnable, low dimensional manifold; the data will move continuously on this manifold over time; and even ECU-authentic, coordinated manipulations to CAN signals will cause detectable anomalies to these characterizations: \begin{enumerate}[leftmargin = *] \item \textbf{Distance from Manifold Anomaly:} Uncoordinated attacks (where malicious messages are not in concert with the car's other messages, such as the famous Jeep hack \cite{miller2015remote}) will produce data that leaves the manifold. \item \textbf{Time Increment Discontinuity:} Coordinated attacks (where all interdependent signals are spoofed to a valid, but manipulated configuration, as in a replay attack) and uncoordinated attacks will cause a discontinuity on the manifold if they change the vehicle's state drastically. \end{enumerate} In this paper we introduce our novel, non-linear, shape-based anomaly detection algorithms, provide visualizations of the time-varying CAN data manifold, and present initial results seeking proof-of-concept of this anomaly IDS by implementing a potential attack approach on a driving vehicle. Our algorithmic developments regard performance and are sufficiently advanced to admit online detection of messages on the high-speed CAN. Overall, this paper gives a transformational approach to CAN detection that has two main advantages: 1) it promises to detect ECU-authentic attacks that no published IDS method has demonstrated; 2) as the approach is completely data-driven, it provides an after-market, vehicle-agnostic, and online IDS. \subsection{CAN Message Basics} CAN is a broadcast protocol with 0 the dominant bit, meaning if multiple ECUs send opposing bits, the 0 overwrites the 1. All ECUs can emit bits until the end of the arbitration ID (AID) portion of the frame, whence the lone ECU with the lowest AID has the floor. (Each AID is assigned to a single ECU.) Refer to Fig~\ref{fig:CANframe}. The up-to eight byte data portion is the message contents, and injecting a signal requires only manipulating or injecting appropriate AID and data combinations to elicit the desired vehicle response. Most AIDs are sent with fixed frequency and redundant data. \begin{figure}[h] \vspace{-.2cm} \includegraphics[width=.48\textwidth]{can-frame2.eps} \caption{ Image from Cho \& Shin \cite{cho2016fingerprinting} of CAN 2.0 data frame. 11 bit arbitration ID field used for prioritization of messages. Up-to eight byte data field used for message contents. } \label{fig:CANframe} \vspace{-.2cm} \end{figure} We follow a key discovery of Moore et al.~\cite{moore2018data}\textemdash \textit{for most signals the correct unit of analysis of CAN data are consecutive byte pairs of a data frame. } Each up-to eight-byte data frame padding with 0s if under eight bytes, decomposed into four separate two-byte messages with integer values in $[0, 2^{2*8}-1]$. I.e., most processes of a vehicle are indexed by the (AID, byte pair) combination; e.g., we have observed a single AID where the first byte pair encoded headlights while the last byte pair encoded speedometer values. We confirmed this claim both empirically and via consultation with a CAN engineer. Any CAN signals not following this convention will not be correctly encoded by our method. The mapping of byte pairs to function is non-public and varies per model; hence, our approach is data-driven. \section{Methodology} \label{sec:method} A priori, CAN traffic is high dimensional\textemdash vehicles often exhibit over 100 AIDs (over 400 byte pairs or PIDs), and each taking potentially \begin{wrapfigure}[20]{r}{.26\textwidth \vspace{-.25cm} \includegraphics[width=.28\textwidth]{Ground_Truth_Speed.eps} \includegraphics[width=.28\textwidth]{Ground_Truth_Reverse.eps} \vspace{-.2cm} \caption{Forward (top) \& Reverse (bottom) speed profiles for ambient data capture depicted.} \label{fig:ground-truth-speed} \end{wrapfigure $2^{16}=65,536$ values. However, our understanding of the physical world suggests that there are far fewer actual degrees of freedom present in the data. This section presents a methodology to learn a more fitting, lower dimensional representation. As our application is anomaly detection, we require an ambient data capture for model fitting. Expecting different vehicle states to admit different inter-dependencies in the data, we train models on data captured while (attempting to accurately) drive the vehicle in forward/reverse through the top/bottom speed profile in Fig. \ref{fig:ground-truth-speed}, respectively. Hence, the states we consider are Key On (on and in park), Accelerating, Speed (holding constant speed), Braking, and Reverse. For pre-processing, we discard any byte pairs for which only a single value is observed in all ambient data, leaving $\approx 70$ byte pairs. While our goal is initial implementation and proof of concept, actual use of our IDS will likely require greater variety in ambient data to minimize unseen signals. Each byte pair's values are regarded as a numerical time series. \input{22-clustering.tex} \input{24-diffusion-manifold.tex} \input{26-nystroem.tex} \input{28-detectors.tex} \subsection{Correlation Spectral Co-Clustering} We apply spectral co-clustering of Dhillon \cite{dhillon2001co}, which treats a given data matrix as an adjacency matrix of a bipartite graph (with nodes for each row on one side, and nodes for each column on the other) and uses normalized cuts (see Shi \& Malik \cite{shi2000normalized}) to find clusters. The upshot is both the rows and columns can be grouped simultaneously. For our application, we interpolate each series to a fixed length and generate the pair-wise correlation matrix. Equipped with this correlation matrix, we use spectral co-clustering implemented in Scikit~\cite{pedregosa2011scikit} to group byte pairs via correlation. In our application to the byte pair correlation matrix, each byte pair appears as a node on each side of the bipartite graph with edges weighted by the correlation of byte pair pairs. \begin{wrapfigure}[15]{r}{.28\textwidth \vspace{-.2cm} \includegraphics[width = .28\textwidth]{PID_Corr_Clust_2.eps} \caption{Correlation heatmap after rearranging byte pairs to group co-clusters.} \label{fig:byte-pair-corr} \vspace{-.2cm} \end{wrapfigure} In order to label the clusters we include a synthetic ``canonical byte pair" for each state. E.g., for the ``Speed" state we take the time series of speed measurements during the data capture (see Moore et al.~\cite{moore2018data}), using a cubic spline, interpolate to the required byte pair length, and cluster along with the actual byte pairs. See Fig. \ref{fig:byte-pair-corr} produced by rearranging rows/columns to group clusters and apply vehicle state labels. The large darker regions along the diagonal represent groups of byte pairs with similar correlation structure. The clusters are labeled according to which cluster the above ``cannonical processes" belong. The main take-away is two-fold: (1) byte pairs comprising a cluster share a similar correlation structure across vehicle states; (2) There exists a mapping between clusters generated in this way and characteristics of the underlying physical system. \subsection{Learning a time-varying lower dimensional manifold} Since clustered byte pairs vary together, we seek a low dimensional manifold for each cluster. This makes intuitive sense as we do not expect those byte pairs galvanized by accelerating to vary smoothly with those byte pairs stimulated upon braking and so on. For the sake of succinctness, we proceed only with the manifold for the ``Speed'' cluster. Let $p_1, ..., p_n$ denote the byte pairs of our cluster, and $x(t) := [ p_1(t), ..., p_n(t)]^T$, the vector of byte pair values at time $t$. We use Diffusion Maps of Coifman \& Lafon \cite{coifman2006diffusion} to obtain a low dimensional representation for each time $t$ as follows:\footnote{See De la Porte et al.'s treatment \cite{de2008introduction} for an intuitive explanation.} \begin{enumerate}[leftmargin = *] \item \textbf{Markov Marix} Let $P$ be the matrix so that $P(i,j)$, interpreted as the probability of jumping from $x_i$ to $x_j$, is proportional to $K(x_i, x_j) = \exp(-\gamma \|x_i-x_j\|^2).$ Here $\|. \|$ denotes Euclidean distance, and $\gamma$ a bandwidth parameter.\footnote{ Choosing $\gamma$ very small/large causes all points in the resulting embedding to be near/far from each other in the diffusion space. An effective heuristic we employed for choosing $\gamma$ is to plot $\log\sum P$ against $\log\gamma$ and choose $\gamma$ corresponding to the extent of the linear region. } \item \textbf{Diffusion Space} Map each $x_i \mapsto y_i: = [P^k(x_i *)]^T$, the $i^{th}$ column of $P^k$. Note that $P^k$ is the matrix of probabilities after $k$ hops, and $\sum_u (\|P^k(x_i,u) - P^k(u,x_j)\|^2) = \|y_i - y_j\|^2 $ is small for large $k$ iff $x_i$ and $x_j$ are close on the dataset's intrinsic geometry. \item \textbf{Projection} It follows that a lower dimensional representation respecting the data's shape is given by projecting to $m << n$ principle components of $P^k$ for large $k$ (equivalently of $P$, eliminating need for parameter $k$), where $m$ is chosen by the user. Explicitly, if $\xi_i$ are the $n$ eigenvectors of $P$ ordered by largest to smallest eigenvalues, then our projection is $x_i \mapsto \Psi(x_i): = \sum_{i=2}^{m+1} \langle y_i, \xi_i\rangle \xi_i.$ The first eigenvector is omitted as it is constant when $P = P^T$. \end{enumerate} Each color in Fig.~\ref{fig:speed-manifold} is the manifold obtained from the ``Speed" cluster for a single time $t$. \begin{figure}[h] \vspace{-.4cm} \includegraphics[width=.5\textwidth]{Speed_Manifold.eps} \vspace{-.2cm} \caption{Embedding of the ``Speed'' manifold into $m = 3$ dimensions. Colors yellow to green to blue indicate progression of the manifold over time. } \label{fig:speed-manifold} \end{figure} \subsection{Nystroem Extension} Naively, to embed a previously unseen point (e.g., $x(t+1)$), it is necessary to recalculate the Markov matrix and solve the eigenvector problem over again. While this poses no theoretical problems, the matrix for to the ``Speed" cluster is on the order of $10^5 \times 10^5$, so recalculating the matrix at each time step to embed new points is infeasible for an online procedure. Leveraging our hypothesis, that the rank of the matrix is much lower than its size, we use the Nystr\"{o}m method \cite{williams2001using, yang2012nystrom}. Concisely, we sub-sample $\hat x_1, \dots, \hat x_k$ for $k = 1000 << 10^5 \approx n$ observed points, $\{x_i\}_{i = 1}^n$, and use the principle components of Nystr\"{o}m approximated $\hat P$ (an $n\times n$ approximation of $P$ with rank at most $k$).\footnote{ We define $\hat P$ from $\hat K: = ABA^T$, an approximation of $K$, where $A = (K(x_i,\hat x_j))_{n\times k} $ and $B$ the psuedo-inverse of $K(\hat x_i, \hat x_j)_{k \times k}$.} We choose $k=1000$ because at $k=1000$ we can embed points fast enough to keep up with the speed of the CAN messages, and it seems likely that the dimension of the physical system determining the dependencies of the ``Speed" cluster is far less than 1000. This permits calculation of the manifold incrementally at CAN message pace. Time is depicted in Fig.~\ref{fig:speed-manifold} by the progression from warm to cool colors. Note that the manifold evolves rather continuously. \subsection{Detectors} Our method gives rise to two methods of anomaly detection. \begin{enumerate}[leftmargin = *] \item \textbf{Distance to Manifold Anomaly:} Given a previously unseen observation $x$ and $S$ the ambient dataset, if $\|\Psi(x)- \Psi(S)|| > K_{\text{Dist}}$ we flag on $x_t$. Here $\Psi^{(k)}(S)$ denotes the embedding image of the ambient training set and $K_{\text{Dist}}$ a threshold. Intuitively, this schema reflects the idea that if we have a sufficient training set then normal observations should be mapped onto the manifold given by $\Psi(S).$ Conversely, if a signal is manipulated its discordance with the normal data should produce a jump from the manifold. \item \textbf{Time Increment Discontinuity:} The second schema involves continuity on the manifold. Let $x(t_i)$, $x(t_{i+1})$ denote subsequent observations. We flag if $||\Psi(x(t_i)) - \Psi(x(t_{i+1}))|| > K_{\text{Cont}}$. Intuitively, this schema reflects the idea that if an attacker can manipulate all correlated PIDs in concert (as in a replay attack), they will be detected, unless they change the data in a fashion such that the resulting rate of change reflects that of the ambient dataset. \end{enumerate} \section{Experiment} \label{sec:experiment} Here we present the initial test of our detectors. To implement a potential attack approach, we identified a collection of byte pairs that share high correlations to the vehicle speed (and therefore to each other). Using the OBD-II port, we injected at high frequency each of these byte pairs with a perturbation of its expected value while driving (on a dynamometer) at constant speed. If the perturbation is sufficiently large, this attack can disable a vehicle causing it to coast to a stop. Here we perturbed the values enough to cause the vehicle systems to malfunction but not shut down. The attack data capture is hosted over a period of 70s. Malicious traffic is injected in three 10s intervals, roughly $[10, 20], [30, 40], [50, 60].$ \begin{figure}[ht] \hspace{-.4cm} \includegraphics[width=9cm,height=4.5cm]{WS_Speed_Man.eps} \includegraphics[width=9cm,height=4.5cm]{WS_Speed_IS.eps} \caption{Distance from ambient manifold (top) and increment distance (bottom) depicted for data with malicious values injected at high frequency for one byte pair during times $[10,20], [20,30], [30,40]$ seconds.} \label{fig:results} \end{figure} Fig.~\ref{fig:results} presents the two detection distances for the attack capture. The first shows the distance from the ``Speed" manifold of the CAN traffic over time. The seconds shows the distance between two consecutive points on the "Speed" manifold over time (referred to along the $y$-axis as increment distance). Both statistics were generated in an online fashion at faster or equal to the speed of CAN traffic. The first figure exhibits unexpected behavior. While there is a clear signal during the attack period, the distance to the ambient manifold is often lower during attack intervals than otherwise. We conjecture that the ambient dataset is not sufficiently representative of the testing data capture. The second figure, depicting increment distance, provides a clear signal of the attack, admitting accurate detection for a wide range of thresholds. In the event of a more sophisticated attack where ECU-authentic messages are sent with manipulated values, our evidence is that the oscillations seen here would not be present, and instead the figure would show six outlying plateaus each denoting the start or stop of an attack interval, respectively. Because this is an online procedure and messages on the CAN bus come milliseconds apart, this detection schema can identify an attack and alert almost instantly. Both figures, particularly the second, suggest that the general shape-based approach does capture the information needed to for separating ambient and anomalous CAN traffic in a completely car agnostic fashion, but more refining and testing is needed. \section{Conclusion} \label{sec:conclusion} This paper introduces an online, manifold learning technique to produce two novel anomaly detectors that seek to exploit unexpected changes in the geometric properties of CAN data for detection. From an ambient capture of CAN data, spectral co-clustering is used to group CAN data according to correlated signals during each vehicle driving state. Next, diffusion mappings are used to produce a low dimensional representation of the data for each state, and an update formula allows the manifolds to evolve over time. We discovered that this representation evolves continuously, and leverage this fact for detection. Our work informs two novel detectors: one based on distance from the expected manifold, learned in a training period on ambient data; the second based on increment distance in the lower dimensional space over time. Further the algorithm is crafted with sufficient treatment of computational complexity to permit real-time application. Targeting passenger vehicles, in which no publicly available mapping of the CAN signals to vehicle functions is present, our method is data driven, to facilitate after-market use upon sufficient refinement. Seeking proof of concept, we implement a potential attack scenario on a driving vehicle, and test the detectors. In terms of accuracy, our results suggest that the first detector is currently insufficient and more representative training data is likely necessary. The second detector gives a strong indication of the attacks, working as expected. We note that this detector promises to identify ECU-authenticated attacks\textemdash where signals are sent from the expected ECU at the expected time, but with manipulated data. Performance-wise, the algorithm keeps pace with CAN data, meaning real-time detection is possible. Further testing and refinement is needed. A deeper look at the manifold distance detector, in particular, investigations into what constitutes a sufficient training data set is necessary. For the increment distance, the results are overwhelmingly positive. Testing on more diverse and sophisticated attacks is needed, as well as on multiple diverse vehicles. For both detectors a method for setting the threshold is required. Overall, the paper introduces and provides proof-of-concept of a novel, computationally viable CAN IDS that holds the promise of detecting next generation CAN attacks. \section*{Acknowledgements} \label{sec:acks} Authors' thank M. Verma and reviewers who helped refine this document. Research sponsored by the Laboratory Directed Research and Development Program of Oak Ridge National Laboratory, managed by UT-Battelle, LLC, for the U. S. Department of Energy and National Science Foundation Math Science Graduate Internship.
\chapter*{MMDF2018 Committees and Planning} \section*{\centering{\textbf{Organizing Committee}}} \begin{tabular} {ll} \hline Prof. Chun-An Chou & Mechanical and Industrial Engineering, Northeastern University \\ Prof. Xiaoning Jin & Mechanical and Industrial Engineering, Northeastern University \\ Prof. Amy Mueller & Civil and Environmental Engineering, Northeastern University \\ Prof. Sarah Ostadabbas & Electrical and Computer Engineering, Northeastern University \\ \hline \end{tabular} \section*{\centering{\textbf{Advisory Committee}}} \begin{tabular} {ll} \hline Prof. Akram Alshawabkeh & Civil and Environmental Engineering, Northeastern University \\ Prof. Lisa Feldman Barrett & Psychology, Northeastern University \\ Claire Duggan & Center for STEM Education, Northeastern University \\ Prof. Deniz Erdoğmuş & Electrical and Computer Engineering, Northeastern University \\ Prof. Sagar Kamarthi & Mechanical and Industrial Engineering, Northeastern University \\ Prof. Haris Koutsopoulos& Civil and Environmental Engineering, Northeastern University \\ Prof. Stacy Marsella & Computer Science, joint with Psychology, Northeastern University \\ Prof. Mark Patterson & Marine and Environmental Science, Northeastern University \\ Dr. Leonard Polizzotto & Executive in Residence, Northeastern University \\ Prof. Carey Rappaport & Electrical and Computer Engineering, Northeastern University \\ Prof. Hanumant Singh & Electrical and Computer Engineering, Northeastern University \\ Prof. Milica Stojanovic & Electrical and Computer Engineering, Northeastern University \\ Dr. Tommy Thomas & Neurology, Emory University School of Medicine \\ \hline \end{tabular} \vspace{20mm} \section*{\centering{\textbf{Acknowledgements}}} The Organizing Committee would like to recognize and sincerely thank the Northeastern University university academic leadership, Office of the Provost (Provost and Professor James C. Bean and Vice-Provost for Research and Professor Arthur F. Kramer), and College of Engineering (and the Dean of Engineering, Professor Nadine Aubry) for providing invaluable support with funds, organization, and logistics. We would also like to express our sincere gratitude to the members of the Advisory Committee, whose input helped shape this event and bring it into existence, to the Logistics Chairman Gaby Fiorenza for making sure the event came together, and to the dedicated team of student volunteers who executed her plan. Finally we would like to thank ThermoFisher Scientific for their sponsorship of the workshop Welcoming Reception and Dinner. \pagebreak \tableofcontents \newpage \chapter{Introduction}\label{sec:introduction} \section{Motivation for the MMDF2018 Workshop} Driven by the recent advances in smart, miniaturized, and mass produced sensors, networked systems, and high-speed data communication and computing, the ability to collect and process larger volumes of higher veracity real-time data from a variety of modalities is expanding. However, despite research thrusts explored since the late 1990's \cite{hall1997introduction,manyika1995data}, to date no standard, generalizable solutions have emerged for effectively integrating and processing multimodal data, and consequently practitioners across a wide variety of disciplines must still follow a trial-and-error process to identify the optimum procedure for each individual application and data sources. A deeper understanding of the utility and capabilities -- as well as the shortcomings and challenges -- of existing multimodal data fusion methods \emph{as a function of data and challenge characteristics} has the potential to deliver better data analysis tools across all sectors, therein enabling more efficient and effective automated manufacturing, patient care, infrastructure maintenance, environmental understanding, transportation networks, energy systems, etc. (see \figref{Overview}). There is therefore an urgent need to identify the underlying patterns that can be used to determine \emph{a priori} which techniques will be most useful for any specific dataset or application. This next stage of understanding and discovery -- i.e., the development of generalized solutions –- can only be achieved via a high level cross-disciplinary aggregation of learnings, and this workshop was proposed at an opportune time as many domains have already started exploring use of multimodal data fusion techniques in a wide range of application-specific contexts. \figOverview \section{Statement of Need} Multimodal data fusion is already being used and explored in a number of highly varied disciplines (e.g., \cite{kunz2013map,sui2012review,germa2010vision,wu2004optimal,chatzis1999multimodal,jannin2000data,kannathal2007data,faundez2005data,dalla2015challenges,olson2012climate}). A number of key challenges common across disciplines can be identified, summarized as follows: (1) How best to work with heterogeneous data at different (spatial or temporal) scales and resolutions, of different types, and with varying levels of reliability? (2) How best to deal with noisy, uncertain, missing, and conflicting data? (3) How best to enable the interaction of multiple modalities in the processing pipeline, and at what level (data, features, or decisions)? (4) How best to integrate datasets (fusion), and when fusing how best to evaluate reasonableness of assumptions, especially given the unknown nature of interactions across datasets? (5) How best to evaluate performance, i.e., how to define an objective function for varying degrees of knowledge about the underlying phenomena and which can take advantage of multiple modalities to improve the end result? While the commonality of the underlying mathematics has been widely discussed (e.g., \cite{lahat2015multimodal}), a major barrier to learning is the lack of common language or framework in this field; because different domains have evolved multimodal data fusion techniques relatively independently, evaluations, results, and even descriptions of the techniques are reported in varying terminology that obscures what might otherwise be common ground. A major contribution of this workshop, therefore, is the creation of a (preliminary) shared framework for discussion (and improvement) as well as a vision for a workshop format that overcomes this barrier to enable cross-disciplinary learning. Previous workshops in related topic areas (Appendix, \secref{pastworkshops}) provided context for the current state of research as well as related ideas and concepts which informed this workshop design. Such topic- and discipline-driven workshops cultivate precisely the experts who must come together to create bridges between the islanded topics. In this spirit, MMDF2018 was specifically designed to facilitate interdisciplinary conversations, broaden views, build/strengthen collaborations across disciplinary lines, and provide a forum for comparing lessons learned from different application perspectives. \section{Workshop Design and Objectives} This workshop was envisioned to bring together experts (both data and application scientists and engineers) from a wide range of domains to drive the needed fundamental advances in the field of multimodal data fusion, providing a forum for learning that generalizes beyond individual applications and domains. Motivating topics included cooperative development of a more unified language for multimodal data fusion and working toward domain-independent tools and techniques to facilitate extraction of knowledge from complex data to drive rapid solution advancement. To achieve these goals, the Workshop Organizers (who collectively apply multimodal data fusion techniques to manufacturing, healthcare, human decision support, and environmental applications) assembled a highly interdisciplinary Advisory Committee with representation from computer science, psychology, neurology, transportation, robotics, system integration, subsurface sensing, communications, signal processing, marine science, and STEM education to ensure the workshop format and participants are as responsive as possible to the stakeholder communities. The participants were comprised of academic, industry, and national laboratory leaders, targeting individuals with deep experience in developing or using multimodal data fusion techniques for application in specific fields (a complete list of workshop participants is available in \secref{list}). A highly interactive, facilitated but discussion-driven breakout-and-reconvene format provided a forum for rapid aggregation of knowledge and learning. Lessons recorded by graduate student scribes and session moderators have been aggregated into this report, with an aim to identify a comprehensive national agenda and roadmap for future research directions. This report was distributed to participants for comment and contributions before publication. The MMDF workshop had four main objectives associated with the above mentioned goals: \begin{itemize} \item \textbf{Examine the landscape of existing multimodal data fusion techniques across sectors:} Summarize the state-of-the-art research in multimodal data methodologies and techniques and applications where they are in use. Identify the current needs of data fusion research across various sectors. Identify the failures/shortcomings in existing techniques and lessons learned from experiences. \item \textbf{Identify commonalities and differences, successes and gaps, in current techniques with respect to a range of dataset types:} Identify multisensory/multimodal data fusion challenges. Identify commonalities and differences in successful applications of data fusion techniques across various domains and applications (especially generalizable lessons). Identify gaps in existing research and development, including persistent roadblocks, challenges, and barriers for future research. Determine resources required to conduct effective and efficient multimodal data fusion in high-impact application domains. \item \textbf{Draft a national agenda and roadmap for multimodal data fusion research and development with the goal of enabling novel multimodal data fusion tools to propel progress:} Identify the national and global drivers, attributes, imperatives, and barriers for multimodal data fusion methodologies and key application challenges. Formulate a shared multimodal data fusion framework to underpin development of tools that can be applied across disciplines to allow researchers to focus on lessons learned from data rather than trial-and-error data processing. Formulate recommendations for research programs and activities to advance multimodal data fusion solutions that bring together all involved communities. Formulate recommendations for integration of associated concepts into education at the K-12 (primarily high school), undergraduate, and graduate levels, to ensure a pipeline for an enthusiastic and capable future workforce in this field. \item \textbf{Disseminate the findings of this workshop widely across domains and sectors to reach all stakeholder communities, including research, industry, and education.} \end{itemize} \section{Workshop Discussion Framework} As a starting point for discussion and a first step toward apples-to-apples comparisons, a preliminary (intentionally highly generalized) framework was provided to the participants, shown in \figref{Framework}. Two examples are provided in the Appendix \secref{examples}. \figFramework To understand the utility of \figref{Framework} in facilitating an ``apples-to-apples'' discussion consider two domain-specific examples: manufacturing line management and patient care (see \tblref{Applications}). The types of data in these applications differ significantly (from images to time series to sentences), however ultimately in both applications at a minimum the user wants to know (1) how to optimize system efficiency/effectiveness and (2) how to evaluate uncertainty in results. Despite the highly differing domains and challenges, the underlying mathematical structure can be mapped onto similar processes: highly diverse data streams must in some way be aggregated to be simultaneously fed to a processing algorithm, which itself provides the end-user with an estimate of the critical characteristics of interest for the system state. However, what is the best way to do so? Should one-dimensional features be extracted from each modality and those features examined together using some type of inference model? Or should the full dataset be fed simultaneously into the inference model (and if so, how to transform 2D or 3D data?)? In either scenario, which type of inference model will be best: machine learning (e.g., artificial neural networks), statistical analysis (e.g., Bayesian maximum likelihood), fitting of parameters for a physics-based or empirical model, or something else? How do we define the metric for which is best? What role does expert domain knowledge play in each of these steps (feature extraction, inference, metric development)? And, critically, once we determine the optimal methodology for application \#1, can it tell us anything about the optimal methodology for application \#2? Answering this question is the goal of the burgeoning field of multimodal data fusion. \section{Workshop Overview and Agenda} The full workshop agenda is provided in the Appendix (\secref{agenda}), however the format and discussion topics are summarized briefly here. The workshop was held over two days, primarily centered around breakout-and-reconvene discussion sessions but with the first half-day comprised of plenary talks to frame the discussion. Throughout all sessions the following perspectives were highlighted for deeper understanding and comparison: \newline \textbf{(I) Applications \& Disciplines:} \newline \indent \indent $\diamond$ Healthcare and biomedicine (neuroscience, psychology, genomics, etc.) \newline \indent \indent $\diamond$ Environmental science (geology, climate change, water quality monitoring, etc.) \newline \indent \indent $\diamond$ Manufacturing and automation \newline \indent \indent $\diamond$ Transportation and logistics \newline \indent \indent $\diamond$ Energy (smart grid, smart agriculture, etc.) \newline \indent \indent $\diamond$ Robotics \newline \textbf{(II) Methodology \& Theory:} \newline \indent \indent $\diamond$ Supervised and unsupervised learning \newline \indent \indent $\diamond$ Transparent vs. black-box methods \newline \indent \indent $\diamond$ Probabilistic inference modeling \newline \indent \indent $\diamond$ Real-time vs. offline learning \newline \indent \indent $\diamond$ Anomaly detection \newline \indent \indent $\diamond$ Dimensionality reduction (feature extraction, feature selection, , etc.) \newline \indent \indent $\diamond$ Levels of multimodal data fusion (raw data, feature, decision, etc.) \newline \pagebreak \chapter{Plenary Session and Keynote} The workshop was kicked off with a half-day plenary session that set the stage through presentation of key disciplinary challenges and existing technology solutions in data integration. Presentations captured input from academia and industry, from both the data science and practitioner perspectives. \section{Keynote: Dr. Kenneth Loparo, Case Western Reserve University} \textbf{Multimodal Data Analysis for Clinical Decision Support in Critical Care Medicine --} The Intensive Care Unit (ICU) is the most data intensive unit in the hospital. This talk discussed streaming real-time multimodal patient data and the integration and analysis of this data to support clinical decision-making. \textbf{Bio:} Dr. Kenneth A. Loparo was an assistant professor in the Mechanical Engineering Department at Cleveland State University from 1977 to 1979 and has been on the faculty of the Case School of Engineering at Case Western Reserve University since 1979. He is the Nord Professor of Engineering in the Department of Electrical Engineering and Computer Science and holds academic appointments in the departments of biomedical engineering and mechanical and aerospace engineering in the Case School of Engineering. He has received numerous awards including the Sigma Xi Research Award for contributions to stochastic control, the John S. Diekoff Award for Distinguished Graduate Teaching, the Tau Beta Pi Outstanding Engineering and Science Professor Award, the Undergraduate Teaching Excellence Award, the Carl F. Wittke Award for Distinguished Undergraduate Teaching and the Srinivasa P. Gutti Memorial Engineering Teaching Award. He was associate dean of engineering from 1994--1997 and chair of the Department of Systems Engineering from 1990--1994. Dr. Loparo is a Life Fellow of the IEEE and a fellow of AIMBE, his research interests include stability and control of nonlinear and stochastic systems with applications to large-scale systems; nonlinear filtering with applications to monitoring, fault detection, diagnosis, prognosis and reconfigurable control; information theory aspects of stochastic and quantized systems with applications to adaptive and dual control and the design of distributed autonomous control systems; the development of advanced signal processing and data analytics for monitoring and tracking of physiological behavior in health and disease. \section{Dr. T{\"u}lay Adali, University of Maryland Baltimore County} \textbf{Data Fusion through Matrix and Tensor Factorizations: Uniqueness, Diversity, and Interpretability --} Fusion of multiple sets of data, either of the same type as in multiset data or of different types and nature as in multi-modality data, is inherent to many problems in engineering and computer science. In data fusion, since most often very little is known about the relationship of the underlying processes that give rise to such data, it is desirable to minimize the modeling assumptions and, at the same time, to maximally exploit the interactions within and across the multiple sets of data. This is one of the reasons for the growing importance of data-driven methods in data fusion tasks. Models based on matrix or tensor decompositions allow data sets to remain in their most explanatory form while admitting a broad range of assumptions among their elements. This talk provided an overview of the main approaches that have been successfully applied for fusion of multiple datasets with a focus on the interrelated concepts of uniqueness, diversity, and interpretability. Diversity refers to any structural, numerical, or statistical inherent property or assumption on the data that contributes to the identifiability of the model, and for multiple datasets, provides the link among these datasets. Hence, diversity enables uniqueness, which is key to interpretability, the ability to attach a physical meaning to the final decomposition. The importance of these concepts as well as the challenges that remain are highlighted through a number of practical examples. \textbf{Bio:} Professor T{\"u}lay Adali received the Ph.D. degree in Electrical Engineering from North Carolina State University, Raleigh, NC, USA, in 1992 and joined the faculty at the University of Maryland Baltimore County (UMBC), Baltimore, MD, the same year. She is currently a Distinguished University Professor in the Department of Computer Science and Electrical Engineering at UMBC and is the director of the Machine Learning for Signal Processing Lab (MLSP Lab). Prof. Adali is a Fellow of the IEEE and the AIMBE, a Fulbright Scholar, and an IEEE Signal Processing Society Distinguished Lecturer. She is the recipient of a 2013 University System of Maryland Regents' Award for Research, an NSF CAREER Award, and a number of paper awards including the 2010 IEEE Signal Processing Society Best Paper Award. Her current research interests are in the areas of statistical signal processing, machine learning, and applications in medical image analysis and fusion. Prof. Adali assisted in the organization of a number of international conferences and workshops including the IEEE International Conference on Acoustics, Speech, and Signal Processing (ICASSP), the IEEE International Workshop on Neural Networks for Signal Processing (NNSP), and the IEEE International Workshop on Machine Learning for Signal Processing (MLSP). Prof. Adali chaired the IEEE Signal Processing Society (SPS) MLSP Technical Committee (2003-–2005, 2011–2013), served on the SPS Conference Board (1998-–2006), IEEE SPS Signal Processing Theory and Methods (2010--2015) Technical Committee, and the IEEE SPS Bio Imaging and Signal Processing Technical Committee (2004-–2007). She was an Associate Editor for IEEE Transactions on Signal Processing (2003-–2006), IEEE Transactions on Biomedical Engineering (2007-–2013), IEEE Journal of Selected Areas in Signal Processing (2010--2013), and Elsevier Signal Processing Journal (2007-–2010). She is currently serving on the Editorial Boards of the Proceedings of the IEEE and Journal of Signal Processing Systems for Signal, Image, and Video Technology. \section{Dr. Alex Hall, Thermo Fisher Scientific} \textbf{Effective Multi-Modal Multi-scale Analytical and Imaging Correlation --} Thermo Fisher Scientific builds and sells many different types of analytical imaging instruments and software. Instruments include optical microscopes, Raman, EDX, XPS, electron microscopes, and micro-tomograph, each of which has particular strengths and weaknesses. In order to answer more complex customer questions that require insight from multiple instrument data streams Thermo Fisher Scientific also develops software solutions, like Avizo and Amira, to correlate and fuse results from different instruments in more complex ways than `voting' with data from each independently. This talk presented the main challenges faced in this emerging field and Thermo's ideas on how to answer them, supported by case study examples from current customer projects. \textbf{Bio:} Dr. Hall is a Product Marketing Engineer representing the 3D analysis program Avizo-Amira with Thermo Fisher Scientific. His background is in evolutionary biology where he used genetic data and skeletal variation collected from X-ray computed tomography to describe several species of reptiles. \section{Dr. Timothy Heidel, National Rural Electric Cooperative Association} \textbf{Leveraging Data to Enhance Power System Planning and Operations --} Rapidly falling costs of distributed and renewable electricity generation and storage technologies and growing emphasis on improving electric power system resiliency have been motivating the investigation of alternative architectures for planning and operating electric power systems. Complementing these trends, advances in power electronics, computation, and communication technologies provide the opportunity to optimize and control grid operations closer to the locations where power is ultimately consumed. This could offer significant efficiency, cost, reliability, and emissions benefits. However, the methods that have been relied on for designing and operating power systems historically could prevent the full realization of the potential benefits associated with these technologies. Technologies that utilize data from a wide variety of sources across a variety of time scales will be critical to achieving the full potential of new technologies. This talk focused on several examples where the use of new data streams may significantly enhance grid operations and planning. \textbf{Bio:} Dr. Tim Heidel (now at Breakthrough Energy Ventures) gave this presentation as NRECA's Deputy Chief Scientist where he was leading R\&D activities, with emphasis in the areas of electric utility data analytics and grid cybersecurity. Prior to joining NRECA, Dr. Heidel served as a Program Director at the Advanced Research Projects Agency-Energy (ARPA-E), where he managed a portfolio of over 75 research projects including new approaches for controlling and optimizing the transmission and delivery of electric power, particularly in the context of high renewables penetration. As the Research Director for MIT's 2011 ``Future of the Electric Grid'' study, Dr. Heidel coordinated research efforts from economics, policy and electrical engineering on the most important challenges and opportunities that are likely to face the U.S. electric grid between now and 2030. Dr. Heidel holds S.B., M.Eng., and Ph.D. degrees in Electrical Engineering and an M.S. in Technology and Policy from MIT. \section{Dr. James Llinas, Center for Multisource Information Fusion, University at Buffalo} \textbf{(Some) Remaining and Evolving Challenges to MMDF System Design and Development --} Much of the MMDF community remains focused on research and development of algorithms for narrow specific applications. Such research remains needed but the community needs to lift its focus to more robust capabilities and more systemic issues related to achieving advanced capabilities. This talk focused on some of what we call remaining challenges in MMDF, these focused on attaining both high-level MMDF capabilities as well as more fully integrated system architectures. The second category of challenges are labeled evolving, associated with what are in essence dramatic changes in the data and computational infrastructure, such as soft data and the Internet of Things. The summary message was an appeal for new initiatives across a broader R\&D base that involves focused multidisciplinary programs. This was joint work between Dr. James Llinas, University at Buffalo and Dr. Erik Blasch, Air Force Office of Scientific Research. \textbf{Bio:} Dr. James Llinas is an Emeritus Professor in the Departments of Industrial and Systems Engineering and dual-appointed in the Department of Mechanical and Aerospace Engineering at the State University of New York at Buffalo. He is the Founder and Executive Director of the Center for Multisource Information Fusion, the only systems-oriented academic research center for Information Fusion in the United States; the Center has been in existence for some 20+ years and has conducted extensive and distinctive research for a wide variety of governmental and civilian clients. Dr. Llinas brings over 35 years of experience in multisource information processing and data fusion technology to his research, teaching, and business development activities. He is an internationally-recognized expert in sensor, data, and information fusion, co-authored the first integrated book on Multisensor Data Fusion, and has lectured internationally for over 30 years on this topic. \section{Dr. Soundar Kumara, Pennsylvania State University} \textbf{Multimodal Sensing and Analytics--An Expository Look --} This talk examined the notion of multi modal sensing, and data analytics in the context of manufacturing and healthcare with a focus on the progression of sensor signal representation in manufacturing and how smart manufacturing and sensing has evolved in the past three decades. Use cases from healthcare and IoT were discussed. \textbf{Bio:} Dr. Soundar Kumara is the Allen, E., and Allen, M., Pearce Professor of Industrial Engineering at Penn State. Has an affiliate appointment with the school of Information Sciences and Technology. His research interests are in Sensor based Manufacturing Process Monitoring, IT in Manufacturing and Service Sectors, Health Analytics, Graph Analytics and Large Scale Complex Networks. He got his undergraduate degree from S.V.U. College of Engineering, Tirupati, India; M.Tech., from I.I.T., Madras and Ph.D., from Purdue University. Prior to attending Purdue he worked with the computing group of Indian Institute of Management, Ahmedabad. He is a Fellow of Institute of Industrial Engineers (IIE), Fellow of the International Academy of Production Engineering (CIRP), Fellow of American Association for Advancement of Science (AAAS), and American Association of Mechanical Engineers (ASME). He has won several awards including the Faculty Scholar Medal (highest research award at PSU), PSU Graduate Teaching Award, Penn State Engineering Society Outstanding Advisor Award, Premier Research Award, and PSES Outstanding Research Award. \pagebreak \chapter{Breakout Sessions} The following section presents the MMDF Workshop results for the four main breakout sessions focused on the topics of healthcare, robotics/manufacturing, energy/transportation/environmental, and methodologies and theories. For each breakout the discussions and activities are summarized. Participants (list provided in \secref{list}) identified goals, desired capabilities, challenges and barriers, and priority research topics. \section{Track 1: Healthcare} \subsection{Overview} This breakout session, comprised primarily of researchers in academia and industry, discussed issues of MMDF primarily in acute/critical care and neuroscience. As new medical sensing devices are developed to advance real-time data acquisition in ICU, the quality of acute/critical care can be potentially improved, however currently there is no gold standard to guide one to access, extract, and integrate information from highly-massive, inconsistent data of different modalities\cite{Johnson2016critical}. In neuroscience the issue of differing resolution and registration is significant: among the most widely-used neuroimaging techniques to record brain activities, electroencephalogram (EEG) can generate high temporal resolution data at low signal-to-noise ratios whereas functional magnetic resonance imaging (fMRI) produces relatively high spatial resolution data \cite{sui2012review, lahat2015multimodal}. Fusing data from these two modalities has shown a potential to uncover brain chaos and produce meaningful spatio-temporal information through intensive data analysis. Therefore the overall goal of this breakout discussion was to discuss in detail: (1) accessibility, liability, usability, and interpretability of healthcare-related data, and (2) potential for generalized data fusion solutions to improve the clinical usage of data, i.e., more accurate and interpretable decisions upon defined research questions or patient conditions. \subsection{Successes} With an existing awareness of MMDF tools and potential in this area, many successes using statistical/machine learning, signal/imaging processing, and information theoretic approaches have already been achieved in processing heterogeneous medical data. In particular, machine learning has been employed to extract and fuse relevant attributes (features) from different data sources, leading to reliable prediction/inference outcomes in medical diagnosis, early detection, and prediction \cite{Johnson2016critical}. Thanks to advanced sensing technologies, more high-quality time-series data of vital signs, lab results, and 2D/3D images are available \cite{Pires2016datafusion}. This may overcome some identified issues related to alignment and synchronization of multi-sensor time-series. It may also enable a vision for an end-to-end learning framework (e.g., deep learning) for imaging and text recognition for various target diseases and disorders \cite{Purushotham2017deep,Mahmud2018deep,Suresh2018deep}. Some recent efforts have been made to improve efficiency and interpretability of MMDF processes. \subsection{Challenges and Barriers} Achieving the desirable capabilities and needs for MMDF requires overcoming several challenges and barriers, outlined in \tblref{HCChallenges}. \tabHCChallenges \subsection{Desired Capabilities and Priorities} Based on the discussed barriers and challenges, desired capabilities are identified as outlined in \tblref{HCCapabilities}. \tabHCCapabilities \section{Track 2: Robotics/Manufacturing} \subsection{Overview} This breakout session focused on discussing the state-of-the-art science, methodologies and tools of MMDF in the domain areas of manufacturing, automation, and robotics. As sensing and data acquisition technologies for machinery, automation and robotics continue to evolve, they provide richer and more relevant information for robust data-driven analytics for improved performance, safety, reliability and maintainability of robotic systems and manufacturing equipment or processes. These emerging resources of multi-source multi-modal data collection and analytics, in conjunction with smart manufacturing and automation systems where cyber and physical systems are highly interconnected, are expected to improve the overall effectiveness, efficiency and fidelity of these systems. The goals identified for MMDF in the domain areas of robotics and manufacturing emphasize monitoring, detection, diagnostics, and substantial improvements in reliability (reduction in unexpected downtime), improved safety, operational efficiency, and human-machine collaboration effectiveness. These goals are categorized into three disparate classes in the short to medium time frames as to when they are anticipated to be developed. \subsection{Successes} Advancements in multi-sensor fusion have been developing rapidly over the last decade as the level of automation at manufacturing enterprises increases with the advent of new external sensor technologies which augment existing embedded sensors on the equipment. Successes have been achieved in a number of areas, such as (1) real-time data representation for linear and nonlinear signals, (2) techniques for feature extraction and dimensionality reduction, (3) graph-based clustering to deal with large-scale data sets, (4) data representation schemes, and (5) sophisticated real-time data representation and visualization. These techniques have been implemented in automated manufacturing processes and production lines in various industries such as automotive, semiconductor, aerospace, pharmaceutical and bio-medical products manufacturing with relatively high automation level, rich sensor data sources, and sophisticated data acquisition technologies. \subsection{Challenges and Barriers} Specific goals and desired functionality were identified for how MMDF can contribute to advancing the missions and objectives of many smart manufacturing and robotics initiatives. However, many of these cannot currently be achieved due to a number of existing challenges and barriers that remain under-addressed. \tblref{MfgChallenges} lays out a number of these scientific challenges and barriers for MMDF methodology development and its effective integration into modern manufacturing systems. \tabMfgChallenges \subsection{Desired Capabilities and Priorities} Researchers continue to build and improve on the capabilities of existing multi-modal data fusion techniques and methodologies all the while exploring what new capabilities MMDF can perform to bring benefits to the smart manufacturing and automation industry as well as to robotics applications. A number of key desired capabilities and priorities were identified to support MMDF process, summarized in \tblref{MfgCapabilities} and detailed below. \tabMfgCapabilities \begin{itemize} \item \textbf{Robotics:} A majority of robotics studies use multi-source sensor data from experiments and virtual-sensing data from simulations for purpose like environmental pattern recognition, robot condition monitoring, navigation, and motion control. Existing multimodal fusion algorithms are mostly designed for fusion at low level (data and feature), e.g., Gaussian mixture regression, Bayesian regression, Bayesian networks, multi-layer perception,deep learning, etc. Since robots generally operate in an uncertain and constantly changing environment, a synergistic operation of many modalities (thermal, visual, tactile, etc.) is desired for improved capabilities for real-time operation with high accuracy and robustness. \item \textbf{Manufacturing and Automation:} The rapid advancements of sensor technology, telemetric technologies, and computing technologies have resulted in rich data in both temporal and spatial spaces in automated manufacturing systems. With massive data readily available, there is an unprecedented increase in demand for advanced methodologies to unveil underlying relationships among events and to assist with various tactical and operational decisions (monitoring, detection, diagnosis, prognosis, control). Due to the complexity of manufacturing systems, enabling MMDF methodologies and algorithms of multimodal data fusion are desired to overcome data uncertainty, multi-resolution and heterogeneity mismatches, and the high dimensionality of the data, as well as the increasing requirements for decision-making capabilities. The priorities of MMDF for the next generation smart manufacturing and automated factory will be the development of a unified MMDF framework to integrate multiple data streams with disparate modalities with physical domain knowledge in manufacturing system modeling and analysis. \end{itemize} \section{Track 3: Energy/Transportation/Environmental} \subsection{Overview} This breakout session brought together researchers working broadly in infrastructure, security, and environmental areas to compare needs, approaches, successes, and challenges related to fusion of multimodal data. Expertise areas covered included: energy, transportation, climate, environment (ecology, fluid dynamics, chemistry), geotechnical, autonomous vehicles (underwater, transportation systems), and security (subsurface sensing, body scanning, etc.). While diverse, these applications generally share characteristics of large system scale and significant system complexity, e.g., transportation or electrical distribution networks, global or local environments, thousands of feet of earth crust. The main goals of MMDF applications for this class of systems are (1) understanding dynamics of complex systems at an appropriate and sufficient level to (2a) recommend architectures for optimization of real-time feedback controls (automated or human-in-the-loop) or (2b) optimize long-term resource management or usage policies under economic or other external constraints. Models/algorithms are therefore required both to drive fundamental knowledge acquisition and to underpin decision support tools or automated management systems. A main take-away from this session was the differential definition of `optimization' relative to traditional mathematical definitions; the majority of applications in this space require `cost-time constrained MMDF' and therefore should optimize based on a metric balancing output accuracy with economic costs and system response time. \subsection{Successes} To date successes in this area have primarily come through use of physics-, chemistry-, or other science-based models, including data assimilation techniques for guiding and verifying model accuracy. This requires consistent gridding and synchronization, and resampling of data is common. Significantly, the use of functional models provides an explicit pathway for knowledge capture, simulation, and interpretation of outputs in the context of system dynamics and other system properties. While most applications are data limited, as indicated above, some data streams are sufficiently dense to enable estimation of extreme value distributions and, in more limited cases, the underlying probability distribution. Probability theory for uncertainty and error propagation is relatively well-developed for these applications (facilitated by use of functional models). Exploration of methods for creation of synthetic datasets - to overcome limitations in data availability for model training/calibration or to address privacy/security concerns - have led to some limited successes, e.g., the APRA-E GRID-DATA (Generating Realistic Information for the Development of Distribution and Transmission Algorithms) program. \subsection{Challenges and Barriers} In this breakout session challenges were identified at all stages of the MMDF process, from data characteristics to algorithm development to interpretability of results. Particularly the latter is highlighted as a key consideration, given the goals of fundamental understanding of, and real-time management of, system dynamics, however issues related to diverse aspects of data sources comprised a significant fraction of the conversation, providing insight into opportunities for MMDF innovation (see \tblref{EnvChallenges}). \tabEnvChallenges \subsection{Desired Capabilities and Priorities} Targets for MMDF capabilities and priorities were driven by the fundamental need in this sector for real-time controls on complex systems in environments where data collection is expensive, necessarily incomplete, and of highly varying accuracy (see \tblref{EnvCapabilities}). Priorities were highlighted that deliver both an ability for operational decision making and for insight into underlying system dynamics (fundamental knowledge/intuition). ``Confidence'' in data and results was a recurring theme, particularly as models/model outputs in these fields are often used by regulators and therefore must be justified in the context of fiscally responsible and/or safety-oriented management of public systems. \tabEnvCapabilities \vspace{-.1in} \section{Track 4: Methodologies and Theories} \subsection{Overview} In this breakout session, comprised of all participants, the conversation was seeded with the following discussion topics: (1) supervised vs. unsupervised learning, (2) transparent vs. black-box methods, (3) probabilistic inference modeling, (4) real-time vs. offline learning, (5) anomaly detection, (6) inference based on missing or noisy data, (7) dimensionality reduction (feature extraction, feature selection), and (7) levels of multimodal data fusion: raw data, feature, decision, etc. \subsection{Successes, Challenges, and Barriers} Recent advances in data analytics and machine learning algorithms have made significant impacts in several domains by revolutionizing the way we process domain-specific data and the techniques uses to evaluate hypotheses or make decisions using these curated data. The field of MMDF has also benefited from these advancements, with methodologies and theories employed in this regard influenced by this fast-paced progress. In particular, the following observations were made: \begin{itemize} \item \textbf{Supervised vs. Unsupervised Learning:} Nothing is totally unsupervised, and framing the problem already guides the inference model by imposing the model structure and setting the hyper-parameters. Fully supervised models have the huge advantage of learning from the experts (embedded in the labelling information), however they come with several disadvantages including: (1) every supervised decision embeds a series hypothesis (can lead to bias in learning), (2) the high cost of labelling data (e.g., manual labelling of 3D radiology images), (3) the number of experts in different categories is different and is limited (causes unbalanced training detests), and (4) the reality of noisy and unreliable labels from multiple annotators (due to bias and/or disagreements among experts). Given these observation, the panel recommended the use of semi-supervised inference models to capitalize on the advantages of both supervised and semi-supervised learning approache, e.g., using pre-processing steps to generate suggestions for labels (such as taking advantage of natural language processing to find labels from text) or using generative models to produce already labeled datasets. The panel also concluded that moving from fully supervised inference model to unsupervised approaches allows some fields, such as psychology, that have historically been hypothesis-driven to start discovering new insights directly from multimodal data sources. \item \textbf{Interperatibility of the Learning Process \& Outcomes:} Deep learning approaches have been rapidly adopted across a wide range of fields because of their accuracy and flexibility \cite{lecun2015deep}. They provide highly scalable solutions for problems in object detection and recognition, machine translation, text-to-speech, and recommendation systems \cite{schmidhuber2015deep}. The majority of deep learning approaches which are based on deep neural networks (DNNs) learn features and labels directly from data. The main challenges here are (1) a requirement for large volumes of labeled data and (2) a difficulty in interpreting the learning process of the algorithm. To address this latter issue while benefiting from the power of DNNs, the panel suggested, for instance, looking into the specific features that are known to have high mutual information with the labels to verify whether latent variables in network have correspondence with these features. \item \textbf{Levels of MMDF:} Classically, the levels at which data fusion would be implemented have been known as: (1) raw data, (2) feature, and (3) decision. In general, raw data fusion is usually done only when data from different modalities are nicely synchronized and have very similar structures (i.e., dimensionality, temporal/spatial resolution). However, in practice, data modalities for most applications have very different structures (e.g., 1D to 4D+ data in patient healthcare information). In these cases, feature level fusion is often employed to represent each modality in a lower dimension where fusion can happen on a smaller dataset. Factor analysis approaches (e.g., Principal Components Analysis (PCA) [12], Exploratory Factor Analysis (EFA), Independent Components Analysis (ICA)) are often used to extract a low dimensional embedding of the original data to facilitate interpretability or computational tractability. Recently, deep learning models such as convolutional neural networks (CNNs) have begun to be utilized as an end-to-end approach that eliminates the need for \emph{a priori} feature extraction, however they remain hindered by the amount of labelled training data that they require. In decision level fusion, the most common in the majority of disciplines due to the parallels to human/system decision making/modeling, the outcomes of individual inference models are integrated to generate a single final decision. As the level of fusion moves from raw to decision (more abstraction), the information content being fused decreases. It is therefore important to ensure the critical content (higher mutual information with the decision) is passed on, or in cases where it is not obvious what content is critical, this argues for fusion at the raw data or feature level. \end{itemize} \subsection{Desired Capabilities and Priorities} It was confirmed by the panel that among the highest priorities in the field of MMDF is to establish a common scientific framework for MMDF to accelerate solution development by rationalizing an approach to data integration, specifically integrating lessons from MMDF efforts across domains to provide \emph{a priori} recommendations for MMDF methodologies at the project design stage. The recommendations for next steps in this topic area were (1) to build a common terminology and set of basic principles for MMDF and (2) to design studies to explicitly test the hypothesis that MMDF knowledge gained in one discipline can usefully inform solution design for other disciplines and applications. \pagebreak \chapter{Workshop Synthesis: Roadmap Recommendations and Next Steps} The workshop discussions led to a consensus on the need for establishing a framework for systematizing the understanding of large and disparate streams of information to produce actionable and reliable decisions in real-time. This section presents the MMDF Workshop recommendations for a priority roadmap of future cross-disciplinary MMDF research. Based on the major challenges and desired capabilities identified, critical directions are detailed to support MMDF methods, algorithms, and metrics, as outlined below. Addressing these will enable progress toward development and integration of machine learning, statistical methods, signal processing, and optimization with discipline-specific insight for the advancement of MMDF science and technologies. \vspace{5mm} \textbf{Question 1:} Can we predict \emph{a priori} for an arbitrary new application where information should optimally be fused (raw data, features, decisions)? Can we predict \emph{a priori} which architectures will be most effective (decentralized, distributed, hierarchical)? \vspace{5mm} \textbf{Question 2:} How can we take data characteristics and social/economic/physical context into account in the above process? \vspace{5mm} \textbf{Question 3:} How can we take system performance demand (assessment vs. prediction vs. detection vs. inference, etc.) into account in the above process? \vspace{5mm} \textbf{Question 4:} How can we quantitatively evaluate the value (economically or in terms of information content) of the contribution of each modality to the quality of outputs and particularly relative to independent analyses using each modality independently? \vspace{5mm} To address these long-range fundamental questions, the workshop attendees identified key critical first steps required to support progress in this field. Primary among these is \textbf{developing a domain-independent MMDF framework and vocabulary} and \textbf{conducting a comprehensive cross-disciplinary MMDF literature review}. It is envisioned that this will integrate terminology and concepts utilized in many domains--disciplinary applications in addition to data theory. In addition there is a critical need for \textbf{a shared evaluation process for recommending and testing MMDF methods} in a more apples-to-apples manner. To achieve these two goals, the following \textbf{Priority Research Agendas} are proposed: \begin{itemize} \item Synthesizing a domain-independent MMDF vocabulary \item Developing a generic architecture framework for MMDF \item Building a cost-benefit evaluation model for MMDF performance \item Defining cross-application MMDF performance metrics \item Assembling a taxonomy of applications (relations based on data, application characteristics, or other) \item Determining MMDF data quantity and quality needs as a function of generic application characteristics \item Facilitating cross-disciplinary transfer of methodologies, algorithms, and evaluation metrics \end{itemize} The MMDF2018 workshop achieved an initial approach toward identifying a common vocabulary for the multimodal data fusion concept; a literature review is already underway, with projected publication in Fall 2018. Moving forward it is envisioned that MMDF research initiatives must be developed to nurture needed cross-disciplinary convergence by (1) explicitly bringing together experts from diverse fields to work together in knowledge discovery and (2) providing discipline-agnostic data-oriented outputs that facilitate broad cross-disciplinary progress in data integration efforts. \pagebreak \chapter{Appendices} \vspace{-.2in} \section{Workshop Agenda} \vspace{-.2in} \label{sec:agenda} \vspace{-.1in} \figProgramone \figProgramtwo \figProgramthree \hfill \pagebreak \section{Participant List} \label{sec:list} \tabParticipants \pagebreak \section{Previous Workshops with Related Themes} \label{sec:pastworkshops} \tabpast \pagebreak \section{Research Examples in Proposed Framework} \label{sec:examples} \tabApplications { \bibliographystyle{IEEEbib} \small
\section{Introduction} \label{sec:intro} The decay of radiogenic isotopes and slow cooling process are one of reasons to drive the gigantic thermal engine of the Earth. The geological dynamics induces mountain building, volcanoes and plate tectonics, etc. Another very important result of the geological dynamics is the geomagnetic field, which is generated in the liquid iron core via a thermal dynamo mechanism in the Earth's core cooling and freezing process\citep{Pozzo-nature}. A recent review article by Williams\citep{williams-2018} concluded that, the thermal conductivity of iron alloys under the extreme temperature and pressure is a very critical parameter for the heat flow out of Earth's core at present. It is also important for the inferred age of Earth's inner core. It will also help us understand the thermal evolution of Earth's core and lowermost mantle. Thus, it is significant to investigate the thermal transport property and the dynamical evolution of the Earth's core. As we all know, the Earth's inner-solid core is mainly composed of metal iron (Fe)\citep{Tateno359}. For example, in the previous experimental measurements, the isothermal equation of state of $\epsilon-$iron (hcp phase) and $\gamma-$iron (fcc phase) indicates that the inner core is mainly composed of pure solid iron\citep{Anderson}. It was further confirmed that the Earth's core consists of a molten iron alloy outer core surrounding a solid inner-core of $\epsilon-$iron\citep{Seagle}. Previous $ab~initio$ calculations\citep{Pozzo-EPSL,Pourovskii} predict a high thermal conductivity for $\epsilon-$iron generally assumed to form the inner core. Although some other researches showed that the Earth's inner core is not pure Fe\citep{Fe-phase-1,Fe-phase-2,Fe-phase-3,Fe-phase-4}, from fundamental research point of view, it is still significant to study the pure-phase Fe at the Earth's core conditions. Despite the efficiency of heat transfer process in Earth's core determines the dynamics of convection and limits the power available for the geodynamo directly\citep{Seagle}, prediction of heat transfer of $\epsilon-$iron under the extreme Earth's core conditions, most critically the electronic and lattice thermal conductivities, still remain unclear because of intrinsic experimental and theoretical difficulties\citep{Ross}. For instance, in 2016, the experimental studies from two research groups of Ohta et al.\citep{Ohta} and Konopkova et al.\citep{Konopkova} present opposite results for the thermal conductivity. \section{Theory} Taking theoretical investigation as an example, the previous theoretical studies adopted the Kubo-Greenwood method to evaluate $\kappa_{el}$ of iron at the Earth's core conditions\citep{Pozzo-nature, Koker-pnas, Pozzo-EPSL, Pourovskii}. However, these studies adopted the Kubo-Greenwood formula as starting point for evaluation of kinetic coefficients, and in this process the electron-electron interaction is not included\citep{Seagle}. In addition, a theoretical work shows that the $\epsilon-$iron is found to behave as a nearly perfect Fermi liquid and the quadratic dependence of the scattering rate in Fermi liquids leads to a modification of the Wiedemann-Franz law (WFL) with suppression of the $\kappa_{el}$ as compared to the electrical one. The strongly correlated electron system significantly increases the electron-electron thermal resistivity, which is found to be of comparable magnitude to that induced by the electron-phonon interaction\citep{Pourovskii}. This is why we need to consider the electron-electron scattering when evaluating the $\kappa_{el}$ at the Earth's core conditions. \begin{figure}[ht!] \centerline{\includegraphics[width=1.0\linewidth,clip]{fig-1.jpg}} \caption{\textbf{(a)} illustrates the simulation model ($\epsilon-$iron) at inner core boundary (ICB) conditions used in our NEAIMD simulations. Fixed boundary conditions at both ends are adopted and the vacuum layers outside of the fixed layers are set up. The periodic boundary conditions are applied in the two lateral directions. \textbf{(b)} is the temperature profile from a representative NEAIMD simulation. \textbf{(c)} is the effective amplitude of electrostatic potential oscillation (EPO) from NEAIMD along the heat flux direction. Here, the representative NEAIMD simulation of $\epsilon-$iron is at 6377.60\,K and 330.68\,GPa and simulation time is 9~ps.} \label{fig:1} \end{figure} Recently, we developed a new methodology based on direct non-equilibrium $ab~initio$ molecular dynamics (NEAIMD) calculations, which can simultaneously predict the electronic thermal conductivity and lattice (phonon) thermal conductivity of pure metals under the first-principles framework\citep{Yue}. Here, we apply our newly developed methodology\citep{Yue} to evaluate the electronic ($\kappa_{el}$) and phononic ($\kappa_{ph}$) thermal conductivities of $\epsilon-$iron at the inner core boundary (ICB) and the core mantle boundary (CMB). Our methodology can directly predict the electronic and phononic thermal conductivities of pure iron metal at the Earth's core conditions with high accuracy, without necessity of explicitly addressing any complicated scattering process of free electrons\citep{Yue}. This method also provides a new physical picture to describe the electronic thermal transport. Because the NEAIMD we adopt here is based on the Born-Oppenheimer approximation, it means that during every molecular dynamics step the electronic wave functions will have self-consistent calculation based on the Kohn-Sham equations to reach the convergence criteria. In this process the electron-electron interactions are naturally included, which is one of the major advantages of our NEAIMD method\citep{Yue}. Here, our simulation results as shown below are comparable to some previous theoretical studies\citep{Pozzo-EPSL,Davies-nature, Pourovskii, Secco}. It is shown that the thermal conductivity of $\epsilon-$iron in the Earth's core is high, which corresponds to a recent experimental result\citep{Ohta}. This can support the point of view that the Earth's core rapid cooling leads to an inner core younger than 0.7 billion years\citep{Ohta,Labrosse}. Then, a geophysical inference can be obtained that the abrupt increase in palaeomagnetic field intensity 1.3 billion years ago\citep{Ohta,Biggin} may not be related to the Earth's core birth. Moreover, different from the conventional WFL theory, the methodology we referred herein describes the electronic thermal transport with a new physical concept. The vibrations of ions will induce the electrostatic potential oscillation (EPO) in space. The physical picture we propose is that, the local EPO can drive the valance shell electrons to collectively oscillate. Then, in the momentum space, the free electrons which are near the Fermi surface could be excited above the Fermi surface and gain the additional thermal kinetic energy simultaneously. Higher temperature corresponds to larger and faster atomic vibration, which will lead to stronger EPO in space. Then, the thermally excited electrons (TEEs) from the high-temperature region will possess more kinetic energy than those in the low-temperature region. When a stable distribution of the thermal kinetic energy of TEEs in space is established along $\nabla \vec{T}$ (temperature gradient), the heat flux carried by TEEs $\vec{J}_{el}$ and $\kappa_{el}$ can be calculated eventually\citep{Yue}. In principle, this methodology includes all the interactions and scattering process of electrons, such as complex electron-electron interactions and electron-phonon interactions. This method does not depend on any artificial parameters and approximations. Thus, it can provide accurate results of $\kappa_{el}$ of pure metals. In addition, the non-equilibrium $ab~initio$ molecular dynamics-electrostatic potential oscillation (NEAIMD-EPO) method can predict the phononic thermal conductivity ($\kappa_{ph}$) of metals simultaneously. Therefore, the NEAIMD-EPO method provides us full access to evaluate the heat transfer process of $\epsilon-$iron in Earth's core conditions. More specific details of the methodology can be found in our recent paper\citep{Yue}. \begin{figure}[th] \centerline{\includegraphics[width=1.0\linewidth,clip]{fig-2.jpg}} \caption{System temperature \textbf{(a)} and pressure \textbf{(b)} oscillate with respect to time for a representative NEAIMD simulation of $\epsilon-$iron at the inner-core boundary (ICB) conditions.} \label{fig:2} \end{figure} \section{Computational Methods} We perform NEAIMD simulations through the modified the Vienna $ab~initio$ Simulation Package (VASP)\citep{Stephen, vasp01, vasp02}, with the Perdew-Wang (PW91) functional\citep{PW91-01, PW91-02} and the projector augmented wave (PAW) method\citep{PAW01,PAW02}. The electronic exchange-correlation is treated using the generalized-gradient approximation (GGA) of Perdew et al.\citep{GGA}. In achieving good accuracy for iron at high-pressures, the choice of orbitals that can be treated as valence orbitals is crucial\citep{Gilles}. At ambient pressure, reasonable accuracy can be obtained by treating all atomic states up to and including $3p$ as core states, but this is not satisfactory here because the $3p$ states respond significantly at high pressure\citep{Gilles}. This is mainly because of the fact that $\epsilon-$iron under extreme conditions behaves as a Fermi liquid\citep{Pourovskii}. In contrast, We have tested the effect on the conductivity of the inclusion in valence of semi-core $3s$ and $3p$ states. We found that inclusion of $3s$ states in the atomic core gives insignificant errors, provided that the nonlinear core corrections are included\citep{Gilles,3s-error}. Thus, the $3p^6 4s^1 3d^7$ valence electronic configuration is adopted in this study and the core radii is $\rm 1.16~\overset{\circ}{A}$\citep{Gilles, Pozzo-EPSL, Pozzo-nature}. The single atomic orbitals are expanded in plane-waves with an energy cutoff of $\rm 400~eV$. The electronic energy levels are occupied according to the Fermi-Dirac statistics, with electronic temperature corresponding to the real system temperature (two temperature model). All the calculation details are provided in Sec.~1 of Supplementary Information (SI). To examine the correctness of our strategy for adopting the pseudo-potential, we also calculate the thermal conductivity of b.c.c iron at ambient condition. The total thermal conductivity (electronic + phononic) of b.c.c iron is obtained to be $\rm 83.68~W/(mK)$ at $\rm 296~K$, which is in very well agreement with the experimental data of $\rm 80.2~W/(mK)$ at $\rm 300~K$ and the previous theoretical research\citep{RE-Cohen,bcc-Alfe}. The b.c.c iron results are presented in Sec.~2.6 of SI. An efficient extrapolation of the charge density was used to speed up the NEAIMD simulations\citep{Alfe} by sampling the Brillouin zone (BZ) with the $\Gamma$ point only. The temperature was controlled with Andersen thermostat\citep{Andersen-Thermostat} and the timestep was set as $\rm 1~fs$. We run simulations for typically $\rm 8-10~ps$, from which we discarded the first $\rm 0.3~ps$ to allow the system to reach equilibrium. We realize the atomic heat flux in NEAIMD via the M\"uller-Plathe algorithm\citep{Muller-Plathe}. In the M\"uller-Plathe method, the kinetic energies of the atoms (nuclei) in the heat source and heat sink are continuously exchanged. After sufficient simulation time, we can establish a relatively steady temperature gradient in metals. Figs.~\ref{fig:1}(a,~b) exhibit a representative $\epsilon-$iron model ($4\times4\times8$ supercell including 256 atoms) for NEAIMD-EPO simulation and the corresponding temperature profile under the ICB (6377.60~K, 330.68~GPa) condition, respectively. An animation of iron atom movement for a representative NEAIMD-EPO simulation is also provided as Supplemental Materials. \begin{figure}[th] \includegraphics[width=1.0\linewidth,clip]{fig-3.jpg} \caption{The variation of electrostatic potential oscillation (EPO) in space with simulation time (where we normalize the test charge number to 1). The plotting data originates from the 9-ps NEAIMD-EPO simulation of $\epsilon-$iron at the inner-core boundary (ICB) condition (6377.60~K, 330.68~GPa).} \label{fig:3} \end{figure} \section{Results} Throughout the NEAIMD-EPO simulation, we can obtain the spatial distribution and the dynamical evolution of the electrostatic potential $U(R)$, where $R$ represents the ion position\citep{Yue}. Fig.~\ref{fig:1}(c) presents the statistical results of the effective amplitudes of the EPO in NEAIMD for $\epsilon-$iron lattice in space. Fig.~\ref{fig:2} exhibits the evolution of system pressure and temperature with respect to simulation time for the entire NEAIMD run as presented in Fig.~\ref{fig:1}. To intuitively demonstrate the dynamic evolution of spatial EPO, we plot the spatial EPO with simulation time in Fig.~\ref{fig:3}. We can observe the local electric-field variation between neighboring atom layers, and the local-field directions continually changing with time. The local electric-field variation will drive the collective vibration of whole free electrons in it, and then in momentum space the free electrons near the Fermi surface could be thermally excited. The local electric-filed oscillation will provides additional kinetic energy to the TEEs through the collective oscillating process of the free electrons in it\citep{Yue}. Fig.~\ref{fig:1}(c) shows the distribution of the effective amplitude of EPO ($\overline{U}_{EPO}(l)$) per atoms-layer along the $\nabla \vec{T}$, where $l$ is the index for atom layers. Moreover, the amplitude distribution of EPO indicates that how the thermal kinetic energy of TEEs is divided in space. More information of the average effective amplitude of EPO of $\epsilon-$iron at different Earth's core conditions can be found in Sec.~2.3 of SI. Here, we calculate $\overline{U}_{EPO}(l)$ using the root mean square (RMS) method\citep{Yue}: \begin{eqnarray} \overline{U}_{EPO}(l)=\frac{1}{N_{al}}\sum_{j=1}^{N_{al}}\sqrt{\frac{1}{n_{steps}}\sum_{t_{i}}^{n_{steps}}(U_{j}(t_{i})-\overline{U}_{j})^2}, \end{eqnarray} where $n_{steps}$ is the simulation steps, $U_{j}(t_{i})$ is the value of the electrostatic potential $U$ for atom $j$ in a specific layer at the specific time step $t_{i}$, and $\overline{U}_{j}$ is the average value of $U_{j}(t_{i})$. Then, the electronic heat flux $\vec{J}_{el}$ according to the kinetic energy of TEEs between two adjacent atom layers can be defined as\citep{Yue}: \begin{eqnarray} \vec{J}_{el}&=&-\frac{n(e)\cdot e\cdot n_{steps}}{S\cdot t}\frac{\partial\overline{U}_{EPO}(l)}{\partial N_{l}}, \end{eqnarray} where $S$ represents the cross-sectional area of the simulation model, $t$ is simulation time, $n(e)$ is the valance electrons number per atoms layer, and $\frac{\partial\overline{U}_{EPO}(l)}{\partial N_{l}}$ is the gradient in space of the effective amplitude value of EPO via the linear fitting for $\overline{U}_{EPO}(l)$ with the atom layer index $N_{l}$ in Fig.~\ref{fig:1}(c) (excluding heat source and heat sink layers). See the theoretical details in Sec.~2.1 of SI. Finally, based on the Fourier\rq s law we can calculate $\kappa_{el}$ of $\epsilon-$iron as\citep{Yue}: \begin{eqnarray} \kappa_{el}=\frac{n(e)\cdot e \cdot n_{steps}}{\nabla T \cdot S\cdot t}\frac{\partial\overline{U}_{EPO}(l)}{\partial N_{l}}, \end{eqnarray} where $\nabla T$ can be obtained via the linear fitting for temperature profile. The data of a representative case are shown in Fig.~\ref{fig:1}(b). \begin{table} \caption{ The electronic ($\kappa_{el}$) and phononic ($\kappa_{ph}$) part of thermal conductivity of $\epsilon-$iron at Earth's core conditions obtained from our NEAIMD-EPO method. Some previous theoretical (based on Kubo-Greenwood method) and experimental results (based on the Wiedemann-Franz law and direct measurement) are also given for comparison. The unit of thermal conductivities is $\rm W/(mK)$. } \label{tb-1} \begin{tabular}{*{5}{|c}|} \hline Condition & P~(GPa) & ~~T~(K)~~ & $\kappa_{el}$ & $\kappa_{ph}$ \\ \hline Solid (CMB) & 136 & 3741 & 198 [this work] & 11 \\% & 24 & 6\\%136.44 & 3740.81 & 198.09 & 10.67 & 23.90\\ Solid (CMB) & 137 & 3916 & 184 [this work] & 13 \\%& 15 & 6 \\%136.74 & 3915.86 & 183.77 & 13.47 & 14.55 \\ \hline Solid (ICB) & 316 & 5289 & 199 [this work] & 13 \\%& 9 & 3 \\% 316.20 & 5289.47 & 198.74 & 12.95 & 9.00\\ Solid (ICB) & 324 & 5905 & 167 [this work] & 11 \\%& 11 & 3 \\ Solid (ICB) & 327 & 5544 & 182 [this work] & 11 \\%& 9 & 3 \\ Solid (ICB) & 327 & 5835 & 174 [this work] & 12 \\%& 10 & 3 \\ Solid (ICB) & 331 & 6378 & 179 [this work] & 12 \\%& 9 & 3 \\ Solid (ICB) & 361 & 5435 & 198 [this work] & 15 \\%& 17 & 5\\ Solid (ICB) & 362 & 5662 & 201 [this work] & 13 \\%& 13 & 4 \\ Solid (ICB) & 365 & 6239 & 189 [this work] & 13 \\%& 11 & 4\\ \hline \hline Solid (ICB) & 329 & 5500 & 286 \citep{Pozzo-EPSL} & \\%& & \\ Solid (ICB) & 364 & 5500 & 297 \citep{Pozzo-EPSL} & \\%& & \\ Solid (ICB) & 329 & 5700 & 294 \citep{Pozzo-EPSL} & \\%& & \\ Solid (ICB) & 364 & 5700 & 307 \citep{Pozzo-EPSL} & \\%& & \\ \hline Solid (ICB) & $\rm \sim330$ & 6000 & $\rm \sim190$ \citep{Pourovskii} & \\%& & \\ \hline Liquid (CMB) & 134 & 4700 & 160 \citep{Pozzo-nature} & \\ Solid (ICB) & 320 & 6250 & 243 \citep{Pozzo-nature} & \\%& & \\ Solid (ICB) & 329 & 6350 & 247 \citep{Pozzo-nature} &\\%& & \\ Solid (ICB) & 339 & 6435 & 248.5 \citep{Pozzo-nature} & \\%& & \\ \hline Solid (ICB) & 360 & 8000 & 270 \citep{Koker-pnas} &\\%& & \\ \hline Solid (ICB) & 342 & 6000 & 210 \citep{Koker-pnas} &\\%& & \\ \hline Liquid (CMB) & 140 & 3750 & 226 measured by \citep{Ohta} (WFL) &\\%& & \\ \hline Liquid (CMB) & 136 & 3750 & 67-145 measured by \citep{Seagle} (WFL) & \\%& & \\ \hline Liquid (CMB) & 136 & 3800 & 33 directly measured by \citep{Konopkova} & \\%& & \\ Solid (ICB) & 330 & 5600 & 46 directly measured by \citep{Konopkova} & \\%& & \\ \hline \end{tabular} \end{table} \begin{figure}[th] \includegraphics[width=1.0\linewidth,clip]{fig-4.jpg} \caption{The corresponding integration of the heat flux from the atomic kinetic energy part with time for the case shown in Figs.~\ref{fig:1}. Here, the slope defines the phonon heat flux which can be used to calculate phonon thermal conductivity.} \label{fig:4} \end{figure} Additionally, via integrating the atomic heat flux in the M\"uller-Plathe algorithm, as shown in Fig.~\ref{fig:4}, we can estimate the $\kappa_{ph}$ of $\epsilon-$iron at the Earth's core conditions simultaneously. Here, we adopt an approximation usually used in statistical physics: with sufficient simulation time, the time-average values of $\kappa_{el}$ and $\kappa_{ph}$ should be equal to the ensemble-average values. We have performed the test for the convergence of simulation time and system size. Because of the size-effect limitation, the NEAIMD method will underestimate the $\kappa_{ph}$. We also implemented the phonon Boltzmann transport equation (BTE) method\citep{shengbte01,shengbte02,shengbte03} to calculate the $\kappa_{ph}$ of $\epsilon-$iron for comparison. However, because that the fourth- and higher order anharmonicity of phonons will become very important at high temperature\citep{Yue-RRA}, the phonon BTE method would overestimate the $\kappa_{ph}$. The details of discussion for $\kappa_{ph}$ can be found in Sec.~2.8 of SI. The main simulation results are presented in TABLE.~\ref{tb-1} and Fig.~\ref{fig:5}. We also calculated the errors of $\kappa_{el}$ in TABLE.~\ref{tb-1} via the $\kappa_{el}$ expression and error propagation theory\citep{Ku}, which mainly stems from the gradient of $\overline{U}_{EPO}(l)$ and $\nabla T$\citep{Yue}. The errors of $\kappa_{el}$ and more details are provided in Sec.~2.9 of SI. The non-linear effect analysis from temperature and simulation size for $\kappa_{el}$ of $\epsilon-$iron are shown in Sec.~2.4 of SI. The errors of $\kappa_{ph}$ estimated in TABLE.~\ref{tb-1} mainly originate from the the nonlinearity of the temperature gradient $\nabla T$. To intuitively see the $\kappa_{el}$ results from NEAIMD-EPO method, in Fig.~\ref{fig:5} we also plot the $\kappa_{el}$ of $\epsilon-$iron from this work and previous theoretical and experimental data in Fig.~\ref{fig:5} with different color bars in 3D style. Our results at ICB conditions are comparable to the previous theoretical works from Kubo-Greenwood (KG) formula\citep{Pozzo-EPSL, Koker-pnas}. Especially, they are well consistent with the recent theoretical research by Pourvoskii, et al.\citep{Pourovskii}. In the research of Pozzo et al.\citep{Pozzo-EPSL}, they reported that the $\kappa_{el}$ of pure solid $\epsilon$-iron at $\rm 5500~K$ and $\rm 329~GPa$ is $\rm 286~W/(mK)$, which is larger than the value $\kappa_{el}$ at $\rm 6000~K$ and $\rm 342~GPa$ reported by Koker et al\citep{Koker-pnas}. In research by Pourvoskii et al.\citep{Pourovskii}, they demonstrate that the electron-electron scattering effect can be comparable to the electron-phonon scattering. They treat the $\epsilon-$iron as strongly correlated electrons system ``Fermi-liquids" and consider both the electron-phonon and electron-electron scattering. The Fermi-liquid model seems to be more accurate to describe the thermal transport of $\epsilon-$iron under ICB conditions. However, as the many-body problem is too complicated, there could still lack of some complicated interactions and scattering mechanism of electrons compared with the real situation. Then, they modify the WFL and give a prediction of $\kappa_{el}$ of perfect $\epsilon-$iron crystal phase at Earth's core conditions as $\rm \sim 190~W/(mK)$ at $\rm \sim 330~GPa$ and $\rm \sim 6000~K$. This value is smaller than previous theoretical predictions by Pozzo et al.\citep{Pozzo-EPSL} and Koker et al.\citep{Koker-pnas}. In addition, our $\kappa_{el}$ results of $\epsilon-$iron at Earth's core conditions are also compatible with some recent experimental measurements\citep{Ohta,Seagle}. \begin{figure*} \includegraphics[width=0.9\linewidth,clip]{fig-5.jpg} \caption{The electronic thermal conductivities of $\epsilon-$iron under the Earth's core conditions (CMB and ICB). The red and green bars represent the results from NEAIMD-EPO method and previous studies, respectively.} \label{fig:5} \end{figure*} In comparison, our NEAIMD-EPO method\citep{Yue} can directly simulate the thermal transport process in pure metals. In principle, our method inherently includes all electron-electron and electron-phonon scattering process. Thus, the NEAIMD-EPO method can theoretically reveal the real physical picture of the thermal transport in $\epsilon-$iron at the Earth's core conditions. Our results in TABLE.\ref{tb-1} ($\rm 179~W/(mK)$ at $\rm 331~GPa$, $\rm 6378~K$) are very close to the value of $\rm \sim 190~W/(mK)$ by Pourvoskii, et al.\citep{Pourovskii} under the similar temperature and pressure conditions. The slight difference can be attributed to two facts: (1) the temperature effect; (2) since our method includes all the scatterings of electrons theoretically, our $\kappa_{el}$ result ($\rm 179~W/(mK)$) is slightly lower than the $\kappa_{el}$ ($\rm \sim 190~W/(mK)$) from Pourovskii et al.\citep{Pourovskii}. Our results of $\kappa_{el}$ of $\epsilon-$iron at ICB and CMB conditions are also consistent with one of experimental works by Ohta, et al.\citep{Ohta}, which confirm the high thermal conductivity of the Earth's core. In addition, another advantage of our NEAIMD-EPO method is that, under the NEAIMD-EPO framework we do not need to figure out the electron collision lifetime $\tau_{el}$, which is usually obtained by the Matthiessen's rule and mainly originates from the electron-phonon interaction (EPI) and is generally very difficult and complicated to accurately evaluate. \section{Conclusion} To conclude, based on first-principles calculations, we use our newly developed methodology of direct non-equilibrium $ab~initio$ molecular dynamics simulation coupled with the electrostatic potential oscillation (named as ``NEAIMD-EPO method") to simulate the real thermal transport process of $\epsilon-$iron under the Earth's core conditions. The NEAIMD-EPO method can describe the thermal transport in the Earth's core conditions in a new physical picture. The method intrinsically includes all electron-electron scatterings and electron-phonon scatterings, and can predict the electronic and phononic thermal conductivity simultaneously. The NEAIMD-EPO method is parameter free and shows robustness in the simulations of the thermal transport process of $\epsilon-$iron at the Earth's core conditions. Our simulation results are comparable to and are consistent with some recent theoretical and experimental works and confirm that the thermal conductivity of $\epsilon-$iron in the Earth's core is high. The NEAIMD-EPO method provides a new approach to study the thermal transport properties of metals in extreme conditions. We also expect that our work could be helpful for clarifying the physical nature of the thermodynamic evolution in the Earth's core. \subparagraph{Data availability} Authors can confirm that all relevant data are included in the paper and the supplementary information files. \acknowledgments All simulation details can be found in the Supplement Information. The authors thank Dr. Stephen Stackhouse (University of Leeds) for fruitful and insightful discussions. The authors also gratefully acknowledge the computing time granted by the John von Neumann Institute for Computing (NIC) and provided on the supercomputer JURECA at J\"ulich Supercomputing Centre (JSC) (Project No. JHPC25 and JHPC46). M.H. acknowledges the start-up fund from the University of South Carolina. \section{Author contributions} S.-Y.Y. performed the simulations and analysis. M.H. supervised the project. S.-Y.Y. and M.H. write the paper. \section{Additional information} \subparagraph{Competing interests} The authors declare no competing financial interests.
\section{Appendix} \subsection{Extending Binary Lift to $n$-Ary Lift}\label{def:n-ary-lift} The binary lift can naturally be extended to an $n$-ary lift by recursively combining two streams into a stream partially applied functions until the final result is obtained: \begin{definition}[$n$-Ary Lift] The $n$-ary \emph{lift} is given as \[\sem{\mathbf{lift}(f)(e_1, \ldots, e_n)}_{s_1, \ldots, s_k} = \mathsf{lift_n}(f)(\sem{e_1}_{s_1, \ldots, s_k}, \ldots, \sem{e_n}_{s_1, \ldots, s_k})\] where {\small \begin{align*} \mathsf{lift}_n & \in (𝔻_1 × \cdots × 𝔻_n \rightarrowtail 𝔻') → (𝓢_{𝔻_1}×\cdots×𝓢_{𝔻_n}→𝓢_{𝔻'})\\ \mathsf{lift}_n(f)(w_1,\dots,w_n) &= \mathsf{liftrec}(f)(w_1,\dots,w_n)\\ \mathsf{liftrec}(f)(w) &= \mathsf{lift}_1(f_1)(w)\\ \mathsf{liftrec}(f)(w_1,\dots,w_{n-1},w_n) &= \mathsf{lift}_2(f_n)(\mathsf{liftrec}(f)(w_1,\dots,w_{n-1}), w_n)\\ f_1(s_1) &= λ(x_2, \dots, x_{\mathsf{arity}(f)}).f(s_1, x_2, \dots, x_n)\\ f_i(f', x_i) &= λ(x_{i+1}, \dots, x_{\mathsf{arity}(f)}).\begin{cases} f'(x_i, \dots, x_n)&\text{if } f'≠⊥\\ f(⊥,\dots⊥,x_i, \dots,x_n)&\text{if } f'=⊥ \end{cases}\\ f_{\mathsf{arity}(f)}(f', e) &= \begin{cases} f'(e)&\text{if } f'≠⊥\\ f(⊥,\dots⊥,e)&\text{if } f'=⊥ \end{cases} \end{align*}} \end{definition} \subsection{Proofs for Expressiveness Theorems in Section~\ref{sec:properties}} \label{sec:expressiveness-proofs} \begin{customTheorem}{3}[Expressiveness of TeSSLa Without Delay]\label{thm:expressiveness-no-delay} Every function $f \in \mathcal S_{\mathbb D_1} \times \ldots \times \mathcal S_{\mathbb D_k} \to \mathcal S_{\mathbb D'_1} \times \ldots \times \mathcal S_{\mathbb D'_n}$ on streams can be represented as a TeSSLa specification without delay iff it is \begin{inparaenum}[a)] \item monotonic and continuous, \item timestamp conservative and \item future independent. \end{inparaenum} \end{customTheorem} \begin{proof} The function $f$ can be represented as the iterative function $\tilde f \in \mathbb M \cup \{\bot\} \times (\mathbb D_1 \cup \{\bot\} \times \ldots \times \mathbb D_k \cup \{ \bot \})^n \times \mathbb T \to \mathbb M$ with $\tilde f(m, d, t) = m'$, which takes a memory state $m$, the current input values $d$, and the corresponding current timestamp $t$ and returns the new memory state $m'$. Based on this memory state the function $\tilde o \in \mathbb M \to \mathbb D'_1 \cup \{\bot\} \times \ldots \times \mathbb D'_n \cup \{\bot\}$ provides the output events for all output streams. For a single input stream $x \in \mathcal S_{\mathbb D}$ and a single output stream $y \in \mathcal S_{\mathbb D}$ the relation between $f$ and its iterative step function $\tilde f$ and the output function $\tilde o$ can be described using an inductively defined function $g \in \mathbb M \cup \{\bot\} \times \mathcal S_{\mathbb D} \to \mathcal S_{\mathbb D}$, s.t. $f(x) = y = g(\bot, x)$. $g$ executes $\tilde f$ and $\tilde o$ for every event of the input stream: $g(m, tdw) = t\tilde o(m')g(m', w)$ and $g(m, t) = t$ where $m' := \tilde f(m, d, t)$. $g$ can be naturally extended to tuples of input and output streams by synchronizing the events by their timestamps and fill in missing events with $\bot$. Because $f$ is monotonic it is sufficient to compute the output events step by step because $f$ is future independent it is sufficient to allow $\tilde f$ to store arbitrary information about the past events and because $f$ is timestamp conservative it is sufficient to execute $\tilde f$ for every timestamp in the input events. Using this representation we can translate $f$ into the following equivalent TeSSLa specification with input variables $x_1, \ldots, x_k$ and output variables $y_1, \ldots, y_n$: \begin{align*} t &:= \mathbf{time}(\mathbf{merge}(x_1, \ldots, x_k)) \\ m &:= \mathbf{lift}(\tilde f)(\mathbf{last}(m, t), x_1, \ldots, x_k, t) \\ \forall_{i \le n}\ y_i &:= \mathbf{lift}(\tilde o_i)(m) \end{align*} The other direction follows immediately from the fact that every TeSSLa specification without delay is monotonic and continuous, timestamp conservative and future independent. \end{proof} \begin{customTheorem}{4}[Expressiveness of TeSSLa With Delay]\label{thm:expressiveness-delay} Every function $f \in \mathcal S_{\mathbb D_1} \times \ldots \times \mathcal S_{\mathbb D_k} \to \mathcal S_{\mathbb D'_1} \times \ldots \times \mathcal S_{\mathbb D'_n}$ can be represented as a TeSSLa specification with delay iff it is \begin{inparaenum}[a)] \item monotonic and continuous and \item future independent. \end{inparaenum} \end{customTheorem} \begin{proof} By removing the timestamp conservatism requirement we need to accompany the step-function $\tilde f$ and the output function $\tilde o$ with a timeout function $\tilde u$ which is evaluated on every new memory state and can return the timestamp of the next evaluation of $\tilde f$ if no input event happens before. One timeout function is sufficient because the step-function $\tilde f$ can perform arbitrary computations and store arbitrary state in order to simulate multiple timeouts. The inductively defined function $g \in \mathbb M \cup \{\bot\} \times \mathcal S_{\mathbb D} \to \mathcal S_{\mathbb D}$ executes $\tilde f$ and $\tilde o$ now for every event of the input stream and every due timeout, s.t. $f(x) = y = g(\bot, x)$: \begin{align*} g(m, tdw) &= \begin{cases} t \tilde o(m') g(m', w) \text{ with } m' := \tilde f(m, d, t) &\text{if } t \le \tilde u(m) \\ \tilde u(m) \tilde o(m') g(m', tdw) \text{ with } m' := \tilde f(m, \bot, \tilde u(m)) &\text{otherwise } \end{cases}\\ g(m, t) &= \begin{cases} t &\text{if } t \le \tilde u(m) \\ \tilde u(m)\tilde o(m')g(m', t) \text{ with } m' := \tilde f(m, \bot, \tilde u(m)) &\text{otherwise} \end{cases} \end{align*} Using this representation we can translate $f$ into the following equivalent TeSSLa specification with input variables $x_1, \ldots, x_k$ and output variables $y_1, \ldots, y_n$: \begin{align*} t &:= \mathbf{time}(\mathbf{merge}(x_1, \ldots, x_k, \mathbf{delay}(d, \mathbf{merge}(x_1, \ldots, x_k)))) \\ d &:= \mathbf{time}(t) - \mathbf{lift}(\tilde u)(m) \\ m &:= \mathbf{lift}(\tilde f)(\mathbf{last}(m, t), x_1, \ldots, x_k, t) \\ \forall_{i \le n}\ y_i &:= \mathbf{lift}(\tilde o_i)(m) \qedhere \end{align*} \end{proof} \subsubsection{Constructive Delay Elimination}\label{sec:delay-elimination-proof} The following lemma and its proof show constructively how to validate the delay operator in a special case of the more general \autoref{thm:expressiveness-no-delay}. \begin{lemma}[Delay Elimination] For every TeSSLa specification $\phi$ with $\sem\phi \in \mathcal S_{\mathbb D_1} \times \ldots \times \mathcal S_{\mathbb D_k} \to \mathcal S_{\mathbb U} \times \mathcal S_{\mathbb D'_1} \times \ldots \times \mathcal S_{\mathbb D'_n}$ with one delay operator there exists a TeSSLa specification $\phi'$ without a delay operator, which derives a boolean stream $z \in \mathcal S_{\mathbb B}$, s.t. for any input streams $x_1,\ldots,x_k$ and any output streams $y_1, \ldots, y_n$ and any stream $d \in \mathcal S_{\mathbb U}$ we have $\sem\phi(x_1, \ldots, x_k) = d, y_1, \ldots, y_n$ iff $\sem{\phi' |_z}(x_1, \ldots, x_k, d, y_1, \ldots, y_n)$ where $d$ is the stream derived immediately through the delay operator. \end{lemma} \begin{proof} We construct the validating specification $\phi'$ from the generating specification $\phi$: We show how to convert the TeSSLa specification $\phi$, which derives new output streams, into the TeSSLa specification $\phi'$, which validates that the output streams were derived according to $\phi$. The specification $\phi'$ derives all the streams except $d$ in the same way as $\phi$ does. The stream $d$ was derived in $\phi$ using the delay operator and is provided as input to $\phi'$. The specification $\phi'$ now validates if the derived streams are equivalent to the input streams $y_1, \ldots, y_n$. In order to check two streams for equivalence one has to assert the equivalence of the timestamps and the values separately, i.e. for every two streams $y,y' \in \mathcal S_{\mathbb D}$ we assert $\op{time}(y) = \op{time}(y') \wedge y = y'$, where $=$ denotes the lifted equal function on $\mathbb D$. Next we have to assert the correct derivation of $d$: Assuming that $\phi$ contains $d = \mathbf{delay}(a,r)$ we derive the effective delays in absolute time by distinguishing three cases: We accept the new delay on $a$ either when the old delay is due or together with an event on $r$. Events on $r$ without a new delay on $a$ can reset the effective delay to $\infty$: \begin{align*} a' := \mathbf{merge}(\ &\mathbf{filter}(\mathbf{last}(a', a) = \mathbf{time}(a), \mathbf{time}(a) + a),\\ & \mathbf{filter}(\mathbf{time}(r) = \mathbf{time}(a), \mathbf{time}(a) + a),\\ & \mathbf{const}(\infty)(\mathbf{merge}(r, \mathbf{unit}))\ ) \end{align*} Now we assert at all events $t := \mathbf{merge}(a, r, d)$ that either the delay was fulfilled by an event on $d$, i.e. $\mathbf{merge}(\mathbf{time}(d), \mathbf{zero}) = \mathbf{last}(a', t)$ or the delay is not due and there was no event on $d$, i.e. $\mathbf{time}(t) > \mathbf{merge}(\mathbf{time}(d), \mathbf{zero}) \wedge \mathbf{last}(a', t) > \mathbf{time}(t).$ The boolean stream $z$ is derived as conjunction of all these assertions. \end{proof} \subsection{Translating TeSSLa$_\text{bool}$-Operators to DFST} \label{booltrans} The function toDFST builds the transducers for a single equation of a TeSSLa$_\text{bool}$-formula $\phi$:\\ % $\mathbf{toDFST}(z := \mathbf{nil}) = (\emptyset,\{z\} \to \op{Val},\{s\},s,\delta)$ with $\delta(s,\emptyset) = (s,\{z \mapsto \bot\})$\\ % $\mathbf{toDFST}(z := \mathbf{unit}) = (\emptyset,\{z\} \to \op{Val},\{s_0,s_1\},s_0,\delta)$ with\\ $\delta(s_0,\emptyset) = (s_1,\{z \mapsto \testrue \})$ and $\delta(s_1,\emptyset) = (s_1,\{z \mapsto \bot\})$.\\ % $\mathbf{toDFST}(z := \mathbf{lift}(f)(a^0,\dots,a^n)) = (\{a^{i\le n}\} \to \op{Val},\{z\} \to \op{Val}, \{s,s_e\},s,\delta)$ consists of two states: $s$ where the transducer loops for every input and applies $f$ to the inputs to compute the output and the sink $s_e$ which is reached when one of the input streams ends:\\ $\delta(s, h) = \begin{cases} (s,\{z \mapsto g(b^0, \dots, b^n)\}) & \text{if } \forall i. h(a^i) \in \{\testrue, \tesfalse, \bot\} \\ (s_e, \{z \mapsto \op{<}'\}) & \text{if } \exists i. h(a_i) = \op{<}'\\ (s_e,\{z \mapsto g(b^0, \dots, b^n)'\} ) & \text{otherwise}, \end{cases}$\\ where $b^i = \begin{cases} \testrue & \text{if } h(a^i) \in \{\testrue, \testrue' \} \\ \tesfalse & \text{if } h(a^i) \in \{\tesfalse, \tesfalse' \} \\ \bot & \text{otherwise} \end{cases}$ \\ and $g(b^0, \dots, b^n) = \begin{cases} \bot &\text{if } \forall i. b^i = \bot \\ f(b^0, \dots, b^n) &\text{otherwise} \end{cases}$ $\mathbf{toDFST}(z := \mathbf{last}(a,b))$ has three states: It stays in the initial state as long as no event on $a$ occurred. The other two states remember the last value that occurred on $a$. For every trigger event on $b$, the value of the current state is the output. Three additional states ensure the proper handling of inclusive and exclusive stream endings. \noindent $\mathbf{toDFST}(z := \mathbf{last}(a,b)) = (\{a, b\} \to \op{Val}, \{z\} \to \op{Val},\{s_0,s_\testrue,s_\tesfalse,s_w,s_v,s_e\},s_0,\delta)$. For the definition $\delta$ we use the following abbreviations: $\testf = \{\testrue, \tesfalse\}$ and $a_x = \{a \mapsto x\}$ for $x \in \{\bot, \testrue, \tesfalse\}$ and $a'_x = \{a \mapsto x'\}$ for $x \in \{<, \bot, \testrue, \tesfalse\}$ and $a^?_x = \{a \mapsto x\}$ for $x \in \op{Val}$: \begin{align*} \delta(s_0, a_\bot \cup b_y) &= (s_0, z_\bot)\\ \delta(s_0, a_{x \in \testf} \cup b_y) &= (s_x, z_\bot)\\ \delta(s_0, a'_x \cup b'_y) &= (s_e, z'_\bot)\\ \delta(s_0, a_x \cup b'_y) &= (s_w, z_\bot)\\ \delta(s_0, a'_x \cup b_y) &= (s_v, z_\bot)\\ \delta(s_{d \in \testf}, a_\bot \cup b_\bot) &= (s_d, z_\bot)\\ \delta(s_{d \in \testf}, a_{x \in \testf} \cup b_\bot) &= (s_x, z_\bot)\\ \delta(s_{d \in \testf}, a_\bot \cup b_{y \in \testf}) &= (s_d, z_d)\\ \delta(s_{d \in \testf}, a_{x \in \testf} \cup b_{y \in \testf}) &= (s_x, z_d)\\ \delta(s_{d \in \testf}, a'_x \cup b_y) &= (s_v, z_\bot)\\ \delta(s_{d \in \testf}, a^?_x \cup b'_{y \in \{<,\bot\}}) &= (s_e, z'_y)\\ \delta(s_{d \in \testf}, a^?_x \cup b'_{y \in \testf}) &= (s_e, z'_d)\\ \delta(s_w, a_\bot \cup b^?_y) &= (s_w, z_\bot)\\ \delta(s_w, a_{x \in \testf} \cup b^?_y) &= (s_e, z'_\bot)\\ \delta(s_w, a'_x \cup b^?_y) &= (s_e, z'_\bot)\\ \delta(s_v, a^?_x \cup b_\bot) &= (s_v, z_\bot)\\ \delta(s_v, a^?_x \cup b'_\bot) &= (s_e, z'_\bot)\\ \delta(s_v, a^?_x \cup b^?_{y \in \{<, \testrue, \tesfalse\}}) &= (s_e, z'_<) \end{align*} $\mathbf{toDFST}(z := \mathbf{slift}(\geq)(\mathbf{time}(a), \mathbf{time}(b))$ consists of three initialization states remembering on which input streams an event already occurred. When on both streams an event occurred the transducer transits in a fourth state in which it stays until one stream ends. In this loop the output is true for every event on $a$ and false for events occurring only on $b$: \noindent $\mathbf{toDFST}(z := \mathbf{slift}(\geq)(\mathbf{time}(a), \mathbf{time}(b))) =$\\ \strut\qquad $ (\{a, b\} \to \op{Val},\{z\} \to \op{Val},\{s_\bot,s_a,s_b,s_c,s_e\},s_\bot,\delta)$ with \begin{align*} \forall s: \delta(s,a_\bot \cup b_\bot) &= (s,z_\bot)\\ \forall s: \delta(s,a'_< \cup b^?_{y \not= <}) &= (s_e,z'_<)\\ \forall s: \delta(s,a^?_{x \not= <} \cup b'_<) &= (s_e,z'_<)\\ \forall s: \delta(s,a'_\testf \cup b_\testf) &= \delta(s,a_\testf \cup b'_\testf) = (s_e,z'_\testrue)\\ \forall s: \delta(s,a'_\testf \cup b'_\testf) &= (s_e,z'_\testrue)\\[1ex] % \delta(s_\bot,a_{x \in \testf} \cup b_\bot) &= (s_a,z_\bot)\\ \delta(s_\bot,a_\bot \cup b_{y \in \testf}) &= (s_b,z_\bot)\\ \delta(s_\bot,a_\testf \cup b_\testf) &= (s_c,z_\testrue)\\ \delta(s_\bot,a'_{x \neq <} \cup b_\bot) &= \delta(s_\bot,a'_\bot \cup b_\testf) = (s_e,z'_\bot)\\ \delta(s_\bot,a'_\bot \cup b'_\testf) &= (s_e,z'_\bot)\\ \delta(s_\bot,a_\bot \cup b'_{y \not= <}) &= \delta(s_\bot,a_\testf \cup b'_\bot) = (s_e,z'_\bot)\\ \delta(s_\bot,a'_\testf \cup b'_\bot) &= (s_e,z'_\bot)\\[1ex] % \delta(s_a,a_\testf \cup b_\bot) &= (s_a,z_\bot)\\ \delta(s_a,a_\bot \cup b_\testf) &= (s_c,z_\tesfalse)\\ \delta(s_a,a_\testf \cup b_\testf) &= (s_c,z_\testrue)\\ \delta(s_a,a'_{x \not= <} \cup b_\bot) &= (s_e,z'_\bot)\\ \delta(s_a,a'_\bot \cup b_\testf) &= \delta(s_a,a'_\bot \cup b'_\testf) = (s_e,z'_\tesfalse)\\ \delta(s_a,a_\bot \cup b'_\testf) &= (s_e,z'_\tesfalse)\\ \delta(s_a,a^?_{x \neq <} \cup b'_\bot) &= (s_e,z'_\bot)\\[1ex] % \delta(s_b,a_\bot \cup b_\testf) &= (s_b,z_\bot)\\ \delta(s_b,a_\testf \cup b^?_y) &= (s_c,z_\testrue)\\ \delta(s_b,a_\bot \cup b'_{y \not= <}) &= (s_e,z'_\bot)\\ \delta(s_b,a'_\bot \cup b^?_{y \neq <}) &= (s_e,z'_\bot)\\ \delta(s_b,a'_\testf \cup b_\bot) &= (s_e,z'_\testrue)\\ \delta(s_b,a_\testf \cup b'_\bot) &= \delta(s_b,a'_\testf \cup b'_\bot) = (s_e,z'_\testrue)\\[1ex] % \delta(s_c,a_\bot \cup b_\testf) &= (s_c,z_\tesfalse)\\ \delta(s_c,a_\testf \cup b^?_y) &= (s_c,z_\testrue) \\ \delta(s_c,a'_\bot \cup b_\bot) &= \delta(s_c,a_\bot \cup b'_\bot) = (s_e,z'_\bot)\\ \delta(s_c,a'_\bot \cup b_\testf) &= \delta(s_c,a'_\bot \cup b'_\testf) = (s_e,z'_\tesfalse)\\ \delta(s_c,a'_\testf \cup b_\bot) &= (s_e,z'_\testrue)\\ \delta(s_c,a_\bot \cup b'_\testf) &= (s_e,z'_\tesfalse)\\ \delta(s_c,a_\testf \cup b'_\bot) &= \delta(s_c,a'_\testf \cup b'_\bot) = (s_e,z'_\testrue) \end{align*} \subsection{Timed Transducers}\label{timedTransducers} A \emph{timed finite state transducer (TFST)} is a 6-tuple $R = (\Sigma, \Gamma, Q, q_0, C, \delta)$ which extends DFSTs with a set of clocks $C$ and $\delta: Q \times \Sigma \times \Theta(C) \rightarrow Q \times 2^C \times \Gamma$ where $\Theta(C)$ is the set of clock constraints. A clock constraint $\vartheta \in \Theta(C)$ is defined over the grammar $\vartheta ::= true \mid T \leq x + c \mid T \geq x + c \mid \neg \vartheta \mid \vartheta \land \vartheta$, where $x \in C$, and $c \in \mathbb T$ is a constant and $T$ refers to the current time. $\delta$ now also takes a clock constraint and provides a set of clocks that have to be reset to $T$ when taking this transition. For an input word $w = (t_0,w_0)(t_1,w_1)(t_2,w_2)\dots$ we call a sequence $s_0,v_0 \xrightarrow[o_0]{(t_0,w_0),\vartheta_0,r_0} s_1,v_1 \xrightarrow[o_1]{(t_1,w_1),\vartheta_1,r_1} s_2,v_2 \xrightarrow[o_2]{(t_2,w_2),\vartheta_2,r_2} \cdots$ a run of a TFST $R$ where $v_i: C \rightarrow \mathbb{R}$ are functions mapping every clock to its current value iff $s_0 = q_0$, $\forall c \in C: v_0(c) = 0$ and for all $i \geq 0$, $\delta(s_i,w_i,\vartheta_i) = (s_{i+1},r_i,o_i)$, $v_{i+1} = v_i[c \leftarrow t_i]$ for all $c \in R$ and $t_i,v_i \models \vartheta_i$ (which means $\vartheta_i$ resolved to \emph{true} if $T$ is replaced with $t_i$ and the corresponding values from $v_i$ are used for the clocks). The output of such a run is the sequence $\sem R(w) = t_0o_0t_1o_1t_2o_2\ldots \in (\mathbb T \times \Gamma)^\infty$. TFSTs resemble timed automata using the notion of clock constraints from~\cite{clocks}. A TFST is called \textit{deterministic}, or DTFST, iff for any two different transitions $\eta_1, \eta_2 \in \delta$ their conjuncted clock constraints $\vartheta_{\eta_1} \land \vartheta_{\eta_2}$ are unsatisfiable. \subsection{Translating TeSSLa$_\text{bool+c}$ to DTFST} \label{timedtrans} The transducers translated from a single equation in a TeSSLa$_\text{bool+c}$-formula $\phi$ are build as before. Instead of the timestamp comparison we translate the new type of equation $\op{toDTFST}(z := \mathbf{lift}(g_v)(\mathbf{time}(e), \mathbf{last}(\mathbf{time}(a),e))) = {}$\\ $\quad (\{a,e\} \to \op{Val}, \{z\} \to \op{Val},\{s_0,s_v,s_e\},s_0,\{c_a\},\delta)$ with $g_v(t_1, t_2) = t_1 \lessgtr t_2 + v$: \begin{align*} \delta(s_0,e_\bot \cup a_\bot, \op{true}) &= (s_0,\emptyset,z_\bot)\\ \delta(s_0,e_\bot \cup a_{y\in\testf}, \op{true}) &= (s_0,\{c_a\},z_\bot)\\ \delta(s_0,e_\bot \cup a'_y,\op{true}) &= (s_v,\emptyset,z_\bot)\\ \delta(s_0,e_{x\in\testf} \cup a_\bot, T\lessgtr c_a + v) &= (s_0,\emptyset,z_\testrue)\\ \delta(s_0,e_{x\in\testf} \cup a_\bot, \neg( T\lessgtr c_a + v)) &= (s_0,\emptyset,z_\tesfalse)\\ \delta(s_0,e_{x\in\testf} \cup a_{y\in\testf}, T\lessgtr c_a + v) &= (s_0,\{c_a\},z_\testrue)\\ \delta(s_0,e'_{x \in \{<,\bot\}} \cup a^?_y, \op{true}) &= (s_e,\emptyset,z'_x)\\ \delta(s_0,e'_{x \in \testf} \cup a^?_y, T\lessgtr c_a + v) &= (s_e,\emptyset,z'_\testrue)\\ \delta(s_0,e'_{x \in \testf} \cup a^?_y, \neg( T\lessgtr c_a + v)) &= (s_e,\emptyset,z'_\tesfalse)\\ \delta(s_v, e_{y \in \testf} \cup a^?_x, \op{true}) &= (s_e, \emptyset, z'_<)\\ \delta(s_v, e_\bot \cup a^?_x, \op{true}) &= (s_v, \emptyset, z_\bot)\\ \delta(s_v, e'_\bot \cup a^?_x, \op{true}) &= (s_e, \emptyset, z'_\bot)\\ \delta(s_v, e'_{y \in \{<, \testrue, \tesfalse\}} \cup a^?_x, \op{true}) &= (s_e, \emptyset, z'_<) \end{align*} This transducer stays in its initial state $s_0$ until one stream ends: For every $a$ it resets the clock to save the value of $a$. For every $b$ it produces an output on $z$ according to the fulfilment of the current clock constraint. The states $s_v$ and $s_e$ handle the stream endings similarly to the transducer for the \textbf{last} operator. \subsection{TeSSLa Transducer (TT)}\label{sec:TT} Finally we introduce TeSSLa transducers as a new transducer type with the same expressiveness as full TeSSLa with arbitrary time computations, an arbitrary data domain over unbounded data structures and the delay operator, which can create new timestamps. To resemble the delay's behaviour we define: A \emph{TeSSLa Transducer (TT)} is a TFST with an extended transition function, which adds $\epsilon$-transitions with clock constrains, which do not consume an input symbol, but still produce an output symbol. These have to be taken when possible but can only be taken once for every point in time. The run of a TT is extended appropriately. \begin{definition}[Transition Function of a TT] The transition function of a TT is $\delta: Q \times (\Sigma \cup \{\epsilon\}) \times \Theta(C) \rightarrow Q \times 2^C \times \Gamma$. \end{definition} \begin{definition}[Run of a TT] For an input word $w = (t_0,w_0)(t_1,w_1)(t_2,w_2)\ldots$ we call a sequence \[ s_0,v_0\xrightarrow[o_0]{\sigma_0,\tau_0,\vartheta_0,r_0} s_1,v_1 \xrightarrow[o_1]{\sigma_1,\tau_1,\vartheta_1,r_1} s_2,v_2 \xrightarrow[o_2]{\sigma_2,\tau_2,\vartheta_2,r_2} \cdots \] a run of a TT if for all $i \geq 0$: $\sigma_i = \epsilon \land v_i, \tau_i \models \vartheta_i \ \lor\ \sigma_i = w_j \land \tau_i = t_j$ and $\tau_i < \tau_{i+1}$ and $\forall t_j: \exists \tau_k: t_j = \tau_k$ and $\forall t \in (\tau_i, \tau_{i+1}]: t, v_i \models \vartheta_i \Rightarrow t = \tau_{i+1}$, where $v_i: C \rightarrow \mathbb{R}$ are functions mapping every clock to its current value iff $s_0 = q_0$, $\forall c \in C: v_0(c) = 0$ and for all $i \geq 0$, $\delta(s_i,\sigma_i,\vartheta_i) = (s_{i+1},r_i,o_i)$, $v_{i+1} = v_i[c \leftarrow \tau_i]$ for all $c \in r_i$ and $\tau_i,v_i \models \vartheta_i$, i.e. $\vartheta_i$ resolves to true if $T$ is replaced with $\tau_i$ and every $x \in C$ is replaced with the clock's current value $v(x)$. The output of such a run is the sequence $\sem R(w) = \tau_0o_0\tau_1o_1\tau_2o_2\dots \in (\mathbb{T} \times \Gamma)^\infty$. \end{definition} We call a TT deterministic (or DTT for short), iff its clock constraints fulfil the same property as the ones of a deterministic TFST. \paragraph{Translating TeSSLa to DTT} We extend the value domain in the previous construction to arbitrary data types $\mathbb D$ and hence get $\op{Val}_{\mathbb D} = \{\bot, d, <', \bot', d' \mid d \in \mathbb D\}$. In case of the last operator instead of the two states $s_{x \in \testf}$ we now have (possibly infinitely many) states $s_{x \in \mathbb D}$. We no longer need translations for special expressions containing the $\mathbf{time}$ operator, but we can now directly translate the time operator itself and we add the translation of the additional $\mathbf{delay}$ operator. In the following we assume $T$ always to be the corresponding $\tau_i$ shown in the run before: $\op{toDTT}(z := \mathbf{time}(a)) = (\{a\} \to \op{Val}_{\mathbb D},\{z\} \to \op{Val}_{\mathbb D},\{s_0,s_e\},s_0,\emptyset,\delta)$: \begin{align*} \delta(s_0,a_\bot, \op{true}) &= (s_0,\emptyset, \emptyset)& \delta(s_0,a_{d \neq \bot}, \op{true}) &= (s_0, z_T, \emptyset)\\ \delta(s_0,a'_{d \not\in \{<,\bot\} },\op{true}) &= (s_e, z'_T, \emptyset)& \delta(s_0,a'_{d \in \{<,\bot\} },\op{true}) &= (s_e,z'_d, \emptyset) \end{align*} The initial state of $\op{toDTT}(z = \mathbf{delay}(a,b))$ represents that no delay is set. When a new delay is accepted the transducers transits into the corresponding state storing the delay and resets the clock. An outgoing transition guarded with a clock constrained checks if the delay timed out and produces a unit symbol on $z$. Either a new delay is set simultaneously or the transition goes back to the initial state. Formally, the transducer is given by $\op{toDTT}(z = \mathbf{delay}(a,b)) = ((\{a\} \to \op{Val}_{\mathbb T}) \cup (\{b\} \to \op{Val}_{\mathbb D}),\{z\}\to\op{Val}_{\mathbb U},\{s,s_e,s^b\} \cup \{s_d, s_d^a, s_d^b \mid d \in \mathbb{T}\},s,\{c_b\},\delta)$ with \begin{align*} \delta(s, a_\bot \cup b_\bot, \op{true}) &= (s, z_\bot,\emptyset)\\ \delta(s, a_{x\neq\bot} \cup b_{y\neq\bot}, \op{true}) &= (s_x, z_\bot,\{c_b\}\\ \delta(s, a_{x\neq\bot} \cup b_\bot, \op{true}) &= (s, z_\bot,\emptyset)\\ \delta(s, a_\bot \cup b_{y\neq\bot}, \op{true}) &= (s, z_\bot,\emptyset\\ \delta(s, a'_{x \in \mathbb{T}} \cup b_{y\neq\bot}, \op{true}) &= (s^a_x, z_\bot,\{c_b\})\\ \delta(s, a'_{x \not\in \mathbb{T}} \cup b_{y\neq\bot}, \op{true}) &= (s^e, z'_\bot,\emptyset)\\ \delta(s, a'_x \cup b_\bot, \op{true}) &= (s^e, z'_\bot, \emptyset)\\ \delta(s, a_\bot \cup b'_y, \op{true}) &= (s^b, z_\bot, \emptyset)\\ \delta(s, a_{x \in \mathbb{T}} \cup b'_\bot, \op{true}) &= (s^b, z_\bot, \emptyset)\\ \delta(s, a_{x \in \mathbb{T}} \cup b'_{y \neq \bot}, \op{true}) &= (s^b_x, z_\bot, \{c_b\})\\ \delta(s, a'_x \cup b'_y, \op{true}) &= (s^e, z'_\bot, \emptyset)\\[1ex] % \delta(s_d, \epsilon, T = d + c_b) &= (s, z_\unitsym, \emptyset)\\ \delta(s_d, \epsilon, T \neq d + c_b) &= (s_d, z_\bot, \emptyset)\\ \delta(s_d, a_\bot \cup b_\bot, T = d + c_b) &= (s, z_\unitsym, \emptyset)\\ \delta(s_d, a_\bot \cup b_\bot, T \neq d + c_b) &= (s_d, z_\bot, \emptyset)\\ \delta(s_d, a_{x\neq\bot} \cup b_\bot, T = d + c_b) &= (s_x, z_\unitsym, \{c_b\})\\ \delta(s_d, a_{x\neq\bot} \cup b_\bot, T \neq d + c_b) &= (s_d, z_\bot, \emptyset)\\ \delta(s_d, a_\bot \cup b_{x\neq\bot}, T = d + c_b) &= (s, z_\unitsym, \emptyset)\\ \delta(s_d, a_\bot \cup b_{x\neq\bot}, T \neq d + c_b) &= (s, z_\bot, \emptyset)\\ \delta(s_d, a_{x\neq\bot} \cup b_{y\neq\bot}, T = d + c_b) &= (s_x, z_\unitsym, \{c_b\})\\ \delta(s_d, a_{x\neq\bot} \cup b_{y\neq\bot}, T \neq d + c_b) &= (s_x, z_\bot, \{c_b\})\\ \delta(s_d, a'_{x \in \mathbb{T}} \cup b_\bot, T = d + c_b) &= (s^a_x, z_\unitsym, \{c_b\})\\ \delta(s_d, a'_{x \in \mathbb{T}} \cup b_\bot, T \neq d + c_b) &= (s^a_d, z_\bot, \emptyset)\\ \delta(s_d, a'_{x \notin \mathbb{T}} \cup b_\bot, T = d + c_b) &= (s^e, z'_\unitsym, \emptyset)\\ \delta(s_d, a'_{x \notin \mathbb{T}} \cup b_\bot, T \neq d + c_b) &= (s^a_d, z_\bot, \emptyset)\\ \delta(s_d, a_\bot \cup b'_y, T = d + c_b) &= (s^b, z_\unitsym, \emptyset)\\ \delta(s_d, a_\bot \cup b'_{y \in \{<, \bot\}}, T \neq d + c_b) &= (s^b_d, z_\bot, \emptyset)\\ \delta(s_d, a_\bot \cup b'_{y \not \in \{<, \bot\}}, T \neq d + c_b) &= (s^b, z_\bot, \emptyset)\\ \delta(s_d, a_{x \in \mathbb{T}} \cup b'_y, T = d + c_b) &= (s^b_x, z_\unitsym, \{c_b\})\\ \delta(s_d, a_{x \in \mathbb{T}} \cup b'_{y \in \{<, \bot\}}, T \neq d + c_b) &= (s^b_d, z_\bot, \emptyset)\\ \delta(s_d, a_{x \in \mathbb{T}} \cup b'_{y \not\in \{<, \bot\}}, T \neq d + c_b) &= (s^b_x, z_\bot, \{c_b\})\\ \delta(s_d, a'_x \cup b'_y, T = d + c_b) &= (s^e, z'_\unitsym, \emptyset)\\ \delta(s_d, a'_x \cup b'_y, T \neq d + c_b) &= (s^e, z'_\bot, \emptyset)\\[1ex] % \delta(s^a_d, \epsilon, T = d + c_b) &= (s^e, z'_\unitsym, \emptyset)\\ \delta(s^a_d, \epsilon, T \neq d + c_b) &= (s^a_d, z_\bot, \emptyset)\\ \delta(s^a_d, a^?_x \cup b_\bot, T = d + c_b) &= (s^e, z'_\unitsym, \emptyset)\\ \delta(s^a_d, a^?_x \cup b_\bot, T \neq d + c_b) &= (s^a_d, z_\bot, \emptyset)\\ \delta(s^a_d, a^?_x \cup b_{y\neq\bot}, T = d + c_b) &= (s^e, z'_\unitsym, \emptyset)\\ \delta(s^a_d, a^?_x \cup b_{y\neq\bot}, T \neq d + c_b) &= (s^e, z'_\bot, \emptyset)\\ \delta(s^a_d, a^?_x \cup b'_y, T = d + c_b) &= (s^e, z'_\unitsym, \emptyset)\\ \delta(s^a_d, a^?_x \cup b'_y, T \neq d + c_b) &= (s^e, z'_\bot, \emptyset)\\[1ex] % \delta(s^b, a_\bot \cup b^?_y, \op{true}) &= (s^b, z_\bot, \emptyset)\\ \delta(s^b, a_{x \in \mathbb{T}} \cup b^?_y, \op{true}) &= (s^b_x, z_\bot, \emptyset)\\[1ex] % \delta(s^b_d, \epsilon, T = d + c_b) &= (s^e, z'_<, \emptyset)\\ \delta(s^b_d, \epsilon, T \neq d + c_b) &= (s^b_d, z_\bot, \emptyset)\\ \delta(s^b_d, a^?_x \cup b^?_y, T = d + c_b) &= (s^e, z'_<, \emptyset)\\ \delta(s^b_d, a_\bot \cup b^?_y, T \neq d + c_b) &= (s^b_d, z_\bot, \emptyset)\\ \delta(s^b_d, a'_{x \not\in \mathbb{T}} \cup b^?_y, T \neq d + c_b) &= (s^b_d, z_\bot, \emptyset)\\ \delta(s^b_d, a^?_{x \in \mathbb{T}} \cup b^?_y, T \neq d + c_b) &= \begin{cases} (s^b_d, z_\bot, \emptyset) & \text{if } v(c_b) + d \leq T + x\\ (s^b_x, z_\bot, \{c_b\}) & \text{otherwise} \end{cases} \end{align*} \section{Conclusion} In this paper we presented the real-time specification language TeSSLa which operates on independent, timed streams and proved that it is suitable for online monitoring. We characterized the expressiveness of TeSSLa in terms of certain classes of stream-transforming functions. We also proved the equivalence of a boolean and a timed fragment of TeSSLa to respective classes of transducers and thereby obtained that equivalence for those fragments is in P and PSPACE, resp. These results facilitate advanced optimizations and static analyses of specifications, e.g. whether such a specification can generate certain outputs. We presented an implementation based on infinite-state transducers and sketched how TeSSLa is also suitable for parallelized implementations. \section{TeSSLa Implementations and Tool Support} \label{sec:implementation} The TeSSLa semantics presented in this paper allows multiple implementation styles: Centralized implementations using global memory which take one synchronized input word, as well as distributed implementations using message passing which take individual asynchronous input streams. Centralized implementations are based on the same idea as the transducers: A global step function triggers the reevaluation of all TeSSLa operators involved in the specification for one timestamp, i.e. until a delayed-labelled edge in the dependency graph is reached. This step function is either triggered by new input events or a timeout of a delay if that has a smaller timestamp. Therefore every delay can register its timeouts globally s.t. the programs main loop can check with every incoming new events if the step function must be triggered for earlier delays before handling the external input. This implementation form is well-suited for software implementations running on traditional CPUs because it minimizes the internal communication overhead. Because software implementations can use dynamic memory management, the integration of unbounded data structures is straightforward. A formalization of such transducers is given in Appendix~\ref{sec:TT}. As motivated in the introduction, one goal of TeSSLa's design is to allow distributed, parallel implementations with finite memory, e.g. on embedded systems or FPGAs. In this scenario we neither have dynamic memory management nor can we implement a global step function. Instead, every operator in the dependency graph is translated into a computation node with a fixed-size memory cell and finite input queues storing incoming events for every dependency. This setup has already been discussed for a preliminary non-recursive version of TeSSLa in~\cite{oldtessla}. The streams used in the TeSSLa semantics presented in this paper have an explicit notion of progress, which allows the local composition of TeSSLa operators without a global synchronization. Hence every computation node can produce a new output value if at least one input queue contains a new event and all other input queues contain at least progress until the timestamp of this event. The output value is sent to the input queues of all nodes depending on this node. While recursive equations in the transducers are solved by building the closure of the transducer created by applying the parallel composition to all computation nodes, in this message passing scenario we actually implement the Kleene chain of the fixed-point defined in the TeSSLa semantics in \autoref{def:tessla-semantics}: Progress and values are circulated in the cyclic graph of computation nodes until the progress increases no longer, which is exactly when the fixed point is reached. Since every computation node only produces new output events if there is enough progress on every input queue, we can guarantee that the fixed point is computed before new external events are processed. For practical evaluations of TeSSLa we implemented a TeSSLa compiler in Scala which parses the TeSSLa specification, performs static type checking and converts the specification to flat TeSSLa. Additionally we added a macro system to be able to specify more complex functions based on the basic TeSSLa operators. The macro system allows to build application-domain-specific standard libraries, which makes TeSSLa a very flexible and powerful but still convenient and easy-to-learn specification language. Furthermore, the types of the input streams are declared explicitly and the user can specify which streams should be contained in the output. Using the macro system, implicit application of $\mathbf{slift}$ to functions and implicit conversion from constants to constant signals, we can write the event counting example from the introduction as follows: \vskip-2ex {\centering \begin{minipage}[t]{8cm} \begin{lstlisting}[gobble=4,language=tessla,] def count[A](a: Events[A]) := { def c: Events[Int] := merge(last(c, a) + 1, 0) c } \end{lstlisting} \end{minipage} \begin{minipage}[t]{2.8cm} \begin{lstlisting}[gobble=4,language=tessla,] in x: Events[Unit] def y := count(x) out y \end{lstlisting} \end{minipage}\par} \noindent We combined the compiler with an interpreter written in Scala, which allows the usage of Java data structures. In order to apply TeSSLa for runtime verification we instrument the LLVM byte code of C programs and analyse this trace online with TeSSLa. This tool chain is available as a Docker container and a web IDE\footnote{\url{http://www.tessla.io}}. \section{Introduction} \noindent The essence of software verification is to check whether a program meets its specification. Runtime verification (RV) is an applied formal technique that has been established as a complement to traditional verification techniques such as model checking~\cite{leucker09brief,havelund05verify}. Compared to static verification, RV considers only a single run of a system and checks whether it satisfies a property. Thus, RV can be seen as a lightweight, but formal extension to testing and debugging. RV can be applied offline to previously recorded traces or online to evaluate correctness properties at the runtime of the system under scrutiny. Typically, a property to be checked is specified as a logical formula, e.g. in (past time) LTL, and then synthesized to a monitor which can evaluate a run~\cite{havelund_synthesizing_2002,bauer_runtime_2011}. Stream runtime verification (SRV)~\cite{bozzelli14foundations}, as pioneered by the language LOLA~\cite{LOLA,LOLA2}, takes a different approach by incrementally relating a set of input streams to a set of output streams. This allows not only the monitoring of correctness properties but also of quantitative measures. In this paper we introduce the novel temporal stream-based specification language TeSSLa which is tailored for SRV of cyber-physical systems, where timing is a critical issue. While traditional SRV approaches process event streams without considering timing information, TeSSLa supports timestamped events natively, which allows efficient processing of streams with sparse and fine-grained event sequences. Preliminary versions of TeSSLa have already been studied with regard to their usability to monitor trace data generated by embedded tracing units of processors~\cite{conirasdate}; how to implement stream-based monitors on hardware has been studied in theory~\cite{oldtessla} and practice~\cite{conirasrv}. These versions share the basic idea of transforming timed event streams but they did not allow for recursive equations and comprised only a set of ad-hoc operators. In this paper we define a minimal language with support for recursive definitions that allows us to obtain strong guarantees for evaluation algorithms, expressiveness results and meaningful fragments. While the practical applicability of such a language has been demonstrated by the previous papers, these papers lack a concise and clear theoretical basis and investigation. As an example for SRV, consider the following specification which checks whether a measured temperature stays within given boundaries. For every new event (measurement) on the temperature stream, new events on the derived streams \emph{low}, \emph{high} and \emph{unsafe} are computed: \begin{center} \begin{minipage}{6cm} \setlength{\belowdisplayskip}{0pt}\setlength{\abovedisplayskip}{1ex} \begin{align*} \mathit{low} &:= \mathit{temperature} < 3\\ \mathit{high} &:= \mathit{temperature} > 8\\ \mathit{unsafe} &:= \mathit{low} \vee \mathit{high} \end{align*} \end{minipage} \begin{minipage}{5cm} \input{intro/streams} \end{minipage} \end{center} SRV is a combination of complex event processing (CEP) and traditional RV approaches: Streams are transformed into streams and there is not only one final verdict but the output is a stream of the property being evaluated at every temperature change. Furthermore, the user gets more detailed information about why an error occurred by being able to distinguish between the two separate causes \emph{low} and \emph{high}. In the rest of this section we introduce the main features of TeSSLa and contrast them with related specification languages. The next section presents the language and its semantics formally, in \autoref{sec:properties} we present several results regarding the expressiveness of TeSSLa and in \autoref{sec:transducers} we focus on comparing (fragments of) the language to variants of (timed) automata. Finally in \autoref{sec:implementation} we discuss different approaches to implement TeSSLa monitors and present our TeSSLa tool suite. \paragraph{Asynchronous Streams} In the previous example of traditional SRV, every stream has an event for every step of the system. TeSSLa requires the events of all streams to be in a global order, but doesn't require all streams to have simultaneous events. As a consequence, both sparse and high-frequency streams can be modeled. As cyber-physical systems often give rise to streams at unstable frequencies or continuous signals, this asynchronous setting is especially suitable. Consider as an example a ring buffer where the number of write accesses should not exceed the number of read accesses too much: \begin{center} \begin{minipage}{6.9cm} \setlength{\belowdisplayskip}{0pt}\setlength{\abovedisplayskip}{1ex} \begin{align*} \mathit{numReads} &:= \mathbf{count}(\mathit{read})\\ \mathit{numWrites} &:= \mathbf{count}(\mathit{write})\\ \mathit{safe} &:= \mathit{numWrites} - \mathit{numReads} \le 2 \end{align*} \end{minipage} \begin{minipage}{5.1cm} \input{intro/async} \end{minipage} \end{center} Read and write events occur independently at different frequencies. The derived stream \emph{numReads} (\emph{numWrites}) counts the number of events of the input stream \emph{read} (\emph{write}). While the \emph{read} and \emph{write} streams contain only discrete events, the number of events can be seen as a piece-wise constant signal with the initial value of 0. The difference between the two signals is evaluated every time one of the two signals changes its value using the \emph{last known value} of both signals. We call this concept \emph{signal semantics}: TeSSLa handles internally only streams of discrete events, but one can express operators following signal semantics in TeSSla and hence these discrete events can be seen as those points in time where the signal changes its value. In these introductory examples operators are automatically lifted to signal semantics, which is formally introduced as the $\mathbf{slift}$ operator later. \paragraph{Recursive Equations} Like existing SRV approaches, TeSSLa relates a set of input streams to a set of output streams via mutually recursive equations, which allows self-references to the past, e.g. counting events of a stream \emph{x} as in the previous example is expressed in TeSSLa as follows: $\mathit{count} := \mathbf{merge}(\mathbf{last}(\mathit{count}, x) + 1, 0)$ The $\mathbf{last}$ operator outputs the last known value of the \emph{count} stream, on every event of the stream \emph{x}. The base of the recursion is provided by merging with 0, which is a stream with one initial event of value 0. Since $\mathbf{last}$ only refers to events strictly lying in the past, the unique solution of such recursive equations can be computed incrementally (see \autoref{sec:semantics}). \paragraph{Time as First-Class Citizen} In TeSSLa, every event has a timestamp which can be accessed via the $\mathbf{time}$ operator. Since every event has a timestamp which is referring to a global clock and is unique for its stream, accessing the timestamps of events serves two purposes: Accessing the global order of events by comparing timestamps and performing calculations with the timestamps. Consider e.g. the following specification which checks whether the lapse of time between two write events exceeds 5 time units and outputs the overtime if it does: \noindent \begin{minipage}{7cm} \setlength{\belowdisplayskip}{0pt}\setlength{\abovedisplayskip}{1ex} \begin{align*} \mathit{diff} &:= \mathbf{time}(\mathit{write}) - \mathbf{last}(\mathbf{time}(\mathit{write}), \mathit{write})\\ \mathit{error} &:= \mathbf{filter}(\mathit{diff} > 5, \mathit{diff} - 5) \end{align*} \end{minipage} \quad \begin{minipage}{4.5cm} \input{intro/time} \end{minipage} \vskip2pt In the example, the stream $\mathit{diff} - 5$ is filtered by the condition $\mathit{diff} > 5$. Note that the property violation is only reported when the delayed event happens. To report such errors as soon as possible, TeSSLa has the ability to create events at certain points in time via the $\mathbf{delay}$ operator. The following specification checks the same property but raises a unit event on the \textit{error} stream as soon as we know that there was no \textit{write} event in time: \begin{minipage}{6cm} \setlength{\belowdisplayskip}{0pt}\setlength{\abovedisplayskip}{1ex} \begin{align*} \mathit{timeout} &:= \mathbf{const}(5)(\mathit{write})\\ \mathit{error} &:= \mathbf{delay}(\mathit{timeout}, \mathit{write}) \end{align*} \end{minipage} \begin{minipage}{5cm} \input{intro/delay} \end{minipage} \vskip2pt The $\mathbf{delay}$ function works as a timer, which is set to a timeout value with the first argument and reset with any event on the second argument. In the example, the function $\mathbf{const}(5)(\mathit{write})$ maps the values of events to the constant value of 5, which is then used as timeout value. While in all the other examples the derived streams only contain events with timestamps taken from the input streams, in this example events with additional timestamps are generated. Like $\mathbf{last}$, the $\mathbf{delay}$ operator can be used in recursive equations, for example the equation \[ \mathit{period} := \mathbf{merge}(\mathbf{const}(5)(\mathbf{delay}(\mathit{period}, \mathbf{unit})), 5) \] produces an infinite stream with an event every 5 time units. The $\mathbf{merge}$ is used to provide a base case for the recursion and $\mathbf{const}$ is used to map the value of the generated events to 5 so that they can be used as the new timeout value. \paragraph{Efficient Parallel Evaluation} TeSSLa's design follows two principles to allow efficient evaluation on parallel hardware: \emph{Explicit memory usage} and \emph{local operator composition}. If TeSSLa operates only on streams with bounded data-types of constant size, then the operators only need finite memory because every operator only needs to store at most one data value. This allows implementations on systems without random access memory, e.g. FPGAs or embedded systems. TeSSLa consists of a small set of primitive operators which can be flexibly combined. The TeSSLa semantics is defined in a way that allows a local composition of the individual operators, which can be realized via message passing without the need for global synchronization. Because of an explicit notion of progress for every stream describing how far the stream is known, local message passing is also sufficient to compute solutions for the recursive TeSSLa equations. Implementing an efficient evaluation on FPGAs is part of our EU research project COEMS\footnote{\url{https://www.coems.eu}}. \subsubsection{Related Work and Comparison} LOLA~\cite{LOLA,LOLA2} is a synchronous stream specification language in the following sense: Events arrive in discrete steps and for every step, all input streams provide an event and all output streams produce an event, which means that it is not suitable for handling events with arbitrary real-time timestamps arriving at variable frequencies. The not yet formally published RTLola~\cite{rtlola} is an extension of LOLA which introduces asynchronous streams to perform aggregations over real-time intervals. A major difference between RTLola and TeSSLa is that RTLola focuses on splitting input streams and aggregating over them, whereas TeSSLa provides a more general framework that in particular allows the (recursive) definition of aggregation operators while giving strict memory guarantees at the same time. Focus~\cite{DBLP:series/mcs/BroyS01} is a formalism for the specification of stream-based systems. Their timed streams progress by discrete ticks that separate events inbetween, thereby allowing multiple events at the same timestamp. The synchronous stream programming languages Lustre~\cite{halbwachs87lustre}, Esterel~\cite{berry00foundations} and Signal~\cite{gautier87signal}, the stream specification language Copilot~\cite{pike10copilot} as well as the class of functional reactive programming (FRP) languages~\cite{eliot97functional} allow the description of the transformation in a linear style, i.e. an input stream is read chronologically and is thereby evaluated. TeSSLa also supports linear evaluation because there are no future-references and the number of past-references is limited by the specification size. The only complement to linear evaluation is the creation of additional events via the $\mathbf{delay}$ operator. Quantitative regular expressions (QREs)~\cite{QRE} and logics like Signal Temporal Logic (STL)~\cite{STL} and Time-Frequency Logic (TFL)~\cite{donze12ontemporal} allow the mapping from complete streams to one final verdict/quantity. They cannot generally be evaluated in a linear way. The idea used in TeSSLa of supporting signals and event streams has also been used for Timed Regular Expressions~\cite{TRE}, but those have two explicitly different stream types, where TeSSLa internally represents signals as event streams. Recently, synthesis of hardware-based monitors from stream specifications has become an important field: For LOLA~\cite{LOLA} constant memory bounds for an algorithm that evaluates well-formed specifications exist and for LOLA 2.0~\cite{LOLA2} future references must be eliminated to gain constant memory bounds. There has been work on synthesis of STL to FPGAs in different ways as well~\cite{eziostl2fpga,ezio17runtime}. \section{Expressiveness of TeSSLa} \label{sec:properties} We discuss the expressiveness of four different TeSSLa fragments: TeSSLa specifications without the delay operator can only produce events with timestamps which are already included in the input streams and TeSSLa specifications with the delay operator can produce arbitrary event patterns even without any input event. On the other hand we distinguish between TeSSLa specifications which use only bounded data structures, which can only consider finitely many past events, and those with unbounded data structures which can consider infinitely many past events in the computation of new events. To characterize functions which can be expressed in TeSSLa we define \emph{timestamp conservatism} and \emph{future independence} in addition to monotonicity and continuity. For a stream $a \in \mathcal S_{\mathbb D}$ we denote with $T(a)$ the set of timestamps present in the stream $a$ and for multiple streams $T(a_1, \ldots, a_n) := \bigcup_{1 \le i \le n} T(a_i)$. \begin{definition}[Timestamp Conservatism] We call a function $f \in \mathcal S_{\mathbb D_1} \times \ldots \times \mathcal S_{\mathbb D_k} \to \mathcal S_{\mathbb D'_1} \times \ldots \times \mathcal S_{\mathbb D'_n}$ on streams \emph{timestamp conservative} iff it does not introduce new timestamps, i.e. for input streams $a \in \mathcal S_{\mathbb D_1} \times \ldots \times \mathcal S_{\mathbb D_k}$ and output streams $b \in \mathcal S_{\mathbb D'_1} \times \ldots \times \mathcal S_{\mathbb D'_n}$ we have $f(a) = b$ implies $T(a) \supseteq T(b)$. \end{definition} Note that TeSSLa specifications without delay are timestamp conservative because only delay can introduce new timestamps. For a stream $a \in \mathcal S_{\mathbb D}$ we denote with $a|_t$ the prefix of $a$ with progress $t$. \begin{definition}[Future Independence] We call a function $f \in \mathcal S_{\mathbb D_1} \times \ldots \times \mathcal S_{\mathbb D_k} \to \mathcal S_{\mathbb D'_1} \times \ldots \times \mathcal S_{\mathbb D'_n}$ on streams \emph{future independent} iff output events only depend on current or previous events, i.e. for input streams $a \in \mathcal S_{\mathbb D_1} \times \ldots \times \mathcal S_{\mathbb D_k}$ and output streams $b \in \mathcal S_{\mathbb D'_1} \times \ldots \times \mathcal S_{\mathbb D'_n}$ we have $f(a) = b$ implies $\forall_{t \in \mathbb T}\ f(a_1|_t, \ldots, a_k|_t) = (b_1|_t, \ldots, b_n|_t)$. \end{definition} Note that every TeSSLa specification is future independent because the operators $\mathbf{last}$ and $\mathbf{delay}$ are the only operators referring to events with different timestamps and they refer only to previous events. The omitted proofs of the following theorems can be found in Appendix~\ref{sec:expressiveness-proofs}. \begin{theorem}[Expressiveness of TeSSLa Without Delay]\label{thm:expressiveness-no-delay} Every function $f \in \mathcal S_{\mathbb D_1} \times \ldots \times \mathcal S_{\mathbb D_k} \to \mathcal S_{\mathbb D'_1} \times \ldots \times \mathcal S_{\mathbb D'_n}$ on streams can be represented as a TeSSLa specification without delay iff it is \begin{inparaenum}[a)] \item monotonic and continuous, \item timestamp conservative and \item future independent. \end{inparaenum} \end{theorem} \begin{proofsketch} Represent the function $f$ as the iterative function $\tilde f(m, d, t) = m'$ taking a memory state $m$, the current input values $d$, and the corresponding current timestamp $t$ and returning the new memory state $m'$. Output events for all output streams can be derived from $m'$. Because $f$ is monotonic it is sufficient to compute the output events step by step; because $f$ is future independent it is sufficient to allow $\tilde f$ to store arbitrary information about the past events; and because $f$ is timestamp conservative it is sufficient to execute $\tilde f$ for every timestamp in the input events. Translate $f(x_1, \ldots, x_k) = y_1, \ldots, y_n$ into an equivalent TeSSLa specification: $t := \mathbf{time}(\mathbf{merge}(x_1, \ldots, x_k)),\ m := \mathbf{lift}(\tilde f)(\mathbf{last}(m, t), x_1, \ldots, x_k, t) \text{ and } \forall_{i \le n}\ y_i := \mathbf{lift}(\tilde o_i)(m)$. \end{proofsketch} If all data types in the TeSSLa specification $\phi$ are bounded, $\tilde f$ uses a finite memory cell $m$, which can only store a constant number of current and previous events. Monotonicity guarantees that we can compute output events incrementally and by future independence we know that knowledge about the previous events is sufficient to derive new events. From the combination of both properties we know that it is not necessary to queue (arbitrarily large) event sequences to compute the output events. Instead one memory cell (capable of storing one element of the data domain) per delay and per last operator in the specification is sufficient. Restricting TeSSLa to bounded data types allows TeSSLa implementations on embedded systems without addressable memory because then finite memory is sufficient. Such a restricted TeSSLa specification can compute new events only based on a finite number of current and previous events. \begin{theorem}[Expressiveness of TeSSLa With Delay]\label{thm:expressiveness-delay} Every function $f \in \mathcal S_{\mathbb D_1} \times \ldots \times \mathcal S_{\mathbb D_k} \to \mathcal S_{\mathbb D'_1} \times \ldots \times \mathcal S_{\mathbb D'_n}$ can be represented as a TeSSLa specification with delay iff it is \begin{inparaenum}[a)] \item monotonic and continuous and \item future independent. \end{inparaenum} \end{theorem} The proof accompanies the step-function $\tilde f$ with a timeout function $\tilde u$ which is evaluated on every new memory state. $\tilde u$ returns the timestamp of the next evaluation of $\tilde f$, which allows arbitrary event generation. The effect of $\tilde u$ can be realized using the \textbf{delay} operator. \noindent We call a stream \emph{Zeno} if it contains two timestamps $t_1$ and $t_2$ with infinitely many events between $t_1$ and $t_2$. With the delay operator it is possible to construct such Zeno streams because the timeout function is not restricted in any way. By Rice's theorem it is impossible to check for an arbitrary timeout function whether it only generates non-Zeno timestamp sequences. Hence, one would need to restrict allowed timeout functions more drastically, which would restrict the possible event sequences generated by a TeSSLa specification further than necessary. For that reason we decided to include the capability to generate Zeno streams with TeSSLa. As a consequence of \autoref{thm:expressiveness-delay} we obtain: \begin{corollary} A TeSSLa specification with multiple delays can be translated into an equivalent specification with only one delay. \end{corollary} TeSSLa with and without delay are closely related because TeSSLa without delay can verify the relation of given input/output streams with respect to a TeSSLa specification that uses delay. The delay is only needed to actively generate the events at specified times. In the following we denote with $\sem{\phi |_y}(x_1, \ldots, x_k) \in \mathbb B$ the boolean function indicating whether the boolean output stream $y \in \mathcal S_{\mathbb B}$ of the TeSSLa specification $\phi$ contains only events with value true for the input streams $x_1, \ldots, x_k \in \mathcal S_{\mathbb D_1} \times \ldots \times \mathcal S_{\mathbb D_k}$. \begin{theorem}[Delay Elimination] For every TeSSLa specification $\phi$ with $\sem\phi \in \mathcal S_{\mathbb D_1} \times \ldots \times \mathcal S_{\mathbb D_k} \to \mathcal S_{\mathbb D'_1} \times \ldots \times \mathcal S_{\mathbb D'_n}$ with delay operators there exists a TeSSLa specification $\phi'$ without delay operators, which derives a boolean stream $z \in \mathcal S_{\mathbb B}$, s.t. for any input streams $x_1, \ldots, x_k$ and output streams $y_1, \ldots, y_n$ we have $\sem\phi(x_1, \ldots, x_k) = y_1, \ldots, y_n$ iff $\sem{\phi' |_z}(x_1, \ldots, x_k, y_1, \ldots, y_n)$. \end{theorem} The above theorem follows from \autoref{thm:expressiveness-no-delay} and the fact that $\sem{\phi' |_z}$ is timestamp conservative, because the output stream $z$ only contain events when any input stream contains an event. See Appendix~\ref{sec:delay-elimination-proof} for a constructive proof of a slightly weaker lemma. \section{Formal Definition of the TeSSLa Core Language} \label{sec:semantics} \noindent In this section we introduce syntax and semantics of the minimal core of TeSSLa. In examples we use parametrized definitions, e.g $\mathbf{merge}(x, y) := …$ on top, which are expanded to their definitions until only core operators remain. \paragraph{Preliminaries} Given a partial order $(A, \le)$, a set $D⊆A$ is called \emph{directed} if $\forall a, b \in D: a \le b \vee b \le a$. $(A, \le)$ is called \emph{directed-complete partial order (dcpo)} if there exists a supremum $\bigvee D$ for every directed subset $D \subseteq A$. Let $f \in A \rightarrow B$ be a function and $(A, \le)$, $(B, \le')$ partial orders. $f$ is called \emph{monotonic} if it preserves the order, i.e. $\forall a_1, a_2 \in A: a_1 \le a_2 \Rightarrow f(a_1) \le' f(a_2)$. $f$ is called \emph{continuous} if it preserves the supremum, i.e. $\bigvee f(D) = f(\bigvee' D)$ for all directed subsets $D \subseteq A$. By the Kleene fixed-point theorem, every monotonic and continuous function $f: A \to A$ has a least fixed point $\mu f$ if $(A, \le)$ is a dcpo with a least element $⊥$. $\mu f$ is the least upper bound of the chain iterating $f$ starting with the bottom element: $\mu f = \bigvee \{ f^n(\bot) \mid n \in \mathbb N \}$. \paragraph{Syntax} A TeSSLa specification $\phi$ consists of a set of possibly mutually recursive stream definitions defined over a finite set of variables $𝕍$ where an equation has the form $x := e$ with $x∈𝕍$ and $$e ::= \mathbf{nil} ~|~ \mathbf{unit} ~|~ x ~|~ \mathbf{lift}(f)(e, …, e) ~|~ \mathbf{time}(e)~|~ \mathbf{last}(e, e)~|~ \mathbf{delay}(e, e).$$ All variables not occuring on the left-hand side of equations are \emph{input variables}. All variables on the left-hand side are \emph{output variables}. We call a TeSSLa specification \emph{flat} if it does not contain any nested expressions. Every specification can be represented as a flat specification by using additional variables and equations. \paragraph{Semantics} We define the semantics of TeSSLa in terms of an abstract time domain which only requires a total order and corresponding arithmetic operators: \begin{definition} A \emph{time domain} is a totally ordered semi-ring $(𝕋,0,1,+,·,≤)$ that is not negative, i.e. $∀_{t∈𝕋}\, 0 ≤ t$. \end{definition} \noindent We extend the order on time domains to the set $𝕋_∞ = 𝕋 ∪ {∞}$ with $∀_{t∈𝕋}\, t < ∞$. Conceptually, streams are timed words that are known inclusively or exclusively up to a certain timestamp, its progress, that might be infinite. A stream might contain an infinite number of events even if its progress is finite. \begin{definition} An \emph{event stream} over a time domain $𝕋$ and a data domain $𝔻$ is a finite or infinite sequence $s = a_0 a_1 \dots ∈ 𝓢_𝔻 = (𝕋·𝔻)^ω ∪ (𝕋·𝔻)^+ ∪ (𝕋·𝔻)^*·(𝕋_∞ ∪ 𝕋·{\streamincl})$ where $a_{2i} < a_{2(i+1)}$ for all $i$ with $0<2(i+1)<|s|$ ($|s|$ is $∞$ for infinite streams). The \emph{prefix relation} over $𝓢_𝔻$ is the least relation that satisfies $s \sqsubseteq s$, $u \sqsubseteq s$ if $uv \sqsubseteq s$ and $ut'\streamincl \sqsubseteq s$ if $ut \sqsubseteq s$, $t' < t$, $t∈𝕋_∞$ and $t'∈𝕋$. \end{definition} We say a stream has an event with value $d$ at time $t$ if in its sequence $d$ directly follows $t$. We say a stream is known at time $t$ if it contains a strictly larger timestamp or a non-strictly larger timestamp followed by a data value or $\bot$. Where convenient, we also see streams as functions $s \in 𝕋→𝔻∪{⊥,\mathrm{?}}$ such that $s(t) = d$ if the stream has value $d$ at time $t$, $s(t) = ⊥$ if it is known to have no value, and $s(t) = \mathrm{?}$ otherwise. We refer to the supremum of all known timestamps of a stream as inclusive or exclusive progress, depending on whether it is itself a known timestamp. The prefix relation realises the intuition of cutting a stream at a certain point in time while keeping or removing the cutting point. In the following, we present the denotation of a specification $\phi$ as a function between input streams and output streams. \begin{definition}[TeSSLa semantics]\label{def:tessla-semantics} Given a specification $\phi$ of equations $y_i := e_i$, every $e_i$ can be interpreted as a function of input streams $s_1, \ldots, s_k$ and output streams $s'_{1}, \ldots, s'_{n}$, that is composed of the primitive functions whose denotation is given in the rest of this section. Input variables are mapped to input streams, $\sem{x_i}_{s_1, \ldots, s_k, s'_{1}, \ldots, s'_{n}} = s_i$ and output variables to output streams, $\sem{y_i}_{s_1, \ldots, s_k, s'_{1}, \ldots, s'_{n}} = s'_i$. Thus for fixed input streams $s_1, \ldots, s_k$ and every $e_i$, we obtain a function $\sem{e_i}_{s_{1}, \ldots, s_{k}} \in \mathcal S_{\mathbb{D}'_{1}}\times \ldots \times \mathcal S_{\mathbb{D}'_{n}} \rightarrow \mathcal S_{\mathbb{D}'_{i}}$ and in combination a function $\sem{e_1,…,e_n}_{s_{1}, \ldots, s_{k}} \in \mathcal S_{\mathbb{D}'_{1}}\times \ldots \times \mathcal S_{\mathbb{D}'_{n}} \rightarrow \mathcal S_{\mathbb{D}'_{1}}\times \ldots \times \mathcal S_{\mathbb{D}'_{n}}$. We now define the denotation of a specification $\phi$ as the least fixed-point of this function. \begin{align*} \sem\phi &\in \mathcal S_{\mathbb{D}_{1}}\times \ldots \times \mathcal S_{\mathbb{D}_{k}} \rightarrow \mathcal S_{\mathbb{D}'_1}\times \ldots \times \mathcal S_{\mathbb{D}'_n}\\ \sem\phi &(s_{1}, \ldots, s_{k}) = \mu \left( \sem {e_1,…,e_n}_{s_{1}, \ldots, s_{k}} \right) \end{align*} \end{definition} The function $\sem{e_1,…,e_n}_{s_{1}, \ldots, s_{k}}$ is monotonic and continuous because all primitive TeSSLa functions defined later in this section are monotonic and continuous and both properties are closed under function composition and cartesian products. $(𝓢_𝔻, \sqsubseteq)$ and by extension $(𝓢_{𝔻_1} \times \ldots \times 𝓢_{𝔻_n}, \sqsubseteq \times \ldots \sqsubseteq)$ are dcpos. By the Kleene fixed-point theorem $\sem {e_1,…,e_n}_{s_{1}, \ldots, s_{k}}$ has a least fixed point, which is the least upper bound of its Kleene chain. Next we give the semantics of the primitive TeSSLa functions. The dependency of the input and output streams $s_{1}, \ldots, s_{k}, s'_1, ..., s'_n$ is assumed implicitly. \begin{definition} \emph{Nil} is a constant for the completely known stream without any events: $\sem{\mathbf{nil}} = ∞ \in 𝓢_𝔻$. \end{definition} \noindent We use the unit type $𝕌={\unitsym}$ for streams that can carry only the single value $\unitsym$. \begin{definition} \emph{Unit} is a constant for the completely known stream with a single unit event at timestamp zero: $\sem{\mathbf{unit}} = 0 \unitsym ∞ \in 𝓢_𝕌$ \end{definition} The following functions are given by specifying two conditions: the first for positions where an output event occurs, and the second where no output event occurs. Thereby the progress of the stream is defined indirectly as the position where the output can no longer be inferred from these conditions. \begin{definition} The \emph{time} operator returns the stream of the timestamps of another stream $\sem{\mathbf{time}(e)} = \mathsf{time}(\sem{e})$ where $\mathsf{time} \in 𝓢_𝔻 → 𝓢_𝕋$ is defined as $\mathsf{time}(s) = s'$ such that \[ ∀_{t} s'(t) = t ⇔ s(t) ∈ 𝔻 \qquad ∀_{t} s'(t) = ⊥ ⇔ s(t) = ⊥. \] \end{definition} The lift operator lifts an $n$-ary function $f$ from values to streams. The notation $A_1 \times \ldots \times A_n \rightarrowtail B$ denotes the set of functions where all $A_i$ and $B$ have been extended by the value $⊥$. \begin{definition} Unary \emph{lift} is defined as $\sem{\mathbf{lift}(f)(e)} = \mathsf{lift_1}(f)(\sem{e})$ where $\mathsf{lift}_1 \in (𝔻 \rightarrowtail 𝔻') → (𝓢_{𝔻}→𝓢_{𝔻'})$ is given by $\mathsf{lift}_1(f)(s) = s'$ such that \begin{align*} ∀_{t,d∈𝔻'} s'(t) = d &⇔ s(t) ∈ 𝔻 ∧ f(s(t)) = d\\ ∀_{t} s'(t) = ⊥ &⇔ s(t) = ⊥ ∨ s(t) ∈ 𝔻 ∧ f(s(t)) = ⊥. \end{align*} \end{definition} \begin{definition} Binary \emph{lift} is given as $\sem{\mathbf{lift}(f)(e_1, e_2)} = \mathsf{lift_2}(f)(\sem{e_1}, \sem{e_2})$ where $\mathsf{lift}_2 \in (𝔻_1 × 𝔻_2 \rightarrowtail 𝔻') → (𝓢_{𝔻_1}×𝓢_{𝔻_2}→𝓢_{𝔻'})$ is given by $\mathsf{lift}_2(f)(s,s') = s''$ s.t. \begin{align*} ∀_{t,d∈𝔻'} s''(t) = d &⇔ (s(t) ∈ 𝔻_1 ∨ s'(t) ∈ 𝔻_2) ∧ \mathsf{known}(t) ∧ f(s(t), s'(t)) = d\\ ∀_{t} s''(t) = ⊥ &⇔ (s(t) = ⊥ ∧ s'(t) = ⊥) ∨ \mathsf{known}(t) ∧ f(s(t), s'(t)) = ⊥ \end{align*} where $\mathsf{known}(t) := s(t) ≠ \mathrm{?} ∧ s'(t) ≠ \mathrm{?}$. \end{definition} The binary lift can naturally be extended to an $n$-ary lift by recursively combining two streams into a stream of tuples or partially applied functions until the final result is obtained (see Appendix~\ref{def:n-ary-lift}). Alternatively, the scheme of the binary lift can be easily extended to higher arities. \begin{example} \emph{Merge} combines events of two streams, prioritising the first one. \begin{minipage}{6.5cm} \setlength{\belowdisplayskip}{0pt}\setlength{\abovedisplayskip}{1ex} \[\mathbf{merge}(x, y) := \mathbf{lift}(\mathsf{mergeaux})(x, y)\] \begin{align*} \mathsf{mergeaux}(a≠⊥, b) &:= a\\ \mathsf{mergeaux}(⊥, b) &:= b \end{align*} \end{minipage} \begin{minipage}{4cm} \begin{tikzpicture}[events] \node[event, fill=red!10] at (1,0) (x1) {$6$}; \node[event, fill=red!10] at (3,0) (x2) {$4$}; \node[event, fill=red!10] at (4,0) (x3) {$2$}; \node[event, fill=blue!10] at (2,-1) (y1) {$5$}; \node[event, fill=blue!10] at (4,-1) (y2) {$7$}; \node[event, fill=red!10] at (1,-2) (z1) {$6$}; \node[event, fill=blue!10] at (2,-2) (z2) {$5$}; \node[event, fill=red!10] at (3,-2) (z3) {$4$}; \node[event, fill=red!10] at (4,-2) (z4) {$2$}; \path (0,0) node[left] {$x$} edge[|-] (x1) (x1) edge (x2) (x2) edge (x3) (x3) edge[->] (5,0); \path (0,-1) node[left] {$y$} edge[|-] (y1) (y1) edge (y2) (y2) edge[->] (5,-1); \path (0,-2) node[left] {$\mathbf{merge}(x,y)$} edge[|-] (z1) (z1) edge (z2) (z2) edge (z3) (z3) edge (z4) (z4) edge[->] (5,-2); \end{tikzpicture} \end{minipage} \end{example} \begin{example} \emph{Const} maps the values of all events of the input stream to a constant value: $\mathbf{const}(c)(a) := \mathbf{lift}(\mathsf{constaux}(c))(a)$ with $\mathsf{constaux}(c)(a) := c$. % Using $\mathbf{const}$ we can lift constants into streams representing a constant signal with this value, e.g. $\mathbf{true} := \mathbf{const}(\op{true})(\mathbf{unit})$ or $\mathbf{zero} := \mathbf{const}(0)(\mathbf{unit})$. \end{example} \begin{definition} The \emph{last} operator takes two streams and returns the previous value of the first stream at the timestamps of the second. It is defined as $\sem{\mathbf{last}(e_1, e_2)} = \mathsf{last}(\sem{e_1}, \sem{e_2})$ where $\mathsf{last}_{𝔻,𝔻'} \in 𝓢_𝔻 × 𝓢_{𝔻'} → 𝓢_𝔻$ is given as $\mathsf{last}(s, s') = s''$ such that \begin{align*} ∀_{t,d∈𝔻} s''(t) = d &⇔ s'(t) ∈ 𝔻' ∧ ∃_{t' < t} s(t') = d ∧ \mathsf{noData}(t', t)\\ ∀_{t} s''(t) = ⊥ &⇔ s'(t) = ⊥ ∧ \mathsf{defined}(t) ∨ ∀_{t' < t} s(t') = ⊥ \end{align*} where $\mathsf{noData}(t, t') := ∀_{t'' | t < t'' < t'} s(t'') = ⊥$ and $\mathsf{defined}(t) := \forall_{t' < t} s''(t') ≠ \mathrm{?}$. \end{definition} \noindent Note that while TeSSLa is defined on event streams, \textbf{last} realizes some essential aspects of the signal semantics: With this operator one can query the last known value of an event stream at a specific time and hence interpret the events on this stream as points where a piece-wise constant signal changes its value. \begin{example} By combining the $\mathbf{last}$ and the $\mathbf{lift}$ operators, we can now realize the \emph{signal lift} semantics implicitly used in the introduction:\\ $\mathbf{slift}(f)(x, y) := \mathbf{lift}(\mathsf{sliftaux}(f))(x',y')$ with \begin{minipage}{6.5cm} \setlength{\belowdisplayskip}{0pt}\setlength{\abovedisplayskip}{1ex} \begin{align*} x' &:= \mathbf{merge}(x, \mathbf{last}(x, y)) \text{ and}\\ y' &:= \mathbf{merge}(y, \mathbf{last}(y, x)). \end{align*} \begin{align*} \mathsf{sliftaux}(f)(a≠⊥, b≠⊥) &:= f(a, b)\\ \mathsf{sliftaux}(f)(⊥, b) &:= ⊥\\ \mathsf{sliftaux}(f)(a, ⊥) &:= ⊥ \end{align*} \end{minipage} \begin{minipage}{4cm} \begin{tikzpicture}[events] \node[event, fill=red!10] at (1,0) (x1) {$1$}; \node[event, fill=red!10] at (3,0) (x2) {$5$}; \node[event, fill=red!10] at (4,0) (x3) {$3$}; \node[event, fill=red!10] at (5,0) (x4) {$1$}; \node[event, fill=blue!10] at (2,-1) (y1) {$2$}; \node[event, fill=blue!10] at (5,-1) (y2) {$4$}; \node[event, fill=red!10] at (1,-2) (x'1) {$1$}; \node[event, fill=red!10] at (2,-2) (x'2) {$1$}; \node[event, fill=red!10] at (3,-2) (x'3) {$5$}; \node[event, fill=red!10] at (4,-2) (x'4) {$3$}; \node[event, fill=red!10] at (5,-2) (x'5) {$1$}; \node[event, fill=blue!10] at (2,-3) (y'1) {$2$}; \node[event, fill=blue!10] at (3,-3) (y'2) {$2$}; \node[event, fill=blue!10] at (4,-3) (y'3) {$2$}; \node[event, fill=blue!10] at (5,-3) (y'4) {$4$}; \node[event, fill=yellow!10] at (2,-4) (z1) {$3$}; \node[event, fill=yellow!10] at (3,-4) (z2) {$7$}; \node[event, fill=yellow!10] at (4,-4) (z3) {$5$}; \node[event, fill=yellow!10] at (5,-4) (z4) {$5$}; \path (0,0) node[left] {$x$} edge[|-] (x1) (x1) edge (x2) (x2) edge (x3) (x3) edge (x4) (x4) edge[->] +(1,0); \path (0,-1) node[left] {$y$} edge[|-] (y1) (y1) edge (y2) (y2) edge[->] +(1,0); \path (0,-2) node[left] {$x'$} edge[|-] (x'1) (x'1) edge (x'2) (x'2) edge (x'3) (x'3) edge (x'4) (x'4) edge (x'5) (x'5) edge[->] +(1,0); \path (0,-3) node[left] {$y'$} edge[|-] (y'1) (y'1) edge (y'2) (y'2) edge (y'3) (y'3) edge (y'4) (y'4) edge[->] +(1,0); \path (0,-4) node[left] {$x + y$} edge[|-] (z1) (z1) edge (z2) (z2) edge (z3) (z3) edge (z4) (z4) edge[->] +(1,0); \end{tikzpicture} \end{minipage} \end{example} \begin{example} In order to \emph{filter} an event stream with a dynamic condition, we apply the last known filter condition to the current event:\\ $\mathbf{filter}(z, x) := \mathbf{lift}(\mathsf{filteraux})(\mathbf{merge}(z, \mathbf{last}(z, x)), x)$ \begin{minipage}{6.5cm} \setlength{\belowdisplayskip}{0pt}\setlength{\abovedisplayskip}{1ex} \begin{align*} \mathsf{filteraux}: 𝔹 × A &\rightarrowtail A\\ \mathsf{filteraux}(c \neq \op{true}, a) &= \bot\\ \mathsf{filteraux}(\op{true}, a) &= a \end{align*} \end{minipage} \begin{minipage}{4cm} \begin{tikzpicture}[events] \node[event, fill=green!50!black!10] at (2,0) (z1) {\testrue}; \node[event, fill=red!10] at (4,0) (z2) {\tesfalse}; \node[unit, fill=blue!10] at (1,-1) (x1) {}; \node[unit, fill=blue!10] at (3,-1) (x2) {}; \node[unit, fill=blue!10] at (4,-1) (x3) {}; \node[unit, fill=blue!10] at (5,-1) (x4) {}; \node[event, fill=green!50!black!10] at (2,-2) (z'1) {\testrue}; \node[event, fill=green!50!black!10] at (3,-2) (z'2) {\testrue}; \node[event, fill=red!10] at (4,-2) (z'3) {\tesfalse}; \node[event, fill=red!10] at (5,-2) (z'4) {\tesfalse}; \node[unit, fill=blue!10] at (3,-3) (f1) {}; \path (0,0) node[left] {$z$} edge[|-] (z1) (z1) edge (z2) (z2) edge[->] +(2,0); \path (0,-1) node[left] {$x$} edge[|-] (x1) (x1) edge (x2) (x2) edge (x3) (x3) edge (x4) (x4) edge[->] +(1,0); \path (0,-2) node[left] {$z'$} edge[|-] (z'1) (z'1) edge (z'2) (z'2) edge (z'3) (z'3) edge (z'4) (z'4) edge[->] +(1,0); \path (0,-3) node[left] {$\mathbf{filter}(z, x)$} edge[|-] (f1) (f1) edge[->] +(3,0); \end{tikzpicture} \end{minipage} \end{example} \begin{definition} The \emph{delay} operator takes delays as its first argument. After a delay has passed, a unit event is emitted. A delay can only be set if a reset event is received via the second argument, or if an event is emitted on the output. Formally, $\sem{\mathbf{delay}(e_1, e_2)} = \mathsf{delay}(\sem{e_1}, \sem{e_2})$ where $\mathsf{delay}_{𝔻} \in 𝓢_{𝕋∖{0}}×𝓢_𝔻 → 𝓢_𝕌$ is given as $\mathsf{delay}(s, s') = s''$ such that \begin{align*} ∀_t s''(t) = \boxempty &⇔ ∃_{t' < t} s(t') = t - t' ∧ \mathsf{setable}(t') ∧ \mathsf{noreset}(t', t)\\ ∀_t s''(t) = ⊥ &⇔ \mathsf{defined}(t) ∧ ∀_{t' < t} s(t') ≠ \mathrm{?} ∧ s(t') ≠ t - t' ∨ \mathsf{unsetable}(t') ∨ \mathsf{reset}(t', t) \end{align*} where $\mathsf{setable}(t) := s''(t) = \boxempty ∨ s'(t) ∈ 𝔻$, $\mathsf{unsetable}(t) := s''(t) = ⊥ ∧ s'(t) = ⊥$, $\mathsf{noreset}(t, t') := ∀_{t'' | t < t'' < t'} s'(t'') = ⊥$ and $\mathsf{reset}(t, t') := ∃_{t'' | t < t'' < t'} s'(t'') ∈ 𝔻$. \end{definition} In many applications the delay operator is used in simplified versions: In the first example of the introduction that uses the delay operator, the delay and the reset argument can be the same because the delay is used only in non-recursive equations and every new delay is a reset, too. If a periodical event pattern is generated independently from input events then the second argument can be set to unit because only an initial reset event is needed. The full complexity of the delay operator is only needed if the delay is used in recursive equations with input dependencies and ensures that the fixed-point is unique. We can observe that all basic functions are monotonic and continuous. From the fact, that these properties are closed under composition and the smallest fixed-point is determined by the Kleene chain, we can therefore conclude: \begin{proposition}\label{thm:semmonotonicity} The semantics of a TeSSLa specification is monotonic and continuous in the input streams. \end{proposition} \noindent In other words, the semantics will provide an extended result for an extended input and is therefore suited for online monitoring. We can further observe that the pre-fixed-points on the Kleene chain have the following property: the progress only increases a finite number of times until a further event has to be appended. This is due to the basic functions that do handle progress in this way. We therefore obtain: \begin{theorem} For a specification $φ$ every finite prefix of $\sem{φ}(s_1, \ldots, s_k)$ can be computed assuming all lifted functions are computable. Assuming they are computable in $O(1)$ steps, the prefix can be computed in $O(k·|φ|)$ steps where $k$ is the number of events over all involved streams. \end{theorem} Note that in case the specification contains no $\mathbf{delay}$ output streams cannot contain any such timestamps that did not occur already in the inputs. Further note, that fixed-points might contain infinitely many positions with data values (in case of $\mathbf{delay}$) and we can thus only compute prefixes. A respective monitor would exhibit infinite outputs even for finite inputs. Due to \autoref{thm:semmonotonicity} we can reuse a previously computed fixed-point if new input events occur and hence also compute the outputs incrementally. \subsubsection{Well-formedness} While the least fixed-point is unique it does not have to be the only fixed-point. In that case, the least fixed-point is often the stream with progress $0$ or some other stream with too little progress and one would be interested in (one of) the maximal fixed-points. Since the largest fixed-points would be more difficult to compute, especially in the setting of online monitoring, we define a fragment for which a unique fixed-point exists. \begin{definition} We call a TeSSLa specification $\phi$ \emph{well-formed} if every cycle of the dependency graph (of the flattened specification) contains at least one \emph{delayed}-labelled edge. The \emph{dependency graph} of a flat TeSSLa specification $\phi$ of equations $y_i := e_i$ is the directed multi-graph $G = (V,E)$ of nodes $V = \{y_1, \ldots, y_n\}$. For every $y_i := e_i$ the graph contains the edge $(y_i, y_j)$ iff $y_j$ is used in $e_i$. We label edges corresponding to the first argument of $\mathbf{last}$ or $\mathbf{delay}$ with \emph{delayed}. \end{definition} \begin{theorem}\label{thm:unique-fixed-point} Given a well-formed specification $\phi$ of equations $y_i := e_i$ and input streams $s_1, \ldots, s_k$ then $\mu (\sem{e_1, \ldots, e_n}_{s_{1}, \ldots, s_{k}})$ is the only fixed-point. \end{theorem} \begin{proof} From the Kleene fixed-point theorem we know $\mu \left( \sem {e_1, \ldots, e_n}_{s_{1}, \ldots, s_{k}} \right) =$\\ $ \bigsqcup \{ \sem {e_1, \ldots, e_n}^n_{s_{1}, \ldots, s_{k}}(\bot) \mid n \in \mathbb N \}$. Because $\phi$ is well-formed, every $\sem{e_i}_{s_{1}, \ldots, s_{k}}$ is either constant or contains at least one $\mathbf{last}$ or $\mathbf{delay}$. The input streams $s_{1}, \ldots, s_{k}$ limit progress, i.e. the maximal timestamp produced, of $\sem{e_i}_{s_{1}, \ldots, s_{k}}$. The progress strictly increases with every step of the iteration of $\sem{e_1,\ldots,e_n}_{s_{1}, \ldots, s_{k}}$ in the Kleene chain until the limit given by the input streams is reached. Every other fixed-point of $\sem{e_1,\ldots,e_n}_{s_{1}, \ldots, s_{k}}$ must be an extension of the least fixed-point, but the least fixed-point has already the maximal progress permitted by the input streams. \end{proof} \section{TeSSLa Fragments and Transducers} \label{sec:transducers} In this section we investigate two TeSSLa fragments related to deterministic Büchi automata and timed automata, resp. We translate TeSSLa specifications to transducers, which can be seen as automata taking the in- and output of the corresponding transducer as input word. Thus by relating TeSSLa fragments to certain transducer classes, we inherit complexity and expressiveness results from the well-known automata models. \subsubsection{Boolean Fragment} The fragment TeSSLa$_\text{bool}$ restricts TeSSLa to boolean streams and the operators \textbf{last}, \textbf{lift} and \textbf{slift} with $\geq$ on timestamps. In the syntax expressions are restricted as follows, where $f$ is a function $f: \mathbb{B}^n \rightarrowtail \mathbb{B}$: \[e := \mathbf{nil} \mid \mathbf{unit} \mid x \mid \mathbf{lift}(f)(e,\dots,e) \mid \mathbf{slift}(\geq)(\mathbf{time}(e), \mathbf{time}(e)) \mid \mathbf{last}(e,e)\] Note that since one can only compare timestamps, for a TeSSLa$_\text{bool}$-formula $\phi$ and two tuples of input streams $S, S' \in \mathcal S_{\mathbb D_1} \times \ldots \mathcal S_{\mathbb D_n}$ we have $\sem\phi(S) = \sem\phi(S')$ iff all events in $S'$ carry the same values in the same order as those in $S$, independent from the exact timestamps of the events. A \emph{deterministic finite state transducer (DFST)} is a 5-tuple $R = (\Sigma, \Gamma, Q, q_0, \delta)$ with input alphabet $\Sigma$, output alphabet $\Gamma$, state set $Q$, initial state $q_0 \in Q$ and transition function $\delta: Q \times \Sigma \rightarrow Q \times \Gamma$. For an input word $w = w_0w_1w_2\dots$ we call a sequence $s_0 \xrightarrow{w_0 / o_0} s_1 \xrightarrow{w_1 / o_1} s_2 \xrightarrow{w_2 / o_2} \cdots$ a run of a DFST $R$ with output $\sem R(w) = o_0o_1o_2\dots \in \Gamma^\infty$ iff $s_0 = q_0$ and $\delta(s_i,w_i) = (s_{i+1},o_i)$ for all $i \geq 0$. To show that TeSSLa$_\text{bool}$ and DFSTs have the same expressiveness, we encode DFST words as TeSSLa$_\text{bool}$ streams and vice versa. The function $\alpha_\Sigma(w) = S$ encodes a DFST word $w = w_0w_1\dots \in \Sigma^\infty$ as a corresponding set of TeSSLa$_\text{bool}$ streams: For every $p \in \Sigma$ a stream $s_p \in S$ exists with $s_p = 0d_01d_1\dots\infty \Leftrightarrow \forall i: (d_i \Leftrightarrow w_i = p)$. The function $\beta_\Sigma(s_1, \ldots, s_k) = w = w_0w_1\dots \in \Sigma^\infty$ encodes TeSSLa$_\text{bool}$ streams as a synchronized DFST word $w$ over the alphabet $\Sigma = \{z_1, \ldots, z_k\} \to \op{Val}$ with $\op{Val} = \{\bot, d, <', \bot', d' \mid d \in \{\testrue, \tesfalse\}\}$ which maps stream names to their current values: Let $T = \{t_0 = 0, t_1, t_2, \ldots\}$ be the set of all timestamps present in the streams including $0$ with $t_i < t_{i+1}$. Then $w_i(s) = \op{<}'$ if $s$ has exclusive progress of $t_i$, $w_i(s) = s(t_i)'$ if $s$ has inclusive progress of $t_i$ or $w_i(s) = s(t_i)$ otherwise. \begin{theorem} For a DFST $R = (\Sigma, \Gamma, Q, q_0, \delta)$ there is a TeSSLa$_\text{bool}$ formula $\phi_R$ and for a TeSSLa$_\text{bool}$ formula $\phi$ there is a DFST $R_\phi = (\Sigma, \Gamma, Q, q_0, \delta)$ s.t. \[ \alpha_\Gamma \circ \sem R = \sem{\phi_R} \circ \alpha_\Sigma \quad\text{and}\quad \beta_\Gamma \circ \sem\phi = \sem{R_\phi} \circ \beta_\Sigma.\] \end{theorem} Note that since the boolean transducers produce one output symbol per input symbol one could reattach the timestamps of the input streams to the output streams to preserve the exact timestamps, too. \paragraph{Translating DFST to TeSSLa$_{bool}$} We represent the states $q \in Q \setminus \{q_0\}$ as stream which is true iff the transducer is in it: $a_q := \mathbf{merge}(x_q,\mathbf{false})$ and the initial state $a_{q_0} := \mathbf{merge}(x_{q_0},\mathbf{true})$, where $x_{q'} := \bigvee_{(a_q,\sigma,a_{q'},\gamma) \in \delta} d_{a_q,\sigma}$. For every transition $\eta_i = (q,\sigma,q',\gamma)$ we add $d_{q,\sigma} := \mathbf{last}(a_q, \mathbf{merge}\{s_p \mid p \in \Sigma\}) \land s_\sigma$ and $o_i := \mathbf{filter}(d_{q,\sigma}, \mathbf{const}(\gamma)(d_{q,\sigma}))$. The merge of all the output streams is the output: $\mathit{output} := \mathbf{merge}\{o_i\mid \eta_i \in \delta\}$. \paragraph{Translating TeSSLa$_\text{bool}$ to DFST} We translate every equation of the flattened specification $\phi$ into individual DFSTs, which are then composed into one DFST $R_\phi$. For every DFST the input symbols are functions from the names of the input streams to $\op{Val}$ and the output symbols are functions from the name of the equation to $\op{Val}$. As discussed in the previous section, for this finite data domain we only need to consider finitely many different internal states for every equation. The transition function realizes the state changes the current output based on the current state. See Appendix~\ref{booltrans} for details on these transducers. For the composition of the individual DFSTs every two $R = (I \to \op{Val}, O \to \op{Val}, Q, q_0, \delta)$ and $R' = (I' \to \op{Val}, O' \to \op{Val} ,Q' ,q_0' ,\delta')$ are then composed parallel into $R'' = (I \cup I' \to \op{Val},O \cup O' \to \op{Val},Q \times Q',(q_0,q_0'),\delta'')$ with $\delta''((s_1,s_2),g'') = ((s_1',s_2'),h'') \Longleftrightarrow \delta(s_1,g) = (s_1',h) \land \delta'(s_2,g') = (s_2',h') \land g'' = g \cup g' \land \forall \sigma \in I \cap I': g(\sigma) = g'(\sigma) \land h'' = h \cup h'$ until one transducer $R_A = (I_A \to \op{Val},O_A \to \op{Val},Q_A,{q_0}_A,\delta_A)$ represents all equations. $R_A$ contains transitions with the same in- and output values for certain propositions which represents dependencies between the original equations. We now build the closure of this transducer which roughly resembles substituting the variables and computing the fixed-point of the equations: $R_\phi = (I_A \backslash O_A \to \op{Val},O_A \to \op{Val},Q_A,{q_0}_A,\delta_\phi)$, where $\delta_\phi(s,g) = (s',h) \Longleftrightarrow \delta_A(s,g') = (s',h) \land g = g'|_{I_A \backslash O_A} \land (\forall a \in I_A \cap O_A: g'(a) = h(a))$ for $g|_I := g \cap (I \times \op{Val})$. Equivalence of deterministic Büchi automata is in P and because the constructed DFSTs can be represented as those we can conclude: \begin{theorem} Equivalence of TeSSLa$_\text{bool}$-formulas is in P. \end{theorem} \subsubsection{Timed Fragment} TeSSLa$_\text{bool+c}$ extends TeSSLa$_\text{bool}$ with the comparison of a timestamp with another, previous timestamp and a constant. In the syntax, expressions are restricted as follows, where $f \in \mathbb B^n \rightarrowtail \mathbb B$: \[e := \mathbf{nil} \mid \mathbf{unit} \mid x \mid \mathbf{lift}(f)(e,\dots,e) \mid \mathbf{lift}(g_v)(\mathbf{time}(e), \mathbf{last}(\mathbf{time}(e),e)) \mid \mathbf{last}(e,e)\] Time comparison is restricted to expressions $\mathbf{lift}(g_v)(\mathbf{time}(a), \mathbf{last}(\mathbf{time}(b),a))$ for streams $a, b \in \mathcal S_{\mathbb B}$ and a constant $v \in \mathbb T$, where $g_v$ is a function $g_v: \mathbb T \times \mathbb T \to \mathbb B$ of the form $g_v(t_1, t_2) = t_1 \lessgtr t_2 + v$ with $\op{\lessgtr} \in \{<, >\}$, which allows checking the temporal distance of the current events of two streams. This is directly related to how clock constraints in timed automata~\cite{timedAutomata,clocks} work. A \emph{timed finite state transducer (TFST)} is a DFSTs with an additional set of clocks $C$ and $\delta: Q \times \Sigma \times \Theta(C) \rightarrow Q \times 2^C \times \Gamma$ where $\Theta(C)$ is the set of clock constraints. A clock constraint $\vartheta \in \Theta(C)$ is defined over the grammar $\vartheta ::= true \mid T \leq x + c \mid T \geq x + c \mid \neg \vartheta \mid \vartheta \land \vartheta$, where $x \in C$, and $c \in \mathbb T$ is a constant and $T$ refers to the current time. $\delta$ now also takes a clock constraint and provides a set of clocks that have to be reset to $T$ when taking this transition. A run of a TFST extends a run of a DFST with timestamps in the input and output word. An additional clock constraint has to be fulfilled to take a transitions and when taking a transitions, some clocks are set to the current time $T$. A more formal definition can be found in Appendix~\ref{timedTransducers}. TFSTs resemble timed automata using the notion of clock constraints from~\cite{clocks}. A TFST is called \textit{deterministic}, or DTFST, iff for any two different transitions $\eta_1, \eta_2 \in \delta$ their conjuncted clock constraints $\vartheta_{\eta_1} \land \vartheta_{\eta_2}$ are unsatisfiable. To show that TeSSLa$_\text{bool+c}$ and DTFSTs have the same expressiveness, we again encode words as streams and vice versa, but this time $\alpha_\Sigma$ and $\beta_\Sigma$ preserve the timestamps. Hence both representations are now isomorphic and we can use the inverse encoding functions for decoding: \begin{theorem} For a DTFST $R = (\Sigma, \Gamma, Q, q_0, C, \delta)$ a TeSSLa$_\text{bool+c}$ formula $\phi_R$ exists and for a TeSSLa$_\text{bool+c}$ formula $\phi$ a DTFST $R_\phi = (\Sigma, \Gamma, Q, q_0, C, \delta)$ exists: \[ \sem R = \alpha^{-1}_\Gamma \circ \sem{\phi_R} \circ \alpha_\Sigma \quad\text{and}\quad \sem\phi = \beta^{-1}_\Gamma \circ R_\phi \circ \beta_\Sigma.\] \end{theorem} \begin{figure}[t] \hskip-.035\textwidth \begin{minipage}{.395\textwidth} \raisebox{8mm}{\input{tessla-expressiveness-grid}} \end{minipage} \begin{minipage}{.64\textwidth} \caption{ TeSSLa fragments are restricted regarding a) event values and available \emph{data} structures and b) event \emph{timestamps} and how events sequences are recognized and generated: TeSSLa$_\text{bool}$ only checks event \emph{ordering} like deterministic Büchi automata and BSRV~\cite{bozzelli14foundations} (LOLA restricted to boolean streams). TeSSLa$_\text{bool+c}$ additionally has timestamp \emph{comparison} with constants like deterministic timed automata. TeSSLa has arbitrary \emph{bounded} data structures and arbitrary computations on the timestamps. Full TeSSLa allows \emph{unbounded} data structures and the creation of new timestamps via \textbf{delay}. } \label{figure:tessla-expressiveness-grid} \vskip5ex\strut \end{minipage} \vskip-13ex\strut \end{figure} \paragraph{Translating DTFST to TeSSLa$_\text{bool+c}$} We reuse the translation for DFSTs with the following adjustments: We extend the stream $d_{q,\sigma}$ to $d_{q,\sigma,\vartheta}$ by adding the timing constraint $\vartheta$, which is translated by lifting the boolean combination to signal semantics and translating the constraint $T \lessgtr x + c$ to $\mathbf{time}(\mathbf{merge}\{s_p \mid p \in \Sigma\}) \lessgtr \mathbf{last}(\mathbf{time}(\mathbf{merge}(b_x,\mathbf{unit})),\mathbf{merge}\{s_p \mid p \in \Sigma\}) + c$. Also for every clock $x \in C$ we add $b_x := \mathbf{merge}\{ \mathbf{filter}(d_{q,\sigma, \vartheta}, d_{q,\sigma, \vartheta}) \mid (q,\sigma, \vartheta,q',r,\gamma) \in \delta \wedge x \in r \}$. \paragraph{Translating TeSSLa$_\text{bool+c}$ to DTFST} The transducers from the equations in $\phi$ are build as before, but instead of translating equations that compare timestamps, we now translate equations of the form $\mathbf{lift}(g_v)(\mathbf{time}(a), \mathbf{last}(\mathbf{time}(b),a))$. Besides the \textbf{lift} and \textbf{last} operators, it also contains a comparison on timestamps, which is translated using the clocks and clock constraints of the DTFSTs to remember and compare timestamps. A formalization is given in Appendix~\ref{timedtrans}. The parallel composition algorithm for DFSTs is extended by conjuncting the timing constraints of the composed transducers. Afterwards the same closure algorithm is applied. Equivalence of deterministic timed automata is PSPACE-complete~\cite{timedAutomata} and because the constructed DTFSTs can be represented as those we can conclude: \begin{theorem} Equivalence of TeSSLa$_\text{bool+c}$-formulas is PSPACE-complete. \end{theorem} \noindent \autoref{figure:tessla-expressiveness-grid} shows the modularity of the different TeSSLa fragments.
\section{Introduction} In terms of real world applications, it is important to provide explainable recommendation. Explanations may show how the system works or help users make an informed choice \cite{two}. Providing explanations usually build user's trust in recommender system and it's results. In order to extract features, many existing systems in content-based music recommendation use music classification which is an well-researched task in Music Information Retrieval. However, extracted features from these methods only provide high-level explanation (e.g., similar artist or style). The focus of this paper is a methods for low-level explanation of recommendation results (e.g., certain words of lyric reflecting genre, important part of acoustic signal reflecting genre). In order to extract explainable content features self-attention architecture is used with genre classification. \cite{five} extract attention weights of lyric using hierarchical attention networks which hierarchically attend segments, lines and words. However, it is more reasonable to provide entire song-level explanation to users. \cite{six} propose a self-attention network for sentence embedding, visualizing important words or phases using attention weights. Inspiring this work, we formulate entire song-level self-attentive genre classification task using two different dataset (Lyric and Audio) respectively. \section{DATASET} Since there is no large lyric dataset which is publicly available, we use dataset\footnote{\label{myfootnote}https://www.kaggle.com/gyani95/380000-lyrics-from-metrolyrics/home} collected from MetroLyrics which has lyrics database featuring 1,000,000+ song lyrics from 20,000 artists. This consist of single label with 10 genre classes. We use subset of Top MAGD dataset\footnote{\label{myfootnote}http://www.ifs.tuwien.ac.at/mir/msd/TopMAGD.html} as Audio dataset. This also consist of single label with 13 genre classes. We reject the lyrics whose length is less than 70 words and the audio less than 30 seconds. \section{self-attention architecture} The entire framework of the model is illustrated in Figure 1. Unlike previous research, we use pre-trained embedding rather than index of word dictionary as input to the model. The song lyrics are split into words and they are represented as a 500 by 128 matrix using pre-trained Word2Vec model \cite{word2vec}. To change the task into an entire song-level task, we set the word length to 500 with zero padding for lyrics less than 500 words. The 30 seconds of audio signals are converted to mel-spectrograms and they are represented as a 30 (length of signals sliced by 1 seconds) by 128 matrix using pre-trained Vggish model \cite{vggish}. \begin{figure}[!h] \centering \includegraphics[height=4.9cm, width=8.5cm]{SAN_architecture.png} \caption{Model structure for self-attentive genre classification} \end{figure} Given outputs of BiLSTM \(H\), the attention can be formulated as \begin{gather} A = softmax(W_{s2}\cdot tanh(W_{s1}\cdot H^T)) \label{eq1} \\ M = A \cdot H \label{eq2} \end{gather} \begin{equation} A_i = \begin{cases} A_i & \text{if $A_i > 0.15 \cdot max(A)$} \\ 0 & \text{otherwise} \end{cases} \end{equation} \(W_{s1}\) and \(W_{s2}\) are learned by the model after random initialization and the shape of these parameter matrix is hyperparameter except for input length. Matrix \(M\) is flattened for genre classification and attention matrix \(A\) is used for visualization of words or sliced audio signals. After training, outputs include content embedding with 2,000 dimensions and attention weights. In order to visualize attention weights, we set condition as in (3). \begin{figure}[!h] \centering \includegraphics[height=4cm, width=7.5cm]{lyric_attn2.png} \caption{Visualization of attention weights of lyrics in hip-hop, metal and jazz genre} \end{figure} \begin{figure}[!h] \centering \includegraphics[height=2.5cm, width=8.5cm]{audio_attn.png} \caption{Visualization of attention weights of 30 seconds of acoustic signals} \end{figure} \begin{figure}[!ht] \centering \includegraphics[height=7cm, width=8cm]{feature_result.png} \caption{Result of similar song retrieval using Lyric (left) and Audio (right) dataset} \end{figure} \section{Experimental results} As a result of visualizing attention weights of lyrics, there is a tendency to focus on words that have an important role in genre classification. Figure 2 shows the visualization of attention weights of lyrics in hip-hop genres. In this case, the model focus on strong and aggressive words such as slang. The model also attend to "rhyme" which is interesting features of hip-hop music. In addition, the metal genre tend to concentrate on aggressive but religious words related to good and evil. Visualization of the attention weights of acoustic signals show a tendency to focus on the beginning of vocal. Figure 3 shows the visualization of attention weights of acoustic signals. in the case of "fix you" of Coldplay, singing start from 13 to 14 seconds. In the case of song of Benediction which has strong metal sound from the beginning, Figure 3 shows that there is a strong attention from the beginning. This may be related to the fact that the pre-trained dataset for Vggish model include diverse speech and instrument data. We explore similar song with query using extracted content features. Figure 4 shows the results of top 4 similar songs with query. Retrieved similar songs from lyrics include cover songs, an important word of lyrics and mood of lyrics. An important word in "trouble" of Coldplay is a "spider", and "spidersong" is retrieved as similar song. Even though the title is not trained, songs with the same title are retrieved such as "trouble" of Lisa Germano. Retrieved similar songs from acoustic signals include similar genre, similar artists and similar vocal timbre. "Don't stop the music" of Rihanna is exciting dance music with female vocal sound, and the dance music with female vocal sound is retrieved as similar songs of Rihanna's music. \section{Conclusions} In this research, we extract content features using self-attentive genre classification, and explore extracted features and attention weights. We indicate acoustic signals are as good features as lyrics in terms of interpretation, and both of them reflect the details that they do not reflect each other. We will further investigate the performance with same dataset of lyric and audio, and compare two modalities in terms of recommendation. Furthermore, we will examine the feasibility of explainable recommendation in real-world applications. \section{Acknowledgements} This work was supported by Kakao and Kakao Brain Corp.
\section{Introduction}\label{sec:introduction}} \else \section{Introduction} \label{sec:introduction} \fi \IEEEPARstart{T}{his} demo file is intended to serve as a ``starter file'' for IEEE Computer Society journal papers produced under \LaTeX\ using IEEEtran.cls version 1.8b and later. I wish you the best of success. \hfill mds \hfill August 26, 2015 \subsection{Subsection Heading Here} Subsection text here. \subsubsection{Subsubsection Heading Here} Subsubsection text here. \section{Conclusion} The conclusion goes here. \appendices \section{Proof of the First Zonklar Equation} Appendix one text goes here. \section{} Appendix two text goes here. \ifCLASSOPTIONcompsoc \section*{Acknowledgments} \else \section*{Acknowledgment} \fi The authors would like to thank... \ifCLASSOPTIONcaptionsoff \newpage \fi \section{Introduction} This demo file is intended to serve as a ``starter file'' for IEEE Computer Society conference papers produced under \LaTeX\ using IEEEtran.cls version 1.8b and later. I wish you the best of success. \hfill mds \hfill August 26, 2015 \subsection{Subsection Heading Here} Subsection text here. \subsubsection{Subsubsection Heading Here} Subsubsection text here. \section{Conclusion} The conclusion goes here. \ifCLASSOPTIONcompsoc \section*{Acknowledgments} \else \section*{Acknowledgment} \fi The authors would like to thank... \section{Introduction} This demo file is intended to serve as a ``starter file'' for IEEE conference papers produced under \LaTeX\ using IEEEtran.cls version 1.8b and later. I wish you the best of success. \hfill mds \hfill August 26, 2015 \subsection{Subsection Heading Here} Subsection text here. \subsubsection{Subsubsection Heading Here} Subsubsection text here. \section{Conclusion} The conclusion goes here. \section*{Acknowledgment} The authors would like to thank... \section{Introduction} \IEEEPARstart{T}{his} demo file is intended to serve as a ``starter file'' for IEEE Communications Society journal papers produced under \LaTeX\ using IEEEtran.cls version 1.8b and later. I wish you the best of success. \hfill mds \hfill August 26, 2015 \subsection{Subsection Heading Here} Subsection text here. \subsubsection{Subsubsection Heading Here} Subsubsection text here. \section{Conclusion} The conclusion goes here. \appendices \section{Proof of the First Zonklar Equation} Appendix one text goes here. \section{} Appendix two text goes here. \section*{Acknowledgment} The authors would like to thank... \ifCLASSOPTIONcaptionsoff \newpage \fi \section{Introduction} \IEEEPARstart{T}{his} demo file is intended to serve as a ``starter file'' for IEEE journal papers produced under \LaTeX\ using IEEEtran.cls version 1.8b and later. I wish you the best of success. \hfill mds \hfill August 26, 2015 \subsection{Subsection Heading Here} Subsection text here. \subsubsection{Subsubsection Heading Here} Subsubsection text here. \section{Conclusion} The conclusion goes here. \appendices \section{Proof of the First Zonklar Equation} Appendix one text goes here. \section{} Appendix two text goes here. \section*{Acknowledgment} The authors would like to thank... \ifCLASSOPTIONcaptionsoff \newpage \fi \section{Introduction} \IEEEPARstart{T}{his} demo file is intended to serve as a ``starter file'' for IEEE \textsc{Transactions on Magnetics} journal papers produced under \LaTeX\ using IEEEtran.cls version 1.8b and later. I wish you the best of success. \hfill mds \hfill August 26, 2015 \subsection{Subsection Heading Here} Subsection text here. \subsubsection{Subsubsection Heading Here} Subsubsection text here. \section{Conclusion} The conclusion goes here. \appendices \section{Proof of the First Zonklar Equation} Appendix one text goes here. \section{} Appendix two text goes here. \section*{Acknowledgment} The authors would like to thank... \ifCLASSOPTIONcaptionsoff \newpage \fi \section{Introduction} This document is a model and instructions for \LaTeX. Please observe the conference page limits. \section{Ease of Use} \subsection{Maintaining the Integrity of the Specifications} The IEEEtran class file is used to format your paper and style the text. All margins, column widths, line spaces, and text fonts are prescribed; please do not alter them. You may note peculiarities. For example, the head margin measures proportionately more than is customary. This measurement and others are deliberate, using specifications that anticipate your paper as one part of the entire proceedings, and not as an independent document. Please do not revise any of the current designations. \section{Prepare Your Paper Before Styling} Before you begin to format your paper, first write and save the content as a separate text file. Complete all content and organizational editing before formatting. Please note sections \ref{AA}--\ref{SCM} below for more information on proofreading, spelling and grammar. Keep your text and graphic files separate until after the text has been formatted and styled. Do not number text heads---{\LaTeX} will do that for you. \subsection{Abbreviations and Acronyms}\label{AA} Define abbreviations and acronyms the first time they are used in the text, even after they have been defined in the abstract. Abbreviations such as IEEE, SI, MKS, CGS, ac, dc, and rms do not have to be defined. Do not use abbreviations in the title or heads unless they are unavoidable. \subsection{Units} \begin{itemize} \item Use either SI (MKS) or CGS as primary units. (SI units are encouraged.) English units may be used as secondary units (in parentheses). An exception would be the use of English units as identifiers in trade, such as ``3.5-inch disk drive''. \item Avoid combining SI and CGS units, such as current in amperes and magnetic field in oersteds. This often leads to confusion because equations do not balance dimensionally. If you must use mixed units, clearly state the units for each quantity that you use in an equation. \item Do not mix complete spellings and abbreviations of units: ``Wb/m\textsuperscript{2}'' or ``webers per square meter'', not ``webers/m\textsuperscript{2}''. Spell out units when they appear in text: ``. . . a few henries'', not ``. . . a few H''. \item Use a zero before decimal points: ``0.25'', not ``.25''. Use ``cm\textsuperscript{3}'', not ``cc''.) \end{itemize} \subsection{Equations} Number equations consecutively. To make your equations more compact, you may use the solidus (~/~), the exp function, or appropriate exponents. Italicize Roman symbols for quantities and variables, but not Greek symbols. Use a long dash rather than a hyphen for a minus sign. Punctuate equations with commas or periods when they are part of a sentence, as in: \begin{equation} a+b=\gamma\label{eq} \end{equation} Be sure that the symbols in your equation have been defined before or immediately following the equation. Use ``\eqref{eq}'', not ``Eq.~\eqref{eq}'' or ``equation \eqref{eq}'', except at the beginning of a sentence: ``Equation \eqref{eq} is . . .'' \subsection{\LaTeX-Specific Advice} Please use ``soft'' (e.g., \verb|\eqref{Eq}|) cross references instead of ``hard'' references (e.g., \verb|(1)|). That will make it possible to combine sections, add equations, or change the order of figures or citations without having to go through the file line by line. Please don't use the \verb|{eqnarray}| equation environment. Use \verb|{align}| or \verb|{IEEEeqnarray}| instead. The \verb|{eqnarray}| environment leaves unsightly spaces around relation symbols. Please note that the \verb|{subequations}| environment in {\LaTeX} will increment the main equation counter even when there are no equation numbers displayed. If you forget that, you might write an article in which the equation numbers skip from (17) to (20), causing the copy editors to wonder if you've discovered a new method of counting. {\BibTeX} does not work by magic. It doesn't get the bibliographic data from thin air but from .bib files. If you use {\BibTeX} to produce a bibliography you must send the .bib files. {\LaTeX} can't read your mind. If you assign the same label to a subsubsection and a table, you might find that Table I has been cross referenced as Table IV-B3. {\LaTeX} does not have precognitive abilities. If you put a \verb|\label| command before the command that updates the counter it's supposed to be using, the label will pick up the last counter to be cross referenced instead. In particular, a \verb|\label| command should not go before the caption of a figure or a table. Do not use \verb|\nonumber| inside the \verb|{array}| environment. It will not stop equation numbers inside \verb|{array}| (there won't be any anyway) and it might stop a wanted equation number in the surrounding equation. \subsection{Some Common Mistakes}\label{SCM} \begin{itemize} \item The word ``data'' is plural, not singular. \item The subscript for the permeability of vacuum $\mu_{0}$, and other common scientific constants, is zero with subscript formatting, not a lowercase letter ``o''. \item In American English, commas, semicolons, periods, question and exclamation marks are located within quotation marks only when a complete thought or name is cited, such as a title or full quotation. When quotation marks are used, instead of a bold or italic typeface, to highlight a word or phrase, punctuation should appear outside of the quotation marks. A parenthetical phrase or statement at the end of a sentence is punctuated outside of the closing parenthesis (like this). (A parenthetical sentence is punctuated within the parentheses.) \item A graph within a graph is an ``inset'', not an ``insert''. The word alternatively is preferred to the word ``alternately'' (unless you really mean something that alternates). \item Do not use the word ``essentially'' to mean ``approximately'' or ``effectively''. \item In your paper title, if the words ``that uses'' can accurately replace the word ``using'', capitalize the ``u''; if not, keep using lower-cased. \item Be aware of the different meanings of the homophones ``affect'' and ``effect'', ``complement'' and ``compliment'', ``discreet'' and ``discrete'', ``principal'' and ``principle''. \item Do not confuse ``imply'' and ``infer''. \item The prefix ``non'' is not a word; it should be joined to the word it modifies, usually without a hyphen. \item There is no period after the ``et'' in the Latin abbreviation ``et al.''. \item The abbreviation ``i.e.'' means ``that is'', and the abbreviation ``e.g.'' means ``for example''. \end{itemize} An excellent style manual for science writers is \cite{b7}. \subsection{Authors and Affiliations} \textbf{The class file is designed for, but not limited to, six authors.} A minimum of one author is required for all conference articles. Author names should be listed starting from left to right and then moving down to the next line. This is the author sequence that will be used in future citations and by indexing services. Names should not be listed in columns nor group by affiliation. Please keep your affiliations as succinct as possible (for example, do not differentiate among departments of the same organization). \subsection{Identify the Headings} Headings, or heads, are organizational devices that guide the reader through your paper. There are two types: component heads and text heads. Component heads identify the different components of your paper and are not topically subordinate to each other. Examples include Acknowledgments and References and, for these, the correct style to use is ``Heading 5''. Use ``figure caption'' for your Figure captions, and ``table head'' for your table title. Run-in heads, such as ``Abstract'', will require you to apply a style (in this case, italic) in addition to the style provided by the drop down menu to differentiate the head from the text. Text heads organize the topics on a relational, hierarchical basis. For example, the paper title is the primary text head because all subsequent material relates and elaborates on this one topic. If there are two or more sub-topics, the next level head (uppercase Roman numerals) should be used and, conversely, if there are not at least two sub-topics, then no subheads should be introduced. \subsection{Figures and Tables} \paragraph{Positioning Figures and Tables} Place figures and tables at the top and bottom of columns. Avoid placing them in the middle of columns. Large figures and tables may span across both columns. Figure captions should be below the figures; table heads should appear above the tables. Insert figures and tables after they are cited in the text. Use the abbreviation ``Fig.~\ref{fig}'', even at the beginning of a sentence. \begin{table}[htbp] \caption{Table Type Styles} \begin{center} \begin{tabular}{|c|c|c|c|} \hline \textbf{Table}&\multicolumn{3}{|c|}{\textbf{Table Column Head}} \\ \cline{2-4} \textbf{Head} & \textbf{\textit{Table column subhead}}& \textbf{\textit{Subhead}}& \textbf{\textit{Subhead}} \\ \hline copy& More table copy$^{\mathrm{a}}$& & \\ \hline \multicolumn{4}{l}{$^{\mathrm{a}}$Sample of a Table footnote.} \end{tabular} \label{tab1} \end{center} \end{table} \begin{figure}[htbp] \centerline{\includegraphics{fig1.png}} \caption{Example of a figure caption.} \label{fig} \end{figure} Figure Labels: Use 8 point Times New Roman for Figure labels. Use words rather than symbols or abbreviations when writing Figure axis labels to avoid confusing the reader. As an example, write the quantity ``Magnetization'', or ``Magnetization, M'', not just ``M''. If including units in the label, present them within parentheses. Do not label axes only with units. In the example, write ``Magnetization (A/m)'' or ``Magnetization \{A[m(1)]\}'', not just ``A/m''. Do not label axes with a ratio of quantities and units. For example, write ``Temperature (K)'', not ``Temperature/K''. \section*{Acknowledgment} The preferred spelling of the word ``acknowledgment'' in America is without an ``e'' after the ``g''. Avoid the stilted expression ``one of us (R. B. G.) thanks $\ldots$''. Instead, try ``R. B. G. thanks$\ldots$''. Put sponsor acknowledgments in the unnumbered footnote on the first page. \section*{References} Please number citations consecutively within brackets \cite{b1}. The sentence punctuation follows the bracket \cite{b2}. Refer simply to the reference number, as in \cite{b3}---do not use ``Ref. \cite{b3}'' or ``reference \cite{b3}'' except at the beginning of a sentence: ``Reference \cite{b3} was the first $\ldots$'' Number footnotes separately in superscripts. Place the actual footnote at the bottom of the column in which it was cited. Do not put footnotes in the abstract or reference list. Use letters for table footnotes. Unless there are six authors or more give all authors' names; do not use ``et al.''. Papers that have not been published, even if they have been submitted for publication, should be cited as ``unpublished'' \cite{b4}. Papers that have been accepted for publication should be cited as ``in press'' \cite{b5}. Capitalize only the first word in a paper title, except for proper nouns and element symbols. For papers published in translation journals, please give the English citation first, followed by the original foreign-language citation \cite{b6}. \section{Motivation and Context} Accidents and attacks that involve chemical, biological, radiological/nuclear or explosive (CBRNe) substances are rare, but can be of high consequence due to the need for forensic investigators and other personnel to face unquantified threats. These events are exceedingly difficult to prepare for because they are so rare and diverse that limited data from real events is available. Physical training exercises are not frequently held due to cost, which also limits the amount of simulated data that is available. A consequence of this is that any systems that are developed to provide support can be difficult to evaluate and validate. To address this, our goal is to design and develop high-fidelity simulated environments, which allow us to maintain the core aspects of CBRNe incidents without any risk of exposure to the dangerous elements of such scenes in the real world. \subsection{Related Research} Virtual environments designed using games engines have previously been used to gather data to train models for a range of applications \cite{1608.02192}\cite{uav_benchmark_simulator} and software packages have been written that can generate photo realistic images from games engines\cite{1609.01326}. There have also been attempts made to develop models of physical systems that simulate potentially dangerous environments \cite{4625089}. To the best of our knowledge, there are no prior applications using games engines to model critical incidents for the purpose of developing analytical tools in a virtual setting that will then transfer to real-world deployment. \subsection{Contributions} Our primary contribution is the creation of a simulated critical incident scenario using Unreal Engine 4, UE4 (See Section II). We developed this to be easy to modify, extensible, and compatible with real-world robotic and sensor systems. We have fully integrated the \emph{AirSim} \cite{airsim2017fsr} plugin into the environment to provide Remote Aerial Vehicles (RAVs) and Remote Ground Vehicles (RGVs) with access to modified APIs which can be used to carry out tasks, using GPS coordinates as opposed to the internal UE4 North, East, Down (NED) coordinate system (Section III). In addition, we have developed a baseline system for autonomously gathering images in a specified region in the environment using multiple RAVs (Section IV). The virtual environment is freely available on GitHub for use by the research community (See: \href{https://github.com/ROCSAFE/CBRNeVirtualEnvMultiRobot/releases}{ROCSAFE CBRNe environment}\footnote{\href {https://github.com/ROCSAFE/CBRNeVirtualEnvMultiRobot/releases}{https://github.com/ROCSAFE/CBRNeVirtualEnvMultiRobot/releases}}). \section{Virtual Environment Design} Within the context of a project called ROCSAFE (Remotely Operated CBRNe Scene Assessment \& Forensic Examination)\footnote{\href {http://www.rocsafe.eu}{http://www.rocsafe.eu}}, several operational scenarios have been identified to represent distinct classes of CBRNe threats. We are developing a virtual representation of these scenarios to validate various AI technologies. Our initial environment consists of a rural scene with a train transporting radioactive material that has been de-railed. \subsection{Unreal Engine 4} We selected UE4 to develop the environment for reasons which include: UE4 can produce near-photo-realistic images; there are several plugins for UE4 that provide virtual RAVs/RGVs; and UE4's blueprint visual scripting system (described in the next section) can allow for rapid prototyping. We identified the assets that would be necessary to develop the environment to our specification. These assets were acquired from websites such as \href{http://www.cgtrader.com}{CGTrader}\footnote{\href {http://www.cgtrader.com}{https://www.cgtrader.com}} and \href{https://3dwarehouse.sketchup.com/?hl=en}{Google 3D warehouse}\footnote{\href {https://3dwarehouse.sketchup.com/?hl=en}{https://www.3dwarehouse.sketchup.com}}. The assets were imported into \emph{Autodesk 3DS} in order to ensure that textures were of sufficient quality to facilitate the planned image processing on collected images. They were then imported into UE4 as static meshes and placed into the scene. This process was designed to be scalable and static meshes can be replaced by simply importing a new mesh which will retain the position of the original in the environment. \subsection{Simulating Radiation using Blueprints} UE4 supports a visual scripting system known as \textit{blueprints}, which is a game-play scripting system based on the concept of using a node-based interface to create game-play elements from within the UE4 Editor. A blueprint was created to simulate gamma radiation in the environment. First, we developed a model of the level of ionizing radiation observed $d$ meters from a source, making the assumptions that the radiation is emitted from a point and is transmitted equally in all directions. We also assumed that the propagating medium is lossless, implying that the level of ionizing radiation is conserved. Letting $d$ = distance from point source of radiation, the strength of the ionizing radiation in micro Sieverts per second (\si{\micro\sievert\per\second}) is determined by the equation $strength(d) \propto \frac{1}{d^2}$. Letting the strength at a distance of 1m from the source equal to \sisetup{quotient-mode=fraction} $\sigma$\si{\micro\sievert\per\second} , the ionizing radiation in \si{\micro\sievert\per\second} is given by: \[strength(d) = \frac{\sigma \times 4 \times \pi}{d^2 \times 4 \times \pi} = \frac{\sigma}{d^2} \si{\micro\sievert\per\second}\] This was modelled in UE4 by using a built-in blueprint node, \href{https://api.unrealengine.com/INT/API/Runtime/Engine/Kismet/UGameplayStatics/ApplyRadialDamageWithFalloff/index.html}{\emph{Apply Radial Damage with Falloff}}\footnote{\href {https://api.unrealengine.com/INT/API/Runtime/Engine/Kismet/UGameplayStatics/ApplyRadialDamageWithFalloff/index.html}{https://api.unrealengine.com}}. The detection of ionizing radiation strength can then be simulated using the \href{https://docs.unrealengine.com/en-us/Engine/Blueprints/UserGuide/Events/\#eventradialdamage}{\emph{Event Radial Damage}} \footnote{\href {https://docs.unrealengine.com/en-us/Engine/Blueprints/UserGuide/Events/\#eventradialdamage}{https://docs.unrealengine.com}} node. This blueprint can be integrated with external plugins that facilitate the control of vehicles in the environment and can be exposed via an API relating to the vehicle. Similarly, it is possible to develop models of chemical and biological dispersion with a corresponding simulated detection. This allows us to decouple the development of the decision support analysis upon detection of hazardous substances from the actual details of the sensors developed in the project, streamlining the development of AI systems. \section{Integration and Extension of AirSim}\label{sec:AirSim} In order to develop autonomous routing algorithms for RAVs and RGVs, we used the AirSim \cite{airsim2017fsr} plugin for UE4. We chose to use AirSim over other plugins for the following reasons: \begin{itemize} \item AirSim has APIs for C++, Python and C\# which allows flexibility in the language used to control vehicles. \item AirSim provides the ability to run multiple RAVs in the same environment. \item AirSim has been open-sourced with an MIT licence and was designed to be easily extended. \item The AirSim API provides convenient access to unmodified images, depth maps and segmented images. \end{itemize} AirSim internally models RAVs using different low-level modules outlined in \cite{airsim2017fsr} and exposes the RAV as a blueprint that we extended to sense radiation placed in the environment and to provide debugging lines for the drone flight path, as shown in Figure \ref{fig:agentRoutes}. \subsection{Adding GPS Support} The AirSim API provides support to query the RAV GPS position using the WGS 84 coordinate system, where the home GPS location of the RAV is set arbitrarily. The API only provides the ability to send the RAV to an Unreal North, East, Down (NED) position relative to the RAV home position, set to (0,0,0) in the UE4 NED coordinate system. We added the capability to set the RAV home GPS position and send the RAV to GPS coordinates rather than NED coordinates. We developed this by creating a GPS coordinate class in the Python API, with methods to calculate the difference between one GPS point and another in terms of degrees, which could in turn be converted to the number of metres latitude/longitude needed to be travelled to reach the second GPS point. Finally, using the UE4 conversion rate of 1 Unreal Unit to 1 cm, we calculated the NED transformation needed to send the RAV to the second GPS point, which allowed us to use functionality already provided by the API. \\ Figure \ref{fig:agentRoutesLeaflet} shows the planned routes of three RAVs overlaid on a known location (The National University of Ireland, Galway) which was used to validate the route planning algorithms. Figure \ref{fig:agentRoutes} shows three RAVs in our developed Unreal Engine simulation environment following the planned routes to gather simulated data from the environment. \begin{figure}[h] \centering \includegraphics[width=3.2in]{Images/RAVRoutingNUIGZoom.PNG} \caption{Planned routes for RAVs plotted on a map for validation purposes.} \label{fig:agentRoutesLeaflet} \end{figure} \begin{figure}[h] \centering \includegraphics[width=3.2in]{Images/RoutesWithRAVsVisible} \caption{The virtual environment with RAVs visiting calculated waypoints} \label{fig:agentRoutes} \end{figure} \subsection{Collecting Images in the Virtual Environment}\label{sec:algodesign} The first problem we tackled using our virtual environment was collecting images to provide an overview of the scene. This task naturally breaks down into the following sub-tasks: \begin{itemize} \item Identify the region that needs to be mapped. \item Divide the region into discrete tiles, the centre of which will define the point where an image will need to be taken to cover that tile. The spacing between tiles should provide approximately a 20\% overlap between the images recorded for each tile to provide optimal image stitching results using algorithms such as ORB \cite{6126544}. \item Design an algorithm that will assign a set of points to each RAV. These sets should form a partition of the full set of points. The objective should be to minimize the time taken for the longest flight path. \item For each waypoint of the calculated RAV routes, collect an image with GPS position and camera metadata and send each collected image to a repository for analysis. \end{itemize} These tasks are subject to the assumptions that the RAVs operate at a fixed height which was chosen to avoid possible obstacles (32m), that the desired region to map is a regular polygonal region specified using the WGS 84 coordinate system and that the RAVs operate at a known average velocity for the duration of their flight. It is also assumed that the region in which the RAVs will operate in is small enough to be considered a flat plane 32m above the earth's surface. \section{Generation of Waypoints and Routes for RAVs} In this context, waypoints are GPS coordinates that RAVs travel to in order to collect data, and a sequence of waypoints defines a route. From our work in extending the API of the AirSim plugin, we were able to generate waypoints for RAVs using a GPS coordinate class that could be mapped to UE4 coordinates. This means that we will be able to extend the work outlined in this paper to RAVs that do not operate in a virtual environment. The method for generating the waypoints is as follows, in the context of gathering data related to the simulated CBRNe scene spanning a polygonal region: \begin{enumerate} \item Among the bounding coordinates which define the polygon, identify the highest latitude, highest longitude, lowest latitude, lowest longitude. Generate a circum-rectangle from these coordinates which contains the polygon. The corner values defining the circum-rectangle are treated as points on the $x,y$ plane, forming their own finite rectangular plane as per the assumption outlined in \ref{sec:algodesign}. \item \label{point2} For the task of mapping, the desired width, $w$ between the points at which images are recorded for an overlap of $y \times 100\%$ between images, using a camera with a field of view (FOV) of $2 \times \theta$ degrees, at a height of $h$ meters, is given by the equation $w=2 \times h \times \frac{1-y}{y+1} \times \tan(\theta)$. We allow grid tiles to lie partially outside the grid to facilitate the full mapping of the grid. \item Calculate the size and number of increments (using \ref{point2}).) necessary to generate waypoints in both directions specified by the axes of the circum-rectangle. The (i, j) waypoint is calculated by taking the sum of the coordinate specified by the lowest latitude, lowest longitude and the increment along the first axis of the rectangle multiplied $i$ times plus the increment along the second axis of the rectangle multiplied $j$ times to give the next waypoint position. \item In order to remove the waypoints that lie inside the circum-rectangle but not the polygon, perform the following test to determine whether or not to delete the point: \\ For the given point to be tested, extend a ray from the point horizontally and record the number of times that it crosses the boundary of the polygon. If the line extended from the point being tested enters the polygon, it must exit again (since it is of infinite length and the region is finite), which means that an even number of boundary crossings implies that the point lies outside the polygon and an odd number implies that the point lies inside the polygon. This is a well known-algorithm, with documented implementations \cite{Shimrat:1962:APP:368637.368653}. \end{enumerate} Each RAV in the environment is treated as an agent, together forming a multi-agent system. These agents are treated as heterogeneous, as some RAVs may have sensors and other equipment attached to perform a specific task. Each agent is assumed to share the same internal representation of the environment, namely the connected graph defined by the generated waypoints, where each point is initially unvisited. In order to gather data at each of the waypoints, the route generating algorithm needs to satisfy the following: given a set $P$ of points to visit and $n$ RAV agents, find a subtour for each agent such that each point in $P$ is visited exactly once by any agent in the system, with the objective of minimizing the longest time taken for any individual agent subtour, in order to minimize the time taken to carry out the mapping task. This follows from the fact that the time taken to complete the overall mapping task equates to the longest time taken for any agent to complete their subtour. This is the Multiple Traveling Salesperson problem \cite{multipleTSP}. The approach taken was a centralized one, with the intention that we extend the work completed to a distributed form of the problem, where agents are not necessarily informed of a plan from a centralized source. A nearset neighbor algorithm was implemented as follows: \begin{algorithm} \caption{Generating the RAV Agent Routes} \label{alg:agentRoutesEdited} \begin{algorithmic}[1] \renewcommand{\algorithmicrequire}{\textbf{Input:}} \renewcommand{\algorithmicensure}{\textbf{Output:}} \REQUIRE Array of agents, Set of coordinates, Cost function which takes two GPS coordinates and outputs a real number representing the cost of travelling from one to the other. \ENSURE A key-value container of agents and their corresponding routes.\\ \hfill\pagebreak \noindent\textbf{\textit{\noindent Initialization} :}\\ agentPaths$\leftarrow$empty key-value container\\ visitedPoints$\leftarrow$empty array \\ For each agent in agents:\\ \quad Initialise path of agent as empty array in agentPaths currentAgentIndex$\leftarrow$0\\ currentAgent$\leftarrow$agents.get(currentAgentIndex)\\ \hfill\pagebreak \WHILE {pointsToVisit is not empty} \STATE agentPosition $\leftarrow$ last value in agentPaths.get(agent) \STATE P$\leftarrow$\(\displaystyle \min_{p \in pointsToVisit}\)cost(agentPosition, p) \STATE Update currentAgent value in AgentPaths to include P \STATE Add P to visitedPoints. \STATE Remove P from pointsToVisit. \STATE currentAgentIndex$\leftarrow$(currentAgentIndex+1) $\mathbf{mod}$$\vert$List of Agents$\vert$ \STATE currentAgent$\leftarrow$agents.get(currentAgentIndex) \ENDWHILE \RETURN agentRouteMap \end{algorithmic} \end{algorithm} \subsection{Algorithm Motivation} In designing this algorithm, we wanted to ensure that each RAV has a similar amount of work to perform in order to balance the work to be done across the system. The generated grid of points to visit is evenly spaced, which means that the cost in terms of distance of travelling to adjacent grid points is fixed along the two dimensions defined by the circum-rectangle of the polygonal region. This means our algorithm encourages RAVs to add the same (minimum) cost of travelling to an adjacent node to their cost each time they choose an additional node to visit, usually resulting in a balanced distribution of work across the system. \subsection{Algorithm Performance Evaluation} The algorithms performance is measured by finding the time taken for all of the generated routes to be completed, assuming that they are all started at the same time and all agents run in parallel. This equates to finding the distance of the longest generated path, assuming that all agents move at the same constant velocity. We calculated a lower bound for the cost of running this algorithm for $n$ agents, found to be $\frac{1}{n}\times$ cost of optimal path for a single agent. \\ \\Proof:\\ Let T be a tour that is an optimal solution to the Travelling Salesperson Problem (TSP) for a graph G(V, E), where E $\subseteq$ V $\times$ V, with a cost function $c(p_i, p_j)$ defined for all $(p_i, p_j)$ $\in$ E and an induced cost function C(T) = $\sum\limits_{(p_i, p_j)\in S_k}C(p_i, p_j)$ defined for any tour of G. The tour T is an ordered tuple (($p_i, p_j$), ($p_j, p_k$),..., ($p_m, p_n$)) $\subseteq$ E which satisfies Cost(T) = \(\displaystyle \min_{e \subseteq E}\) $\sum_{(p_i, p_j) \in e}$ c($p_i, p_j$) with the constraint that each $p_i \in$ V must be visited exactly once. This means T is a hamiltonian tour of G of minimal cost. Any partition ($T_1, T_2, ..., T_m$) of a solution T' can be written as C(T')= \\ $\sum\limits_{k=1}^{m}\sum\limits_{(p_i, p_j)\in T_k} c(p_i, p_j) \leq m\times$ \(\displaystyle\max_{T_k \in T}\) $\sum\limits_{(p_i, p_j)\in T_k}c(p_i, p_j)$ \\ \noindent and since Cost(T) $\leq$ Cost(T'), for the partition determined by Algorithm \ref{alg:agentRoutesEdited}, we find that for any solution S to the Multiple Traveling Salesperson (MTS) problem consisting of the partition ($S_1, S_2, ...,S_m$) for each of the m agents:\\ Cost(T) $\leq$ Cost(S) $\leq$ m$\times$ (\(\displaystyle\max_{S_k \in S}\) $\sum\limits_{(p_i, p_j)\in S_k}C(p_i, p_j)$) = Cost of MTS solution, S. This means we can use a solution of the standard Traveling Salesperson problem as a lower bound for comparison with Algorithm \ref{alg:agentRoutesEdited}. For example, the Held-Karp algorithm gives a well-known lower bound when dealing with a metric space \cite{VALENZUELA1997157}. \section{Conclusion} In this paper, we have outlined the core steps taken to create a customized virtual environment using a games engine and the real-world applications that can benefit from its use. We use a modular approach in designing the virtual environment which provides extensibility and flexibility in our model of the world. This will be valuable once the world starts to become large in terms of the number of actors included. We outlined the process of development of the environment, which was carried out \emph{independently} of the plugins used in order to avoid dependencies that could prevent us from using different or updated plugins at a later stage. We have also discussed our use of AirSim to provide us with a remote vehicle testbed to virtually test real-world scenarios in a safe and robust way. We extended the AirSim API to allow the querying of GPS position and the ability to send an RAV to a calculated GPS coordinate instead of an UE4 coordinate. A further enhancement was to include the use of debug lines to track the paths of each of the RAVs. \subsection{Virtual Environments: Advantages vs Drawbacks} As part of this research, we have considered the advantages and drawbacks of using a virtual environment to test the scene assessment technologies which are being developed in parallel. Advantages of using a virtual environment include: \begin{itemize} \item There is a low monetary cost associated with the development and many assets are freely available. \item Virtual environments are highly configurable and updating realistic scene components is straightforward. This allows flexibility in the specification of the environment. \item The virtual environment scales, whereas real-world events are limited by physical space. It is possible to add hundreds of actors to a scene without impacting engine performance significantly whereas in real life, producing a scene with hundreds of components is not feasible. \item Events that are relatively slow to occur in the real world can be simulated in a games engine more rapidly by accelerating the clock. This allows for rapid gathering of data for analysis than may be possible in the real world. \item The games engine provides a ground truth for everything included in the environment. This is valuable for image processing tasks such as automatically labelling data. \end{itemize} Drawbacks of using a virtual environment include: \begin{itemize} \item Simplified models of physical phenomena must be modelled in the virtual environment, which is time consuming and may not be fully accurate. \item High-fidelity models, components, textures, and layouts are needed in order to achieve a virtual environment that can provide a solid basis for transfer of expected test results to the real world. \item As noted in \cite{1609.01326}, training a computer vision model with images generated from a virtual environment may not consistently perform well on real-world images. \end{itemize} \subsection{Future Work} We plan to design further virtual scenes using the same modular approach outlined in this paper in order to be able to test AI systems across a range of operational scenarios. This will give us the ability to validate these systems prior to field tests that are expensive to run. We also intend to build on our current work to develop more efficient routing algorithms and improved image stitching results. We plan to introduce inter-agent communication protocols to introduce redundancy into the system in case an agent goes offline. A decentralized approach will be taken for the routing algorithms which will be able to make real-time adjustments in case of the failure of one of the RAVs. We will also develop algorithms that will autonomously identify sources of hazardous material based on sensor readings. This will then feed into a routing algorithm for ground vehicles to autonomously navigate to identified evidence collection points. Finally, we will refine the simulated environment by modifying textures and designing and locating more physically realistic assets to generate a large, annotated photo-realistic data set that can be used for computer vision applications such as pixel-level image annotation and object identification. \bibliographystyle{ieeetr}
\section{Introduction} \label{sec:introduction} The use of spreadsheets in industry is widespread. It is estimated that 90\% of all analysts use spreadsheets for their calculations \cite{winston2001executive} and 95\% of US firms use spreadsheets in some form of financial reporting \cite{panko2008sarbanes}. This reporting and the calculations of annalists in spreadsheets are used by companies to make decisions. Unfortunately, spreadsheets are known to be error-prone \cite{panko1998we}. This increases the risk that companies make decisions that are based on inaccurate information which can lead to incorrect decisions and loss of money\footnote{http://www.eusprig.org/horror-stories.htm}. A substantial part of current spreadsheet research is focused on improving the quality of spreadsheets by applying software engineering methods to them like testing \cite{rothermel2000wysiwyt} \cite{roy2017spreadsheet}, reverse engineering \cite{Hermans2010} \cite{cunha2010automatically}, code smells \cite{hermans2014detecting} \cite{cunha2012towards}, and refactoring \cite{hermans2014bumblebee} \cite{badame2012refactoring}. This research has in common that it concentrates on spreadsheet formulas. However, there are other constructions in spreadsheets like charts, pivot tables, and array formulas, that are also used to present decision support information to the user of the spreadsheet. We do not know how widespread the use of these constructions are and if they are somehow related to the error-proneness of spreadsheets. There is almost no research on this topic. The only study we found is the paper of Fisher and Rothermel in which they introduce the EUSES corpus. They counted the number of spreadsheets that contained charts. To improve the overall quality of spreadsheets, we need to understand how spreadsheets are used in industry, and to obtain a complete understanding we should include constructions like charts, pivot table and array formulas in our research. Therefore, in this short paper, we analyze two popular spreadsheet corpora: Enron \cite{hermans2015enron} and EUSES \cite{fisher2005euses} on the use of charts, pivot tables, and array formulas. The contributions of this paper are: 1) a tool that is capable of analyzing properties of charts, pivot tables, and array formulas in Excel files and 2) an analysis of the use of charts, pivot tables, and array formulas in the EUSES and Enron corpora. We organize the remainder of this paper in the following way. In the next section, we describe the approach that was used to analyze the spreadsheets. In Section \ref{sec:results} we present the results of the analysis. Related work is discussed in Section \ref{sec:related_work} and we end the paper with the concluding remarks in Section \ref{sec:concluding_remarks}. \section{Approach and Tool} \label{sec:approach} In this study we use two popular spreadsheet corpora: EUSES \cite{fisher2005euses} and Enron \cite{hermans2015enron}. In previous work \cite{jansen2015corpora}, \cite{Hermans:2012aa}, \cite{Jansen:2015aa} we used the Spreadsheet Scantool, developed at Delft University of Technology. It utilizes the Gembox library to read spreadsheets. Unfortunately, Gembox is not able to analyze charts, pivot tables or array formulas. As a result, we developed a new Analyzer in Visual Basic for Applications (VBA) that is able to access the full Excel object model. We made the VBA code together with instructions about how to use it, available on Github\footnote{\url{https://github.com/HeerBommel/SpreadsheetExplorer.git}}. With the Analyzer, we collect several metrics about the use of charts, pivot tables, and array formulas in spreadsheets in the aforementioned corpora. For charts, we counted the number of spreadsheets that contained at least one chart and the total number of charts in the corpus. For each chart, we determined the chart type. In Excel there are 73 different chart types\footnote{https://msdn.microsoft.com/en-us/vba/excel-vba/articles/xlcharttype-enumeration-excel}. However, most chart types are a variation of their base type. For example, the `radar', `filled radar' and `radar with data markers' all belong to the category of radar charts. In our analysis, we mapped the actual chart type to its category. Also for pivot tables, we counted the number of spreadsheets that contained at least one pivot table. Next, for each pivot table we analyzed: \begin{itemize} \item the size: by counting the number of rows and columns of the underlying dataset \item the number of calculated fields: calculated fields are formulas that can refer to other fields in the pivot table \item the number of calculated items: calculated items are formulas that can refer to other items within a specific pivot field \item the aggregation functions used \item the number of pivot tables per worksheet \end{itemize} With respect to array formulas, we counted the number of spreadsheets that contained at least one array formula and we analyzed all array formulas to obtain a better understanding of why they are used. \section{Results} \label{sec:results} In this section, we will present the results of our analysis. The spreadsheets from both the Enron and the EUSES corpus were scanned for the usage of charts, pivot tables, and array formulas. For each construct, a more detailed analysis was executed to gain more insight into how they were used. \subsection{Charts} \label{sub:charts} Table \ref{tab:NoSpreadsheetsAnalyzed} shows the total number of spreadsheets we have analyzed. Some of the files were password protected, corrupted or otherwise unreadable and we have excluded them from the study (25 files in EUSES and 130 in the Enron dataset). Charts are not rare but the majority of spreadsheets do not contain any charts. They occur more in the Enron spreadsheets. This could be an indication that charts are used more frequently in an industrial setting. \begin{table}[ht] \caption{Number of spreadsheets with and without charts}\label{tab:NoSpreadsheetsAnalyzed} \centering \begin{tabular}{lrrrr} \hline & EUSES & \% & Enron & \% \\ \hline Charts & 340 & 8\% & 1,721 & 11\% \\ No Charts & 4,133 & 92\% & 14,078 & 89\% \\ \hline Total & 4,473 & 100\% & 15,799 & 100\% \\ \hline \end{tabular} \end{table} Within Excel there are two ways to create a chart: 1) the chart is created as a special type of worksheet, this is called a Chart Sheet or 2) the chart is embedded on an existing worksheet. Table \ref{tab:ChartSheetsVsEmbedded} presents the occurrence of the two types in both corpora. When Fisher and Rothermel introduced the EUSES corpus, they stated that 105 of the 4,498 spreadsheets contained charts \cite{fisher2005euses}. We found a different number. According to our analysis, there are 340 spreadsheets that contain charts. The difference is caused by the two different ways a chart can be created. Fisher and Rothermel only counted the chart sheets, while our analysis also included the embedded charts. \begin{table}[ht] \caption{The use of Chart Sheets vs Embedded Charts}\label{tab:ChartSheetsVsEmbedded} \centering \begin{tabular}{l|rr|rr} \hline & \multicolumn{2}{c|}{EUSES} & \multicolumn{2}{c}{Enron} \\ Type & \# Charts & \% & \# Charts & \% \\ \hline Sheet & 355 & 25\% & 1,149 & 13\% \\ Embedded & 1,090 & 75\% & 7,686 & 87\% \\ Total & 1,445 & 100\% & 8,835 & 100\% \\ \hline \end{tabular} \end{table} Tables \ref{tab:ChartTypesEUSES} and \ref{tab:ChartTypesEnron} show the different chart types that were used in both corpora. The most frequently used type is the column chart. Other popular types in both corpora are the line chart and the pie chart. Notable differences between the two corpora are the occurrence of the mixed and scatter chart types. The scatter chart is used frequently in the EUSES corpus (22\%), but less frequently in the Enron set (2\%). The opposite is true for the mixed chart type: it is frequently used within Enron but hardly in the EUSES set. A mixed chart type means that either two y-axes are used or there are two or more data series that use a different chart type (for example the combination of a line and a column chart), see Figure \ref{fig:ExampleMixedTypeChart} for an example. \begin{table}[ht] \caption{Overview of used chart types in EUSES}\label{tab:ChartTypesEUSES} \centering \begin{tabular}{rlrrrlrr} \hline Rank & Chart Type & \# Charts & \% \\ \hline 1 & Column & 515 & 35.6\% \\ 2 & Scatter & 322 & 22.3\% \\ 3 & Line & 258 & 17.9\% \\ 4 & Pie & 139 & 9.6\% \\ 5 & Bar & 125 & 8.7\% \\ 6 & Mixed & 55 & 3.8\% \\ 7 & Surface & 15 & 1.0\% \\ 8 & Area & 13 & 0.9\% \\ 9 & Stock & 2 & 0.1\% \\ 10 & Radar & 1 & 0.1\% \\ \hline \end{tabular} \end{table} \begin{table}[ht] \caption{Overview of used chart types in Enron}\label{tab:ChartTypesEnron} \centering \begin{tabular}{rlrr} \hline Rank & Chart Type & \# Charts & \% \\ \hline 1 & Column & 4,253 & 48.1\% \\ 2 & Line & 2,815 & 31.9\% \\ 3 & Mixed & 866 & 9.8\% \\ 4 & Pie & 649 & 7.3\% \\ 5 & Scatter & 168 & 1.9\% \\ 6 & Area & 67 & 0.8\% \\ 7 & Bar & 11 & 0.1\% \\ 8 & Surface & 6 & 0.1\% \\ \hline \end{tabular} \end{table} \begin{figure}[ht] \centering \includegraphics[clip,width=\columnwidth]{bja-180731-ChartMixedType.pdf} \caption{Mixed chart type (Source: Enron Corpus scott\_neal\_\_38010\_\_Helplist.xls, sheet US Gas)} \label{fig:ExampleMixedTypeChart} \end{figure} \subsection{Pivot Tables} \label{sub:pivot_tables} Table \ref{tab:NoSpreadsheetsWithPivot} shows the number of spreadsheets in both corpora that contain pivot tables. It shows that pivot tables are used very rarely but that they are used more frequently in the industrial Enron set than in the EUSES spreadsheets. \begin{table} \caption{Number of Spreadsheets with Pivot Tables}\label{tab:NoSpreadsheetsWithPivot} \centering \begin{tabular}{lrrrr} \hline & EUSES & \% & Enron & \% \\ \hline Pivot & 19 & 0.4\% & 244 & 1.5\% \\ No Pivot & 4,454 & 99.6\% & 15,555 & 98.5\% \\ \hline Total & 4,473 & 100.0\% & 15,799 & 100.0\% \\ \hline \end{tabular} \end{table} \begin{table} \hfill \caption{Overview of Pivot Table Metrics}\label{tab:PivotMetrics} \centering \begin{tabular}{lrrrr} \hline & avg. \# & avg. \# & \# calc. & \# calc. \\ Corpus & records & fields & items & fields \\ \hline EUSES & 3,738 & 13 & 3 & 0 \\ Enron & 4,073 & 28 & 0 & 0 \\ \hline \end{tabular} \end{table} Pivot tables can be used to analyze large datasets. Therefore, we analyzed the average size of the data tables behind the pivot tables (Table \ref{tab:PivotMetrics}). The maximum number of records we found is equal to the maximum number of rows up to Excel 2003 (65,535 rows). The average number of records in both datasets are comparable, but in the Enron sheets, the average number of columns (fields) in these data sets is larger. Within a pivot table, it is possible to create calculated fields or items based on other data in the table. From Table \ref{tab:PivotMetrics} we can observe that this functionality is hardly used. The main functionality that a pivot table provides is the possibility to summarize large data sets with aggregate functions. We analyzed the use of these functions and found that, in both corpora, in more than 85\% of the cases, either the function Sum or Count was used to summarize the data. When a pivot table is defined in Excel, by default it is created on a new worksheet. However, it is possible to create more than one pivot table on a worksheet and based on our analysis we can conclude that users tend to do so. The average number of pivot tables per worksheet ranges from 1.3 (EUSES) to 1.6 (Enron) and we found a maximum of nine pivot tables on one worksheet. \subsection{Array Formulas} \label{sub:array_formulas} Formulas in Excel always return a single value. However, with an array formula\footnote{\url{https://support.office.com/en-us/article/Guidelines-and-examples-of-array-formulas-7d94a64e-3ff3-4686-9372-ecfd5caa57c7?ui=en-US&rs=en-US&ad=US}}, it is possible to perform multiple calculations on one or more items of an array and return either a single value or multiple values. The formulas have to be entered with a special key combination (ctrl + shift + enter) and most users are unaware of their existence. Nevertheless, we checked in both corpora for array formulas and to our surprise, we found that their occurrence is similar to that of pivot tables. About 1.2\% of the spreadsheets (in both corpora) contains array formulas. In the 250 spreadsheets that contained one or more array formulas, we found a total of 3,965 unique array formulas. We have analyzed these formulas to obtain a better understanding of why array formulas are used. Table \ref{tab:ArrayUseCases} summarizes the results. \begin{table}[ht] \hfill \caption{Use cases for Array Formulas}\label{tab:ArrayUseCases} \centering \begin{tabular}{lrrrr} \hline Use case & \# Formulas & \% of Formulas \\ \hline Multiple criteria aggregation & 2,398 & 60.5\% \\ Array functions & 690 & 17.4\% \\ Sumproduct & 455 & 11.5\% \\ User defined functions & 264 & 6.7\% \\ Unnecessary or erroneous & 66 & 1.7\% \\ Repeat block & 47 & 1.2\% \\ TABLE function & 45 & 1.1\% \\ \hline Total & 3,965 & 100.0\% \\ \hline \end{tabular} \end{table} In over 60\% of the cases, array formulas are used to calculate aggregated values with functions like SUM, MIN, and AVERAGE, based on multiple criteria. An example of such a formula is shown in Figure \ref{fig:ExampleArray}. \begin{figure}[ht] \centering \includegraphics[scale=0.30]{bja-180731-ArraySUMIFS.pdf} \caption{Array formula for a multiple criteria SUM (Source: Enron Corpus eric\_linder\_\_9655\_\_4\_02act.xlsx, sheet Preschedule, cell I30)} \label{fig:ExampleArray} \end{figure} The curly brackets indicate that the formula is an array formula. This specific use case is related to the age of both the Enron and the EUSES corpus. At the time the spreadsheets in the Enron and EUSES corpus were created, there were no functions available for conditional aggregation of values and it could only be accomplished by using an array formula or the SUMPRODUCT function. However, as from Excel 2010, Microsoft has added dedicated functions like SUMIFS, AVERAGEIFS, MINIFS, etc. for these type of calculations. Another important use case for array formulas are the special array functions in Excel, like TRANSPOSE, MMULT, LINEST, FREQUENCY, and MINVERSE. Instead of returning a single value, these functions return an array as result and can only be used in an array formula. Sometimes an array formula is entered as a multi-cell array formula. In such a case a group of cells gets exactly the same array formula and this formula can only be edited when the whole group is selected. The formula will calculate the result for each item in the array of cells. We grouped this use case under the category repeat block. Other use cases we found were user-defined functions that are used as array formulas and what-if analyses with a data table (TABLE function \footnote{https://support.office.com/en-us/article/calculate-multiple-results-by-using-a-data-table-e95e2487-6ca6-4413-ad12-77542a5ea50b}). Finally, we encountered a set of array formulas that were either incorrect or unnecessary. The latter meaning that the same formula would also have worked without the special array syntax. \section{Related Work} \label{sec:related_work} Most related to our work are the papers introducing the corpora that we have analyzed, Euses~\cite{fisher2005euses} and Enron~\cite{hermans2015enron}. While the paper introducing EUSES describes statistics on charts too the paper on Enron does not. Another spreadsheet corpus is FUSE \cite{barik2015f}. This corpus consists of almost 250,000 spreadsheets that were extracted from a public web archive with over 26 billion pages. We preferred the Enron corpus over the FUSE corpus because the Enron spreadsheets were used in an industrial setting. Besides those two corpora, there are other smaller corpora: Two prominent corpora are the Galumpke and Wall corpora, containing 82 and 150 spreadsheets respectively, both derived from classroom experiments~\cite{panko2000two}. Powell and colleagues survey other corpora used in field audits, each audit examining between 1 and 30 spreadsheets~\cite{powell2008critical}. To our knowledge, none of these corpora are publicly available. Furthermore, there are papers on spreadsheet metrics, which also measure properties of spreadsheets. In 2004, Bregar published a paper presenting a list of spreadsheet metrics based on software metrics~\cite{breg2004}. He, however, does not provide any justification of the metrics, nor did he present an evaluation. \section{Concluding Remarks} \label{sec:concluding_remarks} In this paper, we analyzed two popular spreadsheet corpora and focussed on the use of charts, pivot tables, and array formulas. Although the spreadsheets in both corpora are more than ten years old, we believe they still offer a valuable insight into how they are used. Especially because Microsoft did not make a lot of changes with respect to charts, pivot tables, and array formulas. We found that charts are used in about 10\% of the spreadsheets. The most commonly used chart types are Column, Line, and Pie. Pivot tables are much rarer and only found in about 1\% of the spreadsheets. In more than 85\% of the cases, the data in the pivot table is summarized with the aggregate functions \emph{Sum} and \emph{Count}. Finally, to our surprise, the complex array formulas are used as frequently as pivot tables. Overall the use of charts, pivot tables, and array formulas in spreadsheets is limited. Still, they can have an impact on the error-proneness of spreadsheets. Especially pivot tables and array formulas can introduce new types of errors. A well-known problem with pivot tables is that they are not automatically refreshed when the underlying data changes, increasing the risk that the user is analyzing outdated data. Array formulas are difficult to understand and not very well known by the majority of the spreadsheet users. Because of their complexity, it is easy to make errors in these formulas. The information presented in the charts is coming from the underlying data. Errors in this data will lead to errors in charts. However, charts also can introduce their own errors. For example, Excel will in some cases automatically let the Y axis not start at zero, which could misrepresent the underlying data.
\section{Introduction} \label{introduction} The Ethernet communication standard is widely used in robotics systems due to its popularity and reduced cost. When it comes to real-time communications, while historically Ethernet represented a popular contender, many manufacturers selected field buses instead. As introduced in previous work \cite{DBLP:journals/corr/abs-1804-07643}, we are starting to observe a change though. With the arrival of the `Time Sensitive Networking' (TSN) standards, Ethernet is expected to gain wider adoption for real-time robotic applications. There are currently several communication technologies based on the Ethernet protocols. Some protocols such as Profinet RT \cite{profinet} or Powerlink \cite{powerlink} use a network stack specifically designed for the protocol\footnote{These network stacks have been specifically designed to meet the desired real-time capabilities.}. Other protocols, such as the Data Distributed Services (DDS) \cite{dds}, OPC-UA \cite{opcua} or Profinet are built on top of the well known TCP/IP and UDP/IP OSI layers. This facilitates the process of interoperating with common transport protocols and ensures a high compatibility between devices. However, their corresponding network stacks and drivers are typically not optimized for real-time communications. The real-time performance is limited when compared to other Ethernet alternatives with specific network stacks.\\ In this work, we aim to measure and evaluate the real-time performance of the Linux network subsystem with the UDP and IP protocols. UDP is used by several real-time transport protocols such as the Real Time Publish Subscribe protocol (RTPS). We aim to determine which configuration provides better isolation in a mixed-critical traffic scenario. To achieve real-time performance, the network stack will be deployed in a Real-Time Operating System (RTOS). In the case of Linux, the standard kernel does not provide real-time capabilities. However, with the Real-time Preemption patch (PREEMPT-RT), it is possible to achieve real-time computing capabilities as demonstrated \cite{JoC}. Despite the Linux network subsystem not being optimized for bounded maximum latencies, with this work, we expect to achieve reasonable deterministic communications with PREEMPT-RT, as well as a suitable configuration.\\ The content below is structured as follows: section \ref{related_work} introduces related previous work. In particular, we review the real-time performance of Linux with PREEMPT-RT and the real-time communications in Linux for robotics. Section \ref{background} outlines an overview of the key components of the Linux kernel we have used to configure our system to optimize the real-time communications over Ethernet. Section \ref{setup_results} discusses the experimental results obtained while evaluating the presented hypotheses. Finally, Section \ref{conclusions} presents our conclusions and future work.\\ \section{Related work} \label{related_work} In \cite{Abeni_investigatingthe}, Abeni et al. compared the networking performance between a vanilla kernel 3.4.41 and the same version with PREEMPT-RT. They investigated the throughput and latency with different RT patch implementations. They also explained some of the key ideas of the Linux Network architecture in PREEMPT-RT and showed an evaluation of the network latency by measuring the round-trip latency with the UDP protocol. The results showed that the differences between the kernel version tested appeared when the system was loaded. For the kernel versions where the soft Interrupt Requests (IRQ) were served in the IRQ threads the results showed that latency was bounded. However, the influence of concurrent traffic was not discussed in the paper.\\ Khoronzhuk and Valris \cite{linaro_net_perf} showed an analysis of the deterministic performance of the network stack with the aim of using it with TSN. They used a real-time kernel 4.9 with a 1 Gbps Ethernet network interface. They concluded that there is jitter in the order of hundreds of microseconds across the networking stack layers, both in transmission and reception paths.\\ For an appropriate setup of our infrastructure, we made active use of the work presented at \cite{hard_soft_alison} and \cite{osadl_udp}, which provide some guidelines to configure a PREEMPT-RT based OS for real-time networking. \section{Setting up real-time communications in Linux} \label{background} \subsection{The Real-time Preemption patch (PREEMPT-RT)} \label{preempt-rt} There are currently different approaches to use Linux for real-time applications. A common path is to leave the most critical tasks to an embedded RTOS and give to Linux the highest level commands. A second approach is to use a dual-kernel scheme like Xenomai \cite{xenomai} and RTAI \cite{rtai} which deploy a microkernel running in parallel with a separate Linux kernel. The problem for this kind of solution is that it requires special tools and libraries.\\ A third approach is to use a single-kernel. The Real-Time Linux (RTL) Collaborative Project \cite{rtl} is the most relevant open-source solution for this option. The project is based on the PREEMPT-RT patch and aims to create a predictable and deterministic environment turning the Linux kernel into a viable real-time platform. The ultimate goal of the RTL project is to mainline the PREEMPT-RT patch. The importance behind this effort is not related to the creation of a Linux-based RTOS, but to provide the Linux kernel with real-time capabilities. The main benefit is that it is possible to use the Linux standard tools and libraries without the need of specific real-time APIs. Also, Linux is widely used and strongly supported, this helps to keep the OS updated with new technologies and features, something which is often a problem in smaller projects due to resource limitations. \\ \subsection{The Linux Networking Architecture} \label{LNS} While it is possible to bypass the Linux Network Stack using custom drivers or user-space network libraries, we are interested in using the Linux Network Stack; mainly, because it is easier to maintain and integrate with a user-space application or communication middlewares. In addition, the Linux Network Stack supports a wide range of drivers which allow to deploy an application in different devices.\\ \subsubsection{Linux Traffic Control} \label{tc} An important module of the networking subsystem is the Linux kernel packet scheduler, which is configured with the user-space tool Linux Traffic Control (TC) \cite{tc}. TC provides mechanisms to control the way enqueued packets are sent and received, it provides a set of functionality such as shaping, scheduling, policing and dropping network traffic. \\ The main element of the Linux packet scheduler module are the queuing disciplines (Qdisc), which are network traffic disciplines to create queues and quality of service (QoS) rules for reception and transmission. There are ingress and egress Qdisc for reception and transmission respectively. The egress Qdisc provides shaping, scheduling and filter capabilities for data transmission from the network protocol layers to the network interface ring buffers. On the other hand, the ingress Qdisc provides filter and dropping capabilities for the reception path from the network interface ring buffers to the network protocol layers (although these are commonly less used).\\ For the egress Qdisc there are two basic types of disciplines: classless Qdisc and classful Qdisc. The classless Qdisc does not contain another Qdisc so there is only one level of queuing. The classless Qdisc only determines whether the packet is classified, delayed or dropped. The classful Qdisc can contain another Qdisc, so there could be several levels of queues. In such case, there may be different filters to determine from which Qdisc packets will be transmitted.\\ Qdisc can be used to avoid traffic congestion with non real-time traffic at the transmission path (figure \ref{tx_stack}). For a classless Qdisc, the default discipline is the PFIFO\_FAST, which has three FIFO priority bands. In the case of a classful Qdisc there is the PRIO qdisc which can contain an arbitrary number of classes of differing priority. There are also specific egress Qdisc destined for multiqueue network devices, for example the MQPRIO Qdisc \cite{mqprio}, which is a queuing discipline to map traffic flows to hardware queues based on the priority of the packet. This Qdisc will dequeue packets with higher priority allowing to avoid contention problems in the transmission path. In addition to the priority Qdisc, it is common to attach a shaper to limit low priority traffic bandwidth such as a the `Token Bucket Filter' TBF Qdisc \cite{tbf}.\\ \begin{figure}[h!] \centering \includegraphics[width=0.5\textwidth]{images/stack5.jpg} \caption{\footnotesize Linux networking stack transmission path} \label{tx_stack} \end{figure} Recently, because of the interest in support TSN in the Linux network stack, new Qdiscs have been created or are currently under development. The IEEE 802.1Q-2014 Credit Based Shaper (CBS) \cite{cbs}, Qdisc has already been included from kernel 4.15. The CBS is used to enforce a Quality of Service by limiting the data rate of a traffic class. Currently there are two Qdisc under development, the `Earliest Transmit Time First (ETF)' \cite{lwn_etf} which provides a per-queue transmit time based scheduling and the `Time-Aware Priority Scheduler' (TAPRIO) which provides per-port scheduling. These Qdisc will allow to create deterministic scheduling in software or to offload the work to the network hardware if it is supported.\\ \subsubsection{Traffic classification} \label{cl} In order to steer a traffic flow to a Qdisc or to a ring buffer, the traffic flow must be classified usually by marking the traffic with a priority. There are several ways to set the priority of a specific traffic flow: a) from the user-space using socket options SO\_PRIORITY and IP\_TOS, b) with iptables and c) with net\_prio cgroups. Setting the priority of a flow maps the traffic from a socket (or an application) to a Socket Buffer (SKB) priority, which is an internal priority for the kernel networking layer. The SKB priority is used by the MQPRIO Qdisc to map the traffic flow to a traffic class of the Qdisc. At the same time, each traffic class is mapped to a TX ring buffer. \\ \subsubsection{Network hard IRQ threads and softirqs} \label{irqs} At the reception path, the processing of the packets is driven by the kernel interrupt handling mechanism and the ``New API'' (NAPI) network drivers. NAPI is a mechanism designed to improve the performance for high network loads. When there is a considerable incoming traffic, a high number of interrupts will be generated. Handling each interrupt to process the packets is not very efficient when there are many packets already queued. For this reason NAPI uses interrupt mitigation when high bandwidth incoming packets are detected. Then, the kernel switches to a polling-based processing, checking periodically if there are queued packets. When there is not as much load, the interrupts are re-enabled again. In summary, the Linux kernel uses the interrupt-driven mode by default and only switches to polling mode when the flow of incoming packets exceeds a certain threshold, known as the ``weight'' of the network interface. This approach works very well as a compromise between latency and throughput, adapting its behavior to the network load status. The problem is that NAPI may introduce additional latency, for example when there is bursty traffic.\\ There are some differences between how PREEMPT-RT and a normal kernel handle interrupts and consequently how packets are handled at the reception path. The modifications of PREEMPT-RT allow to configure the system to improve the networking stack determinism.\\ In PREEMPT-RT, most interrupt request (IRQ) handlers are forced to run in threads specifically created for that interrupt. These threads are called IRQ threads \cite{lwn_irq_threads}. Handling IRQs as kernel threads allows priority and CPU affinity to be managed individually. IRQ handlers running in threads can themselves be interrupted, so that the latency due to interrupts are mitigated. For a multiqueue NIC, there is an IRQ for each TX and RX queue of the network interface, allowing to prioritize the processing of each queue individually. For example, it is possible to use a queue for real-time traffic and raise the priority of that queue above the other queue IRQ threads.\\ Another important difference is the context where the softirq are executed. From version 3.6.1-rt1, the soft IRQ handlers are executed in the context of the thread that raised that Soft IRQ \cite{lwn_softirq}. This means that the NET\_RX soft IRQ will be normally executed in the context of the network device IRQ thread, which allows a fine control of the networking processing context. However, if the network IRQ thread is preempted or it exhausts its NAPI weight time slice, it is executed in the ksoftirqd/n (where n is the logical number of the CPU). \\ Processing packets in the ksoftirqd/n context is troublesome for real-time because this thread is used by different processes for deferred work and can add latency. Also, as the ksoftirqd runs with SCHED\_OTHER policy, the thread execution can be easily preempted. In practice, the soft IRQs are normally executed in the context of NIC IRQ threads and in the ksoftirqd/n thread for high network loads and under heavy stress (CPU, memory, I/O, etc..).\\ \subsubsection{Socket allocation} \label{skb_alloc} One of the current limitations of the network stack for bounded latency is socket memory allocation. Every packet in the network stack needs a \emph{sckbuff} struct which holds meta-data of the packet. This struct needs to be allocated for each packet, and the time required for the allocation represents a large part of the overhead for processing the packet and jitter source.\\ One of the last projects of the Linux network developers is the XDP or eXpress Data Path \cite{xdp} which aims to provide a high performance, programmable network data path in the Linux kernel. XDP will provide faster packet processing by eliminating the socket meta-data allocation. Despite real-time communications are not the main motivation behind this project, XDP looks like an interesting feature to be used as an express data path for real-time communications \cite{jesus_tsn}.\\ \section{Experimental setup and results} \label{setup_results} To evaluate the real-time performance of the network stack, we used two embedded devices, measuring the latencies of a round-trip test.\\ \subsection{Round-trip test} \label{setup} The network latency is measured as the round-trip time (RTT), also called ping-pong test. For the test we use a client in one of the devices and a server in the other. The round-trip latency is measured as the time it takes for a message to travel from the client to the server, and from the server back to the client. For the client and server one we used a modified version of cyclictest \cite{cyclictest} which allows us to save the statistics and create latency histograms which show the amount of jitter and worst-case latency of the test. Additionally, we count the number of missed deadlines for a 1 millisecond target loop time.\\ For the timing loop we used the \emph{clock\_nanosleep} primitive. We also used memory locking, the FIFO scheduler and set a real-time priority of 80. In all the tests, we marked the traffic as priority traffic using the socket option SO\_PRIORITY. To generate load in the system, we used the program \emph{stress} and, to generate traffic, the program \emph{iperf}.\\ \begin{figure}[h!] \centering \includegraphics[width=0.4\textwidth]{images/RoundTrip_Latency.jpg} \caption{\footnotesize Graphical presentation of the measured round-trip latency. T1 is the time-stamp when data is send from the round-trip client and T2 is the time-stamp when data is received again at the round-trip client. Round-trip latency is defined as T2 - T1.} \label{ping-pong} \end{figure} \subsubsection{Experimental setup} The main characteristics of the embedded device are: \begin{itemize} \item Processor: ARMv7 Processor (2 cores). \item Kernel version: 4.9.30. \item PREEMPT-RT patch (when used): rt21. \item Link capacity: 100/1000 Mbps, Full-Duplex. \end{itemize} Each device has a switched endpoint as network interface. The devices are connected in linear topology with a PC. The PC is simply used to generate contending traffic, also referred in this work as background traffic. \\ The traffic used to measure the end-to-end latency is marked with higher priority than the background traffic. The embedded device network interface has 3 queues (tx\_q0, tx\_q1, tx\_q3). In our case, the network drivers use the Priority Code Point (PCP) of the Ethernet header to map a frame with a TX queue. Priority 4 is mapped to tx\_q0, priorities 2 and 3 to tx\_q1 and the rest of priorities to tx\_q2. We configure a MQPRIO qdisc to map the SKB priorities with the same classification criteria than the one used by the network device drivers. The Qdisc queues are mapped one to one with each hardware queue, so we can avoid traffic contention at the network layer in the transmission path.\\ \begin{lstlisting} tc qdisc replace dev eth1 root mqprio num_tc 3 \ map 2 2 1 1 0 2 2 2 2 2 2 2 2 2 2 2 queues 1@0 1@1 1@2 hw 0 \end{lstlisting} This command maps the SKB priority 4 with queue 0, SKB priorities 2 and 3 with queue 1 and the rest of priorities with queue 2. Checking the classes setting, we get the following output: \begin{lstlisting} root@DUT1:~# tc -g qdisc show dev eth1 qdisc mqprio 8001: root tc 3 map 2 2 1 1 0 2 2 2 2 2 2 2 2 2 2 2 queues:(0:0) (1:1) (2:2) qdisc pfifo_fast 0: parent 8001:3 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 qdisc pfifo_fast 0: parent 8001:2 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 qdisc pfifo_fast 0: parent 8001:1 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 \end{lstlisting} Apart from the networking layer mapping, we need to map the SKB priorities with the priority used by the Ethernet layer, which is the PCP. We set a one to one configuration. This sets the priority in VLAN field of the Ethernet header according to the SKB priority configured in the user-space. The PCP is used by the Network interface Card (NIC) to map traffic to the hardware queues. \begin{lstlisting} root@DUT1:~# ip link set eth1.2 type vlan egress 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7 \end{lstlisting} \subsection{Task and IRQ affinity and CPU shielding} \label{affinity} In real-time systems, real-time tasks and interrupts can be pinned to a specific CPU to separate their resources from non real-time tasks. This is an effective way to prevent non real-time processes interferences. \\ There are several ways to set the affinity of tasks and IRQs with CPUs. For the experiments, we decided to compare two levels of isolation. In the first case, we pin the real-time task the IRQ of the real-time traffic queue to the same CPU. We use ``pthread\_setaffinity\_np'' and ``smp irq affinity'' to set the priorities of the IRQs.\\ In the second case, we use \emph{cpusets} \cite{cpuset}, which is part of the Linux \emph{cgroups} to assign a CPU for real-time tasks. With this method, we can also migrate all processes running in the isolated CPU, so that only the real-time task is allowed to run in that CPU\footnote{Only some kernel processes will run in the isolated CPU which will reduce the system jitter considerably.}. We also set the affinity of all the IRQs to the non real-time CPU, while the IRQs of the real-time queue (of the network device) are set with affinity in the isolated CPU.\\ In the experimental setup, we use the described methods to isolate applications sending and receiving real-time traffic. The tests are run using different configurations: \texttt{no-rt}, \texttt{rt-normal}, \texttt{rt-affinities} and \texttt{rt-isolation}. In the first case, \texttt{no-rt}, we use a vanilla kernel. In the second case, \texttt{rt-normal}, we use a PREEMPT-RT kernel without binding the round-trip programs and network IRQs to any CPU. In the third case, \texttt{rt-affinities}, we bind the IRQ thread of the priority queue and the client and server programs to CPU 1 of each device. Finally, in the fourth case, \texttt{rt-isolation}, we run the round-trip application in an isolated CPU. In all the cases, we set the priority of the RTT test client and server to a 80 value.\\ In order to have an intuition about the determinism of each configuration, we ran a 1 hour cyclictest, obtaining the following worst-case latencies: no-rt: 13197 $\mu s$, rt-normal/rt-affinities: 110 $\mu s$ and rt-isolation: 88 $\mu s$. \\ \subsubsection{System and network load} For each case, we run the tests in different load conditions: idle, stress, tx-traffic and rx-traffic: \begin{itemize} \item \texttt{idle}: No other user-space program running except the client and server. \item \texttt{stress}: We generate some load to stress the CPU and memory and block memory.\footnote{Command used: stress -c 2 -i 2 -m 2 --vm-bytes 128M -d 2 --hdd-bytes 15M} \item \texttt{tx-traffic}: We generate some concurrent traffic in the transmission path of the client. We send 100 Mbps traffic from the client to the PC. \item \texttt{rx-traffic}: We generate some concurrent traffic in the reception path of the server. We send 100 Mbps traffic from the PC to the server. \end{itemize} When generating concurrent traffic, there is also congestion in the MAC queues of both devices. However, as the traffic of the test is prioritized, the delay added by the link layer is not meaningful for the test.\\ \subsection{Results} \label{results} We have compared the results obtained for a round-trip test of 3 hours of duration, sending UDP packets of 500 Bytes at a 1 millisecond rate. The Tables \ref{nort-table}, \ref{rt-table}, \ref{affinity-table}, \ref{isolated-table} show the statistics of the different configuration used under different conditions. For real-time benchmarks, the most important metrics are the worst-cases (Max), packet loss and the number of missed deadlines. In this case, we decided to set a 1 millisecond deadline to match it with the sending rate.\\ As it can be seen in Table \ref{nort-table}, the non real-time kernel results in what seems to be the best average performance, but in contrast, it has a high number of missed deadlines and a high maximum latency value; even when the system is idle. The latency suffers specially when the system is stressed due to the lack of preemption in the kernel. \\ For \texttt{rt-normal} (Table \ref{rt-table}), the latencies are bounded when the system is stressed. When generating concurrent traffic, we observe higher latency values and some missed deadliness.\\ For \texttt{rt-affinities}, we can see an improvement compared to the previous scenario. Specially for concurrent traffic (Table \ref{affinity-table}). We can also see that when pinning the round-trip threads and the Ethernet IRQs for the priority to the same CPU, the latency seems to be bounded.\\ In the case of \texttt{no-isolation} (table \ref{isolated-table}), we appreciate a similar behavior when compared to the affinity case. We can see that stressing the non isolated CPU has some impact on the tasks of the isolated core. However, in the idle case, for short test we observed very low jitter. To the best of our knowledge, one of the main contributions of such latency was the scheduler ticker, which is generated each 10 milliseconds\footnote{This effect was observed using kernel tracer `ftrace' and correlating the latency measurements with the traces during the test.}. While it is possible to avoid it in the client because it runs in a timed loop, in the server side, it is not possible to avoid the ticker. As both devices are not synchronized, at some point, the clock of the server side drifts from the client and the scheduler ticker interferes in the server execution. This effect can be seen in Figure \ref{plot_iso_ticker}.\\ When running the test with 200 Mbps RX-traffic, we observed that best-effort traffic is processed in the ksoftirqd/0 context continuously. This generates high latency spikes in all the cases, even for the isolation case. To trace the source of these latency spikes, we should trace the kernel taking a snapshot when the latency occurs. \\ \begin{table*}[ht] \centering \caption{Round-trip latency results: No RT} \label{nort-table} \begin{tabular}{|c|c|c|c|r|c|} \hline \multicolumn{6}{|c|}{No RT, Kernel version: 4.9.30} \\ \hline & Min($\mu$s) & Avg($\mu$s) & Max($\mu$s) & \multicolumn{1}{c|}{Missed deadline} & Packet loss \\ \hline Idle & 193 & 217 & 1446 & 15 / 600000 & 0 / 600000 \\ \hline Stress & 262 & 560 & 46742 & 20979 / 600000 & 0 / 600000 \\ \hline TX traffic at 100 Mbps & 195 & 378 & 7160 & 2298 / 600000 & 0 / 600000 \\ \hline RX traffic at 100 Mbps & 192 & 217 & 1426 & 22 / 600000 & 0 / 600000 \\ \hline \end{tabular} \end{table*} \begin{table*}[ht] \centering \caption{Round-trip latency results: RT Normal} \label{rt-table} \begin{tabular}{|c|c|c|c|r|c|} \hline \multicolumn{6}{|c|}{RT Normal, Kernel version: 4.9.30-rt21} \\ \hline & Min($\mu$s) & Avg($\mu$s) & Max($\mu$s) & \multicolumn{1}{c|}{Missed deadline} & Packet loss \\ \hline Idle & 251 & 266 & 522 & 0 / 600000 & 0 / 600000 \\ \hline Stress & 254 & 341 & 618 & 0 / 600000 & 0 / 600000 \\ \hline TX traffic at 100 Mbps & 265 & 320 & 25727 & 20 / 600000 & 0 / 600000 \\ \hline RX traffic at 100 Mbps & 263 & 292 & 898 & 9 / 600000 & 0 / 600000 \\ \hline \end{tabular} \end{table*} \begin{table*}[ht] \centering \caption{Round-trip latency results: RT, CPU Affinity} \label{affinity-table} \begin{tabular}{|c|c|c|c|r|c|} \hline \multicolumn{6}{|c|}{RT Affinity, Kernel version: 4.9.30-rt21} \\ \hline & Min($\mu$s) & Avg($\mu$s) & Max($\mu$s) & \multicolumn{1}{c|}{Missed deadline} & Packet loss \\ \hline Idle & 275 & 289 & 644 & 0 / 600000 & 0 / 600000 \\ \hline Stress & 277 & 358 & 828 & 0 / 600000 & 0 / 600000 \\ \hline TX traffic at 100 Mbps & 277 & 322 & 568 & 0 / 600000 & 0 / 600000 \\ \hline RX traffic at 100 Mbps & 274 & 287 & 592 & 0 / 600000 & 0 / 600000 \\ \hline \end{tabular} \end{table*} \begin{table*}[ht] \centering \caption{Round-trip latency results: RT, CPU Isolated} \label{isolated-table} \begin{tabular}{|c|c|c|c|r|c|} \hline \multicolumn{6}{|c|}{RT, CPU Isolated, Kernel version: 4.9.30-rt21} \\ \hline & Min($\mu$s) & Avg($\mu$s) & Max($\mu$s) & \multicolumn{1}{c|}{Missed deadline} & Packet loss \\ \hline Idle & 297 & 311 & 592 & 0 / 600000 & 0 / 600000 \\ \hline Stress & 298 & 355 & 766 & 0 / 600000 & 0 / 600000 \\ \hline TX traffic at 100 Mbps & 301 & 336 & 617 & 0 / 600000 & 0 / 600000 \\ \hline RX traffic at 100 Mbps & 296 & 312 & 542 & 0 / 600000 & 0 / 600000 \\ \hline \end{tabular} \end{table*} \begin{figure*}[h!] \begin{subfigure}[t]{.5\textwidth} \centering \includegraphics[width=0.8\linewidth]{images/idle.png} \caption{ } \label{plot_idle} \end{subfigure} \hfill \begin{subfigure}[t]{.5\textwidth} \centering \includegraphics[width=0.8\linewidth]{images/stress.png} \caption{} \label{plot_stress} \end{subfigure} \medskip \begin{subfigure}[t]{.5\textwidth} \centering \includegraphics[width=0.8\linewidth]{images/tx.png} \caption{} \label{plot_tx} \end{subfigure} \hfill \begin{subfigure}[t]{.5\textwidth} \centering \includegraphics[width=0.8\linewidth]{images/rx.png} \caption{} \label{plot_rx} \end{subfigure} \caption{ \footnotesize Real-time Ethernet round-trip-time histograms. a) Idle system. b) System under load (stress). c) Concurrent low priority traffic in the transmission path. d) Concurrent low priority traffic in the reception path. } \end{figure*} \begin{figure}[h!] \centering \includegraphics[width=0.45\textwidth]{images/iso_time_ticker.png} \caption{\footnotesize Time-plot for isolated CPU. At the beginning, we can observe the effect of the scheduler ticker preempting the real-time task and adding latency to the round-trip test latencies.} \label{plot_iso_ticker} \end{figure} \section{Conclusion and future work} \label{conclusions} The results obtained prove that the Linux real-time setup presented improves greatly the determinism of communications using the UDP protocol. First, we confirm that the communication delay caused when the system is under heavy load is mitigated by making use of a real-time kernel and by running the application with real-time priority. Second, we demonstrate that, whenever there is concurrent traffic, simply setting the priorities of the real-time process is not enough. Separating the real-time application and the corresponding interrupt in a CPU seems to be an effective approach to avoid high latencies. For higher concurrent traffic loads, however, we can still see unbounded latency and further research is required to overcome this limitation with our current setup. \\ We conclude that, under certain circumstances and for a variety of stress and traffic overload situations, Linux can indeed meet some real-time constraints for communications. Hereby, we present an evaluation of the Linux communication stack meant for real-time robotic applications. Future work should take into account that the network stack has not been fully optimized for low and bounded latency; there is certainly room for improvement. It seems to us that there is some ongoing work inside the Linux network stack, such as the XDP \cite{xdp} project, showing promise for an improved real-time performance. In future work, it might be interesting to test some of these features and compare the results.\\ \newpage \bibliographystyle{IEEEtran}
\section{Abelian $2$-groups}\label{abelian2groups} Abelian $2$-groups are a rich source of examples; we present below the computations of $R^*_\mathbb{C}(C_4\times C_2)$ and $R^*_\mathbb{C}(C_4\times C_4)$. To determine the graded rings in this section, we used all of the tools presented in this paper. \cref{theorem_quillenrelations} gives us a starting point to guess relations in the graded character rings, which we then determine precisely using basic virtual character algebra. Once we have a good candidate for $R^*(G)$, we discard as many extra relations as possible by restricting to various subgroups, and get rid of the last ones by looking at continuity of characters. \begin{Remark} In the sequel, we denote the evaluation of a virtual character $X$ at $g \in G$ by $X\vert_{g}$ rather than $\phi_g(X)$. Besides, it will be convenient to use an additive notation throughout, so we denote the cyclic groups by $\mathbb{Z}/4$ and $\mathbb{Z}/2$. \end{Remark} \begin{Proposition} \label{Z4Z2} \[ R^*(\mathbb{Z}/4 \times \mathbb{Z}/2) = \frac{\mathbb{Z}[x,y]}{(4x,2y,xy^3+x^2y^2)} \] with $|x| = |y| = 1$. \end{Proposition} \begin{proof} Let $\rho$ be the generating character of $R(\mathbb{Z}/4)$ sending $1$ to $i$, and $\sigma$ the nontrivial representation of $\mathbb{Z}/2$. Then $R^*(G)$ is generated by $c_1(\rho) =: x$ and $c_1(\sigma) =: y$. By restriction to cyclic subgroups, we see that $x$ has additive order $4$ and $y$, additive order $2$. Now consider $X = \rho - 1$ and $Y = \sigma - 1$. Then by expanding $(X+1)^4 = 1$ we get \[ 4X = -(6X^2 + 4X^3 + X^4) \] On the other hand, $Y^n = (-2)^{n-1}Y$, so \[ XY^3 = 4XY = -X^4Y - 4X^3Y - 6X^2Y = -X^4Y - X^3Y^3 + 3X^2Y^2. \] Modulo $\Gamma^5$, this is $xy^3 = x^2y^2$. The only other possible extra relations (that cannot be ruled out by restrictions to various subgroups) are: $x^{n-1}y = 0$, $x^{n-2}y^2 = 0$ or $x^{n-1}y = x^{n-2}y^2$ for some $n$. We use the continuity method to disprove all of these. Let $\widetilde{\Gamma}^n = \langle X^n, Y^n, X^{n-1}Y, X^{n-2}Y^2 \rangle$, then $\{ \widetilde{\Gamma}^n \}_n$ is an admissible approximation for $\{\Gamma^n\}_n$.\par First suppose that $x^{n-1}y = 0$ for some $n$, that is $X^{n-1}Y \in \Gamma^{n+1}$. Then for $N$ arbitrarily large, there exists $\widetilde{Z} \in \widetilde{\Gamma}^{n+1}$ such that $X^{n-1}Y = \widetilde{Z}+R$ with $R \in \Gamma^N$; in particular, by \Cref{evaluation_approximation}, for any $M>0$, there is an $N$ such that: \[ \begin{cases} v_2\left(\widetilde{Z}\vert_{(k,\ell)}\right) = v_2\left(X^{n-1}Y\vert_{(k,\ell)}\right) \text{ whenever } v_2\left(X^{n-1}Y\vert_{(k,\ell)}\right) < \infty \\ v_2\left(\widetilde{Z}\vert_{(k,\ell)}\right) > M \text{ whenever } v_2\left(X^{n-2}Y^2\vert_{(k,\ell)}\right) = \infty \end{cases}, \] for all $(k,\ell) \in \mathbb{Z}/4\times\mathbb{Z}/2$.\par Write: \begin{align*} \widetilde{Z} =& a\cdot X^{n+1} + b\cdot X^{n}Y + c\cdot X^{n-1}Y^2 + d\cdot Y^{n+1} \\ &+ P\cdot X^{n+2} + Q\cdot X^{n+1}Y + S\cdot X^{n}Y^2 + T\cdot Y^{n+2} \end{align*} where $a,b,c,d \in \mathbb{Z}$ and $P,Q,S,T \in \mathbb{Z}[X,Y]$. Evaluatin at $(2,1)$ gives $X\vert_{(2,1)} = Y\vert_{(2,1)} = -2$. Then the $2$-valuation of $X^{n-1}Y$ is $n$ while the $2$-valuation of $\widetilde{Z}$ is at least $n+1$. This shows that such a $\widetilde{Z}$ cannot exist, and thus $x^{n-1}y$ cannot be zero. A similar argument shows that $x^{n-2}y^2 \neq 0$.\par The only possible remaining relation is $x^{n-1}y = x^{n-2}y^2$. Let $Z = X^{n-1}Y + X^{n-2}Y^2$, and suppose $Z\in \Gamma^{n+1}$. Fix a large number $M>n+2$, and let $\widetilde{Z} \in \widetilde{\Gamma}^{n+1}$ and $R \in \Gamma^N$ satisfy $Z = \widetilde{Z} + R$ with the usual conditions on the valuation of $\widetilde{X}$. Then: \[ \widetilde{Z}\vert_{(2,0)} = a\cdot(-2)^{n+1} + P\cdot (-2)^{n+2} \] while $Z\vert_{(2,0)} = 0$, so $v_2(Z\vert_{(2,0)}) = +\infty$. In this case, we have $v_2(\widetilde{Z})>M>n+2$. This means in particular that $a = 0 \ (\mathrm{mod} \ 2)$, hence $a = 2a'$ for some $a'$. \par We now evaluate at $(1,1)$: \[ Z\vert_{(1,1)} = (i-1)^{n-2}\cdot 4 + (i-1)^{n-1}\cdot (-2). \] thus $v_2(Z\vert_{(1,1)}) = (n+1)/2$. On the other hand: \[ \widetilde{Z}\vert_{(1,1)} = a'\cdot 2\cdot(i-1)^{n+1} + b\cdot(i-1)^{n}(-2) + c\cdot(i-1)^{n-1}4 + d\cdot(-2)^{n+1} + \widetilde{R} \] where $v_2(\widetilde{R}) \geq \frac{n+2}{2}$. We see that $v_2(\widetilde{Z}\vert_{(1,1)}) \geq (n+2)/2$, so we cannot have $v_2(\widetilde{Z}\vert_{(1,1)}) = \widetilde{Z}\vert_{(1,1)}$, in contradiction with our assumption. This means that $Z \notin \Gamma^{n+1}$, and thus $x^{n-1}y \neq x^{n-2}y^2$. This completes the proof. \end{proof} \begin{Remark} Let $G = \mathbb{Z}/2^{n}\times \mathbb{Z}/2$. Then one can show, as above, that there is in $R^*(G)$ a relation of the form $ xy^{n+1} + x^2y^n = 0$. For $n=3$, it is possible to adapt the argument above and show that $R^*(G) = \frac{\mathbb{Z}[x,y]}{(8x, 2y, xy^{4} + x^2y^3)}$. Is it true in general that \[ R^*(\mathbb{Z}/2^n \times \mathbb{Z}/2) = \frac{\mathbb{Z}[x,y]}{(2^nx, 2y, xy^{n+1} + x^2y^n)}? \] \end{Remark} \begin{Proposition} \label{Z4Z4} \[ R^*(\mathbb{Z}/4 \times \mathbb{Z}/4) = \frac{\mathbb{Z}[x,y]}{(4x,4y,2x^2y+2xy^2, x^4y^2 - x^2y^4)} \] with $|x| = |y| = 1$ \end{Proposition} \begin{proof} Existence of relations: let $X, Y$ be the usual lifts of $x,y$. We use that $(X+1)^4 = 1$, that is, \begin{equation}\label{Z4Z4relationX} X^4 = -4X - 6X^2 -4X^3 \end{equation} Then: \begin{align*} X^4Y &= (-4X - 6X^2 - 4X^3)Y = -4XY - 6X^2Y -4X^3Y \\ &= X(6Y^2 + 4Y^3 + Y^4) - 6X^2Y -4X^3Y\\ 6XY^2 - 6X^2Y &= X^4Y - XY^4 +4X^3Y -4XY^3 \numberthis \label{Z4Z4relationdegree3}\\ 0 &= 2XY^2 + 2X^2Y (\mathrm{mod} \ \Gamma^4) \end{align*} so $2x^2y = 2xy^2$. By repeatedly applying \Cref{Z4Z4relationX} to $X^6Y - XY^6$, one obtains: \begin{equation*} X^6Y - XY^6 = 14X^2Y^3 - 14X^3Y^2 + 11X^2Y^4 - 11X^4Y^2 + 5X^3Y^4 - 5X^4Y^3. \end{equation*} The expression $14X^2Y^3 - 14X^3Y^2$ is the sum of $8X^2Y^3 - 8X^3Y^2$ which belongs to $\Gamma^7$, and $6X^2Y^3 - 6X^3Y^2$ which is simply \Cref{Z4Z4relationdegree3} multiplied by $XY$, and thus also belongs to $\Gamma^7$. Thus $x^4y^2 = x^2y^4$.\\ To show there are no extra relations, let $a_0, \cdots a_n \in \mathbb{Z}, n\geq 2$ satisfy: \[ z = a_0x^n + a_1x^{n-1}y + a_2x^{n-2}y^2 + a_3x^{n-3}y^3 + a_{n-1}xy^{n-1} + a_ny^n = 0 \] or in other words, \begin{align*} Z &:= a_0X^n + a_1X^{n-1}Y + a_2X^{n-2}Y^2 + a_3X^{n-3}Y^3 + a_{n-1}XY^{n-1} + a_nY^n \\ &= \sum_{k = 0}^{n+1}b_kX^{n+1-k}Y^k + \sum_{k = 0}^{n+2}P_k(X,Y)X^{n+2-k}Y^k \in \Gamma^{n+1}. \numberthis \label{Z4Z4_polynomial} \end{align*} Suppose, without loss of generality, that $a_0, a_1, a_n, b_0, b_1, b_n \in \{0,1,2,3\}$ and $a_2, a_3, a_{n-1}, b_2, \cdots, b_{n-1} \in \{0,1\}$ while $P_k(X,Y) \in \mathbb{Z}[X,Y]$. Let $\widetilde{Z}$ be the right hand side of the equation, and consider the restriction of \Cref{Z4Z4_polynomial} to the following subgroups: \begin{itemize} \item To $\mathbb{Z}/4\times 1$: then \Cref{Z4Z4_polynomial} becomes $a_0X^n = b_0X^{n+1} +P_0(X,0)X^{n+2} \in \Gamma^{n+1}$. This implies that $a_0 = b_0 = 0(\mathrm{mod} \ 4)$, and since we had assumed that $a_0,b_0 \in \{0,1,2,3\}$ we have $a_0 = b_0 = 0$. \item To $1\times\mathbb{Z}/4$: similarly we obtain $a_n = b_n = 0$. \item To $\langle (1,1) \rangle \cong \mathbb{Z}/4$: the generators $X$ and $Y$ both restrict to the generator $T$ and we obtain $\sum a_kT^n = 0 (\mathrm{mod} \ \Gamma^{n+1})$, so \begin{equation}\label{Z4Z4congruence} a_1+a_2+a_3+a_{n-1} = 0 (\mathrm{mod} \ 4). \end{equation} \end{itemize} Evaluating at $(1,2)$ yields: \begin{align*} v_2(\phi_{(1,2)}(Z)) &\geq \min\left(v_2(a_1) + \frac{n+1}{2}, v_2(a_2) + \frac{n+2}{2}, v_2(a_3) + \frac{n+3}{2}, v_2(a_{n-1}) + \frac{2n-1}{2}\right) \numberthis \label{Z4Z4valuation} \\ v_2(\phi_{(1,2)}(\tilde{Z})) &\geq \frac{n+2}{2} \end{align*} with equality if there is a strict minimum in \Cref{Z4Z4valuation}, so we must have $v_2(a_1) \geq 1$, that is $a_1 = 0$ or $a_1 = 2$. By evaluating at $(2,1)$ instead, one shows that $v_2(a_{n-1}) \geq 1$ and thus $a_{n-1} = 0$, since we had assumed $a_{n-1} \in \{0,1\}$. Our equation becomes $a_1+a_2+a_3 = 0 (\mathrm{mod} \ 4)$. If $a_1 = 0$ then $a_2 =a_3 = 0$, so we can assume $a_1 = 2$, and then $a_2 = a_3 = 1$. Thus $Z = 2X^{n-1}Y + X^{n-2}Y^2 + X^{n-3}Y^3$. To rule out this last possibility, consider the automorphism $\tau$ of $G$, which leaves $(1,0)$ invariant and sends $(0,1) $ to $(0,3)$. This induces a well-defined map $\tau^*$ of graded rings, which maps $y$ to $-y$. Then \[ \tau^*z = -2x^{n-1}y + x^{n-2}y^2 - x^{n-3}y^3 \] and summing $z + \tau^* z$ we obtain $2x^{n-2}y= 0$, which is impossible since all monomials in $R^*(G)$ have additive order $4$. Thus the assumption $a_0 = 2$ is wrong, and this concludes the proof. \end{proof} \section{Continuity of characters} \label{continuity} In the sequel, we view $R(G)$ as a topological ring, with the topology induced by the filtration $\lbrace \Gamma^n \rbrace$; that is, a subset $U \subseteq R(G)$ is open if for any $x\in U$ there is a $t$ such that $x + \Gamma^t \subseteq U$. If $G$ has exponent $m$, then each conjugacy class representative $g \in G$ gives rise to a ring morphism: \[ \phi_g : \begin{cases} R(G) \rightarrow \mathbb{Z}[\mu_m] \\ \ \ \rho \mapsto \chi_\rho(g) \end{cases}, \] where $\mu_m$ is a choice of primitive $m$-th root of unity. We are interested in continuity and density questions with respect to $p$-adic topologies on $\mathbb{Z}$. Note that, to make any kind of rigorous statement, we need to fix an extension of the $p$-adic valuation to $\mathbb{Z}[\mu_m]$. However, we are primarily interested in the case where $m$ is a power of $p$; in that case, as is well-known, there is only one such extension. In particular, \Cref{proposition_pgroupscontinuous} states that whever $G$ is a $p$-group, all evaluation morphisms are continuous. We apply this result in \Cref{Q8_gradedring} to the computation of $R^*(Q_8)$. \par Suppose we are given additive groups $\widetilde{\Gamma}^n \subseteq \Gamma^n$ $(n\geq 1)$ such that: \begin{enumerate}[A.] \item $\widetilde{\Gamma}^{n+1} \subseteq \widetilde{\Gamma}^n$ \label{admissiblefiltration1} \item $\Gamma^n = \widetilde{\Gamma}^n + \Gamma^{n+1}$ \label{admissiblefiltration2} \end{enumerate} (think of $\widetilde{\Gamma}^n$ as an approximation of $\Gamma^n$). Then by an immediate induction: \begin{Lemma} For all $k\in\mathbb{N}$, \[ \Gamma^n = \widetilde{\Gamma}^n + \Gamma^{n+k} \] \qed \end{Lemma} Call $\{\widetilde{\Gamma}^n \}_n$ an \textit{admissible approximation} for $\{\Gamma^n\}_n$ if it satisfies conditions (\ref{admissiblefiltration1}) and (\ref{admissiblefiltration2}). \begin{Remark} Whenever $\{\widetilde{\Gamma}^n\}$ is an admissible approximation, each $\widetilde{\Gamma}^n$ is dense in $\Gamma^n$ for the $\Gamma$-topology. \end{Remark} \begin{Proposition}\label{evaluation_approximation} Let $p$ be a prime number, and suppose the evaluation morphisms \[ \phi_1,\cdots \phi_k : R(G) \mapsto \mathbb{Z}[\mu_m] \] are continuous with respect to the topology induced by the filtration $\lbrace \Gamma^n \rbrace$ on $R(G)$, and the $p$-adic topology on $\mathbb{Z}[\mu_m]$. Then for all $x \in \Gamma^n$, and for all $M>0$, there is an element $\widetilde{x} \in \widetilde{\Gamma}^n$ such that for all $i = 1,\cdots,k$: \[ \begin{cases} v_p(\phi_i(\widetilde{x})) = v_p(\phi_i(x)) \text{ whenever } v_p(\phi_i(x)) < +\infty \\ v_p(\phi_i(\widetilde{x}))>M \text{ whenever } \phi_i(x) = +\infty \end{cases} \] \end{Proposition} \begin{proof} Let $x \in \Gamma^n$, $M>0$. Since all the $\phi_i$ are continuous with respect to the $p$-adic topology, there exists $N$ such that for all $j$ and for all $y \in \Gamma^N$ we have \[ v_p(\phi_j(y)) > \max\left( \max_{v_p(\phi_i(x)) < \infty} \ v_p(\phi_i(x)), \ M \right). \] We can then write $x = \widetilde{x}+r$ with $\widetilde{x}\in\widetilde{\Gamma}^n$ and $r \in \Gamma^N$. \end{proof} \begin{Proposition}\label{proposition_pgroupscontinuous} Let $G$ be a $p$-group. Then the morphisms $\phi_g$, for $g \in G$, are all continuous with respect to the $p$-adic topology on $\mathbb{Z}[\mu_m]$. \end{Proposition} \begin{proof} Fix an element $g \in G$ and let $|G| =: p^n$. By \Cref{gammatopology_coincides_idaictopology}, it suffices to show that $\phi_g$ is continuous with respect to the $I$-adic topology on the left. We show that for any irreducible character $\rho$ of $G$, \[ v_p\left(\phi_g\left(\rho - \varepsilon\left(\rho\right)\right)\right) > 0, \] which implies continuity. Since $G$ is a $p$-group, every character is a sum of $p^n$-th roots of unity, so \begin{align*} \phi_g(\rho-\varepsilon(\rho)) &= \rho(g) - \varepsilon(\rho) \\ &= \sum_{l = 1}^{\varepsilon(\rho)}(\mu_{p^n}^{i_l} - 1), \end{align*} and each $(\mu_{p^n}^{i_l} - 1)$ has positive $p$-valuation. \end{proof} The continuity method allows us to solve questions of torsion and nilpotency in $R^*(G)$: if some element $x \in R(G)$ is contained in $\Gamma^M$ with $M$ large, then $\phi_g(x)$ must be divisible by a large power of $p$. Here is a concrete example: let $G = Q_8 = \langle \ i,j,k \ \vert \ i^2 = j^2 = k^2 = ijk \ \rangle$ be the quaternion group of order $8$. \begin{Theorem} \label{Q8_gradedring} \[ R^*(Q_8) = \frac{\mathbb{Z}[x,y,u]}{(2x,2y,8u,x^2,y^2, xy-4u)} \] where $\vert x \vert = \vert y \vert = 1$ and $\vert u \vert = 2$, with explicit generators as described in \Cref{Q8_relations}. \end{Theorem} We will use continuity of characters to show that the additive order of $u$ is $8$ .\\ The group $Q_8$ has 5 conjugacy classes: $\lbrace 1\rbrace$, $\lbrace -1\rbrace$, $\lbrace \pm i\rbrace$, $\lbrace \pm j\rbrace$, $\lbrace \pm k\rbrace$ so 5 irreducible representations on $\mathbb{C}$. They are as follows: \begin{itemize} \item In dimension 1, the trivial representation, and the characters $\rho_1: \begin{cases} i \mapsto 1 \\ j\mapsto -1 \end{cases}$, $\rho_2 = -\rho_1$ and $\rho_3 = \rho_1\rho_2$, \item and in dimension 2, the representation $\Delta$: \begin{equation*} \Delta(i) = \begin{pmatrix} i & 0 \\ 0 & -i \end{pmatrix}, \ \ \ \Delta(j) = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}, \ \ \ \Delta(k) = \begin{pmatrix} 0 & -i \\ -i & 0 \end{pmatrix} \begin{matrix} \vphantom{1} \\ \vphantom{0}. \end{matrix} \end{equation*} \end{itemize} These representations satisfy the relations \begin{align} \rho_i^2 &= 1 \\ \rho_3 &= \rho_1\rho_2 \\ \Delta\rho_i &= \Delta \label{Q8_relationdelta} \\ \Delta^2 &= 1 + \rho_1 + \rho_2 + \rho_3. \end{align} Let us first take a look at the generators and relations of $Q_8$: \begin{Lemma} \label{Q8_relations} The graded ring $R^*(Q_8)$ is generated by the elements \[ x := c_1(\rho_1), \ \ \ \ y := c_1(\rho_2), \ \ \ \ u := c_2(\Delta), \] which satisfy the relations in \Cref{Q8_gradedring}, that is: \[ 2x = 2y = 8u = 0 , \ \ \ \ x^2 = y^2 = 0, \ \ \ \ xy = 4u. \] \end{Lemma} \begin{proof} First, we eliminate the redundant generators: $c_1(\rho_3) = c_1(\rho_1\rho_2) = c_1(\rho_1) + c_1(\rho_2)$, and $c_1(\Delta) = c_1(\det (\Delta) ) = c_1(1) = 0$. So $R^*(Q_8)$ is indeed generated by $x,y$ and $u$. \\ Now since $\rho_1^2 = \rho_2^2 = 1$, we have $2x = 2y = 0$, and the order of $Q_8$ kills $R^*(Q_8)$ so $8u = 0$. For the relations in degree 2, we apply the total Chern class to \Cref{Q8_relationdelta}, splitting the 2-dimensional representation $\Delta$ into $\sigma_1+\sigma_2$. On the left-hand side we have: \begin{align*} c_t(\Delta\rho_i) =& c_t(\sigma_1\rho_i)c_t(\sigma_2\rho_i) \\ =& 1 + \left[ c_1(\sigma_1) + c_1(\sigma_2) + 2c_1(\rho_i) \right]T \\ &+ \left[ c_1(\sigma_1)c_1(\sigma_2) + c_1(\sigma_1)c_1(\rho_i) + c_1(\sigma_2)c_1(\rho_i) + c_1(\rho_i)^2 \right]T^2 \end{align*} While on the right-hand side: \begin{align*} c_t(\Delta) = 1 + \left[c_1(\sigma_1)+c_1(\sigma_2)\right]T + \left[c_1(\sigma_1)c_1(\sigma_2)\right]T^2. \end{align*} In degree 2, this yields the relation: \begin{align*} c_1(\rho_i)(c_1(\sigma_1)+c_1(\sigma_2)) + c_1(\rho_i)^2 = 0. \end{align*} Bearing in mind that $c_1(\sigma_1)+c_1(\sigma_2) = c_1(\Delta) = 0$, we obtain $x^2 = y^2 = 0$. The relation $xy = 4u$ is obtained by applying $c_t$ to the relation $\Delta^2 = 1 + \rho_1 + \rho_2 + \rho_1\rho_2$ and identifying the terms in degree 2, which yields \begin{align*} 5c_1(\Delta)^2+4u = x^2 + y^2 + 3xy, \end{align*} that is, $4u = xy$. \end{proof} What remains to be proven is that these are the only relations satisfied by the generators; thus we want to check that we have no extra nilpotency or torsion conditions on $u$, and that the products $xu^i$ and $yu^i$ are nonzero for any $i$. For this, we look at the $2$-valuation of the characters of $Q_8$: we define an admissible approximation $(\widetilde{\Gamma}^n)$ that only takes into accounts some generators. This allows us to restrict ourselves when we compute the $2$-valuations of our evaluation morphisms, which we use to extract information about torsion in $R^*(G)$. Let $X, Y, U$ be standard lifts of $x,y,u$. We consider the approximation $\{\widetilde{\Gamma}^n\}$, where $\widetilde{\Gamma}^n$ is the additive subgroup of $(R(G), +)$ generated by \begin{equation} X^{\epsilon_1}Y^{\epsilon_2}U^k, \text{ with } 2k+ \epsilon_1 + \epsilon_2 \geq n \text{ and } 0 \leq \epsilon_1+\epsilon_2 \leq 1. \end{equation} \begin{Lemma} The approximation $(\widetilde{\Gamma}^n)$ is admissible. \end{Lemma} \begin{proof} Obviously we have $\widetilde{\Gamma}^{n+1} \subset \widetilde{\Gamma}^n$, so $(\widetilde{\Gamma}^n)$ satisfies condition (\ref{admissiblefiltration1}). To check (\ref{admissiblefiltration2}), let $Z = \rho_3-1$ and $T = \Delta -2$ be lifts of $c_1(\rho_3)$, $c_1(\Delta)$, respectively. Let $\alpha$ be an additive generator for $\Gamma^n$. We know that $\Gamma^n$ is generated by products of Chern classes of the generating characters of $R(G)$, hence $\alpha$ is of the form: \[ \alpha = X^{\epsilon_1}Y^{\epsilon_2}Z^{\epsilon_3}U^kT^l \in \Gamma^n, \ \ \ \ 2k+l+\epsilon_1+\epsilon_2+\epsilon_3 \geq n. \] If $\epsilon_{1} \geq 2$, then $\alpha$ contains a factor $X^2$, but the relation $x^2 = 0$ implies that $X^2 \in \Gamma^3$, so in that case $\alpha \in \Gamma^{n+1}$. The same goes for $\epsilon_2$, so we can restrict ourselves to monomials such that $\epsilon_1+\epsilon_2 \leq 1$. Similarly, since $c_1(\Delta) = 0$ we have $T \in \Gamma^2$, which means that $l \neq 0$ forces $\alpha \in \Gamma^{n+1}$. We proceed similarly for all factors and obtain \[ \Gamma^n = \widetilde{\Gamma}^n + \Gamma^{n+1}, \] so $(\widetilde{\Gamma}^n)$ satisfies condition (\ref{admissiblefiltration2}). \end{proof} There are 4 nontrivial evaluation morphisms on $R_\mathbb{C}(Q_8)$: \begin{itemize} \item $\phi_{-1}: \rho_i \mapsto 1, \Delta \mapsto -2$, \item $\phi_i: \rho_1 \mapsto 1, \ \ \ \rho_2,\rho_3 \mapsto -1, \ \ \ \Delta \mapsto 0$, \item $\phi_j: \rho_2 \mapsto 1, \ \ \ \rho_1,\rho_3 \mapsto -1, \ \ \ \Delta \mapsto 0$, \item $\phi_k: \rho_3 \mapsto 1, \ \ \ \rho_1, \rho_2 \mapsto -1, \ \ \ \Delta \mapsto 0$. \end{itemize} We apply those to our $X,Y,T,U$ and obtain: \begin{itemize} \item $\phi_{-1}: X,Y \mapsto 0, \ \ \ T \mapsto -4, \ \ \ U \mapsto 4$, \item $\phi_i: X \mapsto 0, \ \ \ Y,T \mapsto -2, \ \ \ U \mapsto 2$, \item $\phi_j: X, T \mapsto -2, \ \ \ Y \mapsto 0, \ \ \ T \mapsto 2$, \item $\phi_k: X,Y,T \mapsto -2, \ \ \ T \mapsto 2$. \end{itemize} It is easy to check that, as stated in \Cref{proposition_pgroupscontinuous}, these morphisms are all continuous with respect to the $2$-adic topology. We can now wrap up the computation: \begin{proof}[Proof of \Cref{Q8_gradedring}.] We want to show that $R^{2n}(G) = \langle u^n \rangle = \mathbb{Z}/8\mathbb{Z}$, and $R^{2n+1}(G) = \langle xu^n, yu^n \rangle = (\mathbb{Z}/2\mathbb{Z})^2$. \\ We first look at $R^{2n}(G)$, where we need to show that $4u^n \neq 0$, that is, $4U^n \notin \Gamma^{2n+1}$. We have $\phi_g(4U^n) = 2^{n+2}$, for any $g = i,j,k$. Suppose that $4U^n \in \Gamma^{2n+1}$; then by \Cref{evaluation_approximation} there is an element $\widetilde{X} \in \widetilde{\Gamma}^{2n+1}$ satisfying \[ n+2 = v_2(\phi_g(4U^n)) = v_2(\phi_g(\widetilde{X})). \] Write \begin{align*} \widetilde{X} =& a_1U^{n+1}+a_2XU^{n}+a_3YU^{n} \\ &+ U^{n+2}P(X,Y,U) + XU^{n+1}Q(X,Y,U) + YU^{n+1}S(X,Y,U) \end{align*} where the $a_i$'s are integers and $P,Q,S$ are polynomials with integer coefficients. Apply $\phi_g$ for $g = i,j,k$ to this equation, divide each equation by $2^{n+1}$ and consider the result mod $2$. We obtain a system of three equations: \begin{align*} 0 &= a_1 + a_3 \\ 0 &= a_1 + a_2 \\ 0 &= a_1 + a_2 + a_3 \end{align*} which has no nontrivial solution. But if $a_m = 0 (\mathrm{mod} \ 2)$ for $m=1,2,3$ then $v_2(\phi_g(\widetilde{x})) > n+2$, which is impossible. Thus $4U^n$ cannot be in $\Gamma^{2n+1}$, and the additive order of $u^m$ is indeed 8 for all $m$. \\ The same process shows that $xu^n, yu^n$ and $xu^n+yu^n$ are nonzero elements of $R^{2n+1}(Q_8)$ for all $n$. \end{proof} \section{Computing from the definition: cyclic groups} \label{cyclicgroups} As introductory examples, we determine the graded character rings of some cyclic groups. In \Cref{gradedring_Cp}, we consider cyclic groups over an algebraically closed field: their graded character ring was computed in \cite{guillot-minac} and many of our subsequent examples will rely on it. For the sake of completeness, we reproduce here the calculation of Guillot and Min\'{a}\v{c}, which is an exercise in the definitions. \par In \Cref{prop_gradedringQQ}, we prove a surprising general result about graded character rings of $p$-groups over the rationals: the classical interplay between Adams operations and rationality (see \cite[Th. 13.29]{serre}), translates to a condition on the generators of $R^*_\mathbb{Q}(G)$. We illustrate this statement in \Cref{R*GCp_QQ} with the computation of $R^*_\mathbb{Q}(C_p)$, where $C_p$ is a cyclic group of prime order. This constitutes our only incursion outside the field of complex numbers; even the computation for cyclic groups of arbitrary order remains wide open over a general field. \par \begin{Proposition}[{\cite[Prop. 3.4]{guillot-minac}}]\label{gradedring_Cp} Let $C_N$ be the cyclic group of order $N$. Whenever $\mathbb{K}$ is an algebraically closed field of characteristic prime to $N$, \[ R^*_\mathbb{K}(C_N) = \frac{\mathbb{Z}\left[x\right]}{(Nx)} \] with $x = c_1(\rho)$ for a one-dimensional representation $\rho$ of $C_N$ that generates $R_\mathbb{K}(C_N)$. \end{Proposition} \begin{proof} Let $\rho$ be a generating character for $R(G)$. By \cref{R*G_generators}, its first chern class $x = c_1(\rho)$ generates $R^*(G)$, and by \cref{R*G_G-torsion} we have $Nx = 0$. It remains to show that there is no additional relation in $R^*(G)$, so suppose that $dx^n = 0$ for some $d$; that is, $d(\rho-1)^n \in \Gamma^{n+1}(G)$. We show that necessarily $N$ divides $d$. Note that since $G$ is cyclic, the augmentation ideal is $ I = (\rho - 1)$ and the Grothendieck filtration coincides with the $I$-adic filtration. Let $X = C_1(\rho)$, then the relation $dx^n = 0$ lifts to $dX^n = X^{n+1}P(X)$ in $R(G)$, which we can then lift to $\mathbb{Z}[X]$ as: \[ dX^n = P(X)X^{n+1} + Q(X)\left((X+1)^{N}-1\right). \] If $n > 1$, by considering the terms of degree $1$ on each side, we conclude that $Q(0) = 0$. We can then divide by $X$ and get a similar equation, with $dX^{n-1}$ on the left. We repeat this process until we reach an equation of the form \[ dX = P(X)X^2 + Q(X)\left((X+1)^N - 1\right). \] By looking again at terms of degree $1$, we see that $d = NQ(0)$, which is what we wanted. \end{proof} Before we move on to more involved computations, here is a rather nice application of \cref{R*G_G-torsion} to graded character rings over the rationals. The proof of the following requires the use of Adams operations; they are $\lambda$-homomorphisms that exist on any $\lambda$-ring, whose precise definition and main properties are outlined in \cite[\S 5] {atiyah-tall}. For our purposes, it suffices to know that for a character of $G$, the $k$-th Adams operation is defined as $\psi^k( \chi(g) ) = \chi(g^k)$. \begin{Proposition}\label{prop_gradedringQQ} Let $G$ be a $p$-group. Then $R^*_\mathbb{Q}(G)$ is concentrated in degrees multiple of $(p-1)$. \end{Proposition} \begin{proof} By \cite[Prop. 5.3]{atiyah-tall}, for $x \in \Gamma^n$, we have $\psi^k(x) = k^nx \ (\mathrm{mod} \ \Gamma^{n+1})$. Moreover, by \cite[Th. 13.29]{serre}, over the rationals, $\psi^k(x) = x$ whenever $(|G|,k) = 1$. In particular, picking any $k \in (\mathbb{Z}/p\mathbb{Z})^\times$ we have $(k^n-1)x \in \Gamma^{n+1}$. Since $x$ is $|G|$-torsion, we conclude that $x = 0$ whenever $(k^n-1) \neq 0 \ (\mathrm{mod} \ p)$, that is, whenever $n$ is not a multiple of $(p-1)$. \end{proof} A straightforward application of this result is the computation of $R^*_\mathbb{Q}(G)$ for $G$ cyclic of prime order $p$. \begin{Corollary}\label{R*GCp_QQ} \[ R^*_\mathbb{Q}(\mathbb{Z}/p\mathbb{Z}) = \frac{\mathbb{Z}[x]}{(px)} \] with $x = c_{p-1}(\chi)$ where $\chi$ is the character of $\mathbb{Q}[\mathbb{Z}/p\mathbb{Z}]$. \end{Corollary} \begin{proof} Let $G = \mathbb{Z}/p\mathbb{Z}$. By \cite[Prop. 13.30 and Ex. 13.1]{serre}, the ring $R_\mathbb{Q}(G)$ is generated by the characters of permutation representations of the subgroups of $G$. The only two subgroups of $G$ are the trivial group $\{0\}$ and $G$ itself, so $R_\mathbb{Q}(G)$ is generated by $\chi$, the regular representation. So $R^*_\mathbb{Q}(G)$ is in turn generated by $c_i(\chi)$ for $1\leq i \leq p$; by \cref{prop_gradedringQQ}, it is generated by $c_{p-1}(\chi)$. It remains to show that this generator has additive order $p$ and is non-nilpotent. Consider the natural map $R_\mathbb{Q}(G) \to R_\mathbb{C}(G)$; it sends $\chi$ to $1+\rho+\cdots+\rho^{p-1}$, with $\rho$ a generating character of $R_\mathbb{C}(G)$. The total Chern class of $1+\rho+\cdots+\rho^{p-1}$ is \[ c_t\left(\sum_{i=0}^{p-1}\rho^i\right) = \prod_{i = 0}^{p-1}c_t(\rho^i) = \prod_{i = 0}^{p-1}(1+ic_1(\rho)), \] so $c_{p-1}(\rho) = (p-1)!\cdot c_1(\rho)$, which proves our claim using \cref{gradedring_Cp}. \end{proof} The graded ring of a general cyclic group over the rationals is not known. In the sequel, unless mentioned otherwise, all graded character rings will be computed over the complex numbers. \section{Definitions and first properties} \label{definitions} We recall some facts about the Grothendieck filtration on $\lambda$-rings, in the context of character rings. A concise treatment of the basic facts about $\lambda$-rings can be found in \cite{atiyah-tall}. Let $G$ be a finite group, and let $\mathbb{K}$ be a field of characteristic zero. The \textit{ring of virtual characters} (or character ring) $R_\mathbb{K}(G)$ of $G$ is the augmented ring generated by irreducible characters of $G$ over $\mathbb{K}$; the augmentation $\epsilon: R_\mathbb{K}(G) \to \mathbb{Z}$ is the degree map. Note that, since $\mathbb{K}$ has characteristic zero, representations up to isomorphism are determined by their characters. Thus $R(G)$ is also the Grothendieck ring on the category of $\mathbb{K} G$-modules, and we use the terms "character" and "representation" interchangeably. For instance, if $\chi$ is a character of $G$, by "the $n$-th exterior power $\lambda^n(\chi)$ of $\chi$", we mean "the character associated to the $n$-th exterior power of the representation affording $\chi$". The maps $\{\lambda^n\}_n$ satisfy for all characters $\chi, \tau$: \begin{enumerate} \item $\lambda^0(\chi) = 1$ \item $\lambda^1(\chi) = \chi$ \item $\lambda^k (\chi+\tau) = \sum_{i+j = k} \lambda^i(\chi)\lambda^j(\tau)$ \label{lambda_addition_formula} \end{enumerate} The addition formula above allows us to extend $\lambda^n$ to $R_\mathbb{K}(G)$, by defining each $\lambda^n(-\chi)$ by the equation $\lambda^n(\chi+ (-\chi)) = 0$. We say that $R_\mathbb{K}(G)$, together with the maps $\{ \lambda^n \}$, is a pre-$\lambda$-ring. Since the $\lambda$-operations also satisfy axioms \cite[\S 1 (12)-(14)]{atiyah-tall}, we see that $R_\mathbb{K}(G)$ is a $\lambda$-ring. We define: \[ \lambda_T: \begin{cases} R(G) &\to 1 + T\cdot R(G)[[T]] \\ \rho &\mapsto 1 + \sum_{i = 1}^\infty \lambda^i (\rho)T^i \end{cases}. \] Call $x$ a \textit{line element} if $\lambda_T(x) = 1 + xT$. Alternatively, $x$ is a line element whenever it is a one-dimensional representation of $G$. \begin{Remark} In the terminology of \cite{atiyah-tall}, a ring with $\lambda$-operations satifying the first three axioms above is called a $\lambda$-ring, and the additional axioms make it a special $\lambda$-ring. These extra axioms describe in particular how $\lambda$-operations interact with the ring multiplication. As it turns out, they are equivalent to the so-called "splitting principle", stated below as \Cref{splittingprinciple}, and to which we refer in practice for calculations. \end{Remark} For $x \in R_\mathbb{K}(G)$ and $n\in \mathbb{N}$, put \[ \gamma^n(x) = \lambda^n(x + n - 1), \] the $n$-th gamma operation. Let $I = \ker \epsilon$ be the augmentation ideal, and note that if $x \in I$ then $\gamma^n(x) \in I$. Let $\Gamma^n$ be the additive subgroup of $R_\mathbb{K}(G)$ generated by the monomials \[ \gamma^{i_1}(x_1)\gamma^{i_2}(x_2)\cdots\gamma^{i_k}(x_k), \ x_i \in I, \ \sum_{j = 1}^{k} i_j \geq n. \] One can show that $\Gamma^0 = R(G)$, $\Gamma^1 = I$, and that each $\Gamma^n$ is a $\lambda$-ideal (see \cite[Prop. 4.1]{atiyah-tall}). Moreover, the $\Gamma$-filtration contains the $I$-adic filtration on $R_\mathbb{K}(G)$, that is, $\Gamma^n \supseteq I^n$ for each $n$. These two filtrations contain the same topological information: \begin{Proposition}[{\cite[Cor. 12.3]{atiyah-characters_cohomology}}] \label{gammatopology_coincides_idaictopology} The topology induced by the Grothendieck filtration coincides with the $I$-adic topology. \end{Proposition} Define the \textit{graded character ring of $G$} (with coefficients in $\mathbb{K}$) as: \[ R^*_\mathbb{K}(G) = \bigoplus_{i\geq 0}\Gamma^i/\Gamma^{i+1}. \] The definitions readily imply that $\Gamma^m\cdot\Gamma^n \subset \Gamma^{m+n}$, so this is indeed a graded ring. In the sequel, we simply write $R^*(G)$ whenever $\mathbb{K}$ is clear from the context. Our aim is to compute examples of the graded ring $R^*(G)$ for some finite groups. \par Determining generators for $R^*(G)$ is a completely straightforward process. For any $\rho \in R(G)$, let $C_n(\rho) = \gamma^n(\rho - \epsilon(\rho))$; we define the \textit{$n$-th algebraic Chern class} $c_n(\rho)$ of $\rho$ as the image of $C_n(\rho)$ by the quotient map $\Gamma^n(G) \to R^n(G)$. Define \[ c_T: \begin{cases} R(G) &\to 1 + T\cdot R^*(G)[[T]] \\ \rho &\mapsto 1 + \sum_{i = 1}^\infty c_i(\rho)T^i \end{cases}. \] We call $c_T(\rho)$ the \textit{total Chern class} of $\rho$. Note that if $x$ is a line element, then $c_T(x) = 1+c_1(x)T$. \begin{Proposition}[{\cite[III.\S2]{fulton-lang}}] \label{chern_class_homomorphism} The total Chern class satisfies the axioms of a Chern class homomorphism as detailed in \cite[I.\S3]{fulton-lang}. In particular, \begin{enumerate}[(i)] \item \label{chern_class_line_elements}If $\rho$ is the character of a representation of degree $n$, then $c_k(\rho) = 0$ for $k>n$. \item \label{chern_class_product} Whenever $\rho$ and $\sigma$ are line elements, we have $c_1(\rho\sigma) = c_1(\rho) + c_1(\sigma)$. \item \label{chern_class_addition}The map $c_T$ is a homomorphism, that is $c_T(x+y) = c_T(x)c_T(y)$. In particular \[ c_n(\rho+\sigma) = \sum_{i=0}^n c_i(\rho)c_{n-i}(\sigma). \] \end{enumerate} \end{Proposition} Note that (\ref{chern_class_product}) is seen by remarking that \[ \gamma^1(\rho\sigma - 1) - \left(\gamma^1(\rho-1) + \gamma^1(\sigma -1)\right) = \gamma^1(\rho-1)\gamma^1(\sigma-1) \in \Gamma^2. \] Much as it is the case for $\lambda$-operations, whenever we need to compute the Chern class of a product, we rely on the splitting principle below. \begin{Proposition}[{\cite[III.\S1]{fulton-lang}}]\label{splittingprinciple} Given representations $\rho_1, \cdots, \rho_k$ of $G$ dimensions $d_1,\cdots,d_k$ respectively, there exists a $\lambda$-ring extension $R'$ of $R(G)$ such that $\Gamma^nR'\cap R(G) = \Gamma^nR(G)$ and each $\rho_i = x_{i,1} + \cdots+x_{i,d_i}$ is the sum of $d_i$ line elements in $R'$. \end{Proposition} Thus for a character $\rho$ of degree $n$, we have, in the graded ring $gr^*R'$: \[ c_T(\rho) = c_T(x_1 + \cdots + x_n) = \prod_{i=1}^{n}(1+c_1(x_i)T). \] The graded ring $R^*(G)$ appears as a subring of $gr^*R'$, and we can recover $c_k(\rho)$ as the coefficient of $T^k$ in the above polynomial, that is, the symmetric polynomial of degree $k$ in the $n$ variables $c_1(x_1),\cdots,c_1(x_n)$. \par As a first practical example of the splitting principle, consider the following computation. Recall that the determinant of a representation $\rho$ of $G$ of degree $n$ is defined as $\det(\rho) = \lambda^n(\rho)$. In particular, by the splitting principle, if we write $\rho = x_1 + \cdots + x_n$ then we have $\det \rho = \prod x_i$. \begin{Lemma}\label{chern_class_determinant} For a representation $\rho$ of $G$, we have $c_1(\rho) = c_1(\det \rho)$. \end{Lemma} \begin{proof} Let $R'$ be an extension of $R(G)$ as in \Cref{splittingprinciple}. The ring $R'$ is a $\lambda$-ring, and (\ref{chern_class_product}) and (\ref{chern_class_addition}) of \Cref{chern_class_homomorphism} do apply in full generality. In $R'$, write $\rho = x_1+\cdots+x_n$ as a sum of line elements. Then, by \Cref{chern_class_homomorphism}(\ref{chern_class_addition}): \begin{align*} c_T(\rho) &= c_T(x_1 + \cdots + x_n) = \prod_{i = 1}^n c_T(x_i) \\ &= \prod_{i=1}^n (1+c_1(x_i) T). \end{align*} The coefficient of $T$ is $c_1(\rho) = \sum_{i=1}^n c_1(x_i)$. On the other hand, by \Cref{chern_class_homomorphism}(\ref{chern_class_line_elements}): \[ c_1(\det \rho) = c_1\left(\prod_{i=1}^n x_i\right) = \sum_{i=1}^n c_1(x_i) = c_1(\rho). \] \end{proof} Moreover, the splitting principle, together with property (\ref{chern_class_product}) in \Cref{chern_class_homomorphism}, imply that $c_k(\sigma\tau)$ is a polynomial in the Chern classes of $\sigma$ and $\tau$. As a direct consequence, we have: \begin{Lemma} \label{R*G_generators} Let $\chi_1, \cdots, \chi_n$ be characters of representations of $G$ of degrees $d_1, \cdots, d_n$ respectively. If the $\chi_i$ generate $R(G)$ as a ring, then the classes $c_k(\chi_i)$ for $1 \leq k \leq d_i$ generate $R^*(G)$ as a ring. \end{Lemma} \begin{proof} By definition, each $\Gamma^n$ is generated by products of Chern classes of virtual characters of $G$. The result follows from the above discussion. \end{proof} We conclude this section with the following improvement on \cite[Lem. 3.2]{guillot-minac}: \begin{Proposition} \label{R*G_G-torsion} The graded piece $R^n(G)$ is $\vert G \vert$-torsion for $n>0$. \end{Proposition} \begin{proof} Consider the regular representation $\mathbb{K} G$ of $G$, with character $\chi$, and let $\rho$ be any character of $G$. For any $g \in G$, \[ \chi\cdot\rho(g) = (\epsilon(\rho)\cdot\vert G\vert )\delta_{1_G, g}. \] Pick a virtual character $\rho \in \Gamma^n$ for $n>0$, and write $\rho = \rho^+ - \rho^-$ with $\rho^+$, $\rho^- \in R^+(G)$ and $\epsilon(\rho^+) = \epsilon(\rho^-)$. Then $\chi\cdot\rho^+ = \chi \cdot \rho^-$ and thus $\chi \cdot \rho = 0$. Looking modulo $\Gamma^{n+1}$, we obtain: \[ 0 = \chi\cdot\rho = (\chi - \vert G\vert)\rho + |G|\cdot\rho = |G|\cdot\rho \ (\mathrm{mod} \ \Gamma^{n+1}), \] since $\chi-|G| \in I = \Gamma^1$. \end{proof} \section{Introduction} Let $G$ be a finite group and $\mathbb{K}$ a field of characteristic zero. The character ring $R_\mathbb{K}(G)$ of $G$ is the abelian group generated by the irreducible characters of $G$ over $\mathbb{K}$, which has a ring structure coming from the tensor product of representations. The ring $R_\mathbb{K}(G)$, with the operations $\{\lambda^n: R_\mathbb{K}(G) \to R_\mathbb{K}(G)\}$ induced by exterior powers of representations, together satisfy the axioms of a $\lambda$-ring. \par Grothendieck used the theory of $\lambda$-rings in the 1960s, to provide a categorical framework for the Riemann-Roch theorem (see \cite{berthelot-sga6}). With each $\lambda$-ring $R$, he associated a filtration (hereafter the Grothendieck filtration, or $\Gamma$-filtration); the associated graded ring $gr^* R$ is equipped with so-called algebraic Chern classes, which satisfy the properties of the eponymous construction in algebraic topology. To underline the importance of this construction, let us mention that, when $X$ is a smooth algebraic variety (say, over the complex numbers), there is an isomorphism \[ gr^*K(X) \otimes \mathbb{Q} \cong CH^*X \otimes \mathbb{Q}, \] where $CH^*X$ is the Chow ring of $X$ and $K(X)$ is the Grothendieck group of algebraic vector bundles over $X$ (see for example \cite[Ex. 15.2.16]{fulton-intersection}). If $X$ is a reasonable topological space and $K(X)$ is, this time, its topological $K$-theory, then \[ gr^*K(X) \otimes \mathbb{Q} \cong H^{2*}(X,\mathbb{Q}), \] where $H^{2*}(X,\mathbb{Q})$ is the even part of the singular cohomology of $X$ (see \cite[Prop. 3.2.7]{atiyah-k-theory}). Both of these isomorphisms are compatible with Chern classes.\par Character rings are natural examples of $\lambda$-rings; in the sequel we write $R^*_\mathbb{K}(G)$ for $gr^*(R_\mathbb{K}(G))$. There only are a few examples of explicit computations of $R_\mathbb{K}^*(G)$ in the literature: the first paper on the subject is a 2001 preprint by Beauville (\cite{beauville}), who showed that for a complex connected reductive group $G$, the graded ring $R_\mathbb{C}^*(G)\otimes \mathbb{Q}$ is simply described in terms of a maximal torus and its Weyl group.\par It should be noted that in all of the above results, the graded ring is tensored with the rational field. However, we show in \Cref{R*G_G-torsion} that when $G$ is a finite group, the ring $R^*_\mathbb{K}(G)$ is torsion, so that $R^*_\mathbb{K}(G) \otimes \mathbb{Q}$ is zero in positive degree. Computing $R^*_\mathbb{K}(G)$ is harder but not hopeless, as is shown by Guillot and Min\'a\v{c} in \cite{guillot-minac}, where they determine explicitly $R^*_\mathbb{C}(G)\otimes \mathbb{F}_2$ for some $2$-groups. The present paper extends their work, by providing more explicit examples of graded character rings on the one hand, and by presenting general results about their structure and behaviour on the other hand.\par The theory of graded character ring is intricate, and studying even the most elementary groups can lead to remarkable results. For instance, the following computation (presented below as \Cref{gradedrepring_Cpk}), which extends \cite[Prop. 3.11]{guillot-minac}, shows that there is no Künneth formula for $R^*_\mathbb{C}(G)$: \begin{Theorem} Let $C_p$ be a cyclic group of prime order $p$. Then: \[ R^*_\mathbb{C}(C_p^k) = \frac{\mathbb{Z}[x_1,\cdots,x_k]}{(px_i, x_i^p x_j - x_ix_j^p)}. \] \end{Theorem} This makes determining graded character rings of some "easy" groups surprisingly difficult, a consequence that is in turn illustrated by the rather sophisticated computation of $R^*_\mathbb{C}(C_4\times C_4)$, the very last one that we present in this paper. It is part of our endeavour to compute the graded character rings of abelian $p$-groups, which are of special interest: we show in \Cref{GH_coprime} that if $G, H$ are of coprime orders, the Künneth formula does hold for $R^*_\mathbb{C}(G\times H)$. This reduces the computation of graded character rings of abelian groups, to those of abelian $p$-groups. On that topic, we adapt the main theorem of \cite{quillen} to show that for an abelian group $G$ and for each prime $p$, there is an explicit, surjective morphism: \[ R_\mathbb{C}^*(G)\otimes \mathbb{F}_p \to gr_\bullet \mathbb{F}_p G, \] where $gr_\bullet \mathbb{F}_p G$ is the graded ring associated to the filtration by powers of the augmentation ideal of $\mathbb{F}_p G$. In particular, the following result is a direct corollary of \Cref{theorem_quillenrelations}: \begin{Theorem} Let $G$ be an abelian $p$-group of the form $C_{p^{i_1}}\times \cdots \times C_{p^{i_n}}$. Then $R^*_\mathbb{C}(G)$ is generated by elements $x_1, \ldots, x_n$ of degree 1 such that any monomial in any relation between these in $R^*_\mathbb{C}(G)\otimes \mathbb{F}_p$ features some $x_k^{p^{i_k}}$, for some index $k$. \end{Theorem} Again, this is illustrated by the example of $C_4 \times C_4$: \begin{Theorem} The graded ring of $C_4 \times C_4$ is given by \[ R^*_\mathbb{C}(C_4\times C_4) = \frac{\mathbb{Z}[x,y]}{(4x,4y, 2x^2y + 2xy^2, x^4y^2 - x^2y^4)}, \] therefore \[ R^*_\mathbb{C}(C_4 \times C_4)\otimes \mathbb{F}_2 = \frac{\mathbb{F}_2[x,y]}{(x^4y^2 + x^2y^4)}. \] \end{Theorem} (This is \Cref{Z4Z4} in the text.) Notice how relations modulo $2$ involve either $x^4$ or $y^4$ in each monomial. \par Most of our results pertain to representations over the complex numbers. The situation can become much more complicated over other fields, as the following result shows: \begin{Theorem} When $G$ is a $p$-group, the graded ring $R^*_\mathbb{Q}(G)$ is concentrated in degrees multiple of $(p-1)$. In particular, for any prime $p$: \[ R^*_\mathbb{Q}(C_p) = \frac{\mathbb{Z}[x]}{(px)} \] where $|x| = p-1$. \end{Theorem} This statement combines \Cref{prop_gradedringQQ} and \Cref{R*GCp_QQ}. It is striking that, in general, the graded character ring of a cyclic group over the rationals is not known. By contrast, the graded ring $R^*_\mathbb{C}(G)$ for any cyclic group $G$ was computed in \cite{guillot-minac}, and is generated by an explicit class of degree $1$. \par The above results provide a convincing argument in favour of graded character rings: their theory, of which we barely scratched the surface, is rich and complex.\par Another, perhaps more concrete argument in their favour, is that they are a fine invariant of groups: they take into account the $\lambda$-ring structure of $R_\mathbb{K}(G)$, which can distinguish non-isomorphic groups with the same character table such as the quaternion group $Q_8$ and the dihedral group $D_4$ of order $8$. In fact, \Cref{gradedring_D4} and \Cref{Q8_gradedring} add up to the following: \begin{Theorem} \[ R^*_\mathbb{C}(D_4) = \frac{\mathbb{Z}\left[x,y,b\right]}{(2x,2y,4b,xy,xb-yb)} \] with $|x| = |y| = 1$ and $|u| = 2$, and \[ R^*_\mathbb{C}(Q_8) =\frac{\mathbb{Z}[x,y,u]}{(2x,2y,8u,x^2,y^2, xy-4u)} \] where $\vert x \vert = \vert y \vert = 1$ and $\vert u \vert = 2$. \end{Theorem} This paper is organized as follows: the main definitions are introduced in \Cref{definitions}; each of sections $3$ to $6$ is focused on a different computational tool. We show in \Cref{cyclicgroups} two elementary computations, concerning cyclic groups over any algebraically closed $\mathbb{K}$ (after \cite{guillot-minac}), and over the rationals, and we will then restrict ourselves to the case $\mathbb{K} = \mathbb{C}$. In \Cref{restrictions}, we put the cyclic group example to good use: we show that restriction of characters is a well-defined homomorphism and apply it to elementary abelian groups as well as some dihedral groups. In \Cref{quillen}, using a result of Quillen in \cite{quillen}, we construct the aforementioned morphism $R_\mathbb{C}^*(G)\otimes \mathbb{F}_p \to gr_\bullet \mathbb{F}_p G$. In \Cref{continuity}, we look at the continuity of evaluation of characters with respect to the topology induced by the Grothendieck filtration, and the $p$-adic topology. We apply our results to graded character rings of $p$-groups: first in \Cref{continuity} for the quaternion group of order $8$, and second in \Cref{abelian2groups} to some abelian $2$-groups.\par In light of the functoriality of $R^*(-)$ and the existence of a restriction morphism, a natural question arising is whether induction of representations also induces a well-defined map between graded rings; in other words, whether $R^*(-)$ is a Mackey functor. This question will be the subject of an second paper, in which we show through an explicit example that $R^*(-)$ is not a Mackey functor, and explore a modified filtration and its associated graded ring.\par Besides the aforementioned work of Guillot and Min\'{a}\v{c}, which lays much of the groundwork for this paper, here are our main references. All nontrivial statements of representation theory that we use can be found in \cite{serre}; the theory of $\lambda$-rings is outlined in a concise manner in \cite{atiyah-tall}, and the mechanics of the Grothendieck filtration and Chern characters are summed up in \cite{fulton-lang}.\par \textbf{Acknowledgements.} I would like to thank both my Ph.D. advisors: Pierre Guillot for suggesting this problem in the first place, and for his kind guidance from the first to the last keystroke of this paper, and J\'{a}n Min\'{a}\v{c} for many an enthusiastic and encouraging discussion. \section{Universal enveloping algebras} \label{quillen} The aim of this section is to construct, for any abelian $p$-group $G$, a map: \[ R^*(G)\otimes \mathbb{F}_p \to gr_\bullet (\mathbb{F}_p G), \] where $gr_\bullet \mathbb{F}_p G$ is the graded ring associated to the filtration of the group ring $\mathbb{F}_p G$ by powers of its augmentation ideal. To this effect, we apply the main result of \cite{quillen}: fix a prime $p$, and let $\{G_n\}$ denote the lower central series of $G$, defined by $G_1 = G$ and $ G_{n+1} = (G_n,G) $. Consider the sequence $\{D_n\}$, where $D_n$ is the $n$-th mod $p$ dimension subgroup of $G$: \[ D_n := \prod_{ip^s \geq n}G_i^{p^s}. \] Then $\{D_{n}\}$ is a $p$-filtration of $G$, that is, it satisfies: \begin{itemize} \item $(D_r, D_s) \subseteq D_{r+s}$ \item $x\in D_r \implies x^p \in D_{pr}$ for all $r$. \end{itemize} Moreover, $\{D_{n}\}$ is the fastest descending $p$-filtration of $G$ (see \cite[\S 11.1]{dixon}). Set $L_\bullet(G) = \bigoplus D_n / D_{n+1}$, then $L_\bullet(G)$ is a $p$-restricted graded Lie algebra over $\mathbb{F}_p$. On the other hand, if $I$ denotes the augmentation ideal of the group ring $\mathbb{F}_p G$, then \[ F_n := \{x \in G \ | \ x-1 \in I^n \} \] is also a $p$-filtration of $G$, thus $F_n \supset D_n$ and there is a map of Lie algebras: \[ \psi: \begin{cases} L_\bullet (G)&\to gr_\bullet (\mathbb{F}_p G) \\ g \ (\mathrm{mod} \ F^n) &\mapsto (g-1) \ (\mathrm{mod} \ I^n). \end{cases} \] \begin{Theorem}[{\cite[\S 1]{quillen}}] The homomorphism $\widehat{\psi}$ from $gr_\bullet (\mathbb{F}_pG)$ to the universal enveloping algebra $U(L_\bullet(G))$ induced by $\psi$ is an isomorphism. \end{Theorem} Now suppose $G$ is an abelian $p$-group of the form $C_{p^{i_1}}\times \dots \times C_{p^{i_m}}$. Then $D_{n} = G^{p^i}$ for $p^i$ the smallest power of $p$ such that $p^i \geq n$. Thus \[ L_n(G) \cong \begin{cases} \{1\}, &n \neq p^i \\ C_p\times\cdots \times C_p, &n = p^i. \end{cases} \] \begin{Lemma} If $G$ is abelian then $R(G)\otimes \mathbb{F}_p \cong \mathbb{F}_pG$ through an isomorphism that sends the Grothendieck filtration $\{\Gamma_p^n\}_n$ induced on $R(G)\otimes\mathbb{F}_p$ to the $I$-adic filtration on $\mathbb{F}_p G$. \end{Lemma} \begin{proof} Write $G$ as a product of cyclic groups. The isomorphism that sends each cyclic group generator $g$ to the character $\rho_g: g \mapsto e^{2\pi i /|g|}$, sends $I \subset \mathbb{F}_p$ to $\Gamma_p^1$. Since every irreducible character of $G$ has dimension 1, the filtration $\{\Gamma_p^n\}_n$ coincides with the $\Gamma_p^1$-adic filtration. \end{proof} So $gr_\bullet(R(G) \otimes \mathbb{F}_p) \cong gr_\bullet(\mathbb{F}_pG) \cong U(L_\bullet(G))$ with universal map \[ h: \begin{cases} L_\bullet(G) &\to gr_\bullet(R(G)\otimes\mathbb{F}_p) \\ g &\mapsto C_1(\rho_g) \ (\mathrm{mod} \ \Gamma_p^2) \end{cases}, \] and there is a map $\phi$ of algebras induced by $L_\bullet(G) \to gr_\bullet(\mathbb{F}_p G)$: \[ \phi: gr_\bullet(R(G)\otimes \mathbb{F}_p) \to gr_\bullet(\mathbb{F}_pG). \] On the other hand, the map $R(G) \to R(G)\otimes \mathbb{F}_p$ preserves the $\Gamma$-filtration and induces a maps $R^*(G) \to gr_\bullet(R(G)\otimes \mathbb{F}_p)$, and thus a map $R^*(G)\otimes \mathbb{F}_p \to gr_\bullet(R(G)\otimes\mathbb{F}_p)$. Composing this latter map with $\phi$, we obtain a map \[ R^*(G)\otimes \mathbb{F}_p \to gr_\bullet(\mathbb{F}_p G) \] satisfying $\phi(c_1(\rho_g)) = g-1$. A straightforward corollary of this is the following: \begin{Theorem}\label{theorem_quillenrelations} Let $G = C_{p^{i_1}}\times\cdots\times C_{p^{i_n}}$, and let $\rho_k$ be the generating character of $R(C_{p^{i_k}})$ sending a generator $g_k$ of $C_{p^{i_k}}$ to $e^{2i\pi/p^{i_k}}$. Then there is a well-defined homomorphism: \[ R^*(G)\otimes\mathbb{F}_p \to \frac{\mathbb{F}_p[u_1,\cdots, u_n]}{(u_1^{p^{i_1}}, \cdots, u_n^{p^{i_n}} )} \] sending $c_1(\rho_k)$ to $u_k$. \end{Theorem} Although we do not directly refer to it in the sequel, \Cref{theorem_quillenrelations} proves useful when "guessing" relations in $R^*(G)$, as illustrated by the graded character rings of abelian 2-groups: in \Cref{Z4Z4}, we show that \[ R^*(C_4 \times C_4) = \frac{\mathbb{Z}[x,y]}{(4x,4y,2x^2y+2xy^2, x^4y^2 - x^2y^4)} \] with $x = c_1(\rho_{(1,0)})$, $y = c_1(\rho_{(0,1)})$. By \Cref{theorem_quillenrelations}, modulo 2, nontrivial relations must involve $x^4$ or $y^4$. Since one can easily rule out relations of the form $x^4, y^4 = 0$ by restriction to $C_4$, we know that any extra relation will occur in degree 5 or more. Here, it occurs in degree 6. Again, in \Cref{Z4Z2}, we show \[ R^*(C_4 \times C_2) = \frac{\mathbb{Z}[x,y]}{(4x,2y,xy^3+x^2y^2)} \] with $x = c_1(\rho_{(1,0)})$, $y = c_1(\rho_{(0,1)})$. We know by \Cref{theorem_quillenrelations} that any nontrivial relation modulo $2$ must involve $x^2$ or $y^4$. \section{The restriction homomorphism} \label{restrictions} Graded character rings are computed in two steps: first, we identify a minimal set of generators for $R^*(G)$ using general information on the representation theory of $G$, and we determine possible relations in higher degree. The second step consists in showing that there are no extra relations in $R^*(G)$, and is usually much less straightforward. In the case of cyclic groups (see \Cref{gradedring_Cp}), we used an ad hoc method for this step; in this section we rely on the functoriality of $R^*(-)$ to look at restrictions of representations to subgroups of $G$. We rely on this technique, and on \Cref{gradedring_Cp}, to compute of $R^*(C_p^k)$ in \Cref{gradedrepring_Cpk}. We then turn to the dihedral groups $D_p$ for odd primes $p$ in \Cref{gradedring_Dp}, and to $D_4$ in \Cref{gradedring_D4}. In passing, we prove a Künneth formula for groups of coprime order. \begin{Lemma}\label{R*G_functorial} The graded character ring $R^*(-)$ is functorial in $G$: a group homomorphism $\phi : G \to H$ induces a well-defined ring map $\phi^*: R^*(H) \to R^*(G)$, which sends each generator $c_n(\rho)$ to $c_n(\rho\circ\phi)$.\par In particular, if $H$ is a subgroup of $G$, the restriction of representation $\res^{G}_{H}: R(G) \to R(H)$ induces a well-defined homomorphism of graded character rings, also denoted $\res^{G}_{H}: R^*(G) \to R^*(H)$, with \[ \res^{G}_{H}c_n(x) = c_n(\res^{G}_{H}(x)) \] for all $x\in R(G), n \in \mathbb{N}$. \end{Lemma} \begin{proof} This is clear. \end{proof} The second consequence of \Cref{R*G_functorial} is to reduce the computation of graded character rings of abelian groups to that of $R^*(G)$ for $p$-groups: \begin{Corollary}\label{GH_coprime} Let $G$ and $H$ be groups with coprime order. Then \[ R^*_\mathbb{C}(G\times H) = R^*_\mathbb{C}(G) \otimes_\mathbb{Z} R^*_\mathbb{C}(H) \] \end{Corollary} \begin{proof} Let $\pi_G, \pi_H: G\times H \to G,H$ be the projection maps. By \cite[Th. 3.10]{serre}, for any complex irreducible character $\rho$ of $G\times H$, there are irreducible characters $\sigma_G,\sigma_H$ of $G, H$ respectively such that $\rho = (\sigma_G \circ\pi_G) \cdot (\sigma_H\circ\pi_H$). Let $\rho_G = \sigma_G\circ \pi_G$ and $\rho_H = \sigma_H\circ\pi_H$, then $R^*_\mathbb{C}(G\times H)$ is generated by classes of the form $c_n(\rho_G\cdot\rho_H)$, which can be written as polynomials in the Chern classes of $\rho_G, \rho_H$. In other words, the projection maps $\pi_G, \pi_H$ induce a surjective homomorphism \[ \pi_G^*\otimes\pi_H^* : R^*_\mathbb{C}(G)\otimes R^*_\mathbb{C}(H) \to R^*_\mathbb{C}(G\times H). \] Moreover, applying \Cref{R*G_G-torsion} to the case where $|G|, |H|$ are coprime, we have that \[ \bigoplus_{i+j = n}\left(R^i(G)\otimes R^j(H)\right) \cong R^n_\mathbb{C}(G) \oplus R^n_\mathbb{C}(H) \] for any $n\geq 1$. In particular, the surjection above decomposes as $\bigoplus(\pi_G^*)^{n} \otimes (\pi_H^*)^n: R^n_\mathbb{C}(G)\oplus R^n_\mathbb{C}(H) \to R^*_\mathbb{C}(G\times H)$. The inclusions $\iota_G,\iota_H: G,H \to G\times H$ induce a two-sided inverse $(\iota^*_G,\iota^*_H) = \bigoplus_{n} (\iota_G^n, \iota_H^n): R^n_\mathbb{C}(G\times H) \to R^n_\mathbb{C}(G)\oplus R^n_\mathbb{C}(H)$ to this surjection. \end{proof} We now use \Cref{R*G_functorial} to compute of the graded character rings of elementary abelian groups. Let $p$ be a prime number, and let $C_p$ be the cyclic group of order $p$, with a choice of generator $g$. Recall that we fixed $\mathbb{K} = \mathbb{C}$. \begin{Proposition} \label{gradedrepring_Cpk} Let $G = C_p^k$. Then \[ R^*(G) = \frac{\mathbb{Z}[x_1,\cdots,x_k]}{(px_i,x_i^px_j = x_ix_j^p)}. \] with $x_i = c_1(\rho_i)$ where $\rho_i$ restricts to a nontrivial one-dimensional representation of the $i$-th factor $C_p$. \end{Proposition} \begin{proof} Denote by $g_i$ the element $(1,\cdots,1,g,1,\cdots,1)$ with $g$ in $i$-th position, so that $G$ is generated by $g_1,\cdots,g_k$. Let $\omega = \exp^{2i\pi/p}$, and let $\rho_i$ be the representation of $G$ defined by $\rho_i: g_j \mapsto \omega^{\delta_{ij}}$. The $\rho_i$'s generate $R(G)$, so the elements $x_i := c_1(\rho_i)$ generate $R^*(G)$. Note that $\rho_i^p = 1$ for all $i$, so $px_i = 0$ by \Cref{chern_class_homomorphism}(\ref{chern_class_product}).\\ The relation $x_i^px_j = x_ix_j^p$ is obtained as follows: let $X_i$ be the standard lift $\rho_i - 1$ of $x_i$ to $R(G)$. Then $(X_i+1)^p = 1$, so that \begin{align*} X_i^p &= -\sum_{l=1}^{p-1}\binom{p}{l}X_i^l = X_i\left(-\sum_{l=0}^{p-2}\binom{p}{l+1}X_i^l\right) \\ &= pX_i(-1+\phi(X_i)), \end{align*} where $\phi(T) \in \mathbb{Z}[T]$ has no constant term. For any $i,j$, write \begin{align*} X_i^pX_j\left( -1 + \phi(X_j) \right) &= pX_iX_j\left(-1+\phi(X_i)\right)\left(-1+\phi(X_j)\right) \\ &= X_iX_j^p\left(-1+\phi(X_i)\right). \end{align*} In $R^{p+1}(G)$, this is: \[ x_i^px_j = x_ix_j^p, \] and the generators of $R^*(G)$ satisfy all the required relations. \\ Let us show that there are no extra relations: the graded piece of rank $l$ is generated by monomials of the form: \[ x_1^{s_1}\cdots x_k^{s_k}, \ \ \ \ \sum_{i=1}^{k} s_i = l. \] Let $S_l \subset \mathbb{Z}^k_{\geq 0}$ be the set of multi-indices $(s_1,\cdots,s_k)$ such that $\sum s_i = l$ and only the first nonzero coordinate of each $s\in S_l$ is (possibly) greater than $p-1$. We must show that the monomials $x^s = x_1^{s_1}\cdots x_k^{s_k}$ are linearly independent. Consider a zero linear combination: \begin{align} \sum_{s\in S_l}a_sx^s = 0 \label{Cpk_linearcombination} \end{align} and let $\psi: R^*(C_p^k) \rightarrow R^*(C_p)$ be the restriction to the cyclic group generated by the product $g_1^{t_1}\cdots g_k^{t_k}$ for some $0\leq t_j \leq p-1$. Then $\psi(x_j) = t_j\cdot z$, where $z$ is the standard one-degree generator of $R^*(C_p)$, and \Cref{Cpk_linearcombination} becomes: \begin{equation*} \sum_{s\in S_l}a_st_1^{s_1}\cdots t_k^{s_k}z^l = 0, \end{equation*} that is, \begin{equation} \sum_{s\in S_l}a_st_1^{s_1}\cdots t_k^{s_k} = 0 \in \mathbb{F}_p, \label{Cpk_linearcombinationFp} \end{equation} for all possible strings $(t_1,\cdots,t_k)$ with $0\leq t_j \leq p-1$. In particular, grouping terms by powers of $t_k$ in \Cref{Cpk_linearcombinationFp}, we get: \begin{align} \begin{dcases} \ \ \ a_{(0,\cdots,0,l)}t_k^{l} = 0 &\text{ when } t_1 = \cdots = t_{k-1} = 0 \\ \ \ \ \sum_{t=0}^{p-1}\left(\sum_{s\in S_{l-i}} b_st_1^{s_1}\cdots t_{k-1}^{s_{k-1}} \right) t_k^i = 0 &\text{otherwise.} \end{dcases} \end{align} This implies that the coefficient of $x_k^l$ in \Cref{Cpk_linearcombination} is zero; more generally, the second equation must be true for all values of $t_k$, from $0$ to $p-1$. In other words, the $\left( \sum b_st_1^{s_1}\cdots t_{k-1}^{s_{k-1}} \right)$ are the entries of a vector in the kernel of the Vandermonde matrix $(t_k^i)_{t_k = 1,\cdots,p-1}^{i = 1,\cdots,p-1}$, which is invertible in $\mathbb{F}_p$. Therefore \[ \sum_{s\in S_{l-i}} b_st_1^{s_1}\cdots t_{k-1}^{s_{k-1}} = 0 \] for all combinations $(t_1,\cdots,t_{k-1})$. An immediate induction shows that we must have each $a_s = 0$, so the monomials $\lbrace x^s\rbrace_{s\in S_l}$ are linearly independent. \end{proof} Note that the relations between the generators of $R^*((C_p)^k)$ appear in degree $p+1$, so the degree of relations goes to $\infty$ as $p \to \infty$. In \cref{quillen} we shed light on this phenomenon, via a general result about the minimal degree of relations in a $p$-group. We now turn to our first non-abelian group, for which the computation combines the restriction map with some basic Chern class algebra. Let $p$ be an odd prime and consider the dihedral group: \[ D_p = \left\langle \tau, \sigma \vert \tau^2 = \sigma^p = 1, \tau\sigma\tau = \sigma^{-1} \right\rangle. \] There are $(p+1)/2$ irreducible representations of $D_p$: \begin{itemize} \item Two representations of degree 1, the trivial representation 1 and the signature $\varepsilon$ which sends elements of the form $\sigma^j$ to 1, and elements of the form $\tau\sigma^j$ to -1. \item And $(p-1)/2$ representations $\chi_1, \cdots \chi_{(p-1)/2}$ of degree 2: \begin{align*} \chi_k(\sigma^j) &= \begin{pmatrix} e^{\frac{2ikj\pi}{p}} & 0 \\ 0 & e^{-\frac{2ikj\pi}{p}}\end{pmatrix} \\ \chi_k(\tau) &= \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} \begin{matrix} \vphantom{0}\\ \vphantom{1}.\end{matrix} \end{align*} \end{itemize} The characters of these generate the ring $R(D_p)$. For convenience, define $\chi_0 = 1+\varepsilon$; we have the following relations: \begin{align} \varepsilon^2 &= 1 \label{Dp_order_epsilon} \\ \varepsilon\cdot\chi_k &= \chi_k \\ \chi_k\cdot\chi_l &= \chi_{k+l} + \chi_{k-l}. \label{Dp_chikchil} \end{align} \begin{Proposition} \label{gradedring_Dp} Let $x = c_1(\chi_1)$ and $y = c_2(\chi_1)$, then \[ R^*(D_p) = \frac{\mathbb{Z}\left[x,y\right]}{(2x,py,xy)}. \] \end{Proposition} \begin{proof} Let $x$ and $y$ be as above; note that \Cref{chern_class_determinant} implies that $x = c_1(\chi_1) = c_1(\chi_k) = c_1(\mathrm{det} \ \chi_k) = c_1(\varepsilon)$ for any $k$, and $0 = c_1(\varepsilon^2) = 2c_1(\varepsilon) = 2x$. For the other relations, we use \Cref{Dp_chikchil} above and apply the total Chern class $c_t$ to both sides: \begin{equation} c_t(\chi_k\chi_l) = c_t(\chi_{k+l})c_t(\chi_{k-l}). \label{Dp_totalclass} \end{equation} Let $y_i = c_2(\chi_i)$. Expand the right-hand side: \begin{align*} c_t(\chi_{k+l})c_t(\chi_{k-l}) &= (1+xT+y_{k+l}T^2)(1+xT+y_{k-l}T^2) \\ &= 1 + 2xT + (x^2+ y_{k+l} + y_{k-l})T^2 + (xy_{k+l} + xy_{k-l})T^3 + y_{k+l}y_{k-l}T^4. \numberthis \label{Dp_ctrhs} \end{align*} For the left-hand side, we use the splitting principle (\Cref{splittingprinciple}): in some extension of $R(D_p)$, we can write $\chi_k = \rho_1 + \rho_2$ and $\chi_l = \eta_1 + \eta_2$ with $\rho_i$, $\eta_i$ of dimension 1, in a way that is compatible with the $\Gamma$-filtration. Then: \begin{align*} c_t(\chi_k\chi_l) =& c_t\left((\rho_1+\rho_2)(\eta_1+\eta_2)\right) \\ =& c_t(\rho_1\eta_1)c_t(\rho_1\eta_2)c_t(\rho_2\eta_1)c_t(\rho_2\eta_2) \\ =& (1+(c_1(\rho_1)+c_1(\eta_1))T)\cdot(1+(c_1(\rho_1)+c_1(\eta_2))T)\\ &\cdot(1+(c_1(\rho_2)+c_1(\eta_1))T)\cdot(1+(c_1(\rho_2)+c_1(\eta_2))T). \end{align*} Now, let $s_1, s_2$ (resp. $t_1, t_2$) be the first and second symmetric polynomials in $(\rho_1, \rho_2)$ (resp. ($\eta_1,\eta_2)$). Then $c_i(\chi_k) = s_i$ and $c_i(\chi_l) = t_i$. The last equality can be rewritten: \begin{align*} c_t(\chi_k\chi_l) = &1+ 2(s_1+t_1)T + (t_1^2+s_1^2+3s_1t_1+2t_2+2s_2)T^2 \\ &+(s_1^2t_1+s_1t_1^2+2s_1s_2+2t_1t_2+2s_1t_2 + 2s_2t_1)T^3 \\ &+ (t_2^2 + s_2^2 + s_1s_2t_1 + s_1t_1t_2 + s_1^2t_2 + s_2t_1^2 -2s_2t_2)T^4. \end{align*} We replace $s_1 = t_1 = x$ and eliminate all occurrences of $2x$ to obtain \begin{equation} c_t(\chi_k\chi_l) = 1 + (x^2+2y_k+2y_l)T^2 + (y_k-y_l)^2T^4. \label{Dp_ctlhs} \end{equation} Comparing coefficients in \Cref{Dp_ctrhs} and \Cref{Dp_ctlhs}, we obtain: \begin{align} y_{k+l}+y_{k-l} &= 2(y_k + y_l) \label{Dp_relationsum} \\ xy_{k+l} + xy_{k-l} &= 0 \label{Dp_relationproduct} \\ y_{k+l}y_{k-l} &= (y_k-y_l)^2 . \end{align} First look at \Cref{Dp_relationproduct} with $k=l$. Note that $y_0 = c_2(1+\varepsilon) = 0$, and thus \Cref{Dp_relationproduct} yields $x\cdot y_{2k} = 0$ for all $k$, which is equivalent to $x\cdot y_k = 0$ for all $k$ since indices are understood modulo the odd prime $p$.\\ We then show that $py_k = 0$ for all $k$. Recall that $R^*(D_p)$ is $2p$-torsion, and consider \Cref{Dp_relationsum} with $k=l$. Multiplying by $p$, we obtain $py_{2k} = 0$ for all $k$. Again, this implies that $py_k = 0$ for all $k$. \\ Finally, consider \Cref{Dp_relationsum} with $l = k$ and $l = k+1$. This gives: \begin{align*} y_{2k} &= 4y_k \\ y_{2k+1} &= 2(y_k+y_{k+1}) - y_1. \end{align*} Together, these two relations imply that all $y_k$'s are multiples of $y_1 =: y$.\\ It remains to show that these are the only relations in $R^*(D_p)$, that is, $x$ and $y$ are not nilpotent, and there is no extra dependency relation between them. Restricting $x$ to $C_2$ and $y$ to $C_p$ shows none of the generators are nilpotent, while restricting both $x$ and $y$ to $C_2$ eliminates any extra possible relation. \end{proof} A similar argument gives $R^*(D_4)$, where $D_4$ is the dihedral group $D_4$ of order 8. Note that $R^*(D_4)\otimes \mathbb{F}_2$ is already known and was computed in \cite[Prop. 3.12]{guillot-minac}. It has four nontrivial irreducible representations: \begin{itemize} \item In degree 1, the representations $\rho: r \mapsto -1, \ s\mapsto 1$ and $\eta: r \mapsto 1, s\mapsto -1$ and their product $\rho\eta$, \item And in degree 2, the representation $\Delta$, which sends $s$ to $\begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}$ and $r$ to $\begin{pmatrix} 0 & -1 \\ 1 & 0\end{pmatrix}$, \end{itemize} with relations: \begin{align} \rho^2 &= \eta^2 = 1 \\ \rho\Delta &= \eta\Delta = \Delta \\ \Delta^2 &= 1+\rho+\eta+\rho\eta. \label{D4_relationdelta} \end{align} \begin{Proposition}\label{gradedring_D4} Let $c_1(\rho) = x$; $c_1(\eta) = y$ and $c_2(\Delta) = b$. Then \[ R^*(D_4) = \frac{\mathbb{Z}\left[x,y,b\right]}{(2x,2y,4b,xy,xb-yb)}. \] \end{Proposition} \begin{proof} Note that $c_1(\rho\eta) = x+y$ and $c_1(\Delta) = c_1(\det\Delta) = c_1(\rho\eta)$. So the graded ring is indeed generated by $x,y,b$. We have $2x = 2y = 0$ from the relations above; and, letting $X,Y,B$ being the standard lifts $C_1(\rho), C_1(\eta), C_2(\Delta)$ of $x,y$ and $b$ to $R(D_4)$, we compute that $XB = YB = XY$. So $XY \in \Gamma^3$, thus $xy = 0$ and $xb = yb$. Finally, applying the total Chern class to \Cref{D4_relationdelta} yields the equation: \[ 5c_1(\Delta)^2 + 4b = x^2+3xy+y^2 = x^2+ y^2 = (x+y)^2 \] and since $c_1(\Delta) = x+y$, we obtain $4b = 0$. \\ To see these are the only relations, we use the computation of $R^*(D_4)\otimes\mathbb{F}_2 = \frac{\mathbb{Z}[x,y,b]}{(xy,xb-yb)}$ from \cite{guillot-minac}: tensoring with $\mathbb{F}_2$ shows that none of $x,y,b$ is nilpotent and that there are no extra relations between the genrerators. Finally, restriction to $C_4 = \langle r \rangle$ shows that any power $b^i$ of $b$ has additive order $4$. \end{proof}
\section{Introduction} Creating an AI capable of answering questions as well as people can has been a long-standing research problem. Recently, \textit{reading comprehension} (RC), a challenge to read a passage and then answer questions about it, has received much attention. Large and high-quality datasets that are sufficient to train deep neural networks have been constructed; in particular, the SQuAD dataset~\cite{RajpurkarZLL16} has brought significant progress such that the RC performance of AI is now comparable to that of humans. In the SQuAD 1.1 dataset, each question refers to one passage of an article, and the corresponding answer is guaranteed to be a span in that passage \footnote{The experiments reported in this paper used the SQuAD 1.1 dataset. SQuAD 2.0, which was recently released, additionally contains unanswerable questions based on one passage~\cite{RajpurkarJL18}. }. % Thus, most of the current top-performing RC methods such as BiDAF~\cite{SeoKFH17} and QANet~\cite{Yu18} assume that one \textit{relevant} passage, which contains all the facts required to answer the question, is given when answering the question. We tackle the task of \textit{machine reading at scale} (MRS) wherein, given a question, a system retrieves passages relevant to the question from a corpus and then extracts the answer span from the retrieved passages. \citeauthor{ChenFWB17} proposed DrQA, which is an open-domain QA system using Wikipedia's texts as a knowledge source by simply combining an exact-matching IR method with an RC method based on a neural network~\cite{ChenFWB17}. Their system showed promising results; however, the results indicated that the IR method, which retrieved the top five passages from five million articles for each question, was a bottleneck in terms of accuracy. It can retrieve passages that contain question words, but such passages are not always relevant to the question. \begin{figure}[t!] \centering \includegraphics[width=.45\textwidth]{./images/2917_attention-r10.eps} \caption{Our machine-reading-at-scale system uses a corpus of passages as a knowledge source. Our neural network learns IR and RC tasks jointly. Its IR component accurately re-ranks the passages retrieved by using fast IR methods.} \label{fig:concept} \end{figure} Here, we focus on the strong relationship between IR and RC. The RC capability of identifying an answer span in a passage will improve the IR capability of distinguishing between relevant and irrelevant passages. However, applying a model trained in RC to IR is not promising because the RC model, trained with only relevant passages, cannot indicate that there is no answer in irrelevant passages. We need to train a model so that it has both capabilities. Recently, a joint neural model of IR and RC components, trained with reinforcement learning, was examined~\cite{WangAAAI2018}. It outperformed DrQA; however, the IR component still was a bottleneck. The IR component was indirectly trained with a \textit{distant supervision} reward, which indicates how well the answer string extracted by its RC component matches the ground-truth. We conjecture that this reward, which does not consider the answer span, may prevent the IR component from carefully considering the context of passages. Our main research goal is to investigate the impact of learning from answer \textit{spans} in IR for RC. For this, we propose a neural model that incorporates the IR and RC tasks by using supervised multi-task learning (MTL). It shares the hidden layers between IR and RC tasks and minimizes the joint loss of relevance scores in IR and answer spans in RC. Our model can be trained using standard RC datasets, such as SQuAD, consisting of the triples of a question, a passage, and an answer span. We use the triples in the datasets as positive (i.e., relevant) examples and generate negative examples from the datasets for the learning of the IR component. Although our neural model can alleviate the bottleneck of IR accuracy, adapting it to the whole of a large-scale corpus causes computational complexity problems. We therefore introduce telescoping settings~\cite{MatveevaBBLW06}, where our IR model component re-ranks the outputs of fast exact-matching models that focus on eliminating higher irrelevant passages (Figure~\ref{fig:concept}). This idea enables our model to perform at a practical speed without loss of generality. The main contributions of this study are as follows. \begin{itemize} \item We developed a \textit{Retrieve-and-Read} model for supervised MTL of IR and RC tasks that shares its hidden layers between the two tasks and minimizes the joint loss. \item Our model with a telescoping setting exceeded the state-of-the-art by a significant margin on a large-scale MRS task, answering SQuAD questions using the full Wikipedia as the knowledge source. \item We created a new dataset, Jp-News, which is based on Japanese news articles. This dataset is more difficult for IR models than SQuAD because of the existence of similar passages and articles on the same topics. \item We thoroughly evaluated the effectiveness of MTL by investigating the individual contributions of our model components. We confirmed significant improvements in IR by learning from answer spans. \end{itemize} \section{Problem statement} Let us state the problem that this study addresses. \begin{problem} [{\sc Machine Reading at Scale; MRS}] \label{prob:qa} Given a question, an MRS system retrieves $k$ passages relevant to the question in a corpus $D$ (IR task) and extracts an answer from the retrieved passages (RC task). \end{problem} \begin{definition} A \textit{question}, $q$, is a sentence in natural language. \end{definition} \begin{definition} A \textit{passage}, $x$, is a short part of a document in natural language. It does not contain any non-textual information. \end{definition} \begin{definition} A \textit{corpus}, $D$, is a collection of passages. \end{definition} \begin{definition} An \textit{answer} is a span of arbitrary length within a passage. Its type is not limited to single words or named entities. It is extracted (not synthesized and generated) from the passage. \end{definition} \begin{definition} \label{def:relevant} A \textit{relevant passage} to a question is one that contains all textual facts required to answer the question. The IR task requires such relevant passages to be found. \end{definition} \section{Proposed model} Our \textit{Retrieve-and-Read} model is based on the bi-directional attention flow (BiDAF) model~\cite{SeoKFH17}, which is a standard RC model. As shown in Figure~\ref{fig:network}, it consists of six layers: \begin{figure}[t!] \centering \includegraphics[width=.45\textwidth]{./images/e2eqa-r4.eps} \caption{Retrieve-and-Read model architecture.} \label{fig:network} \end{figure} \begin{layer} The \textbf{word embedding layer} maps all words to a vector space using pre-trained word embeddings. \end{layer} \begin{layer} The \textbf{contextual embedding layer} encodes the temporal interactions between words. \end{layer} \begin{layer} The \textbf{attention flow layer} couples question and passage vectors and produces a sequence of question-aware passage word vectors. \end{layer} \begin{layer} The \textbf{modeling layer} captures the interaction among passage words conditioned on the question. \end{layer} \begin{layer} The \textbf{comprehension layer} outputs an answer to the question. \end{layer} \begin{layer} The \textbf{retrieval layer} provides the relevance of the passage. \end{layer} \noindent The first four layers of our model are shared by the IR and RC tasks, and it has a new task-specific layer for the IR task. The model jointly learns the two tasks by combining their loss functions. In addition to the attention mechanism in the shared layers, the retrieval layer calculates a binary exact-match channel to capture the question intent clearly and has a self-attention mechanism to retain important word representations for retrieval. We note that the RC component trained with single-task learning (STL) is essentially equivalent to BiDAF, except for the word embedding layer that has been modified to improve accuracy. \subsection{Word embedding layer} Let $x = \{x_1, \ldots, x_T\}$ and $q = \{q_1, \ldots, q_J\}$ represent one-hot vectors of words in the input passage and question. This layer projects each of the one-hot vectors (size of $V$) into a $v$-dimensional continuous vector space with a weight matrix $W^e \in \mathbb{R}^{v \times V}$. The embedding vectors are passed to a two-layer highway network~\cite{SrivastavaGS15} that is shared for the question and passage. The outputs are two sequences of $v$-dimensional vectors: $X \in \mathbb{R}^{v \times T}$ for the passage ($T$ words) and $Q \in \mathbb{R}^{v{\times}J}$ for the question ($J$ words). Note that the original BiDAF uses a pre-trained GloVe~\cite{PenningtonSM14} and also trains character-level embeddings by using a CNN~\cite{Kim14} in order to handle out-of-vocabulary (OOV) or rare words. Instead of using GloVe and CNN, our model uses fastText~\cite{BojanowskiGJM17} for the fixed pre-trained word vectors and removes character-level embeddings. The fastText model takes into account subword information and can obtain valid representations even for OOV words. \subsection{Contextual embedding layer} This layer has a single-layer LSTM~\cite{HochreiterS97} in the forward and backward directions and concatenates the $d$-dimensional outputs of the two LSTMs. It has learnable parameters for both directions. It obtains $H \in \mathbb{R}^{2d{\times}T}$ from $X$ and $U \in \mathbb{R}^{2d{\times}J}$ from $Q$. \subsection{Attention flow layer} This layer computes attentions in two directions in order to fuse information from the passage (i.e., context) to the question (i.e., query) words as well as from the question to the passage. It first computes a similarity matrix $S \in \mathbb{R}^{T{\times}J}$, \begin{align} S_{tj} = {w^s}^{\mathsf{T}} [ H_t; U_j; H_t \odot U_j ], \end{align} that indicates the similarity between the $t$-th passage word and the $j$-th question word. $w^s \in \mathbb{R}^{6d}$ are learnable parameters, the $\odot$ operator denotes the Hadamard product, and the $[; ]$ operator is vector concatenation across the rows. \textbf{Context-to-query attention} signifies which question words are most relevant to each passage word. It outputs $\tilde{U}_t = \sum_j a_{tj} U_j \in \mathbb{R}^{2d}$, where $a_t = \mathrm{softmax}_j(S_{t}) \in \mathbb{R}^J$. \textbf{Query-to-context attention} signifies which passage words have the closest similarity to one of the question words. It outputs $\tilde{h} = \sum_t b_t H_t \in \mathbb{R}^{2d}$, where $b = \mathrm{softmax}_t(\mathrm{max}_j(S)) \in \mathbb{R}^T$. It then obtains $\tilde{H} \in \mathbb{R}^{2d{\times}T}$ by tiling the vector $T$ times across the columns. \textbf{Bi-directional attention} computes $G$ to obtain a question-aware representation of each passage word, \begin{align} G = [ H; \tilde{U}; H \odot \tilde{U}; H \odot \tilde{H} ] \in \mathbb{R}^{8d{\times}T}. \end{align} \subsection{Modeling layer} This layer uses a single-layer bi-LSTM and obtains $M \in \mathbb{R}^{2d{\times}T}$ from $G$. The output is passed on to the task-specific layers. \subsection{Comprehension layer} The RC task requires the model to find a phrase to answer the question. This layer uses the concept of pointer networks \cite{VinyalsFJ15}, where the phrase is derived by predicting the start and end indices in the passage. First, this layer passes the output of the modeling layer $M$ to another single-layer bi-LSTM and obtains $M^{1} \in \mathbb{R}^{2d{\times}T}$. It then calculates the probability distribution of the start index, \begin{align} \label{eq:p1} p^1 = \mathrm{softmax}_t( {w^1}^{\mathsf{T}} [G; M^{1}]) \ \in \mathbb{R}^{T}, \end{align} where $w^1 \in \mathbb{R}^{10d}$ are learnable parameters. Next, it calculates an attention-pooling vector, $\tilde{m}^{1} = \sum_t p^1_t M^{1}_t \in \mathbb{R}^{2d}$, and tiles it $T$ times to obtain $\tilde{M}^1 \in \mathbb{R}^{2d{\times}T}$. Then, it passes the concatenated matrix of $[G; M^{1}; \tilde{M}^{1}; M^{1} \odot \tilde{M}^{1}] \in \mathbb{R}^{14d{\times}T}$ to another single-layer bi-LSTM and obtains $M^{2} \in \mathbb{R}^{2d{\times}T}$. Finally, it calculates the probability distribution of the end index, \begin{align} \label{eq:p2} p^2 = \mathrm{softmax}_t({w^2}^\mathsf{T} [G; M^{2}]) \in \mathbb{R}^{T}, \end{align} where $w^2 \in \mathbb{R}^{10d}$ are learnable parameters. \subsection{Retrieval layer} The IR task requires the model to find relevant passages that meet the information needs of the question. This layer maps the output of the modeling layer to the relevance score of the passage by using a binary exact-matching and a self-attention mechanism. First, for capturing question words clearly, this layer calculates a binary exact-match channel, $\tilde{B}$. Let $B \in \mathbb{R}^{J{\times}T}$ be a matrix such that the entry at position $(j, t)$ is 1 if the $j$-th question word is an exact match to the $t$-th passage word in the passage and 0 otherwise. It performs a max-pooling of $B$ over all the question words to obtain ~$\tilde{B} \in \mathbb{R}^{1{\times}T}$. Then, it passes $[M; \tilde{B}] \in \mathbb{R}^{(2d+1){\times}T}$ to another single-layer bi-LSTM and obtains $M^{r} \in \mathbb{R}^{2d{\times}T}$. To retain important word representations for retrieval, it calculates an attention-pooling of $M^{r}$, \begin{align} \tilde{m}^{r} = \sum\nolimits_t \beta_t M^{r}_t \ \in \mathbb{R}^{2d}. \end{align} The element of the attention $\beta \in \mathbb{R}^T$ is computed as the inner product between a question-aware representation of each passage word and a self-attention context vector, $w^c$: \begin{align} \beta_t = \exp({m_t}^\mathsf{T} w^c) / \sum\nolimits_{t'}\exp({m_{t'}}^\mathsf{T} w^c), \end{align} where $m_t = W^{a} M^r_t + b^{a}$. $W^a \in \mathbb{R}^{c{\times}2d}$ and $b^a, w^c \in \mathbb{R}^{c}$ are learnable parameters. Finally, it calculates the relevance of the passage to the question, \begin{align} p^r = \mathrm{sigmoid}({w^r}^\mathsf{T} \tilde{m}^r) \ \in [0,1], \end{align} where $w^r \in \mathbb{R}^{2d}$ are learnable parameters. \subsection{Multi-task learning} We define the training loss as the sum of losses in IR and RC, \begin{align} L(\theta) = L_{RC} + \lambda L_{IR}, \end{align} where $\theta$ is the set of all learnable parameters of the model and $\lambda$ is a balancing parameter. Our model uses question-answer-passage triples in the training set as positive examples and generates negative examples from the set. We explain the negative sampling procedure used in our experiments in Section~\ref{sec:negative}. The loss of the IR task, $L_{IR}$, is the binary cross entropy between the true and predicted relevance scores averaged over all examples: \begin{align} L_{IR} = -\frac{1}{N} \sum\nolimits_i \left(r_i \log p^r + (1 - r_i) \log (1 - p^r) \right), \end{align} where $N$ is the number of examples and $r_i$ is the true relevance score (1 if the $i$-th example is positive, 0 otherwise). The loss of the RC task, $L_{RC}$, is the negative log probabilities of the true start and end indices given by the predicted distributions averaged over all \textit{positive} examples: \begin{align} L_{RC} = - \frac{1}{N_{\rm pos}} \sum\nolimits_i r_i \left( \log p^1_{y_i^1} + \log p^2_{y_i^2} \right), \end{align} where $N_{\rm pos}$ is the number of positive examples, and $y_i^1$ and $y_i^2$ are the true start and end indices. Note that negative examples are ignored in the loss function for RC because they do not have the correct answer spans for the query. \subsection{Test process} \label{sec:test-process} \subsubsection{IR task.} Given a question $q$, our model outputs the top-$k$ passages, $R_k$, ordered by the relevance $p^r$ for each passage $x \in D$ and $q$. \subsubsection{RC task.} Our model outputs an answer for each passage in the retrieved set. In total, it outputs $k$ answers. Given $x \in R_k$ and $q$, it chooses the answer span $(t_1, t_2)$ where $t_1 \leq t_2$ with the maximum value of $p^1_{t_1} p^2_{t_2}$, which can be computed in linear time with dynamic programming. It then outputs an answer as a substring of $x$ with the chosen span. \subsubsection{MRS task.} \label{sec:voting} Our model returns a final answer with weighted majority voting from the $k$ outputs of the RC component. It uses $\exp(p^r / \tau)$ for each RC output as a weight, where $\tau$ is a temperature parameter that controls the voting. It sums the weights of each answer string and selects the most voted for answer as the final answer. Note that we do not use the RC score for the voting. \subsection{Telescoping setting} \label{sec:telescoping} It is difficult to adapt neural networks to the whole of a large-scale corpus due to their computational cost; so, we consider using a \textit{telescoping} setting that uses chaining of different IR models, where each successive model re-ranks a smaller number of passages~\cite{MatveevaBBLW06}. Without loss of generality, we can use a telescoping setting with our model, where our IR component finds relevant passages in a subset of a corpus $D$ retrieved by chaining of different IR models. That is, the initial rankers focus on eliminating higher irrelevant passages, and our model operates as a re-ranker for determining the existence of answer phrases within the remaining passages. We explain the settings used in our experiments in Section~\ref{sec:teles}. \section{Experiments} \subsection{Datasets} \subsubsection{Training} We used \textbf{SQuAD} 1.1~\cite{RajpurkarZLL16}, which is a standard RC dataset based on Wikipedia articles, and \textbf{Jp-News}, which was created by crowdworkers in the same way as SQuAD. For each question, we defined that the single passage corresponding to the question in the dataset is relevant and the others are not relevant. That is, our IR component used question-answer-passage triples in the training set as positive examples. It generated negative examples from the set, as described in Section~\ref{sec:negative}. Table~\ref{tb:dataset} shows the statistics of the datasets. The main characteristic of Jp-News is the use of a set of Japanese news articles that contain similar passages on the same topics. These similar passages make it difficult for IR models to find the most relevant passage to each question. See the Appendix~\ref{sec:dataset} for details of the data collection and analysis of the Jp-News dataset. \subsubsection{Evaluations} We used a benchmark for MRS, \textbf{SQuAD}$_\mathrm{full}$~\cite{ChenFWB17}, to evaluate our model trained with SQuAD. It takes only the question-answer pairs of the SQuAD development set and uses the full Wikipedia as the knowledge source (5,075,182 articles). In this \textit{end-to-end} setting, no relevance information for IR is given. To evaluate the \textit{individual} contributions of our model components precisely, we conducted additional experiments using the passages of the SQuAD development set (denoted as \textbf{SQuAD}$_\mathrm{dev}$) or those of Jp-News as the knowledge source. As in the training set, the question-answer-passage triples in the development set were used as positive examples. Our IR evaluation using binary relevance scores is more rigorous than distant-supervision evaluations based on whether the ground-truth appears in the retrieved passages~\cite{ChenFWB17,WangAAAI2018}. \begin{table}[t!] \centering \caption{Number and mean length (in tokens) of each item in the training datasets.} \label{tb:dataset} \begin{tabular}{l|cc|ccc}\hline & \multicolumn{2}{c|}{SQuAD} & \multicolumn{3}{c}{Jp-News} \\ & train & dev & train & dev & test \\ \hline No. articles & 442 & 48 & 4,000 & 500 & 500 \\ No. questions & 87,599 & 10,570 & 66,073 & 8,247 & 8,272 \\ No. passages & 18,896 & 2,067 & 10,024 & 1,214 & 1,247 \\ No. answers & 87,599 & 34,726 & 179,908 & 22,500 & 22,500 \\ Len. questions & 11.4 & 11.5 & 21.9 & 21.8 & 21.9 \\ Len. passages & 140.3 & 144.5 & 181.4 & 176.2 & 177.7 \\ Len. answers & 3.5 & 3.3 & 4.3 & 4.5 & 4.2 \\ \hline \end{tabular} \end{table} \subsection{Evaluation metrics} \subsubsection{IR Task} We used metrics for binary relevance judgments to evaluate the individual contributions of our IR component. \textbf{Success@k} (S@k) is the percentage of times that a relevant document is in the top-$k$ retrieved documents, $R_k$, for a query~\cite{Craswell09e}. \textbf{MRR@k} (M@k) is the mean reciprocal rank of the first relevant document~\cite{Craswell09a}. \subsubsection{RC and MRS Tasks} We evaluated the models with the same metrics used in SQuAD. \textbf{EM} (Exact match) measures the percentage of predictions that match the ground truth exactly. \textbf{F1} (Macro-averaged F1 score) measures the average overlap between the bag of words of the prediction and that of the ground truth~\cite{RajpurkarZLL16}. \subsection{Baselines} \subsubsection{MRS task} We used two state-of-the-art models: \textbf{DrQA}~\cite{ChenFWB17} and \textbf{R$^3$}~\cite{WangAAAI2018} in the end-to-end setting. Moreover, for the detailed evaluations, we used a simple pipeline of a TF-IDF model (without re-ranking) and our RC component trained with STL. This structure corresponds to the one of DrQA~\cite{ChenFWB17}. We also evaluated a pipeline of our IR component trained with STL (used as a re-ranker) and our RC component trained with STL. \subsubsection{IR task} For the individual evaluations, we used two recent neural IR models as re-ranker baselines. \textbf{Duet} \cite{MitraDC17} is a recent standard neural IR model. It consists of two separate CNNs: one that exactly matches question and passage words and another that matches the question and the passage by using learned distributed representations. In \cite{MitraDC17}, \citeauthor{MitraDC17} reported that Duet significantly outperformed non-neural IR models such as BM25~\cite{RobertsonW94} and LSA~\cite{DeerwesterDLFH90} and also earlier neural IR models such as DSSM~\cite{HuangHGDAH13} and DRMM~\cite{GuoFAC16}. \textbf{Match-tensor} \cite{JaechKRC17} is a recent model that uses RNNs for the encoding of the input query and passage. It uses soft-matching between each question and passage word encoded by a bi-LSTM and uses 2D convolutions that map the matching tensor to the relevance score. Although Duet does not assume that queries are given in the form of natural language, Match-tensor can carefully consider the context of question and passage sentences with RNNs. \subsubsection{RC task} In order to confirm that our MTL approach does not degrade RC performance, we used \textbf{BiDAF}~\cite{SeoKFH17}, which is a base model of our model, and \textbf{Document Reader}~\cite{ChenFWB17}, which is the RC component of DrQA. \subsection{Model configuration} \label{sec:config} \subsubsection{Preprocess} We used the Stanford CoreNLP tokenizer \cite{ManningSBFBM14} (JTAG tokenizer \cite{FuchiT98}) on the SQuAD (Jp-News) dataset. Our model used pre-trained $300$-dimensional fastText embeddings~\cite{BojanowskiGJM17} in a case-sensitive manner, and they were fixed during training. We used the 2016-03-05 (2017-11-03) dump of English (Japanese) Wikipedia articles for pre-training. \subsubsection{Training process} We used the same configuration for all datasets. We trained our model with 10 GPUs (GeForce GTX 1080 Ti). Each GPU processed a minibatch of size 60, consisting of 30 positive and 30 negative examples. The LSTM hidden size, $d$, and the context vector size, $c$, were set to 100. Weights were initialized using the Xavier uniform initializer~\cite{GlorotB10}, except that the biases of all the linear transformations were initialized with zero vectors. A dropout \cite{SrivastavaHKSS14} rate of 0.2 was used for all highway and LSTM layers and each linear transformation before the softmax and sigmoid for the outputs. We used SGD with a momentum of 0.9 and an initial learning rate of 1. The number of epochs was 15, and the learning rate was reduced by a factor of 0.9 every epoch. The balancing factor of MTL, $\lambda$, was set to 1. During training, the moving average of each weight was maintained with an exponential decay rate of 0.99. At test time, the moving average was used instead of the raw weight. Single-task learning (STL) was conducted by changing the training loss function. We used $L(\theta)=L_{IR}$ for the IR task and $L(\theta)=L_{RC}$ for the RC task. \subsubsection{Negative sampling} \label{sec:negative} Negative examples for training were generated from positive examples. Each negative example consisted of the same question and a similar passage, which was randomly sampled among the top-15 most similar passages in a TF-IDF vector space of the training set, to the corresponding positive example. Preliminary experiments showed that negative examples consisting of a question and a passage that were randomly sampled from the whole training set were not effective at training IR modules. \subsubsection{Telescoping settings} \label{sec:teles} We used two settings: T1 and T2. \textbf{T1}.\, For SQuAD$_\mathrm{full}$, we used chaining of two exact-matching IR models and one neural IR model. The first model retrieved five articles from about five million articles, and the second one retrieved $200$ passages from the five articles. Articles were split into passages by one or more line breaks, as in \cite{ChenFWB17}. We used Document Retriever~\cite{ChenFWB17}, which is a model based on bigram hashing and TF-IDF matching, for both the first and second retrievals. Finally, the IR component of our model found the top-$1$ passage from the 200 passages and passed it to our RC component. \textbf{T2}.\, For the individual evaluations using SQuAD$_\mathrm{dev}$ and Jp-News, one TF-IDF model retrieved $200$ passages from the whole passages in the evaluation set, and our neural IR component retrieved the top-$k$ passage. $k$ was varied from $1$ to $5$. The temperature parameter for voting, $\tau$, was set to $0.05$. \subsubsection{Baseline settings.} For MRS and RC baselines with the SQuAD dataset, we used the results reported in their studies. For Jp-News, we trained and evaluated BiDAF and Document Reader using the original configuration of each study. We trained GloVe embeddings with the same Wikipedia articles that our model used for pre-training. We did not use the lemma, POS, or NER features for Document Reader, because they degraded accuracy. The IR baselines used the same telescoping settings as our model. We used the original configuration of each IR method, except as follows. We used the $300$-dimensional fastText (which our model used) for the fixed embeddings. Although the original Duet uses character $n$-grams for learning the word embeddings, it does not work well when there is not much training data. \subsection{Results} The reported results of all neural models with different initializations are means over five trials. \subsection*{\normalsize Does our system achieve state-of-the-art performance on a large-scale MRS task?} \begin{table}[t!] \centering \tabcolsep=3pt \caption{MRS using full Wikipedia results. S, DS, DS', and E mean supervised learning, distant supervision with SQuAD and with other datasets, and ensemble model, respectively. The results of our single model and R$^3$ are averages of five runs; the superscript is the standard error.} \label{tb:fullMRS} \begin{tabular}{lcccc|cc}\hline & & & & & \multicolumn{2}{c}{SQuAD$_\mathrm{full}$} \\ & S & DS & DS' & E & EM & F1 \\ \hline DrQA & \checkmark& & & & 27.1 & -- \\ DrQA+DS & \checkmark& \checkmark & & & 28.4 & -- \\ DrQA+DS+MTL & \checkmark& \checkmark & \checkmark & & 29.8 & -- \\ $\mathrm{R}^3$ & & \checkmark & & &29.1$^{.2}$ & 37.5$^{.2}$ \\ \hline Retrieve-and-Read (single) & \checkmark& & & & \textbf{32.7}$^{.2}$ & \textbf{39.8}$^{.2}$ \\ Retrieve-and-Read (ensemble) & \checkmark& & & \checkmark & \textbf{35.6} & \textbf{42.6} \\\hline \end{tabular} \end{table} We evaluated the overall performance of our single and ensemble models with SQuAD$_\mathrm{full}$ and the T1 telescoping setting. The ensemble model consists of five training runs with the identical architecture and hyper-parameters. It chooses the answer with the highest sum of confidence scores amongst the five runs for each question. Table~\ref{tb:fullMRS} shows that our models outperformed the state-of-the-art by a significant margin. The improvement of our single (ensemble) model over R$^3$, which was trained without using answer spans, was up to 3.6\% (6.5\%) in EM and 2.3\% (5.3\%) in F1. This result indicates the effectiveness of learning from answer spans in IR. \subsection*{\normalsize Does our MTL improve the accuracy of STL, which does not consider answer spans, in IR?} The individual contributions of our neural IR component on SQuAD$_\mathrm{dev}$ and Jp-News were evaluated using the T2 telescoping setting. Table~\ref{tb:IRresult} shows that our IR component trained with MTL significantly outperformed STL. The IR component shares hidden layers with the RC component in order that it can learn from answer spans, and this sharing contributed to statistically significant improvements over all baselines ($t$-test; $p<.001$) for all datasets. \begin{table}[t!] \centering \tabcolsep=4.5pt \caption{Averaged IR (re-ranking) results. The initial ranker was TF-IDF.} \label{tb:IRresult} \begin{tabular}{l|cc|cccc}\hline & \multicolumn{2}{c}{SQuAD$_\mathrm{dev}$} & \multicolumn{2}{|c}{Jp-News$_\mathrm{dev}$} & \multicolumn{2}{c}{Jp-News$_\mathrm{test}$} \\ IR re-ranker & S@1 & M@5 & S@1 & M@5 & S@1 & M@5\\ \hline (None) & 0.748 & 0.810 & 0.713 & 0.824 & 0.692 & 0.804 \\ Duet & 0.665 & 0.743 & 0.573 & 0.698 & 0.564 & 0.692 \\ Match-tensor & 0.732 & 0.791 & 0.725 & 0.821 & 0.704 & 0.806 \\ \hline Our IR (STL) & 0.707 & 0.773 & 0.690 & 0.800 & 0.673 & 0.787 \\ Our IR (MTL) & {\bf 0.811} & {\bf 0.863} & {\bf 0.753} & {\bf 0.842} & {\bf 0.737} & {\bf 0.830 } \\ \hline \end{tabular} \end{table} Other re-rankers did not clearly outperform TF-IDF. Interestingly, our IR component trained with STL performed significantly worse than TF-IDF and Match-tensor. This result indicates that it is important to teach which part of the passage meets the information needs rather than to give only a relevance score to the whole passage and that our MTL approach allows for accurate learning from a small amount of data. We should note that the experiments conducted on Duet and Match-tensor in their original studies used a set of approximately one million documents, so they would outperform TF-IDF when there is a large amount of data. \subsection*{\normalsize Does our MTL improve the accuracy of STL in RC?} \begin{table}[t!] \centering \caption{Averaged standard RC (reading one relevant passage) results for a single model.} \label{tb:RCresult} \begin{tabular}{l|cc|cccc}\hline & \multicolumn{2}{c}{SQuAD$_\mathrm{dev}$} & \multicolumn{2}{|c}{Jp-News$_\mathrm{dev}$} & \multicolumn{2}{c}{Jp-News$_\mathrm{test}$} \\ RC model & EM & F1 & EM & F1 & EM & F1 \\ \hline BiDAF & 67.7 & 77.3 & 76.9 & 88.1 & 77.3 & 88.3\\ Document Reader & {\bf 69.5} & {\bf 78.8} & 75.9 & 87.6 & 76.2 & 87.8\\ \hline Our RC (STL) & 69.1 & 78.2 & 77.4 & 88.4 & 78.3 & 88.8\\ Our RC (MTL) & 69.3 & 78.5 & {\bf 78.0} & {\bf 88.8} & {\bf 78.8} & {\bf 89.2}\\ \hline \end{tabular} \end{table} We evaluated the individual contributions of our RC component using with SQuAD$_\mathrm{dev}$ and Jp-News. Table~\ref{tb:RCresult} and Figure~\ref{fig:loss_RC} show the results for the \textit{standard} RC task, where each model was given one relevant passage for each question. As shown in Figure~\ref{fig:loss_RC}, our MTL approach performed statistically significantly better than STL in terms of EM and F1 of each epoch (Two-way repeated-measures ANOVA; $p<.05$) for all datasets. Although our RC component based on a vanilla BiDAF was not competitive among the current state-of-the-art methods such as QANet~\cite{Yu18}, we confirmed that our MTL does not degrade RC performance and it is comparable to the Document Reader model, which is used in DrQA~\cite{ChenFWB17}. \begin{figure}[t!] \centering \includegraphics[width=.47\textwidth]{./images/mc_curve-r2.eps} \caption{Averaged learning curves of our RC component trained with MTL or STL. (a) EM and (b) F1 metrics on SQuAD$_\mathrm{dev}$ set. Error bars are for over five trials.} \label{fig:loss_RC} \end{figure} \subsection*{\normalsize Does our MTL improve the accuracy of pipeline approaches in MRS?} We compared our MTL approach with a pipeline of our components trained with STL, by using SQuAD$_\mathrm{dev}$ and Jp-News. We also evaluated a simple pipeline of TF-IDF finding the top-1 passage and our RC component trained with STL. Table~\ref{tb:QAresult} shows that our MTL approach with the T2 telescoping setting ($k=1$) statistically significantly outperformed the pipeline approaches ($t$-test; $p<.001$) for all datasets. As shown in Tables \ref{tb:IRresult} and \ref{tb:RCresult}, the improvements in our IR component were responsible for this progress. \begin{table}[t!] \centering \caption{MRS results of our single and ensemble models. The initial ranker was TF-IDF. (IR, RC) = (None, STL) corresponds to the pipeline of TF-IDF and a neural RC model~\cite{ChenFWB17}.} \label{tb:QAresult} \begin{tabular}{cc|cc|cccc}\hline \multicolumn{8}{l}{Single model~(mean performance over five trials)} \\ \hline & & \multicolumn{2}{c}{SQuAD$_\mathrm{dev}$} & \multicolumn{2}{|c}{Jp-News$_\mathrm{dev}$} & \multicolumn{2}{c}{Jp-News$_\mathrm{test}$} \\ Our IR & Our RC & EM & F1 & EM & F1 & EM & F1 \\ \hline (None) & STL & 53.9 & 61.6 & 65.6 & 78.0 & 65.6 & 77.9 \\ STL & STL & 52.2 & 59.9 & 64.9 & 77.2 & 65.5 & 77.7 \\ MTL & MTL & {\bf 60.0} & {\bf 68.1} & {\bf 69.5} & {\bf 81.7} & {\bf 70.6} & {\bf 82.7} \\ \hline \hline \multicolumn{8}{l}{Ensemble model consisting of five single models} \\ \hline Our IR & Our RC & EM & F1 & EM & F1 & EM & F1 \\ \hline (None) & STL & 56.6 & 63.6 & 68.2 & 79.7 & 67.9 & 79.4 \\ STL & STL & 56.3 & 63.2 & 68.8 & 80.2 & 68.8 & 80.4 \\ MTL & MTL & {\bf 64.5} & {\bf 71.8} & {\bf 73.5} & {\bf 84.5} & {\bf 75.0} & {\bf 85.9} \\ \hline \end{tabular} \end{table} \subsection*{\normalsize Does our whole system run at a practical speed?} The test process for SQuAD$_\mathrm{dev}$ using our single model with (without) the T2 telescoping setting, where our neural model processed 200 (2,047) passages for each question, took 1.5 (17.1) seconds per question. The time taken by the TF-IDF search was very short (less than 10 milliseconds). Also, the test process for SQuAD$_\mathrm{full}$, in which the mean length of the passages is shorter than in that of SQuAD$_{\mathrm{dev}}$, took 1.0 second per question when using our single model with the T1 telescoping setting. To summarize, the whole system could run at a practical speed under the telescoping settings, and the computational order of the system was dependent on the size of the subset retrieved by TF-IDF and on the lengths of the question and passages. \subsection*{\normalsize Does the telescoping setting degrade accuracy in IR?} We evaluated the accuracy of the initial ranker, TF-IDF, on the SQuAD$_\mathrm{dev}$ and Jp-News datasets, when it retrieved 200 passages in the T2 telescoping setting. We confirmed that it eliminated higher irrelevant passages with almost no deterioration in accuracy: the Success@200 rate was 0.991 (0.997) on the SQuAD (Jp-News) development set, while the Success@1 rate was 0.748 (0.713). Although TF-IDF was reasonable as an initial ranker on these datasets, we need to improve the accuracy to overcome the problem of lexical variation between the question and the passages. We will discuss this issue in Section~\ref{sec:related}. \subsection*{\normalsize Detailed analysis} Figure~\ref{fig:vis2} provides a qualitative analysis of our IR components' attention to a passage. The component trained with MTL captured the answer phrase as well as question words, but the component trained with STL did not recognize the answer phrase. \begin{figure}[t!] \centering \includegraphics[width=.44\textwidth]{./images/2203_compare_r7.eps} \caption{Attention of our IR components trained with (a) STL and (b) MTL to passage words. Darker red signifies greater attention.} \label{fig:vis2} \end{figure}{} Figure~\ref{fig:qtype_ir} shows IR results broken down by the first words in the question on SQuAD$_\mathrm{dev}$. Our IR component trained with MTL performed better than TF-IDF in every category. \begin{figure}[t!] \centering \includegraphics[width=.44\textwidth]{./images/qtype_ir_r4.eps} \caption{Success@1 rates broken down by the ten most-frequent first words in the question on the SQuAD dev.~set.} \label{fig:qtype_ir} \end{figure} Table~\ref{tb:ablation} shows the accuracy of our IR component with and without the exact-match channel on SQuAD$_\mathrm{dev}$ and Jp-News. This channel improved the model performance ($t$-test; $p<.01$). \begin{table}[t!] \centering \tabcolsep=2.5pt \caption{Ablation test of our IR re-ranker model. The results are averages over five trials.} \label{tb:ablation} \begin{tabular}{l|cc|cccc}\hline & \multicolumn{2}{c}{SQuAD$_\mathrm{dev}$} & \multicolumn{2}{|c}{Jp-News$_\mathrm{dev}$} & \multicolumn{2}{c}{Jp-News$_\mathrm{test}$} \\ IR re-ranker & S@1 & M@5 & S@1 & M@5 & S@1 & M@5\\ \hline Our IR (MTL) & {\bf 0.811} & {\bf 0.863} & {\bf 0.753} & {\bf 0.842} & {\bf 0.737} & {\bf 0.830 } \\ w/o exact-match & 0.800 & 0.858 & 0.742 & 0.832 & 0.726 & 0.820 \\ \hline \end{tabular} \end{table} Table~\ref{tb:voting} shows the results of our model using the T2 telescoping setting with different values of $k$, which is the number of passages retrieved by our IR component. The results for $k$ = 1 were the best for corpora like SQuAD (Wikipedia articles), where most descriptions are expected to be stated only once, while larger values of $k$ were suitable for corpora like Jp-News that include the same descriptions in multiple passages. \begin{table}[t!] \centering \tabcolsep=4pt \caption{Effect of varying the number of retrieved passages, $k$, on the averaged MRS results of our single model.} \label{tb:voting} \begin{tabular}{l|cccc|cccc}\hline & \multicolumn{2}{c}{SQuAD$_\mathrm{full}$} & \multicolumn{2}{c}{SQuAD$_\mathrm{dev}$} & \multicolumn{2}{|c}{Jp-News$_\mathrm{dev}$} & \multicolumn{2}{c}{Jp-News$_\mathrm{test}$} \\ $k$ & EM & F1 & EM & F1 & EM & F1 & EM & F1 \\ \hline 1 &{\bf 32.7} & {\bf 39.8} & {\bf 60.0} & {\bf 68.1} & 69.5 & 81.7 & 70.6 & 82.7\\ 3 & 32.4 & 39.5 & 59.5 & 67.6 & 69.7 & 81.9 & 70.8 & 82.8\\ 5 & 31.4 & 38.4 & 58.9 & 67.0 & {\bf 69.9} & {\bf 82.0} & {\bf 70.9} & {\bf 82.9}\\ \hline \end{tabular} \end{table} The total number of parameters without word embeddings in our MTL (STL = IR + RC) model was 3.11M (4.52M = 1.67M + 2.85M). The MTL model shared hidden layers for the two tasks and could save 1.41M parameters compared with the pipeline system of the two individual components. Also, the training time of MTL with SQuAD was 14.0 hours. It could save 4.6 hours compared with the pipeline system (8.6 hours for IR and 10.0 hours for RC components). \section{Related work and discussion} \label{sec:related} \paragraph{Machine reading at scale} MRS, which is a combination of an IR and RC task that uses a large number of unstructured texts as a knowledge source, is an emerging research field. As described earlier, the work of \citeauthor{WangAAAI2018}~\cite{WangAAAI2018} is the most similar to ours. In their model, R$^3$, the ranker and reader share the hidden layers and they are jointly learned with reinforcement learning. The largest difference between DrQA~\cite{ChenFWB17} and our model is that R$^3$ was trained entirely using distant supervision. Although distant supervision without using answer \textit{spans} can learn from a large amount of data, it may prevent models from carefully considering the context of passages. We believe that supervised learning using answer spans is also promising because of its high accuracy. Our model can be trained with standard RC datasets with answer spans, and such datasets can be collected by crowdsourcing. Recently, \citeauthor{WangICLR2018} proposed answer re-ranking methods that reorder the answer candidates generated by the RC module of an MRS system~\cite{WangICLR2018}. Their methods can be used as post-processes for existing MRS systems including ours; unfortunately, they did not report their performance on SQuAD$_\mathrm{full}$. Their methods (and our weighted voting scheme described in Section~\ref{sec:voting}) are effective when the correct answer is repeatedly suggested in passages. However, there are still problems with question answering that combines disjoint pieces of textual evidence. Effective methods of text understanding across multiple passages need to be developed that would alleviate the limitations of our Definition~\ref{def:relevant}, which assumes that all textual facts required to answer the question are contained in one relevant passage. Currently, SQuAD$_{\mathrm{full}}$ is the only large-scale MRS dataset that can be used to both train and evaluate \textit{extractive} RC models in the \textit{same domains and question styles}. NewsQA~\cite{TrischlerWYHSBS16} can be used as the training data for extractive RC models, while its questions are too dependent on the corresponding passage (e.g., Who is hiring?)~to use the MRS task. \citeauthor{Clark18} recently released the ARC dataset as a more challenging dataset~\cite{Clark18}. It consists of 7,787 QA pairs and 14M science sentences, although its multiple-choice type of question is different from that of SQuAD and JP-News. \paragraph{RC with a small number of passages} Several small-scale MRS datasets consisting of sets of (question, answer string, evidence passages) triples have been proposed: TriviaQA~\cite{JoshiCWZ17}, Quasar-T~\cite{DhingraMC17}, SearchQA~\cite{DunnSHGCC17} (\textit{answer extraction}), WikiHop~\cite{WelblSR17} (\textit{multiple choice}), Quasar-S~\cite{DhingraMC17} (\textit{cloze-styles}), and MS~MARCO~\cite{NguyenRSGTMD16} (\textit{answer generation}). Each QA pair in these datasets has a \textit{small} number of evidence passages that were gathered automatically from the Web by using a search engine as their initial ranker in a large-scale MRS setting. Approaches that read all given passages at once are often adapted to work with these datasets. That is, IR methods are not used. For example, R-NET for MS MARCO~\cite{WangYWCZ17} concatenates all ten passages corresponding to a question and extracted an answer span from the concatenated one. However, such approaches consume a lot of memory and do not work well when there are many long passages. Moreover, the datasets listed above do not provide answer spans in evidence passages and cannot be used for \textit{supervised training} of our model because of the lack of a relevance score and answer span of passages to each question. Thus, we did not conduct any experiments with these datasets in this study. \paragraph{Distant supervision in IR for RC} Although SQuAD is a large-scale RC dataset, the domains and styles of its questions are limited. Incorporating distant supervision with supervised learning will be important for building open-domain QA systems. As distant supervision datasets, we can use the RC datasets without answer spans or other QA datasets without evidence passages, such as CuratedTREC~\cite{BaudisS15}, WebQuestions~\cite{BerantCFL13}, or WikiMoviews~\cite{MillerFDKBW16}. Distant supervision in IR for RC has not yet been fully established. \citeauthor{WangAAAI2018} reported that their ranker trained with distant supervision performed far worse than the oracle performance~\cite{WangAAAI2018}. In the future, we need to investigate the effects of using distant supervision in IR for RC, including the effect of adding adversarial distracting sentences~\cite{JiaL17}. \paragraph{Neural IR} Neural ranking models are currently a popular topic in IR~\cite{MitraC17}. There are roughly two groups: embedding space models~\cite{HuangHGDAH13,ShenHGDM14b,NalisnickMCC16} and interaction-based models~\cite{ GuoFAC16, XiongDCLP17, HuiYBM17, DaiXC018, HuiYBM18}. In the embedding space models, the query and documents are first embedded into continuous vectors, and the ranking is calculated from their embeddings' similarity. These models are faster than interaction-based ones, and we can use them as initial rankers in order to alleviate the problem of lexical variation. Most of the recent models use an interaction mechanism between the query and document words for accuracy. These neural approaches give a relevance score to the whole document for training and tend to be data-hungry~\cite{MitraC17}. By contrast, our experimental results showed that our MTL approach accurately learns from a small amount of data. \paragraph{Multi-task and transfer learning} MTL and transfer learning~\cite{PanY10} play a key role in building intelligent QA systems when the amount of available data is limited. \citeauthor{McCannBXS17} used contextualized word embeddings, called CoVe, trained in machine translation to improve the accuracy of RC~\cite{McCannBXS17}. \citeauthor{PetersNIGCLZ18} proposed contextualized word embeddings, called ELMo, trained in language modeling. Adding ELMo representations to existing models showed significant improvements on six challenging NLP problems including RC~\cite{PetersNIGCLZ18}. \citeauthor{Yu18} used a complementary data augmentation technique to enhance the training data of RC by using a translation model. The technique paraphrases examples by translating the original sentences from English to French and then back to English~\cite{Yu18}. These techniques can be used with our models. \paragraph{Traditional IR-based QA systems} Most traditional systems focus on factoid questions, which can be answered with named entities, and have a pipeline architecture consisting of at least three components: question analysis, IR, and answer extraction~\cite{HirschmanG01}. The systems reformulate queries to enable their IR method to cover many textual variants. However, their reformulation is dependent on the redundancy of the knowledge source~\cite{BrillDB02}, and thus, they do not work well on smaller corpora. A deeper understanding of natural language is needed to overcome their limitations. Moreover, there are two approaches to IR for QA: one is to index each passage as a separate document and retrieve them; the other one is to retrieve long {\it documents} from a corpus first and then find relevant short {\it passages} from the retrieved documents~\cite{TellexKLFM03}. Exploring the potential of such a two-stage IR in an end-to-end neural network model would be worthwhile. In particular, the work of \citeauthor{ChoiHUPLB17} \shortcite{ChoiHUPLB17} is related to the second stage of passage retrieval: it selects a few sentences from a long document (guaranteed to be relevant to a given question) and then generates the final answer from the selected sentences. \section{Conclusion} This study considered the task of \textit{machine reading at scale} (MRS) enabling QA based on a set of passages as a knowledge source. We improved IR for reading comprehension (RC). Regarding the originality of our work, we believe our study makes two main contributions. First, we proposed the \textit{Retrieve-and-Read} model, which is based on a simple and effective approach that incorporates IR and RC tasks by using supervised multi-task learning (MTL). In the conventional reinforcement approach of joint learning of IR and RC tasks~\cite{WangAAAI2018}, the IR component is indirectly trained with a distant supervision reward based on RC predictions. Our model directly minimizes the joint loss of IR and RC in order that the IR component, which shares the hidden layers with the RC component, can be also trained with correct answer spans. Next, we created a new dataset, Jp-News, by using crowdsourcing in the same way as SQuAD. Jp-News is suitable for making evaluations of IR for RC tasks, because it consists of a set of news articles that contain similar passages on the same topics and a set of clear-intent long questions. The key strength of this study is the high accuracy of our MRS system, particularly our IR component. While this study was limited to supervised learning, our MTL approach achieved state-of-the-art performance on a standard benchmark, in answering SQuAD questions using the full Wikipedia as the knowledge source. We also thoroughly evaluated the effectiveness of supervised MTL by investigating the individual contributions of our model components. The experimental results demonstrated the effectiveness of learning from answer spans in IR for RC. We believe that this finding will contribute to the development of MRS systems. Moreover, our approach can be easily applied to other state-of-the-art RC neural networks such as QANet~\cite{Yu18}. The existing RC methods could be extended into ones enabling QA from a corpus and handling questions that have no answer in the reading passage. Finally, the experimental results on our new dataset showed the capability of retrieving and reading passages in a non-English language without linguistic knowledge. Future work will involve exploring the potential of using distant supervision and enabling our model to combine disjoint pieces of textual evidence. \bibliographystyle{ACM-Reference-Format}
\section{Introduction} We study the mean square of the product of Dirichlet $L$-functions with arbitrary Dirichlet polynomials. The central problem is to obtain an asymptotic formula for \begin{align}\label{eq: intro main quantity of interest} \sideset{}{^*}\sum_{\chi (\textrm{mod}\ q)} \left|L \left( \tfrac{1}{2},\chi \right)\right|^2 \bigg|\sum_{a \leq q^\kappa} \frac{\alpha_a \chi(a)}{\sqrt{a}} \bigg|^2, \end{align} where $\sum^*$ denotes summation over all primitive characters $\chi$ modulo $q$, the coefficients $\alpha_a \ll a^\varepsilon$ are arbitrary, and $0 < \kappa < 1$. The asymptotic evaluation when $\kappa < 1/2$ was established by Iwaniec and Sarnak [\textbf{\ref{IS}}]. In this regime the main term comes from the ``diagonal'' contribution, and the off-diagonal terms contribute only to the error. In this work we obtain an asymptotic expression for \eqref{eq: intro main quantity of interest} with $\kappa$ going beyond the $\frac{1}{2}$-barrier. In this larger regime some off-diagonal terms contribute to the main term, and evaluating this contribution, as well as bounding the error terms, is considerably more difficult. Duke, Friedlander and Iwaniec [\textbf{\ref{DFI1}}] proved that the quantity in \eqref{eq: intro main quantity of interest} may be bounded by $O_\varepsilon(q^{1+\varepsilon})$ for some $\kappa > 1/2$, but their proof does not extend to give an asymptotic formula. Very recently, Conrey, Iwaniec and Soundararajan [\textbf{\ref{CIS}}] applied their asymptotic large sieve and studied \eqref{eq: intro main quantity of interest} with an additional averaging over the modulus $q$. The analogous problem to \eqref{eq: intro main quantity of interest} for the Riemann zeta-function was studied by Bettin, Chandee and Radziwi\l\l \ [\textbf{\ref{BCR}}], who broke the $\frac{1}{2}$-barrier for an arbitrary Dirichlet polynomial. Our work is inspired by their beautiful paper, but there are significant differences between the family of primitive Dirichlet $L$-functions in the $q$-aspect and the Riemann zeta-function in the $t$-aspect. These differences usually make the family of Dirichlet $L$-functions more difficult to work with. In fact, Bettin, Chandee and Radziwi\l\l \ mentioned the work of Duke, Friedlander and Iwaniec [\textbf{\ref{DFI1}}], and said: ``Our proof of Theorem 1 would not extend to give an asymptotic in this case, and additional input is needed.'' It turns out that it is more convenient to work with a more general version of \eqref{eq: intro main quantity of interest} by introducing ``shifts''. We let $\alpha,\beta \in \mathbb{C}$ satisfy $\text{Re}(\alpha),\text{Re}(\beta) \ll (\log q)^{-1}$ and, for our later application\footnote{See Lemma \ref{lemmathird}}, $\text{Im}(\alpha),\text{Im}(\beta) \ll \log q$. Furthermore, we treat the characters $\chi$ according to their parity to ensure that the $L$-functions under consideration have the same gamma factors in their functional equations. Let $\varphi^+(q)$ be the number of even primitive characters $\chi$ modulo $q$, and let $\sum^+$ denote summation over all these characters. In this work we deal exclusively with even Dirichlet characters, but our arguments go through identically for odd characters. For fixed $0 < \kappa < 1$, we study \begin{equation*} I_{\alpha,\beta}=\frac{1}{\varphi^+(q)}\ \sideset{}{^+}\sum_{\chi(\textrm{mod}\ q)} L(\tfrac 12+\alpha,\chi)L(\tfrac12+\beta,\overline{\chi})\big|A(\chi)\big|^2, \end{equation*} where \begin{align*} A(\chi) &=\sum_{a\leq q^\kappa}\frac{\alpha_a\chi(a)}{\sqrt{a}}, \end{align*} and $\alpha_a$ is an arbitrary sequence of complex numbers satisfying $\alpha_a \ll_\varepsilon a^\varepsilon$. For technical convenience we assume that $q$ is prime throughout the paper. Note that in this case, the number of primitive characters is $\varphi^*(q)=q-2$, and we have $\varphi^+(q)=(q-3)/2$. It is likely that our methods could be adapted to the case of general $q$ with more effort. The following is our main theorem. \begin{theorem}\label{mthm} Suppose that $q$ is prime. Let $\alpha,\beta \in \mathbb{C}$ satisfy \begin{align*} |\textup{Re}(\alpha)|,|\textup{Re}(\beta)| \ll (\log q)^{-1}\qquad\emph{and}\qquad|\textup{Im}(\alpha)|,|\textup{Im}(\beta)| \ll \log q. \end{align*} Suppose that $\kappa< 1/2 + 1/202$. Then \begin{align}\label{mainfml} \!\!I_{\alpha,\beta}&=\zeta(1+\alpha+\beta)\sum_{\substack{da,db\leq q^\kappa\\(a,b)=1}}\frac{\alpha_{da}\overline{\alpha_{db}}}{da^{1+\beta}b^{1+\alpha}}\nonumber\\ &\qquad+\Big(\frac{q}{\pi}\Big)^{-(\alpha+\beta)}\frac{\Gamma(\frac{1/2- \alpha}{2})\Gamma(\frac{1/2-\beta}{2})}{\Gamma(\frac{1/2+\alpha}{2})\Gamma(\frac{1/2+\beta}{2})}\zeta(1-\alpha-\beta)\sum_{\substack{da,db\leq q^\kappa\\(a,b)=1}}\frac{\alpha_{da}\overline{\alpha_{db}}}{da^{1-\alpha}b^{1-\beta}}+O(q^{-\delta_0}) \end{align} for some $\delta_0>0$. \end{theorem} The use of Theorem 2 of [\textbf{\ref{DFI2}}] and our Proposition \ref{prop2} below also suffices to break the $\frac12$-barrier. With those results, Theorem \ref{mthm} holds provided that $\kappa<1/2+1/526$. The range of $\kappa$ can be enlarged if we know more about the Dirichlet polynomial $A(\chi)$. Let $\gamma$ be a smooth function supported in $[1,2]$ such that $\gamma^{(j)}\ll_j q^\varepsilon$ for any fixed $j\geq0$. Suppose that $\alpha=\eta*\lambda$, where $\eta_{a_1},\lambda_{a_2}$ are two sequences of complex numbers supported on $[1,A_1]$ and $[1,A_2]$, respectively, with $A_1=q^{\kappa_1}$, $A_2=q^{\kappa_2}$ and $\kappa=\kappa_1+\kappa_2$, and satisfy $\eta_a,\lambda_a\ll a^\varepsilon$. Friedlander and Iwaniec [\textbf{\ref{FI}}] showed that \begin{align*} \frac{1}{\varphi^*(q)}\ \sideset{}{^*}\sum_{\chi(\text{mod}\ q)}\bigg|\sum_{n}\frac{\chi(n)}{\sqrt{n}}\gamma\Big(\frac nN\Big)\bigg|^2\big|A(\chi)\big|^2 \ll_\varepsilon q^\varepsilon+q^{-3/4+5\kappa/4+\varepsilon}\big(A_1+A_2\big)^{1/4}, \end{align*} if $N\ll q^{1/2+\varepsilon}$. When $A_1\asymp A_2$, their result gives an upper bound of $O_\varepsilon(q^\varepsilon)$ provided that $\kappa<1/2+1/22$. \begin{theorem}\label{thm2} Assume as above and suppose further that $9\kappa+\max\{\kappa_1,\kappa_2\}<5$. Then \eqref{mainfml} holds for some $\delta_0>0$. \end{theorem} If $\kappa_1=\kappa_2$, then Theorem \ref{thm2} allows us to take $\kappa<1/2+1/38$. Another case of special interest is when $\alpha=\eta*\lambda$ with $\eta_a$ being smooth coefficients up to $q^{1/2+\varepsilon}$ and $\lambda_a$ being arbitrary and as long as possible. This can be viewed as an analogue of Hough' result [\textbf{\ref{H}}; Theorem 4] (see also [\textbf{\ref{Z}}; Theorem 1.1]), which gives an asymptotic formula for the fourth moment of Dirichlet $L$-functions twisted by the square of a Dirichlet polynomial of length less than $q^{1/32}$. Suppose that \[ \eta_{a_1}=\eta\Big(\frac{a_1}{A_1}\Big), \] where $\eta$ is a smooth function supported in $[1,2]$ such that $\eta^{(j)}\ll_j q^{\varepsilon}$ for any fixed $j\geq0$. If $N,A_1\ll q^{1/2+\varepsilon}$, then Watt [\textbf{\ref{W}}] proved that \begin{align*} \frac{1}{\varphi^*(q)}\ \sideset{}{^*}\sum_{\chi(\text{mod}\ q)}\bigg|\sum_{n}\frac{\chi(n)}{\sqrt{n}}\gamma\Big(\frac nN\Big)\bigg|^2\big|A(\chi)\big|^2 \ll_\varepsilon q^\varepsilon+q^{\vartheta-1/2+\varepsilon}A_2^2, \end{align*} where $\vartheta=7/64$. This yields an upper bound of $O_\varepsilon(q^\varepsilon)$ provided that $\kappa_2<1/4-\vartheta/2$. \begin{theorem}\label{thm3} Assume as above and suppose further that $\kappa_2<1/14-\vartheta/7$ with $\vartheta=7/64$. Then \eqref{mainfml} holds for some $\delta_0>0$. \end{theorem} As an application of Theorem \ref{mthm}, we obtain the order of magnitude of the third moment of Dirichlet $L$-functions. \begin{theorem}\label{thm: third moment} Suppose that $q$ is prime. Then \begin{align}\label{eq: third moment} \frac{1}{\varphi^*(q)}\ \sideset{}{^*}\sum_{\chi(\emph{mod}\ q)} \left|L \left( \tfrac{1}{2},\chi\right) \right|^3 \asymp (\log q)^{9/4}. \end{align} \end{theorem} We remark that it is also possible to obtain upper bounds on all moments below the fourth by adapting the work of Radziwi\l\l\, and Soundararajan [\textbf{\ref{RS1}}] and Hough [\textbf{\ref{H}}]. An important application of the twisted second moment of Dirichlet $L$-functions is in regard to non-vanishing of Dirichlet $L$-functions at the central point $s=1/2$. It is widely believed that $L(1/2,\chi)\ne 0$ for all primitive characters $\chi$. At least $34\%$ of Dirichlet $L$-functions in the family of primitive characters, to a large modulus $q$, are known to not vanish at the central point [\textbf{\ref{B}}] (see also [\textbf{\ref{IS}}]). Our results here, together with the mollifier method, may be used to give a slight improvement of such a result. However, we note that in the case of large prime $q$, Khan and Ngo [\textbf{\ref{KN}}], using the ``twisted" mollifier introduced by [\textbf{\ref{S}}] and [\textbf{\ref{MV}}], have obtained a non-vanishing proportion of $3/8$. Improving that using the usual mollifier would require a mollifier with $\kappa>3/5$, which seems out of reach of the current techniques. \subsection{Comparison with the $t$-aspect analogue} We close the introduction with a brief discussion of the main differences between our work and the work of Bettin, Chandee and Radziwi\l\l's on the twisted second moment of the Riemann zeta-function [\textbf{\ref{BCR}}]. In [\textbf{\ref{BCR}}], after applying the approximate functional equation and dyadic decompositions, the main object to study is of the form \[ \frac{1}{\sqrt{ABMN}}\mathop{\sum \sum \sum\sum}_{\substack{a \asymp A, b \asymp B \\ m \asymp M, n \asymp N,MN\ll T^{1+\varepsilon}}} \alpha_a \beta_b\, \widehat{W}\Big(T\log\frac{am}{bn}\Big), \] where $W$, say, is some compactly supported smooth function satisfying $W^{(j)}\ll_j T^{\varepsilon}$ for any fixed $j\geq0$. The diagonal contribution $am=bn$ may be extracted and is fairly easy to understand. For the remaining terms, write $am-bn=r$ with $r\ne0$. The rapid decay of the Fourier transform implies that the contribution of the terms with $|r|>T^{-1+\varepsilon}\sqrt{ABMN}$ is negligible. The off-diagonal contribution is then essentially \[ \frac{1}{\sqrt{ABMN}}\sum_{0<|r|\leq T^{-1+\varepsilon}\sqrt{ABMN}}\mathop{\sum \sum \sum\sum}_{\substack{am-bn=r\\a \asymp A, b \asymp B \\ m \asymp M, n \asymp N,MN\ll T^{1+\varepsilon}}} \alpha_a \beta_b. \] In particular, this is null unless $AM\asymp BN$. Writing $am-bn=r$ as a congruence condition modulo $b$ and applying the Poisson summation formula transform the above expression to an exponential sum roughly of the form \begin{equation}\label{BCRexp} \frac{\sqrt{MN}}{\sqrt{AB}(AM+BN)}\mathop{\sum \sum}_{\substack{0<|r|\leq T^{-1+\varepsilon}\sqrt{ABMN}\\|g|\ll T^{\varepsilon}(AM+BN)/MN}}\,\mathop{\sum \sum}_{\substack{a \asymp A, b \asymp B}} \alpha_a \beta_b\,e\Big(\frac{-rg\overline{a}}{b}\Big). \end{equation} Trivially, this is bounded by $T^{-1+\varepsilon}AB\ll T^{2\kappa-1+\varepsilon}$. So any extra power saving is sufficient to break the $\frac12$-barrier. Bettin, Chandee and Radziwi\l\l\ [\textbf{\ref{BCR}}] gained this by utilizing an estimate for sums of Kloosterman fractions in [\textbf{\ref{BC}}] (or, [\textbf{\ref{DFI2}}]). In our situation, we use the approximate functional equation and apply character orthogonality, as well as dyadic decompositions, to reduce the problem to understanding sums of the form \begin{align*} \frac{1}{\sqrt{ABMN}}\mathop{\sum \sum \sum\sum}_{\substack{am \equiv\pm bn (\textrm{mod}\ q)\\a \asymp A, b \asymp B \\ m \asymp M, n \asymp N,MN\ll q^{1+\varepsilon}}} \alpha_a \beta_b. \end{align*} Diagonal main terms arise from $am = bn$. We set this contribution aside, and study the remaining terms. At this point, we can, as above, write the congruence condition modulo $q$ as $am\mp bn=qr$ with $r\ne0$, and switch to a congruence condition modulo $b$. The Poisson summation formula then leads to an exponential sum roughly of the form \begin{equation}\label{ourexp} \frac{\sqrt{MN}}{\sqrt{AB}(AM+BN)}\mathop{\sum \sum}_{\substack{0<|r|\ll q^{-1}(AM+BN)\\|g|\ll q^{\varepsilon}(AM+BN)/MN}}\,\mathop{\sum \sum}_{\substack{a \asymp A, b \asymp B}} \alpha_a \beta_b\,e\Big(\frac{-qrg\overline{a}}{b}\Big). \end{equation} The results on cancellation in sums of Kloosterman fractions [\textbf{\ref{DFI2}}, \textbf{\ref{BC}}] are still applicable, but only work in the ``balanced'' case when $AM$ and $BN$ are more or less of the same size. Roughly speaking, the $t$-aspect averaging yields the constraint $AM\asymp BN$ and ensures that $r,g\ll T^{\kappa-1/2+\varepsilon}$ in \eqref{BCRexp}. In our situation \eqref{ourexp}, we lack the condition $AM \asymp BN$, and therefore the ranges of summation of $r$ and $g$ can be as large as $q^{\kappa+\varepsilon}$. The trivial bound, which can be $O_\varepsilon(q^{2\kappa-1/2+\varepsilon})$, is worse in our case as well. So a different method is required for the ``unbalanced'' regime when $AM$ and $BN$ are of rather different sizes. Furthermore, it is impossible to ignore the contribution of these terms. This contribution is genuinely large, and, as it turns out, will cancel out with the contribution from the principal character modulo $q$. A similar phenomenon already arose in Young's work on the fourth moment of Dirichlet $L$-functions [\textbf{\ref{Y}}]. We remark that it is possible to show that $I_{\alpha,\beta}\ll_\varepsilon q^\varepsilon$ for some $\kappa > 1/2$ without considering the unbalanced case [\textbf{\ref{DFI1}}]. We begin the treatment of the unbalanced regime by applying the Poisson summation formula to introduce exponential phases. The zero frequency cancels out with the contribution from the principal character modulo $q$. We bound the contribution of the non-zero frequencies with a delicate argument involving the additive large sieve inequality. The phases of the exponentials are rational fractions, and we divide these fractions into two classes: ``good'' fractions and ``bad'' fractions. The good fractions are far apart from each other, and we can immediately apply the additive large sieve inequality to get a saving. The bad fractions can be close together, which weakens the large sieve inequality, but we still obtain a saving since there are comparatively few of these bad fractions. Lastly, we remark that with our two different methods for the two different regimes, the critical ranges of summation in \eqref{ourexp} are when $A\asymp B\asymp N\asymp q^\kappa$ and $M\asymp q^{2-3\kappa}$. This explains why the ranges of $\kappa$ for the asymptotic formula in our theorems are slightly smaller than the corresponding ranges for the upper bound. \begin{remark} \emph{Throughout the paper $\varepsilon$ denotes an arbitrarily small positive number whose value may change from one line to the next.} \end{remark} \section{Initial manipulations}\label{initial} We start by recalling the orthogonality property of characters and the approximate functional equation. \begin{lemma}[Orthogonality]\label{ortho} For $(mn,q)=1$ we have \[ \sideset{}{^+}\sum_{\chi(\emph{mod}\ q)} \chi(m)\overline{\chi}(n)=\frac 12\sum_{\substack{d|q\\d|(m\pm n)}}\mu\Big(\frac qd\Big)\varphi(d)=\frac 12\sum_{q|(m\pm n)}\varphi(q)-1. \] \end{lemma} \begin{proof} The proof is standard. See, for example, [\textbf{\ref{IS}}; (3.1) and (3.2)]. \end{proof} \begin{lemma}[Approximate functional equation]\label{fe} Let $\chi$ be an even primitive character and let $G(s)$ be an even entire function of rapid decay in any fixed strip $|\emph{Re}(s)| \leq C$ satisfying $G(0) = 1$. Let \[ X_\pm(s)=G(s)\frac{\Gamma(\frac{1/2\pm \alpha+s}{2})\Gamma(\frac{1/2\pm\beta+s}{2})}{\Gamma(\frac{1/2+\alpha}{2})\Gamma(\frac{1/2+\beta}{2})} \] and \begin{equation}\label{Vpm} V_{\pm}(x)=\frac{1}{2\pi i}\int_{(\varepsilon)}X_\pm(s)x^{-s}\frac{ds}{s}. \end{equation} Then \begin{align*} L(\tfrac 12+\alpha,\chi)L(\tfrac12+\beta,\overline{\chi})&=\sum_{m,n\geq1}\frac{\chi(m)\overline{\chi}(n)}{m^{1/2+\alpha}n^{1/2+\beta}}V_+\Big(\frac{\pi mn}{q}\Big)\\ &\qquad\qquad+\Big(\frac{q}{\pi}\Big)^{-(\alpha+\beta)}\sum_{m,n\geq1}\frac{\chi(m)\overline{\chi}(n)}{m^{1/2-\beta}n^{1/2-\alpha}}V_-\Big(\frac{\pi mn}{q}\Big). \end{align*} \end{lemma} \begin{proof} The proof is standard and can be easily derived following Theorem 5.3 of [\textbf{\ref{IK}}]. \end{proof} \begin{remark}\label{rmkV} \ \begin{itemize} \item \emph{It is convenient to prescribe certain conditions on the function $G$. To be precise, we assume $G(s)$ is invariant under the transformations $\alpha\rightarrow-\beta$, $\beta\rightarrow-\alpha$, and vanishes at $s=\pm(\alpha+\beta)/2$. An admissible choice of $G$ is $$G(s)=\frac{(\frac{\alpha+\beta}{2})^2-s^2}{(\frac{\alpha+\beta}{2})^2}\,e^{s^2},$$ but there is no need to specify a particular function $G$.} \item \emph{If $|\text{Re}(\alpha)|,|\text{Re}(\beta)|\ll (\log q)^{-1}$ and $|\text{Im}(\alpha)|,|\text{Im}(\beta)|\leq T$, then Stirling's approximation gives $$x^jV_{\pm}^{(j)}(x)\ll_{j,C} (1+|x|/T)^{-C}$$ for any fixed $j\geq0$ and $C>0$.} \end{itemize} \end{remark} From Lemma \ref{fe} and Lemma \ref{ortho} we get \begin{eqnarray*} I_{\alpha,\beta}&=&\sum_{\substack{a,b\leq q^\kappa\\m,n\geq1}}\frac{\alpha_a\overline{\alpha_b}}{\sqrt{ab}m^{1/2+\alpha}n^{1/2+\beta}}V_{+}\Big(\frac{\pi mn}{q}\Big)\frac{1}{\varphi^+(q)}\ \sideset{}{^+}\sum_{\chi(\textrm{mod}\ q)} \chi(am)\overline{\chi}(bn)\nonumber\\ &&\quad\quad+\Big(\frac{q}{\pi}\Big)^{-(\alpha+\beta)}\sum_{\substack{a,b\leq q^\kappa\\m,n\geq1}}\frac{\alpha_a\overline{\alpha_b}}{\sqrt{ab}m^{1/2-\beta}n^{1/2-\alpha}}V_{-}\Big(\frac{\pi mn}{q}\Big)\frac{1}{\varphi^+(q)}\ \sideset{}{^+}\sum_{\chi(\textrm{mod}\ q)} \chi(am)\overline{\chi}(bn)\\ &=&J_{\alpha,\beta}^{+}+\Big(\frac{q}{\pi}\Big)^{-(\alpha+\beta)}J_{-\beta,-\alpha}^{-}, \end{eqnarray*} where \begin{align*} J_{\alpha,\beta}^{+}&=\frac{\varphi(q)}{2\varphi^+(q)}\sum_{\substack{a,b\leq q^\kappa\\am\equiv \pm bn(\text{mod}\ q)\\(mn,q)=1}}\frac{\alpha_a\overline{\alpha_b}}{\sqrt{ab}m^{1/2+\alpha}n^{1/2+\beta}}V_{+}\Big(\frac{\pi mn}{q}\Big)\\ &\qquad\qquad\qquad\qquad\qquad\qquad-\frac{1}{\varphi^+(q)}\sum_{\substack{a,b\leq q^\kappa\\(mn,q)=1}}\frac{\alpha_a\overline{\alpha_b}}{\sqrt{ab}m^{1/2+\alpha}n^{1/2+\beta}}V_{+}\Big(\frac{\pi mn}{q}\Big), \end{align*} and $J^-$ is the same but with $V_-$ in place of $V_+$. Note from Remark \ref{rmkV} that the condition $(mn,q)=1$ may be omitted with the cost of an error of size $O_\varepsilon(q^{\kappa-3/2+\varepsilon})$. The same error applies when we replace $\varphi(q)$ by $q$ and $\varphi^+(q)$ by $q/2$. So, up to an error term of size $O_\varepsilon(q^{\kappa-3/2+\varepsilon})$, we have \begin{align*} J_{\alpha,\beta}^{+}&=\sum_{\substack{a,b\leq q^\kappa\\am\equiv\pm bn(\text{mod}\ q)}}\frac{\alpha_a\overline{\alpha_b}}{\sqrt{ab}m^{1/2+\alpha}n^{1/2+\beta}}V_{+}\Big(\frac{\pi mn}{q}\Big)-\frac{2}{q}\sum_{\substack{a,b\leq q^\kappa\\m,n\geq1}}\frac{\alpha_a\overline{\alpha_b}}{\sqrt{ab}m^{1/2+\alpha}n^{1/2+\beta}}V_{+}\Big(\frac{\pi mn}{q}\Big)\\ &=\mathcal{M}_{\alpha,\beta}^{+}+S_{\alpha,\beta}^{+}-\frac{2}{q}\sum_{\substack{a,b\leq q^\kappa\\m,n\geq1}}\frac{\alpha_a\overline{\alpha_b}}{\sqrt{ab}m^{1/2+\alpha}n^{1/2+\beta}}V_{+}\Big(\frac{\pi mn}{q}\Big), \end{align*} where $\mathcal{M}_{\alpha,\beta}^{+}$ and $S_{\alpha,\beta}^{+}$ are the contributions from the diagonal terms $am=bn$ and the off-diagonal terms $am\ne bn$ in the first sum, respectively. We similarly define $\mathcal{M}_{-\beta,-\alpha}^{-}$ and $S_{-\beta,-\alpha}^{-}$. Much of this paper is spent studying the off-diagonal terms $S^\pm$. We shall complete the proofs of Theorem \ref{mthm} and Theorems \ref{thm2}, \ref{thm3} in Sections \ref{smthm} and \ref{sthm2}. We just finish this section with a partial evaluation of $\mathcal{M}^{\pm}$. Replacing $a,b$ by $da,db$ with $(a,b)=1$, we see that $m=bn'$ and $n=an'$ for some $n'\in\mathbb{N}$. Hence \begin{align}\label{M+} \mathcal{M}_{\alpha,\beta}^{+}&=\sum_{\substack{da,db\leq q^\kappa\\(a,b)=1}}\frac{\alpha_{da}\overline{\alpha_{db}}}{da^{1+\beta}b^{1+\alpha}}\sum_{n\geq1}\frac{1}{n^{1+\alpha+\beta}}V_{+}\Big(\frac{\pi abn^2}{q}\Big)\nonumber\\ &=\sum_{\substack{da,db\leq q^\kappa\\(a,b)=1}}\frac{\alpha_{da}\overline{\alpha_{db}}}{da^{1+\beta}b^{1+\alpha}}\frac{1}{2\pi i}\int_{(\varepsilon)}X_+(s)\Big(\frac{q}{\pi ab}\Big)^s\zeta(1+\alpha+\beta+2s)\frac{ds}{s}, \end{align} and a similar expression holds for $\mathcal{M}^-$. \section{Main propositions} In this section we focus on the sum \[ \sum_{\substack{am\equiv\pm bn(\text{mod}\ q)\\am\ne bn}}\alpha_a\beta_b \] over dyadic intervals. Theorem \ref{mthm} is deduced from the following two propositions. The first result essentially treats the case when $m$ and $n$ are close, while the second one deals with the case when $m$ and $n$ are far apart. \begin{proposition}\label{prop1} Let $A,B,M,N\geq1$, and let $\alpha_a,\beta_b$ be two sequences of complex numbers supported on $[A,2A]$ and $[B,2B]$ satisfying $\alpha_a\ll A^\varepsilon, \beta_b\ll B^\varepsilon$. Let $W_1$ and $W_2$ be smooth functions supported in $[1,2]$ such that $W_1^{(j)},W_2^{(j)}\ll_j q^{\varepsilon}$ for any fixed $j\geq0$. Let \[ \mathcal S =\frac{1}{\sqrt{ABMN}}\sum_{\substack{am\equiv\pm bn(\emph{mod}\ q)\\am\ne bn}}\alpha_a\beta_bW_1\Big(\frac{m}{M}\Big)W_2\Big(\frac{n}{N}\Big). \] Then \begin{equation}\label{prop1-1} \mathcal{S}\ll_\varepsilon q^{-1+\varepsilon}\sqrt{ABMN}. \end{equation} If $ABMN\gg q^{2-\varepsilon}$, then \begin{equation}\label{prop1-2} \mathcal S= \mathcal M_1^++\mathcal M_1^-+\mathcal E , \end{equation} where \begin{equation}\label{mainM2} \mathcal{M}_1^\pm=\frac{1}{\sqrt{ABMN}}\sum_{\substack{d\geq 1\\r\ne0}}\sum_{(a,b)=1}\alpha_{da}\beta_{db}\int W_1\Big(\frac{bx}{M}\Big)W_2\Big(\frac{\pm(abx-qr)}{bN}\Big)dx \end{equation} and \begin{align}\label{bdE1} \mathcal{E}&\ll_\varepsilon q^{-17/20+\varepsilon}(AB)^{-3/20}(AM+BN)^{17/10}(A+B)^{1/4}(MN)^{-17/20}\nonumber\\ &\qquad\qquad +q^{-1+\varepsilon}(AB)^{-1/8}(AM+BN)^2(A+B)^{1/8}(MN)^{-1}. \end{align} \end{proposition} \begin{proof} To prove \eqref{prop1-1}, we write $am\mp bn=qr$. Then $$0< |r|\leq R=4(AM+BN)q^{-1},$$ and \begin{equation}\label{555} \mathcal{S}=\frac{1}{\sqrt{ABMN}}\sum_{0<|r|\leq R}\sum_{am\mp bn=qr}\alpha_a\beta_bW_1\Big(\frac{m}{M}\Big)W_2\Big(\frac{n}{N}\Big). \end{equation} We can take the innermost sum over all $a$ and $m$, and the sums over $b$ and $n$ being over all divisors of $(am-qr)$. So, by symmetry, \begin{equation*} \mathcal{S}\ll_\varepsilon \frac{q^\varepsilon R}{\sqrt{ABMN}}\min\{AM,BN\}\ll_\varepsilon q^{-1+\varepsilon}\sqrt{ABMN}, \end{equation*} and we obtain \eqref{prop1-1}. We next prove \eqref{prop1-2}. We proceed from \eqref{555}. Without loss of generality, assume that $AM\ll BN$ (consequently, we also have $qR\ll BN$). This simplifies the decision on which variable to eliminate. We will eliminate $n$ in this case, so we first introduce Mellin inversion to write \begin{align*} W_2\Big(\frac{n}{N}\Big)&=W_2\Big(\frac{\pm(am-qr)}{bN}\Big)\\ &=\frac{1}{(2\pi i)^4}\int_{(\varepsilon)}\int_{(\varepsilon)}\int_{(\varepsilon)}\int_{(\varepsilon)}\widehat{f_\pm}(u,v,w,z)a^{-u}b^{-v}m^{-w}r^{-z}dudvdwdz. \end{align*} Note that by integration by parts $j$ times on each variable of the expression \[ \widehat{f_\pm}(u,v,w,z)=\int_{0}^{\infty}\int_{0}^{\infty}\int_{0}^{\infty}\int_{0}^{\infty}a^{u-1}b^{v-1}m^{w-1}r^{z-1}W_2\Big(\frac{\pm(am-qr)}{bN}\Big)dadbdmdr, \] we have \begin{equation}\label{fhat} \widehat{f_\pm}(u,v,w,z)\ll_{\varepsilon,j} A^{\text{Re}(u)}B^{\text{Re}(v)}M^{\text{Re}(w)}R^{\text{Re}(z)}\Big(q^{-\varepsilon} \big(1+|u|\big)\big(1+|v|\big)\big(1+|w|\big)\big(1+|z|\big)\Big)^{-j} \end{equation} uniformly for $\text{Re}(u),\text{Re}(v),\text{Re}(w),\text{Re}(z)\geq \varepsilon$, and for any fixed $j\geq 0$. Hence we may restrict the $u,v,w,z$-integrals to \[ |u|,|v|,|w|,|z|\ll q^\varepsilon. \] Let $d=(a,b)$ (note that this implies $d|r$). We can now remove $n$ by writing $am\mp bn=qr$ as $m\equiv q(r/d)\overline{a/d}(\textrm{mod}\ b/d)$. The Poisson summation formula then yields \begin{eqnarray}\label{1} \!\!\!\!\!\sum_{\substack{m,n\\am\mp bn=qr}}m^{-w}W_1\Big(\frac{m}{M}\Big)&&=\sum_{m\equiv q(r/d)\overline{a/d}(\textrm{mod}\ b/d)}m^{-w}W_1\Big(\frac{m}{M}\Big)\nonumber\\ &&=\sum_{g\in\mathbb{Z}}e\Big(\frac{-q(r/d)g\overline{a/d}}{b/d}\Big)\int \Big(\frac{bx}{d}\Big)^{-w}W_1\Big(\frac{bx}{dM}\Big)e(gx)dx. \end{eqnarray} Note that the integral is over $x\asymp dM/B\asymp dMN/(AM+BN)$. For the term $g=0$, we fold back the Mellin inversion and get the terms $\mathcal{M}_1^\pm$ in \eqref{mainM2}. The restriction $d|r|\leq R$ may be removed due to the support of $W$. For the terms $g\ne0$, integration by parts $j$ times implies that \begin{eqnarray*} \int \Big(\frac{bx}{d}\Big)^{-w}W_1\Big(\frac{bx}{dM}\Big)e(gx)dx&\ll_j&\frac{dM^{1-\text{Re}(w)}}{B}\Big(\frac{(1+|w|)B}{gdM}\Big)^j \end{eqnarray*} for any fixed $j\geq 0$. So we may restrict the sum in \eqref{1} to $0<|g|\leq G/d$, where \[ G=\frac{ q^\varepsilon B}{M}\asymp\frac{ q^\varepsilon(AM+BN)}{MN}. \] Hence, \begin{equation}\label{contS} \mathcal{S}=\mathcal{M}_1^++\mathcal{M}_1^-+ \mathcal{E}+O_C\big(q^{-C}\big) \end{equation} with \begin{align}\label{boundE1} \mathcal{E}\ll &\frac{1}{\sqrt{ABMN}}\sum_{d\leq R}\int_{(\varepsilon)}\int_{(\varepsilon)}\int_{(\varepsilon)}\int_{(\varepsilon)}\int_{x\asymp dMN/(AM+BN)}\nonumber \\ &\qquad\qquad x^{-\text{Re}(w)}\big|\widehat{f_\pm}(u,v,w,z)\big|\big|Z_d(x)\big|dxdudvdwdz, \end{align} where \begin{equation*} Z_d(x)=d^{-(u+v+z)}\sum_{\substack{0<|r|\leq R/d\\0<|g|\leq G/d}}\sum_{(a,b)=1}a^{-u}b^{-(v+w)}r^{-z}\alpha_{da}\beta_{db}\,e\Big(\frac{-qrg\overline{a}}{b}+gx\Big)W_1\Big(\frac{bx}{M}\Big). \end{equation*} The above expression is in the form of Theorem 1 of [\textbf{\ref{BC}}]. We apply this and get \begin{align*} Z_d(x)&\ll_\varepsilon q^\varepsilon\Big(\frac{ABRG}{d^4}\Big)^{1/2}\Big(1+\frac{qRG}{AB}\Big)^{1/2}\\ &\qquad\quad\bigg(\Big(\frac{ABRG}{d^4}\Big)^{7/20}\Big(\frac Ad+\frac Bd\Big)^{1/4}+\Big(\frac{AB}{d^2}\Big)^{3/8}\Big(\frac{RG}{d^2}\Big)^{1/2}\Big(\frac Ad+\frac Bd\Big)^{1/8}\bigg)\\ & \ll_\varepsilon d^{-2}q^{-1/2+\varepsilon}\frac{(AM+BN)^2}{MN}\\ &\qquad\quad\Big(\frac{(AB)^{7/20}(AM+BN)^{7/10}(A+B)^{1/4}}{d^{33/20}(qMN)^{7/20}}+\frac{(AB)^{3/8}(AM+BN)(A+B)^{1/8}}{d^{15/8}(qMN)^{1/2}}\Big). \end{align*} Plugging this into \eqref{boundE1} and using the bound in \eqref{fhat} we obtain \eqref{bdE1}. \end{proof} \begin{proposition}\label{prop2} Assume the conditions of Proposition \ref{prop1} and that $BM\ll q^{1-\varepsilon}$, $A\ll N$, $B\gg M$. Then \[ \mathcal S= \mathcal M_2+\mathcal E , \] where \begin{equation}\label{mainM} \mathcal{M}_2=\frac{2}{\sqrt{ABMN}}\sum_{a,b}\sum_m\alpha_a\beta_bW_1\Big(\frac{m}{M}\Big)\int W_2\Big(\frac{qx}{N}\Big)dx \end{equation} and \begin{eqnarray*} \mathcal E\ll_\varepsilon \Big(\frac{q}{BM}\Big)^{-1/6+\varepsilon}+q^\varepsilon\Big(\sqrt{\frac AN}+\sqrt{\frac MB}\Big). \end{eqnarray*} \end{proposition} \begin{proof} Applying the Poisson summation formula over $n$ gives \begin{align*} \mathcal S &=\frac{1}{\sqrt{ABMN}}\sum_{a,b}\sum_{m}\alpha_a\beta_bW_1\Big(\frac{m}{M}\Big)\sum_{n\equiv\pm am\overline{b}(\text{mod}\ q)}W_2\Big(\frac{n}{N}\Big)\\ &=\frac{\sqrt{N}}{q\sqrt{ABM}}\sum_{a,b}\sum_{m}\sum_{h\in\mathbb{Z}}\alpha_a\beta_b\, e\Big(\frac{\pm ahm\overline{b}}{q}\Big)W_1\Big(\frac{m}{M}\Big)\widehat{W_2}\Big(\frac{hN}{q}\Big). \end{align*} The contribution of the term $h=0$ corresponds to the term $\mathcal{M}_2$ in \eqref{mainM}. For $h\ne0$ the rapid decay of the Fourier transform means we may restrict the sum over $h$ to $0<|h|\leq H$, where \[ H=\frac{q^{1+\varepsilon}}{N}. \] Thus we have \[ \mathcal{S}=\mathcal{M}_2+\mathcal{E}+O_C\big(q^{-C}\big), \] where \begin{align}\label{Z1} \mathcal{E}&=\frac{\sqrt{N}}{q\sqrt{ABM}}\sum_{a,b}\sum_m\sum_{0<|h|\leq H}\alpha_a\beta_b\, e\Big(\frac{\pm ahm\overline{b}}{q}\Big)W_1\Big(\frac{m}{M}\Big)\widehat{W_2}\Big(\frac{hN}{q}\Big)\nonumber\\ &=\frac{\sqrt{N}}{q\sqrt{ABM}}\sum_{l}\sum_{u\in\mathcal{U}_l}\nu_l(u)\sum_{a}\sum_{0<|h|\leq H}\alpha_a\, e\Big(\frac{\pm ahu}{q}\Big)\widehat{W_2}\Big(\frac{hN}{q}\Big). \end{align} Here \begin{equation}\label{condition}\mathcal{U}_l=\big\{0<u<q: \exists\, B/l\leq b\leq 2B/l,\, M/l\leq m\leq 2M/l,\, (b,m)=1,\,m\overline{b}\equiv u(\text{mod}\ q)\big\}\end{equation} and $$\nu_l(u)=\sum_{\substack{m\overline{b}\equiv u(\text{mod}\ q)\\(b,m)=1}}\beta_{lb}W_1\Big(\frac{lm}{M}\Big).$$ Note that if \begin{equation*}(b_1,m_1)=(b_2,m_2)=1\qquad \text{and}\qquad m_1\overline{b_1}\equiv m_2\overline{b_2}\equiv u(\text{mod}\ q), \end{equation*} then $b_1m_2\equiv b_2m_1(\text{mod}\ q)$. Since $BM\ll q^{1-\varepsilon}$, it follows that $b_1m_2=b_2m_1$, and hence $b_1=b_2$ and $m_1=m_2$. So given $u\in\mathcal{U}_l$, the existence of the pair $(b,m)$ in \eqref{condition} is unique. In particular we get \begin{equation}\label{bdU} \#\,\mathcal{U}_l\ll \frac{BM}{l^2}\qquad\text{and}\qquad \nu_l(u)\ll_\varepsilon q^\varepsilon. \end{equation} Given $0<X<q$, we call a pair $(u_1,u_2)$ ``$(l,X)$-bad'' if $u_1,u_2\in\mathcal{U}_l$ and \begin{align*} u_1- u_2\equiv s(\text{mod}\ q) \end{align*} with $0<|s|\leq X$. Define $\mathcal{U}_l^{\text{bad}}\subset \mathcal{U}_l$ to be the set consisting of all $u$'s which belong to at least one such pair, and set $\mathcal{U}_l^\text{good}=\mathcal{U}_l\backslash\mathcal{U}_l^\text{bad}.$ Let \begin{align*} Y_l=\#\big\{B/l\leq b_1,b_2\leq 2B/l,&\,M/l\leq m_1,m_2\leq 2M/l,\,0<|s|\leq X:\\ &(b_1,m_1)=(b_2,m_2)=1\ \text{and}\ m_1\overline{b_1}- m_2\overline{b_2}\equiv s(\text{mod}\ q)\big\}. \end{align*} We have \begin{align*} m_1\overline{b_1}- m_2\overline{b_2}\equiv s(\text{mod}\ q) &\Longleftrightarrow sb_1b_2+ b_1m_2-b_2m_1 \equiv 0(\text{mod}\ q)\\ &\Longleftrightarrow (sb_1-m_1)(sb_2+m_2)\equiv -m_1m_2(\text{mod}\ q). \end{align*} The facts that given $m_1, m_2$ and the product $(sb_1-m_1)(sb_2+m_2)$, the number of triples $(b_1,b_2,s)$ is $\ll_\varepsilon q^\varepsilon$, and that $(sb_1-m_1)(sb_2+m_2)\ll X^2(B/l)^2$ lead to \begin{align*} Y_l&\ll_\varepsilon q^\varepsilon \Big(\frac Ml\Big)^2\Big(1+\frac{X^2B^2}{l^2q}\Big)\ll_\varepsilon q^\varepsilon\Big(\frac{M^2}{l^2}+\frac{X^2B^2M^2}{l^4q}\Big). \end{align*} The same bound, hence, applies to $\#\,\mathcal{U}_l^\text{bad}$, and so \begin{equation}\label{bdU1} \sum_{u\in\mathcal{U}_l^\text{bad}}|\nu_l(u)|^2\ll_\varepsilon q^\varepsilon\Big(\frac{M^2}{l^2}+\frac{X^2B^2M^2}{l^4q}\Big). \end{equation} We write \eqref{Z1} as \[ \mathcal{E}=\frac{\sqrt{N}}{q\sqrt{ABM}}\bigg(\sum_l\sum_{u\in\mathcal{U}_l^\text{bad}}+\sum_l\sum_{u\in\mathcal{U}_l^\text{good}}\bigg)=\frac{\sqrt{N}}{q\sqrt{ABM}}\big(Z_\text{bad}+Z_\text{good}\big), \] say. For $Z_\text{bad}$, we apply Cauchy's inequality, \eqref{bdU1} and the additive large sieve inequality (see [\textbf{\ref{mont}}; Corollary 2.2] or [\textbf{\ref{IK}}; Theorem 7.7]), obtaining \begin{align}\label{bdZ1} Z_\text{bad}&\ll\sum_l\sum_{u\in\mathcal{U}_l^\text{bad}}|\nu_l(u)|\bigg|\sum_{a}\sum_{0<|h|\leq H}\alpha_a\, e\Big(\frac{\pm ahu}{q}\Big)\widehat{W_2}\Big(\frac{hN}{q}\Big)\bigg|\nonumber\\ &\ll\sum_l\bigg(\sum_{u\in\mathcal{U}_l^\text{bad}}|\nu_l(u)|^2\bigg)^{1/2}\bigg(\sum_{u\in\mathcal{U}_l^\text{bad}}\bigg|\sum_{a}\sum_{0<|h|\leq H}\alpha_a\, e\Big(\frac{\pm ahu}{q}\Big)\widehat{W_2}\Big(\frac{hN}{q}\Big)\bigg|^2\bigg)^{1/2}\nonumber\\ &\ll_\varepsilon q^\varepsilon\sum_l \Big(\frac Ml+\frac{XBM}{l^2q^{1/2}}\Big)\Big(\big(q+AH\big)AH\Big)^{1/2}\ll_\varepsilon q^{1+\varepsilon} \big(M+q^{-1/2}XBM\big)\sqrt{\frac AN}. \end{align} For $Z_\text{good}$, by Cauchy's inequality and \eqref{bdU} we get \begin{align*} Z_\text{good}&\ll \sum_l\bigg(\sum_{u\in\mathcal{U}_l}|\nu_l(u)|^2\bigg)^{1/2}\bigg(\sum_{u\in\mathcal{U}_l^\text{good}}\bigg|\sum_{a}\sum_{0<|h|\leq H}\alpha_a\, e\Big(\frac{\pm ahu}{q}\Big)\widehat{W_2}\Big(\frac{hN}{q}\Big)\bigg|^2\bigg)^{1/2}\\ &\ll_\varepsilon q^\varepsilon\sum_l \frac{(BM)^{1/2}}{l}\bigg(\sum_{u\in\mathcal{U}_l^\text{good}}\bigg|\sum_{a}\sum_{0<|h|\leq H}\alpha_a\, e\Big(\frac{\pm ahu}{q}\Big)\widehat{W_2}\Big(\frac{hN}{q}\Big)\bigg|^2\bigg)^{1/2}. \end{align*} Note that for every $u_1,u_2\in\mathcal{U}_l^\text{good}$ we have $\|u_1/q-u_2/q\|>X/q$, where $\| \xi \|$ denotes the distance from $\xi \in \mathbb{R}$ to the nearest integer. Another application of the large sieve inequality yields \begin{equation}\label{bdZ2} Z_\text{good}\ll_\varepsilon q^\varepsilon \sum_l \frac{(BM)^{1/2}}{l}\Big(\big(q/X+AH\big)AH\Big)^{1/2}\ll_\varepsilon q^{1+\varepsilon} \Big((BM)^{1/2}X^{-1/2}+\frac{\sqrt{ABM}}{\sqrt{N}}\Big)\sqrt{\frac AN}. \end{equation} Combining \eqref{bdZ1}, \eqref{bdZ2} and choosing $X=(q/BM)^{1/3}$ we obtain \[ \mathcal{E}\ll_\varepsilon \Big(\frac{q}{BM}\Big)^{-1/6+\varepsilon}+q^\varepsilon\Big(\sqrt{\frac AN}+\sqrt{\frac MB}\Big), \] and the result follows. \end{proof} For Theorem \ref{thm2} we need the following proposition instead of Proposition \ref{prop1}. \begin{proposition}\label{prop3} Assume the conditions of Proposition \ref{prop1} and that $ABMN\gg q^{2-\varepsilon}$, $AM\ll BN$. Assume also that $\alpha=\eta*\lambda$, where the sequences $\eta_{a_1}$ and $\lambda_{a_2}$ are supported on the intervals $[A_1,2A_1]$ and $[A_2,2A_2]$ with $A=A_1A_2$, and satisfy $\eta_a,\lambda_a\ll a^\varepsilon$. Then \begin{equation*} \mathcal S= \mathcal M_1^++\mathcal M_1^-+\mathcal E , \end{equation*} where $\mathcal{M}_1^\pm$ are defined as in \eqref{mainM2} and \begin{align*} \mathcal{E}&\ll_\varepsilon q^{-1+\varepsilon}A^{1/4}B^{1/2}(AM+BN)(MN)^{-1/2}\\ &\qquad\qquad +q^{-3/4+\varepsilon}A^{1/4}B^{1/2}(AM+BN)^{1/2}(MN)^{-1/4}(A_1+A_2)^{1/4}. \end{align*} \end{proposition} \begin{proof} With $ABMN\gg q^{2-\varepsilon}$ and $AM\ll BN$, we recall from \eqref{contS} that \begin{equation*} \mathcal{S}=\mathcal{M}_1^++\mathcal{M}_1^-+ \mathcal{E}+O_C\big(q^{-C}\big) \end{equation*} with \begin{align}\label{E3} \mathcal{E}\ll &\frac{1}{\sqrt{ABMN}}\sum_{d\leq R}\int_{(\varepsilon)}\int_{(\varepsilon)}\int_{(\varepsilon)}\int_{(\varepsilon)}\int_{x\asymp dMN/(AM+BN)}\nonumber\\ &\qquad\qquad x^{-\text{Re}(w)}\big|\widehat{f_\pm}(u,v,w,z)\big|\big|Z_d(x)\big|dxdudvdwdz, \end{align} where \begin{equation*} Z_d(x)=d^{w-z}\sum_{\substack{0<|r|\leq R/d\\0<|g|\leq G/d}}\sum_{(a,b)=d}a^{-u}b^{-(v+w)}r^{-z}\alpha_{a}\beta_{b}\,e\Big(\frac{-qrg\overline{a/d}}{b/d}+gx\Big)W_1\Big(\frac{bx}{dM}\Big). \end{equation*} Using the fact that $\alpha=\eta*\lambda$ we can write \begin{align*} Z_d(x)&=d^{-(u+v+z)}\sum_{d=d_1d_2}\\ &\qquad\ \sum_{\substack{0<|r|\leq R/d\\0<|g|\leq G/d}}\sum_{\substack{a_1,a_2,b\\(a_1a_2,b)=1\\(a_1,d_2)=1}}(a_1a_2)^{-u}b^{-(v+w)}r^{-z}\eta_{d_1a_1}\lambda_{d_2a_2}\beta_{db}\,e\Big(\frac{-qrg\overline{a_1a_2}}{b}+gx\Big)W_1\Big(\frac{bx}{M}\Big). \end{align*} Applying Lemma 6 of [\textbf{\ref{H-BJ}}], which is essentially the same as the result of [\textbf{\ref{FI}}], to the above expression with \[ U\leftrightarrow \frac Bd,\qquad K\leftrightarrow \frac{RG}{d^2}\asymp\frac{ q^\varepsilon (AM+BN)^2}{d^2qMN},\qquad S\leftrightarrow \frac{A_1}{d_1}\qquad \text{and}\qquad T\leftrightarrow \frac{A_2}{d_2} \] leads to \begin{align*} Z_d(x)&\ll_\varepsilon q^\varepsilon \sum_{d=d_1d_2}U(KST)^{3/4}\big(K^{1/4}+S^{1/4}+T^{1/4}\big)\\ &\ll_\varepsilon d^{-13/4}q^{-3/4+\varepsilon} \sum_{d=d_1d_2}\frac{ A^{3/4}B(AM+BN)^{3/2}}{(MN)^{3/4}}\Big(\frac{(AM+BN)^{1/2}}{d^{1/2}(qMN)^{1/4}}+\frac{A_1^{1/4}}{d_{1}^{1/4}}+\frac{A_2^{1/4}}{d_{2}^{1/4}}\Big). \end{align*} Plugging this into \eqref{E3} we obtain the proposition. \end{proof} The following proposition is required for Theorem \ref{thm3}. \begin{proposition}\label{prop4} Assume the conditions of Proposition \ref{prop3}. Also assume that $\alpha=\eta*\lambda$, $\beta=\nu*\xi$, where the sequences $\eta_{a_1},\lambda_{a_2},\nu_{b_1}, \xi_{b_2}$ are supported on the intervals $[A_1,2A_1],[A_2,2A_2],[B_1,2B_1]$ and $[B_2,2B_2]$ with $A=A_1A_2$, $B=B_1B_2 , and satisfy $\eta_a,\lambda_a\ll a^\varepsilon$, $\nu_b,\xi_b\ll b^\varepsilon$. Suppose further that \[ \eta_{a_1}=\eta\Big(\frac{a_1}{A_1}\Big)\qquad\text{and}\qquad \nu_{b_1}=\nu\Big(\frac{b_1}{B_1}\Big), \] where $\eta$ and $\nu$ are smooth functions supported in $[1,2]$ such that $\eta^{(j)},\nu^{(j)}\ll_j q^{\varepsilon}$ for any fixed $j\geq0$. Then \begin{equation*} \mathcal S= \mathcal M_1^++\mathcal M_1^-+\mathcal E , \end{equation*} where $\mathcal{M}_1^\pm$ are defined as in \eqref{mainM2} and \begin{align*} \mathcal{E}\ll_\varepsilon&\, q^{\vartheta-1/2+\varepsilon}(AB)^{-3/4}(AM+BN)^{3/2}(MN)^{-3/4}\\ &\qquad\qquad\Big(A_2B_2+\frac{(AM+BN)^2}{qMN}\Big)^{1/2}\Big(A_2B_2+\frac{B}{A_1}\Big)^{1/2} \end{align*} with $\vartheta=7/64$. \end{proposition} \begin{proof} We proceed from \eqref{contS}, \begin{equation*} \mathcal{S}=\mathcal{M}_1^++\mathcal{M}_1^-+ \mathcal{E}+O_C\big(q^{-C}\big) \end{equation*} with \begin{align}\label{E4} \mathcal{E}\ll &\frac{1}{\sqrt{ABMN}}\sum_{d\leq R}\int_{(\varepsilon)}\int_{(\varepsilon)}\int_{(\varepsilon)}\int_{(\varepsilon)}\int_{x\asymp dMN/(AM+BN)}\nonumber\\ &\qquad\qquad x^{-\text{Re}(w)}\big|\widehat{f_\pm}(u,v,w,z)\big|\big|Z_d(x)\big|dxdudvdwdz, \end{align} where \begin{equation*} Z_d(x)=d^{w-z}\sum_{\substack{0<|r|\leq R/d\\0<|g|\leq G/d}}\sum_{(a,b)=d}a^{-u}b^{-(v+w)}r^{-z}\alpha_{a}\beta_{b}\,e\Big(\frac{-qrg\overline{a/d}}{b/d}+gx\Big)W_1\Big(\frac{bx}{dM}\Big). \end{equation*} Since $\alpha=\eta*\lambda$ and $\beta=\nu*\xi$, we get \begin{align*} Z_d(x)&=d^{-(u+v+z)}\sum_{d=d_1d_2=d_3d_4}\sum_{\substack{0<|r|\leq R/d\\0<|g|\leq G/d}}\sum_{\substack{a_1,a_2,b_1,b_2\\(a_1a_2,b_1b_2)=1\\(d_1,a_2)=(d_3,b_2)=1}}(a_1a_2)^{-u}(b_1b_2)^{-(v+w)}r^{-z}\\ &\qquad\qquad \eta\Big(\frac{d_1a_1}{A_1}\Big)\nu\Big(\frac{d_3b_1}{B_1}\Big)\lambda_{d_2a_2}\xi_{d_4b_2}\,e\Big(\frac{-qrg\overline{a_1a_2}}{b_1b_2}+gx\Big)W_1\Big(\frac{b_1b_2x}{M}\Big). \end{align*} Note that if we apply Weil's bound on the sum over $a_1$ here, we would obtain a slightly weaker result. Instead we apply the Poisson summation formula over $a_1$ and obtain \begin{align*} &\sum_{(a_1,b_1b_2)=1}a_1^{-u}\,\eta\Big(\frac{d_1a_1}{A_1}\Big)e\Big(\frac{-qrg\overline{a_1a_2}}{b_1b_2}\Big)={\sum_{x(\text{mod}\ b_1b_2)}}^{\!\!\!\!\!\!\!\!\!*}\ \ e\Big(\frac{-qrg\overline{xa_2}}{b_1b_2}\Big)\sum_{a_1\equiv x(\text{mod}\ b_1b_2)}a_1^{-u}\,\eta\Big(\frac{d_1a_1}{A_1}\Big)\\ &\qquad\qquad=\sum_{k\in\mathbb{Z}}S(qrg\overline{a_2},k;b_1b_2)\int (b_1b_2y)^{-u}\,\eta\Big(\frac{d_1b_1b_2y}{A_1}\Big)e(ky)dy. \end{align*} The integral is over $y\asymp d_2A_1/B$, and as before we may restrict the sum to $|k|\leq K$, where \[ K=\frac{q^\varepsilon B}{d_2A_1}. \] Since $|S(qrg\overline{a_2},0;b_1b_2)|\leq (qrg,b_1b_2)$, the contribution of the term $k=0$ to $Z_d(x)$ is \begin{align*} &\ll_\varepsilon \frac{q^\varepsilon A_1}{B} \sum_{d=d_1d_2=d_3d_4}\sum_{\substack{0<|r|\leq R/d\\0<|g|\leq G/d}}\sum_{\substack{a_2,b_1,b_2\\(a_2,b_1b_2)=1\\(d_1,a_2)=(d_3,b_2)=1}} \Big|\nu\Big(\frac{d_3b_1}{B_1}\Big)\lambda_{d_2a_2}\xi_{d_4b_2}\Big|(rg,b_1b_2)d_2\\ &\ll_\varepsilon d^{-3}q^\varepsilon ARG\ll_\varepsilon d^{-3}q^{-1+\varepsilon}\frac{A(AM+BN)^2}{MN}. \end{align*} Hence \begin{equation}\label{Zd4} Z_d(x)\ll_\varepsilon q^\varepsilon \sum_{d=d_1d_2=d_3d_4}\int_{y\asymp d_2A_1/B}y^{-\text{Re}(u)}|R(y)|dy+d^{-3}q^{-1+\varepsilon}\frac{A(AM+BN)^2}{MN}, \end{equation} where \begin{align}\label{Ry} R(y)&=\sum_{\substack{0<|r|\leq R/d\\0<|g|\leq G/d}}\sum_{\substack{a_2,b_1,b_2\\(a_2,b_1b_2)=1\\(d_1,a_2)=(d_3,b_2)=1}}\sum_{0< |k|\leq K}S(qrg\overline{a_2},k;b_1b_2)\\ &\qquad \qquad a_2^{-u}(b_1b_2)^{-(u+v+w)}r^{-z}\nu\Big(\frac{d_3b_1}{B_1}\Big)\lambda_{d_2a_2}\xi_{d_4b_2}W_1\Big(\frac{b_1b_2x}{M}\Big)\eta\Big(\frac{d_1b_1b_2y}{A_1}\Big)e(gx+ky).\nonumber \end{align} We now use the following result, which is a special case of Lemma 4.1 of Watt [\textbf{\ref{W}}]. \begin{lemma} Let $1\leq N, R,S,U,W<q$, $Z\in\mathbb{R}$ and let $\alpha_r,\beta_s,\gamma_u$ be three sequences of complex numbers supported on $[R,2R], [S,2S]$ and $[1,U]$, and satisfy $\alpha_r\ll R^\varepsilon,\beta_s\ll S^\varepsilon,\gamma_u\ll U^\varepsilon$. For any $r\in[R,2R]$ and $s\in[S,2S]$, suppose that $F_{r,s}$ is a five times continuously differentiable function supported in $[1,2]$ such that $F_{r,s}^{(j)}\ll_j q^\varepsilon$ for any $0\leq j\leq 5$. Then \begin{align*} &\sum_{(r,s)=1}\sum_{\substack{0<u\leq U\\0<w\leq W}}\sum_{n}\alpha_r\beta_s\gamma_u e(Zw)F_{r,s}\Big(\frac{n}{N}\Big)S(qu\overline{r},w;ns)\\ &\qquad\qquad\ll_\varepsilon q^\vartheta\big(1+ZW\big)NS\sqrt{RUW}\big(RS+U\big)^{1/2}\big(RS+W\big)^{1/2}\big(X^{2\vartheta}+X^{-3/2}\big), \end{align*} where $\vartheta=7/64$ and \[ X=\frac{NS\sqrt{R}}{\sqrt{qUW}}. \] \end{lemma} Separating the variables $b_1$, $b_2$ in $W_1$ and $\eta$ in \eqref{Ry} using their Mellin transforms, and then applying the above lemma with \[ R\leftrightarrow \frac{A_2}{d_2},\qquad S\leftrightarrow \frac{B_2}{d_4},\qquad U\leftrightarrow \frac{RG}{d^2}\asymp\frac{ q^\varepsilon (AM+BN)^2}{d^2qMN},\qquad W\leftrightarrow K\asymp \frac{q^\varepsilon B}{d_2A_1}, \] \[ N\leftrightarrow \frac{B_1}{d_3},\qquad Z\leftrightarrow \frac{d_2A_1}{B} \qquad \text{and}\qquad X\leftrightarrow \frac{\sqrt{ABMN}}{AM+BN}\ (\ll 1), \] we get \begin{align*} R(y)&\ll_\varepsilon q^{\vartheta+\varepsilon}\frac{B}{d}\sqrt{\frac{(AM+BN)^2A_2B}{d^2d_2^2qA_1MN}}\Big(\frac{A_2B_2}{d_2d_4}+\frac{(AM+BN)^2}{d^2qMN}\Big)^{1/2}\\ &\qquad\qquad\Big(\frac{A_2B_2}{d_2d_4}+\frac{B}{d_2A_1}\Big)^{1/2}\frac{(AM+BN)^{3/2}}{(ABMN)^{3/4}}\\ &\ll_\varepsilon d^{-2}q^{\vartheta-1/2+\varepsilon}\frac{B}{d_2A_1}\frac{(AM+BN)^{5/2}}{(AB)^{1/4}(MN)^{5/4}}\\ &\qquad\qquad\Big(\frac{A_2B_2}{d_2d_4}+\frac{(AM+BN)^2}{d^2qMN}\Big)^{1/2}\Big(\frac{A_2B_2}{d_2d_4}+\frac{B}{d_2A_1}\Big)^{1/2}. \end{align*} Plugging this into \eqref{Zd4} yields \begin{align*} Z_d(x)&\ll_\varepsilon d^{-2}q^{\vartheta-1/2+\varepsilon}\frac{(AM+BN)^{5/2}}{(AB)^{1/4}(MN)^{5/4}}\Big(A_2B_2+\frac{(AM+BN)^2}{d^2qMN}\Big)^{1/2}\Big(A_2B_2+\frac{B}{A_1}\Big)^{1/2}\nonumber\\ &\qquad\qquad+d^{-3}q^{-1+\varepsilon}\frac{A(AM+BN)^2}{MN}, \end{align*} and hence \begin{align*} \mathcal{E}&\ll_\varepsilon q^{\vartheta-1/2+\varepsilon}\frac{(AM+BN)^{3/2}}{(AB)^{3/4}(MN)^{3/4}}\Big(A_2B_2+\frac{(AM+BN)^2}{qMN}\Big)^{1/2}\Big(A_2B_2+\frac{B}{A_1}\Big)^{1/2}. \end{align*} This completes the proof of the proposition. \end{proof} \section{Proof of Theorem \ref{mthm}}\label{smthm} We proceed from \eqref{M+} and start the evaluation of the off-diagonal terms, $S_{\alpha,\beta}^{+}$. We assume that the sequences $\alpha_a,\beta_b$ are supported on $[A,2A]$ and $[B,2B]$. We remark that our main term analysis is inspired by the nice papers of Young [\textbf{\ref{Y}}] and Zacharias [\textbf{\ref{Z}}]. \subsection{Partition into dyadic intervals} We first apply a dyadic partition of unity to the sums over $m$ and $n$. Let $W$ be a smooth non-negative function supported in $[1, 2]$ such that $$ \sum_{M} W \Big ( \frac{x}{M} \Big ) = 1, $$ where $M$ runs over a sequence of real numbers with $\#\{M: X^{-1}\leq M\leq X\}\ll \log X$. With this partition of unity, we write \begin{align*} S_{\alpha,\beta}^{+}=\sum_{M,N} S_{\alpha,\beta}^{+}(M,N), \end{align*} where \begin{align*} S_{\alpha,\beta}^{+}(M,N)=\sum_{\substack{am\equiv\pm bn(\text{mod}\ q)\\am\ne bn}}\frac{\alpha_a\beta_b}{\sqrt{ab}m^{1/2+\alpha}n^{1/2+\beta}}\,W\Big ( \frac{m}{M} \Big )W \Big ( \frac{n}{N} \Big )V_{+}\Big(\frac{\pi mn}{q}\Big). \end{align*} Due to the rapid decay of $V_+$ in Remark \ref{rmkV}, we may assume that $MN\ll q^{1+\varepsilon}$. Separating the variables $m$ and $n$ in $V_+$ using \eqref{Vpm}, we have \begin{equation}\label{mainexS} S_{\alpha,\beta}^{+}(M,N)=\frac{1}{2\pi i}\int_{(\varepsilon)}X_+(s)\Big(\frac q\pi\Big)^s\sum_{\substack{am\equiv\pm bn(\text{mod}\ q)\\am\ne bn}}\frac{\alpha_a\beta_b}{\sqrt{ab}m^{1/2+\alpha+s}n^{1/2+\beta+s}}W\Big ( \frac{m}{M} \Big )W \Big ( \frac{n}{N} \Big )\frac{ds}{s}. \end{equation} We now apply Propositions \ref{prop1} and \ref{prop2} to the above sum: given some small $\delta_0>0$, let \begin{align*} &\mathcal{A}_1=\big\{(M,N): ABMN\ll q^{2-2\delta_0}\big\},\\ &\mathcal{A}_{2,<}=\big\{(M,N): ABMN\gg q^{2-2\delta_0},BM\ll q^{1-6\delta_0+\varepsilon},A\ll q^{-2\delta_0}N,B\gg q^{2\delta_0}M\big\},\\ &\mathcal{A}_{2,>}=\big\{(M,N): ABMN\gg q^{2-2\delta_0},AN\ll q^{1-6\delta_0+\varepsilon},A\gg q^{2\delta_0}N,B\ll q^{-2\delta_0}M\big\},\\ &\mathcal{A}_3=\big\{(M,N): MN\ll q^{1+\varepsilon}\big\}\backslash\big(\mathcal{A}_1\cup \mathcal{A}_{2,<}\cup \mathcal{A}_{2,>}\big). \end{align*} If $(M,N)\in\mathcal{A}_1$ we apply \eqref{prop1-1} of Proposition \ref{prop1}; if $(M,N)\in\mathcal{A}_{2,<}\cup \mathcal{A}_{2,>}$ we apply Proposition \ref{prop2}; and in the remaining case we apply \eqref{prop1-2} of Proposition \ref{prop1}. Then we obtain \begin{align*} S_{\alpha,\beta}^{+}(M,N)&=\mathds{1}_{(M,N)\in\mathcal{A}_3}\big(\mathcal{M}_1^+(M,N)+\mathcal{M}_1^-(M,N)\big)\\ &\qquad\qquad+\mathds{1}_{(M,N)\in\mathcal{A}_{2,<}}\mathcal{M}_{2,<}(M,N)+\mathds{1}_{(M,N)\in \mathcal{A}_{2,>}}\mathcal{M}_{2,>}(M,N)+\mathcal{E}(M,N) \end{align*} with obvious meaning. More work on the secondary main terms $\mathcal{M}_1^\pm(M,N)$ and $\mathcal{M}_{2,\gtrless}(M,N)$ is required before we can make any use of them. We shall do that in subsections \ref{secondarymt} and \ref{secondarymt2} after showing in the next subsection that the error term $\mathcal{E}(M,N)$ is acceptable. \subsection{The error term $\mathcal{E}(M,N)$}\label{errorterm} Without loss of generality, we may assume that $M\ll N$. From \eqref{prop1-1} of Proposition \ref{prop1} and Proposition \ref{prop2}, the error term is $O_\varepsilon(q^{-\delta_0+\varepsilon})$ if $ABMN\ll q^{2-2\delta_0}$, or if \begin{equation}\label{cond2} BM\ll q^{1-6\delta_0+\varepsilon}, \qquad A\ll q^{-2\delta_0}N\qquad\text{and}\qquad B\gg q^{2\delta_0}M. \end{equation} We now consider the remaining case $(M,N)\in\mathcal{A}_3$. Note that if $N\gg q^{\kappa+6\delta_0}$, then $M\ll_\varepsilon q^{1-\kappa-6\delta_0+\varepsilon}$, and all the conditions in \eqref{cond2} are satisfied. So we may assume that $N\ll q^{\kappa+6\delta_0}$. In that case, provided that $\kappa<6/11$ (which we subsequently assume), the first term in \eqref{bdE1} in Proposition \ref{prop1} dominates the second term, i.e. \begin{align*} \mathcal{E}(M,N)&\ll_\varepsilon q^{-17/20+\varepsilon}(AB)^{-3/20}(AM+BN)^{17/10}(A+B)^{1/4}(MN)^{-17/20}\\ &\ll _\varepsilon q^{-17/20+\varepsilon}\big(A/B\big)^{3/20}A^{33/20}+q^{-17/20+\varepsilon}A^{31/20}B^{1/10}\\ &\quad +q^{-17/20+\varepsilon}A^{1/10}B^{31/20}\big(N/M)^{17/20}+q^{-17/20+\varepsilon}\big(B/A\big)^{3/20}B^{33/20}\big(N/M)^{17/20}. \end{align*} We divide into two cases:\\ Case 1: $BM\gg q^{1-6\delta_0+\varepsilon}$ or $B\ll q^{2\delta_0}M$. Then $M\gg q^{1-\kappa-6\delta_0}$, and so $1\leq N/M\ll q^{2\kappa+12\delta_0-1+\varepsilon}$. Note that as $ABMN\gg q^{2-2\delta_0}$, it follows that $q^{1-2\kappa-2\delta_0-\varepsilon}\ll A/B\ll q^{2\kappa+2\delta_0-1+\varepsilon}$, and hence \begin{align*} \mathcal{E}(M,N)&\ll _\varepsilon q^{-17/20+3(2\kappa+2\delta_0-1)/20+33\kappa/20+17(2\kappa+12\delta_0-1)/20+\varepsilon}=q^{-37/20+73\kappa/20+21\delta_0/2+\varepsilon}; \end{align*} Case 2: $A\gg q^{-2\delta_0}N$. As $M\gg q^{2-2\delta_0}/ABN$ we have \begin{align*} \mathcal{E}(M,N)&\ll _\varepsilon q^{-17/20+3(2\kappa+2\delta_0-1)/20+33\kappa/20+\varepsilon}+q^{-51/20+17\delta_0/10+\varepsilon}A^{19/20}B^{12/5}N^{17/10}\\ &\qquad\qquad+q^{-51/20+17\delta_0/10+\varepsilon}A^{7/10}B^{53/20}N^{17/10}\\ &\ll_\varepsilon q^{-1+39\kappa/20+3\delta_0/10+\varepsilon}+q^{-51/20+101\kappa/20+51\delta_0/10+\varepsilon}. \end{align*} Summing up we obtain \[ \mathcal{E}(M,N)\ll_\varepsilon q^{-\delta_0+\varepsilon}+q^{-37/20+73\kappa/20+21\delta_0/2+\varepsilon}+q^{-1+39\kappa/20+3\delta_0/10+\varepsilon}+q^{-51/20+101\kappa/20+51\delta_0/10+\varepsilon}, \] provided that $\kappa<6/11$. We hence conclude that $\mathcal{E}(M,N)\ll_\varepsilon q^{-\delta_0+\varepsilon}$ for some $\delta_0>0$ if $\kappa<51/101$. \subsection{The secondary main terms $\mathcal{M}_1^\pm(M,N)$}\label{secondarymt} For $(M,N)\in\mathcal{A}_3$, from \eqref{prop1-2} of Proposition \ref{prop1} we have \begin{align*} \mathcal{M}_1^+(M,N)&=\sum_{r\ne0}\sum_{\substack{d\\(a,b)=1}}\frac{\alpha_{da}\beta_{db}}{d\sqrt{ab}}\frac{1}{2\pi i}\int_{(\varepsilon)} X_+(s)\Big(\frac q\pi\Big)^s\\ &\qquad \int(bx)^{-(1/2+\alpha+s)}\big(ax-qr/b\big)^{-(1/2+\beta+s)}\,W\Big ( \frac{bx}{M} \Big )W \Big ( \frac{abx-qr}{bN} \Big )dx\frac{ds}{s} \end{align*} and \begin{align*} \mathcal{M}_1^-(M,N)&=\sum_{r\ne0}\sum_{\substack{d\\(a,b)=1}}\frac{\alpha_{da}\beta_{db}}{d\sqrt{ab}}\frac{1}{2\pi i}\int_{(\varepsilon)} X_+(s)\Big(\frac q\pi\Big)^s\\ &\qquad \int(bx)^{-(1/2+\alpha+s)}\big(qr/b-ax\big)^{-(1/2+\beta+s)}\,W\Big ( \frac{bx}{M} \Big )W \Big ( \frac{qr-abx}{bN} \Big )dx\frac{ds}{s}. \end{align*} Writing $W$ in terms of its Mellin transform we get \begin{align*} &\mathcal{M}_1^+(M,N)=\frac{1}{(2\pi i)^3}\int_{(\varepsilon)}\int_{(c_2)}\int_{(c_1)} X_+(s)\widetilde{W}(u)\widetilde{W}(v)\Big(\frac q\pi\Big)^sM^uN^v\\ &\qquad\quad \sum_{r\ne0}\sum_{\substack{d\\(a,b)=1}}\frac{\alpha_{da}\beta_{db}}{da^{1+\beta+s+v}b^{1+\alpha+s+u}}\int x^{-(1/2+\alpha+s+u)}\big(x-qr/ab\big)^{-(1/2+\beta+s+v)}\,dxdudv\frac{ds}{s}. \end{align*} Note that if $r>0$ then the integral over $x$ is restricted to $x>qr/ab$, and if $r<0$ then it is restricted to $x>0$. For absolute convergence, we also need to impose the conditions \begin{equation}\label{contour1}\begin{cases} \text{Re}(\alpha+\beta+2s+u+v)>0,\ \text{Re}(\beta+s+v)<1/2 & \quad\text{if }r>0,\\ \text{Re}(\alpha+\beta+2s+u+v)>0,\ \text{Re}(\alpha+s+u)<1/2 & \quad\text{if }r<0. \end{cases}\end{equation} Under these assumptions, the $x$-integral is equal to (see, for instance, 17.43.21 and 17.43.22 of [\textbf{\ref{GR}}]) \[ \Big(\frac {q|r|}{ab}\Big)^{-(\alpha+\beta+2s+u+v)}\times\begin{cases} \frac{\Gamma(\alpha+\beta+2s+u+v)\Gamma(1/2-\beta-s-v)}{\Gamma(1/2+\alpha+s+u)} & \quad\text{if }r>0,\\ \frac{\Gamma(\alpha+\beta+2s+u+v)\Gamma(1/2-\alpha-s-u)}{\Gamma(1/2+\beta+s+v)} & \quad\text{if } r<0. \end{cases} \] Hence \begin{align*} \mathcal{M}_1^+(M,N)&=\sum_{r\geq1}\sum_{\substack{d\\(a,b)=1}}\frac{\alpha_{da}\beta_{db}}{dab}\frac{1}{(2\pi i)^3}\int_{(c_2)}\int_{(c_1)} \widetilde{W}(u)\widetilde{W}(v)M^uN^v\\ &\qquad \int_{(\varepsilon)} X_+(s)H^+(s)\Big(\frac q\pi\Big)^s\Big(\frac {q}{a}\Big)^{-(\alpha+s+u)}\Big(\frac {q}{b}\Big)^{-(\beta+s+v)}r^{-(\alpha+\beta+2s+u+v)}\,\frac{ds}{s}dudv, \end{align*} where \[ H^+(s)=\Gamma(\alpha+\beta+2s+u+v)\bigg(\frac{\Gamma(1/2-\beta-s-v)}{\Gamma(1/2+\alpha+s+u)}+\frac{\Gamma(1/2-\alpha-s-u)}{\Gamma(1/2+\beta+s+v)}\bigg). \] A similar formula holds for $\mathcal{M}_1^-(M,N)$ with $H^+(s)$ being replaced by $H^-(s)$, where \[ H^-(s)=\frac{\Gamma(1/2-\alpha-s-u)\Gamma(1/2-\beta-s-v)}{\Gamma(1-\alpha-\beta-2s-u-v)}, \] and the imposed conditions for the absolute convergence are \begin{equation}\label{contour2} \text{Re}(\alpha+s+u)<1/2, \qquad \text{Re}(\beta+s+v)<1/2. \end{equation} To keep the symmetry, we write \[ \mathcal{M}_1^+(M,N)+\mathcal{M}_1^-(M,N)=\mathcal{P}_1(M,N)+\mathcal{P}_2(M,N), \] where, for $j=1,2$, \begin{align}\label{Nintegral} \mathcal{P}_j(M,N)&=\sum_{r\geq1}\sum_{\substack{d\\(a,b)=1}}\frac{\alpha_{da}\beta_{db}}{dab}\frac{1}{(2\pi i)^3}\int_{(c_2)}\int_{(c_1)} \widetilde{W}(u)\widetilde{W}(v)M^uN^v\\ &\qquad \int_{(\varepsilon)} X_+(s)H_j(s)\Big(\frac q\pi\Big)^s\Big(\frac {q}{a}\Big)^{-(\alpha+s+u)}\Big(\frac {q}{b}\Big)^{-(\beta+s+v)}r^{-(\alpha+\beta+2s+u+v)}\,\frac{ds}{s}dudv,\nonumber \end{align} where \[ H_1(s)=\Gamma(1/2-\beta-s-v)\bigg(\frac{\Gamma(\alpha+\beta+2s+u+v)}{\Gamma(1/2+\alpha+s+u)}+\frac{\Gamma(1/2-\alpha-s-u)}{2\Gamma(1-\alpha-\beta-2s-u-v)}\bigg) \] and \[ H_2(s)=\Gamma(1/2-\alpha-s-u)\bigg(\frac{\Gamma(\alpha+\beta+2s+u+v)}{\Gamma(1/2+\beta+s+v)}+\frac{\Gamma(1/2-\beta-s-v)}{2\Gamma(1-\alpha-\beta-2s-u-v)}\bigg). \] \subsubsection{The $r$-sum} The aim here is to show that we can somehow replace the sum over $r$ in \eqref{Nintegral} by $\zeta(\alpha+\beta+2s+u+v)$. We start with $\mathcal{P}_1(M,N)$. Choose $c_1=0$ and $c_2=\varepsilon$. We move the $s$-contour to the right to $\text{Re}(s)=1/2-\varepsilon/3$, crossing a simple pole at $s=1/2-\beta-v$ from the first gamma factor of $H_1(s)$. In doing so we obtain \[ \mathcal{P}_1(M,N)=\mathcal{P}_1'(M,N)-\mathcal{R}_1(M,N), \] where $\mathcal{P}_1'(M,N)$ is the integral along the new line and \begin{align*} \mathcal{R}_1(M,N)&=-\frac32\sum_{r\geq1}\sum_{\substack{d\\(a,b)=1}}\frac{\alpha_{da}\beta_{db}}{dab}\frac{1}{(2\pi i)^2}\int_{(\varepsilon)}\int_{(0)} X_+(1/2-\beta-v)\widetilde{W}(u)\widetilde{W}(v)M^uN^v\\ &\qquad\qquad \Big(\frac q\pi\Big)^{1/2-\beta-v}\Big(\frac {q}{a}\Big)^{-(1/2+\alpha-\beta+u-v)}\Big(\frac {q}{b}\Big)^{-1/2}r^{-(1+\alpha-\beta+u-v)}\,\frac{dudv}{1/2-\beta-v}. \end{align*} As moving the $u$-contour in the above expression to $\text{Re}(u)=2\varepsilon$ encountering no pole, we have \begin{align}\label{R1} &\mathcal{R}_1(M,N)=-\frac32\sum_{\substack{d\\(a,b)=1}}\frac{\alpha_{da}\beta_{db}}{dab}\frac{1}{(2\pi i)^2}\int_{(\varepsilon)}\int_{(2\varepsilon)} X_+(1/2-\beta-v)\widetilde{W}(u)\widetilde{W}(v)M^uN^v\nonumber\\ &\qquad\quad \Big(\frac q\pi\Big)^{1/2-\beta-v}\Big(\frac {q}{a}\Big)^{-(1/2+\alpha-\beta+u-v)}\Big(\frac {q}{b}\Big)^{-1/2}\zeta(1+\alpha-\beta+u-v)\,\frac{dudv}{1/2-\beta-v}. \end{align} With $\mathcal{P}_1'(M,N)$, the $r$-sum can be written as $\zeta(\alpha+\beta+2s+u+v)$. We then shift the $s$-contour back to $\text{Re}(s)=\varepsilon$, but this time crossing two simple poles at $s=1/2-\beta-v$, again, and $s=1/2-(\alpha+\beta+u+v)/2$, because of the zeta-function. We write \[ \mathcal{P}_1'(M,N)=\mathcal{P}_1''(M,N)+\mathcal{R}_1'(M,N)+\mathcal{R}_1''(M,N) \] accordingly, where $\mathcal{R}_1'(M,N)$ and $\mathcal{R}_1''(M,N)$ are the residues at $s=1/2-\beta-v$ and $s=1/2-(\alpha+\beta+u+v)/2$, respectively. It follows that \[ \mathcal{P}_1(M,N)=\mathcal{P}_1''(M,N)-\big(\mathcal{R}_1(M,N)-\mathcal{R}_1'(M,N)\big)+\mathcal{R}_1''(M,N). \] Note that $\mathcal{R}_1'(M,N)$ is the same as $\mathcal{R}_1(M,N)$ in \eqref{R1} but with the $u$-contour being along $\text{Re}(u)=0$. So the difference $\mathcal{R}_1(M,N)-\mathcal{R}_1'(M,N)$ is the residue at $u=v-\alpha+\beta$ of \eqref{R1}. That is to say \begin{align*} &\mathcal{R}_1(M,N)-\mathcal{R}_1'(M,N)=-\frac{3}{2q}\sum_{a,b}\frac{\alpha_{a}\beta_{b}}{\sqrt{ab}}\\ &\qquad\quad\frac{1}{2\pi i}\int_{(\varepsilon)} X_+(1/2-\beta-v)\widetilde{W}(v-\alpha+\beta)\widetilde{W}(v) \Big(\frac q\pi\Big)^{1/2-\beta-v}M^{v-\alpha+\beta}N^v\frac{dv}{1/2-\beta-v}. \end{align*} We shall make use of the fact that \begin{align}\label{tildeW} \widetilde{W}(v)N^v&=N^v\int_{0}^{\infty}x^{v-1}W(x)dx\nonumber\\ &=\sum_{n}n^{v-1}W\Big(\frac nN\Big)+N^v\sum_{n}\int_{n/N}^{(n+1)/N}\bigg(x^{v-1}W(x)-\Big(\frac nN\Big)^{v-1}W\Big(\frac nN\Big)\bigg)dx\nonumber\\ &=\sum_{n}n^{v-1}W\Big(\frac nN\Big)+O_\varepsilon\big(q^\varepsilon N^{\text{Re}(v)-1}|v|\big). \end{align} Using this and \eqref{Vpm} we obtain \begin{align*} &\mathcal{R}_1(M,N)-\mathcal{R}_1'(M,N)\\ &\qquad\quad=-\frac{3}{2q}\sum_{\substack{a,b\\m,n}}\frac{\alpha_{a}\beta_{b}}{\sqrt{ab}m^{1/2+\alpha}n^{1/2+\beta}}W\Big(\frac mM\Big)W\Big(\frac nN\Big)V_+\Big(\frac{\pi mn}{q}\Big)+O_\varepsilon\big(q^{\kappa-1/2+\varepsilon} (MN)^{-1}\big). \end{align*} For $\mathcal{R}_1''(M,N)$, we have \[ H_1\Big(\frac{1-\alpha-\beta-u-v}{2}\Big)=\frac{2}{\alpha-\beta+u-v}. \] Hence \begin{align}\label{R''} &\mathcal{R}_1''(M,N)=\frac{2}{q}\sum_{\substack{d\\(a,b)=1}}\frac{\alpha_{da}\beta_{db}}{d\sqrt{ab}}\frac{1}{(2\pi i)^2}\int_{(\varepsilon)}\int_{(0)} X_+\Big(\frac{1-\alpha-\beta-u-v}{2}\Big) \widetilde{W}(u)\widetilde{W}(v)M^uN^v\nonumber\\ &\qquad\qquad \Big(\frac q\pi\Big)^{(1-\alpha-\beta-u-v)/2}\Big(\frac {a}{b}\Big)^{(\alpha-\beta+u-v)/2}\frac{dudv}{(1-\alpha-\beta-u-v)(\alpha-\beta+u-v)}. \end{align} We apply the same argument to $\mathcal{P}_2(M,N)$, but this time choose $c_1=\varepsilon$ and $c_2=0$. Similarly we obtain \[ \mathcal{P}_2(M,N)=\mathcal{P}_2''(M,N)-\big(\mathcal{R}_2(M,N)-\mathcal{R}_2'(M,N)\big)+\mathcal{R}_2''(M,N). \] In particular, note that \[ H_2\Big(\frac{1-\alpha-\beta-u-v}{2}\Big)=-\frac{2}{\alpha-\beta+u-v}. \] So \begin{align*} &\mathcal{R}_2''(M,N)=-\frac{2}{q}\sum_{\substack{d\\(a,b)=1}}\frac{\alpha_{da}\beta_{db}}{d\sqrt{ab}}\frac{1}{(2\pi i)^2}\int_{(0)}\int_{(\varepsilon)} X_+\Big(\frac{1-\alpha-\beta-u-v}{2}\Big) \widetilde{W}(u)\widetilde{W}(v)M^uN^v\\ &\qquad\qquad \Big(\frac q\pi\Big)^{(1-\alpha-\beta-u-v)/2}\Big(\frac {a}{b}\Big)^{(\alpha-\beta+u-v)/2}\frac{dudv}{(1-\alpha-\beta-u-v)(\alpha-\beta+u-v)}.\nonumber \end{align*} Apart from the minus sign and the changes of the contours, this is the same as $\mathcal{R}_1''(M,N)$. Hence, using \eqref{tildeW} as before, \begin{align*} &\mathcal{R}_1''(M,N)+\mathcal{R}_2''(M,N)=-\text{Res}_{u=v-\alpha+\beta}\ \text{of \eqref{R''}}\\ &\quad\qquad=-\frac{1}{q}\sum_{a,b}\frac{\alpha_{a}\beta_{b}}{\sqrt{ab}}\frac{1}{2\pi i}\int_{(\varepsilon)} X_+(1/2-\beta-v) \Big(\frac q\pi\Big)^{1/2-\beta-v}\\ &\quad\quad\qquad\qquad\qquad\widetilde{W}(1/2-\beta-v)\widetilde{W}(v)M^{1/2-\beta-v}N^v\frac{dv}{(1/2-\beta-v)}\\ &\quad\qquad=-\frac{1}{q}\sum_{\substack{a,b\\m,n}}\frac{\alpha_{a}\beta_{b}}{\sqrt{ab}m^{1/2+\alpha}n^{1/2+\beta}}W\Big(\frac mM\Big)W\Big(\frac nN\Big)V_+\Big(\frac{\pi mn}{q}\Big)+O_\varepsilon\big(q^{\kappa-1/2+\varepsilon} M^{-1/2}N^{-1}\big). \end{align*} We sum up the calculations in this subsection in the following proposition. \begin{proposition}\label{propM1} For $(M,N)\in\mathcal{A}_3$ we have \begin{align*} &\mathcal{M}_1^+(M,N)+\mathcal{M}_1^-(M,N)=\mathcal{P}_1''(M,N)+\mathcal{P}_2''(M,N)\\ &\qquad\qquad+\frac{2}{q}\sum_{\substack{a,b\\m,n}}\frac{\alpha_{a}\beta_{b}}{\sqrt{ab}m^{1/2+\alpha}n^{1/2+\beta}}W\Big(\frac mM\Big)W\Big(\frac nN\Big)V_+\Big(\frac{\pi mn}{q}\Big)+O_\varepsilon\big(q^{7\kappa/2+5\delta_0-5/2+\varepsilon}\big), \end{align*} where, for $j=1,2$, \begin{align}\label{N''} &\mathcal{P}_j''(M,N)=\sum_{\substack{d\\(a,b)=1}}\frac{\alpha_{da}\beta_{db}}{dab}\frac{1}{(2\pi i)^3}\int_{(c_2)}\int_{(c_1)} \widetilde{W}(u)\widetilde{W}(v)M^uN^v\\ &\qquad\qquad \int_{(\varepsilon)} X_+(s)H_j(s)\Big(\frac q\pi\Big)^s\Big(\frac {q}{a}\Big)^{-(\alpha+s+u)}\Big(\frac {q}{b}\Big)^{-(\beta+s+v)}\zeta(\alpha+\beta+2s+u+v)\,\frac{ds}{s}dudv.\nonumber \end{align} \end{proposition} \subsection{The secondary main terms $\mathcal{M}_{2,\gtrless}(M,N)$}\label{secondarymt2} Applying Proposition \ref{prop2} to $S_{\alpha,\beta}^+(M,N)$ for the pairs $(M,N)\in\mathcal{A}_{2,<}$ we get \begin{align*} \mathcal{M}_{2,<}(M,N)=&\,\frac 2q\sum_{a,b}\frac{\alpha_{a}\beta_{b}}{\sqrt{ab}}\frac{1}{2\pi i}\int_{(\varepsilon)} X_+(s)\Big(\frac q\pi\Big)^s\\ &\qquad\qquad \sum_m m^{-(1/2+\alpha+s)}\,W\Big ( \frac{m}{M} \Big )\int x^{-(1/2+\beta+s)}\,W\Big ( \frac{x}{N} \Big )dx\frac{ds}{s}. \end{align*} Recall from \eqref{tildeW} that \begin{align*} \int_{0}^{\infty}x^{u-1}W\Big(\frac xN\Big)dx=\sum_{n}n^{u-1}W\Big(\frac nN\Big)+O_\varepsilon\big(q^\varepsilon N^{\text{Re}(u)-1}|u|\big). \end{align*} The contribution of the $O$-term to $\mathcal{M}_{2,<}(M,N)$ is $O_\varepsilon\big(q^{-1+\varepsilon}\sqrt{ABM/N}\big)$. Hence \begin{equation}\label{propM2} \mathcal{M}_{2,<}(M,N)=\frac{2}{q}\sum_{\substack{a,b\\m,n}}\frac{\alpha_{a}\beta_{b}}{\sqrt{ab}m^{1/2+\alpha}n^{1/2+\beta}}W\Big(\frac mM\Big)W\Big(\frac nN\Big)V_+\Big(\frac{\pi mn}{q}\Big)+O_\varepsilon\big(q^{-1/2-4\delta_0+\varepsilon}\big). \end{equation} The same expression holds for $\mathcal{M}_{2,>}(M,N)$. \subsection{Assembling the partition of unity} Recall that Proposition \ref{propM1} holds when $(M,N)\in\mathcal{A}_3$ and \eqref{propM2} holds when $(M,N)\in\mathcal{A}_{2,\gtrless}$. Summing up we obtain \begin{align*} &S_{\alpha,\beta}^{+}=\sum_{(M,N)\in\mathcal{A}_3} \big(\mathcal{P}_1''(M,N)+\mathcal{P}_2''(M,N)\big)\\ &\qquad\qquad+\sum_{(M,N)\notin\mathcal{A}_{1}}\frac{2}{q}\sum_{\substack{a,b\\m,n}}\frac{\alpha_{a}\beta_{b}}{\sqrt{ab}m^{1/2+\alpha}n^{1/2+\beta}}W\Big(\frac mM\Big)W\Big(\frac nN\Big)V_+\Big(\frac{\pi mn}{q}\Big)+O_\varepsilon\big(q^{-\delta_0+\varepsilon}\big) \end{align*} for some $\delta_0>0$. The condition $(M,N)\notin\mathcal{A}_{1}$ in the second sum may be removed at the cost of an error of size $O_\varepsilon\big(q^{-\delta_0+\varepsilon}\big)$. This allows us to extend the summation over all $(M,N)$, and thus to remove the partition of unity. For the first sum, the following result shall allow us to add all the missing pairs $(M,N)$. \begin{lemma} With $\mathcal{P}_j''(M,N)$, $j=1,2$, defined as in \eqref{N''} we have \[ \mathcal{P}_j''(M,N)\ll_\varepsilon q^\varepsilon\min\bigg\{\frac{\sqrt{ABMN}}{q},\sqrt{\frac AN},\sqrt{\frac BM}\bigg\}. \] \end{lemma} \begin{proof} Recall from \eqref{contour1} and \eqref{contour2} that for $j=1,2$, $H_j$'s have rapid decay as any of the variables gets large in the imaginary directions. So we have, trivially, \[ \mathcal{P}_j''(M,N)\ll_\varepsilon q^{-(\sigma+c_1+c_2)+\varepsilon}M^{c_1}N^{c_2}A^{\sigma+c_1}B^{\sigma+c_2}, \] provided that \[ 0<2\sigma+c_1+c_2<1,\qquad \sigma+c_1<\frac12\qquad\text{and}\qquad \sigma+c_2<\frac12. \] The lemma follows by choosing various suitable values of $\sigma$, $c_1$ and $c_2$. \end{proof} The above lemma implies that for $j=1,2$, \begin{eqnarray*} \sum_{(M,N)\in\mathcal{A}_3}\mathcal{P}_j''(M,N)=\sum_{M,N}\mathcal{P}_j''(M,N)+O_\varepsilon\big(q^{-\delta_0+\varepsilon}\big). \end{eqnarray*} Now we can apply the following result of Young [\textbf{\ref{Y}}; p. 30]. \begin{lemma}\label{sumunity} Let $F(s_1,s_2)$ be an entire function of rapid decay in each variable in a fixed strip $|\emph{Re}(s_j)|\leq C$, $j=1,2$. Then we have \[ \sum_{M,N}\frac{1}{(2\pi i)^2}\int_{(c_2)}\int_{(c_1)}F(s_1,s_2)\widetilde{W}(s_1)\widetilde{W}(s_2)ds_1ds_2=F(0,0). \] \end{lemma} In view of this we get \begin{align*} &\sum_{(M,N)\in\mathcal{A}_3}\big(\mathcal{P}_1''(M,N)+\mathcal{P}_2''(M,N)\big)=\mathcal{N}_{\alpha,\beta}^++O_\varepsilon\big(q^{-\delta_0+\varepsilon}\big), \end{align*} where \[ \mathcal{N}_{\alpha,\beta}^+=\sum_{\substack{d\\(a,b)=1}}\frac{\alpha_{da}\beta_{db}}{dab}\frac{1}{2\pi i}\int_{(\varepsilon)} X_+(s)H(s)\Big(\frac q\pi\Big)^s\Big(\frac {q}{a}\Big)^{-(\alpha+s)}\Big(\frac {q}{b}\Big)^{-(\beta+s)}\zeta(\alpha+\beta+2s)\,\frac{ds}{s} \] and \begin{align*} H(s)=&\frac{\Gamma(\alpha+\beta+2s)\Gamma(1/2-\beta-s)}{\Gamma(1/2+\alpha+s)}+\frac{\Gamma(\alpha+\beta+2s)\Gamma(1/2-\alpha-s)}{\Gamma(1/2+\beta+s)}\\ &\qquad\qquad+\frac{\Gamma(1/2-\alpha-s)\Gamma(1/2-\beta-s)}{\Gamma(1-\alpha-\beta-2s)}. \end{align*} Using Lemma 8.2 of [\textbf{\ref{Y}}] we have \[ H(s)=\pi^{1/2}\frac{\Gamma(\frac{\alpha+\beta+2s}{2})\Gamma(\frac{1/2-\alpha-s}{2})\Gamma(\frac{1/2-\beta-s}{2})}{\Gamma(\frac{1-\alpha-\beta-2s}{2})\Gamma(\frac{1/2+\alpha+s}{2})\Gamma(\frac{1/2+\beta+s}{2})}. \] So \begin{align*} \mathcal{N}_{\alpha,\beta}^+&=\frac{\pi^{1/2}q^{-(\alpha+\beta)}}{\Gamma(\frac{1/2+\alpha}{2})\Gamma(\frac{1/2+\beta}{2})}\sum_{\substack{d\\(a,b)=1}}\frac{\alpha_{da}\beta_{db}}{da^{1-\alpha}b^{1-\beta}}\\ &\qquad\qquad\frac{1}{2\pi i}\int_{(\varepsilon)} G(s)\frac{\Gamma(\frac{\alpha+\beta+2s}{2})\Gamma(\frac{1/2-\alpha-s}{2})\Gamma(\frac{1/2-\beta-s}{2})}{\Gamma(\frac{1-\alpha-\beta-2s}{2})}\Big(\frac{ab} {\pi q}\Big)^{s}\zeta(\alpha+\beta+2s)\,\frac{ds}{s}. \end{align*} We apply the functional equation, \begin{align*} &\pi^{-(\alpha+\beta+2s)/2}\Gamma\Big(\frac{\alpha+\beta+2s}{2}\Big)\zeta(\alpha+\beta+2s)\\ &\qquad\qquad=\pi^{-(1-\alpha-\beta-2s)/2}\Gamma\Big(\frac{1-\alpha-\beta-2s}{2}\Big)\zeta(1-\alpha-\beta-2s), \end{align*} and change the variable $s\rightarrow -s$ to obtain \begin{align}\label{N+} \mathcal{N}_{\alpha,\beta}^+=-\Big(\frac{q}{\pi}\Big)^{-(\alpha+\beta)}\sum_{\substack{d\\(a,b)=1}}\frac{\alpha_{da}\beta_{db}}{da^{1-\alpha}b^{1-\beta}}\frac{1}{2\pi i}\int_{(-\varepsilon)} X_-(s)\Big(\frac {\pi ab}{ q}\Big)^{-s}\zeta(1-\alpha-\beta+2s)\,\frac{ds}{s}. \end{align} We conclude that \begin{proposition}\label{S+} We have \begin{align*} S_{\alpha,\beta}^{+}&=\mathcal{N}_{\alpha,\beta}^++\frac{2}{q}\sum_{\substack{a,b\\m,n}}\frac{\alpha_{a}\beta_{b}}{\sqrt{ab}m^{1/2+\alpha}n^{1/2+\beta}}V_+\Big(\frac{\pi mn}{q}\Big)+O_\varepsilon\big(q^{-\delta_0+\varepsilon}\big), \end{align*} where $\mathcal{N}_{\alpha,\beta}^+$ is defined as in \eqref{N+}. \end{proposition} \subsection{Combining the main terms and secondary main terms} Section \ref{initial} and Proposition \ref{S+} imply that \[ I_{\alpha,\beta}=\Big(\mathcal{M}_{\alpha,\beta}^++\mathcal{N}_{\alpha,\beta}^+\Big)+\Big(\frac{q}{\pi}\Big)^{-(\alpha+\beta)}\Big(\mathcal{M}_{-\beta,-\alpha}^-+\mathcal{N}_{-\beta,-\alpha}^-\Big)+O_\varepsilon\big(q^{-\delta_0+\varepsilon}\big), \] where $\mathcal{M}^\pm$, $\mathcal{N}^\pm$ are defined as in \eqref{M+} and \eqref{N+}. We have, for instance, \begin{align*} \Big(\frac{q}{\pi}\Big)^{-(\alpha+\beta)}\mathcal{M}_{-\beta,-\alpha}^-+\mathcal{N}_{\alpha,\beta}^+&=\Big(\frac{q}{\pi}\Big)^{-(\alpha+\beta)}\sum_{\substack{da,db\leq q^\kappa\\(a,b)=1}}\frac{\alpha_{da}\beta_{db}}{da^{1-\alpha}b^{1-\beta}}\\ &\qquad\frac{1}{2\pi i}\bigg(\int_{(\varepsilon)}-\int_{(-\varepsilon)}\bigg) X_-(s)\Big(\frac {\pi ab}{ q}\Big)^{-s}\zeta(1-\alpha-\beta+2s)\,\frac{ds}{s}\\ &=\text{Res}_{s=0}\\ &=X_-(0)\Big(\frac{q}{\pi}\Big)^{-(\alpha+\beta)}\zeta(1-\alpha-\beta)\sum_{\substack{da,db\leq q^\kappa\\(a,b)=1}}\frac{\alpha_{da}\beta_{db}}{da^{1-\alpha}b^{1-\beta}}. \end{align*} Note that the pole at $s=(\alpha+\beta)/2$ of the zeta-function is cancelled by the function $G$. A similar expression holds for the combination of the other two terms, and Theorem \ref{mthm} follows. \section{Proofs of Theorems \ref{thm2} and \ref{thm3}}\label{sthm2} \subsection{Proof of Theorem \ref{thm2}} We argue the same as in the proof of Theorem \ref{mthm}. The only difference is that we also apply Proposition \ref{prop3} to \eqref{mainexS}: if $(M,N)\in\mathcal{A}_1$ we apply \eqref{prop1-1} of Proposition \ref{prop1}; if $(M,N)\in\mathcal{A}_{2,<}\cup \mathcal{A}_{2,>}$ we apply Proposition \ref{prop2}; and in the remaining case we apply Proposition \ref{prop3}. So it remains to check that the error term $\mathcal{E}(M,N)$ is acceptable when $(M,N)\in\mathcal{A}_3$. As in Subsection \ref{errorterm}, if $(M,N)\in\mathcal{A}_3$, then we may assume that $M, N\ll q^{\kappa+6\delta_0}$. Without loss of generality, let us assume that $AM\ll BN$. Then from Proposition \ref{prop3}, \begin{align*} \mathcal{E}(M,N)&\ll_\varepsilon q^{-1+\varepsilon}A^{1/4}B^{3/2}(N/M)^{1/2}+q^{-3/4+\varepsilon}A^{1/4}B(N/M)^{1/4}(A_1+A_2)^{1/4}. \end{align*} Since $M\gg q^{2-2\delta_0}/ABN$, it follows that $N/M\ll q^{-2+2\delta_0}ABN^2\ll q^{-2+4\kappa+14\delta_0}$, and hence \begin{align*} \mathcal{E}(M,N)&\ll_\varepsilon q^{-2+15\kappa/4+7\delta_0+\varepsilon}+q^{-5/4+9\kappa/4+7\delta_0/2+\varepsilon}(A_1+A_2)^{1/4}. \end{align*} Thus $\mathcal{E}(M,N)\ll_\varepsilon q^{-\delta_0+\varepsilon}$ for some $\delta_0>0$ if $9\kappa+\max\{\kappa_1,\kappa_2\}<5$. \subsection{Proof of Theorem \ref{thm3}} Again we follow the arguments in the proof of Theorem \ref{mthm}. The only difference is that if $(M,N)\in\mathcal{A}_3$, then we apply Proposition \ref{prop4} to \eqref{mainexS}. We only need to verify that the error term $\mathcal{E}(M,N)$ is negligible in this case. As above, we may assume that $M, N\ll q^{\kappa+6\delta_0}$, and, without loss of generality, that $AM\ll BN$. In view of Proposition \ref{prop4}, \begin{align*} \mathcal{E}(M,N)\ll_\varepsilon&\, q^{\vartheta-1/2+\varepsilon}(BN/AM)^{3/4}\Big(A_2B_2+\frac{B^2N}{qM}\Big)^{1/2}\Big(A_2B_2+\frac{B}{A_1}\Big)^{1/2} \end{align*} with $\vartheta=7/64$. Since $M\gg q^{2-2\delta_0}/ABN$, we get \begin{align*} \mathcal{E}(M,N)&\ll_\varepsilon\, q^{\vartheta-2+3\kappa/2+21\delta_0/2+\varepsilon}B^{3/2}\big(A_2B_2+q^{-3+2\kappa+14\delta_0}AB^3\big)^{1/2}\Big(A_2B_2+\frac{B}{A_1}\Big)^{1/2}. \end{align*} As $MN\ll q^{1+\varepsilon}$, we have $AB\gg q^{1-2\delta_0-\varepsilon}$, and so $B/A_1\ll q^{-1+2\delta_0+\varepsilon}A_2B^2$. Hence \begin{align*} \mathcal{E}(M,N)&\ll_\varepsilon\, q^{\vartheta-2+3\kappa+2\kappa_2+21\delta_0/2+\varepsilon}+q^{\vartheta-5/2+4\kappa+3\kappa_2/2+23\delta_0/2+\varepsilon}+q^{\vartheta-7/2+6\kappa+\kappa_2+35\delta_0/2+\varepsilon}\\ &\ll_\varepsilon\, q^{\vartheta-1/2+7\kappa_2+35\delta_0/2+\varepsilon}. \end{align*} Thus $\mathcal{E}(M,N)\ll_\varepsilon q^{-\delta_0+\varepsilon}$ for some $\delta_0>0$ if $\kappa_2<1/14-\vartheta/7$. \section{Proof of Theorem \ref{thm: third moment}} The lower bound for \eqref{eq: third moment} is relatively straightforward, and follows from the work of Rudnick and Soundararajan [\textbf{\ref{RS}}]. We therefore focus on the upper bound. Our approach utilizes a combination of ideas from Heath-Brown [\textbf{\ref{hb}}] and Bettin, Chandee and Radziwi\l\l\ [\textbf{\ref{BCR}}], as well as our Theorem \ref{mthm} on the twisted second moment of Dirichlet $L$-functions. Heath-Brown [\textbf{\ref{hb}}; Theorem 1] previously obtained Theorem \ref{thm: third moment} assuming the Generalized Riemann Hypothesis, and Bettin, Chandee and Radziwi\l\l \ [\textbf{\ref{BCR}}; Corollary 2] obtained the analogue of Theorem \ref{thm: third moment} for the Riemann zeta-function $\zeta(s)$. Let us define \begin{align*} M(q) = \sideset{}{^*}\sum_{\chi(\text{mod}\ q)} \left|L \left( \tfrac{1}{2},\chi\right) \right|^3, \end{align*} so that the upper bound in \eqref{eq: third moment} follows from the estimate \begin{align*} M(q) &\ll q (\log q)^{9/4}. \end{align*} We follow Heath-Brown (see [\textbf{\ref{hb}}; p. 408--409]) and first obtain an upper bound for $M(q)$ in terms of an integral. As $L(s,\chi)$ is an analytic function, we have \begin{align}\label{eq: L subharmonic inequality} \left|L \left( \tfrac{1}{2},\chi\right) \right|^3 &\leq \frac{1}{2\pi} \int_0^{2\pi } \left|L \left( \tfrac{1}{2}+re^{i\theta},\chi\right) \right|^3 d\theta \end{align} for any $r \geq 0$. We multiply both sides of \eqref{eq: L subharmonic inequality} by $r$ and integrate from $0$ to $R$, obtaining \begin{align}\label{eq: upper bound for central value in terms of integral} \left|L \left( \tfrac{1}{2},\chi\right) \right|^3 &\leq \frac{1}{\text{meas}(D)} \int_D \left|L \left( \tfrac{1}{2}+z,\chi\right) \right|^3 dA, \end{align} where $D = \{z : |z| \leq R\}$ and $dA$ denotes the area measure. We choose $R = (\log q)^{-1}$, and then the real part of $1/2+z$ satisfies \begin{align*} \frac{1}{2} - \frac{1}{\log q} \leq \text{Re}\Big( \frac{1}{2}+z \Big) \leq \frac{1}{2} + \frac{1}{\log q}. \end{align*} Now define a function \begin{align*} W_\rho (s)=W(s) = \frac{q^{\rho(s - 1/2)}-1}{(s -1/2)\log q}, \end{align*} where $\rho > 0$ is a parameter at our disposal (we eventually take $\rho$ to be rather small). For $z \in D$ we have \begin{align}\label{eq: lower bound for W on D} \left|W \left( \tfrac{1}{2}+z \right) \right| \geq \frac{\rho}{2}, \end{align} provided that $\rho \leq 1/2$, say. By positivity, we obtain from \eqref{eq: upper bound for central value in terms of integral} and \eqref{eq: lower bound for W on D} that \begin{align*} \left|L \left( \tfrac{1}{2},\chi\right) \right|^3 &\ll_\rho (\log q)^2\int_D \left|W \left( \tfrac{1}{2}+z \right) \right|^6 \left|L \left( \tfrac{1}{2}+z,\chi\right) \right|^3 dA \\ &\leq (\log q)^2 \int_{- 1/\log q}^{1/\log q} \int_{-\infty}^\infty \left|W \left( \tfrac{1}{2}+\gamma + it \right) \right|^6 \left|L \left( \tfrac{1}{2}+\gamma + it,\chi\right) \right|^3 dt \ d\gamma. \end{align*} We define \begin{align*} J(\gamma) = \sideset{}{^*}\sum_{\chi(\text{mod}\ q)} \int_{-\infty}^\infty \left|W \left( \tfrac{1}{2}+\gamma + it \right) \right|^6 \left|L \left( \tfrac{1}{2}+\gamma + it,\chi\right) \right|^3 dt. \end{align*} We have therefore obtained \begin{align*} M(q) &\ll_\rho (\log q)^2 \int_{- 1/\log q}^{1/\log q} J(\gamma) \ d \gamma. \end{align*} By [\textbf{\ref{hb}}; Lemma 4] we have \begin{align*} J(\gamma) \ll_A\, q(\log q)^{-1} + J\Big(\frac{A}{\log q} \Big), \end{align*} where $A \geq 1$ is a parameter at our disposal. Thus, \begin{align}\label{eq: upper bound for M in terms of J} M(q) &\ll_{\rho,A} \, q + (\log q)J\Big(\frac{A}{\log q} \Big). \end{align} We shall eventually take $A$ to be a large, but fixed, constant. In order to apply our main theorem, we need to truncate the integral in the definition of $J(\gamma)$ to $|t| \leq T$, for some relatively small $T$. This can be done easily because of the decay of $W$ in vertical strips. For $|t| \geq 1$ we have \begin{align*} \left|W \Big( \frac{1}{2}+\frac{A}{\log q} + it \Big) \right|^6 \ll_{\rho,A} \frac{1}{t^6}, \end{align*} so that \begin{align*} &\sideset{}{^*}\sum_{\chi(\text{mod}\ q)} \int_{|t| \geq T} \left|W \Big( \frac{1}{2}+\frac{A}{\log q} + it \Big) \right|^6 \left|L \Big( \frac{1}{2}+\frac{A}{\log q} + it,\chi\Big) \right|^3 dt \\ &\qquad\qquad\ll_{\rho,A} \ \sideset{}{^*}\sum_{\chi(\text{mod}\ q)} \int_{|t| \geq T} \left|L \Big( \frac{1}{2}+\frac{A}{\log q} + it,\chi\Big) \right|^3\frac{dt}{t^6} . \end{align*} We break the integral into dyadic segments, so we must estimate \begin{align*} &\sideset{}{^*}\sum_{\chi(\text{mod}\ q)} \int_{U \leq |t| \leq 2U} \left|L \Big( \frac{1}{2}+\frac{A}{\log q} + it,\chi\Big) \right|^3\frac{dt}{t^6}\\ &\qquad\qquad \ll \frac{1}{U^6} \sideset{}{^*}\sum_{\chi(\text{mod}\ q)} \int_{-2U}^{2U}\left|L \Big( \frac{1}{2}+\frac{A}{\log q} + it,\chi\Big) \right|^3 dt \end{align*} for $U \geq T$. By H\"older's inequality and Theorem 10.1 of [\textbf{\ref{mont}}], we find that this latter quantity is \begin{align*} \ll \frac{(qU)^{1/4}}{U^6} \left( \ \sideset{}{^*}\sum_{\chi(\text{mod}\ q)} \int_{-2U}^{2U} \left|L \Big( \frac{1}{2}+\frac{A}{\log q} + it,\chi\Big) \right|^4 dt \right)^{3/4}\ll \frac{q (\log qU)^3}{ U^{5}}. \end{align*} Summing over $U=2^j$ with $U \geq T=\log q$, we find that \begin{align}\label{eq: J and J1} J\Big(\frac{A}{\log q}\Big) &= \ J_1\Big( \frac{A}{\log q}\Big) + O_{\rho,A}\big(q(\log q)^{-1}\big), \end{align} where \begin{align}\label{fmlJ1} &J_1(\gamma) = \sideset{}{^*}\sum_{\chi(\text{mod}\ q)} \int_{-\log q}^{\log q} \left|W \left(\tfrac12+ \gamma + it \right) \right|^6\left|L \left( \tfrac12+\gamma + it,\chi\right) \right|^3dt. \end{align} We next require an upper bound for $L(1/2+A/\log q+it,\chi)$. Here we mostly follow the arguments of [\textbf{\ref{BCR}}; Section 6]. \begin{lemma}\label{lem: BCR lemma 2 analog} Let $G$ be a compactly supported function. Suppose that $F(u) = -G'(u)$ for $u > 0$ and $F$ is three times continuously differentiable and compactly supported. Then \begin{align*} \sum_n \frac{\chi(n)}{n^s} G \Big(\frac{\log n}{\log x} \Big) = \frac{1}{2\pi i}\int_{(c)} L (s+w,\chi) \widehat{F} \Big(\frac{-iw \log x}{2\pi} \Big) \frac{dw}{w}, \end{align*} where $c > \max\{1-\emph{Re}(s),0\}$, $x > 1$ and $\widehat{F}$ denotes the Fourier transform of $F$. \end{lemma} \begin{proof} Argue as in [\textbf{\ref{BCR}}; Lemma 2]. \end{proof} Let $\delta >0$ be a small positive parameter to be chosen later. We introduce another parameter $\theta$ which satisfies $\delta < \theta < 1$. We define \begin{align*} \widehat{F}(z) &= e^{2\pi i (\theta - \delta)z}\bigg(\frac{e^{2\pi i (1-\theta)z}-1}{2\pi i (1-\theta)z}\bigg)^N, \end{align*} where $N \geq 10$ is a bounded integer (actually, $N=10$ suffices). Then $F$ is compactly supported on $[\theta - \delta, \theta - \delta + (1-\theta)N]$. For $u > 0$, we define \begin{align*} G(u) &= 1 - \int_0^u F(v) dv, \end{align*} and $G(u) = 0$ for $u \leq -1$. We let $G$ decay smoothly to zero on the interval $[-1,0]$. Thus $F(u) = -G'(u)$ for all $u >0$. We have $G(u) = 1$ for $0 < u < \theta - \delta$, and $G(u) = 0$ for $u > \theta - \delta + (1-\theta) N$. Lastly, $G$ is $N$ times differentiable, and therefore $\widehat{G}(u) \ll (1+|u|)^{-N}$. We now let $x \leq q^{1/2 + 1/300}$, and choose our parameters $\delta$, $\theta$ so that $\delta = 2(N-1)(1 - \theta)$, and $\theta = (\log y)/(\log x)$ with $y = q^{1/2+2\delta}$. Note that we want $\delta$ to be small enough so that $x \leq q^{1/2 + 1/300}$. We remark that we shall eventually choose our parameter $\rho$ to be sufficiently small in terms of $\delta$. With such choice of $\delta$ and $\theta$ we have \begin{align*} \widehat{F} \bigg(\frac{-iw \log x}{2\pi} \bigg) &= (yx^{-\delta})^w \bigg(\frac{(x/y)^w-1}{w(1-\theta)(\log x)} \bigg)^N. \end{align*} Using Lemma \ref{lem: BCR lemma 2 analog} with $s = \sigma + it$ and $\sigma = 1/2 + A/\log q$, we shift the line of integration to $\text{Re}(w) =1/2- \sigma$, thereby obtaining \begin{align}\label{eq: upper bound for L} |L(s,\chi)| &\leq \bigg|\sum_n \frac{\chi(n)}{n^s} G \Big(\frac{\log n}{\log x}\Big) \bigg| + (4N)^N \frac{(yx^{-\delta})^{1/2-\sigma}}{(\delta \log x)^N}\int_{-\infty}^\infty \frac{\left|L \left(\frac{1}{2}+it+iv,\chi \right) \right|}{\big((\sigma -1/2)^2 + v^2\big)^{(N+1)/2}}dv. \end{align} Let \begin{align*} c(n) &= \sum_{\substack{n=ab\\ a,b \leq x}} d_{1/2}(a) d_{1/2}(b), \end{align*} where $d_{1/2}(n)$ are the Dirichlet coefficients of $\zeta(s)^{1/2}$. Then $c(n) = 1$ for $n \leq x$. Since $G (u) = 0$ for $u > 1$, we obtain by Fourier inversion \begin{align}\label{idG} \sum_n \frac{\chi(n)}{n^s} G \Big(\frac{\log n}{\log x}\Big) &= \sum_n \frac{c(n)\chi(n)}{n^s} G \Big(\frac{\log n}{\log x}\Big)\nonumber\\ &= \frac{\log x}{2\pi}\int_{-\infty}^{\infty}\bigg(\sum_{a \leq x} \frac{d_{1/2}(a)\chi(a)}{a^{s+iv}} \bigg)^2 \widehat{G}\Big( \frac{v \log x}{2\pi}\Big) dv. \end{align} We then multiply both sides of \eqref{eq: upper bound for L} by $|W(s)|^6|L(s,\chi)|^2$, integrate over $t$, sum on $\chi$, apply \eqref{fmlJ1} and \eqref{idG} to obtain \begin{align}\label{eq: upper bound for J with cal E} J_1 \Big( \frac{A}{\log q}\Big) \leq \mathcal{M} + \mathcal{E}, \end{align} where \begin{align*} \mathcal{M}=&\,\frac{\log x}{2\pi}\int_{-\log q}^{\log q} \int_{-\infty}^\infty \bigg|\widehat{G}\Big( \frac{v \log x}{2\pi}\Big)\bigg|\bigg|W \Big(\frac{1}{2} + \frac{A}{\log q}+it\Big) \bigg|^6\\ &\qquad\qquad\sideset{}{^*}\sum_{\chi(\text{mod}\ q)} \bigg|L \Big(\frac{1}{2} + \frac{A}{\log q}+it,\chi\Big) \bigg|^2 \bigg|\sum_{a \leq x} \frac{d_{1/2}(a) \chi(a)}{a^{1/2+A/\log q+i(t+v)}} \bigg|^2dvdt \end{align*} and \begin{align*} \mathcal{E} =&\, (4N)^N \frac{(yx^{-\delta})^{-A/\log q}}{(\delta \log x)^N}\int_{-\infty}^{\infty} \int_{-\infty}^\infty \frac{\big| W (1/2 + A/\log q + it ) \big|^6}{\big(A^2/(\log q)^2 + v^2\big)^{(N+1)/2}} \\ & \qquad\qquad\sideset{}{^*}\sum_{\chi(\text{mod}\ q)} \bigg|L \Big(\frac{1}{2} + \frac{A}{\log q}+it,\chi\Big) \bigg|^2 \bigg| L \Big( \frac{1}{2}+it+iv,\chi \Big) \bigg| dv dt. \end{align*} Observe that we have used positivity to extend the $t$-integral in $\mathcal{E}$ to all of $\mathbb{R}$. Our goal now is to show that \begin{align}\label{bdonM} \mathcal{M} \ll_{\rho,A,\delta} q (\log q)^{5/4} \end{align} and \begin{align}\label{eq: cal E is smaller than J} \mathcal{E} \leq \frac{1}{2}J \Big( \frac{A}{\log q}\Big). \end{align} Then \eqref{eq: J and J1}, \eqref{eq: upper bound for J with cal E}, \eqref{bdonM} and \eqref{eq: cal E is smaller than J} together give \begin{align*} J_1 \Big( \frac{A}{\log q}\Big) &\ll_{\rho,A,\delta} q (\log q)^{5/4}, \end{align*} and comparison with \eqref{eq: upper bound for M in terms of J} and \eqref{eq: J and J1} leads to \begin{align*} M(q) \ll_{\rho, A,\delta} q(\log q)^{9/4}, \end{align*} as desired. The bound \eqref{bdonM} follows from the observation that \begin{align*} \int_{-\log q}^{\log q} \left|W \left( \frac{1}{2} + \frac{A}{\log q} + it \right) \right|^6 dt \ll_{\rho,A} (\log q)^{-1} \end{align*} and the following lemma. \begin{lemma}\label{lemmathird} Let $t,v \in \mathbb{R}$ with $|t|\leq \log q$, and $s = 1/2 + A/\log q+it$. Then \begin{align}\label{eq: upper bound on 3rd moment main term} \sideset{}{^*}\sum_{\chi(\emph{mod}\ q)} \left|L \left( s,\chi\right) \right|^2 \bigg|\sum_{a \leq x} \frac{d_{1/2}(a) \chi(a)}{a^{s+iv}} \bigg|^2 \ll_{A} q(\log q)^{9/4}, \end{align} and the implied constant is independent of $t$ and $v$. \end{lemma} \begin{proof} Applying Theorem \ref{mthm} with \[ \alpha=\frac{A}{\log q}+it,\qquad \beta=\frac{A}{\log q}-it\qquad\text{and}\qquad \alpha_a=\frac{d_{1/2}(a)}{a^{A/\log q+i(t+v)}}, \] the quantity on the left side of \eqref{eq: upper bound on 3rd moment main term} is \begin{align*} \ll_A q (\log q) \sum_{a,b \leq x} \frac{d_{1/2}(a)d_{1/2}(b)}{[a,b]}+O_\varepsilon\big(q^{1-\varepsilon}\big). \end{align*} Note we have used the fact that $d_{1/2}(n) \geq 0$. By an Euler product computation we find \begin{align*} \sum_{a,b \leq x} \frac{d_{1/2}(a)d_{1/2}(b)}{[a,b]} &\leq \prod_{p \leq x} \bigg( \sum_{i,j \geq 0} \frac{d_{1/2}(p^i)d_{1/2}(p^j)}{[p^i,p^j]} \bigg) = \prod_{p \leq x} \bigg( 1 + \frac{5}{4p} + O\Big( \frac{1}{p^2}\Big) \bigg) \\ &\ll (\log x)^{5/4} \ll (\log q)^{5/4}, \end{align*} and the proof is complete. \end{proof} We now proceed to show \eqref{eq: cal E is smaller than J}. For notational simplicity we write \begin{align*} \mathcal{F} &= (4N)^N \frac{(yx^{-\delta})^{-A/\log q}}{(\delta \log x)^N}. \end{align*} We make the change of variables $z = t+v$, obtaining \begin{align*} \mathcal{E} = &\,\mathcal{F}\int_{-\infty}^{\infty} \int_{-\infty}^\infty \frac{\big| W (1/2 + A/\log q + it ) \big|^6}{\big(A^2/(\log q)^2 + (z-t)^2\big)^{(N+1)/2}} \\ &\qquad\qquad \sideset{}{^*}\sum_{\chi(\text{mod}\ q)} \bigg|L \Big(\frac{1}{2} + \frac{A}{\log q}+it,\chi\Big) \bigg|^2 \bigg|L \Big(\frac{1}{2} + iz,\chi\Big) \bigg| dz dt. \end{align*} By H\"older's inequality we obtain \begin{align}\label{eq: bound for cal E} \mathcal{E} &\leq \mathcal{F} \mathcal{E}_1^{2/3} \mathcal{E}_2^{1/3}, \end{align} where \begin{align*} \mathcal{E}_1 =&\, \sideset{}{^*}\sum_{\chi(\text{mod}\ q)} \int_{-\infty}^{\infty}\bigg|W \Big(\frac{1}{2} + \frac{A}{\log q}+it\Big) \bigg|^6\bigg|L \Big(\frac{1}{2} + \frac{A}{\log q}+it,\chi\Big) \bigg|^3\\ &\qquad\qquad \int_{-\infty}^\infty \frac{dz}{\big(A^2/(\log q)^2 + (z-t)^2\big)^{(N+1)/2}}\,dt, \end{align*} and \begin{align*} \mathcal{E}_2 &=\sideset{}{^*}\sum_{\chi(\text{mod}\ q)} \int_{-\infty}^\infty\left|L (\tfrac{1}{2} + iz,\chi) \right|^3 \int_{-\infty}^{\infty} \frac{\big| W (1/2 + A/\log q + it ) \big|^6}{\big(A^2/(\log q)^2 + (z-t)^2\big)^{(N+1)/2}}\,dtdz . \end{align*} It is easy to bound $\mathcal{E}_1$. By changing variables we obtain \begin{align*} \int_{-\infty}^\infty \frac{dz}{\big(A^2/(\log q)^2 + (z-t)^2\big)^{(N+1)/2}}&= \Big( \frac{\log q}{A}\Big)^N \int_{-\infty}^\infty \frac{du}{(1+u^2)^{(N+1)/2}} \leq \Big( \frac{\log q}{A}\Big)^N, \end{align*} and therefore \begin{align}\label{eq: upper bound for cal E 1} \mathcal{E}_1 &\leq\Big( \frac{\log q}{A}\Big)^N J \Big(\frac{A}{\log q}\Big). \end{align} Let us turn to $\mathcal{E}_2$. A change of variables yields \begin{align*} &\int_{-\infty}^\infty\frac{\big| W (1/2 + A/\log q + it ) \big|^6}{\big(A^2/(\log q)^2 + (z-t)^2\big)^{(N+1)/2}}\,dt\\ &\qquad\qquad= \Big( \frac{\log q}{A}\Big)^N \int_{-\infty}^\infty \frac{\left|W \left(1/2 + A/\log q + iz + iAu/\log q \right) \right|^6}{(1+u^2)^{(N+1)/2}}\,du. \end{align*} We wish to replace the argument in $W$ by $1/2 + A/\log q + iz$. Thus, we examine the quotient \begin{align*} &\frac{\left|W \left(1/2 + A/\log q + iz + iAu/\log q \right) \right|}{\left|W \left(1/2 + A/\log q + iz \right) \right|} \\ &\qquad\qquad= \left|\frac{q^{\rho(A/\log q + iz + iAu/\log q)}-1}{q^{\rho(A/\log q + iz)}-1} \right| \left|\frac{A/\log q + iz}{A/\log q + iz + iAu/\log q} \right|. \end{align*} If $A \geq A_0(\rho)$, then \begin{align*} \left|\frac{q^{\rho(A/\log q + iz + iAu/\log q)}-1}{q^{\rho(A/\log q + iz)}-1} \right| \ll 1. \end{align*} Also, by considering the two cases $|Au/\log q - z| \geq |z|/3$ and $|Au/\log q - z| \leq |z|/3$, say, we find that \begin{align*} \left|\frac{A/\log q + iz}{A/\log q + iz + iAu/\log q} \right|\ll 1 + |u|, \end{align*} and hence \begin{align*} &\int_{-\infty}^\infty \frac{\left|W \left(1/2 + A/\log q + iz + iAu/\log q \right) \right|^6}{(1+u^2)^{(N+1)/2}}\,du \\ &\qquad\qquad\ll \bigg|W \Big(\frac{1}{2} + \frac{A}{\log q}+iz\Big) \bigg|^6 \int_{-\infty}^\infty \frac{(1+|u|)^6}{(1+u^2)^{(N+1)/2}}du\ll \bigg|W \Big(\frac{1}{2} + \frac{A}{\log q}+iz\Big) \bigg|^6. \end{align*} We have therefore obtained \begin{align}\label{eq: intermed bound for cal E 2} \mathcal{E}_2 &\ll \Big( \frac{\log q}{A}\Big)^N\sideset{}{^*}\sum_{\chi(\text{mod}\ q)} \int_{-\infty}^{\infty} \bigg|W \Big(\frac{1}{2} + \frac{A}{\log q}+iz\Big) \bigg|^6 \bigg|L \Big(\frac{1}{2} + iz,\chi\Big) \bigg|^3 dz. \end{align} The right side of \eqref{eq: intermed bound for cal E 2} is similar to $J\left(0 \right)$, but the argument of $W$ is perturbed. If we had precisely $J( 0)$, we could apply [\textbf{\ref{hb}}; Lemma 4] to relate $J(0)$ to $J(A/\log q)$. We claim the bounds \begin{align}\label{eq: use convexity} \int_{-\infty}^\infty &\left|W \Big(\frac{1}{2} + \frac{A}{\log q} + iz\Big) \right|^6 \sideset{}{^*}\sum_{\chi (\text{mod }q)} \left|L \Big(\frac{1}{2} + iz,\chi\Big) \right|^3 dz \nonumber \\ &\ll e^{3A/2 + O(\rho A)} \int_{-\infty}^\infty \left|W \Big(\frac{1}{2} + \frac{2A}{\log q} + iz\Big) \right|^6 \sideset{}{^*}\sum_{\chi (\text{mod }q)} \left|L \Big(\frac{1}{2} + \frac{A}{\log q} + iz,\chi\Big) \right|^3 dz \nonumber \\ &\leq e^{3A/2 + O(\rho A)} J\Big(\frac{A}{\log q} \Big). \end{align} The proof is very similar to the proof of [\textbf{\ref{hb}}; Lemma 4], so we do not give it. The only real difference is that we must do more careful bookkeeping with the constants. To prove \eqref{eq: use convexity} we also use the bounds \begin{align*} \left|W \Big(\frac{1}{2} + \frac{2A}{\log q} + iz\Big) \right| &\ll e^{O(\rho A)} \left|W \Big(\frac{1}{2} + \frac{A}{\log q} + iz\Big) \right|, \\ \left|W \Big(\frac{1}{2} + iz\Big) \right| &\ll e^{O(\rho A)} \left|W \Big(\frac{1}{2} + \frac{A}{\log q} + iz\Big) \right|, \end{align*} which hold for $A \geq A_0(\rho)$. By \eqref{eq: intermed bound for cal E 2} and \eqref{eq: use convexity} we therefore obtain \begin{align}\label{eq: bound for cal E 2} \mathcal{E}_2 &\ll e^{3A/2 + O(\rho A)}\Big( \frac{\log q}{A}\Big)^N J \Big(\frac{A}{\log q} \Big). \end{align} We compare \eqref{eq: bound for cal E}, \eqref{eq: upper bound for cal E 1} and \eqref{eq: bound for cal E 2} and find \begin{align*} \mathcal{E} &\ll \mathcal{F} e^{A/2+ O(\rho A)}\Big( \frac{\log q}{A}\Big)^N J \Big(\frac{A}{\log q} \Big). \end{align*} Recalling our definitions, we have \begin{align*} \mathcal{E} &\leq C e^{-(1+O(\rho \delta^{-1}))\delta A}\Big(\frac{8N}{\delta A} \Big)^N J \Big(\frac{A}{\log q} \Big) \end{align*} for some absolute constant $C > 0$. We obtain \eqref{eq: cal E is smaller than J} by choosing $\rho$ to be sufficiently small in terms of $\delta$, and then choosing $A$ to be sufficiently large in terms of $\rho$ and $\delta$. \section*{Acknowledgments} The second author was supported by NSF grant DMS-1501982. The authors would like to thank Sandro Bettin and Maksym Radziwi\l\l\, for various helpful comments.
\section{Introduction} There is a large number of parameters which can be set and changed when configuring the network of a server and this leads to a huge number of possible configurations. Genetic algorithms (GAs) \cite{smith,genintro,zengen} are most often used to solve search and optimization problems \cite{goldberg}. In this paper, we will resort to those algorithms to discover the most efficient set of parameter combinations for the given problem. The premises of GAs when applied to network configuration is that better configuration sets will have a higher chance of survival and being optimized through multiple rounds (generations) of selection, crossover and mutation. GAs are being used for the sake of efficiently searching through the immense number of available combinations, when brute force testing of all the different combinations is unfeasible. A major part in choosing the right network configurations is to find the most relevant network parameters. The goal of the optimization may be to prioritize the throughput for fast transfer of data but giving latency some level of importance might also be relevant. This choice depends on the nature of the service at hand. The default network settings are usually generic and static regardless of the traffic going through and hence they do not generally optimize the network performance for all kinds of network load. A correct configuration setting can fully utilize the system resources and hence lead the system to the best Quality of Service (QoS) for properties such as short request response time and high throughput. In this paper, we will be performing various tests both on physical machines and Virtual Machines (VMs) to compare the diverse options which can be derived for different purposes. Physical machines can give us better performance, but there are many benefits of using VMs. VMs enable multiple workloads to be consolidated on less servers and safe isolation of co-located workloads. This improves resource utilization, reduces idle power costs and makes it possible to test risky configurations. There are many ways to increase throughput, for example the quality can be sacrificed \cite{goldberg}, or various parameters can be tuned \cite{netcards,tcptune}. There are some systems that improve simply by changing the different configurations \cite{boostperf,autotune} and tuning them in accordance to what one wants to achieve. The main problem is to tune those different parameters dynamically in accordance to the payload which is received. At this juncture, we shall review some related research. GAs have been applied in the literature to tighten security \cite{adam} via manipulating the configuration parameters of Apache 2.0. The work reported in \cite{apachecon} presents learning through Reinforcement Learning (RL) to improve different configuration parameters. It uses the RL approach for autonomic configuration and reconfiguration of multi-tier web systems. It is able to adapt performance parameter settings not only to the change of workload, but also to the change of VM configurations. The approach is evaluated using the TPC-W benchmark on a three-tier web-site hosted in a Xen-based VM environment \cite{apachecon}. The results of the experiments demonstrate that the approach can auto-configure the web system dynamically in response to the change in both workload and VM resources. The focus is on Apache parameters, but the auto-configuration part is relevant to what we are trying to achieve herein. Each generation of network cards has different features, and if not fully configured the network performance might become a severe bottleneck. However for Linux, where the operating system runs on various types of machines, the default configurations are not tuned to for 10 Gbit/s network cards, or 1 Gbit/s in our case. \cite{netcards} describes the basic settings that can be changed in a Linux environment in order to maximize the throughput speed. The performance of the receive side TCP processing has usually been overruled by "per-byte" operations, such as check-summing and copying. But as the architecture in modern processors has changed, "per-packet" operations are becoming the main source of overhead \cite{tcpreceive}. Two optimization techniques are represented to improve the receive side TCP performance. A similar benchmark for testing the TCP streaming receive throughput with netperf is used. Results of another study \cite{tcpoverhead} shows that TCP is not the source of overhead often observed in packet processing, and it could support a lot higher speeds if correctly implemented. The reminder of this article is organized as follows. In Section \ref{sec:Genetic algorithm}, a short overview of the principles of GAs is given. Section \ref{Sec:Approach} provides an overview of our solution. Section \ref{sec:Experiments} gives an overview of the experimental set-up and reports the experimental results. Section \ref{Sec:Conclusion} concludes the article and gives an overview of future research directions worth exploring. \section{Genetic algorithms (GAs)} \label{sec:Genetic algorithm} GAs are inspired by the process of natural selection and are a version of Evolutionary Algorithms (EAs) \cite{genintro}. They are most often used to solve search and optimization problems by generating high quality solutions using biologically inspired operators such as selection, crossover and mutation. The common underlying idea behind this is: given a population of individuals within some environment that has limited resources, competition for those resources causes natural selection (survival of the fittest). This results in a rise of fitness of the population. Then based upon fitness of the candidates the better candidates are chosen to seed the next generation. After a given amount of generations the GA will come to a point where it is not getting considerably fitter offspring, that is when the GA stops. GAs have also been successfully applied to many theoretical optimization problems \cite{goldberg} and several industrial applications \cite{davis1991handbook}. \subsection{Representation} In genetics a genotype is the part of the genetic makeup of a cell, and phenotype is what determines its characteristics. \begin{figure}[th!] \includegraphics[width=0.48\textwidth]{Bilder/genrep} \caption{Genotype Representation} \label{fig:genrep} \end{figure} By using GAs we can represent our configurations on a genetic level, as a genotype as seen in Figure \ref{fig:genrep}. The array data type is called a chromosome, and each chromosome consists of multiple genes, while the possible values for each gene are called alleles. A programmer can represent all individuals in a population in many different ways, some of them being; binary, integer, permutation, real-valued or floating-point. In our algorithm each chromosome is a representation of a parameter combination, whereas a gene is a single parameter among many. \subsection{Life cycle} The genetic operator is an operator used in GAs that leads the algorithm toward a solution. The three types of operators are selection, crossover and mutation operators. These operators contribute to crossing existing solutions into new solutions (crossover), diversifying the population (mutation) and selecting the best solutions for every generation (selection). \begin{figure}[th!] \includegraphics[width=0.48\textwidth]{Bilder/flow1} \caption{The algorithmic life cycle, representing the different processes taking place from initialization of a population until its termination.} \label{fig:flow1} \end{figure} In Figure \ref{fig:flow1} a population goes through evaluation and selection, this operation gives better individuals stronger preference and allows them to pass their genes on to the next generation. How good an individual is depends on their fitness, and there are different methods to choose from, such as fitness proportional selection, ranking selection, tournament selection etc. For every method there is a different criteria of what being fit is. The fittest parents are chosen and a crossover operation is performed on parents based on the crossover method. Crossover or recombination is an operation that merges information from two parent genotypes into one or two offspring genotypes. Crossover is a stochastic operator where the algorithm decides what part of each parent will be combined. The main idea behind this is to partner up two different individuals with desirable features to create an offspring which combines those features. This has been done over millennia to plants and by livestock breeders to produce species that give higher yield or have other desirable features \cite{smith}. The next operator in the cycle is mutation, which contributes to diversity from one generation to another in the GA. The goal is to change one or multiple gene values to something different. The mutation probability is defined in the algorithm. At the end of the cycle new parents will be chosen depending on their fitness, resulting in new fitter individuals merging with the population while the less fit individuals are removed. \section{Approach} \label{Sec:Approach} \subsection{Selection of configuration parameters} Netperf is used for measuring the network speed. It is a software application that can be used to measure different aspects of network performance. It supports Unix domain sockets, but is mostly used on bulk data transfer request/response using TCP or UDP and Berkeley Sockets interfaces \cite{netperf}. It provides numerous predefined tests. Just like in the case of cluster-based web service performance, the performance improvement can not easily be achieved by tuning individual components \cite{clusterserv}, there is no single universal configuration that is good for all workloads. Therefore the genetic algorithm is used to find the optimal configuration setup for a given payload which is going through the server. There are many relevant parameters described in \cite{tcptune,netcards} and some of them are: \begin{itemize} \item \textbf{Jumbo Frames -} Jumbo frames are Ethernet frames with a payload of more than 1500 bytes, which is the standard limit \cite{jumbo}. Per definition, jumbo frames can carry up to 9000 bytes. In combination with Gigabit Ethernet switches, network interface controllers (NICs) can support frames bigger than the default, making jumbo frames possible. The network parameter determining the frame size is the Maximum Transfer Unit (MTU). \item \textbf{Multi streams -} The throughput of a network depends on the type of traffic that is flowing through the wire. The number of streams is important, that is, how many end to end socket connections which are established and uses the network at the same time\cite{tcptune}. The Netperf tool has a mode where one can use up to 8 active streams. \item \textbf{Transmission queue size -} The transmission queue is a buffer which holds packets that are scheduled to be sent to the card. If one wants to avoid the packet descriptors being lost, the size of the buffer should be tuned. The default size of 1000 packets can be too small. \item \textbf{TX Checksum -} This is a checksum offload parameter that when set asks the card to compute the segment checksum before it is sent. When this is enabled, the kernel enters a random value in the checksum field of the TCP header and leaves it to the network adapter to calculate the correct checksum. \item \textbf{TCP Segmentation Offload - } This is a parameter which may be used to reduce the CPU overhead when running TCP/IP. The task of splitting a large chunk of data into TCP segments, which normally is done by the OS, is handed over to the NIC, which splits the data into segments and add fills in the TCP header fields correctly. \item \textbf{Large Receive Offload - } If this parameter is set and supported by the NIC, it combines multiple Ethernet frames received into one large frame, offloading this work for the OS and the CPU. It is a technique which increases inbound throughput of high-bandwidth network connections. There are two types of LRO, one that is usually turned on by default and another which is specific for the given device driver. The last one yields much better results as it accumulates the frames inside the NIC. \item \textbf{Generic Segmentation Offload (GSO) - } It has been observed that a lot of savings in TSO come from traversing the network stack once rather than multiple times\cite{gso}. GSO is, like TSO, only effective if the MTU is around the default value of 1500. \item \textbf{TCP Window Scaling - } Is an option that can increase the size of the receive window allowed in TCP beyond its default value of 65535 bytes. The throughput is limited by two windows, the receive and the congestion window. The receive window tries not to go past the limit of the receiver to process data, while the congestion window tries not to breach the limit of the network (congestion control). \item \textbf{TCP Timestamp - } Enabling this can provide a more accurate round trip time measurement, but it also adds an overhead to the throughput and CPU usage. This option should be disabled if one wants to increase the speed. \item \textbf{Memory - } There are three parameters, exemplified by \textit{net.ipv4.tcp\_mem = 287121 382828 57424}, which define how the kernel should manage the memory usage of the TCP stack. The first value tells the kernel that below this number of memory pages, no restriction on memory should be imposed. The second value defines the starting point at which the kernel should start pressuring memory usage down. The final defines the maximum amount of memory pages for all sockets. \item \textbf{Read and Write Memory - } two parameters control the read and write memory buffers, \textit{net.ipv4.tcp\_rmem} and \\ \textit{net.ipv4.tcp\_wmem}. Read memory takes care of the size of the receive buffer used by TCP sockets, while write memory adjusts the amount of memory reserved for send buffers. Each have three values, exemplified by \textit{net.ipv4.tcp\_rmem = 4096 87380 16777216}. The first value tells the kernel the size of the minimum receive buffer for a TCP connection which is allocated to a TCP socket. The second is the default receive buffer and the third is the maximum receive buffer. Similarly \textit{net.ipv4.tcp\_wmem} determines the size of the TCP send buffer of TCP sockets in use. \end{itemize} \subsection{The fitness function} There are many ways to measure network performance as every network is different in nature and design. And how important the various metrics are depends on what the network is used for, for instance what kind of service the servers involved provide. A few of the most used metrics are the following: \begin{itemize} \item \textbf{Throughput} is usually measured in bits per second and is the amount of data which is transmitted through a network per unit time. \item \textbf{Latency} is the response time, the delay between sender and receiver, expressing how fast the signal travels from one end to another. \item \textbf{Bandwidth} determines that maximum possible throughput that is achievable, one can not send more data than the specified bandwidth size. \item \textbf{Jitter} is the variation in packet delays, normally an undesired deviation. \item \textbf{Packet loss} is when packets of data transmitted through a computer network fail to reach their destination. \item \textbf{Quality of Service} (QoS) is a measure of the overall performance of a service as seen by the users. \end{itemize} We decided to only focus on throughput, i.e. the fitness function equals the measured throughput of the network for a given set of parameters. However, a few tests where made checking whether the change of parameters leading to higher throughput also affected the latency. The tests measuring the fitness function are applied to TCP streams, having in mind traffic such as large video files being transferred in a network. The tools used in this paper to measure throughput are iPerf \cite{iperf} and netperf\cite{netperf}. iPerf is a tool to measure the maximum achievable bandwidth on a network. There are various parameters which can be customized, buffers and protocols such as TCP and UDP. iPerf measures bandwidth, packet loss, transfer size and other parameters. It has a client-server functionality and can generate data streams in order to measure the throughput, in one or two directions. Netperf is another software application that measures network throughput between two hosts. It has a variety of tests to measure unidirectional data transfer and request/response performance. In order to measure latency, ping and hping3 are used, simply measuring the round-trip time for messages sent from the originating host to the destination computer. An Internet Control Message Protocol (ICMP) echo request packet is sent waiting for an ICMP echo reply. \subsection{The algorithm} Figure \ref{fig:flow1} shows a simplified flowchart for the entire algorithm. It starts with the initialization of the population. Each parent is a chromosome that consists of a set of parameters, whereas a gene is one of these parameters. Several sources\cite{netcards, tcptune} were studied in order to select adequate parameters. The list of 14 different parameters shown below were used for initial experiments and this list was at a later stage extended to a total of 27 parameters. For every run of the algorithm, each parameter from the list can be extracted, but it is the algorithm that decides whether all the parameters will be used or just a selected few, based on the fitness. \lstset{basicstyle=\small} \begin{lstlisting}[ caption=Parameter list,numbers=none] sysctl -w net.ipv4.tcp_mem=;'287121 382828 574242';'16777216 16777216 16777216' sysctl -w net.ipv4.tcp_rmem=;'4096 87380 6291456';'8192 873800 16777216' sysctl -w net.ipv4.tcp_wmem=;'4096 16384 4194304';'8192 873800 16777216' sysctl -w net.ipv4.tcp_moderate_rcvbuf=;0;1 sysctl -w net.ipv4.tcp_no_metrics_save=;0;1 sysctl -w net.ipv4.tcp_timestamps=;0;1 sysctl -w net.ipv4.tcp_window_scaling=;0;1 sysctl -w net.ipv4.tcp_sack=;0;1 sysctl -w net.core.wmem_max=;212992;16777216 sysctl -w net.core.rmem_max=;212992;16777216 sysctl -w net.core.rmem_default=;212992;412992 sysctl -w net.core.wmem_default=;212992;412992 sysctl -w net.core.netdev_max_backlog=;1000;5000 ifconfig eno2 mtu ;1500;2700 \end{lstlisting} At the end of each line, the minimum and maximum values used for each parameter is shown. When initializing the first generation, the genetic algorithm chooses a random value between the minimum and the maximum value. When all the parents have been initialized and placed in the population pool, the next step is to measure the fitness for every member of the population. One by one, each parent is tested by applying all its network parameter genes to the server and then performing a netperf test, normally ten seconds long. The throughput speed recorded by netperf is then stored for each parent as its fitness function. The next phase of the genetic life cycle is the selection. The percentage of the population that should be disposed of for every generation is one of the configuration parameters of the algorithm. In the experiments presented in this paper, a value of 10\% was used. This means that 10 percent of the worst fit individuals is removed in every generation. After the selection, the population is restored by selecting the best 10\% of the parents for generation of the same number of offspring. All the pairs of this selection of parents makes a pair of children by going through a crossover process where there is a given chance for a switch of genes between the two parents leading to their offspring. In our experiments this probability was set to 50\%. In the final phase a mutation may occur to any of the specimen, the probability was set to 16\% in our case. In this process, if a parent is selected for mutation, one gene of the chromosome is given a new random value. This cycle repeats a number of times. In a real life system this would go on forever, but in our algorithm we terminate the loop after an number of iterations, mostly determined by how stable the results are. \section{Experiments} \label{sec:Experiments} \subsection{Experimental setup} The experimental setup is shown in Figure \ref{fig:topology3}. There are two physical servers running Ubuntu 16.04 which are connected through a switch to the internet. Another switch connects the 1 gigabit ethernet ports of the servers to each other. The specifications for these machines are listed in Table \ref{table:machspec}. \begin{table}[!pht] \scalebox{0.7}{ \begin{tabular}{ |c|c| } \hline OS & Ubuntu 16.04 xenial\\ \hline CPU & 2x Intel Xeon CPU E5530 @ 2.394GHz\\ \hline NICs & Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet x4 \\ & Intel Corporation 82576 Gigabit Network Connection x4 \\ \hline RAM & 290MiB / 24098MiB \\ \hline Disk space & 151 GiB \\ \hline \end{tabular} } \caption{The machine specifications of our servers}\label{table:machspec} \end{table} Both of these machines have four Network Interface Controllers (NICs). The payload of the experiments is generated using iperf. On the computer running the clients, three of the four NICs available are bound to an iperf process, and the last one is used for ssh access. In this way they can separately generate traffic. Two VMs are included in the topology for the purpose of testing the algorithm and its behaviour on virtual machines. \begin{figure}[th!] \center \includegraphics[width=0.48\textwidth]{Bilder/topology3} \caption{The topology for the setup using two physical machines with 1 Gigabit ethernet ports. The machines are connected through a switch which forwards the data traffic of the experiments.} \label{fig:topology3} \end{figure} \subsection{Test scenarios} Just as for cluster-based web service performance, the performance improvement can not easily be achieved by tuning individual components\cite{clusterserv}. There is no single universal configuration that is best for all workloads. Therefore, the genetic algorithm is used to find the optimal configuration setup for a given payload on the server. The different parameters used are shown in Table \ref{table:newpams} and there are 27 of them. If all the parameters were binary, there would be $2^{27}$ possible combinations. More than a 100 million combinations would evidently be impossible to test one by one in order to find the best network configuration. Additionally some of the parameters have thousands of possible values, making the total number of combinations immense and the need for a smarter algorithm obvious. \begin{table}[!pht] \center \begin{tabular}{ |c|c|} \hline Type & Parameters \\ \hline \multirow{3}{4em}{TCP - net.ipv4} & tcp\_mem \\ & tcp\_rmem \\ & tcp\_wmem \\ & tcp\_moderate\_rcvbuf \\ & tcp\_no\_metrics\_save \\ & tcp\_timestamps\\ & tcp\_window\_scaling \\ & tcp\_sack\\ & tcp\_tw\_reuse \\ & tcp\_keepalive\_probes \\ & tcp\_keepalive\_intvl \\ & tcp\_fin\_timeout \\ \hline \hline \multirow{3}{4em}{net.core} & wmem\_max \\ & rmem\_max\\ & rmem\_default \\ & wmem\_default \\ & netdev\_max\_backlog \\ & bpf\_jit\_enable \\ & dev\_weight \\ & rps\_sock\_flow\_entries \\ & optmem\_max \\ & somaxconn \\ & busy\_read \\ & busy\_poll \\ & tstamp\_allow\_data \\ \hline \hline MTU & mtu\\ Txqueuelen & txqueuelen \\ \hline \end{tabular} \caption{Listing of all the different parameters used in the experiments} \label{table:newpams} \end{table} Two different tests will be performed in this topology. In the first one the throughput speed between our physical machines while we load them with traffic is tested. In the second test the same is done using virtual machines. The performance is tested both when changing the parameters directly on the VMs as well as on the host machine. It is a way to establish whether changes on just the VMs actually have as much effect as changes on the host machine they are operating on, and also to see to what extent changing parameters on the host machine affects the performance on the VMs. The two scenarios that are to be performed are as follows: \begin{itemize} \item Configurations changed directly inside the VM \item Configurations changed on the host machine (server) \end{itemize} For all the experiments performed, the following parameters were used as input to the genetic algorithm: \begin{itemize} \item Parameter number: 27 \item Generations: 40 \item Population size: 80 \item Selection probability: 10\% \item Crossover probability: 50\% \item Mutation probability: 16\% \end{itemize} The same values were used for all the experiments, making it straightforward to compare the results of the various scenarios. The values where chosen after some initial tests since they yielded the best results. \subsection{Results} Initial experiments showed that the algorithm was able to improve the total client-server throughput by a few percent when the fitness function was calculated based on a netperf stream which was the only one using the network and hence used the complete 1 Gbit/s bandwidth. For the main part of the experiments, and for all results shown in this section, three independent TCP connections were set up between the two physical servers. The netperf stream used for calculating the fitness function then had to compete with the other traffic. In this scenario, the genetic algorithm was able to improve the performance of the default Linux network configuration substantially. This can be seen in Figure \ref{fig:normal2}, where the throughput of the best individuals (the best parameter combination found for every generation) clearly are much better than the throughput obtained when using the default configurations of the Linux OS. On average, the performance of the top individuals are larger by 65\% in Figure \ref{fig:normal2}, but the throughput speed does not increase substantially over the generations. This means that a good parameter combination is found already among one of the first 80 randomly initialized parents. \begin{figure}[th!] \includegraphics[width=0.48\textwidth]{Bilder/normal2.png} \caption{The best, worst and default individuals for every generation. The best parameter settings display on average a 65\% higher throughput speed than those of the default OS settings.} \label{fig:normal2} \end{figure} In order to see wether there are any drawbacks when imporoving the throughput, the latency was tested using hping3 on the server loaded with network traffic, using the default and the optimal configurations learned from the algorithm. One of the results is shown in Listing \ref{lst:lattest}. \begin{lstlisting}[caption=Latency test from Client to Server, label=lst:lattest,numbers=none] sudo hping3 -c 10000 -i u10000 10.0.0.1 -p 8000 Fast parameter combination round-trip min/avg/max = 1.2/6.8/1005.8 ms Default round-trip min/avg/max = 1.3/7.0/1006.1 ms \end{lstlisting} Other tests also showed that the latency was not affected when increasing the throughput. Two types of experiments were performed on the virtual machines. One in which the network parameters of the OS of the VM itself was changed, and another where the parameters of the OS of the host machine or hypervisor of the VM was changed. In some cases changing parameters of the OS of the VM does not change the actual behaviour of the underlying hypervisor, so potentially these could lead to different results in the two cases. \begin{figure}[th!] \includegraphics[width=0.48\textwidth]{Bilder/figvmtest2} \caption{The best, worst and default individuals for each generation when changing the configuration of the OS of the VM.} \label{fig:figvmtest2} \end{figure} As seen in Figure \ref{fig:figvmtest2}, the throughput does increase substantially when optimizing the parameters inside the VM. Here a few generations are needed before the optimal configuration is found. It is surprising that the throughput of the traffic entering the VM-based server is so high. Some specific network configuration benefits this stream compared to the background traffic of the iperf-clients, and more research is needed to find the exact reason. However, in our case, the most important result is to see how the algorithm improves the throughput compared to the that of the default VM configuration. In the other set of VM experiments, the default configuration of the VM itself was kept unchanged and instead the algorithm was applied to the network parameters of the OS of the hypervisor. \begin{figure}[th!] \includegraphics[width=0.48\textwidth]{Bilder/vmhyp.png} \caption{The average population throughput of every generation. Comparing the configuration of the VM-OS to the configuration of the host machine-OS.} \label{fig:vmhyp} \end{figure} In Figure \ref{fig:vmhyp} it can be seen that the throughput of the average population is much smaller when the configurations takes place within the VM. This might as mentioned earlier be due to the fact that the effect of changing some of the parameters of the VM-OS does not take effect in the OS of the host machine or hypervisor. \begin{figure}[th!] \includegraphics[width=0.48\textwidth]{Bilder/vmhyptop.png} \caption{The best individuals of each generation. Comparing the configuration of the VM-OS to the configuration of the host machine-OS.} \label{fig:vmhyptop} \end{figure} The difference between the throughput speed in Figure \ref{fig:vmhyptop} for the top individuals is approximately 30\%, between VM and host machine. This means that by changing the parameters directly on the physical machine, we get higher performance in comparison to changing it on the VM. The speed of the top individuals in both cases are also much higher than the default settings, by 60\% on the host machine and by 180\% on the VM. \section{Conclusion and Future Work} \label{Sec:Conclusion} The main objective of this paper was to improve the throughput speed by finding the optimal set of configurations depending on the network traffic, using a genetic algorithm. After various experiments we were able to conclude that the throughput speed did improve considerably compared to that of the default settings of the Linux OS. In fact, we were able to achieve a throughput speed increase by up to 65\% for physical machines and even more for virtual machines. The fitness of the whole population raises from one generation to another, but the performances of the top individuals are quite stationary. After discovering the top individuals in the first generation, the speed does not increase significantly through more generations. This means that for the type of traffic considered here, testing 80 randomly generated configurations is enough for obtaining a very good configuration. However, for other kinds of network traffic and for traffic changing dynamically, a more advanced algorithm like the one demonstrated here, would be needed. A not fully optimized throughput speed on a machine can be caused by many factors as the different relevant parameter values could be too low, not allowing for maximum send/receive capability. A wrong chain of configurations could also be the problem, and that is something which is impossible or very hard to detect manually due to the immense number of available combinations. Hence a genetic algorithm is being used to search for the best solution. Each set of parameters is represented as a chromosome, those chromosomes go through multiple crossover, mutation and selection processes and the most fit configuration is selected in every generation. Going through those various operations means that our GA can find an optimized version of configurations exclusively for the type of traffic that is going through the server at a given time. An adaptive approach to change network parameters dynamically has been developed, which resulted in a significant increase of speed compared to the default settings. Our experiments furthermore indicates that the latency is not affected negatively by the optimization of the throughput. \subsection{Future Work} Some experiments were done in order to test the effect of changing the percentages of several of the parameters of the genetic algorithm, like crossover and mutation probabilities, but this work should be extended in order to improve the algorithm. Adding more networking parameters to the configuration set could improve the results, and in addition the GA could benefit from supporting automatic parameter extraction. In this work they were extracted from a predefined list, but every OS-version potentially has different parameters. This could be done by searching through all available parameters on the systems, saving them to a list and testing different values for each of them. Another approach that should be pursued, is to address the layer above the operating system, changing the configuration of applications running on the OS. For example, if an Apache web-server was used, the algorithm could include changing the default Apache configurations on top of the configurations of the OS, improving the overall throughput even further. \paragraph{Ability to adjust latency and throughput ratio} The fitness function of this work equals the throughput. A more general solution would be to include latency in the calculation of the function. Additionally, it should be possible to adjust the importance of each of these features for the server-admin which runs such an algorithm. Other metrics, like jitter and packet loss, could also be included in the fitness function. \paragraph{A/B testing} An A/B test could have been performed in order to find an algorithm with the best possible factors for selection, crossover and mutation. Having every instance try different probabilities, split the users and test different versions on them to see which one is preferable. One instance could have higher throughput, another have higher latency and a third one something in between. \paragraph{Load balancing} It could be efficient to split the traffic and send the streams to different machines so that they all could contribute in the search for an optimal solution. With the introduction of a load balancer between multiple physical machines or VMs the algorithm could be running at multiple instances at once. And if one instance finds a better parameter combination than the one already running, this combination could be distributed to all instances. \bibliographystyle{acm}
\section{Introduction} \label{sec:intro} In the current paradigm of structure formation, most of the baryons at high redshift ($z\gtrsim1.5$; \citealt{Meiksin2009} and references therein) are distributed in a web of diffuse filamentary structures in which galaxies form and evolve. The complex interplay between this rich reservoir of gas and the galaxies themselves is still a matter of investigation, e.g. importance and strength of feedback from active galactic nuclei (AGN), existence of a cold mode of accretion onto galaxies, astrophysics of galactic outflows, build up of super-massive black holes in short timescales, angular momentum evolution (e.g., \citealt{Dekel2009,Brooks2009,DiMatteo2012,Shen2013,Dubois2013,Woods2014,Feng2014,AnglesAlcazar2014,Nelson2016, Stewart2016, Obreja2018}). Intergalactic and circumgalactic large-scale structures thus encode fundamental information to test our current galaxy evolution theories. So far, whether one focuses on large scales, i.e. on the intergalactic medium (IGM), or on smaller scales, ie. on the hundreds of kiloparsecs close to galaxies often referred to as the circumgalactic medium (CGM), the strongest constraints on the physical properties of these diffuse gas phases are obtained by analyzing absorption features along background sightlines (e.g., \citealt{Croft2002, Bergeron2002, Hennawi2006, QPQ2, Tumlinson2011, Farina2013b, Rudie2013, Turner2014, Farina2014, QPQ5, Lee2014}). Direct imaging of the same gas phases greatly complement these absorption studies, allowing a spatial, morphological, physical, and kinematical characterisation, which is simply not possible with sparse one-dimensional information inherent to the absorption technique. Yet, predicted to be diffuse, the IGM and CGM is expected to be hard to detect in emission (SB$_{\rm Ly\alpha}\sim10^{-20}$~erg~s$^{-1}$~cm$^{-2}$~arcsec$^{-2}$; e.g., \citealt{Lowenthal1990, GW96, Bunker1998, Rauch2008}). Nevertheless, recently, the deployment of new advanced integral field spectrographs on 10-m class telescopes, i.e. the Multi-Unit Spectroscopic Explorer (MUSE; \citealt{Bacon2010}) on the ESO/VLT and the Keck Cosmic Web Imager (KCWI; \citealt{Morrissey2012}), opened up the possibility of routinely performing such an experiment by targeting very low levels of surface brightness (SB). Indeed, the latest observations are able to directly studying in emission at least the CGM of galaxies with reasonable observational times ($\sim$tens of hours). In particular, these observations usually show extended Ly$\alpha$\ emission on scales of tens of kiloparsecs around the targeted $z\gtrsim1.7$ galaxies (\citealt{Wisotzki2016, Leclercq2017}), opening up a new parameter space for the study of the CGM gas phases, and ultimately of galaxy evolution. Even before the advent of the current new instrumentations, it has been shown that such extended Ly$\alpha$\ emission on CGM scales is more easily detected around high-redshift quasars or active galactic nuclei (AGN). In this case, the Ly$\alpha$\ emission was detected around most of the objects ($50-70$\%) on $R<50$~kpc (e.g., \citealt{HuCowie1987,heckman91a,heckman91b,Moller2000b,Weidinger05,Christensen2006,North2012,qpq4,fab+16}), extending up to $R>100$~kpc in few rare bright cases known as Enormous Lyman-Alpha Nebulae (ELAN; \citealt{cantalupo14, hennawi+15,Cai2016, fab+2018,Cai2018}). The ELAN are indeed structures characterized by high observed surface brightnesses (SB$_{\rm Ly\alpha}> 10^{-17}$~erg~s$^{-1}$~cm$^{-2}$~arcsec$^{-2}$) spanning continuously out to hundreds of kiloparsecs, and thus resulting in luminosities $L_{\rm Ly\alpha}> 10^{44}$~erg~s$^{-1}$ (\citealt{Cai2016}). The comparison between all these pioneering observations however is hampered by (i) the heterogeneity of the technique used (longslit spectroscopy, narrow-band imaging, integral-field spectroscopy), (ii) by the lower and different sensitivities inherent to the previous observational instruments (SB$_{\rm limit}> {\rm few}\times 10^{-18}$~erg s$^{-1}$ cm$^{-2}$ arcsec$^{-2}$ for some works and SB$_{\rm limit}\gtrsim 10^{-17}$~erg s$^{-1}$ cm$^{-2}$ arcsec$^{-2}$ for others), (iii) by uncertainties in the redshift of the targeted quasars, and (iv) by the difficulties in achieving a clean removal of the unresolved emission from the quasar, which can easily outshine the faint large-scale emission (e.g., \citealt{Moller2000a}). The advent of the aforementioned new sensitive IFU intruments together with the discoveries of the ELAN have motivated intense research on quasar halos, and have resulted in frequent new clear detections of the cool CGM gas. Overall, mainly due to the new sensitivities achieved ($<10^{-18}$~erg s$^{-1}$ cm$^{-2}$ arcsec$^{-2}$), recent studies now routinely show detections on $R\sim50$~kpc around $z\gtrsim3$ quasars (e.g., \citealt{Husband2015, Borisova2016, Fumagalli2016, Ginolfi2018}), i.e. the redshift range for which Ly$\alpha$\ is visible with MUSE. In very rare cases these newly discovered Ly$\alpha$\ nebulosities at $z\sim3$ match the observed SB and extent of the ELAN previously unveiled at $z\sim2$ (\citealt{fab+2018}). In the presence of a quasar, the detected Ly$\alpha$\ emission on halo scales has been usually explained as (i) recombination radiation produced after quasar photoionization ({\it a.k.a.} fluorescence; e.g.,\citealt{Weidinger04, Weidinger05, qpq4, cantalupo14, fab+15b, Borisova2016}), and/or (ii) Ly$\alpha$\ photons resonantly scattered within the gas distribution surrounding the quasar (e.g., \citealt{qpq4, cantalupo14, Borisova2016}), and/or (iii) recombination radiation produced after photoionization by several sources, e.g. quasar and active companions (e.g., \citealt{Husband2015, fab+2018, Husemann2018}). A clear determination of the contribution from the different mechanisms cannot be easily achieved by using only the information enclosed in the Ly$\alpha$\ emission. Indeed Ly$\alpha$\ photons within the CGM gas are likely affected by resonant scattering (e.g., \citealt{Dijkstra2017,Gronke2017} and references therein), which could lead to strong modification of the Ly$\alpha$\ spectral shape (e.g., \citealt{Dijkstra2017} and references therein), and the relative strength of the Ly$\alpha$\ line with respect to other diagnostics (e.g., \citealt{Neufeld_1990}). Notwithstanding these challenges, observations of the extended Ly$\alpha$\ emission -- together with the aforementioned absorption studies (e.g., \citealt{qpq3,QPQ5,QPQ7,qpq9}) -- currently paint a scenario in which quasar's halos are hosting a large reservoir of cool ($T\sim10^4$~K) gas. This gas is possibly tracing a complex set of astrophysical processes: gas/substructures infalling onto the central quasar (e.g., \citealt{Hu1991,Weidinger04,fab+2018}); strong turbulences or outflows (e.g., \citealt{Ginolfi2018}); interactions between substructures (e.g., \citealt{Hu1991,Husband2015,fab+2018,Husemann2018}); large-scale filaments (\citealt{cantalupo14}). Further, in the case of ELANe there are evidences that the Ly$\alpha$\ emitting gas on hundreds of kpc is composed by a population of cool and dense (volume density $n_{\rm H}> 1$~cm$^{-3}$) clumps (\citealt{cantalupo14}). Indeed, if one assumes an ELAN to be powered by the radiation from the associated brightest quasar, the high levels of Ly$\alpha$\ emission together with the current stringent limits on the \ion{He}{ii}/Ly$\alpha$\ ratio can be matched by photoionization models only if very high densities ($n_{\rm H}\gtrsim3$~cm$^{-3}$; thus low ionization parameters log$U\lesssim-2$), and low column densities ($N_{\rm H}\lesssim10^{20}$~cm$^{-2}$) are used (\citealt{fab+15b,fab+2018}). The same framework thus requires the clumps to have compact sizes $R \equiv N_{\rm H}/n_{\rm H}\lesssim20$~pc (\citealt{fab+15b,hennawi+15,fab+2018}). Current simulations are not able to achieve the resolutions needed to resolve such clumps in the CGM of galaxies, predicting low densities ($n_{\rm H}\sim10^{-2}-10^{-3}$~cm$^{-3}$) for such a medium (see discussions in \citealt{cantalupo14,hennawi+15}). This tension between observations and simulations motivated new research on hydrodinamical instabilities (e.g., \citealt{Mandelker2016}). In particular, very high resolution idealised hydrodinamical (\citealt{McCourt2018}) and magneto-hydrodinamical (\citealt{Ji2018}) simulations have shown that a mist of cool gas clouds could form and survive in the halo of galaxies, possibly explaining the high densities required by the observed levels of Ly$\alpha$\ emission around quasars. Also, the effects of the quasar activity (e.g. radiation, outflows) on the diffuse gas phases and on the production of Ly$\alpha$\ photons is not fully understood, and could lead to effects on the morphology and physical properties of the surrounding gas distribution. Extreme examples of what a powerful AGN can do are the high-redshift radio galaxies (HzRGs), whose powerfull radio jet and UV radiation clearly alter the surrounding gas (e.g., \citealt{Nesvadba2017,Silva2018}). These objects show extended Ly$\alpha$\ emission with active kinematics (FWHM$>1000$~km~s$^{-1}$) associated with the radio emission, but a more extended (100 kpc scales) quiescent (FWHM$<700$~km~s$^{-1}$) gas phase consistent with gravitational motions (e.g., \citealt{vanOjik1997, VillarMartin2002, Humphrey2007, VillarM2007}), and/or large-scale structures (\citealt{Vernet2017}). This quiescent large-scale gas phase is similar to what is seen around quasars (\citealt{Husband2015, Borisova2016, fab+2018}). Understanding the effects of AGN disruption mechanisms is fundamental given that these are invoked in cosmological simulations to modify the gas properties around and within massive galaxies to match observational constraints, e.g. star formation, halo mass versus stellar mass relation (e.g., \citealt{Silk1998, Sijacki2007, Booth2009, Richardson2016}). In this context, we have started to survey the $z\sim3$ quasar population with the main aim to characterise (i) the physical properties of the CGM/IGM in emission associated with such expected massive dark-matter halos (M$_{\rm DM}\sim10^{12.5}$~M$_{\odot}$, \citealt{white12,Trainor2012}), and (ii) the frequency of detection of ELAN [${\rm SB}_{\rm Ly\alpha}\gtrsim 10^{-17}$erg s$^{-1}$ cm$^{-2}$ arcsec$^{-2}$\ out to 100~kpc]. In this paper we focus on presenting the observations at the Ly$\alpha$\ transition for the first 61 targeted quasars under the acronym QSO MUSEUM ({\it Q}uasar {\it S}napshot {\it O}bservations with {\it MU}se: {\it S}earch for {\it E}xtended {\it U}ltraviolet e{\it M}ission). This work is part of an on-going multi-technique and multi-wavelength effort to unveil any dependence on the nature of each system (e.g., geometry, environment, radio activity, luminosity) in the detection and properties of extended gaseous structures. This work is structured as follows. In Section~\ref{sec:obs}, we describe our observations and data reduction. In Section~\ref{sec:analysis} we explain our analysis procedures, and the current uncertainties on the systemic redshifts of the quasars in our sample. In Section~\ref{sec:results}, we present the observational results. In particular, we reveal the discovery of extended Ly$\alpha$\ emisssion around our targeted quasars, and show their diverse morphologies, individual radial profiles, stacked profiles, average covering factor for the Ly$\alpha$\ emission, compact line emitters associated with the targeted systems, kinematics, and spectral shape of the Ly$\alpha$\ emission. In Section~\ref{sec:disc} we discuss our results in light of the current statistics for extended Ly$\alpha$\ emission around quasars, and the usually invoked powering mechanisms. Finally, Section~\ref{sec:summ} summarises our findings. Throughout this paper, we adopt the cosmological parameters $H_0=70$~km~s$^{-1}$~Mpc$^{-1}$, $\Omega_M =0.3$ and $\Omega_{\Lambda}=0.7$. In this cosmology, 1\arcsec\ corresponds to about 7.6 physical kpc at $z=3.17$ (median redshift for our sample). All magnitudes are in the AB system (\citealt{Oke1974}), and all distances are proper, unless otherwise specified. \section{Observations and data reduction} \label{sec:obs} The survey QSO MUSEUM ({\it Q}uasar {\it S}napshot {\it O}bservations with {\it MU}se: {\it S}earch for {\it E}xtended {\it U}ltraviolet e{\it M}ission) has been designed to target the population of $z\sim3$ quasars with the aim of (i) uncovering additional ELANe, similar to \citet{cantalupo14} and \citet{hennawi+15}, (ii) conducting a statistical census to determine the frequency of the ELAN phenomenon, (iii) studying the size, luminosity, covering factor of the extended Ly$\alpha$\ emission, and any relationship with quasar properties (e.g., luminosity, radio activity), (iv) looking for any evolutionary trend by comparing this sample with the $z\sim2$ quasar population (e.g., \citealt{fab+16}). We have selected the targets from the last edition (13th) of the catalogue by \citet{VeronCetty2010}, and SDSS-DR12 Quasar catalogue (\citealt{Paris2017}), starting from the brightest quasars with $z<3.4$ not targeted by the MUSE Guaranteed Time Observation (GTO) team (i.e. \citealt{Borisova2016}). In addition, to facilitate detection of the expected low surface brightness features, we require our targeted fields (i) to have low extinction, i.e. $A_{V}<0.2$~mag, computed from the maps of \citet{sfd98}\footnote{We are aware of new extinction maps obtained by \citet{Schlafly2011}. However, here we decided to rely on \citet{sfd98} as their values are on average $14\%$ higher for our sample, thus making our selection more conservative.}, and (ii) to be devoid of stars brighter than 13 mag. Also, we gave higher priority for observations to the less crowded fields. For this purpose, we have visually inspected the density of sources using the optical catalogues available at the time of selection, in particular, SDSS-DR12 (\citealt{sdssdr12}), DSS2 (\citealt{Lasker1996}) and USNO-A2/B1 (\citealt{Monet1998, Monet2003}) catalogs. To conduct the survey QSO MUSEUM, we have been awarded so far a total of 111 hours, of which $68\%$ have been executed. The current resulting sample comprises 61 quasars\footnote{Additional four fields have been observed during our programmes, i.e. Q~1346+001, Q~0106-4137, Q~0029-3857, Q~0153-3951, but these sources happen to be stars and not quasars as listed in the last edition (13th) of the catalogue by \citet{VeronCetty2010}.} with $i$-band magnitude in the range $17.4 < i < 19.0$ (median 18.02), or absolute $i$-band mangnitude normalized at $z=2$ (\citealt{Ross2013}) in the range $ -29.67 \le M_i(z=2) \le -27.03$ (or absolute magnitude at rest-frame 1450~\AA\ in the range $-28.29 \le M_{1450} \le -25.65$), and the redshift spanning $3.03 < z < 3.46$ (median 3.17). Our survey thus expands on the work by \citet{Borisova2016}, both in number of targeted sources (19 vs 61) and by encompassing fainter sources\footnote{The faintest target in \citet{Borisova2016} has $M_i(z=2)= -28.23$.}. In Table~\ref{tab:sample} we summarize the information for our obtained sample. Of the 61 quasars targeted, 15 (or 25\%) are detected in radio, and fullfill the most used radio-loudness criteria $R=f_{\nu, 5 {\rm GHz}}/f_{\nu, 4400\AA}>10$ (\citealt{Kellermann1989})\footnote{The fraction of radio-loud objects in our sample is thus larger than the value for the overall quasar population ($\sim10-20\%$; \citealt{Kellermann1989,Ivezic2002}). We initially aimed at building a characteristic sample of the quasar population, but our project has not been fully completed.}. Some of these radio-loud objects have been covered by the Faint Images of the Radio Sky at Twenty-centimeters (FIRST) survey (\citealt{Becker1994}) with a resolution of 5\arcsec. This resolution is sufficient to start comparing the location/morphology of extended Ly$\alpha$\ emission and radio emission (see Section~\ref{sec:powering} and Appendix~\ref{app:FIRST}). The observations for QSO MUSEUM have been acquired in service-mode under the ESO programmes 094.A-0585(A), 095.A-0615(A/B), and 096.A-0937(B) with the Multi Unit Spectroscopic Explorer (MUSE; \citealt{Bacon2010}) on the VLT 8.2m telescope YEPUN (UT4) during ``dark time''. All the observations consisted of exposures of 900~s each, rotated by 90 degrees with respect to each other. The survey has been designed to get a total exposure time on source per object of 45 minutes. However, SDSS~J0817+1053 and SDSS~J1342+1702 have only two usable exposures. In addition, we integrated longer on UM~683 (180 min) and UM~672 (90 minutes) motivated by the extended Ly$\alpha$\ emission already clearly detected in the preliminary reduction using the v1.0 MUSE pipeline (\citealt{Weilbacher2014}) at the time of first data acquisition. For the same reason, the quasar PKS~1017+109 has been observed for additional 4.5 hours as presented in \citet{fab+2018}. The observations were carried out in weather conditions classified by ESO as clear (CL; $45\%$ of the objects), photometric (PH; $27\%$), clear with high-wind (CL-WI; $18\%$), photometric with high humidity (PH-WI; $5\%$), photometric with high-wind (PH-WI; $3\%$), and thin (TN; $2\%$). The average (median) seeing of these observations is $1.07\arcsec$ ($0.98\arcsec$) (FWHM of a Moffat profile computed from the white-light image obtained by collapsing the final MUSE datacube for each target), which is great given the any-seeing nature of our programmes. In Table~\ref{tab:ObsLog} we summarize the observation log for our survey. We have reduced the data using the MUSE pipeline recipes v1.4 (\citealt{Weilbacher2014}). Specifically, we have performed bias subtraction, flat fielding, twilight and illumination correction, and wavelength calibration using this software. In addition, the pipeline flux-calibrate each exposure using a spectrophotometric standard star observed during the same night of each individual observing block. To improve the flat-fielding and to enable the detection of very low surface-brightness signals, we have performed a flat-fielding correction and subtract the sky with the procedures {\tt CubeFix} and {\tt CubeSharp} within the \textsc{cubExtractor} package (Cantalupo in prep., \citealt{Borisova2016}). We combined the individual exposures using an average $3\sigma$-clipping algorithm. To improve the removal of self-calibration effects, we applied a second time {\tt CubeFix} and {\tt CubeSharp}. In this way, we are left with a final science datacube and a variance datacube. The latter has been obtained by taking into account the propagation of errors for the MUSE pipeline and during the combination of the different exposures. The variance is then rescaled by a constant factor to take into account the correlated noise as done in \citet{Borisova2016}. The final MUSE datacubes result in an average $2\sigma$ surface brightness limit of SB$_{\rm Ly\alpha}=8.8\times10^{-19}{\rm\,erg\,s^{-1}\,cm^{-2}\,arcsec^{-2}}$ (in 1 arcsec$^2$ aperture) in a single channel (1.25\AA) at the wavelength of the Ly$\alpha$\ line for the extended emission around each quasar. The deepest narrow-band (NB) studies in the literature usually use NB filters with FWHM$\sim30$\AA. For comparison, our datacubes have an average $2\sigma$ surface brightness limit of SB$_{\rm Ly\alpha}=4.2\times10^{-18}{\rm\,erg\,s^{-1}\,cm^{-2}\,arcsec^{-2}}$ (in 1 arcsec$^2$ aperture) in NB images of $30$\AA, centered at the Ly$\alpha$\ line for the extended emission around each quasar. In Table~\ref{tab:ObsLog} we list these SB limits for each datacube. \input{Tab_sample_MUSEUM_NEW.tex} \input{Tab_observing_log_MUSEUM.tex} \section{Detecting large-scale emission associated with a quasar} \label{sec:analysis} As many works in the literature have illustrated (e.g., \citealt{HuCowie1987,Moller2000a,heckman91a,bergeron99,Husemann2013,qpq4,fab+16}), the detection of extended emission around a quasar inevitably requires that one removes the unresolved emission from the quasar itself (continuum and line emission) and the contribution of any other continuum sources. To perform these operations and to extract the extended emission from each of the MUSE datacubes, we rely on the same procedures described in \citet{Borisova2016}, which we briefly summarize in the following section, while leaving the presentation of the results to section~\ref{sec:results}. We use this approach to allow for a one-to-one comparison with that work, and to facilitate the creation of a homogeneous sample. \subsection{Empirical point-spread-function subtraction, continuum source subtraction, and extraction of extended emission} \label{sec:cubex} The point spread function (PSF) of the quasar has been subtracted with the {\tt CubePSFSub} method within \textsc{CubExtractor} (Cantalupo in prep.). The algorithm obtains the PSF of the quasar as pseudo-NB images of user-defined wavelength ranges within the MUSE datacube. For each wavelength range, the empirical PSF is then rescaled to the flux within $5\times5$ pixels ($1\arcsec \times 1\arcsec$) around the quasar position and subtracted from a circular region with a radius of about five times the seeing. Here we use the same wavelength ranges as in \citet{Borisova2016} to construct the pseudo-NB images, i.e. 150 spectral pixels ($187.5$~\AA). This method is unsuitable for the study of emission within the region used for the PSF rescaling, as data show complex residuals on these scales ($\sim10$~kpc). In particular, this method assumes the quasar to greatly outshine the host galaxy, whose contribution in the central region is thus considered to be negligible. Subsequently, we have applied the {\tt CubeBKGSub} algorithm within \textsc{CubExtractor} to remove any continuum source in the MUSE datacube. This procedure is based on a fast median-filtering approach described in \citet{Borisova2016}, and allows us to avoid any contamination from continuum sources in the search for extended line emission associated with each quasar. We then run \textsc{CubExtractor} on each of the PSF and continuum subtracted cubes to select, if any, extended Ly$\alpha$\ emission. Specifically, we only use the portion of the cubes at about $\pm11000$~km~s$^{-1}$ ($\pm150$ layers) around the quasar systemic redshift. As \citet{Borisova2016} found Ly$\alpha$\ nebulae with a minimum ``volume'' of $10000$ connected voxels (volume pixels) above a signal-to-noise ratio ${\rm S/N} > 2$ around all of their targets, we first use such selection criteria to identify the Ly$\alpha$\ extended emission around our sample. However, we find that some of our targets are not characterized by such large volumes. For this reason, we have then decreased the threshold on the number of connected voxels in steps of $1000$ to search for detections. All our targets have a detected Ly$\alpha$\ nebula greater than 1000 voxels. We list in Table~\ref{Tab:LyaNeb} the number of connected voxels for each of them. These numbers should be considered with caution as, by construction, the extraction process is strongly dependent on the correct determination of the noise in MUSE datacubes. In this respect, we rely on the variance cube produced by our pipeline. This cube is propagated during the reduction steps and then rescaled to take into account the correlated noise (see details in \citealt{Borisova2016}). \textsc{CubExtractor} generates a three-dimensional (3D) mask that includes all the connected voxels satisfing the selection criteria, and which can be used to compute several diagnostic images. First, for each quasar, the 3D mask is used to construct an ``optimally extracted'' NB image for the Ly$\alpha$\ emission by summing the flux along the wavelength direction for only the voxels selected by this 3D mask. Following \citet{Borisova2016}, a layer of the MUSE cube corresponding to the peak of the Ly$\alpha$\ emission has been added as ``background'' layer to each ``optimally extracted'' NB image. In other words, as the projected field-of-view described by the 3D mask does not cover the whole MUSE field-of-view, we replaced the empty pixels with values from the respective pixels in the layer at the peak of the Ly$\alpha$\ emission. In addition, the 3D masks -- and thus only the voxels selected -- are also used to compute the first and second moments (in velocity space) of the flux distribution at each spatial location around each quasar. Finally, we have also constructed NB images of $30$~\AA\ by collapsing the MUSE cubes centered at the Ly$\alpha$\ peak of each nebulosity. Altough all this analysis approach can be used to extract and present any line-emission covered by the MUSE datacubes for our sample (e.g., \ion{C}{iv}, \ion{He}{ii}), in this work we focus only on the Ly$\alpha$\ emission and we leave to a future paper (Arrigoni Battaia et al., in prep.) the analysis of additional extended line diagnostics. \subsection{The quasars' systemic redshift} \label{sec:systemic_redshift} Having an accurate systemic redshift for the targeted quasars is a first fundamental step towards the understanding of the geometry and kinematics of each system (e.g., \citealt{Weidinger05}). In particular, a precise determination of the systemic redshift would allow (i) to say if the detected extended line emission is physically related to the studied quasars, or if it is a structure at larger distances in the foreground or background; and (ii) to compare the kinematic informations available from observations to simulation studies. However, such precise estimates of the systemic redshift of $z>2$ quasars are difficult to determine (e.g., \citealt{Gaskell1982,Tytler1992,Hewett2010}), and requires expensive campaigns of follow-up observations in the near-IR (e.g., \citealt{McIntosh1999}) or molecular tracers to bring the uncertainties down to the order of few tens of km~s$^{-1}$ (e.g., \citealt{Venemans2017}). For our sample, at the moment we can only rely on the sytemic redshift estimated from the \ion{C}{iv}\ line after correcting for the known luminosity-dependent blueshift of this line with respect to systemic (\citealt{Richards2002,Richards2011,Shen2016}). We have estimated the peak of the \ion{C}{iv}\ line for each of the quasars from our MUSE sample, as specified in \citet{Shen2016}, and added to the estimated redshift the luminosity dependent velocity shift determined following the relation in \citet{Shen2016}. In Table~~\ref{tab:sample} we list such systemic redshifts for our targeted quasars. With an intrinsic uncertainty of $415$~km~s$^{-1}$ for the empirical calibration in \citet{Shen2016}, these estimates are not optimal for a detailed studied of our systems in which we expect velocities of the order of hundreds of km~s$^{-1}$ to be in place (e.g., \citealt{Goerdt2015,Borisova2016,fab+2018}). Future efforts are surely needed to better constrain this fundamental parameter. We have indeed initiated a survey in molecular tracers to obtain the systemic redshift of these quasars down to few tens of km~s$^{-1}$ uncertainties. \section{Results: diverse specimens of extended Ly$\alpha$ emission} \label{sec:results} In this section we present the results of our QSO MUSEUM survey concerning the detection of extended Ly$\alpha$\ emission around the targeted quasars. We stress once again that our data do cover the wavelengths of additional emission lines and continuum diagnostics of which we will present the data in dedicated papers. \subsection{The morphology of the extended Ly$\alpha$ emission} \label{sec:morph} In Figure~\ref{fig:SBmaps} we show the atlas of the $61$ ``optimally extracted'' NB images for the Ly$\alpha$\ nebulae extracted from the PSF and continuum subtracted datacubes following the procedure mentioned in section~\ref{sec:cubex}. In this atlas, each image represents $30\arcsec\, \times\, 30\arcsec$ (or about $230$~kpc~$\times\, 230$~kpc) around each quasar, whose position before PSF subtraction is indicated by the white crosshair. For simplicity, we identify each target by the index from Table~\ref{tab:sample}, and we report this number in the bottom-right corner of each image. As it is not feasible to visually assess the noise level in these ``optimally extracted'' images, we overlay the S/N contours computed from the propagated variance and taking into account the number of spaxels contributing to each spatial pixel. Specifically, we show the contours for ${\rm S/N}=2,\, 4,\, 10,\, 20$, and $50$. Qualitatively, Figure~\ref{fig:SBmaps} shows extended Ly$\alpha$\ emission around each system however with different extents, geometries, and substructures. All the objects are characterized by Ly$\alpha$\ emission on radii $R\lesssim50$~kpc (magenta circle on ID~38 in Figure~\ref{fig:SBmaps}), which appears to be mostly symmetric on such scales. The average maximum projected distance at which we detect Ly$\alpha$\ emission from the targeted quasar down to the $2\sigma$ SB limit is 81~kpc or 10.7\arcsec (see Table~\ref{Tab:LyaNeb}). Objects with asymmetric extended Ly$\alpha$\ emission appear to be very rare in our sample. Indeed, we discover only $1$ ELAN (around the quasar with ID~13 or PKS~1017+109; \citealt{fab+2018}). In all our targets, we are confident that the extended Ly$\alpha$\ emission is not due to a systematic effect in underestimating the PSF of each quasar (see also appendix~\ref{app:PSFsubtraction}). Indeed, in each case, the extended Ly$\alpha$\ emission is characterized by a much narrower line profile than the broad Ly$\alpha$\ emission of the quasar itself. We show these differences in Figure~\ref{fig:1DspecComparison}, where we compare the normalized Ly$\alpha$\ line features for each quasar (black) and surrounding nebulosity (red). The quasar and nebulosity spectra reported in these figures have been extracted in circular apertures with $1.5$ arcsec radius, and centered at the peak of the unresolved quasar or at the peak of the extended Ly$\alpha$\ emission, respectively. From Figure~\ref{fig:1DspecComparison}, it is also evident that some of the extended nebulosities appear to have a shift in redshift with respect to the current uncertain estimate for the quasar systemic. Specifically, we have estimated the redshift for the nebulosities as the location of the flux-weighted centroid of the Ly$\alpha$\ emission in these 1D spectra. In Figure~\ref{fig:histoDeltaV} we show the histogram\footnote{We use bins with the same size as the intrinsic uncertainty on the estimate of the quasars redshift, i.e. 415~km~s$^{-1}$} of such velocity shifts between the quasar systemics and the nebulosities, which cover the range $-2000\, {\rm km\, s^{-1}}\, \leq \Delta v \leq 5980$~ km~s$^{-1}$, with the quasars with ID~38 (or SDSSJ0125-1027) and ID~23 (or Q-2138-4427) having the bluest and the reddest shift, respectively. Overall, 75\% of the nebulosities have their peaks at positive velocity shifts with respect to the systemic of the quasar, making the median value of such shift $\Delta v_{\rm median} = 782$~km~s$^{-1}$. Additionally, if we instead compute the velocity shift between the nebulosities and the observed peak of the Ly$\alpha$\ emission of the quasars themselves ($z_{\rm peak\, QSO\, Ly\alpha}$), we find definitely smaller shifts (orange histogram in Figure~\ref{fig:histoDeltaV}). Such velocity displacements cover the range $-2205\, {\rm km\, s^{-1}}\, \leq \Delta v \leq 2524$~ km~s$^{-1}$ with the quasars with ID~38 (or SDSSJ0125-1027) and ID~6 (or SDSSJ0947+1421) being two outliers with the bluest and the reddest shift, respectively. The median value is $\Delta v_{\rm median} = 144$~km~s$^{-1}$. Thus, intriguingly, even though the peak of the Ly$\alpha$\ line of the quasars is highly affected by the presence of multiple absorption features, it appears close in wavelength to the Ly$\alpha$\ nebulosities. This occurrence highlight the important of a precise determination of the quasar systemic, and might be related to the physical mechanism producing the Ly$\alpha$\ emission within the nebulosities, and/or to the overall kinematics of the observed gas (see discussion in section~\ref{sec:powering}). We report all the estimates of the redshifts used for this plot in Table~\ref{tab:sample}\footnote{Our calculation of the quasar systemic redshifts gives consistent results with works in the literature (e.g., \citealt{Weidinger05}; see Appendix~\ref{app:individual_fields}).}. We compared the nebulae here discovered with the work by \citet{Borisova2016}, finding an overall agreement with our results. \citet{Borisova2016} also found mainly spatially symmetric nebulosities and only two of their targets (ID 1 and 3 in their work) show asymmetric extended nebulosities. Overall, this result is consistent with the expectations from previous works in the literature which showed that 50-70\% of the targeted quasars have extended Ly$\alpha$\ emission in their surroundings on radii $<50$~kpc (see Section~\ref{sec:intro}). It is important to stress that previous works targeting $z\sim3$ quasars were achieving SB limits of the order of $\sim10^{-17}$~erg s$^{-1}$ cm$^{-2}$ arcsec$^{-2}$\ evaluated for equivalent $60$~\AA\ NB filters (e.g. \citealt{heckman91a, Christensen2006}), which is much poorer (at least one order of magnitude) than any recent MUSE data, including our work. Regarding the velocity shift between the Ly$\alpha$\ nebulosities and the quasars systemic, the values reported in \citet{Borisova2016} (their Table~2) show that all nebulosities have positive velocity shifts in the range $959\, {\rm km\, s^{-1}}\, \leq \Delta v \leq 4011$~ km~s$^{-1}$, and with a median value of $\Delta v_{\rm median} = 1821$~km~s$^{-1}$ \footnote{The quasars' systemic redshift in \citet{Borisova2016} is obtained as in this work. Thus, it is similarly uncertain.}. However, while looking at their Figure~2 it appears that the peak of the Ly$\alpha$\ emission from the nebulosities is closer to the peak of the Ly$\alpha$\ emission of the quasars themselves, being sometimes also blueshifted from the quasar's systemic (e.g. their ID 14, 16). The closer association between the nebulosities and the peak of the Ly$\alpha$\ emission of the quasars themselves seems thus in agreement with our analysis.\\ \begin{figure*} \includegraphics[width=0.85\textwidth]{Fig1.pdf} \caption{Atlas of the 61 ``optimally extracted'' NB images for the Ly$\alpha$\ emission around the quasars in the QSO MUSEUM sample. Each image shows the SB maps of $30\arcsec\times30\arcsec$ (or about $230$~kpc~$\times\, 230$~kpc) centered on each quasar after PSF and continuum subtraction (see Section~\ref{sec:cubex} for details). Each of the system is numbered following Table~\ref{tab:sample}. In each image the white crosshair indicates the position of the quasar prior to PSF subtraction. For reference, we overlay a magenta circle with a radius of 50~kpc on the image with ID~38. To highlight the significance of the detected emission, for each SB map we indicate the contours for ${\rm S/N}=2,\, 4,\, 10,\, 20$, and $50$. A cyan diamond in the bottom-left corner indicates when the quasar is radio-loud. The detected extended Ly$\alpha$\ emission shows a diversity of extents, geometries and substructures. North is up, east is to the left.} \label{fig:SBmaps} \end{figure*} \input{Tab_LyaNeb_MUSEUM.tex} \begin{figure*} \includegraphics[width=0.95\textwidth]{Fig2_mosaic1.pdf} \caption{1D spectra for the quasars in our sample (black) and discovered nebulosities (red) at the location of the Ly$\alpha$\ emission, in the observed frame. Each spectrum has been extracted in a circular aperture of $1.5$~arcsec radius, and it is normalized to its peak in this wavelength range. The dashed blue lines indicate the systemic redshift of the quasars as listed in Table~\ref{tab:sample}, and the blue shaded regions indicate the calibration uncertainty on this estimates ($415$~km~s$^{-1}$). Following Table~\ref{tab:sample}, we report the quasars' ID numbers in each panel. The nebulosities show a much narrower line profile than quasars, and appear to be shifted from the current estimate for the quasars' systemic redshift.} \label{fig:1DspecComparison} \end{figure*} \begin{figure*} \includegraphics[width=0.95\textwidth]{Fig2_mosaic2.pdf} \smallskip \centerline{{\bf Figure 2} -- {\it continued}} \smallskip \end{figure*} \begin{figure*} \includegraphics[width=0.95\textwidth]{Fig2_mosaic3.pdf} \smallskip \centerline{{\bf Figure 2} -- {\it continued}} \smallskip \end{figure*} \begin{figure} \includegraphics[width=0.95\columnwidth]{Fig3.pdf} \caption{Histogram of the velocity shifts between the flux-weighted centroid of the Ly$\alpha$\ emission peak of the nebulosities $z_{\rm peak\, Ly\alpha}$ and the systemic redshift of the quasars $z_{\rm systemic}$ (blue), both listed in Table~\ref{tab:sample}. We compare this histogram with the histogram of the velocity shifts between $z_{\rm peak\, Ly\alpha}$ and the Ly$\alpha$\ emission peak of the quasar itself $z_{\rm peak\, QSO\, Ly\alpha}$ (orange, see Table~\ref{tab:sample}). The Ly$\alpha$\ nebulosities appear to be closer to $z_{\rm peak\, QSO\, Ly\alpha}$ than to the current (uncertain) $z_{\rm systemic}$ of the quasars.} \label{fig:histoDeltaV} \end{figure} \subsubsection{Quantifying the spatial asymmetry of the emission} \label{sec:asymm} A better understanding of the discovered Ly$\alpha$\ nebulae requires quantitative informations also on their morphology and on the level of asymmetry of the structures above our current detection limits. Indeed, these informations should be used to infer the physical properties, geometry, and scales of the Ly$\alpha$\ emitting gas both observationally and in comparison to current cosmological simulations post-processed with radiative transfer codes (e.g., \citealt{Weidinger05,cantalupo14}). We have thus quantified the asymmetry of the Ly$\alpha$\ light distribution in the discovered nebulosities by estimating (i) the distance between the quasar and the flux-weighted centroid of the emission within the $2\sigma$ isophote of each nebulosity, $d_{\rm QSO-Neb}$; (ii) the asymmetry of the emission within the $2\sigma$ isophote using the second order moments of each nebulosity's light. In particular, after estimating the flux-weighted centroid for each nebulosity $(x_{\rm Neb}, y_{\rm Neb})$ within the $2\sigma$ isophote in the 2D image shown in Figure~\ref{fig:SBmaps}\footnote{Also for this analysis the $1\arcsec \times 1\arcsec$ region around each quasar, and used for the PSF rescaling, has been masked.}, we have measured the flux-weighted second order moments following for example \citet{stoughton02}. These moments are defined as \begin{eqnarray} M_{xx}&\equiv&\langle\frac{(x-x_{\rm Neb})^2}{r^2}\rangle_{f}, \ \ \ M_{yy}\equiv\langle\frac{(y-y_{\rm Neb})^2}{r^2}\rangle_{f},\\ \nonumber M_{xy}&\equiv&\langle\frac{(x-x_{\rm Neb})(y-y_{\rm Neb})}{r^2}\rangle_{f}, \end{eqnarray} where $r$ is the distance of a point $(x,y)$ from the flux-weigthed centroid. Using the second order moments one can define the so-called ``Stokes parameters'' \begin{equation} Q\equiv M_{xx} - M_{yy}, \ \ \ U\equiv 2M_{xy}, \end{equation} and derive the asymmetry (or the ratio between the semiminor and semimajor axis $b$ and $a$), and the position angle describing the light distribution: \begin{equation} \centering \alpha = b/a = \frac{(1-\sqrt{Q^2+U^2})}{1+\sqrt{Q^2+U^2}}, \ \ \ \phi = \arctan\left(\frac{U}{Q}\right). \end{equation} In particular, the angle $\phi$ is the angle between the semimajor axis and the closest $x$- or $y$-axis. In Table~\ref{Tab:LyaNeb} we list the obtained parameters following this formalism: distance between each quasar and the center of the nebulosity $d_{\rm QSO-Neb}$, the asymmetry $\alpha$, and the angle $\phi$ after converting it to the more common angle East of North. In Figure~\ref{fig:asymmetry} we plot the distance $d_{\rm QSO-Neb}$, and the asymmetry $\alpha$ versus the area enclosed by the $2\sigma$ isophote of each Ly$\alpha$\ nebulosity in the top panel and bottom panel, respectively. To help the visualization of the data we also show the histogram for each quantity. This figure clearly shows that most of the nebulae have their flux-weighted centroid in close proximity of the targeted quasar, $(d_{\rm QSO-Neb})_{\rm median}=8.3$~kpc (or $1.1$~arcsec), and that appear to have a more circular shape, $\alpha_{\rm median}=0.71$. On the contrary, there are a handful of cases for which the centroid of the nebulosity is clearly separated from the quasar ($>20$~kpc), with ID 13 (or PKS~1017+109) being the extreme case ($d_{\rm QSO-Neb}=64.4$~kpc). Also, 7 nebulosities show an asymmetry $\alpha<0.5$. However, while most of these small asymmetries are driven by features on small scales, ID 13 (or PKS~1017+109) appear to be a clear outlier with the small asymmetry driven by structures on large scales, i.e. encompassing an area $\geq 3.4\times$ that of the other 6 nebulosities with $\alpha<0.5$. These characteristics are probably evidences of the powering mechanism for the Ly$\alpha$\ emission (see Section~\ref{sec:powering}), of the local environment of the system studied (e.g., \citealt{hennawi+15,fab+2018}), and possibly encode information on the different orientations of the systems with respect to our observational vantage point. In Figure~\ref{fig:asymmetry} we also indicate weather a quasar is radio-quiet (blue) or radio-loud (red), showing that the two populations do not differ on these plots. \begin{figure} \includegraphics[width=0.95\columnwidth]{Fig4_1.pdf}\\ \includegraphics[width=0.95\columnwidth]{Fig4_2.pdf} \caption{Top panel: plot of the distance between the quasar position and the flux-weighted centroid of the Ly$\alpha$\ nebulosity, $d_{\rm QSO-Neb}$, versus the area enclosed by the $2\sigma$ isophote. Most of the nebulosities are centered at small separations from the quasar, with ID 13 (or PKS~1017+109) being a clear outlier. Lower panel: plot of the asymmetry $\alpha$, i.e. the ratio between the semiminor axis $b$ and semimajor axis $a$, versus the area enclosed by the $2\sigma$ isophote. ID 13 (or PKS~1017+109) appears to be a clear outlier with the small asymmetry driven by structures on large scales. In both panels, blue circles indicate the radio-quiet systems, red circles the radio-loud, and the open circles the six cases where no radio data are available.} \label{fig:asymmetry} \end{figure} \subsubsection{Individual circularly averaged surface brightness profiles} \label{sec:ind_profiles} In this section we compute the radial SB profiles for the discovered Ly$\alpha$\ nebulosities as commonly done in the literature. Such profiles provide additional information on the diverse morphologies of the nebulosities, while can shed light on the mechanism powering the Ly$\alpha$\ line and on the cool gas distribution around quasars at this redshift. In particular, we aim to obtain an average profile for our sample, and compare it to the average profile of Ly$\alpha$\ seen from the quasar CGM at different redshifts (e.g., \citealt{fab+16}). First, to use the full information contained in the MUSE datacubes we decided not to use the ``optimally extracted'' images. Indeed these images are obtained by cutting the data with a S/N threshold which would inevitably result in the loss of information at large distances from the quasar. From Table~\ref{Tab:LyaNeb} -- where we report the maximum projected distance reached by each Ly$\alpha$\ structure from the quasar position -- it is evident that 32 nebulosities do not have emission above $2\sigma$ extending at distances $>80$~kpc from the quasar. In addition, the noise characterization in the ``optimally extracted'' images is not trivial and would introduce an additional uncertainty in the estimate of the profiles (as explained in \citealt{Borisova2016}). For these reasons we extracted the circularly averaged SB profiles from NB images with fixed width ($30$~\AA) obtained from the PSF and continuum subtracted datacubes, and centered at the Ly$\alpha$\ peak of each nebulosity. For each of these NB images, we have propagated the corresponding subsection of the variance cube to obtain a variance image. As anticipated in Section~\ref{sec:obs}, in Table~\ref{tab:ObsLog} we list the $2\sigma$ SB limit for each of these NB images, which are roughly $5\times$ higher than for a single layer (1.25~\AA). While such a fixed width does not enclose the whole Ly$\alpha$\ emission above the ${\rm S/N} = 2$ threshold used to extract the 3D mask, it is a good compromise to include most of the bright Ly$\alpha$\ emission while being still sensitive to emission at very low SB levels on large scales ($\sim100$~kpc). Also, this width is similar to the wavelength range spanned by the NB filter used in the literature to detect Ly$\alpha$\ emission, and thus enables a more direct comparison with those studies. Figures~\ref{fig:Prof_one} show all the NB images obtained from the PSF and continuum subtracted datacubes together with the white-light images and the ``optimally extracted'' images. This figure clearly display the higher noise level in comparison to the single layer ($1.25$~\AA) used as background in the ``optimally extracted'' NB images (see section~\ref{sec:cubex}). Before proceeding with the extraction of the profiles, we further prepared the NB images by masking artifacts and compact sources, which would otherwise contaminate the profiles. In particular, even though we have subtracted the continuum using the {\tt CubeBKGSub} algorithm within \textsc{CubExtractor}, our images are affected by residuals (both positive or negative) expecially at the position of bright continuum sources, i.e. stars or galaxies. To avoid such contamination, we constructed a mask for the continuum sources using the white-light image of each field. This approach is very conservative as the subtraction of the continuum has been tested in previous works (e.g., \citealt{Borisova2016}). In particular, in analogy to what was done in \citet{fab+16}, we run \textsc{CubExtractor} to identify all the continuum sources above ${\rm S/N}=2$ and down to very small objects (5 pixels minimum) within the white-light images. \textsc{CubExtractor} produces a ``segmentation'' image that is then used to create a mask, after removing the region corresponding to the quasar that otherwise would hide the emission of interest here. In addition, to avoid the detection of signal from compact line emitters around the quasars, i.e., objects which do not have a continuum detection, we obtain a similar mask using the NB image itself. However, at this step we only identify compact sources, with area between 5 pixels and 20 pixels (roughly a seeing disc). By combining the two individual masks, we then obtained a final mask which allow us to neglect in our analysis both pixels from artifacts and compact sources. Overall this masking procedure reduces the fraction of the field-of-view that is usable around each quasar to an average of $88\%$. This analysis and the final available field-of-view is similar to what has been used to extract radial SB profiles around quasars in NB images of similar depth (\citealt{fab+16}). We then calculated the circularly averaged SB profile for each quasar in radial logarithmic bins centered at the quasar positions with an unweighted average of all the not-masked pixels within each annulus. We then consistently propagated the errors from the variance images. To facilitate the visualization of the profiles and the comparison with the NB images, we overplot on the ``optimally extracted'' images in Figures~\ref{fig:Prof_one} the annuli within which we calculate the radial SB profiles. In the same Figures we show the SB profiles for each of the discovered Ly$\alpha$\ nebulosities (blue data points with errors), together with the $2\sigma$ error estimates expected within each aperture in the case one assumes a perfect sky and continuum subtraction (gray shaded area)\footnote{This is obtained using the formula SB$_{\rm limit}($area$)=$SB$_{\rm limit}^{1\, {\rm arcsec^2}}/\sqrt{\rm area}$ where SB$_{\rm limit}^{1\, {\rm arcsec^2}}$ is the SB limit in $1$~arcsec$^{2}$ reported in Table~\ref{tab:ObsLog}. This formula is true only if a perfect sky and continuum subtraction is performed. For this reason the shaded region has to be regarded as only indicative.}. In addition, to compare such profiles with the ``optimally extracted'' NB images, we compute the profiles within the same annuli, but only using the emission enclosed by the $2\sigma$ isophote (red data points). By construction, these profiles do not extend further than the contour enclosing the maximum distance defined by the $2\sigma$ isophote\footnote{The last data-point in some of the profiles extracted using the 3D mask (red crosses) is driven to high SB values because of the small portion of nebula within the last ring.}. While extracting both radial profiles, we masked the central $1\arcsec \times 1\arcsec$ region around the quasar position used for the PSF rescaling. For this reason the radial profiles in Figures~\ref{fig:Prof_one} are shown for radii $R>10$~kpc. Overall, this analysis once again shows the diversity of the morphologies and extents of the Ly$\alpha$\ emission around the targeted quasars, while emphasizing the differences in SB between the different objects. In particular, consistently with the 2D images, the profiles extend out to the maximum annulus which include the $2\sigma$ isophote, and beyond this radius they appear to monotonically decrease. This decrease is not driven by the current depth of the data as otherwise we would have had larger nebulae in the ``optimally extracted'' images than in the NB images. This can be clearly seen by comparing the data-points from the NB images (blue) and the data-points from the ``optimally extracted'' images (red). The decrease is visible in both symmetric and asymmetric nebulosities. Further, we do not see any particular difference between the individual profiles of the radio-quiet and radio-loud objects. \begin{figure*} \centering \includegraphics[width=0.68\textwidth]{Fig5_mosaic1_xx.pdf} \caption{Each row shows $50\arcsec\times50\arcsec$ (or approx. $380$~kpc~$\times380$~kpc) images (white-light image, $30$\AA\ NB image, ``optimally extracted'' NB image) and the circularly average SB profiles for the targets in our QSO MUSEUM survey. A cyan diamond in the top-left corner of the white-light image indicates that the quasar is radio-loud. For comparison, the NB images and ``optimally extracted'' NB images are shown on the same color scheme and the position of the quasar prior to PSF subtraction is indicated by the white crosshair in all images. We overlay on the ``optimally extracted'' images the circular apertures used for the extraction of the profiles. In the rightmost panel we show the circularly average SB profile extracted from the NB image (blue) and from the ``optimally extracted'' NB image (red) (see section~\ref{sec:ind_profiles} for details). The gray shaded region represents the $2\sigma$ SB limit expected within each aperture in the case it is assumed a perfect sky and continuum subtraction. North is up, east is to the left.} \label{fig:Prof_one} \end{figure*} \begin{figure*} \centering \includegraphics[width=0.68\textwidth]{Fig5_mosaic2_xx.pdf} \smallskip \centerline{{\bf Figure 5} -- {\it continued}} \smallskip \end{figure*} \begin{figure*} \centering \includegraphics[width=0.68\textwidth]{Fig5_mosaic3_xx.pdf} \smallskip \centerline{{\bf Figure 5} -- {\it continued}} \smallskip \end{figure*} \begin{figure*} \centering \includegraphics[width=0.68\textwidth]{Fig5_mosaic4_xx.pdf} \smallskip \centerline{{\bf Figure 5} -- {\it continued}} \smallskip \end{figure*} \begin{figure*} \centering \includegraphics[width=0.68\textwidth]{Fig5_mosaic5_xx.pdf} \smallskip \centerline{{\bf Figure 5} -- {\it continued}} \smallskip \end{figure*} \begin{figure*} \centering \includegraphics[width=0.68\textwidth]{Fig5_mosaic6_xx.pdf} \smallskip \centerline{{\bf Figure 5} -- {\it continued}} \smallskip \end{figure*} \clearpage \begin{figure*} \centering \includegraphics[width=0.68\textwidth]{Fig5_mosaic7_xx.pdf} \smallskip \centerline{{\bf Figure 5} -- {\it continued}} \smallskip \end{figure*} \begin{figure*} \includegraphics[width=0.68\textwidth]{Fig5_mosaic8_xx.pdf} \smallskip \centerline{{\bf Figure 5} -- {\it continued}} \smallskip \end{figure*} \begin{figure*} \centering \includegraphics[width=0.68\textwidth]{Fig5_mosaic9_xx.pdf} \smallskip \centerline{{\bf Figure 5} -- {\it continued}} \smallskip \end{figure*} \begin{figure*} \centering \includegraphics[width=0.68\textwidth]{Fig5_mosaic10_xx.pdf} \smallskip \centerline{{\bf Figure 5} -- {\it continued}} \smallskip \end{figure*} \begin{figure*} \centering \includegraphics[width=0.68\textwidth]{Fig5_mosaic11.pdf} \smallskip \centerline{{\bf Figure 5} -- {\it continued}} \smallskip \end{figure*} \subsubsection{The average surface brightness profiles} \label{sec:av-prof} In this section we present average SB profiles for our sample. We have obtained three different stacked profiles by averaging with equal weights the profiles obtained from the NB images of (i) all the 61 quasars, (ii) the radio-quiet sample (39 quasars), and (iii) the radio-loud sample (15 quasars)\footnote{We remind the reader that currently we do not have information on the radio emission for 6 quasars in our sample, which are thus excluded from both the radio-quiet and radio-loud sample.}. The left panel in Figure~\ref{fig:averageProf} shows these three SB profiles versus the physical radius of the annuli used for the profile extraction. In particular, we indicate the whole sample in blue (large datapoints), while the sub-samples of the radio-quiet and radio-loud objects in pink and green (small datapoints), respectively. We note that there is only a marginal difference between the radio-quiet and radio-loud subsamples at radii $20$~kpc~$<R<50$~kpc, with the radio-loud objects showing a slightly higher SB. For comparison with \citet{Borisova2016}, we fit these stacked profiles with an exponential SB$(r)=C_e{\rm exp}^{-r/r_h}$ or a power law SB$(r)=C_p r^{\alpha}$. We found that the obtained stacked profiles are better fit by an exponential profile with scale length $r_h=15.7\pm0.5$~kpc, $r_h=15.5\pm0.5$~kpc, and $r_h=16.2\pm0.3$~kpc, for the whole sample, the radio-quiet and the radio-loud objects, respectively. The aforementioned excess in SB at intermediate scales for the radio-loud sample thus determine the small tentative difference in scale length between the two subsamples. Further, our quasars are surrounded by Ly$\alpha$\ nebulosities characterized by scale lengths roughly $3\times$ larger than those for LAEs at similar redshifts (e.g., \citealt{Leclercq2017}), probably reflecting the different halo masses, and also the ability of the QSOs to power observable Ly$\alpha$\ emission further out. We note that our best fit power laws have slopes of $\alpha=-1.96$, $\alpha=-1.93$, and $\alpha=-1.81$, for the whole sample, the radio-quiet and the radio-loud objects, respectively. These values are consistent with the power law slope reported by \citet{Borisova2016} for their average profile, i.e. $\alpha=-1.8$. However in our case the best fit profile appears to be the exponential. For comparison purposes, the average profile from \citet{Borisova2016} is shown in Figure~\ref{fig:averageProf} (solid green line), together with our best exponential fit (dashed red), and best power law fit (dotted gray) to our whole sample. For completeness, we have then computed the average SB profile of the whole sample and of the radio-quiet sub-sample both excluding the quasar with ID~13 (or PKS~1017+109), which shows a rare ELAN with multiple AGN companions (see Section~\ref{sec:ELAN}; \citealt{fab+2018}). The scale-lenghts for the profiles slightly shrinks $r_h=15.4\pm0.7$~kpc and $r_h=15.2\pm0.7$~kpc, respectively for the whole sample and for the radio-quiet sample. However the uncertainties are larger than the variations. The brightness and extent of an ELAN thus seems to affect the average SB profiles even with a large sample of objects. Table~\ref{Tab:profilesfit} lists all the details of the profile fitting. We then compare our stacked SB profile with the work by \citet{fab+16}. This work produced a stacked Ly$\alpha$\ SB profile for the $z\sim2$ quasar's CGM by targeting 15 $z\sim2.253$ radio-quiet quasars with the NB technique, and achieving similar depths to our extracted NB data. Indeed, those NB data are a factor of $\sim2$ less deep than our MUSE NB images, but the cosmological SB dimming of the form $(1+z)^{-4}$ should compensate this difference. Those quasars are characterized by an average $M_i(z=2) = -27.21$, and are thus slightly fainter than the quasar in this study (average $M_i (z=2)=-28.05$; see Table\ref{tab:sample}). However 8 out of 15 of those quasars have luminosities similar to quasars in the current sample. In particular two have magnitudes $M_i(z=2)=-28.75$ (SDSS~J093849.67+090509.7), and $M_i(z=2)=-28.06$ (SDSS~J084117.87+093245.3), which are comparable also to quasars in the sample of \citet{Borisova2016}. Notwithstanding such differences in luminosity, \citet{fab+16} did not report any dependence of the individual profiles of the extended Ly$\alpha$\ emission with respect to the luminosity of the quasar themselves. As discussed in \citet{fab+16}, the NB imaging technique could be affected by flux losses if the Ly$\alpha$\ line is in reality at a different wavelength (thus redshift) than expected, and thus falls outside or at the edge of the used filter. \citet{fab+16} have shown that only error distributions on the redshift with width comparable to the width of the NB filter (in this case about 2500~km~s$^{-1}$) can result in significant flux losses (see their appendix B), and concluded that flux losses should be of the order of $3$\% for their sample. Before proceeding with the comparison, we discuss an additional piece of evidence suggesting that flux losses are indeed unlikely to dominate the observations in \citet{fab+16}. In section~\ref{sec:morph} we have shown that the Ly$\alpha$\ extended emission around the targets of our QSO MUSEUM survey peaks at wavelengths close to the maximum of the Ly$\alpha$\ emission of the targeted quasars. We have thus checked the velocity separation between the quasar's systemic redshift\footnote{In \citet{fab+16} the quasar's systemic redshfits are more robust than here (uncertainty of $\sim270$~km~s$^{-1}$).} and the peak of the Ly$\alpha$\ line for each of the quasars in \citet{fab+16}. We have found a median (mean) shift of $\Delta v=-92$~km~s$^{-1}$ ($-250$~km~s$^{-1}$), with only two quasars having a large displacement, $\Delta v=-1468$~km~s$^{-1}$ (SDSS~J131433.84+032322.0) and $\Delta v=-1789$~km~s$^{-1}$ (SDSS~J085233.00+082236.2). Since the quasar's systemic redshifts were chosen to conservatively fit within the NB filter, this occurrence indicates that those observations should not be significantly affected by flux losses at least for 13/15 of the quasars in their sample. We thus show in Figure~\ref{fig:averageProf} the average profile for the Ly$\alpha$\ emission around $z\sim2.253$ quasars as determined by \citet{fab+16} (large orange datapoints). It appears that $z\sim3$ quasars are surrounded by a brighter glow in the Ly$\alpha$\ line. This is even more evident if we correct the SB of the two datasets for the cosmological dimming, and use the comoving distances instead of the physical ones. We show this comparison in the right panel of Figure~\ref{fig:averageProf}. This result has to be verified with more statistical studies of the $z\sim2$ population, e.g. with KCWI. Nevertheless we discuss the implications of such a finding in Section~\ref{sec:redshiftEvol}. \begin{figure*} \centering \includegraphics[width=0.7\textwidth, clip]{Fig6.pdf} \caption{Average Ly$\alpha$\ SB profiles for the nebulosities discovered in our QSO MUSEUM survey. Left panel: we show the average profile for the whole sample (large blue; 61 targets), the radio-quiet subsample (pink diamond; 39 quasars), and radio-loud subsample (small green; 15 quasars) in observed SB units versus the physical radius. For the radio-quiet and radio-loud subsamples we slightly shifted the datapoints along the $x$-axis to allow a better visualization. For each profile, open squares indicate negative datapoints. For the whole sample we show the best exponential fit (dashed red line) and the best power-law fit (dotted gray line). In addition, we compare our dataset with the average profile for (i) $z\sim2.25$ quasars by \citet{fab+16}, and for (ii) $z\sim3.5$ quasars by \citet{Borisova2016}. Right panel: the average profile for the QSO MUSEUM sample is compared to the average profiles by \citet{fab+16}, and \citet{Borisova2016} after correcting for the cosmological dimming and using comoving units for the radii. By comparing these datasets it appears that $z\sim3$ quasars are surrounded by a brighter glow in the Ly$\alpha$\ line (see Sections~\ref{sec:av-prof} and \ref{sec:redshiftEvol} for details and discussion).} \label{fig:averageProf} \end{figure*} \input{Tab_fit_average_profile_LAST.tex} \subsubsection{Averaging covering factor of detected extended Lyman-Alpha emission} Given the diversity in morphology of the discovered nebulosities, it is difficult to visually assess which fraction of the area around the quasars contributes to the aforementioned profiles. We have thus complemented the previous analysis by estimating the covering factor in logarithmic bins for the extended Ly$\alpha$\ emission above the ${\rm S/N} = 2$ threshold used to extract the 3D mask in Section~\ref{sec:cubex}. Specifically, for each logarithmic bin used for the extraction of the radial profiles in Section~\ref{sec:ind_profiles}, we have simply defined the covering factor $f_{\rm C}$ as the ratio between the area spanned by the Ly$\alpha$\ emission above the ${\rm S/N}=2$ threshold and the total area of that radial bin. We have thus obtained radial profiles for $f_{\rm C}$ for each discovered Ly$\alpha$\ nebulosity. The average covering factor for our whole sample $\langle f_{\rm C} \rangle_{{\rm S/N}=2}$ is then estimated by averaging with equal weights the information from each individual target. In Figure~\ref{fig:coveringFactor} we thus show $\langle f_{\rm C} \rangle_{{\rm S/N}=2}$ in logarithmic bins of radius $R$ from the quasar. This covering factor has to be treated with caution. Indeed, by construction, it depends on the depth of the dataset and on the ${\rm S/N}$ threshold used for the analysis. In addition, close to the quasar position, the morphology of the nebulosities, and thus the area covered by the Ly$\alpha$\ emission, are uncertain due to the PSF subtraction. For these reasons, in Figure~\ref{fig:coveringFactor} the estimated values are formally regarded as a lower limit for the area covered by Ly$\alpha$\ emitting gas around our sample of quasars. Figure~\ref{fig:coveringFactor} shows that the detected extended Ly$\alpha$\ emission covers a fraction $>30$\% for radii $R<50$~kpc (vertical gray line), while it quickly decrease to lower values at larger distances. For comparison, we show in red the profile of the covering factor for the target with ID 13 (or PKS~1017+109), which is associated with an ELAN. This object is clearly characterized by a larger covering factor than the average population, with $f_{\rm C}>0.8$ for $R<50$~kpc, and $f_{\rm C}>0.1$ at $R=140$~kpc (our last bin). The Quasar Probing Quasar (QPQ) series of papers (e.g., \citealt{QPQ1,qpq4}) studied the $z\sim2$ quasar CGM by using bright background sightlines of higher-$z$ quasars as a probe of the foreground quasar halo. These studies have shown that the $z\sim2$ quasar CGM is permeated by optically thick gas with high covering factor >0.4 out to 200 projected kpc in a $\pm 1500$~km~s$^{-1}$ velocity interval (\citealt{QPQ5,qpq6}). A direct comparison between these absorption studies and our current work is complicated by the differences inherent to the two techniques. Indeed the absorption experiment can only rely on a one-dimensional probe percing through the studied foreground system. The seeing, the uncertainty on cloud sizes, the fact that one probes the quasar ionizing luminosity or $n_{\rm H}^2$ in emission, but optical depth in absorption (\citealt{qpq4}), and (possibly) the different redshift targeted (see Section~\ref{sec:redshiftEvol}), all hamper a statistical one-to-one comparison. Notwithstanding these uncertainties, our data suggests that the optically thick gas -- if present also at $z\sim3$ in similar quantities -- is not responsible for the Lyman-alpha emission at $>50$~kpc distance from the central quasar as its covering factor is much higher than the one of the emitting gas (at least down to the current SB limits), and such optically thick phase should be bright enough (if illuminated by the quasar) to be detected in our observations as demonstrated in \citet{qpq4}. To get similar lower limits on the covering factor at 50~kpc or larger distances as in our data, one would have to consider only the lowest column density systems observed in the QPQ series. We will focus on a detailed comparison between absorption and emission studies (also in individual systems at $z\sim3$) in future works. \begin{figure} \centering \includegraphics[width=0.98\columnwidth, clip]{Fig7.pdf} \caption{Covering factor of the Ly$\alpha$\ emission above ${\rm S/N}>2$ in logarithmic bins around the quasars. To obtain this plot, we use the same circular apertures used for the profiles extraction (see section~\ref{sec:ind_profiles}). Given that we are not sensitive to very faint Ly$\alpha$\ emission (SB$_{\rm Ly\alpha}\lesssim10^{-18}$~erg s$^{-1}$ cm$^{-2}$ arcsec$^{-2}$), we show the data as lower limits: for our whole sample (black) and for the target with ID 13 (or PKS~1017+109) (red). For reference, the gray vertical line indicates $R=50$~kpc.} \label{fig:coveringFactor} \end{figure} \subsection{Compact line emitters associated with the extended Lyman-Alpha emission} \label{sec:comp_sel} The targets of QSO MUSEUM have been chosen without any prior constraint on their environment\footnote{We remind the reader that we selected our targets by avoiding very crowded fields in optical observations (see Section~\ref{sec:obs}). This should not biased our selection as most of the optical sources for which a field result to be crowded at the depth of SDSS-DR12, DSS2 and USNO-A2/B1 are low-$z$ objects.}. However, the morphology, extent, and level of the Ly$\alpha$\ emission could be influenced by the presence of active companions, satellites, nearby systems and large scale structures (e.g., \citealt{Cai2016, fab+2018}). It has indeed been shown a tendency for ELANe to be associated with overdensities of galaxies and QSOs (\citealt{hennawi+15,Cai2016,fab+2018}, Arrigoni Battaia et al. in prep.). In this section we thus report on our attempt to find associated compact emitters. Given the depth of our data and the FOV probed, this analysis is not conclusive but is intended as a first attempt to characterizing the small scale environment in which our objects reside. To identify galaxies at the same redshift of the targeted quasars, we rely on the identification of emission or absorption lines at the redshift of interest. Specifically, we search for (i) compact continuum sources with clear line features and (ii) compact Ly$\alpha$\ emitters (LAEs) whose continuum might have been too faint to be detected in the former case. Thus, here, we do not attempt to obtain the redshift of continuum objects with no clear emissions or absorptions as it would be highly uncertain given the depth of our data. To avoid contamination from the noisy edges of the datacubes, we restrict this analysis to the central $55\arcsec \times 55\arcsec$ (or $418$~kpc~$\times418$~kpc). More specifically, we proceed as follows. First, we obtained a catalogue of continuum source candidates by running \textsc{CubExtractor} on the white-light images shown in Figure~\ref{fig:Prof_one} with a threshold of $2\sigma$ above the background root mean square and with a minimum detection area of 5 pixels. Using the segmentation maps produced by \textsc{CubExtractor}, we have then extracted the 1D spectra for each identified source from the MUSE datacubes, resulting in an average of 54 sources per field for a total of 3280 sources. The inspection of such spectra has been conducted to identify emission or absorption within $\pm3000$~km~s$^{-1}$ from the systemic redshift of each targeted quasars. This large velocity window should allow us to find systems associated with most of the quasars and nebulosities even though their current redshifts significantly differ (see Table~\ref{tab:sample} and Section~\ref{sec:morph}). This search resulted in the discovery of 11 continuum selected sources characterized by some line emission close to the location of expected transitions for the redshift of interest. Apart from the contamination of six foreground objects with detected [\ion{O}{ii}], or H$\delta$ line emission, we found (i) four active companions with detected Ly$\alpha$, and tentative \ion{C}{iv}\ , \ion{He}{ii}\ , and (ii) one object with only one line emission that we interpreted as Ly$\alpha$. In addition, for each field, we look for signatures of AGN activity for all the continuum-detected sources, identifying two higher z quasars and one lower z quasar. For all these sources\footnote{Two companions (AGN1 and QSO2) and the continuum object with Ly$\alpha$\ emission (LAE1) have been discovered around the quasar with ID 13, and already reported in \citet{fab+2018}. We do not show them again here (the same applies for LAE2 associated with the same system). }, we show their spectra in Appendix~\ref{app:individual_fields}, while we indicate their positions with the corresponding names on the NB images in Figure~\ref{fig:Prof_one}, and listed them in Table~\ref{tab:ContinuumSources}. In particular, we note that the quasar with the larger number (2, of which 1 is a type-I) of active companions detected (ID 13 or PKS~1017+109) also presents the more extended and brightest of the Ly$\alpha$\ nebulosities (see \citealt{fab+2018}). The aforementioned analysis however misses all the line emitters whose faint continua were not detected in the white-light image. To search for such objects, we run \textsc{CubExtractor} to select groups of contiguous voxels within the PSF and continuum subtracted MUSE datacubes. Specifically, we search for line emitters within a window of $\pm3000$~km~s$^{-1}$. To avoid contamination from spuriuous sources, we conservatively extract candidate sources with a minimum volume of 50 voxels at ${\rm S/N}\geq5$, and masking the location of residuals from stars that would otherwise contaminate our catalogue. Note that the selected threshold would allow us to surely detect bright ($F>1.1 \times 10^{-17}$~erg~s$^{-1}$~cm$^{-2}$) line emitters associated with the quasars in most of our fields, if present. We have indeed tested our selection criteria by introducing 100 mock sources with fluxes in the range $(1-2)\times10^{-17}$~erg~s$^{-1}$~cm$^{-2}$ into the PSF and continuum subtracted datacube for each targeted field. Each of the mock sources has a profile defined by a two-dimensional Gaussian in the spatial direction with FWHM equal to the estimated seeing (on average FWHM~$=1.07$ arcsec), and a Gaussian with FWHM=$2.5$~\AA\ in the spectral direction. As it is clear from Figure~\ref{fig:completeness}, the aforementioned selection criteria allow us to be, on average, $\geq 80\%$ complete for line fluxes $F>1.1 \times 10^{-17}$~erg~s$^{-1}$~cm$^{-2}$. Note however that for ten of our fields, the completeness is $\geq 80\%$ only at higher fluxes $F\gtrsim1.3 \times 10^{-17}$~erg~s$^{-1}$~cm$^{-2}$. \begin{figure} \centering \includegraphics[width=0.98\columnwidth, clip]{Fig8.pdf} \caption{Results of a completeness test for the detection of Ly$\alpha$\ emitters associated with the targeted systems. The blue solid line indicates the average recovered fraction, while the blue shaded region indicates the spread between the maximum and minimum of the recovered fraction for the individual fields. With our selection criteria, we are thus $\geq 80$~\% complete for fluxes $> 1.1 \times 10^{-17}$~erg~s$^{-1}$~cm$^{-2}$.} \label{fig:completeness} \end{figure} Applying this method to the data, we identify an average of 1 source per field. To avoid the selection of spurious sources, we have then visually inspected the ``optimally extracted'' line flux images, and extracted a 1D spectrum for each of the selected sources. We classify as Ly$\alpha$\ emitters only those compact sources which appear to not have other emission lines identifiable as e.g. H$\alpha$, [\ion{O}{iii}], H$\beta$, [OII]. In addition, for some fields, our selection criteria identify small portions of the Ly$\alpha$\ nebulosities. We classify such portions as additional LAEs only when they appear to be compact, centrally concentrated sources. This last choice, which happens in 9 cases out of 20 detected portions of nebulae\footnote{LAE2 in ID~8 (or UM683); LAE1, LAE2, AGN1 in ID~13 or (PKS~1017+109); LAE1 and LAE2 in ID~46 (or Q2355+0108); LAE1 in ID~47 (or 6dF~J0032-0414); LAE1 and LAE3 in ID~56 (or TEX1033+137).}, has to be confirmed with additional data targeting the continuum emission of such candidate companions. Following this procedure, we identify a total of 22 LAEs when considering all our sample. We list their coordinates, their redshifts and information on the Ly$\alpha$\ line emission in Appendix~\ref{app:individual_fields}, while we indicate them with their respective numbers on the NB images shown in Figure~\ref{fig:Prof_one}. Overall, following our selection criteria, most of our fields (48) do not show the presence of LAEs down to our sensitivity limits and apertures used\footnote{For the quasar with ID~58 (Q1205-30) we were able to compare our analysis with NB data reaching the same depth (\citealt{Fynbo2000}; Appendix~\ref{app:individual_fields}), confirming that there are no LAEs in this particular field down to out limits.}. If we use the luminosity function for field LAEs by \citealt{Cassata2011} (bin $3<z<4.55$) and assume a comoving volume of $231$~Mpc$^3$ defined by the MUSE FoV and the window of $\pm 3000$~km~s$^{-1}$, we find that we would expect $0.6\pm0.3$ LAEs per field\footnote{The errors listed for the expected number of LAEs in this paragraph encompass the different estimates due to the sensitivity of each individual field, log$(L_{\rm Ly\alpha}/[{\rm erg~s^{-1}}])=42-42.1$.}. A similar value, $0.7\pm0.4$, is obtained by adopting the more recent luminosity function of \citet{Drake2017}. If we thus take into account the estimates of the expected number of LAEs per field (ranging between about 0.3 and 1) and the fact that we are 80\% complete, we obtain a total expected number of LAEs in the range $24-30$, not far from the total of 22 found\footnote{Note that also the 5 objects with continuum detection reported in this section (4 companions + 1 Ly$\alpha$\ emitter) could be classified as LAE from their Ly$\alpha$\ ${\rm EW}_{\rm rest}$, summing up to 27 LAEs in total.}. Therefore, at these luminosities, our quasar environments seem to be similar to the field, suggesting that on average quasars do not inhabit the most dense environments at their redshift (\citealt{ts12,Fanidakis13}). Nevertheless, the fields with more than one detection are clear outliers, and probably reflect the presence of underlying overdensities and/or effects of powering mechanisms, e.g., chance alignment between the position of the LAE and the ionization cones of the quasars (e.g., \citealt{hr01}). Some of the detected LAEs, expecially the one with high equivalent widths (${\rm EW}_{\rm rest}>240$~\AA; \citealt{cantalupo12}) might indeed represent candidates for the so-called ``dark galaxies'', i.e. dense pockets of gas fluorescently illuminated by the targeted quasars (e.g. \citealt{hr01}). Using the luminosity function from \citet{cantalupo12}, who reported candidate LAEs\footnote{The LAEs in \citet{cantalupo12} are not spectroscopically confirmed.} around one $z\sim2.4$ hyper-luminous quasar (bolometric luminosity $L_{\rm bol}>10^{47}$~erg~s$^{-1}$), we would expect to see 1 LAE per field above our luminosity limit\footnote{Note however that not all our quasars are hyper-luminous.}. \citet{cantalupo12} found indeed only 1 LAE with luminosity high enough to be detected by our observations, and at a 'MUSE distance' from the quasar. This LAE has an exceptional ${\rm EW}_{\rm rest}=327\pm28$\AA. Recently, \citet{Marino2018} also searched for ``dark galaxy'' candidates with deep MUSE observations around a sample of 5 QSOs (4 at $z\gtrsim 3.7$ and 1 at $z\approx 3.2$) and 1 type-II AGN. Unfortunately, from the unprecise redshifts reported for their LAEs in their Table 5, we are not able to verify how many LAEs they detected down to our luminosity limit and within our velocity window for the whole sample. However, we can see that they detected only 2 LAEs for their 4 QSOs at $z\gtrsim3.7$ matching our criteria (see their Fig.~7, right panel). Both of these sources are classified as candidate ``dark-galaxies'' (see their Table 3). On the contrary, no bright ``dark-galaxy'' candidates are reported within $\pm 3000$~km~s$^{-1}$ for their $z\approx3.2$ QSO (see their Table 3 and Fig.~4). In our sample, we only have 1 LAE (LAE2 in the SDSS~J1209+1138 field; see Table~\ref{MEGAtabLAEs}) with an exceptional equivalent width of $EW_{\rm rest}>420$~\AA\ that could be considered as a ``dark-galaxy'' candidate as usually done in the literature. We conclude that object-to-object variations can play an important role at these high luminosities, and within our small field-of-view, explaining the difference with \citet{cantalupo12}. Finally, we stress that the analysis presented in this section is inevitably limited in identifying companions within the Ly$\alpha$\ nebulosities themselves, unless they are characterized by a brighter emission than the extended Ly$\alpha$. We thus do not exclude the presence of faint galaxies embedded within the extended Ly$\alpha$\ emission surrounding each quasar in our sample. \subsection{Kinematic information from the extended Lyman-Alpha emission} \label{sec:kinematics} In this section we present the maps for the flux-weighted velocity centroid and the flux-weigthed velocity dispersion of the extended Ly$\alpha$\ emission calculated as explained in section~\ref{sec:cubex} (following the same analysis of \citealt{Borisova2016}). We reiterate that we do {\it not} fit any function to the line profile to avoid neglecting fundamental information on the gas properties imprinted by the Ly$\alpha$\ resonant scattering, which is likely in play here. Figure~\ref{fig:Velmaps} shows the atlas of the 61 maps for the flux-weighted velocity centroid with respect to $z_{\rm peak\, Ly\alpha}$ (Table~\ref{tab:sample})\footnote{Following the analysis in section~\ref{sec:morph}, all the discovered Ly$\alpha$\ nebulosities would appear mainly as red in Figure~\ref{fig:Velmaps}, i.e. as largely redshifted, if the flux-weighted velocity centroid would have been calculated with respect to the quasars sytemic redshifts (see Figure~\ref{fig:histoDeltaV} for the velocity shifts).}. In agreement with \citet{Borisova2016}, the majority of the maps looks noisy and difficult to interpret as ordered motions of any kind (rotation, infall, or outflow), though each nebulosity shows peculiar structures. On the other hand, the largest and brightest nebula (ID 13) show a remarkable velocity pattern on hundreds of kiloparsec, with the furthest portion clearly redshifted. This coherent velocity pattern has been interpreted as signature of inspiraling motions within the quasar's halo (\citealt{fab+2018}). The difference in complexity between the maps of very extended neulosities and smaller systems could be due to the resonant nature of the Ly$\alpha$\ line which sample more turbulent regions on scales of tens of kpc. Such small scales around the quasars are likely more affected by both turbulent motions due to galaxy formation processes (feedback, interactions) and the resonant scattering of Ly$\alpha$\ photons coming from the quasar itself (see Section~\ref{sec:powering} for further discussion). Figure~\ref{fig:Sigmamaps} shows the atlas of the 61 maps for the flux-weighted velocity dispersion. In the bottom left corner of each image we indicate the average velocity dispersion $\langle \sigma_{\rm Ly\alpha} \rangle$ within each nebulosity. We find that the extended Ly$\alpha$\ emission has $\langle \sigma_{\rm Ly\alpha} \rangle < 400$~km~s$^{-1}$ (or FWHM$<940$~km~s$^{-1}$) in all the cases, irrespective of the radio-loudness of the targeted quasars. These estimates are similar to the velocity widths observed in absorption in the CGM surrounding $z\sim2$ quasars ($\Delta v>300$~km~s$^{-1}$; \citealt{qpq3,qpq9}). As done in \citet{qpq9}, we can compare these values with the expected velocity dispersion for a dark matter halo hosting quasars. In particular, it has been found that the maximum of the average one-dimensional root-mean-square (rms) velocity $\sigma_{\rm rms-1D}$ is related to the maximum circular velocity within a dark matter halo by $\sigma_{\rm 1D}=V_{\rm circ}^{\rm max}/\sqrt{2}$ (\citealt{Tormen1997}). If we assume dark matter halos of M$_{\rm DM}\sim10^{12.5}$~M$_{\odot}$ (\citealt{white12}) at $z\sim3$, an NFW profile (\citealt{Navarro1997}) with a concentration parameter of $c=3.7$ (\citealt{Dutton2014}), the maximum circular velocity is $V_{\rm circ}^{\rm max}=360$~km~s$^{-1}$. Hence $\sigma_{\rm rms-1D}=250$~km~s$^{-1}$. The motions within all these Ly$\alpha$\ nebulae have thus amplitudes consistent with gravitational motions expected in dark matter halos hosting quasars, with part of the velocity dispersion likely due to Ly$\alpha$\ resonant scattering and instrument resolution (FWHM$\approx2.83$\AA\ or 170 km~s$^{-1}$ at $5000$\AA). To check for any dependence on the quasar luminosity and on the strength of the radio emission, in Figure~\ref{fig:sigmavsMi} we plot the average flux-weighted velocity dispersion for each nebulosity as a function of $M_i(z=2)$ for each targeted quasar. On the same plot, we differentiate between objects with measured radio fluxes and radio-quiet object (red and blue), and use larger symbols for quasars characterized by stronger radio emission. It is clear that there are no trends in both luminosity or radio strengths, confirming that the mechanisms responsible for the broadening of the Ly$\alpha$\ line on 50 kpc scales do not depend on these properties for at least our observed ranges ($F_{\rm Radio}<900$~mJy; $M_i(z=2)\gtrsim-29$ for radio-loud objects, and $M_i(z=2)>-29.7$ for radio-quiet). We note however that the relatively quiescent Ly$\alpha$\ nebulosities around all the 15 radio-loud quasars in our sample run counter to the two radio-loud systems with $\sigma>425$~km~s$^{-1}$ (or FWHM$>1000$~km~s$^{-1}$) showed by \citet{Borisova2016}. Specifically, the two radio-loud objects in \citet{Borisova2016}, PKS~1937-101 and QB~2000-330, have a peak flux at $1.4$~Ghz of $838.8\pm25.2$~mJy and $446.8\pm15.7$~mJy (\citealt{Condon1998}), and a magnitude of $M_{i}(z=2)=-30.35$ and $-29.77$, respectively. Even though we have in our sample quasars as strong in radio emission as these two, i.e. ID 49 and 54 ($>700$~mJy), our quasars are 2.4 magnitudes fainter and show $\langle \sigma_{\rm Ly\alpha} \rangle = 221$, and $287$~km~s$^{-1}$ (or FWHM~$=519$, and $647$~km~s$^{-1}$). This difference thus suggests that -- if an outflow is present in the radio-loud systems -- (i) the winds are driven by the radiative output of the AGN rather than by a jet, and/or (ii) the coupling between the Ly$\alpha$\ emitting gas on large scales (tens of kpc) and an outflow is more effective around more luminous AGN, and/or (iii) more luminous radio-loud AGN are able to sustain coherent winds (or jets) for longer timescales. It is interesting to note that also in the radio-quiet population there can be extended Ly$\alpha$\ nebulosities showing broad emission. In particular, \citet{Borisova2016} showed one radio-quiet quasar in their sample, J0124+0044 (z=3.783), with broad extended Ly$\alpha$\ emission. The statistics from our work together with \citet{Borisova2016} suggests a very low rate, 1 out of 56 (39+17), which seems to not depend on the current quasar luminosity\footnote{The object in \citet{Borisova2016} with broad Ly$\alpha$\ emission has $M_i(z=2)=-28.98$}. We further discuss these rare broad extended Ly$\alpha$\ nebulosities (for both radio-quiet and radio-loud systems) in Section~\ref{sec:timescale}. \begin{figure*} \includegraphics[width=0.85\textwidth]{Fig9.pdf} \caption{Atlas of the 61 maps for the flux-weigthed velocity cendroid of the Ly$\alpha$\ emission around the quasars in the QSO MUSEUM sample. The flux-weighted centroid is calculated as first moment of the flux distribution with respect to the peak of the Ly$\alpha$\ emission of each nebulosity $z_{\rm peak\, Ly\alpha}$ (Table~\ref{tab:sample}). Each image is presented on the same scale of Figure~\ref{fig:SBmaps}, $30\arcsec\times30\arcsec$ (or about $230$~kpc~$\times 230$~kpc), even though we use only the information within the extracted 3D-masks to compute these ``velocity maps'' (see Section~\ref{sec:cubex}). In each image the white crosshair indicates the position of the quasar prior to PSF subtraction. A cyan diamond in the bottom-left corner indicates that the quasar is radio-loud. The detected extended Ly$\alpha$\ emission shows complex and noisy maps on tens of kiloparsecs, while more coherent patterns on larger scales (see ID 13).} \label{fig:Velmaps} \end{figure*} \begin{figure*} \includegraphics[width=0.85\textwidth]{Fig10.pdf} \caption{Atlas of the 61 maps for the flux-weigthed velocity dispersion of the Ly$\alpha$\ emission around the quasars in the QSO MUSEUM sample. The velocity dispersion is calculated as second moment of the flux distribution. Each image is presented on the same scale of Figure~\ref{fig:SBmaps}, $30\arcsec\times30\arcsec$ (or about $230$~kpc~$\times 230$~kpc), even though we use only the information within the extracted 3D-masks to compute these ``velocity-dispersion maps'' (see Section~\ref{sec:cubex}). In each image the white crosshair indicates the position of the quasar prior to PSF subtraction. A cyan diamond in the top-left corner indicates that the quasar is radio-loud. We indicate in the bottom-left corner of each image the average velocity dispersion $\langle \sigma_{\rm Ly\alpha} \rangle$ for each map. The extended Ly$\alpha$\ nebulae show an average velocity dispersion $\langle \sigma_{\rm Ly\alpha} \rangle < 400$~km~s$^{-1}$ (or FWHM$<940$~km~s$^{-1}$), irrespective of the radio-loudness of the targeted quasars.} \label{fig:Sigmamaps} \end{figure*} \begin{figure} \centering \includegraphics[width=0.95\columnwidth]{Fig11.pdf} \caption{Plot of the average flux weighted velocity dispersion $\langle \sigma_{\rm Ly\alpha} \rangle$ of each Ly$\alpha$\ nebulosity versus the absolute $i$-band magnitude normalized at $z=2$, $M_i(z=2)$, using \citet{Ross2013}. We indicate in blue the radio-quiet systems, while in red the radio-loud objects. The size of the symbol for the radio-loud objects symbolizes the flux listed in Table~\ref{tab:sample}, i.e. larger symbols mean larger fluxes following the relation ${\rm size}_{\rm radio} = {\rm size}_{\rm quiet} + 5\times{\rm log} (F_{\rm Radio})$. The crosses indicates the objects for which we do not have information on their radio flux. The average flux-weighted velocity dipersion do not depend on the current quasar luminosity or strength of radio emission.} \label{fig:sigmavsMi} \end{figure} \subsection{Spectral shape and asymmetry of the extended Lyman-Alpha emission} As the Ly$\alpha$\ photons are expected to experience frequency excursions in the scattering process (\citealt{Dijkstra2017} and references therein), and the resulting change in frequency depends both on local and unrelated structures, the shape of the Ly$\alpha$\ line can be fundamental in understanding the astrophyiscs of the studied system, e.g. presence of inflows/outflows (e.g., \citealt{Laursen2009}), absorption from the foreground IGM. For this reason, it is particular important to quantify the asymmetries of the Ly$\alpha$\ line profile, and/or the presence of different peaks (e.g., \citealt{Gronke2016}). Unfortunately, our data lack the necessary sensitivity to clearly assess the presence of asymmetric wings in the line profile. This has been indeed tested by calculating the third moment of the flux distribution for the extended Ly$\alpha$\ emission as done for the smaller moments, leading to poorly constrained and inconclusive values. By averaging over the whole nebulae we could achieve higher sensitivity, but we would complicatedly mix, and washed out the low S/N features we are looking for. In addition, we do not detect clear double-peaks profile -- expected in the case of optically thick gas (e.g., \citealt{Neufeld_1990}) -- in any of the discovered Ly$\alpha$\ nebulosities. However, this result may be driven by the spectral resolution of MUSE at these wavelengths (FWHM$\approx2.83$\AA\ or 170 km~s$^{-1}$ at $5000\AA$). Therefore, for this kind of detailed analysis, we would need a dataset with a much higher S/N for the wings of the Ly$\alpha$\ emission, and with higher spectral resolution. Now that the level of the Ly$\alpha$\ emission is known, we can plan such experiments. \section{Discussion} \label{sec:disc} From the analysis presented in the previous sections, it is clear that we have detected extended Ly$\alpha$\ emission on tens of kpc scales around each of the targeted quasars. In this section we discuss some of the implications of the observations presented in this work, relying only on the information coming from the Ly$\alpha$\ emission. In future studies, we will revisit these points with the use of additional diagnostics. \subsection{Small detection rate for Enormous Lyman-Alpha Nebulae} \label{sec:ELAN} Recent observations have shown the existence of Enormous Lyman-Alpha Nebulae (ELAN; \citealt{cantalupo14,hennawi+15,Cai2016}) extending for hundreds of kiloparsecs around $z\sim2$ quasars, with SB$_{\rm Ly\alpha}\sim10^{-17}$~erg s$^{-1}$ cm$^{-2}$ arcsec$^{-2}$. Current statistics suggest that the ELAN are very rare structures which are found around a few percent of the targeted radio-quiet quasars at $z\sim2$ (\citealt{qpq4,hennawi+15}). One of the aim of the QSO MUSEUM survey, together with on-going efforts (e.g., \citealt{Cai2018}), is to better characterize the frequency of this phenomenon, and understand why these nebulae are so uncommon (e.g., presence of companions, halo mass, illumination). Thanks to our QSO MUSEUM survey, and the previous work of \citet{Borisova2016}, we have now amassed a sample of 80 ($61+19$) quasars at $z\sim3$ down to SB$_{\rm limit}\sim {\rm few}\times 10^{-18}$erg s$^{-1}$ cm$^{-2}$ arcsec$^{-2}$. Of all these quasars, only one object shows the extreme observed surface brightnesses and extents found in the ELAN at $z\sim2$, i.e. the ID 13 in this work or PKS~1017+109. All the other nebulosities show lower levels of Ly$\alpha$\ emission or extends only to much smaller distances from the central quasar down to the same SB limits (see Figure~\ref{fig:asymmetry}). The ELAN around the quasar PKS~1017+109 has been studied in detail in \citet{fab+2018}, where we have indicated the common peculiarities with the other ELAN discovered at $z\sim2$, with particular emphasis on the identification of active companions in their surroundings. It has been proposed that the higher SB$_{\rm Ly\alpha}$ in these ELAN traces patches with higher volume densities than the average population at both redshifts (\citealt{hennawi+15,fab+16}) and/or gas reprocessing the additional contribution to the ionizing radiation from the active companions (\citealt{fab+2018}) in the environment of ELAN. The higher density patches could be due to substructures interacting with the main halo hosting the targeted quasars (\citealt{fab+2018}). Further, to clarify how easy it is to detect ELAN with current facilities and how a detected Ly$\alpha$\ nebulosity around a quasar could ``grow'' with longer integration times, in Figure~\ref{fig:AreaVSSN} we show the histogram of the area spanned by each of the Ly$\alpha$\ nebulosities in our sample for different S/N detection threshold (the different colors). For each histogram, we indicate the position of the nebula around the quasar with ID 13, or PKS~1017+109 (\citealt{fab+2018}). It is clear that ELAN are clearly visible as extended objects even with shorter integration times than used here, as the area for ${\rm S/N}=10$ is already $>200$~arcsec$^2$ for ID 13. In the same figure, an additional x-axis indicates the corresponding radius for a circular nebula with the same area, i.e. $R=\sqrt{(Area/\pi)}$. Even with the threshold of ${\rm S/N=10}$ this ELAN has $R>60$~kpc. The plot in the inset of Figure~\ref{fig:AreaVSSN} shows how the area grows for each nebulosity as a function of S/N with respect to the area for ${\rm S/N}=10$. In the same plot, we color coded the line for each Ly$\alpha$\ nebula depending on the final observed area for ${\rm S/N}=2$. This plot shows that the nebulae with the larger sizes (lines with lighter colors) do not increment their extent as fast as smaller nebulae if deeper observations are conducted. This occurrence could reflect the different scales probed by the different nebulae. Indeed, while small Ly$\alpha$\ nebulae most probably trace the gas within the central portion of the dark matter halo hosting a quasar, nebulae with $100$~kpc sizes start to probe IGM regions where the densities are expected to be lower. This has been also the case for the nebula around UM~287 (\citealt{cantalupo14}), which was detected after only 20 minutes of NB imaging with the Low Resolution Spectrograph (LRIS; \citealt{Oke1995}) instrument on the Keck telescope. The size of the nebula did {\it not} increase significantly with the total observing time acquired in those observations of $\sim10$~hours. If the relation for the large nebulosities shown in the inset of Figure~\ref{fig:AreaVSSN} holds for even larger areas, one would need to increase the S/N by a factor of 8 to roughly double the detected area. This would then require additional $\sim64$~hours on a previously detected 200~arcsec$^2$ Ly$\alpha$\ nebula in data as deep as our survey. However, the characteristics of the powering mechanisms and the volume density of the gas can both change on larger scales, most probably requiring longer integration times to detect the IGM. \begin{figure*} \centering \includegraphics[width=0.75\textwidth, clip]{Fig12.pdf} \caption{Histogram of the variation of the area for each Ly$\alpha$\ nebulosity for different S/N thresholds (different colors as indicated in the legend). The ELAN discovered in QSO MUSEUM is indicated with arrows. The plot in the inset shows the logarithmic variation of the area (normalized to the area for ${\rm S/N}=10$) of the Ly$\alpha$\ nebulae with respect to the S/N threshold. In this plot, we color-coded the lines for each nebula following the area for ${\rm S/N}=2$ as listed in Table~\ref{Tab:LyaNeb}. This plot clearly state that ELAN can be detected with very fast integrations with current facilities. Smaller Ly$\alpha$\ nebulae have the potentiality of ``growing'' faster than ELAN when the exposure time is increased, probably reflecting the different scales sampled (CGM vs CGM+IGM).} \label{fig:AreaVSSN} \end{figure*} \subsection{Is there a redshift evolution of extended Lyman-Alpha emission around quasars?} \label{sec:redshiftEvol} As anticipated in Section~\ref{sec:av-prof} and shown in Figure~\ref{fig:averageProf}, the current observations of Ly$\alpha$\ halos around radio-quiet quasars hint to a clear difference between the $z\sim3$ and $z\sim2$ population. Indeed, the Ly$\alpha$\ emission seems to be much stronger at $z\sim3$ than at $z\sim2$, maybe suggesting a larger mass in the cool ($T\sim10^4$~K) phase of the CGM at $z\sim3$ than at $z\sim2$ ($M_{\rm cool}>10^{10}$~M$_{\odot}$; \citealt{QPQ5,QPQ7}). Here we investigate this hypothesis. To further check the presence of a redshift evolution, we split our large sample of radio-quiet quasars into two redshift bins, and look for any trend that would confirm the strong difference between $z\sim2$ and $z\sim3$. Given the large uncertainties on the systemic redshift of our sample (see Section~\ref{sec:systemic_redshift}), we built the two redshift bins by maximizing the number of objects in each bin, while excluding quasars whose redshift is so uncertain that they could sit in the other bin both because of the uncertainty on the systemic redshift $z_{\rm systemic}$, and/or the difference in redshift between the Ly$\alpha$\ nebula $z_{\rm peak\, Ly\alpha}$ and $z_{\rm systemic}$. We find that a cut $z_{\rm peak\, Ly\alpha}<3.191$ and $z_{\rm peak\, Ly\alpha}>3.229$ satisfies our conservative criteria, resulting in two almost equally populated subsamples of 17 and 18 objects each, respectively. The selected quasars cannot change their bin even with a $3\sigma$ deviation from their current redshift. The median redshift for the two samples is $z_{\rm low}=3.114$, and $z_{\rm high}=3.336$. Such a redshift difference corresponds to about 0.15 Gyr in the standard cosmology assumed in this work. For each bin, we then computed the average profile as performed in Section~\ref{sec:av-prof}. \begin{figure*} \centering \includegraphics[width=0.9\textwidth, clip]{Fig13.pdf} \caption{Redshift evolution of Ly$\alpha$\ emission around quasars. Left panel: we show the average profile for the whole sample (large blue; 61 targets), the radio-quiet lower-$z$ subsample (small dark-green diamond; 17 quasars), and radio-quiet higher-$z$ subsample (small brown squares; 18 quasars) after correcting the SB for the cosmological dimming and using comoving units for the radii. For each profile, open symbols indicate negative datapoints. We compare our dataset with the average profile for $z\simeq2.25$ quasars by \citet{fab+16}. Right panel: the average SB profiles presented in the left panel are now plotted with respect to the proper radius normalized to the virial radius $R_{\rm vir}=[3M_{\rm halo}/(800\pi\rho_{\rm crit}(z))]^{1/3}$ expected for halos hosting quasars at these redshifts (see Section~\ref{sec:redshiftEvol} for details). We show the best exponential fit to the two subsamples (colored dashed lines). Using the ratio between the parameters of these two fits we predict the evolution for lower-redshifts in steps of about 0.15 Gyr (dotted lines). The thicker dotted line corresponds to about 1.05 Gyr, the difference between the higher-$z$ subsample and $z\simeq2.25$. For reference, the gray vertical line indicates 1 Rvir. Our observations thus suggest a clear evolutionary trend (see Section~\ref{sec:redshiftEvol} for discussion).} \label{fig:EvolProf} \end{figure*} The left panel in Figure~\ref{fig:EvolProf} shows the comparison of the average surface brightness profiles for the two redshift bins with the profile for the whole sample, and the profile at $z\simeq2.25$ (\citealt{fab+16}) after correcting all for the SB dimming. A difference between the higher and the lower redshift bin is evident, with the lower-$z$ profile being always below the data-points for higher-$z$. The average ratio between the data-points for the two subsamples is $1.5\pm0.1$, while the profile for $z\simeq2.25$ is a factor of about $17\pm8$ lower (two central points) with respect to the lower-$z$ subsample. These differences are thus significant given the estimated uncertainties. What is the cause of such strong variations? We first explore the possibility that such differences are due to the cosmological evolution of densities and scales. \citet{MasRibas2018} investigated the redshift scaling of a low SB signal in the case of electron-scattering around quasars. They show that the cosmological evolution of densities and scales cancel out the cosmological effect of surface brightness dimming $(1+z)^{-4}$ in their particular case. Here, we perform a similar calculation, but in the case of Ly$\alpha$\ emission from gas clouds that are optically thin to Lyman continuum photons (neutral Hydrogen column density $N_{\rm HI}\ll10^{17.2}$~cm$^{-2}$). This emission scenario is indeed the most favored scenario for extended Ly$\alpha$\ emission around AGN (e.g., \citealt{heckman91a,fab+15b,fab+16,Cai2016}; see also discussions in \citealt{qpq4,cantalupo14}). Following the formalism in \citet{qpq4}, the observed Ly$\alpha$\ surface brightness in an optically thin scenario scales as SB$_{\rm Ly\alpha}\propto (1+z)^{-4}n_{\rm H}N_{\rm H}$, where $n_{\rm H}$ is the Hydrogen volume density, and $N_{\rm H}$ is the Hydrogen total column density. It can be shown that $N_{\rm H}\propto n_{\rm H}R_{\rm vir}$ (see e.g. equation 2 in \citealt{qpq4}), where $R_{\rm vir}$ is the virial radius of the quasars' halo, $R_{vir}\equiv R_{200}=[3M_{\rm halo}/(800\pi\rho_{\rm crit}(z))]^{1/3}$ \footnote{Here we use as virial radius the radius $R_{200}$ at which the average density of a matter overdensity is 200 times the cosmic mean density.}. To compute the dependence with redshift we thus need an estimate of the quasars' halo mass at the redshifts of interest. The current consensus in the literature indicates that quasars at $z\sim2$ and $z\sim3$ inhabits dark-matter halos with similar masses ($M_{\rm halo}=10^{12.5}$~M$_{\odot}$) independent of their luminosities, though with large uncertainties (e.g., \citealt{daAngela2008,Kim&Croft2008,white12,Trainor2012} ). If we then assume the same halo mass for the different redshifts, $R_{\rm vir}$ changes only because of the evolution of the critical density $\rho_{\rm crit}(z)$, thus increasing by a factor (1+z) towards lower redshifts. Therefore, because the cosmological evolution sets $n_{\rm H}\propto (1+z)^3$, and $N_{\rm H}\propto n_{\rm H}R_{\rm vir}\propto(1+z)^2$, we find an overall scaling of SB$_{\rm Ly\alpha} \propto (1+z)$ or SB$_{\rm Ly\alpha}^{\rm no\, dimming} \propto (1+z)^5$ when taking out the factor for the SB dimming as in Figure~\ref{fig:EvolProf}. If the changes in the Ly$\alpha$\ profiles were caused simply by the cosmological evolution of density and scales, we would thus expect a ratio of 1.3 and 3, respectively between the two subsamples at $z\sim3$, and between $z\simeq2.25$ and the lower-$z$ subsample. These values differ with the aforementioned observed ratios ($1.5\pm0.1$ and $17\pm8$), suggesting that the profile evolution is much stronger than expected from the cosmological density evolution. This result matches well with the high densities ($n_{\rm H}> 1$~cm$^{-3}$) invoked to explain the levels of the observed Ly$\alpha$\ emission (\citealt{heckman91a, cantalupo14,fab+15b, hennawi+15}). Such a high density gas most likely does not trace the evolution of the cosmic mean density. We then focus on physical processes that could act on CGM scales. To have a better handle on the profiles evolution on such scales, we plot the SB values with respect to the physical distance normalized to the virial radius of the quasars' halo at each redshift, $R_{\rm vir}$. As previously done, we assumed the same halo mass for the redshift subsamples, finding $R_{\rm vir}^{z\sim2}\simeq 130$~kpc and $R_{\rm vir}^{z\sim3}\simeq 100$~kpc, respectively for $z\simeq2.25$ and $z\sim3$. The right panel of Figure~\ref{fig:EvolProf} shows this test. At $z\sim3$ the exponential behavior of the SB profiles now seems to well describe the presence of emitting gas within a halo of radius $R_{\rm vir}$, with a consequent dimming of the Ly$\alpha$\ emission at larger distances. At $z\sim2$ the Ly$\alpha$\ emission seems instead more concentrated in the central portion of the halos, with tentative indications of a fainter signal at larger separations. \input{Tab_fit_profile_subsamples.tex} To quantitatively constrain the difference between profiles and check if there is any relation between their shapes, we proceed as follows. First, we fit the two subsamples at $z\sim3$ with an exponential function ${\rm SB}(x)=C_e {\rm exp}(-x/x_h)$ (colored dashed lines in Figure~\ref{fig:EvolProf} and Table~\ref{Tab:fit_subsamples}). Being $\approx0.15$~Gyr one from the other, the ratio between the parameters of these profiles ($C_e$ and $x_h$) could define a trend for the evolution towards lower-$z$. We then construct other exponential functions by using such ratios (thus in steps of 0.15 Gyr; dotted lines in the right panel of Figure~\ref{fig:EvolProf}). A profile at $z=2.25$ should be at 1.05 Gyr (or about 7 steps; thicker dotted line) from the profile of the higher-$z$ sample. Surprisingly we find the datapoints of \citet{fab+16} at this location. Figure~\ref{fig:EvolProf} thus shows a striking agreement between the profile reported by \citet{fab+16} and the predictions based on $z\sim3$. The difference we detect for the subsamples at $z\sim3$ is then possibly due to the same physical mechanism(s) that cause the difference between $z\sim3$ and $z\sim2$, and these most likely act on CGM scales. Given the currently favored optically thin scenario for the Ly$\alpha$\ emission, the abrupt decrease in SB$_{\rm Ly\alpha}$ -- which follows SB$_{\rm Ly\alpha}\propto n_{\rm H}N_{\rm H}$ -- could be due to a strong variation in $n_{\rm H}$ and/or $N_{\rm H}$. We have shown however that variations in densities have to be larger than the cosmological density evolution, making it unlikely that only variations in $n_{\rm H}$ are responsible for the differences between $z\sim2$ and $z\sim3$. Variations in $N_{\rm H}$ -- or in other words in the mass of the cool optically thin gas phase within the CGM, $M_{\rm cool}\propto N_{\rm H}$ (e.g., \citealt{qpq4}) -- are thus a more plausible explanation. Intriguingly, theoretical works have predicted just such a scenario for halos with masses above the critical halo mass for shock stability $M_{\rm shock}\simeq 10^{12}$~M$_{\odot}$ (roughly constant with redshift; \citealt{Dekel&Birnboim2006,Dekel2009}). As mentioned above, the quasars here studied should be indeed in this regime. In this theoretical framework, if $M_{\rm halo}>M_{\rm shock}$ there are two possible scenarios for the CGM: i) the presence of cool streams embedded in a hot phase, and ii) the prevalence of the hot phase. The smooth transition between these two scenarios, or the maximum halo mass for cold streams, is a function of redshift, and is set by the shock stability criterion for the cool streams to balance the virial shock-heating (see Section~4.3 in \citealt{Dekel&Birnboim2006}). At the quasar's halo mass at $z\sim2$ and $z\sim3$, $M_{\rm halo}=10^{12.5}$~M$_{\odot}$, the threshold between the two scenarios is at $z=2$ (see Figure 7 in \citealt{Dekel&Birnboim2006}). As one expects a smooth transition from the presence of cool streams to their absence, we conclude that the observed decrease in Ly$\alpha$\ emission around quasars from $z\sim3$ to $z\sim2$ could be due to this phenomenon, namely the inability of cool dense gas to survive the shock-heating process in similarly massive halos at lower $z$. It is important to stress that this scenario would hold for any powering mechanism for the Ly$\alpha$\ emission (see Section~\ref{sec:powering}). In other words, a decrease with redshift in the mass of the cool gas component within the CGM would result in a decrease of the level of Ly$\alpha$\ emission. Finally, our result could be linked to the evolution of the space density of bright quasars as a function of redshift (e.g., \citealt{Richards2006}). It has been shown indeed that the space density of quasars steadily increases from $z=5$ to lower redshifts, peaking between redshift $z=2$ and $z=3$. After this peak, the space density drops significantly, reaching at $z=1$ roughly the same value of $z=5$ (e.g., Figure 20 in \citealt{Richards2006}). This trend, together with the level of star-formation of the quasars' hosts, could be related to the drastic changes within the quasars CGM which we start to witness. If the cool phase within the CGM cannot be replenished by infalling gas from the IGM or from the transformation of hot gas into cool gas within the CGM, the mass of cool CGM gas would thus drastically decrease, probably preventing future episodes of quasar activity as this gas is also the fuel for the high star-formation rates estimated for quasars' hosts (e.g., \citealt{rtl+13}). This scenario finds additional confirmation in the fact that the IGM becomes more tenuous at lower redshift (e.g., \citealt{Dave2010,McQuinn2016}), and the halo gas is expected to warm up while structure evolution progresses (e.g., \citealt{Dekel&Birnboim2006,vandeVoort2011}). We stress again that our result is based on heterogeneous techniques and thus requires a confirmation with current IFU instruments at $z\sim2$ (e.g. KCWI) and higher redshifts. Sensitive current facilities, such as MUSE and KCWI, will allow us to tackle these hypothesis with statistical and homogeneous samples, painting a clear picture for the evolution of the cool gas phase around quasars across cosmic time. \subsection{What is the combination of mechanisms powering the Lyman-alpha emission?} \label{sec:powering} To better understand the astrophysics of the Ly$\alpha$\ emitting gas, it is key to determine the primary mechanism (or constrain the combination of mechanisms) which power the observed Ly$\alpha$\ luminosities. While studying LABs, i.e. Ly$\alpha$\ nebulae with area$>16$~arcsec$^2$ and $L_{\rm Ly\alpha}\sim 10^{43}-10^{44}$~erg~s$^{-1}$ at $z\sim2-6$, several studies have usually invoked four mechanisms to power the extended Ly$\alpha$\ emission: (i) shocks powered by outflows (e.g., \citealt{Mori2004}), (ii) Ly$\alpha$\ collisional excitation or so called gravitational cooling radiation (e.g., \citealt{Haiman2000,Rosdahl12}), (iii) photoionization by a central AGN or star-formation (e.g., \citealt{Overzier2013,Prescott2015b}), (iv) resonant scattering of Ly$\alpha$\ photons from embedded sources (e.g., \citealt{Dijkstra2008}). In addition, when the Ly$\alpha$\ emission encompasses very large scales and radio-loud objects are within the sample, additional processes could inevitably affect the observed levels, e.g., presence of multiple active sources, shocks from radio jets. All of these processes may contribute together to the observed Ly$\alpha$\ emission, but due to the complexity to simulate them simultaneously, they are usually assessed individually. Given the similar levels of Ly$\alpha$\ emission of LABs and the nebulosities around quasars, we here consider in turn all the aforementioned processes. As anticipated in Section~\ref{sec:kinematics}, the relatively quiescent ($\langle\sigma_{\rm Ly\alpha}\rangle<400$~km~s$^{-1}$) Ly$\alpha$\ line of the discovered nebulosities seems to be consistent with gravitational motions within the massive halos currently expected to host quasars. These large-scale nebulosities are thus unlikely powered by very fast outflows driven by the quasar ($v_{\rm s}>1000$~km~s$^{-1}$). Due to our spatial resolution and to our analysis technique, we cannot however rule out the presence of winds on smaller scales (few kpc). Such small-scale winds could act as additional sources of ionizing photons ($F_{\rm UV}\propto v_{\rm s}^3$; e.g., \citealt{Allen2008}), and thus contribute to power the Ly$\alpha$\ emission on large scales through the recombination channel. In addition, especially in the case of radio-loud objects, a collimated jet may be responsible for part of the emission. As stated in Section~\ref{sec:kinematics}, we do not find evidences for violent kinematics in radio-loud objects. However, in Appendix~\ref{app:FIRST} we show that the extended Ly$\alpha$\ emission for the radio-loud objects with detections from the FIRST survey (spatial resolution of 5 arcsec) matches well the extent of the detected radio emission. This occurrence probably reveals a link between the Ly$\alpha$\ emission and the synchrotron radiation usually invoked to explain the radio data (see e.g. \citealt{vanOjik1996,mileyd08} for the alignment seen in HzRGs). Further, it has been routinely shown that collisional excitation of the Ly$\alpha$\ line would require a fine tuning between the density and the temperature of the gas to reproduce the observations (e.g., \citealt{Dijkstra2009_hd}). This is due to the exponential dependence on temperature of the collisional excitation coefficient and, being a collisional process, to the dependence on density squared in the ionized case. Thus, as it has been stressed previously in the case of Ly$\alpha$\ nebulae (e.g., \citealt{Borisova2016}), collisional excitation seems to be unlikely the dominant mechanism when strong ionizing sources are present. Indeed, the only requirement for a photoionization scenario (by the quasar or other ionizing sources) is at least a partial illumination of the cool emitting gas by the targeted AGN. As explained in \citet{qpq4}, we can solve for two limiting regimes in the case of photoionization from a source with ionizing luminosity $L_{\nu_{\rm LL}}$. In the first case, the source or the level of radiation is not strong enough to highly ionize the gas, allowing a large fraction of neutral Hydrogen to be present, i.e. the gas is optically thick to Lyman continuum photons ($N_{\rm HI}\gg 10^{17.2}$~cm$^{-2}$). In this approximation the cool gas will behave like a `mirror', converting a portion of the impinging ionizing radiation into Ly$\alpha$\ emission. The SB thus follows the relation SB$_{\rm Ly\alpha}\propto L_{\nu_{\rm LL}}$. In the second case instead, the source of radiation is bright enough to keep the gas highly ionized, i.e. the gas is optically thin to Lyman continuum photons ($N_{\rm HI}\ll 10^{17.2}$~cm$^{-2}$). In this regime, as anticipate in Section~\ref{sec:redshiftEvol}, it can be shown that SB$_{\rm Ly\alpha}\propto n_{\rm H} N_{\rm H}$. Therefore, in the optically thin regime, the observed surface brightness should not depend on the luminosity of the targeted quasars, but only on the physical properties of the gas, i.e., the volume density $n_{\rm H}$, and the column density $N_{\rm H}$. In addition, if there is enough neutral Hydrogen (i.e. the gas is optically thick in the Ly$\alpha$\ transition, $N_{\rm HI}\gtrsim10^{14}$~cm$^{-2}$), the resonant scattering of Ly$\alpha$\ photons emitted by the central AGN or embedded sources could be a viable process to produce extended Ly$\alpha$\ emission (e.g., \citealt{Dijkstra2017}, and references therein). In this case, the Ly$\alpha$\ emission on large scales is due to a `random walk' in frequency and in space of centrally produced Ly$\alpha$\ photons. This process is caused by the absorption and consequent re-emission of photons by neutral hydrogen atoms in the quasar CGM. If scattering of Ly$\alpha$\ photons from the quasar is the main powering mechanism, we would thus expect the observed SB$_{\rm Lya}$ to be proportional to the Ly$\alpha$\ emitted by the quasar, SB$_{\rm Ly\alpha}\propto L_{\rm Ly\alpha}^{\rm QSO}$. On top of this, $L_{\rm Ly\alpha}^{\rm QSO}$ is expected to increase with increasing quasar's $L_{\nu_{\rm LL}}$. We show this trend in Figure~\ref{fig:LLyaMi} where we plot the peak Ly$\alpha$\ luminosity of each quasar $L_{\rm Ly\alpha;QSO}^{\rm peak}$ against their absolute $i$-mag normalized at $z=2$. The first quantity has been calculated by considering the maximum at the Ly$\alpha$\ transition of the quasar's spectra shown in Figure~\ref{fig:1DspecComparison}. In this plot we indicate the radio-loudness of our targets (red and blue) and we associate a green circle to each data-point. This green circle indicates the product of the area of each nebulosity and the distance between the center of the nebulosity and the targeted quasars as defined in section~\ref{sec:asymm}. The data in Figure~\ref{fig:LLyaMi} appear to be slightly correlated but a linear regression through the datapoints resulted in a Pearson correlation coefficient of $r_{\rm PCC}=0.4$, which is not statistically meaningful. We however overlay in the figure the obtained fit to the data, $L_{\rm Ly\alpha;QSO}^{\rm peak}/(10^{31}\, {\rm erg~s~Hz^{-1}})=12.376\times10^{-(M_i(z=2)+27)/2.5}$ (black solid line), together with the 1 rms distance from the fit (dahsed lines). \begin{figure} \centering \includegraphics[width=0.9\columnwidth, clip]{Fig14.pdf} \caption{Plot of the peak Ly$\alpha$\ luminosity of the targeted quasars $L_{\rm Ly\alpha;QSO}^{\rm peak}$ versus their absolute $i$-mag normalized at $z=2$, $M_i(z=2)$. As done in Figure~\ref{fig:sigmavsMi}, we indicate in blue the radio-quiet systems, while in red the radio-loud objects (larger sizes = larger $F_{\rm Radio}$). The crosses indicate the objects for which we do not have information on their radio flux. The green circles are drawn for all the objects and their sizes indicates a product of the area of the nebulosities and of the distance between the center of the nebulosities and the targeted quasars (see Figure~\ref{fig:asymmetry}). The solid and dashed black lines show a linear fit to the data and the 1 rms distance from the fit, respectively (see Section~\ref{sec:powering} for details).} \label{fig:LLyaMi} \end{figure} The aforementioned last three cases, namely photoionization of optically thick or thin gas, and resonant scattering are thus closely related, difficult to disentangle, and possibly present simultaneously. However, if any of these mechanisms plays a dominant role in the production of extended Ly$\alpha$\ around quasars with no effect from the other mechanisms, it should naively imprint a well defined dependence in the observed Ly$\alpha$\ levels as explained previously. We have thus explored our data to find any of the aforementioned relations for the SB$_{\rm Ly\alpha}$. In particular, we checked for variation of the average SB$_{\rm Ly\alpha}$ with current ionizing luminosity, and with the peak Ly$\alpha$\ luminosity of the targeted quasars $L_{\rm Ly\alpha;QSO}^{\rm peak}$. In addition, we have also looked for any dependence for the peak of the Ly$\alpha$\ emission from the nebulosities $L_{\rm Ly\alpha;Neb}^{\rm peak}$ against the same quantities. Consistently with $L_{\rm Ly\alpha;QSO}^{\rm peak}$, we have computed the peak of the Ly$\alpha$\ emission of the nebulosities using the spectra shown in Figure~\ref{fig:1DspecComparison}. Figure~\ref{fig:VariousPlots} shows this test. The two left panels of this figure reveal that there is no clear dependence on the quasar luminosity (spanning roughly three magnitudes) for both the SB$_{\rm Ly\alpha}$ and for $L_{\rm Ly\alpha;Neb}^{\rm peak}$, with a consistent number of the nebulosities sitting at similar values around $\sim0.4\times10^{-17}$~erg s$^{-1}$ cm$^{-2}$ arcsec$^{-2}$\ and $\sim0.8\times10^{31}$~erg~s$^{-1}$~Hz$^{-1}$, respectively for SB$_{\rm Ly\alpha}$ and $L_{\rm Ly\alpha;Neb}^{\rm peak}$. Given the absence of any dependence with quasar luminosity, this occurrence seems to rule out a fully optically thick regime for the Ly$\alpha$\ emitting gas, while hints to the possibility of this gas being optically thin to the ionizing radiation. This is usually found to be indeed the case if one assumes the quasar to shine on gas at distances comparable with halo scales (hundreds of kpc; \citealt{fab+15b,fab+2018}). The nebulosities however are characterized by a wide scatter around the aforementioned values, especially for SB$_{\rm Ly\alpha}$, indicating that other processes probably drive the level of the Ly$\alpha$\ emission. The two right panels of Figure~\ref{fig:VariousPlots} show our test for the dependence of the Ly$\alpha$\ emission of the nebula (peak and average) with respect to the Ly$\alpha$\ luminosity of the quasars, and thus probe a pure scattering scenario. In an attempt to verify the presence of a linear correlation within the dataset, we have performed a linear fit to the data and calculated the Pearson correlation coefficient $r_{\rm PCC}$. For both plots, we do not find any strong correlation, with $r_{\rm PCC}=0.2$ and $r_{\rm PCC}=0.3$ for the upper right panel and lower right panel respectively. For completeness, we indicate in the plots our linear fits which resulted to be $L_{\rm Ly\alpha;Neb}^{\rm peak}=0.02121\times10^{31} (L_{\rm Ly\alpha;QSO}^{\rm peak}/10^{31}[{\rm erg~s^{-1}~Hz^{-1}}])$~erg~s$^{-1}$~Hz$^{-1}$, and SB$_{\rm Ly\alpha}^{\rm Nebula}=0.00891\times10^{-17} (L_{\rm Ly\alpha;QSO}^{\rm peak}/10^{31}[{\rm erg~s^{-1}~Hz^{-1}}])$erg s$^{-1}$ cm$^{-2}$ arcsec$^{-2}$. On the same plots, we also indicate the 1 rms distance from the fits with the dashed lines. The absence of clear correlations could indicate that the resonant scattering of Ly$\alpha$\ photons is not a dominant mechanism in shaping the emission from the discovered nebulosities on the full scales encompassed by the 2$\sigma$ isophote used to calculate the SB$_{\rm Ly\alpha}$ for each nebula. This can be due by the fact that (i) additional powering mechanisms (i.e. recombination) and/or (ii) the variability of the quasar luminosity (e.g., \citealt{Peterson2004}) could have washed out a clearer dependance. The two right panels of Figure~\ref{fig:VariousPlots} and the quality of the PSF subtraction on small scales ($\sim10$~kpc) prevent us to probe the presence of a tighter relation at smaller scales. However, a signature of the relation between the Ly$\alpha$\ emitted by the quasar and each Ly$\alpha$\ nebula could be represented by the small velocity difference between the quasar Ly$\alpha$\ and the nebulae themselves shown in section~\ref{sec:morph}. Indeed this small difference in velocity could reflect that the Ly$\alpha$\ emission from the quasar and the peak of the nebula (always at small projected separation from the quasar) follow the same path of least resistance to escape the system in the scattering process. It is important to stress that -- if resonant scattering is the only mechanism in play -- only a very small fraction of the Ly$\alpha$\ emission produced by the central quasar is needed to match the total Ly$\alpha$\ emission observed in the detected extended nebulae, i.e., the Ly$\alpha$\ luminosity of a nebula is $\approx3\%$ of the peak of the Ly$\alpha$\ emission of the quasar (average of our whole sample). Finally, as done in Figure~\ref{fig:LLyaMi}, in Figure~\ref{fig:VariousPlots} we associate a green circle to each data-point to indicate the extent and spatial asymmetry of each nebulosity. By looking at these datapoints, we do not find any correlation between the quasar ionizing luminosity and Ly$\alpha$\ emission and the size/spatial asymmetry of the nebulae. Summarizing, the current data at the Ly$\alpha$\ line location suggest a scenario in which the Ly$\alpha$\ emission is powered by a combination of photoionization of relatively optically thin gas, and resonant scattering. In addition, we cannot rule out a contribution from small-scales winds or jets in ionizing the surrounding gas distribution. We will investigate the powering mechanisms in a future work focused on additional diagnostics covered by our observations. \begin{figure*} \centering \includegraphics[width=0.75\textwidth, clip]{Fig15.pdf} \caption{Lower left: plot of the average Ly$\alpha$\ surface brightness (SB$_{\rm Ly\alpha}$) of all the discovered nebulosities versus the absolute $i$-mag normalized at $z=2$ for the targeted quasars. Lower right: plot of the SB$_{\rm Ly\alpha}$ versus the peak Ly$\alpha$\ luminosity for the targeted quasars (as derived from our MUSE data). Upper left: plot of the peak Ly$\alpha$\ luminosity for the discovered nebulosities versus $M_i(z=2)$ for the targeted quasars. Upper right: plot of the peak Ly$\alpha$\ luminosity for the discovered nebulosities versus the peak Ly$\alpha$\ luminosity for the targeted quasars (as derived from our MUSE data). As done in Figure~\ref{fig:sigmavsMi}, we indicate in blue the radio-quiet systems, while in red the radio-loud objects (larger sizes = larger $F_{\rm Radio}$). The crosses indicate the objects for which we do not have information on their radio flux. The green circles are drawn for all the objects and their sizes indicates a product of the area of the nebulosities and of the distance between the center of the nebulosities and the targeted quasars (see Figure~\ref{fig:asymmetry}). In the right panels, the solid and dashed black lines show a linear fit to the data and the 1 rms distance from the fit, respectively (see Section~\ref{sec:powering} for details).} \label{fig:VariousPlots} \end{figure*} \subsection{Insights on the observability of fast AGN winds on large scales} \label{sec:timescale} Our study, together with \citet{Borisova2016}, has shown that we can routinely detect Ly$\alpha$\ nebulosities for tens of kpc with fast MUSE observations, and we have argued in Section~\ref{sec:powering} that these nebulosities are likely powered by a combination of mechanisms dominated by the radiation of the central quasar. As already noticed in Section~\ref{sec:kinematics}, the same samples result in only 1 broad Ly$\alpha$\ nebulosity around a radio-quiet quasar out of 56 ($17+39$), and only 2 out of 17 ($15+2$) for radio-loud objects. If the broad Ly$\alpha$\ emission is a signature of AGN winds on large scales (tens of kpc), these observations suggest a low probability of detecting them out to 50 kpc, i.e. $2\%$ and $12\%$, respectively for the radio-quiet and radio-loud samples. Such low probabilities could reflect i) a bad coupling between a relatively hot wind and the cool gas phase and/or ii) that winds do not emit Ly$\alpha$\ emission or emit Ly$\alpha$\ at much fainter levels than here probed, and/or iii) the difficulties to propagate coherent winds on large scales (tens of kpc) for long period of times\footnote{A wind with a velocity of $0.01c$ would require $\sim10^{7}$~yr to reach 50 kpc.} by the observed stochastic and episodic AGN winds generated on much smaller scales (e.g., \citealt{KingPounds2015}). The first two options seem quite unlikely given that fast winds (with shifts and line widths $>1000$~km~s$^{-1}$) on scales of tens of kpc have been reported also in cold tracers around quasars (e.g., [\ion{C}{ii}]~158~$\mu$m; \citealt{Cicone2015}), and the shock front should behave like a quite hard ionizing source, thus powering strong Ly$\alpha$\ emission (e.g., \citealt{Allen2008}). Our snapshot observations could however be missing a broad and diffuse Ly$\alpha$\ component. Regarding the propagation of winds on large scales, in addition to the uncertainties in the triggering of a sustained wind, we would expect a lag between the light propagation from the quasar and the wind propagation due to the different times at which they probably switch on, and at the different speeds (light vs shock). This lag could be the cause of the observed low probabilities. Indeed, young quasars or quasars with an inefficient propagation of the wind would be characterized by a quiescent Ly$\alpha$\ nebula (due to the quasar illumination) more extended than a turbulent region affected by the wind (if any). This scenario has been illustrated around HzRGs, where large velocity dispersion in Ly$\alpha$\ are found within the smaller scales perturbed by the jet (FWHM$>1000$~km~s$^{-1}$), but smaller velocities dispersions on larger scales beyond the radio structures or in closer regions not affected by the jet (FWHM$\sim300-700$~km~s$^{-1}$; e.g., \citealt{VillarMartin2003, Vernet2017}). If this is indeed the case, we would expect already in our data to see intermediate nebulae with large velocity dispersions on few kiloparsecs, and smaller (quiescent) velocity dispersions on larger scales. Given the current spatial resolution of our data, and the PSF subtraction algorithm used, we cannot firmly assess this scenario below approx. $1-2$~arcsec from the quasar with the current data. We note however that several authors argued for ubiquitous extreme kinematics ($>1000$~km~s$^{-1}$) around quasars on tens of kpc scales (usually $<30$~kpc) from low to very high redshift ($z\sim6$), and basically along the whole electromagnetic spectrum and thus gas phases (e.g., \citealt{Greene2011,Liu2014,Greene2014,Brusa2015,Perna2015,Cicone2015,Rupke2017}). Such scales would corresponds to about 4 arcsec at $z\sim3$. Nevertheless, both our flux-weigthed dispersion maps (Figure~\ref{fig:Sigmamaps}) and the maps presented in \citet{Borisova2016} (their Figure~7), do not show at face value higher widths close to the central quasars. This result would even be exacerbated if the Ly$\alpha$\ line that we observe is broaden by scattering, as is expected. The observed Ly$\alpha$\ line width could then be even smaller if measured through non-resonant tracers. As noted in Section~\ref{sec:kinematics}, the motions within the Ly$\alpha$\ nebulae thus seems to be consistent with gravitational motions. This evidence thus encourage a new effort in characterizing the small-scale gas phase around quasars, while linking it to the larger scales (100~kpc) targeted in this study. The new AO system GALACSI (\citealt{Stuik2006}) on MUSE will be fundamental to addressing the aforementioned points, while taking into account known issues dealing with small-scale emission around bright quasars (e.g., PSF deblending; \citealt{Husemann2016, HusemannHarrison2018}). Indeed, \citet{Husemann2016} showed that previously reported spatially resolved [\ion{O}{iii}] emission-line widths on kpc scales around a sample of $z\sim0.5$ quasars (\citealt{Liu2014}) are significantly narrower than the one before PSF deblending. \section{Summary and conclusions} \label{sec:summ} To characterize the CGM of massive halos and to uncover additional ELAN, we exploit the unprecedented capabilities of the MUSE instrument on the ESO/VLT to build the ``fast'' survey (45 minutes/source) QSO MUSEUM targeting 61 quasars at a median redshift of $z=3.17$ ($3.03<z<3.46$). With quasars characterized by different radio-loudness (39 radio-quiet; 15 radio-loud; 6 with currently no radio information) and spanning roughly three magnitudes $-29.67\leq M_i(z=2)\leq-27.03$, this survey expands previous works targeting quasars at these cosmic epochs (e.g., \citealt{Borisova2016}). In this work we present the results of our survey for the Ly$\alpha$\ emission only. We plan to present the results for additional diagnostics in future works. By analyzing the datacubes at the location of the Ly$\alpha$\ transition, we thus find that \begin{enumerate} \item After PSF and continuum subtraction, each of the targeted quasars show a Ly$\alpha$\ nebulosity whose bulk emission is on radii $R<50$~kpc above our detection limits (SB$_{\rm Ly\alpha}=8.8\times10^{-19}$~erg s$^{-1}$ cm$^{-2}$ arcsec$^{-2}$; $2\sigma$ in 1 arcsec$^2$ in a single channel of $1.25\AA$), with an average surface brightness of the order of SB$_{\rm Ly\alpha}\sim0.4\times10^{-17}$~erg s$^{-1}$ cm$^{-2}$ arcsec$^{-2}$. The average maximum projected distance covered by the Ly$\alpha$\ emission from each quasar is 80~kpc. This extended Ly$\alpha$\ emission is characterized by diverse morphologies. In particular, most of the discovered nebulae appear to be symmetric (median asymmetry $\alpha=0.71$), while few exceptions show more elongated morphologies. \item Given the diverse morphologies, the discovered Ly$\alpha$\ nebulosities show very diverse radial profiles, which however result in a stacked profile best described by an exponential fit, SB$(r)=C_e{\rm exp^{-r/r_h}}$ with scale-length of $r_h=15.7\pm0.5$~kpc (whole sample). This radial profile is consistent till $R\simeq60$~kpc with the profile shown in \citet{Borisova2016}, at larger radii our profile better indicates an exponential behavior. The radio-loud sample has a slight excess in SB at $20$~kpc$<R<50$~kpc, resulting in a tentatively larger scale-length $r_h=16.2\pm0.3$~kpc, with respect to the radio-quiet sample $r_h=15.5\pm0.5$~kpc. \item Down to our detection limits, the gas emitting Ly$\alpha$\ emission covers a fraction $>30\%$ of the area around the quasars for radii $R<50$~kpc. At larger distances, the covering fraction rapidly decrease (Figure~\ref{fig:coveringFactor}). \item The peak of the Ly$\alpha$\ emission of the nebulosities appear to be closer in redshift to the peak of the Ly$\alpha$\ emission of the quasars $z_{\rm peak\, QSO\, Ly\alpha}$ than to the current systemic redshift of the quasars $z_{\rm systemic}$. We find a median shift of the Ly$\alpha$\ emission of $\Delta v=782$~km~s$^{-1}$, and $\Delta=144$~km~s$^{-1}$ from $z_{\rm peak\, QSO\, Ly\alpha}$ and $z_{\rm systemic}$, respectively. More precise systemic redshift are needed to verify this occurrence. \item We discovered 27 LAEs with $F>1.1\times10^{-17}$~erg~s$^{-1}$~cm$^{-2}$ (our $\geq 80\%$ completeness level). This low detection rate agrees with the currently known luminosity functions for field LAEs (\citealt{Cassata2011, Drake2017}), which would predict $24-30$ LAEs to be found. We find fields with more than one detection which appear to be clear outliers and probably reflecting the presence of underlying overdensities, and/or effects of powering mechanisms, e.g., chance alignment between the position of the LAE and the ionization cones of the quasars. In addition, only three fields show the presence of active companions. We note that the quasar with the larger number (2, of which 1 type-I) of active companions detected (ID 13; \citealt{fab+2018}) also presents the more extended and brightests of the discovered Ly$\alpha$\ nebulosities (see point (ix)). \item The velocity maps obtained from the first moment of the flux distribution of the discovered Ly$\alpha$\ nebulosities appear to be noisy and difficult to interpret as ordered motions of any kind (rotation, infall, or outflow; see also \citet{Borisova2016}), though each nebulosity show peculiar structures on velocities of the order of few hundreds km~s$^{-1}$ (Figure~\ref{fig:Velmaps}). Nebulae with larger extents than the average easily show coherent velocity structures (e.g., ID 13; \citealt{fab+2018}). The difference in complexity between the maps of very extended nebulosities and smaller systems could be due to the resonant nature of the Ly$\alpha$\ line which sample more turbulent regions on tens of kpc around the quasar. \item All the discovered Ly$\alpha$\ nebulosities, irrespective of the radio-loudness, are characterized by relatively quiescent kinematics ($\langle \sigma_{\rm Ly\alpha} \rangle<400$~km~s$^{-1}$ (or FWHM$<940$~km~s$^{-1}$). These estimates are similar to the velocity widths observed in absorption in the CGM surrounding $z\sim2$ quasars ($\Delta v>300$~km~s$^{-1}$; \citealt{qpq3,qpq9}). The motions within all these Ly$\alpha$\ nebulae have amplitudes consistent with gravitational motions expected in dark matter halos hosting quasars (M$_{\rm DM}\sim10^{12.5}$~M$_{\odot}$; \citealt{white12,Trainor2012}). This point is even strengthen by the fact that part of the velocity dispersion could be due to Ly$\alpha$\ resonant scattering and instrument resolution (FWHM$\approx2.83$\AA or $170$~km~s$^{-1}$ at 5000\AA). \item The relatively quiescent Ly$\alpha$\ nebulosities around all the 15 radio-loud quasars in our sample run counter to the two radio-loud system with $\sigma_{\rm Ly\alpha}>425$~km~s$^{-1}$ showed by \citet{Borisova2016}. This occurrence might be driven by the higher luminosity of the Borisova's quasars for equal radio emission (see Section~\ref{sec:kinematics}), and/or might reflect the probabilities of propagating a coherent AGN winds on halo scales (see Section~\ref{sec:timescale}). Note that this would be also valid in the case of radio-quiet systems (Section~\ref{sec:timescale}). \item Of all the discovered Ly$\alpha$\ nebulosities, only ID 13 (or PKS~1017+109) shows the extreme observed surface brightnesses and extent found in the case of $z\sim2$ ELAN (\citealt{cantalupo14,hennawi+15}). The ELAN around PKS~1017+109 has been studied in detail in \citet{fab+2018}. In this work we clearly show that ELAN are indeed easily detected as extended sources even with faster observations than here used (Figure~\ref{fig:AreaVSSN}). \item The current statistics of Ly$\alpha$\ nebulae around radio-quiet quasars at $z\sim2$ (\citealt{fab+16}) suggests a lower level of Ly$\alpha$\ emission with respect to the nebulae in the QSO MUSEUM sample and other surveys at $z\sim3$ (\citealt{Borisova2016}). Even though the current statistics at $z\sim2$ still rely on a relatively small sample of NB data and have thus to be confirmed with on-going campaigns using IFU instruments, we here show that such a difference would fit well with a decrease in cool halo mass in the CGM of similarly massive halos from $z\sim3$ to $z\sim2$ (\citealt{Dekel&Birnboim2006}). These changes in Ly$\alpha$\ profiles can thus reflect a different balance between cool and hot gas phase at different redshifts (see discussion in Section~\ref{sec:redshiftEvol}). Future statistical surveys at different redshift are key in testing this hypothesis. \item There are hints suggesting that the discovered Ly$\alpha$\ nebulosities are powered by recombination and scattering of Ly$\alpha$\ photons in optically thin gas (Section~\ref{sec:powering}). The presence of fast outflows ($v_s>1000$~km~s$^{-1}$) on $R\sim50$~kpc seems to be disfavored fo the majority of the sample. However we cannot exclude the presence of winds or jets on scales of few kpc. \end{enumerate} As shown by the aforementioned list of results, the large dataset of QSO MUSEUM allowed us to reveal the common features characterizing the extended Ly$\alpha$\ emission around quasars, but also to find extreme and rare outliers, i.e., the brightest and more extended nebulosities or ELAN. Given their high surface brightnesses, these objects are the ideal laboratory for the study of the astrophysics in play on halo-scales. Overall, QSO MUSEUM unveils the complexity inherent in the study of large-scale (hundreds of kpc) systems. Each of the discovered Ly$\alpha$\ nebulosities would indeed require a detailed individual study using multiwavelength and deeper observations to firmly characterize them (e.g., geometry, environment, powering mechanisms), and understand the particular moment at which these systems are observed (e.g., ongoing AGN outflow, merger(s), quasar lifetime). Notwithstanding this complexity, our survey open the path to a better comprehension on how massive systems form and evolve along the cosmic history, and would be the benchmark for future statistical and homogeneous investigations. \section*{Acknowledgements} We thank Max Gronke and Aura Obreja for fruitful discussions. Based on observations collected at the European Organisation for Astronomical Research in the Southern Hemisphere under ESO programmes 094.A-0585(A), 095.A-0615(A), 095.A-0615(B) and 096.A-0937(B). We acknowledge the role of the ESO staff in providing high-quality service-mode observations, which are making this project feasible in a shorter time-scale. JXP acknowledges support from the National Science Foundation (NSF) grant AST-1412981. SC gratefully acknowledges support from Swiss National Science Foundation grant PP00P2\_163824. EL is supported by a European Union COFUND/Durham Junior Research Fellowship (under EU grant agreement no. 609412). \bibliographystyle{mnras}
\section{Introduction} Fire emblem is a series of tactical role-playing video games. Combat is turn-based and alternates between the Player Phase, in which the player is given the chance to move all of his/her units, and the Enemy Phase, in which the enemy AI may do the same. Several common objectives include defeating all enemies, defeating the enemy boss, and seizing the enemy stronghold. Battle continues until the player achieves the map objective or is defeated. An infrequent but recurring element of Fire Emblem is the arena. Some battle maps feature an arena where the player may optionally send their units to fight. When a unit arrives at the arena, the player must place a wager, after which the player unit engages in single combat against an enemy. If the player wins the battle, he/she obtains money equal to the wager; else, if the player loses or withdraws from the battle, the wager is lost. The arena can be a valuable source of money and experience points. However, repeated failure may result in a net loss of money without experience point gain. Furthermore, defeated player units in Fire Emblem are treated as ``dead'' and cannot be used in future battles---the ``permadeath'' aspect of the series applies to arena battles in many Fire Emblem games. \afterpage{ \begin{center} \begin{figure} \includegraphics[scale=0.8]{FE8_Arena} \includegraphics[scale=0.8]{arena1} \caption{The image on the left\cite{fewiki} is from chapter 5 of Fire Emblem: The Sacred Stones. The building in the upper right is an arena. When a unit is sent to the arena, the player is given the option to place a wager and start an arena battle, as seen in the image on the right\cite{rpgclassics}.} \end{figure} \end{center} } Arena battles are simpler than Fire Emblem overall. Terrain and unit positioning are irrelevant, as are enemy reinforcements and weapon choice---the player and enemy meet face to face and trade blows until one is defeated. Despite this simplicity, it is nontrivial to calculate the player's probability of victory in the arena. Battles can, in principle, continue indefinitely, so the victory probability cannot be computed by simply enumerating all possible battles from start to finish. This paper demonstrates how to compute the exact victory probability as a straightforward, if somewhat tedious, application of dynamic programming. We begin with a simplified case in which each combatant attacks once per round and neither can perform critical hits. We then extend this result to account for critical hits, and finally deal with the cases where one combatant is fast enough to attack twice per round of combat. In all cases, the victory probability is derived in terms of a multivariate recurrence relation. \section{Background} While Fire Emblem gameplay is complicated in general, relatively little background is needed to understand arena battles. Player and enemy units, respectively, sport blue and red color schemes. The battle animation screen displays some key statistics about both combatants (see figure 2 \cite{lp}), with little variation from game to game. At the bottom of the screen are the combatants' hit points, indicating how much damage each unit can take before dying. The sides of the screen offer information about attacks initiated by each unit: \begin{itemize} \item \textbf{HIT}: The hit probability of each of the unit's attacks as a percent. (Note: displayed hit rates are inaccurate in most Fire Emblem games. See section 7.2 for more information.) \item \textbf{DMG}: The damage inflicted by each of the unit's attacks. \item \textbf{CRT}: The percent probability (conditional on hitting) that each of the unit's attacks will be a \emph{critical hit}. Critical hits inflict thrice the normal damage. \end{itemize} \begin{center} \begin{figure} \includegraphics[scale=0.8]{arena-joshua} \caption{An arena battle from Fire Emblem: The Sacred Stones, in which Joshua (player unit) battles an enemy wyvern rider.} \end{figure} \end{center} In Fire Emblem battles, a sufficiently fast unit may attack twice per round of combat while only being attacked once in turn. The speed threshold for performing a \emph{follow-up attack} varies; in recent games, a unit must have an effective speed stat at least 4 or 5 higher than the opponent's in order to perform a follow-up attack. Follow-up attacks are accounted for in battle preview screens but are unmentioned in arena battle screens in most games. We are now equipped to understand basic arena battles. Combat proceeds according to the following control flow: \\ \begin{algorithmic}[H] \WHILE{Player and Enemy are both alive} \STATE Player attacks Enemy \STATE Enemy attacks Player \IF{Player is sufficiently fast} \STATE Player attacks enemy again \ELSIF{Enemy is sufficiently fast} \STATE Enemy attacks Player again \ENDIF \ENDWHILE \end{algorithmic} \section{No Critical Hits or Follow-Up Attacks} In this simplified special case, each combatant attacks once per round of combat. The only randomness involved is in deciding whether each attack hits. Let $p_1$ and $p_2$, respectively, be the (true) hit probabilities of the player and enemy. Also let $H_1, H_2$ denote the hit points of the player and enemy, and let $d_1, d_2$ be the damage dealt by each player/enemy attack. Rather than keeping track of the combatants' hit points, it will be more convenient to take note of how many more attacks must hit to fell the player/enemy. For example, in figure 2, Joshua must hit the enemy wyvern rider $\lceil 34/4 \rceil = 9$ times to win. Let $m$ be the number of hits needed to fell the player, and define $n$ similarly for the enemy. Note in particular that \[m = \left\lceil \frac{H_1}{d_2} \right\rceil, ~~~~~ n = \left\lceil \frac{H_2}{d_1} \right\rceil.\] A modicum of caution is needed here: it is possible for $d_1$ and/or $d_2$ to be 0. If neither combatant can hurt the other (i.e. if $d_1 = d_2 = 0$), then the arena battle will never end. Otherwise, if only one unit is able to damage the other, then the battle will be a guaranteed win for that unit. No calculation is needed in these cases. Now let $A_{m,n}$ be the player's victory probability for a given choice of $m, n < \infty$. We will express $A_{m,n}$ in terms of other $A_{m', n'}$ satisfying: \begin{itemize} \item $m' \leq m$ \item $n' \leq n$ \item At least one of $m' < m$ and $n' < n$ \end{itemize} In other words, we will treat $\left\{A_{m,n}\right\}$ as a multivariate sequence and establish a recurrence relation in which $A_{m,n}$ depends only on ``prior'' terms. The recurrence can be derived with basic probability theory by considering all possible outcomes of the first round of combat. Letting $W$ represent the event that the player wins and using $X$ to denote a possible outcome of the first round, we have: \[A_{m,n} := \text{Pr}[W] = \sum_{X} \text{Pr}[X] \cdot \text{Pr}[W | X]. \tag{3.1}\] For example, one possible outcome $X$ of the first round is that the player and enemy attacks both hit. This happens with probability $\text{Pr}[X] = p_1p_2$. Each combatant will then be one hit closer to death, so the probability of the player winning after this first round is $\text{Pr}[W | X] = A_{m-1,n-1}$. There are four possible outcomes of the first round, since the player and enemy attack can both independently hit or miss. Using the formula above, we obtain: \[A_{m,n} = p_1p_2A_{m-1,n-1} + p_1(1-p_2)A_{m,n-1} + (1-p_1)p_2A_{m-1,n} + (1-p_1)(1-p_2)A_{m,n}.\] Observe that $A_{m,n}$ appears on both sides of the equality. Expanding $(1-p_1)(1-p_2)$ as $1 - p_1 - p_2 + p_1p_2$ and solving for $A_{m,n}$, we obtain our recurrence relation: \[A_{m,n} = \frac{p_1p_2A_{m-1,n-1} + p_1(1-p_2)A_{m,n-1} + (1-p_1)p_2A_{m-1,n}}{p_1 + p_2 - p_1p_2}.\] To complete the definition of the sequence $\left\{A_{m,n}\right\}$, we must also specify initial values. For example, we should have $A_{m,0} = 1$ whenever $m > 0$---the battle is a guaranteed victory if the player is still alive and the enemy is already dead. We similarly have $A_{0,n} = 0$ when $n > 0$. Since the recurrence for $A_{m,n}$ includes the term $A_{m-1,n-1}$, it is possible that the recurrence will call on the value $A_{0,0}$, which seems odd because $m = n = 0$ suggests that the player and enemy are both dead. This case can only occur when the player and enemy both deliver the lethal blow in the same round. But the player attacks first during each round, so the player will have dealt the lethal blow first. Therefore, we want $A_{0,0} = 1$. With our initial values accounted for, we can define $\left\{A_{m,n}\right\}$ compactly as follows: \[A_{m,n} = \begin{cases} {1} & {n \leq 0} \\ {0} & {m \leq 0, n > 0} \\ {\frac{p_1p_2A_{m-1,n-1} + p_1(1-p_2)A_{m,n-1} + (1-p_1)p_2A_{m-1,n}}{p_1 + p_2 - p_1p_2}} & {\text{else}} \end{cases}\] Note that by writing e.g. $n \leq 0$ instead of $n = 0$, we allow for the possibility of negative indices. Thus far, this is impossible---both $m$ and $n$ will be positive at the beginning of each round, and each can then decrease by at most 1 before the next round starts. However, negative indices will become a consideration in the more general cases with critical hits and follow-up attacks, as each unit may take multiple attacks' worth of damage in a single round of combat. \section{No Follow-Up Attacks} This section generalizes the previous one by allowing for the possibility of critical hits (while still prohibiting all follow-up attacks). Critical hits change little in principle, although they do make for a more complicated recurrence since there are more possible outcomes of each round of combat. Let $c_1$ and $c_2$, respectively, be the critical hit rates of the player and enemy. Recall that the crit rate is conditional on an attack hitting---therefore, the probability of the player delivering a critical hit is $p_1c_1$, not $c_1$. Besides the lengthier recurrence, the main difference in this case is that a critical hit deals the damage equivalent of three regular attacks. We must therefore be a little more careful in our definition of $m$ and $n$: for example, we now let $m$ be the number of \emph{regular} attacks needed to fell the player. The probability formula (3.1) for $A_{m,n}$ from the previous section works here, too. One possible round outcome $X$ is that the player lands a critical hit while the enemy misses. Here, we have: \[\text{Pr}[X] = p_1c_1(1-p_2).\] The probability of the player winning after that particular round outcome would be \[\text{Pr}[W | X] = A_{m,n-3},\] since the enemy takes the equivalent of three regular attacks while failing to deal any damage back to the player. This time, the recurrence relation will not fit on a single line. For convenience, we will split the terms from the right-hand side of (3.1) into groups, given below: \begin{itemize} \item The term corresponding to player and enemy both missing: \[(1-p_1)(1-p_2)A_{m,n}\] \item Terms corresponding to player hitting and enemy missing: \[p_1(1-p_2) \left[c_1A_{m,n-3} + (1-c_1)A_{m,n-1}\right]\] \item Player misses, enemy hits: \[(1-p_1)p_2 \left[c_2A_{m-3,n} + (1-c_2)A_{m-1,n}\right]\] \item Player and enemy both hit: \[p_1p_2 \left[c_1c_2A_{m-3,n-3} + c_1(1-c_2)A_{m-1,n-3} + (1-c_1)c_2A_{m-3,n-1} + (1-c_1)(1-c_2)A_{m-1,n-1}\right]\] \end{itemize} As in the previous case, we can now sum these terms, set the result equal to $A_{m,n}$, and group the $A_{m,n}$ terms together. We obtain: \begin{eqnarray*} (p_1 + p_2 - p_1p_2)A_{m,n} & = & p_1(1-p_2) \left[c_1A_{m,n-3} + (1-c_1)A_{m,n-1}\right] \\ & + & (1-p_1)p_2 \left[c_2A_{m-3,n} + (1-c_2)A_{m-1,n}\right] \\ & + & p_1p_2 \left[c_1c_2A_{m-3,n-3} + c_1(1-c_2)A_{m-1,n-3} \right. \\ & & \left. ~~~~~~ + (1-c_1)c_2A_{m-3,n-1} + (1-c_1)(1-c_2)A_{m-1,n-1}\right] \end{eqnarray*} We can finish solving for $A_{m,n}$ by simply dividing through by $(p_1 + p_2 - p_1p_2)$, although this makes it more difficult to write the recurrence in a visually appealing manner. The initial values for $A_{m,n}$ are precisely the same as in the previous case: we want $A_{m,n} = 1$ whenever $n \leq 0$, and $A_{m,n} = 0$ when $m \leq 0$ and $n > 0$. The value $A_{0,0} = 1$ is again correct because it still only arises in cases where the player lands the lethal blow first. \section{Enemy Follow-Up Attacks} The last generalization we'll make in this paper is to account for the cases where one combatant is fast enough to attack twice per round. We first consider follow-up attacks from the enemy because it is actually a little more difficult mathematically to deal with follow-up attacks from the player. When the enemy can perform follow-up attacks, arena battles proceed as follows: in round 1, the player attacks once, and then the enemy attacks twice consecutively. Then begins round 2, in which the player attacks once and the enemy attacks twice consecutively again. As always, battle continues until one unit is defeated. Let $A_{m,n}^e$ denote the player's victory probability when the enemy can perform follow-up attacks. Similar to the introduction of critical hits, enemy follow-up attacks further complicate the recurrence for $\left\{A_{m,n}^e\right\}$ while changing little about our solution method. Formula (3.1) can again be applied as is. When written out in full, the formula will have the lone term $A_{m,n}^e$ on the left-hand side. Corresponding to the event that all attacks in a given round miss, the right-hand side of (3.1) will contain the term \[(1-p_1)(1-p_2)^2A_{m,n}^e.\] We can again group the $A_{m,n}^e$ terms together by expanding $(1-p_1)(1-p_2)^2A_{m,n}^e$ and moving it to the left-hand side of (3.1). The combined $A_{m,n}^e$ term is \[(p_1 + 2p_2 - 2p_1p_2 - p_2^2 + p_1p_2^2)A_{m,n}^e. \tag{5.1}\] We can solve for $A_{m,n}^e$ by setting (5.1) equal to the sum of all remaining terms on the right-hand side of (3.1). We again group some of these terms together for convenience: \begin{itemize} \item The player hits, and the enemy misses both attacks: \[p_1(1-p_2)^2 \left[c_1A_{m,n-3}^e + (1-c_1)A_{m,n-1}^e\right] \tag{5.2}\] \item The player misses, while the enemy hits exactly once: \[2(1-p_1)p_2(1-p_2) \left[c_2A_{m-3,n}^e + (1-c_2)A_{m-1,n}^e\right] \tag{5.3}\] \item The player hits, while the enemy hits exactly once: \[2p_1p_2(1-p_2) \left[c_1c_2A_{m-3,n-3}^e + c_1(1-c_2)A_{m-1,n-3}^e\right.\] \[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + \left.(1-c_1)c_2A_{m-3,n-1}^e + (1-c_1)(1-c_2)A_{m-1,n-1}^e\right] \tag{5.4}\] \item The player misses, while the enemy hits both attacks: \[(1-p_1)p_2^2 \left[c_2^2A_{m-6,n}^e + 2c_2(1-c_2)A_{m-4,n}^e + (1-c_2)^2A_{m-2,n}^e\right] \tag{5.5}\] \item The player hits, and the enemy hits both attacks: \[p_1p_2^2 \left[c_1c_2^2A_{m-6,n-3}^e + (1-c_1)c_2^2A_{m-6,n-1}^e\right.\] \[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + \left. 2c_1c_2(1-c_2)A_{m-4,n-3}^e + 2(1-c_1)c_2(1-c_2)A_{m-4,n-1}^e\right.\] \[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + \left. c_1(1-c_2)^2A_{m-2,n-3}^e + (1-c_1)(1-c_2)^2A_{m-2,n-1}^e\right] \tag{5.6}\] \end{itemize} The complete recurrence for $A_{m,n}^e$ can be obtained by setting expression (5.1) equal to the sum of expressions (5.2) through (5.6) and then dividing by the coefficient on $A_{m,n}^e$. The initial values for $A_{m,n}^e$ are again exactly the same as in the previous two cases. \section{Player Follow-Up Attacks} Let $A_{m,n}^p$ denote the player's victory probability when the player can perform follow-up attacks. While seemingly similar to the previous case, correctly dealing with player follow-up attacks will require some new tech. This is because the initial value $A_{0,0}^p = 1$ is no longer universally correct. In the previous cases, all player attacks happened before all enemy attacks in any given round. Thus, if the player and enemy both delivered the lethal blow in the same round, then the player won because he/she dealt the decisive blow first. But the course of battle is different when the player can perform follow-up attacks: in each round, the player attacks once, then the enemy attacks once, and finally the player attacks again. The enemy's one attack occurs between the player's two attacks. If the player and enemy both deal the lethal blow in the same round, then either combatant could be the winner of the battle. One way to address this problem is to introduce a multiplier function: \[B(m,n) = \begin{cases} {0} & {m \leq 0, n > 0} \\ {1} & {\text{else}} \end{cases}\] For given $m$ and $n$, this function is just 1 unless the enemy has already won the battle, in which case it takes on a value of 0 instead. The terms of formula (3.1) can be multiplied by appropriate $B(x,y)$ to prevent the player from attacking after being defeated. Thus, we can continue to use the initial value $A_{0,0}^p = 1$. By way of example, consider the event $X$ in which the player and enemy hit all of their attacks but none are critical hits. Using the previous cases as examples, the term of (3.1) corresponding to this event would be \[\text{Pr}[X] \cdot \text{Pr}[W | X] = (p_1^2p_2(1 - c_1)^2(1 - c_2)) \cdot A_{m-1,n-2}^p.\] But when $m = 1$ and $n = 2$, this yields $\text{Pr}[W | X] = A_{0,0}^p = 1$, which is incorrect because the enemy will have dealt the lethal blow before the player. On the other hand, multiplying by $B(m,n)$---using the values of $m$ and $n$ directly after the enemy's attack---gives us \[\text{Pr}[W | X] = B(m-1,n-1) \cdot A_{m-1,n-2}^p,\] which correctly evaluates to 0 when $m = 1$ and $n = 2$. In cases where the player dies before the follow-up attack, the $B(x,y)$ function ``zeroes out'' his/her win probability. In all other cases, $B(x,y)$ takes on a value of 1 and has no multiplicative effect. A full recurrence for $A_{m,n}^p$ can be derived in the same way as the previous cases provided that we multiply terms by the appropriate $B(x,y)$ values. There is, however, a more elegant way of solving the player follow-up case by way of reduction to the enemy follow-up case. The trick is to shift the somewhat artificial separation between rounds of combat. The reduction can be made clear by comparing side-by-side the attack flows of the two follow-up cases: \begin{center} \begin{tabular}{c|cc} Round \# & Enemy follow-up & Player follow-up \\ \hline & Player & Player \\ 1 & Enemy & Enemy \\ & Enemy & Player \\ \hline & Player & Player \\ 2 & Enemy & Enemy \\ & Enemy & Player \\ \hline & Player & Player \\ 3 & Enemy & Enemy \\ & Enemy & Player \\ \hline & Player & Player \\ 4 & Enemy & Enemy \\ & $\vdots$ & $\vdots$ \end{tabular} \end{center} In the player follow-up case, remove the first player attack and ignore the separations between rounds. The resulting attack flow is then Enemy, Player, Player, Enemy, Player, Player, etc. This is exactly the attack flow from the enemy follow-up case, but with ``Player'' and ``Enemy'' swapped. We can therefore use the enemy follow-up case to compute the \emph{enemy's} probability of victory after the player's first attack. Knowing the enemy's victory probability immediately tells us the player's victory probability too. Indeed, we can even use formula (3.1) again. This time, though, we need to sum over the possible outcomes $X$ of the player's first attack, instead of the possible outcomes of the first round of combat. There are three possible outcomes for the player's first attack: a miss (probability $(1 - p_1)$), a regular hit (probability $p_1(1 - c_1)$), and a critical hit (probability $p_1c_1$). After---for example---a player miss on the first attack, the enemy's probability of winning is $A_{n,m}^e$, hence the player's probability of winning is $(1 - A_{n,m}^e)$. (Note that $m$ and $n$ have been swapped; so, too, must the values $p_1, p_2$ and $c_1, c_2$.) Accounting for all three possible outcomes of the initial player attack, formula (3.1) leads us to: \[A_{m,n}^p = (1 - p_1)\left(1 - A_{n,m}^e\right) + p_1(1 - c_1)\left(1 - A_{n-1,m}^e\right) + p_1c_1\left(1 - A_{n-3,m}^e\right).\] This serves as our recurrence relation for the player follow-up case in terms of the enemy follow-up case. Notably, the recurrence above can be used to compute $A_{m,n}^p$ for any choice of $m$ and $n$, so initial values are unnecessary. \section{Algorithm and Implementation} Given initial values and a recurrence relation, terms of a sequence can be computed efficiently using dynamic programming. The algorithm is straightforward---our recurrence relations express sequence terms as expressions in lower-indexed sequence terms, so we must fill in the DP table in increasing index order. Pseudocode for computing $A_{m,n}$ is given below: \begin{center} \begin{algorithmic}[H] \STATE Construct an $(m+1) \times (n+1)$ DP table, $A$ \STATE Use initial values of $A_{m,n}$ to fill in some entries \FOR{$i = 1$ \TO $i = m$} \FOR{$j = 1$ \TO $j = n$} \STATE Fill in entry $A[i][j]$ using the recurrence relation \ENDFOR \ENDFOR \RETURN $A[m][n]$ \end{algorithmic} \end{center} Values of $A_{m,n}^e$ can be computed in exactly the same way. So, too, can values of $A_{m,n}^p$, using the full self-contained recurrence involving the function $B(x,y)$ (omitted from this paper for brevity). Alternatively, $A_{m,n}^p$ can be computed using the recurrence in terms of $A_{m,n}^e$. The DP table in our algorithm has $(m+1)(n+1) = O(mn)$ entries. Each of our recurrence relations has constant length, so every entry---initial value or not---takes $O(1)$ time to fill in. Thus, the algorithmic runtime is $O(mn) = O(H_1H_2 / d_1d_2)$. A GUI implementing this algorithm is provided at the following link: \begin{verbatim} https://github.com/aibrockmann/Fire-Emblem-Arena-Probabilities \end{verbatim} Several files are available. The first is the source code, a Python script, which can be executed as is if Python 2.7+ is installed. The other files are Windows and Linux executables, created from the source code using PyInstaller. There are some considerations that arise when implementing this algorithm. Most are ordinary programming considerations. One, however, results from the inaccuracy of displayed hit rates in most Fire Emblem games. \subsection{Programming Issues} One programming issue has already been mentioned: if at least one combatant is unable to damage the other, then we will encounter division by 0 when computing $m$ and $n$. This is easily avoided---calculating $m$ and $n$ is unnecessary in these cases. If neither player nor enemy can deal damage, then the battle will be endless. If only one can deal damage, then he/she will win with probability 1. Another possible point of trouble is that our recurrences may call on terms with negative indices, whereas the indices on our DP table are non-negative. There are several simple ways to get around this issue. One is to change the recurrences themselves so that each index $i$ is replaced with $\max\{i, 0\}$. Another way is to bump negative indices up to 0 before calling on DP table entries. (This is effectively what the provided implementation does.) Lastly, trouble can arise from inaccuracy in floating point arithmetic. Terms in our recurrences are often products over many non-integer values, so floating point inaccuracies may add up to be appreciable. The provided implementation avoids this problem by storing intermediate values as fractions; only at the end is the exact answer used to produce a decimal approximation, and the exact answer is also provided in fraction form. \subsection{Fire Emblem True Hit} As previously mentioned, the displayed hit rates in most Fire Emblem games are incorrect. Our algorithm is still correct---however, one must make sure to convert from displayed hit rates to true hit rates so that the algorithm uses the correct values of $p_1$ and $p_2$. Displayed hit rates are accurate in the first five Fire Emblem games. For each accuracy check, these games choose a value from $[0, 1, \dots, 99]$ uniformly at random; if the chosen value is less than the displayed hit rate, then the attack hits, else it misses. For a given hit rate $x$, there are precisely $x$ possible values less than $x$, so that the probability of a hit is $x/100$. Most remaining games, starting with \emph{Binding Blade} and ending with \emph{Awakening}, generate two random numbers (i.e. ``2RN'') per accuracy check. If the \emph{average} of these two numbers is less than the displayed hit, then the attack will hit. The overall effect is that displayed hit rates 50 and higher are understated while those below 50 are overstated. For example, given a displayed hit rate of 99, the only random number combination (out of 10000) whose average is not below 99 is $(99, 99)$. Thus, a displayed hit rate of $99\%$ corresponds to a true hit rate of $99.99\%$. Under the 2RN system, only displayed hit rates of 0 and 100 are accurate. Research suggests \cite{fe14} that the true hit rates in \emph{Fire Emblem Fates} are different yet. Displayed hit rates below $50\%$ seem to be accurate. For hit rates 50 and above, the game still generates two random numbers, which are averaged and compared to the displayed hit; however, the average in this case seems to be unevenly weighted. In particular, given random numbers $a$ and $b$, \emph{Fates} compares the weighted average $(3a + b)/4$ to the displayed hit rate. This means that displayed hit rates 50 and above are still understated, but the difference is not as large as it is with the old 2RN true hit mechanics. \section{Extensions} Our algorithm and implementation correctly provide the player's victory probability in basic arena battles. However, some games feature relevant gameplay elements that we have not taken into account. For example, we have not taken any offensive skills into account. One such offensive skill is Luna: each attack performed by a unit with Luna has a chance to cut the target's effective defense or resistance in half. The activation rate as a percent is equal to the user's skill stat. Allowing for most offensive skills is simple in principle---we just need to account for more possible round outcomes in formula (3.1). (We would probably also need to index $A_{m,n}$ with the combatants' hit points rather than the number of ``regular'' hits needed to defeat them.) However, the number of terms in our recurrences will grow roughly exponentially in the number of sources of randomness, so the math will become messy very quickly. Correctly accounting for some skills also requires more information than is displayed on screen. For example, the effect of Luna depends on the target's defense or resistance, and this information is not displayed on the arena battle screen in recent Fire Emblem games. The Fire Emblem series also features special weapons with effects that are not obvious at a glance. ``Brave'' weapons in most games strike twice with each attack, and each strike can independently hit, miss, land a critical hit, or trigger an offensive skill. The Devil Axe bears a chance of dealing damage to the attacker instead of the target. Most special weapons are theoretically simple to account for but significantly complicate the recurrences. Fortunately, this is a minor point---special weapons rarely, if ever, appear in arena battles. Another relevant gameplay element is, thus far, limited to \emph{Fates}: arena battles may include backup units that attack once per round of combat. As with most offensive skills and special weapons, these dual strikes are straightforward to account for by broadening the set of possible round outcomes. However, several offensive skills (Sol and Aether) and one special weapon (Nosferatu) can heal the user, and this does change the math in a significant way. Our recurrences express sequence values in terms of lower-indexed sequence values; our dynamic program takes advantage of this monotonicity to compute values in an appropriate order. The possibility of mid-battle healing breaks this monotonicity. It may still be possible to compute $A_{m,n}$ efficiently using modified recurrences, albeit with a very different implementation: the appropriate recurrence could be used to generate $(H_1 + 1)(H_2 + 1)$ linearly independent equations in the $A_{i,j}$, and the resulting system could be solved using Gaussian elimination. Under this modified implementation, $H_1$ and $H_2$ should be the combatants' \emph{maximum} (rather than current) hit points, while the indices $m$ and $n$ should denote the combatants' current hit points. Regardless of any healing, a unit's current hit points cannot rise above maximum; thus, the system generated in this way would have $O(H_1H_2)$ equations. It might be possible to find a closed form for $A_{m,n}$ in general. However, work toward a closed form using generating functions has not proved fruitful, even in simplified special cases of the arena problem.
\section{Introduction} Despite its simple definition, numerical semigroups provide a fertile ground for research \cite{GR}. Following \cite{HK}, we investigate algebraic properties of an exponential counterpart of numerical semigroups from a relative point of view. Throughout this paper, $\kappa$ is a field. A numerical semigroup ring is a complete local domain of the form $\kappa[\![\mathbf{u}^{s_1},\ldots,\mathbf{u}^{s_n}]\!]$, where $s_1, \ldots,s_n$ are positive \em{rational} numbers. Note that, in the literature, $s_1, \ldots,s_n$ are often assumed to be relatively prime positive integers. The objects we study are local homomorphisms $R\to R'$ of numerical semigroup rings. Through the homomorphism, we have an algebra $R'$ over the coefficient ring $R$, which we denote by $R'/R$. Within Cohen-Macaulay homomorphisms, we are mainly interested in the property of complete intersection. We remark that the classical study of numerical semigroup rings is a special case of our relative situation. Indeed, a numerical semigroup ring can be considered as a numerical semigroup algebra over a Noether normalization. Following the terminology of \cite{EGA-24,EGA}, a numerical semigroup algebra $R'/R$ is called \em{Cohen-Macaulay} (resp. \em{complete intersection}) if the homomorphism $R\to R'$ is flat and its fibers are Cohen-Macaulay (resp. complete intersection) rings. There are only two fibers of the homomorphism. Both are zero dimensional and hence Cohen-Macaulay. Therefore the Cohen-Macaulay property for a numerical semigroup algebra is simply equivalent to flatness. The notion of complete intersection has been extended to arbitrary homomorphisms of Noetherian rings \cite{A}. In this paper, flatness is included as a part of the definition of complete intersection so that the hierarchy of complete intersection inside Cohen-Macaulay automatically holds. In the context of numerical semigroup algebras, our definition of complete intersection takes the form directly from the historical origin. Recall that, in algebraic geometry, a $d$-dimensional variety in the $n$-dimensional ambient space is complete intersection if it can be cut out by $n-d$ hypersurfaces. For a flat numerical semigroup algebra $R'/R$, we consider a local surjective $R$-algebra homomorphism \[ \hat{\pi}\colon R[\![Y_1,\ldots,Y_n]\!]\to R'. \] The power series ring $R[\![Y_1,\ldots,Y_n]\!]$ has dimension $n+1$. The kernel of $\hat{\pi}$ needs at least $n$ generators. If the kernel can be generated by $n$ elements, the flat algebra $R'/R$ is called \em{complete intersection}. In the language of \cite{A}, \[ R\to R[\![Y_1,\ldots,Y_n]\!]\to R' \] is a Cohen factorization of $R\to R'$. If the kernel of $\hat{\pi}$ is generated by a regular sequence, the homomorphism $R\to R'$ is called complete intersection at the maximal ideal of $R'$. If $R\to R'$ is complete intersection at the maximal ideal, it is also complete intersection at the zero ideal \cite{T}. In \cite{A}, a homomorphism is called complete intersection if it is complete intersection at all prime ideals. Note that the kernel of $\hat{\pi}$ is generated by a regular sequence if and only if it is generated by $n$ elements. Hence our definition of complete intersection for flat numerical semigroup algebras agrees with that of \cite{A}, and also with that of \cite{EGA}. There are $n$ candidates of the form $Y_i^{\beta_i}-\mathbf{u}^{\beta_{i0}}Y_1^{\beta_{i1}}\cdots Y_n^{\beta_{in}}$ for the set of generators of the kernel of $\hat{\pi}$, where $\mathbf{u}^{\beta_{i0}}\in R$ and $\beta_{ii}=0$. For prescribed numerical invariants $\beta_i$, the image of the set $\{Y_1^{s_1}\cdots Y_n^{s_n}\,|\, 0\leq s_i<\beta_i\}$ in $R'$ can be used to study the complete intersection property of $R'/R$. Each monomial in the set describes a factorization of its image. If an element of $R'$ has factorizations from two distinct monomials in the set, the difference of the monomials creates an extra generator for the kernel of $\hat{\pi}$. This is the idea of $\alpha$-rectangular, $\beta$-rectangular and $\gamma$-rectangular sets of Ap\'{e}ry numbers in the classical case \cite{DMS-2013, DMS}. In the relative situation, Ap\'{e}ry numbers are generalized to Ap\'{e}ry monomials; the role of these numerical invariants is replaced by the notion of rectangles to emphasize the ``shape'' rather than the ``size'' of the set of Ap\'{e}ry monomials. Investigating factorizations of a numerical semigroup algebra, we obtain a main result asserting that a flat numerical semigroup algebra is complete intersection if it has a nonsingular rectangle. See Theorem~\ref{thm:main}. This paper is organized as follows. Section~\ref{sec:apr} starts with our broader definition of numerical semigroups. Notions related to Ap\'{e}ry monomials are defined. Section~\ref{sec:flat} reviews flatness of numerical semigroup algebras. A new criterion for flatness is given in terms of the number of Ap\'{e}ry monomials. In Section~\ref{sec:rectangle}, we define rectangles with examples to clarify the notion. Sufficient conditions are given for a flat numerical semigroup algebra to be complete intersection. Section~\ref{sec:234} consists of a detailed study of rectangular numerical semigroup algebras generated by few monomials. For flat algebras generated by three monomials, we show that rectangles must be non-singular with a special type resembling free numerical semigroups. For flat algebras generated by four monomials, we find a subclass of rectangular algebras, which consists only of complete intersection algebras. \section{Ap\'{e}ry Monomials}\label{sec:apr} In the literature, a numerical semigroup is a submonoid of the set ${\mathbb{N}}$ of non-negative integers, whose greatest common divisor is $1$. The condition on the greatest common divisor is equivalent to the statement that the complement of the semigroup in ${\mathbb{N}}$ consists of finitely many elements. In this classical definition, the multiplicity of the numerical semigroup is recognized as the smallest non-zero number in the semigroup. To study numerical semigroups, other submonoids of ${\mathbb{N}}$ appear without the condition on greatest common divisors. It is also observed that a numerical semigroup divided by its multiplicity naturally occurs in the study of the tangent cones of the numerical semigroups \cite{H2015, H2016}. We will see that numerical semigroups in the following broader sense give rise to many flat numerical semigroup algebras. \begin{defn}[numerical semigroup] A numerical semigroup is a monoid generated by finitely many positive rational numbers. \end{defn} Let $S$ be a numerical semigroup. The numerical semigroup ring $R:=\uRing{S}$ in the variable $\mathbf{u}$ consists of power series $\sum_{s\in S}a_s\mathbf{u}^s$ with $a_s\in\kappa$. An element $\mathbf{u}^s\in R$ is called a \em{monomial} of $R$. Note that, in the notation $\uRing{S}$ for $R$, the numerical semigroup ring comes with a choice of variable $\mathbf{u}$. We denote $S=\log_\mathbf{u} R$. We shall allow ourself to multiply $S$ by a positive rational number $t$ and study the numerical semigroup ring $\vRing{tS}$. Easily tracked from the relation $\mathbf{u}=\mathbf{v}^t$, two rings $\uRing{S}$ and $\vRing{tS}$ are essentially the same. If a numerical semigroup $S$ is generated by $s_1,\ldots,s_n$, we also write the numerical semigroup ring $\uRing{S}$ in terms of the chosen variable $\mathbf{u}$ as $\kappa[\![\mathbf{u}^{s_1},\ldots,\mathbf{u}^{s_n}]\!]$. Let $S$ and $S'$ be numerical semigroups. For a positive rational number $t$ satisfying $tS\subset S'$, the numerical semigroup ring $R'=\vRing{S'}$ has an algebra structure over $R=\uRing{S}$ through the relation $\mathbf{u}=\mathbf{v}^t$. We denote the algebra by $R'/R$ and call it a \em{numerical semigroup algebra} with $R$ as its \em{coefficient ring}. Note that there are different ways to embed $R$ into $R'$. By scaling the semigroups, we may work in the situation where $R$ and $R'$ share the same variable $\mathbf{u}$. For such a situation, we say $R'/R$ is a numerical semigroup algebra in the variable $\mathbf{u}$. If $S'$ is generated by $S$ together with rational numbers $s_1,\ldots,s_n$, the numerical semigroup ring $R'$ is also denoted by $R[\![\mathbf{u}^{S'}]\!]$ or $R[\![\mathbf{u}^{s_1},\ldots,\mathbf{u}^{s_n}]\!]$ to indicate its $R$-algebra structure. In this paper, the notation $R[\![\mathbf{u}^{s_1},\ldots,\mathbf{u}^{s_n}]\!]$ will always mean a numerical semigroup algebra with the numerical semigroup ring $R$ as its coefficient ring. The classical study of numerical semigroup rings fits in our relative situation by choosing Noether normalizations. More precisely, for a numerical semigroup ring $\uRing{S}$, we take an element $s\in S$ and obtain a Noether normalization $\kappa[\![\mathbf{u}^s]\!]$ of $\uRing{S}$. The numerical semigroup ring $\uRing{S}$ is Cohen-Macaulay, Gorenstein or complete intersection if and only if the algebra $\uAlg{S}{s}$ has the same property \cite{HK}. Ap\'{e}ry numbers are among the most important tools to study numerical semigroups. The notion can be extended to the relative situation. \begin{defn}[Ap\'{e}ry monomial] For a numerical semigroup algebra $R'/R$, a monomial $p$ of $R'$ is called an Ap\'{e}ry monomial if, whenever there are monomials $p_1$ of $R$ and $p_2$ of $R'$ such that $p_1p_2 =p$, then $p_1=1$. \end{defn} In other words, a monomial is Ap\'{e}ry if it is not divisible by any non-trivial coefficient. We denote the set of Ap\'{e}ry monomials of $R'/R$ by $\Apr(R'/R)$. \begin{example} $\Apr(\2uRing{3}{5}/\uRing{6})=\{\mathbf{u}^0,\mathbf{u}^3,\mathbf{u}^5,\mathbf{u}^8,\mathbf{u}^{10},\mathbf{u}^{13}\}$. \end{example} \begin{example} $\Apr(\2uRing{3}{5}/\2uRing{6}{8})=\{\mathbf{u}^0,\mathbf{u}^3,\mathbf{u}^5,\mathbf{u}^{10}\}$. \end{example} Ap\'{e}ry numbers are the logarithmic form of Ap\'{e}ry monomials. Let $R'/R$ be a numerical semigroup algebra in the variable $\mathbf{u}$. Let $S'=\log_\mathbf{u} R'$ and $S=\log_\mathbf{u} R$. Then an element $s\in S'$ such that $\mathbf{u}^s\in\Apr(R'/R)$ is called an \em{Ap\'{e}ry number} of $S'$ with respect to $S$. In the classical case, recall that an Ap\'{e}ry number of a numerical semigroup $S'$ with respect to an element $m\in S'$ is defined to be an element $s\in S'$ such that $s-m\not\in S'$. In our terminology, these numbers are exactly Ap\'{e}ry numbers of $S'$ with respect to the numerical semigroup $m{\mathbb{N}}$. For a numerical semigroup algebra $R'/R$, an Ap\'{e}ry monomial $p$ not equal to $1$ is called a \em{minimal monomial} if, whenever there are monomials $p_1$ and $p_2$ of $R'$ such that $p_1p_2 =p$, then one of $p_1$ and $p_2$ has to be $p$. In other words, minimal monomials of a numerical semigroup algebra are minimal elements among non-trivial Ap\'{e}ry monomials with respect to the partial order given by divisions. Let $\mathbf{u}^{s_1},\ldots,\mathbf{u}^{s_n}$ be the minimal monomials of $R'/R$, then $R'=R[\![\mathbf{u}^{s_1},\ldots,\mathbf{u}^{s_n}]\!]$. The following two notions are central in the computational aspect of numerical semigroup algebras. \begin{defn}[representation] Let $R'/R$ be a numerical semigroup algebra in the variable $\mathbf{u}$. A representation of a monomial $\mathbf{u}^s$ of $R'/R$ is an expression $\mathbf{u}^s=\mathbf{u}^{s_0}\mathbf{u}^w$, where $\mathbf{u}^{s_0}\in R$ and $\mathbf{u}^w\in\Apr(R'/R)$. \end{defn} \begin{defn}[factorization]\label{fact} Let $R'/R$ be a numerical semigroup algebra in the variable $\mathbf{u}$. Let $\mathbf{u}^{s_1},\ldots,\mathbf{u}^{s_n}$ be the minimal monomials of $R'/R$. An expression $\mathbf{u}^s=\mathbf{u}^{s_0}(\mathbf{u}^{s_1})^{a_1}\cdots(\mathbf{u}^{s_n})^{a_n}$ for a monomial $\mathbf{u}^s$ of $R'$, where $\mathbf{u}^{s_0}\in R$ and $a_i\in{\mathbb{N}}$, is called a \em{factorization} of $\mathbf{u}^s$. \end{defn} Note that representations and factorizations always exist for monomials in a numerical semigroup algebra. \section{Flatness}\label{sec:flat} Flatness is a homological notion for modules. It also has a characterization in terms of relations. Roughly speaking, a module is flat if all its module relations come from the relations of the underlying ring. See \cite[Theorem 7.6]{M} for the precise statement. For a finitely generated module over a Noetherian local ring, free and flat are equivalent properties. To emphasize the computational aspect of numerical semigroup algebras, we interpret this fact again as in \cite{HK} using the flatness criterion by relations. \begin{lem}\label{lem:ur} A numerical semigroup algebra is flat if and only if every monomial has a unique representation. \end{lem} \begin{proof} If every monomial has a unique representation, the numerical semigroup algebra is free and thus flat. Assume that the algebra $\uAlg{S'}{S}$ is flat. Consider two different representations $\mathbf{u}^{t_1}\mathbf{u}^{w_1}=\mathbf{u}^{t_2}\mathbf{u}^{w_2}$, where $\mathbf{u}^{t_1},\mathbf{u}^{t_2}$ are coefficients and $\mathbf{u}^{w_1},\mathbf{u}^{w_2}$ are Ap\'{e}ry. Assume that $t_1<t_2$. Applying \cite[Theorem 7.6]{M} for the flat algebra, there are elements $f_{ij}\in\uRing{S}$ and $g_j\in\uRing{S'}$ such that \begin{eqnarray} \mathbf{u}^{t_1}f_{1j}-\mathbf{u}^{t_2}f_{2j}&=&0,\label{eq:510891}\\ f_{i1}g_1+\cdots+f_{in}g_n&=&\mathbf{u}^{w_i},\label{eq:510772} \end{eqnarray} where $i=1,2$ and $1\leq j\leq n$ for some $n$. From (\ref{eq:510891}), we see that the constant term of $f_{1j}$ vanishes for each $j$. Since $\mathbf{u}^{w_1}$ is an Ap\'{e}ry monomial, this implies that the coefficient of $f_{11}g_1+\cdots+f_{1n}g_n$ at $\mathbf{u}^{w_1}$ vanishes, contradicting (\ref{eq:510772}). \qed \end{proof} In particular, Ap\'{e}ry monomials form an $R$-module basis of a flat numerical semigroup algebra over $R$. \begin{example}\label{ex:nonflat} The algebra $\uRing{}/\2uRing{2}{3}$ has two Ap\'{e}ry monomials $\mathbf{u}^0$ and $\mathbf{u}$. The algebra is not flat, since $\mathbf{u}^{3}$ has different representations $\mathbf{u}^2\mathbf{u}$ and $\mathbf{u}^3\mathbf{u}^0$. \end{example} \begin{example}\label{ex:flatclassical} The algebra $\2uRing{2}{3}/\uRing{2}$ has two Ap\'{e}ry monomials $\mathbf{u}^0$ and $\mathbf{u}^3$. All monomials with even exponents belong to the coefficient ring $\uRing{2}$, and all monomials in $\2uRing{2}{3}$ with odd exponents are uniquely represented as $\mathbf{u}^{2t}\mathbf{u}^3$ for some integer $t\geq 0$. By Lemma~\ref{lem:ur}, the algebra is flat. \end{example} \begin{example}\label{ex:flatglue} The algebra $\4uRing{12}{14}{16}{35}/\2uRing{12}{16}$ has four Ap\'{e}ry monomials $\mathbf{u}^0,\mathbf{u}^{14},\mathbf{u}^{35},\mathbf{u}^{49}$. Since the difference of any two distinct elements in $\{0,14,35,49\}$ is not the difference of any two elements in the numerical semigroup $\langle 12,16\rangle$, any monomial of the algebra has a unique representation. The algebra is flat by Lemma~\ref{lem:ur}. \end{example} Example~\ref{ex:flatclassical} is part of a general phenomenon in the classical case. If the coefficients of a numerical semigroup algebra provide a Noether normalization, then the algebra is flat \cite[Corollary 2.2]{HK}. Example~\ref{ex:flatglue} is a general phenomenon about gluing. Let $S$ and $T$ be numerical semigroups generated by integers, $q\in S$ and $p\in T$ be relatively prime numbers. Recall that the numerical semigroup $pS+qT$ is called a \em{gluing} of $S$ and $T$, if $p$ and $q$ are not in the minimal set of generators of $T$ and $S$, respectively. The algebra $\kappa[\![\mathbf{u}^{pS+qT}]\!]$ over $\kappa[\![\mathbf{u}^{pS}]\!]$ or over $\kappa[\![\mathbf{u}^{qT}]\!]$ is flat \cite[Proposition 2.9]{HK}. See Example~\ref{ex:22} for another flat numerical semigroup algebra beyond these general phenomena. In this section, we provide two more criteria for flatness: A criterion counts Ap\'{e}ry monomials and another is expressed in terms of the set \[ \Delta_S(S'):=\{a_1-a_2 \,|\, \text{$\mathbf{u}^{a_1},\mathbf{u}^{a_2}\in\Apr(\uAlg{S'}{S})$ and $a_1\geq a_2$}\} \] for numerical semigroups $S\subset S'$. \begin{prop}\label{flat} Let $\uAlg{S'}{S}$ be a numerical semigroup algebra, where $S'$ and $S$ are subsets of ${\mathbb{N}}$ with greatest common divisors $d'$ and $d$ respectively. There are at least $d/d'$ Ap\'{e}ry monomials. The following conditions are equivalent. \begin{itemize} \item The algebra is flat. \item The algebra has $d/d'$ Ap\'{e}ry monomials. \item $\Delta_S(S')\cap (d/d'){\mathbb{Z}}\subset S$. \end{itemize} In particular, if the algebra is flat, then $S=S'\cap (d/d'){\mathbb{Z}}$. \end{prop} \begin{proof} Dividing every number in $S'$ by $d'$, we may assume that $d'=1$. With this assumption, there exists an Ap\'{e}ry number in each congruence class modulo $d$. So totally there are at least $d$ Ap\'{e}ry monomials. If there are exactly $d$ Ap\'{e}ry monomials, each congruence class consists of exactly one Ap\'{e}ry monomial. Consider two representations $\mathbf{u}^{s_1}\mathbf{u}^{w_1}=\mathbf{u}^{s_2}\mathbf{u}^{w_2}$, where $\mathbf{u}^{s_1},\mathbf{u}^{s_2}$ are coefficients and $\mathbf{u}^{w_1},\mathbf{u}^{w_2}$ are Ap\'{e}ry. Since $s_1$ and $s_2$ are both divisible by $d$, the exponents $w_1$ and $w_2$ are in the same congruence class. Hence $\mathbf{u}^{w_1}=\mathbf{u}^{w_2}$. In other words, every monomial has a unique representation. By Lemma~\ref{lem:ur}, the algebra is flat. If there are more than $d$ Ap\'{e}ry monomials, two different Ap\'{e}ry numbers $w_1$ and $w_2$ are in the same congruence class. Say $w_1>w_2$. Choose $s_1$ and $s_2$ in $S$ large enough so that $w_1-w_2=s_2-s_1$. Then we have two different representations $\mathbf{u}^{s_1}\mathbf{u}^{w_1}=\mathbf{u}^{s_2}\mathbf{u}^{w_2}$ for a monomial. Consequently, the algebra is not flat. The inclusion $\Delta_S(S')\cap d{\mathbb{Z}}\subset S$ is just another way to state that each congruence class contains exactly one Ap\'{e}ry number. The condition that there is only one Ap\'{e}ry number congruent to $0$ modulo $d$ can be stated as $S'\cap d{\mathbb{Z}}=S$, which is therefore a necessary condition for flatness. \qed \end{proof} \begin{example}\label{ex:22} For $\mathbf{u}=\mathbf{v}^6$, the algebra $\twovRing{4}{9}/\2uRing{2}{3}$ is flat, since it has six Ap\'{e}ry monomials $1,\mathbf{v}^4,\mathbf{v}^8,\mathbf{v}^9,\mathbf{v}^{13},\mathbf{v}^{17}$. Note that the numerical semigroup $\langle 4,9\rangle$ can not be written as a gluing of $\langle 2,3\rangle$ and another numerical semigroup, because the semigroup obtained from such a gluing needs at least three generators \cite[Lemma 9.8]{GR}. \end{example} For a numerical semigroup algebra $R[\![\mathbf{u}^{s_1},\ldots,\mathbf{u}^{s_n}]\!]$, we may choose $m\in{\mathbb{N}}$ such that $ms_i\in\log_\mathbf{u} R$ for all $i$. Therefore $R[\![\mathbf{u}^{s_1},\ldots,\mathbf{u}^{s_n}]\!]$ can be considered as the algebra obtained from $R$ by joining $m$-th roots of the monomials $\mathbf{u}^{ms_1},\ldots,\mathbf{u}^{ms_n}$ in $R$. We may apply Proposition~\ref{flat} to the case that only one root is joined. \begin{cor}\label{cor:f1} Assume that $\log_\mathbf{u} R\subset{\mathbb{N}}$ and has greatest common divisor $1$. Assume that $s,m\in{\mathbb{N}}$ are relatively prime. Then the algebra $R[\![\mathbf{u}^{s/m}]\!]$ is flat if and only if $s\in\log_\mathbf{u} R$. \end{cor} \begin{proof} The set of Ap\'{e}ry numbers is $\{0,s/m,2s/m,\ldots,(t-1)s/m\}$, where $t$ is the smallest positive integer satisfying $ts/m\in\log_\mathbf{u} R$. The algebra is flat if and only if there are $m$ Ap\'{e}ry numbers. If the algebra is flat, then $t=m$ and hence $s\in\log_\mathbf{u} R$. Conversely, if $s\in\log_\mathbf{u} R$, then $t\leq m$. There are at least $m$ Ap\'{e}ry monomials. Hence $t=m$ and consequently the algebra is flat. \qed \end{proof} Let $S\subset{\mathbb{N}}$ be a numerical semigroup with the greatest common divisor $1$. As an application of Corollary~\ref{cor:f1}, the algebra $\2uRing{S}{s}/\uRing{S}$ is not flat for any $s\in{\mathbb{N}}\setminus S$. See Example~\ref{ex:nonflat}. More generally, for any numerical semigroup $S'$ satisfying $S\subsetneq S'\subset{\mathbb{N}}$, Proposition~\ref{flat} implies that the algebra $\uAlg{S'}{S}$ is not flat. If we remove the condition on the greatest common divisor, plenty of flat algebras come out by adding monomials. \begin{example} Let $R=\2uRing{2}{3}$. Since $3\in\log_\mathbf{u} R$, the algebra $R[\![\mathbf{u}^{3/2}]\!]$ is flat by Corollary \ref{cor:f1}. In terms of the new variable $\mathbf{v}=\mathbf{u}^{1/2}$, we may write $R[\![\mathbf{u}^{3/2}]\!]=\threevRing{4}{6}{3}=\twovRing{4}{3}$. \end{example} \begin{example} Joining the $4$-th root of $\mathbf{u}^6$ and the square roots of $\mathbf{u}^5$ and $\mathbf{u}^7$ to $\3uRing{5}{6}{7}$, we obtain $\threevRing{3}{5}{7}$ in terms of the variable $\mathbf{v}=\mathbf{u}^{1/2}$. The algebra $\threevRing{3}{5}{7}/\3uRing{5}{6}{7}$ has more than two Ap\'{e}ry monomials, including three minimal monomials. By Proposition \ref{flat}, the algebra is not flat. \end{example} If $S'$ is generated by $S$ and one more element in Proposition~\ref{flat}, the condition $S'\cap d{\mathbb{Z}}=S$ is also sufficient for flatness as stated in Proposition~2.5 in \cite{HK}. This is not true in general. \begin{example} In the algebra $\3uRing{5}{8}{9}/\3uRing{9}{15}{21}$, the monomial $\mathbf{u}^{23}$ has different representations $\mathbf{u}^{18}\mathbf{u}^5$ and $\mathbf{u}^{15}\mathbf{u}^8$. The algebra is not flat, although $\langle5,8,9\rangle\cap 3{\mathbb{Z}}=\langle 9,15,21\rangle$. \end{example} Now, we give a necessary condition for a numerical semigroup algebra to be flat. For an element $s$ in a numerical semigroup $T$, a \em{divisor} of $s$ in $T$ is an element $t\in T$ such that $s-t\in T$. The terminology is justified by its exponential counterpart, where $\mathbf{u}^t$ divides $\mathbf{u}^s$ in $\uRing{T}$. We call $0$ the \em{trivial divisor} of $s$ and any divisor not equal to $s$ a \em{proper divisor}. \begin{prop}\label{prop:log} If a numerical semigroup algebra $R[\![\mathbf{u}^{s_1},\ldots,\mathbf{u}^{s_n}]\!]$ is flat, then any two minimal generators of $\log_\mathbf{u} R$ belonging to $T:=\langle s_1,\ldots,s_n\rangle$ have only trivial common divisor in $T$. \end{prop} \begin{proof} Let $a_1,\ldots,a_m$ be the minimal generators of $\log_\mathbf{u} R$. Assume that $a_1\in T$. We claim that any proper divisor $a'_1$ of $a_1$ in $T$ is an Ap\'{e}ry number. Write \begin{equation}\label{eq:3144} a'_1=\sum\beta_ia_i+\sum \gamma_js_j \end{equation} and \[ a_1-a'_1+\sum\gamma_js_j=\sum\beta'_ia_i+\sum\gamma'_js_j \] for certain Ap\'{e}ry numbers $\sum \gamma_js_j$ and $\sum\gamma'_js_j$. Then \[ a_1=\sum(\beta_i+\beta'_i)a_i+\sum\gamma'_js_j. \] By the criterion of flatness in Lemma~\ref{lem:ur}, \[ \sum(\beta_i+\beta'_i)a_i=a_1 \] Since $a_1,\ldots,a_m$ are minimal generators, we have $\beta_1+\beta'_1=1$ and $\beta_i=\beta'_i=0$ for $i>1$. Since $a_1>a'_1$, we have $\beta_1=0$ from (\ref{eq:3144}). Hence $a'_1$ is the Ap\'{e}ry number $\sum \gamma_js_j$. For $\alpha\in{\mathbb{Z}}$, we use the notation $\alpha^+:=\alpha$ if $\alpha>0$ and $\alpha^+:=0$ otherwise. To show the proposition, we assume the contrary that $a_1,a_2\in T$ come with a common non-trivial divisor $t$. By joining $t$ to the set $\{s_i\}$, we may assume $t=s_1$. Then there are expressions $a_1=\sum\alpha_is_i$ and $a_2=\sum\alpha'_is_i$ for positive $\alpha_1$ and $\alpha'_1$. By flatness, $\sum(\alpha'_i-\alpha_i)^+s_i$ and $\sum(\alpha_i-\alpha'_i)^+s_i$ in the expressions \[ a_1+\sum(\alpha'_i-\alpha_i)^+s_i=a_2+\sum(\alpha_i-\alpha'_i)^+s_i \] cannot be both Ap\'{e}ry. Assume that the divisor $\sum(\alpha'_i-\alpha_i)^+s_i$ of $a_2$ is not Ap\'{e}ry. By the claim in the previous paragraph, the number $(\alpha'_1-\alpha_1)^+$ can not be less than $\alpha'_1$. This is impossible since $\alpha_1>0$. \qed \end{proof} For $n=2$ in Proposition~\ref{prop:log}, we have more precise information. \begin{cor}\label{2.5} Let $s_1$ and $s_2$ be positive integers satisfying $\gcd(s_1,s_2)=1$. The following statements are equivalent for a numerical semigroup algebra $R[\![\mathbf{u}^{s_1},\mathbf{u}^{s_2}]\!]$ satisfying the condition $\log_{\mathbf{u}}R\subseteq\langle s_1,s_2\rangle$. \begin{itemize} \item The algebra $R[\![\mathbf{u}^{s_1},\mathbf{u}^{s_2}]\!]$ is flat. \item $\log_{\mathbf{u}}R$ is either principal or is generated by $a_1s_1$ and $a_2s_2$ for some positive integers $a_1$ and $a_2$ such that $a_1$ divides $s_2$ and $a_2$ divides $s_1$. \end{itemize} \end{cor} \begin{proof} We work on the case that $\log_{\mathbf{u}}R$ is not principal. By Proposition~\ref{prop:log}, it is generated by two elements $a_1s_1$ and $a_2s_2$ with only trivial divisor in common. For $0\leq r_1<a_1$ and $0\leq r_2<a_2$, we claim that $r_1s_1+r_2s_2$ is Ap\'{e}ry. Assume the contrary, by changing indices, we may write $r_1s_1+r_2s_2=a_1s_1+r'_1s_1+r'_2s_2$. Then $a_2s_2=(a_1-r_1+r'_1)s_1+(a_2-r_2+r'_2)s_2$ implies that $s_1$ is a divisor of $a_2s_2$. This is impossible. For distinct pairs $(r_1,r_2)$ and $(r'_1,r'_2)$ satisfying $0\leq r_i<a_i$ and $0\leq r'_i<a_i$, we claim that $r_1s_1+r_2s_2\neq r'_1s_1+r'_2s_2$. We may assume $r_1<r'_1$. If $r_1s_1+r_2s_2=r'_1s_1+r'_2s_2$, then $a_2s_2=(r_1'-r_1)s_1+(a_2-r_2+r'_2)s_2$ implies that $s_1$ is a divisor of $a_2s_2$. This is impossible. Therefore there are $a_1a_2$ Ap\'{e}ry numbers. By Proposition~\ref{flat}, the $R$-algebra $R[\![\mathbf{u}^{s_1},\mathbf{u}^{s_2}]\!]$ is flat if and only if $\gcd(a_1s_1,a_2s_2)=a_1a_2$, equivalently $a_1$ divides $s_2$ and $a_2$ divides $s_1$. \qed \end{proof} \begin{example} The algebra $\2uRing{3}{4}/\2uRing{9}{12}$ is not flat by Corollary~\ref{2.5}. The algebra has Ap\'{e}ry monomials $1, \mathbf{u}^3, \mathbf{u}^4, \mathbf{u}^6,\mathbf{u}^7,\mathbf{u}^8,\mathbf{u}^{10},\mathbf{u}^{11},\mathbf{u}^{14}$. While $\gcd(9,12)=3$, one sees that the algebra is not flat also by counting Ap\'{e}ry monomials. \end{example} \section{Rectangles}\label{sec:rectangle} In this section, we denote by $\mathbf{u}^{s_1},\ldots,\mathbf{u}^{s_n}$ the minimal monomials of a numerical semigroup algebra $R'/R$ in the variable $\mathbf{u}$. \begin{defn}[rectangle] The set of the Ap\'{e}ry monomials of the algebra $R'/R$ is called a rectangle of size $\beta_1\times\cdots\times\beta_n$ if the following conditions hold. \begin{itemize} \item All Ap\'{e}ry monomials can be factored uniquely as $(\mathbf{u}^{s_1})^{\ell_1}\cdots (\mathbf{u}^{s_n})^{\ell_n}$, where $0\leq \ell_i<\beta_i$. \item All monomials $(\mathbf{u}^{s_1})^{\ell_1}\cdots (\mathbf{u}^{s_n})^{\ell_n}$ with $0\leq \ell_i<\beta_i$ are Ap\'{e}ry. \end{itemize} A numerical semigroup algebra is \em{rectangular} if the set of its Ap\'{e}ry monomials forms a rectangle. \end{defn} As seen in the next example, the condition of uniqueness is essential in the definition of rectangles. \begin{example} The algebra $\4uRing{14}{21}{22}{33}/\uRing{22}$ is flat with $22$ Ap\'{e}ry monomials. Since $22\neq\beta_1\times\beta_2\times\beta_3$ for integers $\beta_i>1$, the algebra is not rectangular. Note that the set of Ap\'{e}ry monomials can be described as $\{1,\mathbf{u}^{14},\mathbf{u}^{28},\mathbf{u}^{42}\}\times\{1,\mathbf{u}^{21},\mathbf{u}^{42}\}\times\{1,\mathbf{u}^{33}\}$. However this set is not a rectangle, because $\mathbf{u}^{42}$ and $\mathbf{u}^{75}$ have different expressions. \end{example} A rectangle of Ap\'{e}ry monomials may have different sizes. \begin{example} The algebra $\2uRing{2}{3}/\uRing{12}$ is rectangular. Its set of Ap\'{e}ry monomials can be described as a $4\times 3$ rectangle $\{1,\mathbf{u}^3,\mathbf{u}^6,\mathbf{u}^9\}\times\{1,\mathbf{u}^2,\mathbf{u}^4\}$ or a $2\times 6$ rectangle $\{1,\mathbf{u}^3\}\times\{1,\mathbf{u}^2,\mathbf{u}^4,\mathbf{u}^6,\mathbf{u}^8,\mathbf{u}^{10}\}$. \end{example} A numerical semigroup algebra obtained by joining one root of a monomial is always rectangular, but it may not be flat, see Example~\ref{ex:nonflat}. We are mainly interested in flat rectangular algebras. Since a rectangular algebra has a unique maximal Ap\'{e}ry monomial, flat rectangular algebras are Gorenstein by \cite[Proposition 3.1]{HK}. Here is another non-flat rectangular algebra: \begin{example}\label{ex:35} The algebra $\4uRing{14}{21}{22}{33}/\2uRing{14}{22}$ is not flat, since $\mathbf{u}^{231}$ has two representations $(\mathbf{u}^{14})^{15}\mathbf{u}^{21}=(\mathbf{u}^{22})^9\mathbf{u}^{33}$. The algebra is rectangular and the set of its Ap\'ery monomials is $\{1,\mathbf{u}^{21}\}\times\{1,\mathbf{u}^{33}\}$. \end{example} Certain flat numerical semigroup algebras are always rectangular. See the proof of Corollary~\ref{2.5}. \begin{prop} Let $R$ be a numerical semigroup ring which is not a power series ring. A flat algebra $R[\![\mathbf{u}^{s_1},\mathbf{u}^{s_2}]\!]$ satisfying $\log_{\mathbf{u}}R\subseteq\langle s_1,s_2\rangle\subseteq{\mathbb{N}}$ and $\gcd(s_1,s_2)=1$ is rectangular. \end{prop} Free numerical semigroups~\cite{BC} (not to be confused with the notion of free algebras given by numerical semigroups) provide examples of rectangular algebras in the classical case: Assume that $R=\kappa[\![\mathbf{u}^{s_0}]\!]$. Let $S$ be the semigroup minimally generated by $s_0,s_1,\ldots,s_n$. Assume that $S$ is free in the sense that its Ap\'{e}ry numbers with respect to $s_0{\mathbb{N}}$ can be listed as $\sum_{i=1}^n\lambda_is_i$ for $0\leq\lambda_i<\phi_i$ after rearranging the indices, where $\phi_i=\min\{h\in{\mathbb{N}}\,|\, hs_i\in\langle s_0,\ldots,s_{i-1}\rangle\}$. By \cite[Proposition 9.15]{GR}, there are $\phi_1\phi_2\cdots\phi_n$ Ap\'{e}ry monomials. So the algebra $\kappa[\![\mathbf{u}^{s_0},\ldots,\mathbf{u}^{s_n}]\!]/\kappa[\![\mathbf{u}^{s_0}]\!]$ is rectangular. The notions of $\alpha$-rectangular, $\beta$-rectangular and $\gamma$-rectangular Ap\'ery sets for numerical semigroups also provide rectangular algebras. Indeed, there are strict implications \[ \text{$\alpha$-rectangular $\implies$ $\beta$-rectangular $\implies$ $\gamma$-rectangular $\implies$ free} \] for numerical semigroups \cite[Theorem~2.13]{DMS}. In particular, if $S$ has an $\alpha$-rectangular Ap\'ery set, then the algebra $\uAlg{S}{s}$ is rectangular for some $s\in S$. However, the converse is not true. For instance, the semigroup $\langle 5,6,9\rangle$ does not have $\gamma$-rectangular Ap\'ery set (hence not $\beta$-rectangular nor $\alpha$-rectangular), but $\kappa[\![\mathbf{u}^5,\mathbf{u}^6,\mathbf{u}^9]\!]/\kappa[\![\mathbf{u}^6]\!]$ is a rectangular algebra with the set $\{1,\mathbf{u}^9\}\times\{1,\mathbf{u}^5,\mathbf{u}^{10}\}$ of Ap\'ery monomials. Given a numerical semigroup $S$, the properties of Cohen-Macaulay, Gorenstein and complete intersection of the algebra $\uAlg{S}{s}$ are independent of the choice of an element $s\in S$. This is not the case for rectangular algebras. \begin{example} The Ap\'{e}ry monomials $1,\mathbf{u}^2,\mathbf{u}^3,\mathbf{u}^4,\mathbf{u}^6$ of $\2uRing{2}{3}/\uRing{5}$ do not form a rectangle. An algebra with only one minimal monomial, for instance $\2uRing{2}{3}/\uRing{3}$, is always rectangular. \end{example} If the set of Ap\'{e}ry monomials of $R'/R$ form a rectangle of size $\beta_1\times\cdots\times\beta_n$, every monomial can be factored as $\mathbf{u}^t(\mathbf{u}^{s_1})^{\ell_1}\cdots (\mathbf{u}^{s_n})^{\ell_n}$, where $\mathbf{u}^t\in R$ and $0\leq\ell_i<\beta_i$ for all $i$. Such a factorization is unique if and only if the algebra is flat. Under the flatness assumption, there is a unique factorization \[ \mathbf{u}^{s_i\beta_i}=\mathbf{u}^{t_i}(\mathbf{u}^{s_1})^{\beta_{i 1}}\cdots (\mathbf{u}^{s_n})^{\beta_{i n}} \] such that $0\leq\beta_{ij}<\beta_i$ for all $j$. Note that $\beta_{ii}=0$ in the above factorization. Let $\mathbf{Y}$ be the variables $Y_1,\ldots,Y_n$ and $\mathbf{Z}$ be the shorthand of $Z_1,\ldots,Z_n$, where $Z_\ell:=Y_\ell^{\beta_\ell}Y_1^{-\beta_{\ell 1}}\cdots Y_n^{-\beta_{\ell n}}$. In terms of the matrix \begin{equation}\label{def:log} \log_\mathbf{Y}\mathbf{Z}:= \begin{pmatrix} \beta_1 & -\beta_{12} & \cdots & -\beta_{1n} \\ -\beta_{21}& \beta_2 & \cdots & -\beta_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ -\beta_{n1} & -\beta_{n2} & \cdots & \beta_n \end{pmatrix}, \end{equation} we have a relation \begin{equation}\label{eq:log} \log_\mathbf{Y}\mathbf{Z} \begin{pmatrix} s_1 \\ s_2 \\ \vdots \\s_n \end{pmatrix}= \begin{pmatrix} t_1 \\ t_2 \\ \vdots \\t_n \end{pmatrix}. \end{equation} \begin{example} In the algebra $\6uRing{32}{35}{38}{44}{48}{56}/\2uRing{32}{48}$, the squares of minimal monomials are not Ap\'{e}ry. So all Ap\'{e}ry monomials are in the set $\{0,\mathbf{u}^{35}\}\times\{0,\mathbf{u}^{38}\}\times\{0,\mathbf{u}^{44}\}\times\{0,\mathbf{u}^{56}\}$. Since $\gcd(32,48)=16$, this set consists of all the 16 Ap\'{e}ry monomials. Therefore the algebra is flat with a rectangle of size $2\times 2\times 2\times 2$. Relation (\ref{eq:log}) becomes \[ \begin{pmatrix} 2 & -1 & 0 & 0 \\ 0& 2 & -1 & 0 \\ 0 & 0 & 2 & -1 \\ 0 & 0 & 0 & 2 \end{pmatrix} \begin{pmatrix}35\\38\\44\\56\end{pmatrix}= \begin{pmatrix}32\\32\\32\\2\times 32+48\end{pmatrix}. \] \end{example} If $\log_\mathbf{Y}\mathbf{Z}$ is invertible, we call the rectangle \em{non-singular}. In such a case, every monomial in $\mathbf{Y}$ can be written uniquely as $Z_1^{i_1}\cdots Z_n^{i_n}$ with rational exponents $i_1,\ldots,i_n$. In other words, row vectors of $\log_\mathbf{Y}\mathbf{Z}$ form a basis for the vector space ${\mathbb{Q}}^n$. If furthermore all entries of the inverse of $\log_\mathbf{Y}\mathbf{Z}$ are non-negative, every monomial in $\mathbf{Y}$ can be written as $Z_1^{i_1}\cdots Z_n^{i_n}$ with non-negative rational exponents. This statement can be also expressed in terms of vectors of exponents: If a vector in ${\mathbb{Q}}^n$ sits in the first orthant with respect to the standard basis, then the vector also sits in the first orthant with respect to the basis given by the row vectors of $\log_\mathbf{Y}\mathbf{Z}$. \begin{lem}\label{lem:matrix} Let \[ B=\begin{pmatrix} \beta_1 & -\beta_{12} & \cdots & -\beta_{1n} \\ -\beta_{21}& \beta_2 & \cdots & -\beta_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ -\beta_{n1} & -\beta_{n2} & \cdots & \beta_n \end{pmatrix} \] be a matrix of real numbers satisfying the property that $\beta_j>\beta_{ij}\geq 0$ for all $i$ and $j$. If $\beta_is_i\geq\sum_{j\neq i}\beta_{ij}s_j$ for certain positive numbers $s_1,\ldots,s_n$ and for all $i$, then $\det B$ and all the entries of the adjoint of $B$ are non-negative. \end{lem} \begin{proof} We use induction on the size $n$ of the matrix to prove the lemma. For $n=1,2$, the lemma is clearly true. To work on the case $n>2$, we assume that the lemma holds for matrices of size less than $n$. Deleting the $i$-th row and the $j$-th column from $B$, we obtain a matrix $B_{ij}$ whose determinant multiplied by $(-1)^{i+j}$ is an entry of the adjoint of $B$. Note that $B_{ii}$ still satisfies the conditions of the lemma. By the induction hypothesis, $\det B_{ii}\geq 0$. If $i<j$, we first perform $j-2$ operations of switching rows so that the $(j-1)$-th row of $B_{ij}$ becomes the first row and other rows of $B_{ij}$ keep the order; then we perform $i-1$ operations of switching columns on the new matrix obtained so that $i$-th column becomes the first column and other columns keep the order. After these $i+j-3$ operations, $B_{ij}$ becomes a matrix $B'_{ij}$ satisfying the following conditions. \begin{itemize} \item The first row consists of $\{-\beta_{j\ell}\}_{\ell\neq j}$. \item The first column consists of $\{-\beta_{\ell i}\}_{\ell\neq i}$. \item Replacing the entry $-\beta_{ji}$ at the upper left corner of $B'_{ij}$ by $\beta_i$, the matrix $B''_{ij}$ obtained satisfies the condition of the lemma. \end{itemize} If $i>j$, we perform $j-1$ operations of switching rows and $i-2$ operations of switching columns. After $i+j-3$ operations of switching rows and columns, $B_{ij}$ also becomes a matrix $B'_{ij}$ satisfying the above three conditions. Now we compute $\det B'_{ij}$ using Laplace expansion on the first row. The first row of $\adj(B'_{ij})$ is the same as that of $\adj(B''_{ij})$. By the induction hypothesis, the entries of the first row of $\adj(B''_{ij})$ are non-negative. Since the first row of $B'_{ij}$ consists of $\{-\beta_{j\ell}\}_{\ell\neq j}$, Laplace expansion shows $\det B'_{ij}\leq 0$. Taking the negative signs from switching rows and columns into account, $\det B'_{ij}=(-1)^{i+j-3}\det B_{ij}$. Hence the entry $(-1)^{i+j}\det B_{ij}$ of $\adj(B)$ is non-negative. To prove $\det B\geq 0$, we may replace $B$ by the matrix obtained by multiplying the $i$-th column by $s_i$ for all $i$. In other words, we may assume that $s_1=\cdots=s_n=1$. Now, adding all other columns to the first column of $B$, we obtain a matrix whose entries in the first column are all non-negative. To compute the determinant of the new matrix, we use Laplace expansion on the first column. Since all entries of $\adj(B)$ are non-negative, $\det B\geq 0$ as well. \qed \end{proof} \begin{thm}\label{thm:main} A flat numerical semigroup algebra $R'/R$ is a complete intersection, if its Ap\'{e}ry monomials form a non-singular rectangle. \end{thm} \begin{proof} Let $\beta_1\times\cdots\times\beta_n$ be the size of the non-singular rectangle. Consider the local $R$-algebra homomorphism $\hat{\pi}\colon R[\![Y_1,\ldots,Y_n]\!]\to R'$, where $Y_\ell$ maps to $\mathbf{u}^{s_\ell}$ for $1\leq\ell\leq n$. The restriction $\pi\colon R[Y_1,\ldots,Y_n]\to R'$ of $\hat{\pi}$ is surjective. Since $\ker\hat{\pi}$ is generated by $\ker\pi$, it suffices to show that $\ker\pi$ is generated by $n$ elements. We claim that $f_\ell:=Y_\ell^{\beta_\ell}-\mathbf{u}^{t_\ell}Y_1^{\beta_{\ell 1}}\cdots Y_n^{\beta_{\ell n}}$ generate $\ker\pi$, where $\mathbf{u}^{t_\ell}\in R$ and $0\leq\beta_{\ell i}<\beta_i$ for all $i$. Let $\mathbf{Y}$ and $\mathbf{Z}$ be as in (\ref{def:log}). Since $\log_\mathbf{Y}\mathbf{Z}$ is invertible, we may associate a non-negative number to a monomial $\mathbf{Y}^\mathbf{i}=Y_1^{i_1}\cdots Y_n^{i_n}$. Let $(j_1,\ldots,j_n)\in{\mathbb{Q}}^n$ be the vector given by $(j_1,\ldots,j_n)\log_\mathbf{Y}\mathbf{Z}=(i_1,\ldots,i_n)$. By Lemma~\ref{lem:matrix}, all $j_\ell$ are non-negative. We define \[ \|\log\mathbf{Y}^\mathbf{i}\|:=j_1+\cdots+j_n. \] If $i_\ell\geq\beta_\ell$ for some $\ell$, we replace the factor $Y_\ell^{\beta_\ell}$ of $\mathbf{Y}^\mathbf{i}$ by $\mathbf{u}^{t_\ell}Y_1^{\beta_{\ell 1}}\cdots Y_n^{\beta_{\ell n}}$ resulting $\mathbf{u}^{t_\ell}\mathbf{Y}^\mathbf{i}/Z_\ell$. Then \[ \mathbf{Y}^\mathbf{i}-\mathbf{u}^{t_\ell}\mathbf{Y}^\mathbf{i}/Z_\ell=f_\ell \mathbf{Y}^\mathbf{i}/Y_\ell^{\beta_\ell}\in\langle f_1,\ldots,f_n\rangle. \] In the logarithmic form, the operation subtracts the $\ell$-th row of $\log_\mathbf{Y}\mathbf{Z}$ from the vector $\mathbf{i}:=(i_1,\ldots,i_n)$. Hence \[ \|\log(\mathbf{u}^{t_\ell}\mathbf{Y}^\mathbf{i}/Z_\ell)\|=\|\log\mathbf{Y}^\mathbf{i}\|-1. \] After finitely many such operations, every monomial $Y_1^{i_1}\cdots Y_n^{i_n}$ can be changed so that the condition $i_\ell<\beta_\ell$ is satisfied for each $\ell$. Applying these operations, every element of $R[Y_1,\ldots,Y_n]$ can be written as the sum of an element of $\langle f_1,\ldots,f_n\rangle$ and an $R$-linear combination of monomials $Y_1^{i_1}\cdots Y_n^{i_n}$ satisfying $i_\ell<\beta_\ell$. By flatness and the rectangular property, $f_1,\ldots,f_n$ generate $\ker\pi$. \qed \end{proof} If $S$ is a free numerical semigroup, we can find a minimal generator $s$ such that the Ap\'{e}ry monomials of $\kappa[\![\mathbf{u}^S]\!]/\kappa[\![\mathbf{u}^{s}]\!]$ form a non-singular rectangle. The next example is observed already in \cite[Lemma~3]{W}. \begin{example} Let $a$ be an odd positive integer. With relations \[\begin{pmatrix} 2& -1 & 0 & \cdots & 0 & 0\\ 0& 2 & -1 & \cdots & 0 & 0\\ 0& 0 & 2 & \cdots & 0 & 0\\ \vdots& \vdots & \vdots & \ddots & \vdots & \vdots\\ 0& 0 & 0 & \cdots & 2 & -1\\ 0& 0 & 0 & \cdots & 0 & 2 \end{pmatrix} \begin{pmatrix} 2^n+a\\ 2^n+2a\\ 2^n+4a\\ \vdots\\ 2^n+2^{n-2}a\\2^n+2^{n-1}a \end{pmatrix} = \begin{pmatrix} 2^n\\ 2^n\\ 2^n\\ \vdots\\ 2^n\\ 2^n(a+2) \end{pmatrix}, \] the flat rectangular algebra $\kappa[\![\mathbf{u}^{2^n},\mathbf{u}^{2^n+a},\ldots,\mathbf{u}^{2^n+2^{n-1}a}]\!]/\kappa[\![\mathbf{u}^{2^n}]\!]$ is a complete intersection. \end{example} Let $S$ and $T$ be numerical semigroups generated by integers. If $\kappa[\![\mathbf{u}^S]\!]/\kappa[\![\mathbf{u}^p]\!]$ and $\kappa[\![\mathbf{u}^T]\!]/\kappa[\![\mathbf{u}^q]\!]$ are rectangular for some relatively prime numbers $p\in S$ and $q\in T$, then $\kappa[\![\mathbf{u}^{qS+pT}]\!]/\kappa[\![\mathbf{u}^{pq}]\!]$ is rectangular. Indeed, \[ \begin{array}{l} \Apr(\kappa[\![\mathbf{u}^{qS+pT}]\!]/\kappa[\![\mathbf{u}^{pq}]\!])=\\ \\ \{\mathbf{u}^{qw_1+pw_2} \,|\, \mathbf{u}^{w_1}\in \Apr(\kappa[\![\mathbf{u}^S]\!]/\kappa[\![\mathbf{u}^p]\!]) \text{ and } \mathbf{u}^{w_2}\in\Apr(\kappa[\![\mathbf{u}^T]\!]/\kappa[\![\mathbf{u}^q]\!])\}. \end{array} \] See \cite{HK} and also \cite[Proposition~9.11]{GR} for the case of gluing. Given rectangles of $\kappa[\![\mathbf{u}^S]\!]/\kappa[\![\mathbf{u}^p]\!]$ and $\kappa[\![\mathbf{u}^T]\!]/\kappa[\![\mathbf{u}^q]\!]$ with matrices $\log_{\mathbf{Y}_1}{\mathbf{Z}_1}$ and $\log_{\mathbf{Y}_2}{\mathbf{Z}_2}$, the algebra $\kappa[\![\mathbf{u}^{qS+pT}]\!]/\kappa[\![\mathbf{u}^{pq}]\!]$ has a rectangle with the matrix \[ \log_\mathbf{Y}\mathbf{Z}= \begin{pmatrix}\log_{\mathbf{Y}_1}{\mathbf{Z}_1} & 0\\ 0 & \log_{\mathbf{Y}_2}{\mathbf{Z}_2}\end{pmatrix}. \] Clearly, $\log_\mathbf{Y}\mathbf{Z}$ is invertible if and only if $\log_{\mathbf{Y}_1}{\mathbf{Z}_1}$ and $\log_{\mathbf{Y}_2}{\mathbf{Z}_2}$ are invertible. In the absolute case, the existence of rectangles depends on the choice of a Noether normalization. It is possible that $\kappa[\![\mathbf{u}^{qS+pT}]\!]/\kappa[\![\mathbf{u}^r]\!]$ is not rectangular for any $r\in qS+pT$, even though $\kappa[\![\mathbf{u}^S]\!]/\kappa[\![\mathbf{u}^s]\!]$ and $\kappa[\![\mathbf{u}^T]\!]/\kappa[\![\mathbf{u}^t]\!]$ are rectangular for some $s\in S$ and $t\in T$. \begin{example} Let $S=\langle 2,3\rangle$ and $T=\langle 3,4\rangle$. The algebras $\kappa[\![\mathbf{u}^S]\!]/\kappa[\![\mathbf{u}^{12}]\!]$ and $\kappa[\![\mathbf{u}^T]\!]/\kappa[\![\mathbf{u}^{24}]\!]$ have rectangles $\{1,\mathbf{u}^2,\mathbf{u}^4\}\times\{1,\mathbf{u}^3,\mathbf{u}^6,\mathbf{u}^9\}$ and $\{1,\mathbf{u}^4,\mathbf{u}^8\}\times\{1,\mathbf{u}^3,\mathbf{u}^6,\mathbf{u}^9,\mathbf{u}^{12},\mathbf{u}^{15},\mathbf{u}^{18},\mathbf{u}^{21}\}$, respectively. To see that $\kappa[\![\mathbf{u}^{7S+5T}]\!]/\kappa[\![\mathbf{u}^r]\!]$ is not rectangular for any $r\in 7S+5T$, we observe the relation $14+21=15+20$ in $7S+5T=\langle 14,21,15,20\rangle$. If $r\in\{14,15,20,21\}$, the product of two minimal monomials is not Ap\'{e}ry. If $r\not\in\{14,15,20,21\}$, the product of two minimal monomials equals the product of the other two minimal monomials. Both cases can not happen for a rectangle. \end{example} To provide more examples, we present a class of flat rectangular algebras. \begin{prop} Let $a$, $b$ and $4$ be integers with greatest common divisor $1$. Assume that $\mathbf{u}^a$ and $\mathbf{u}^b$ are the minimal monomials of the algebra $\3uRing{4}{a}{b}/\uRing{4}$. Then the algebra is rectangular if and only if one of $a$ or $b$ is even. \end{prop} \begin{proof} If the algebra is rectangular, then its Ap\'{e}ry monomials are $1,\mathbf{u}^a,\mathbf{u}^b$ and $\mathbf{u}^{a+b}$. Assume $a<b$. Since $\mathbf{u}^a$ and $\mathbf{u}^b$ are minimal, the monomial $\mathbf{u}^{2a}$ is not Ap\'{e}ry. So $2a=4r+sb$ for some non-negative integers $r$ and $s$. Then $s\leq 1$. If $s=0$, then $a=2r$ is even. If $s=1$, then $b$ is even. Now assume conversely that the algebra is not rectangular. Then $\mathbf{u}^{a+b}$ is not an Ap\'{e}ry monomial. Otherwise, the Ap\'{e}ry monomials form the rectangle $\{1,\mathbf{u}^a\}\times\{1,\mathbf{u}^b\}$. So $a+b=4r+sa+tb$ for some non-negative integers $r,s,t$. As $\mathbf{u}^a$ and $\mathbf{u}^b$ are minimal, we have $s=t=0$. So $a+b$ is even. Since $a$ and $b$ can not be both even, they have to be both odd. \qed \end{proof} Next section will provide a partial answer to the following questions. \begin{question} Is every flat rectangular algebra a complete intersection? Assume that the Ap\'{e}ry monomials of a flat numerical semigroup algebra form a rectangle. Is the rectangle always non-singular? \end{question} \section{Algebras with Few Minimal Monomials}\label{sec:234} In this section, we work on a rectangle of size $\beta_1\times\cdots\times\beta_n$ of a flat numerical semigroup algebra $R'/R$ for the cases $n=2,3,4$. Let $\mathbf{u}^{s_1},\ldots,\mathbf{u}^{s_n}$ be minimal monomials of $R'/R$. We use the notation \[ \log_\mathbf{Y}\mathbf{Z} \begin{pmatrix} s_1 \\ s_2 \\ \vdots \\s_n \end{pmatrix}= \begin{pmatrix} t_1 \\ t_2 \\ \vdots \\t_n \end{pmatrix} \] as in (\ref{eq:log}), where $Z_\ell=Y_\ell^{\beta_\ell}Y_1^{-\beta_{\ell 1}}\cdots Y_n^{-\beta_{\ell n}}$ and $\mathbf{u}^{t_\ell}\in R$. Consider the case $n=2$. From \[ \begin{pmatrix} \beta_1 & -\beta_{12} \\ -\beta_{21} & \beta_2 \end{pmatrix} \begin{pmatrix} s_1 \\ s_2 \end{pmatrix}=\begin{pmatrix} t_1 \\ t_2 \end{pmatrix}, \] we have a relation \[ (\beta_1-\beta_{21})s_1+(\beta_2-\beta_{12})s_2=t_1+t_2. \] If the numbers $\beta_{21}$ and $\beta_{12}$ were both non-zero, the coefficient $\mathbf{u}^{t_1+t_2}$ would become the Ap\'{e}ry monomial $\mathbf{u}^{(\beta_1-\beta_{21})s_1}\mathbf{u}^{(\beta_2-\beta_{12})s_2}$. Therefore the matrix $\log_\mathbf{Y}\mathbf{Z}$ is triangular for $n=2$. The main result of this section is the case $n=3$. \begin{thm}\label{thm:3min} For a flat rectangular algebra $R[\![\mathbf{u}^{s_1},\mathbf{u}^{s_2},\mathbf{u}^{s_3}]\!]$, the matrix $\log_\mathbf{Y}\mathbf{Z}$ is triangular after a suitable permutation of indices. In particular it is non-singular. \end{thm} \begin{proof} Our proof consists of three steps: (1) $\beta_{ij}\beta_{ji}=0$ for all $i\neq j$. (2) $t_i>0$ for some $i$. (3) $\beta_{ij}=\beta_{ik}=0$ for some $\{i,j,k\}=\{1,2,3\}$. Then we can change indices to that $\beta_{31}=\beta_{32}=0$. With $\beta_{12}\beta_{21}=0$, we may change indices again so that furthermore $\beta_{21}=0$. After these changes of indices, the matrix $\log_\mathbf{Y}\mathbf{Z}$ becomes upper triangular. {\bf Step 1.} We show first that $\beta_{ij}\beta_{ji}=0$ for all $i\neq j$. If not, say $\beta_{12}\beta_{21}\neq 0$, we claim that the conditions $\beta_i=\beta_{ji}+\beta_{ki}$ on columns would hold for all $\{i,j,k\}=\{1,2,3\}$. From \[ \begin{pmatrix} \beta_1 & -\beta_{12} & -\beta_{13} \\ -\beta_{21} & \beta_2 & -\beta_{23}\\ -\beta_{31} & -\beta_{32} & \beta_3\end{pmatrix} \begin{pmatrix} s_1 \\ s_2 \\s_3 \end{pmatrix}=\begin{pmatrix} t_1 \\ t_2\\ t_3 \end{pmatrix}, \] we have a relation \[ (\beta_1-\beta_{21})s_1+(\beta_2-\beta_{12})s_2=(\beta_{23}+\beta_{13})s_3+(t_1+t_2). \] The Ap\'{e}ry monomial $\mathbf{u}^{(\beta_1-\beta_{21})s_1}\mathbf{u}^{(\beta_2-\beta_{12})s_2}$ is divisible by the coefficient $\mathbf{u}^{t_1+t_2}$. Hence $t_1=t_2=0$. If $\beta_{23}+\beta_{13}<\beta_3$, we would have two different factorizations \[ \mathbf{u}^{(\beta_1-\beta_{21})s_1}\mathbf{u}^{(\beta_2-\beta_{12})s_2}=\mathbf{u}^{(\beta_{23}+\beta_{13})s_3} \] of a monomial in the rectangle. Hence $0\leq\beta_{23}+\beta_{13}-\beta_3<\beta_3$ and we have another relation \[ (\beta_1-\beta_{21})s_1+(\beta_2-\beta_{12})s_2= \beta_{31}s_1+\beta_{32}s_2+(\beta_{23}+\beta_{13}-\beta_3)s_3+t_3. \] The Ap\'{e}ry monomial $\mathbf{u}^{(\beta_1-\beta_{21})s_1}\mathbf{u}^{(\beta_2-\beta_{12})s_2}$ is divisible by the coefficient $\mathbf{u}^{t_3}$. Hence $t_3=0$ and \[ \mathbf{u}^{(\beta_1-\beta_{21})s_1}\mathbf{u}^{(\beta_2-\beta_{12})s_2}= \mathbf{u}^{\beta_{31}s_1}\mathbf{u}^{\beta_{32}s_2}\mathbf{u}^{(\beta_{23}+\beta_{13}-\beta_3)s_3}. \] Monomials in the rectangle are distinct. Hence the column conditions $\beta_i=\beta_{ji}+\beta_{ki}$ hold for all $\{i,j,k\}=\{1,2,3\}$. To get a contradiction from $\beta_{12}\beta_{21}\neq 0$, we work on elements of the form $\beta_is_i+\beta_{jk}s_k$, where $\{i,j,k\}=\{1,2,3\}$. By the column conditions, we have \[ \beta_is_i+\beta_{jk}s_k=(\beta_{ji}+\beta_{ki})s_i+\beta_{jk}s_k=\beta_js_j+\beta_{ki}s_i. \] Therefore $\beta_is_i+\beta_{jk}s_k$ represents the same number for any $\{i,j,k\}=\{1,2,3\}$. Write \[ \mathbf{u}^{\beta_is_i}\mathbf{u}^{\beta_{jk}s_k}=\mathbf{u}^t\mathbf{u}^{\alpha_is_i}\mathbf{u}^{\alpha_js_j}\mathbf{u}^{\alpha_ks_k}, \] where $0\leq\alpha_i<\beta_i$, $0\leq\alpha_j<\beta_j$, $0\leq\alpha_k<\beta_k$ and $\mathbf{u}^t\in R$. If $\alpha_i>0$, the Ap\'{e}ry monomial $\mathbf{u}^{(\beta_i-\alpha_i)s_i}\mathbf{u}^{\beta_{jk}s_k}$ is divisible by the coefficient $\mathbf{u}^t$. Then $t=0$ and we would have two different factorizations \[ \mathbf{u}^{(\beta_i-\alpha_i)s_i}\mathbf{u}^{\beta_{jk}s_k}=\mathbf{u}^{\alpha_js_j}\mathbf{u}^{\alpha_ks_k} \] of a monomial in the rectangle. Hence $\alpha_i$ vanishes, and so do $\alpha_j$ and $\alpha_k$. Now $\beta_is_i+\beta_{jk}s_k=t$. By a similar argument, we have $\beta_is_i+\beta_{kj}s_j=t'\in\log_\mathbf{u} R$. For $i=3$, we obtain a contradiction by two different representations \[ \mathbf{u}^{t'}\mathbf{u}^{\beta_{12}s_2}=\mathbf{u}^t\mathbf{u}^{\beta_{21}s_1}. \] {\bf Step 2.} Since $\beta_{12}\beta_{21}=0$, we may assume $\beta_{12}=0$ by changing indices. If $\beta_{13}=0$, then $\det\log_\mathbf{Y}\mathbf{Z}=\beta_1\beta_2\beta_3-\beta_1\beta_{32}\beta_{23}>0$. If $\beta_{13}\neq 0$, then $\beta_{31}=0$ and $\det\log_\mathbf{Y}\mathbf{Z}$ can be computed according to vanishing of $\beta_{32}$: If furthermore $\beta_{32}=0$, then $\det\log_\mathbf{Y}\mathbf{Z}=\beta_1\beta_2\beta_3-\beta_{21}\beta_{12}\beta_3>0$. Otherwise, $\beta_{32}\neq 0$ implies that $\beta_{23}=0$ and $\det\log_\mathbf{Y}\mathbf{Z}=\beta_1\beta_2\beta_3-\beta_{21}\beta_{32}\beta_{13}>0$. In any cases, $\det\log_\mathbf{Y}\mathbf{Z}>0$. Therefore \[ \begin{vmatrix} \beta_1s_1-\beta_{12}s_2-\beta_{13}s_3 & -\beta_{12} & -\beta_{13} \\ -\beta_{21}s_1+\beta_2s_2-\beta_{23}s_3 & \beta_2 & -\beta_{23} \\ -\beta_{31}s_1-\beta_{32}s_2+\beta_3s_3 & -\beta_{32} & \beta_3 \end{vmatrix} =s_1\det\log_\mathbf{Y}\mathbf{Z}>0. \] Recall that the entries of the adjoint of $\log_\mathbf{Y}\mathbf{Z}$ are all non-negative. Hence $t_i=\beta_is_i-\beta_{ij}s_j-\beta_{ik}s_k>0$ for some $\{i,j,k\}=\{1,2,3\}$. {\bf Step 3.} Provided that $\beta_{ij}s_j+\beta_{ik}s_k=\beta_is_i-t_i>0$ for all $\{i,j,k\}=\{1,2,3\}$, we want to get a contradiction. After changing indices, we may assume that $t_3>0$ and $\beta_{21}=0$. Let $\alpha_1$ be a positive integer in $\log_\mathbf{u} R$. Then $\alpha:=\alpha_1s_1\in\log_\mathbf{u} R$. We choose the largest element $s_0\in\log_\mathbf{u} R$ such that there exists a factorization \[ \mathbf{u}^\alpha=\mathbf{u}^{s_0}(\mathbf{u}^{s_1})^{a_1}(\mathbf{u}^{s_2})^{a_2}(\mathbf{u}^{s_3})^{a_3} \] satisfying the condition $s_0<\alpha$. Write $a_1=n_1\beta_1+a'_1$, where $n_1\in{\mathbb{N}}$ and $0\leq a'_1<\beta_1$. Let $a'_2:=a_2+n_1\beta_{12}$ and $a'_3:=a_3+n_1\beta_{13}$. Then we have another factorization \[ \mathbf{u}^\alpha=\mathbf{u}^{s_0+n_1t_1}(\mathbf{u}^{s_1})^{a'_1}(\mathbf{u}^{s_2})^{a'_2}(\mathbf{u}^{s_3})^{a'_3}. \] Since $\beta_{12}s_2+\beta_{13}s_3>0$, the condition $s_0+n_1t_1<\alpha$ still holds. By the maximality of $s_0$, the number $n_1t_1$ has to vanish. Write $a'_2=n_2\beta_2+a''_2$, where $n_2\in{\mathbb{N}}$ and $0\leq a''_2<\beta_2$. Let $a'''_3:=a''_3+n_2\beta_{23}$. Since we assume $\beta_{21}=0$, we have one more factorization \[ \mathbf{u}^\alpha=\mathbf{u}^{s_0+n_2t_2}(\mathbf{u}^{s_1})^{a'_1}(\mathbf{u}^{s_2})^{a''_2}(\mathbf{u}^{s_3})^{a'''_3}. \] The condition $s_0+n_2t_2<\alpha$ still holds from the assumption $\beta_{21}s_1+\beta_{23}s_3>0$. By the maximality of $s_0$ again, the number $n_2t_2$ has to vanish. We claim that $a'''_3<\beta_3$. Otherwise, we would have a factorization \[ \mathbf{u}^\alpha=\mathbf{u}^{s_0+t_3}(\mathbf{u}^{s_1})^{a'_1+\beta_{31}}(\mathbf{u}^{s_2})^{a''_2+\beta_{32}} (\mathbf{u}^{s_3})^{a'''_3-\beta_3} \] contradicting the maximality of $s_0$, since we assume $\beta_{31}s_1+\beta_{32}s_2>0$ and $t_3>0$. As an element in the rectangle, the monomial $(\mathbf{u}^{s_1})^{a'_1}(\mathbf{u}^{s_2})^{a''_2}(\mathbf{u}^{s_3})^{a'''_3}$ is Ap\'{e}ry. Now we have different representations $\mathbf{u}^\alpha\mathbf{u}^0$ and $\mathbf{u}^{s_0}\mathbf{u}^{a'_1s_1+a''_2s_2+a'''_3s_3}$ of $\mathbf{u}^\alpha$. This can not happen in a flat algebra. \qed \end{proof} \begin{cor} A flat rectangular algebra $R[\![\mathbf{u}^{s_1},\mathbf{u}^{s_2},\mathbf{u}^{s_3}]\!]$ is complete intersection. \end{cor} \begin{example}\label{4.4} In the flat algebra $\5uRing{16}{24}{31}{46}{44}/\2uRing{16}{24}$, the set of the Ap\'{e}ry monomials is a rectangle of size $2\times2\times2$ with the relation \[ \begin{pmatrix} 2 & -1 & 0 \\ 0& 2 & -1 \\ 0 & 0 & 2 \\ \end{pmatrix} \begin{pmatrix}31\\46\\44\end{pmatrix}= \begin{pmatrix}16\\2\times24\\4\times16+24\end{pmatrix}. \] The matrix $\log_\mathbf{Y}\mathbf{Z}$ is triangular. \end{example} We define $\log_\mathbf{Y}\mathbf{Z}$ only for flat rectangular algebras. The following algebra is not flat. The corresponding $3\times 3$ matrix is singular. \begin{example} The Ap\'{e}ry monomials of the algebra $\3uRing{3}{5}{7}/\2uRing{17}{19}$ are $1$, $\mathbf{u}^3$, $\mathbf{u}^{18}$, $\mathbf{u}^{21}$ and $\mathbf{u}^s$ for $5\leq s\leq 16$. They form a rectangle of size $4\times2\times2$ with the relation \[ \begin{pmatrix} 4 & -1 & -1 \\ -1& 2 & -1 \\ -3 & -1 & 2 \\ \end{pmatrix} \begin{pmatrix}3\\5\\7\end{pmatrix}= \begin{pmatrix}0\\0\\0\end{pmatrix}. \] \end{example} Using a result of Bresinsky \cite{B}, we have the following result for an algebra with $4$ minimal monomials. \begin{thm} Let $\mathbf{u}^{s_1},\mathbf{u}^{s_2},\mathbf{u}^{s_3},\mathbf{u}^{s_4}$ be the minimal monomials of a rectangular algebra $R'/R$. If $R=\kappa[\![\mathbf{u}^s]\!]$ for some $s$ in the semigroup generated by $s_1,s_2,s_3,s_4$, then $R'/R$ is complete intersection. \end{thm} \begin{proof} We may assume that $s_1,s_2,s_3,s_4$ are integers with the greatest common divisor $1$. In the rectangle of size $\beta_1\times\beta_2\times\beta_3\times\beta_4$, we have relations \[ \beta_is_i=\beta_{ij}s_j+\beta_{ik}s_k+\beta_{il}s_l+\lambda_is \] for $\{i,j,k,l\}=\{1,2,3,4\}$, where $\lambda_i\in{\mathbb{N}}$. Since flat rectangular algebras are Gorenstein, the semigroup $\langle s_1,s_2,s_3,s_4\rangle$ is symmetric. If the algebra is not complete intersection, then \cite[Theorem 3]{B} says \[ (\mathbf{u}^{s_1})^{\alpha_1}(\mathbf{u}^{s_3})^{\alpha_3}=(\mathbf{u}^{s_2})^{\alpha_2}(\mathbf{u}^{s_4})^{\alpha_4} \] for some $0<\alpha_i<c_i$, where $c_i=\min\{n \,|\, 0< ns_i\in\langle s_j ; j\neq i\rangle\}$. Since monomials in the rectangle are distinct, $\alpha_i\geq\beta_i$ for some $i$. Say $\alpha_1\geq\beta_1$. Then $\beta_1<c_1$. Write $s=n_1s_1+n_2s_2+n_3s_3+n_4s_4$, where $n_1,n_2,n_3,n_4\in{\mathbb{N}}$. Then \[ (\beta_1-n_1\lambda_1)s_1=(\beta_{12}+n_2\lambda_1)s_2+ (\beta_{13}+n_3\lambda_1)s_3+(\beta_{14}+n_4\lambda_1)s_4. \] By the minimality of $c_1$, the non-negative number $\beta_1-n_1\lambda_1$ has to vanish. Therefore $\beta_{12}=\beta_{13}=\beta_{14}=n_2\lambda_1=n_3\lambda_1=n_4\lambda_1=0$ and $\lambda_1 s=\beta_1s_1=n_1\lambda_1s_1$. Consequently, $\lambda_1>0$ and $s=n_1s_1$. The monomial $(\mathbf{u}^{s_1})^{\alpha_1}=\mathbf{u}^{\lambda_1 s}(\mathbf{u}^{s_1})^{\alpha_1-\beta_1}$ is not Ap\'{e}ry, nor is $(\mathbf{u}^{s_2})^{\alpha_2}(\mathbf{u}^{s_4})^{\alpha_4}=(\mathbf{u}^{s_1})^{\alpha_1}(\mathbf{u}^{s_3})^{\alpha_3}$. Therefore $\alpha_i\geq\beta_i$ for $i=2$ or $4$. Say $\alpha_2\geq\beta_2$. Then $\beta_2<c_2$ and $\lambda_2s=\beta_2s_2$ by the same argument as above. Now the relation $\beta_2s_2=\lambda_2n_1s_1$ contradicts the minimality of $c_2$. \qed \end{proof} \paragraph{\bf{Acknowledgements}} Part of this work has been developed during the visits of I-Chiau Huang to the Institute for Research in Fundamental Sciences (IPM) and Raheleh Jafari to the Institute of Mathematics, Academia Sinica (IoM) in 2016. Both authors would like to thank IPM and IoM for their hospitality and support. The authors are grateful to Mee-Kyoung Kim for inspiring conversation and comments. Finally we would like to thank the referee for a careful reading of the manuscript and valuable comments and suggestions.
\section{Introduction}\label{sec:intro} Data sets in radio astronomy have increased 1000-fold over the past decade\cite{sabater_datasize}. It is no longer feasible to move, store and process these data sizes at university clusters, nor to process these data manually. LOFAR, the Low-Frequency Array\cite{LOFAR} is a modern and powerful radio telescope that creates more than 5 Petabytes of data per year. At present, the majority of LOFAR time is allocated to several Key Science Projects (KSPs)\cite{lotss}. These projects need to process hundreds or thousands of observations. Typical observations produce approximately 14 TB of archived data. Obtaining high fidelity images from this data requires complex processing steps. To manage and automate the data processing, workflow management software is needed. This software needs to accelerate LOFAR processing on a High Throughput Computing (HTC) cluster while ensuring it is easy to prototype, test, and integrate future algorithms and pipelines. To automate LOFAR data processing, we have worked with the LOFAR Surveys KSP (SKSP). Together, we designed a software suite that integrates LOFAR software\cite{cookbook} with the Dutch grid infrastructure\cite{dutchinfra}. This software, based on Apache Airflow\footnote{\url{https://airflow.apache.org/}}, makes it easy to add future science cases, extend and modify pipelines, include data quality checks, and rapidly prototype complex pipelines. For the SKSP use cases, AGLOW achieves a significant reduction in development time: from months to days, allowing researchers to concentrate on data analysis rather than management of processing. Additionally, and perhaps more importantly, the software versions and repositories used are defined within the workflow. This makes reproducibility an integral part of the AGLOW software. Finally, the software is built to leverage an HTC cluster by seamlessly submitting the processing jobs through the cluster's job submission system\cite{glite}. The work presented here builds on our previous work parallelizing single LOFAR jobs\cite{mechev} on a distributed environment. The majority of processing was done at SURFsara at the Amsterdam Science Park\cite{SurfSara}, which is one of the sites used by the LOFAR Long Term Archive (LTA)\footnote{\url{https://lta.lofar.eu}}. Ongoing efforts include scheduling and processing data at clusters in Pozna\`{n} in Poland and J\"{u}lich in Germany. \textbf{Contributions:} The main features of the AGLOW software are the following: \begin{itemize} \item Integration of the Grid middleware with Apache Airflow, allowing us to dynamically define, create, submit and monitor jobs on the Dutch national e-infrastructure. \item Integration of the LOFAR (LTA) utilities in Airflow, facilitating pipeline developers to automate staging (moving from tape to disk) and retrieval of LOFAR data. \item Integration of the SURFsara storage with Airflow, making LOFAR pipelines aware of the storage layer available at the Dutch national e-infrastructure. \item Ease of creating simple software blocks, with which users can integrate and test their pipelines. \item Storing all software versions and script repositories as part of the workflow to make LOFAR processing reproducible and portable. \end{itemize} \textbf{Outline:} The organization of this manuscript is as follows: We provide background on data processing in radio astronomy and why LOFAR science requires complex workflows and cover workflow management algorithms and capabilities (section \ref{sec:background}). We discuss related work in workflow management (section \ref{sec:related}). In section \ref{sec:AGLOW}, we introduce our software and two use cases. Both of our use cases require acceleration at an HTC cluster and automation by a workflow orchestration software. We follow these examples with details on the integration between LOFAR software, LOFAR data and the resources at SURFsara in Amsterdam in section \ref{sec:extending}. Finally, we discuss our results (sect. \ref{sec:results}) and look ahead to the demands of future LOFAR projects and upcoming telescopes in section \ref{sec:conclusions}. \section{Background}\label{sec:background} This work lies at the intersection of Radio Astronomy and Computer Science. The goal of the study is to leverage the flexibility of an industry standard workflow management software and use CERN's Worldwide Computing Grid\footnote{\url{http://wlcg.web.cern.ch/}} at SURFsara \cite{grid} to accelerate reproducible processing of LOFAR data. A single LOFAR surveys observation is recorded in distinct frequency chunks (henceforth called `subbands'), each of which is uploaded to the LTA as a separate file. Some of the processing steps require the entire frequency information, while others can run independently and operate on a single subband. The latter steps can be easily accelerated on an HTC cluster by taking advantage of the data level parallelism. Multiple scientific projects may desire to run different processing steps on a single LOFAR observation. To minimize time spent on retrieving data from the LTA and eliminate re-processing of data, pipelines for multiple science cases need to be integrated together. This integration should be done by a software that encodes the dependencies between different steps and automatically executes processing steps once their dependencies have been met. Software packages that solve these challenges are called `workflow management software' (see, e.g., \cite{workflow1,workflow2,workflow3}.) \section{Related Work}\label{sec:related} A workflow is described by a set of tasks. The dependencies between these tasks are encoded in a Directed Acyclic Graph (DAG) \cite{dag}. This data structure imposes a strict dependency hierarchy between the tasks \cite{dagalgos}. This means that there exists a well-defined execution order and a well-defined list of dependencies for each task. The execution order is typically determined by algorithms such as Kahn's algorithm \cite{Kahn} or a depth-first search \cite{dfs}. Workflow management software is used in various fields from research to industry. In biology, gene sequencing and analysis pipelines require automation of multiple processing steps. In gene sequencing, Toil\footnote{\url{https://toil.readthedocs.io}} has been successfully used to automate RNA sequence analysis\cite{toil}. Additionally, many software teams in biotech develop their own in-house workflow management software \cite{nextflow}. Currently, we can parallelize a single processing step of the pipeline using the Grid LOFAR Tools (GRID\_LRT\footnote{\url{https://github.com/apmechev/GRID_LRT}}) \cite{mechev}. The LOFAR Surveys science cases incorporate multiple steps with inter-linked dependencies. Resolving these dependencies can be done efficiently by a comprehensive workflow orchestration software. The purpose of such software is to resolve dependencies between the multiple tasks in a workflow, execute these tasks, and track the status, logs, output, and runtime of each task. In astronomy, workflow systems have been developed that are telescope specific, such as ESOReflex\cite{reflex} by the European Southern Observatory. Other projects, such as astrogrid\footnote{http://www.astrogrid.org} and 'Workflow 4Ever'\footnote{http://wf4ever.github.io/ro/}, have either been completed or are no longer supported. The astrogrid project, for example, was a collaboration to create standards, infrastructure, and software for distributed astronomical processing. Its operation phase spanned 2008-2010. Workflow4Ever, likewise, has been out of support since 2013. To ensure continuing support for the LOFAR workflows, we have decided to use a leading enterprise workflow management software, Airflow. Airflow is an open source Python software package developed by Airbnb\footnote{\url{https://www.airbnb.com/}} to manage complex workflows. It encodes workflows in Python and makes it easy to re-use, re-arrange, schedule and execute blocks in a user-defined workflow. Airflow is capable of scheduling and executing workflows by resolving the dependencies between tasks and scheduling these tasks for execution. The software uses a metadata database\footnote{In our case implemented by Postgresql} to retain metadata such as task state, execution date, and output. While Airflow allows building workflows easily from Python and bash functions, it can easily be extended to support custom processing scenarios. Additionally, Airflow conforms to the Common Workflow Language (CWL) \cite{cwl} standard using the \textit{cwl-airflow} package \cite{cwlairflow}, meaning it can execute CWL workflows as well. Finally, Airflow is part of the Apache incubator and upon certification will receive continual support by the Apache software foundation\footnote{https://www.apache.org/}. \section{AGLOW}\label{sec:AGLOW} Complex astronomical pipelines are time consuming to develop and operate. Furthermore, they may evolve rapidly to incorporate new processing techniques or requirements. Migrating these pipelines to a distributed, high throughput environment is often justified, or even required, in order to meet the timelines set by scientific projects. The time saved by running on a cluster must be balanced by the flexibility and development time required to implement or update the scientific pipelines. To address these concerns, we have developed a software package, Automated Grid-enabled LOFAR Workflows (AGLOW)\footnote{\url{https://github.com/apmechev/AGLOW}}. AGLOW is based on Airflow and the LOFAR software and addresses issues with automation and acceleration of LOFAR processing. With AGLOW, we can translate LOFAR pipelines into DAGs. We provide the tools that enable users to easily implement their LOFAR science pipelines and execute them on a distributed architecture. Using these tools, the data processing required by various LOFAR science cases is automated and accelerated. \subsection{AGLOW: Case Study} For our case-study, we have chosen two ways to process LOFAR Surveys data: coverage and depth. The Surveys Key Science Project (SKSP)\cite{lotss} is an ambitious project to map the northern sky at low frequencies using the Dutch LOFAR stations. These maps will help understand the formation and evolution of massive black holes, galaxies, clusters of galaxies and large-scale structure of the Universe. The LOFAR surveys observations consist of several tiers with the widest Tier (Tier 1) covering the whole sky visible from the Northern Hemisphere with 3168 observations of 8 hours each \cite{lotss}. The other tiers (Tier 2, Tier 3) consist of much longer observations of smaller sections of the sky and can collect hundreds of hours of data for a single direction. The deepest single field being analyzed, in collaboration with the EoR group, is the North Celestial Pole (NCP) field which has $\sim$1700 hrs of observations to date. Processing this data will create an image with an unprecedented resolution and sensitivity. Here we have implemented processing pipelines for both the Tier 1 data and Tier 2 data into AGLOW. The scientific importance of these two examples, as well as the large processing requirements, make them ideal candidates for acceleration and automation with AGLOW. \subsubsection{Surveys Project: All Sky Survey}\label{sec:coverage} The main driver for the development of AGLOW and its constituent packages has been the LOFAR SKSP Project. A typical 8-hour observation produces 14 TB of data. This data is eventually reduced to several hundred gigabytes. Data needs to be processed by two pipelines: first by the Direction Independent (DI) pipeline, and then by the Direction Dependent (DD) pipeline. We have split the DI pipeline into four stages, and the DD pipeline into two subsequent stages. Splitting up the pipelines in stages allows speedup through parallelization for the stages that can benefit from data-level parallelism. Additionally, this setup allows fault tolerance and easy re-processing. Current SKSP processing is easily started by launching a new DAG-run in Airflow. Importantly, with AGLOW, adding new functionality to the pipeline is easy and can be done at any time without disrupting current processing. \subsubsection{Deeper Surveys Fields} To create deep images of a single field, minor modifications were made to the processing pipeline described in the previous section. Scripts were included to re-align the data in the frequency axis, and the DD processing steps include an extra final combination step that stacks multiple observations. Being able to rapidly test alternative processing strategies is crucial to creating a deep image of the NCP field. With the success of this project, future deep LOFAR observations will be processed with these pipelines. \subsection{AGLOW: Implementation}\label{sec:implementation} AGLOW combines the LOFAR software, the Grid LOFAR Tools (GRID\_LRT), and Airflow to allow automation and makes large-scale LOFAR processing easily reproducible. The components of the AGLOW software are shown in Fig. \ref{AGLOW_structure}. In this section, we will discuss these components and their functions. \begin{figure}[thpb] \centering \framebox{\parbox{3.3in}{ \includegraphics[width=0.45\textwidth]{figures/AGLOW_structure.png} }} \caption{Design of the AGLOW software, incorporating Airflow, the GRID\_LRT package\cite{mechev} and custom operators designed to integrate LOFAR software, Grid middleware and dCache storage. GRID\_LRT is a software package developed to parallelize single LOFAR jobs at SURFsara. It contains several modules to help set up, and launch jobs on an HTC cluster at SURFsara. Airflow is a stand-alone package by Airbnb, which is extended with several classes that couple Airflow with the Grid infrastructure. These classes are collectively named the AGLOW operators/sensors. } \label{AGLOW_structure} \end{figure} \subsubsection{GRID LOFAR Tools and LOFAR software} We have previously developed tools to create LOFAR jobs and launch them on a distributed infrastructure\cite{mechev}. These tools have matured to a point where it is easy to both plug and play existing scripts and extend the framework to add more complex pipelines. These steps make it possible for a user to batch execute bash or Python scripts on their LOFAR data in parallel. After the scripts are executed, the results are uploaded to shared dCache storage\cite{dcache} at SURFsara\cite{SurfSara}. More complex steps use additional Github repositories, such as the prefactor\footnote{https://github.com/lofar-astron/prefactor} for direction independent calibration or DDF-pipeline\footnotemark{} for direction-dependent calibration and imaging. The sequence of steps is encoded in parameter-set files (parsets), which can be modified and dropped into AGLOW depending on the processing requirements. With AGLOW, we can easily include the DDF-pipeline and prefactor repositories, as well as any other scripts. Since these scripts are tracked by git \cite{torvalds2010git}, a full commit and branch history of the scripts is available. We use this history to make processing reproducible, by using the same git-commit for all LOFAR datasets. In addition to these script repositories, we have integrated the most common software packages used to process LOFAR data with AGLOW. These are the Default Pre-Processing Pipeline (DPPP)\cite{cookbook}, the LOFAR Solutions Tool (LoSoTo), WSclean \cite{wsclean}, AOflagger\cite{aoflag}, CASA\cite{casa}, pyBDSF\cite{bdsf}, DDFacet\cite{tasseDDFacet} and KillMS\cite{smirnov_tasse_KillMS,tassekalman}. \footnotetext{https://github.com/mhardcastle/ddf-pipeline. DDF-pipeline is a leading example of a Direction Dependent calibration pipeline used for LOFAR data. It uses DDFacet \cite{tasseDDFacet}, KillMS \cite{smirnov_tasse_KillMS} and to create high quality images. } \subsubsection{Extending Airflow}\label{sec:extending} Two types of modifications were made to Airflow to allow processing on a Grid environment. First, functions were added to check the number of files located in intermediate grid storage. We use this to decide whether to stage files, or whether enough files have been successfully processed by a previous task. Second, more complex tasks were implemented as Airflow operators or sensors (Figure \ref{AGLOW_Operators}). These tasks include creating job description files, setting up job scripts, launching jobs using the gLite workload management system and monitoring the status of these jobs. Future additions will include operators that evaluate the current cluster workload and make decisions on location to launch the data processing. With the AGLOW package, such tasks are easy to implement without modifying or interrupting processing. This leads to an easily reproducible, intelligent scientific processing that is also efficiently executed and requires minimal interaction. The operators and sensors added to Airflow are shown in Fig. \ref{AGLOW_Operators}. Using AGLOW to accelerate the execution of a pipeline requires deciding how to split the processing to benefit from parallelization. Once the steps to be parallelized are selected, users can add git repositories of scripts to the configuration file. Next, each step is added to a Python script called the DAG file. This file is placed in the Airflow's dags folder, which adds it to AGLOW. To migrate LOFAR workflows to a new server, the DAG and configuration files need to be transferred to the new AGLOW instance. \begin{figure}[thpb] \centering \framebox{\parbox{3.3in}{ \includegraphics[width=0.45\textwidth]{figures/Operators.png} }} \caption{Airflow Operators for Staging LOFAR data, creating job descriptions and submitting jobs to the Dutch grid. On the left is the input given to each operator. `SRM lists' are lists of links to data at the LOFAR LTA or located on the SURFsara dCache storage. Parsets are files specific to `prefactor' and `DDF-pipeline' and define the processing for each pipeline step. Finally, the `Sandbox' and `Token' operators read their parameters from a configuration file. The use of a scripts sandbox and job description tokens is detailed in our previous work\cite{mechev}.} \label{AGLOW_Operators} \end{figure} \subsection{AGLOW: Jobs} Once LOFAR observations are downloaded from the LTA, they are typically processed with several packages before producing a science ready dataset. We have integrated these packages with Airflow to make it easy to create complex LOFAR workflows. Each of the processing steps above requires extra set-up to process on the Dutch Grid infrastructure. The job scripts setup, job description, and job submission are done by the GRID\_LRT package\cite{mechev}. With AGLOW, we automate this setup, enabling users to focus on developing more comprehensive data processing pipelines. Below we outline several possible steps a user can use in their pipeline. \subsubsection{DPPP Parset} The DPPP software is used extensively in LOFAR data processing. It has many capabilities such as flagging bad data, averaging data in time and frequency, and calibrating the data with a sky-model. The input parameters of this software are stored in a text file called a parset. The input data and the DPPP parset are sufficient to define a DPPP execution step. As noted in section \ref{sec:background}, LOFAR data is split in frequency into subbands. Much of the DPPP processing, such as averaging and flagging, can be done independently for each subband, thus they can be processed on independent machines. This parallelization makes these steps a perfect candidate for an HTC cluster. For a dataset that is split into 244 subbands, 244 jobs are launched concurrently. In Airflow, the DPPP parset task is encoded in a DAG (Fig. \ref{fig:NDPPP_DAG}). The DPPP DAG is a linear workflow that consists of the 'sandbox' setup, creation of the job-description documents, uploading of the DPPP parset and job launching and monitoring. \begin{figure}[thpb] \centering \framebox{\parbox{2.5in}{ \includegraphics[width=0.35\textwidth]{figures/NDPPP_DAG.png} }} \caption{Render of the DPPP parset DAG in the Airflow User Interface. This view shows the setup and submission steps. Even this simple DAG can include branching options such as the \texttt{branch\_if\_staging\_needed} task which checks if the data is not staged and stages it. All of the operators in this figure are part of the AGLOW software. Their inputs and outputs are shown in Fig. \ref{AGLOW_Operators}. Using configuration files, the NDPPP DAG can be used by different users for different science cases making it portable and maintainable. These features make reproducible science with LOFAR data easy. } \label{fig:NDPPP_DAG} \end{figure} \subsubsection{WSclean Job} The WSClean\cite{wsclean} package is used to create an image from a LOFAR dataset. This software has a very wide range of parameters options, however, it cannot take a parset file as an input. Instead, the parameters are specified in the command line. In the AGLOW implementation, we parse all the command-line parameters from a text file, referred to as the 'wsclean parset'. This file is added to the jobs in the same way as the DPPP parset, i.e. using the \textit{Token Uploader} Operator. The DAG for the wsclean software uses the same blocks as the DPPP DAG, with different configuration and parset files. The reuse of Airflow operators makes maintainability of all tasks easier. \subsection{Shell/Python Script} Users that require the run of multiple software packages on a single dataset can craft a custom shell or Python script that executes these steps using the LOFAR tools during a single distributed job. This option increases flexibility and minimizes the overhead associated with scheduling and running multiple jobs in sequence. At the workflow orchestration level, we use the same Airflow operators as the above tasks. The script is uploaded to the job description database using the \textit{Token Uploader} Operator. It is executed once the jobs are launched. Currently only the LOFAR Spectroscopy project uses custom shell scripts to process LOFAR data. A recent study of carbon recombination lines used a custom bash script to calibrate and image LOFAR data on the SURFsara \texttt{GINA}\footnote{The \texttt{GINA} cluster is an HTC cluster located at SURFsara integrated with the Dutch Grid initiative. It supports massively parallel processing which is required to efficiently process LOFAR data with \textit{prefactor}. } cluster \cite{pedro}. \subsection{Prefactor parset} The input to the prefactor pipeline software is a parset file which describes a linear workflow. The description of this workflow consists of a list of processing steps and their associated parameters. The `prefactor' package uses the LOFAR software to do the direction-independent calibration of the archived LOFAR datasets. Prefactor steps are executed by the generic pipeline framework\cite{cookbook}. While this framework can run a sequential pipeline, it is not capable of conditional branching nor parallelization on all cluster architectures. The original goal of the GRID\_LRT software was to tackle the parallelization challenge while AGLOW solves the additional challenge of pipeline management. We have already processed more than 50 datasets through the `prefactor' DAG using AGLOW. The full `prefactor' pipeline is shown in figure \ref{SKSP_workflow}. This DAG shows the four processing steps as well as additional Python operators that manage the staging and result verification. \subsection{DDF-pipeline} The final AGLOW DAG is the implementation of the DDF-pipeline repository which is a pipeline that is extensively used by the LOFAR surveys KSP and is described in detail in \cite{lotss}. This pipeline operates on the products of the prefactor pipeline and consists of a series of calibration and imaging loops with the objective of creating a final science quality image. For each of these loops the majority of the processing time is spent in DDFacet\cite{tasseDDFacet} and KillMS\cite{smirnov_tasse_KillMS,tassekalman} steps that perform the direction-dependent imaging and calibration respectively. In total, DDF-pipeline takes $\sim$4\, days of processing to complete. As DDF-pipeline creates large intermediate files we have so far not divided the pipeline into too many steps to avoid filling the storage on the \texttt{GINA} cluster. However, we have split the pipeline into two steps and there is further potential for parallelization that will be implemented in the future. \subsection{Linking Multiple Jobs} Pre-processing of LOFAR SKSP data can be done by a single DPPP task, with 244 jobs running in parallel. More complex LOFAR pipelines will include multiple processing tasks as well as tasks responsible for job setup. Therefore, it is important to facilitate running multi-step pipelines with AGLOW. Creating workflows by defining dependencies between tasks is a core Airflow capability. We use this functionality to link multiple steps of a LOFAR pipeline together. In the SKSP pipeline, we take advantage of the data level parallelism for the initial processing steps for the calibrator and target. The other two steps are run as a single grid job. Switching the parallelization for each step is done by changing the number of datasets per node parameter in the configuration file for each step. \section{Results and Discussions}\label{sec:results} The implementation of AGLOW makes it possible to efficiently process LOFAR data with minimal user interaction. The scheduling algorithm automatically launches pipelines, meaning that there is little time spent between runs. Additionally, controlling/fixing the version of the scripts is done by specifying the commit of each script repository. This makes data processing easily reproducible. Once the dependencies of multiple science pipelines have been encoded in a DAG, Airflow efficiently executes this DAG, running tasks in parallel where possible. The first LOFAR processing pipeline integrated with AGLOW was a single linear workflow, with only one submission to the compute cluster. This workflow is used to reduce the data size making data retrieval to research institutes less time consuming. We offer this workflow as a service to LOFAR users who do not have a high-bandwidth connection to the LOFAR Archive. A more complex pipeline was implemented: the LOFAR direction independent calibration pipeline (`prefactor'). The scientific importance and complexity of this pipeline make it a good case study for the capabilities of the AGLOW software. We show that AGLOW's design allows integration of more complex data processing workflows with the Dutch Grid resources. These workflows can be either used by PIs of LOFAR projects or offered as a processing service to the wider astronomical community. An important feature of AGLOW is the loose coupling between pipeline logic, software versions, pipeline parameters, and datasets. The goal of this decoupling is to give users complete control over all the processing variables. With AGLOW, one can develop the pipeline logic independently of the LOFAR software versions and conversely update the LOFAR software and script repositories independently from the pipeline logic. Finally, the Airflow operators are themselves decoupled from the scientific pipelines. As these operators are reused, this decoupling makes them easy to maintain and extend. In large part thanks to their flexibility, automation, and Grid integration, AGLOW and GRID\_LRT have become a standard part of the Direction Independent processing for the LOFAR SKSP project. \section{Conclusions}\label{sec:conclusions} In this work, we have detailed a comprehensive workflow management software for processing radio astronomy data on a distributed infrastructure. We leverage an industry standard workflow management software, Airflow. Using its capabilities, we make it possible to build, test, automate and deploy LOFAR pipelines on short timescales, generally from months to days. With the flexibility of Airflow's Python and Bash operators, users can design their own workflows, as well as co-ordinate more complex science cases. In this way, AGLOW facilitates reproducible processing of scientific data. In the future, AGLOW will support additional LOFAR science cases including Long Baselines and Spectroscopy. In this article, we have described our implementation of the data processing pipelines used by the LOFAR Surveys Key Science Project. Future work includes further de-coupling of the Grid-setup and pipeline logic. We will do this by creating `sub-dags' (details in \ref{sec:Subdags}) for each type of LOFAR jobs. Using these sub-dags will reduce the complexity of scientific workflows while also making the code even more reusable and thus easier to maintain and upgrade. Efforts to integrate processing at the other two LTA sites, (J\"{u}lich and Pozna\'{n}) have already started with `prefactor' runs being performed on J\"{u}lich using a modified version of the SKSP workflow. The software also currently works on the Eagle cluster at Pozna\'{n}. Combining the J\"{u}lich and SURFsara workflows will be done in the future so that AGLOW can track and start processing at multiple clusters. Finally, AGLOW can be used as a `LOFAR As A Service' model. In this model, users only provide an observation ID and processing parameters and receive the final results upon job completion. This model will build upon previous success offering LOFAR processing to users without login to the \texttt{GINA} cluster \cite{oonk_prep}. This previous work was already useful for studying radio absorption in Cassiopeia A \cite{maria} and a `data-to-images' service will be valuable to the whole LOFAR community. Our experience with automating LOFAR scientific workflows on a distributed architecture will be valuable when setting up data processing for future Radio Telescopes such as the Square Kilometer Array \cite{ska} . \section*{APPENDIX} \begin{figure*}[!ht] \centering \includegraphics[width=0.52\textwidth]{figures/SKSP_Dag1.png} \caption{Workflow for the prefactor pipeline. Here we show the reuse of AGLOW operators for the four prefactor steps. In addition to the LOFAR processing, we also have conditional operators to skip processing of the calibrator if it has been previously processed. This is done by the `branch\_if\_cal\_exists' task. We also have a final step that checks if all the results have been uploaded, done by the `all\_files\_done' task. Likewise, quality checks can be added in this workflow wherever needed.} \label{SKSP_workflow} \end{figure*} The LOFAR SKSP workflow is shown in Figure \ref{SKSP_workflow}. This figure shows how reuse of the staging, setup operators, and glite-wms sensors makes maintainability easy and allows rapid prototyping of complex pipelines. This workflow additionally takes advantage of Airflow's \textit{PythonOperator} to check if the LOFAR data is on disk at the archive and whether all final products were uploaded by each step. AGLOW also allows for staging the calibrator and target files concurrently. When the data is staged, Airflow continues with the processing of that data. \subsection{Sub-DAG}\label{sec:Subdags} Airflow allows developers to include entire DAGs as a single task in their workflow. Airflow can trigger a DAG execution based on parameters provided by the parent DAG. This feature makes it possible to concatenate short, commonly used tasks into DAGs and call them in a parent workflow. Using sub-DAGS makes the code more maintainable and easy to use, while it makes workflows simpler. For LOFAR, Sub-DAGs are used to automate job submission, making the resulting scientific workflows simpler. \section*{Acknowledgement} APM would like to acknowledge the support from the NWO/DOME/IBM programme ``Big Bang Big Data: Innovating ICT as a Driver For Astronomy'', project \#628.002.001. The processing and storage functionality that has made this project possible was enabled by SURF Cooperative through grant e-infra 160022 \& 160152. The LOFAR software and dedicated reduction packages on \url{https://github.com/apmechev/GRID_LRT} were deployed on the e-infrastructure by the LOFAR e-infra group, consisting of J.B.R. Oonk (SURFsara \& Leiden Observatory), A.P. Mechev (Leiden Observatory). This paper is based on data obtained with the International LOFAR Telescope (ILT) under project codes LC2\_038 and LC3\_008. LOFAR (van Haarlem et al. 2013) is the Low-Frequency Array designed and constructed by ASTRON. It has observing, data processing, and data storage facilities in several countries, which are owned by various parties (each with their own funding sources), and which are collectively operated by the ILT foundation under a joint scientific policy. The ILT resources have benefited from the following recent major funding sources: CNRS-INSU, Observatoire de Paris and Universit\'{e} d’Orl\'{e}ans, France; BMBF, MIWF-NRW, MPG, Germany; Science Foundation Ireland (SFI), Department of Business, Enterprise and Innovation (DBEI), Ireland; NWO, The Netherlands; The Science and Technology Facilities Council (STFC), UK \bibliographystyle{unsrt}
\section{Introduction} Recently, \cite{Younes2016} reported the discovery of a nebula surrounding the magnetar Swift J1834.9-0846. The fact that this system has the highest efficiency of all pulsar wind nebulae (PWNe) known was considered to be highly unusual: $\sim 10\%$ of the mild spin-down power of the pulsar, $L_{sd} \sim 10^{34}$ erg s$^{-1}$, is emitted just in soft X-rays. This promoted interpretations based on a transfer, via a yet unknown mechanism, of magnetic energy into particle acceleration \citep{Granot2017}. However, we demonstrated that the multifrequency data, as well as its size, could be encompassed by a normal, rotationally-powered PWN under the condition that it is entering in reverberation \citep{Torres2017}. The latter is a relatively short but important phase in the evolution of all PWNe, produced when the reverse shock created by the supernova explosion travels back toward the pulsar, compressing the wind bubble, see, e.g., \cite{Slane2017}, for a review. This compression heats the PWN, reducing its size, and increasing the magnetic field. Such evolution leads, as we see below, to an almost complete burn-off of the electron population. Despite the obvious importance of this phase, it is not yet usual that radiative models of PWNe consider it. In fact, the effect of reverberation upon the spectral results has been dealt with only in a few scattered occasions, and with different levels of detail, see, e.g., \cite{Gelfand2009,Vorster2013,Bandiera2014,Bucciantini2011,Martin2016,Torres2017}. Here we aim at studying the radiative properties of the reverberation phase in detail. For this, we shall study the future reverberation period of well-characterized PWNe. We shall prove that the 10\% efficiency found for Swift J1834.9-0846 is not a limit at any rate, not even for this very pulsar, finding that all PWNe can have periods of superefficiency from radio to gamma-rays. \section{PWN evolution} We use the code TIDE 2.3, which has been described in detail in \cite{Martin2016, Torres2017}. Here we only add subroutines appropriate to compute efficiencies as a function of time, as described below. The main components and features of the model, apart that it takes into account the variation of the spin-down power, $L_{sd}$, according to a given value of braking index, $n$, are as follows: \begin{itemize} \item The injection function for pairs is assumed as a broken power law, powered by the pulsar. The model computes the time-evolution of the distribution subject to synchrotron, inverse Compton, and Bremsstrahlung interactions, adiabatic losses or heating, and accounting for escaping particles. Expressions for the radiative losses can be found in \cite{Martin2012}. \item The magnetic field of the nebula is also powered by the rotational power (the instantaneous injection is the fraction of spin-down that goes to power the magnetic field, $\eta$). The field varies in time as a result of the balance between this power and the adiabatic losses or gains of the field due to the expansion or contraction of the PWN \citep{Torres2013b}. \item The size of the PWN is computed according to age, progenitor explosion energy, medium density, velocity, and pressure of the supernova ejecta at the position of the PWN shell. We take into account that the latter profiles change if the PWN shell is surrounded by unshocked ejecta (thus the radius of the PWN is smaller than the radius of the reverse shock of the SNR, $R < R_{rs}$), or by shocked ejecta (where $R_{rs} < R < R_{snr}$, being $R_{snr}$ the radius of the SNR). After reverberation, when the PWN pressure reaches that of the SNR, a Sedov expansion follows. Details are explicit in \S3 of \cite{Martin2016}. \end{itemize} The theoretical approach described is able to cope well with multifrequency data of known nebulae. The red curves in the top panels of Fig. \ref{time_evolution} shows the spectral energy distribution (SEDs) of the six PWNe (Crab, G09, G21, G54, Kes75, and J1834) that we take as examples in this work, at their corresponding age today as fixed or deduced from observations. The parameters for each model, together with the relevant pulsar's observational data are given in Table 1. Notation for all the parameters follows that usually found in the literature, and in any case, is consistent with that used by us before \citep{Martin2016,Torres2017}. We divide parameters in Table 1 among measured or assumed, derived, and fitted values. Apart of these parameters we assume the following usual ones for all PWNe/SNR complexes: energy of the explosion $E_{SN}=10^{51}$ erg, interstellar medium density $\rho_{ISM}=0.5 $ cm$^{-3}$, SNR density index = 9, PWN adiabatic index = 1.333, and SNR adiabatic index = 1.667. We also consider the cosmic microwave background with $T_{cmb} = 2.73$ K and $\omega_{cmb}=0.25$ eV cm$^{-3})$. As expected, small variation in the fitted parameters are found when compared with similar models but that do not take into account reverberation \cite{Torres2014}. Note that all PWNe studied are now relatively young, and considered to be free-expanding except for J1834. All other nebulae, such as Crab itself, will enter into reverberation sometime in their future. We choose these young nebulae (rather than other more mature) on purpose: as we shall see, reverberation is a very sensitive process, leading to a strong evolution where most of the electron population is wiped out. Since we are actually interested in the reverberation process itself, fixing the model parameters before this process happens makes more sense than doing it long after it ends. \begin{figure*} \centering \hspace{-0.5cm} \includegraphics[width=0.35 \textwidth]{crab_sedevo.eps}\hspace{-0.4cm} \includegraphics[width=0.35 \textwidth]{G09_sedevo.eps} \hspace{-0.5cm} \includegraphics[width=0.35 \textwidth]{G21_sedevo.eps} \\ \hspace{-0.5cm} \includegraphics[width=0.35 \textwidth]{G54_sedevo.eps}\hspace{-0.4cm} \includegraphics[width=0.35 \textwidth]{kes75_sedevo.eps} \hspace{-0.5cm} \includegraphics[width=0.35 \textwidth]{1834_sedevo.eps}\\ \hspace{-0.5cm} \includegraphics[width=0.35 \textwidth]{crab_elecevo.eps}\hspace{-0.4cm} \includegraphics[width=0.35 \textwidth]{G09_elecevo.eps}\hspace{-0.4cm} \includegraphics[width=0.35 \textwidth]{G21_elecevo.eps}\\ \hspace{-0.5cm} \includegraphics[width=0.35 \textwidth]{G54_elecevo.eps}\hspace{-0.4cm} \includegraphics[width=0.35 \textwidth]{kes75_elecevo.eps}\hspace{-0.4cm} \includegraphics[width=0.35 \textwidth]{1834_elecevo.eps} \\ \caption{Spectral energy and electron distributions of the modelled PWNe along time. Each panel shows the evolution at different moments of interest for each nebula ($t_1 \ldots t_4)$, which are introduced and discussed in the text, and includes also the results at the age today for comparison. The colored shadows in the electron panels note the Lorentz factor whose synchrotron-emitted characteristic energy is in the X-ray band (0.1--10 keV) for the nebular magnetic field value at $t_1$ (black), $t_2$ (orange) and $t_3$ (blue), respectively. The shadows in the SEDs note the radio (1.4 GHz), X-rays (0.1-10 keV), GeV (0.1-10 GeV), and TeV (1-10 TeV) bands used to compute the corresponding luminosities. } \label{time_evolution} \end{figure*} Fig. \ref{time_evolution} shows the time evolution of the model fitting the current data for each of the PWNe considered. The two sets of panels show the electron and spectral energy distributions along time. A strong time evolution is expected. The times shown are chosen within and around the corresponding reverberation period of each PWN, and correspond to the times of the maximum PWN radius, $t_1=t(R_{max})$, the maximum of the X-ray efficiency, $t_2=t($Eff$^{max}_{X})$, the minimum PWN radius, $t_3=t(R_{min})$, and a later time already at the Sedov phase, $t_4=t(@Sedov)$. Specific values for these times along the PWNe evolution of each nebula are also given in Table 1. The X-ray efficiency (and correspondingly, radio, GeV, and TeV efficiencies as well) are defined as the ratio of the luminosity emitted in a given frequency range at a given time with respect to the spin-down power at that same time, e.g., Eff.$_X (t) = L_X(t) / L_{sd}(t)$. If at a time $t$ we measure this ratio to be larger than 1, we shall say the PWN is superefficient. \section{Superefficiency} \begin{figure*} \centering \hspace{-0.5cm} \includegraphics[width=0.35 \textwidth]{crab_eff-rad.eps}\hspace{-0.4cm} \includegraphics[width=0.35 \textwidth]{G09_eff-rad.eps}\hspace{-0.4cm} \includegraphics[width=0.35 \textwidth]{G21_eff-rad.eps}\\ \hspace{-0.5cm} \includegraphics[width=0.35 \textwidth]{crab_eff-rad-zoom.eps}\hspace{-0.4cm} \includegraphics[width=0.35 \textwidth]{G09_eff-rad-zoom.eps}\hspace{-0.4cm} \includegraphics[width=0.35 \textwidth]{G21_eff-rad-zoom.eps} \\ \hspace{-0.5cm} \includegraphics[width=0.35 \textwidth]{G54_eff-rad.eps}\hspace{-0.4cm} \includegraphics[width=0.35 \textwidth]{kes75_eff-rad.eps} \hspace{-0.5cm} \includegraphics[width=0.35 \textwidth]{1834_eff-rad.eps}\\ \hspace{-0.5cm} \includegraphics[width=0.35 \textwidth]{G54_eff-rad-zoom.eps}\hspace{-0.4cm} \includegraphics[width=0.35 \textwidth]{kes75_eff-rad-zoom.eps} \hspace{-0.5cm} \includegraphics[width=0.35 \textwidth]{1834_eff-rad-zoom.eps} \caption{Evolution of the PWNe efficiencies in X-rays (0.1-10 keV), GeV (0.1-10 GeV), and TeV (1-10 TeV) and PWN radii along time. The second and fourth rows zooms around the reverberation period, as shown in the corresponding global evolution panels. % } \label{super} \end{figure*} Fig. \ref{super} shows the time evolution of the calculated efficiencies in radio (1.4 GHz), X-rays (0.1-10 keV), GeV (0.1-10 GeV), and TeV (1-10 TeV), together with the PWN radii. % Table 1 shows the timescale for the duration of reverberation ($t(R_{min})-t(R_{max})$), the minimum radius, and the maximum magnetic field attained, as well as the properties of any superefficiency period in radio, X-rays, GeV, or TeV energies (maximum efficiency, Eff.$^{max}$; duration, Dos; and the time at which the maximum efficiencies happen, $t($Eff.$^{max}$)). We also show the time $t_4$ in the Sedov expansion used in the figures as an example of the spectra in this regime, and values of the magnetic field at different times of interest. Reverberation brings a significant evolution in a short period of time. Plotting efficiencies rather than distributions makes this evolution more clear. The X-ray efficiency has several stages of increase and decrease, which can be used to define different phenomenological phases. We call them phases a to c, for reference. We distinguish these phases via the following subsequent events: Phase a has the PWN in free expansion, and lasts from the pulsar birth to the maximum of the nebula radius (at $t_1$). Phase b finishes at the maximum of the X-ray efficiency (at $t_2$). Phase c finishes at the minimum of the radius (at $t_3$). Phase d is the Sedov expansion, assumed to continue after $t_3$. % We use different background colours in Fig. \ref{super} to distinguish these phases. % Their spectral and electron properties at these times were shown in Fig. \ref{time_evolution}. % Note that in some cases, phase c is too short to be visible without a zoom in the reverberation period, as shown in the second and fourth rows of Fig. \ref{super}. % Fig. \ref{super} shows that even the Crab nebula, associated to the more energetic pulsar of the sample we study, has a period in its future time evolution where, e.g., the X-ray luminosity will exceed the spin-down power at the time. In fact, all PWNe in our sample are expected to have a period of radio, X-ray, and GeV superefficiency, and all but Crab and J1834, will also have a period of TeV superefficiency. The finding of superefficiency at all frequencies dramatically shows how dangerous it is to rule out a pulsar of a given spin-down power as a possible origin of nebula whose radio, X-ray, GeV, or even TeV luminosity exceeds it. The zoomed panels in Fig. \ref{super} show that the moments at which the maximum efficiencies are attained are close but not exactly the same at different frequencies. This is a natural result of having electrons of different energies contributing to the photon spectrum at different frequencies. The number of electrons at a given energy is in turn a result of a balance between gains (via adiabatic heating) and losses (via radiation and escape) and the peak number is attained at different times for different energies. We also note that there is a variety of possibilities regarding which of the maximum efficiencies is the largest. Sometimes, like the case of J1834 and Kes 75, the largest maximum efficiency occurs for the X-rays. In others, for more energetic pulsars like Crab, G09, or G21, it occurs at the GeV band. The evolution of the radio efficiency is quite similar for all PWNe. It shows a sharp peak happening close to the time of maximum of the compression. In this small time scale around $t_3$, all the PWNe studied become superefficient in radio. However, the maximum efficiency attained in the radio band is typically smaller than that reached at higher frequencies, see Table 1. \begin{figure*} \centering \includegraphics[width=0.32\textwidth]{crab_t2t3elec.eps} \includegraphics[width=0.32\textwidth]{crab_t2t3sync.eps} \includegraphics[width=0.32\textwidth]{crab_t2t3ssc.eps} \includegraphics[width=0.32\textwidth]{G09_t2t3elec.eps} \includegraphics[width=0.32\textwidth]{G09_t2t3sync.eps} \includegraphics[width=0.32\textwidth]{G09_t2t3ssc.eps} \includegraphics[width=0.32\textwidth]{G54_t2t3elec.eps} \includegraphics[width=0.32\textwidth]{G54_t2t3sync.eps} \includegraphics[width=0.32\textwidth]{G54_t2t3ssc.eps} \includegraphics[width=0.32\textwidth]{1834_t2t3elec.eps} \includegraphics[width=0.32\textwidth]{1834_t2t3sync.eps} \includegraphics[width=0.32\textwidth]{1834_t2t3ssc.eps} \caption{Details of the time evolution of the electron distribution and the synchrotron and self-synchrotron Compton contribution to the photon spectrum around the time of minimum radii and maximum efficiency, between $t_2$ and $t_3$ in the corresponding panels of Figure \ref{time_evolution}. Times are color-coded as described in the left panels. % } \label{super-detail} \end{figure*} The zoomed panels of Fig. \ref{super} can actually be considered as a proxy for the evolution of the luminosities themselves, in arbitrary units. In such a short period of time, the change of the spin-down power is small. In these zoomed panels, we note the appearance of a second peak in the X-ray efficiency for most of the cases studied (of which those appearing in Crab and G09 are examples). When such second peak happens, it is closer to the time of the minimal radius. Whereas this second peak is however only a local maximum, with the absolute largest X-ray efficiency happening at earlier times, it may also provide a second -and shorter- superefficiency period in some cases. In the zoomed panels of Fig. \ref{super}, we marked on some exemplary cases (Crab, G09, G54, and J1834) several times of interest between the times of the maximum of the X-ray efficiency and its second local maximum. At these times, we plotted the electron distribution, the synchrotron and self-synchrotron Compton contribution to the photon spectrum in Fig. \ref{super-detail}. This figure shows how the synchrotron-related processes dominate the shape of the spectrum at both low and high energies (compare Fig. \ref{super-detail} with the corresponding total SED shown in Fig. \ref{time_evolution}). This is particularly obvious when the two peaks in the SED appear clearly distinguished in energy, at the time of maximum efficiency $t_2$. \begin{figure*} \centering \includegraphics[width=0.32\textwidth]{crab_losses.eps} \includegraphics[width=0.32\textwidth]{G09_losses.eps}\\ \includegraphics[width=0.32\textwidth]{G54_losses.eps} \includegraphics[width=0.32\textwidth]{1834_losses.eps} \caption{Timescales for the adiabatic heating and the energy losses via synchrotron radiation. The black dots mark the interval of Lorentz factors emitting synchrotron photons with characteristic energies in the X-ray band. The green dot marks the same for radio (synchrotron photons with characteristic energies at 1.4 GHz). The curves are color-coded as in Fig. \ref{super-detail}. } \vspace{1cm} \label{losses} \end{figure*} We note that the maximum of the X-ray efficiency does not occur at the minimum of the radius, but at a time in between the start of reverberation and the latter. This is in remarkable agreement with a result from analytical considerations earlier done by Bandiera (2014). This happens in all cases studied, and is a result of the energetic balance: a competence between electron heating by the nebular compression and how fast electrons escape or are cooled down via the emission of synchrotron radiation. The more compressed is the nebula, electrons are cooled down faster (via synchrotron radiation in a larger magnetic field), and a smaller number of electrons are actually available to emit in X-rays. The competition between gains by adiabatic heating and losses by synchrotron along the critical time period is shown in Fig. \ref{losses}. They depict the timescales for energy gains and losses at the same times in which the corresponding SEDs and electron distributions were shown earlier. It can be seen that during most of the compression, synchrotron radiation has a shorter timescale than heating for the Lorentz factors of interest, and quickly burns off the electron population in all PWNe. This is consistent with the SEDs being dominated by synchrotron and self-synchrotron emission, and with the appearance of a second peak in the X-ray efficiency, as further discussed below. Fig. \ref{super-detail} and \ref{losses} also show the interval of Lorentz factors emitting synchrotron photons with characteristic energies ($\nu_c=({3}/{4\pi}) \gamma^2 ({eB}/{mc})$) between 0.1 and 10 keV (noted with black dots), and radio (1.4 GHz, noted with green dots). The Lorentz factors of interest for the emission of photons at these bands change significantly along the time evolution, even in this limited time extent, due to the strong variation in the magnetic field. This was also summarily shown in Fig. \ref{time_evolution}, where we showed these intervals at $t_2=t($Eff$^{max}_{X})$ and $t_3=t(R_{min})$. For these Lorentz factors of interest, and along the period shown, the number of electrons uniformly decreases, due to the cooling domination. At the beginning of phase c the peak of the synchrotron contribution to the SED, shown in the middle panel of Fig. \ref{super-detail}, is close to the X-ray band of interest, affecting the value of efficiency just as a consequence of the band selection. If, instead, we would be interested in the hard X-ray luminosity above 100 keV, the X-ray synchrotron flux would uniformly increase with time. In addition of the X-ray luminosity variation via synchrotron, the X-ray flux is also affected by self-synchrotron emission, see the second and third panels of Fig. \ref{super-detail}. The latter radiation process dominates the production of the second peak. It happens at times when the comptonized synchrotron spectrum actually peaks in X-rays instead than in gamma-rays. When it does, the flux in X-rays produced by self synchrotron Compton emission may be one order of magnitude larger than that produced by synchrotron emission directly. This emphasizes how important it is to consider the self-synchrotron Compton process along the evolution of all nebulae, even when at later times it may be, usually, completely irrelevant. Note that when they happen, these second peaks occur closer to (but still before) the minimum of the radius. Note too that the GeV (and TeV) maximum efficiency happens always after the X-ray one. The reason for all this is the same, and is related to the fact that the self-synchrotron emission, which we compute following with the formulae given in the Appendix of Martin et al. (2012), is quadratic in the number of electrons, inversely quadratic in the size of the nebula, and linear in the field. The electrons influence is thus larger for self-synchrotron emission, given that they are also accounted in the photon target distribution. However, the maximum efficiency moves towards later times when compared to the X-ray one since for a longer time the reduction of particles is compensated by the increase in the field and the decrease in the radius. With reverberation wiping electrons off quickly, once the maximum of the GeV luminosity is attained and starts to decrease, there is no possible compensation to the loss of electrons. There is no second peak in GeV or TeV energy bands because at these energy bands there is only one dominant process generating the SED, and the recovery can only happen when a sufficient number of high energy electrons are rebuilt by the pulsar. \section{Concluding remarks} Here, we have shown that supereffiency periods in which the luminosity at a given band from radio to TeV exceeds the pulsar spin-down power, are common. They are unavoidably associated with the reverberation process. Supereffiency happens because when the PWNe are reverberating, the spin-down power is no longer the energy reservoir. In these cases, the nebulae are receiving energy from the environment, and the spin-down power is, a priori, not determinant to judge detectability at any band. Observing one such superefficient system would be amazing: a bright, small or point-like nebula, with a spatially coincident pulsar many times less energetic. The difficulty for observing them is that such systems can be maintained only for a few hundred years. For the estimate that follows, let us assume that the superefficiency period roughly lasts about 300 years in the evolution of young nebulae, of typically $<10000$ years of age (although note that as the G54 case tells, supernova with large ejected masses or low density environments can produce reverberation beyond this age). Assuming a pulsar birthrate of 3 century$^{-1}$ \citep{Faucher2006}, 300 PWNe were born within the last $10000$ years, and from these, we are interested in a period equivalent to --at most-- 3\% of their evolution. Taking into account the correspondingly shorter percentages for pulsars born at different centuries, we have a probability of $\sim 1\%$ of finding one these pulsars in the right period of their evolution. Thus we expect at most 3 PWNe in a superefficient stage in the Galaxy today. This should be taken rather as an upper limit, because it assumes it is equally probable to have reverberation at any time within the first 10000 years of a pulsar (thus neglecting that there is no reveberation in their free-expansion phases). In a future work, we shall focus on observational strategies for finding superefficient or highly efficient PWNe. Note that our model assumes no morphological shape for the PWN; they are described with a time-varying radius. If the compression is asymmetric or turbulence develops, superefficiency could be less effective, detaining the reduction in the PWN size and the increment in the field perhaps before our results indicate. This might affect less energetic nebulae in particular, such as Kes 75 or J1834, being likely unimportant for others such as G09, G21 or Crab. Magneto-hydrodynamical simulations will verify on this issue. In any case, $R_{min}$ is many orders of magnitude larger than the pulsar's radius, or even the pulsar's magnetosphere (typically at least 6 orders of magnitude larger than the size of a young pulsar's light cylinder), and thus the inner workings of the pulsed emission via synchro-curvature radiation \citep{Torres2018}, is not expected to be significantly affected even in the most severe of the compressions. \acknowledgements This research was supported by the grants AYA2015-71042-P, SGR2017-1383, iLink 2017-1238, and the National Natural Science Foundation of China via NSFC-11473027, NSFC-11503078, NSFC-11133002, NSFC-11103020, NSFC-11673013, XTP project XDA 04060604 and the Strategic Priority Research Program ``The Emergence of Cosmological Structures" of the Chinese Academy of Sciences, Grant No. XDB09000000. \begin{table*} \renewcommand{\arraystretch}{0.7}% \scriptsize \centering \caption{Physical parameters used by, and resulting from the fits. } \begin{tabular}{lllllllll}\hline\hline PWN & & {\red {Crab Nebula }} & {\red {G0.9+0.1 }} & {\red { G21.5-0.9 }} & {\red {G54.1+0.3 }} & {\red {G29.3-0.3 }} & {\red {J1834.9-0846 }} & \\ referred to as & & {\red {Crab }} & {\red {G09 }} & {\red { G21 }} & {\red {G54 }} & {\red {Kes 75 }} & {\red {J1834 }} & \\ \hline \hline {\blue {Measured or assumed }}\\ \hline $t_{age}$ & [years] & 960 & 2000 & 870 & 1700 & 700 & 7970 &\\ ${P}(t_{age})$ & [ms] &33.40 &52.2 &61.86 &136 &324 &2480 &\\ $\dot{P}(t_{age})$ & [s s$^{-1}$] &$4.2\times10^{-13}$&$1.5\times10^{-13}$&$2.0\times10^{-13}$&$7.5\times10^{-13}$&$7.1\times10^{-12}$&$7.96\times10^{-12}$&\\ $n$ & \ldots & 2.509 & 3 & 3 & 3 & 2.16 & 2.2 &\\ $D$ & [kpc] & 2.0 & 8.5 & 4.7 & 6 & 6 & 4 &\\ \hline {\blue { Derived }}\\ \hline $\tau_{0}$ & [years] & 758 & 3305 & 3985 & 1171 & 547 & 280 &\\ $B_s$ & [G] & $4.68\times10^{12} $ & $2.91\times10^{12} $ & $3.58\times10^{12} $ & $1.01\times10^{13} $ & $8.19\times10^{13} $ & $1.43\times10^{14} $ &\\ $L_{sd}(t_{age})$ & [erg s$^{-1}$] &$4.5\times10^{38}$ &$4.3\times10^{37}$ &$3.4\times10^{37}$ &$1.2\times10^{37}$ &$8.2\times10^{36}$ &$2.1\times10^{34}$ &\\ $L_{0}$ & [erg s$^{-1}$] & $3.0\times10^{39}$ & $1.1\times10^{38}$ & $5.0\times10^{37}$ & $7.2\times10^{37}$ & $7.7\times10^{37}$ & $1.74\times10^{38}$ &\\ \hline {\blue {Fitted parameters}}\\ \hline $M_{ej}$ & [M$_{\odot}$] & 9.0 & 11 & 8 & 20 & 6 & 11.3 &\\ $T_{fir}$ & [K] & 70 & 30 & 35 & 20 & 25 & 25 &\\ $\omega_{fir}$ & [eV cm$^{-3}$] & 0.1 & 2.5 & 1.4 & 2.0 & 2.5 & 0.5 &\\ $T_{nir}$ & [K] & 5000 & 3000 & 3500 & 3000 & 5000 & 3000 &\\ $\omega_{nir} $ & [eV cm$^{-3}$] & 0.3 & 25 & 5.0 & 1.1 & 1.4 & 1.0 &\\ $\gamma_b$ & \ldots & $9\times10^5$ & $1.0\times10^5$ & $1.0\times10^5$ & $5.0\times10^5$ & $2.0\times10^5$ & $1.0\times10^7$ &\\ $ \alpha_l$ & \ldots & 1.5 & 1.4 & 1.0 & 1.2 & 1.4 & 1.0 &\\ $\alpha_h$ & \ldots & 2.54 & 2.7 & 2.5 & 2.8 & 2.3 & 2.1 &\\ $\epsilon$ & \ldots & 0.27 & 0.2 & 0.2 & 0.3 & 0.2 & 0.6 &\\ $\eta$ & \ldots & 0.02 & 0.01 & 0.04 & 0.005 & 0.008 & 0.045 &\\ \hline {\blue {Resulting features}}\\ \hline Rev. Timescale & [years] & 3201.7 & 1703.9 & 1028.86 & 2242.61 & 674.679 & 1037.906 &\\ $t_1=t(R_{max})$ & [years] & 3640 & 5341 & 4549 & 9619 & 4007 & 7336 & \\ $r_{min}$ & [pc] & $9.8\times10^{-2}$ & $3.2\times10^{-3}$ & $7.3\times10^{-3}$ & $1.3\times10^{-4}$ & $7.5\times10^{-5}$ & $5.5\times10^{-4}$ &\\ $B_{max} = B_{t_3}$ & [G] & $5.6\times10^{-2}$ & $14.7$ & $4.7$ & $2.0\times10^{3}$ & $3.9\times10^{3}$ & $1.4\times10^{2}$ &\\ Eff.$^{max}_{\rm r}$ & \ldots & 4.1 & 41.9 & 7.2 & 106.9 & 905.5 & 14.9 &\\ Dos$_{\rm r}$& [years] & 150 & 12.2 & 4.0 & 4.0 & 3.9 & 1.0 &\\ $t($Eff.$^{max}_{\rm r})$ & [years] & 6834.2 & 7041.8 & 5575.8 & 11860.8 & 4682.5 & 8373.5 &\\ Eff.$^{max}_{X}$ & \ldots & 2.9 & 54.2 & 36.8 & 5464 & 23523 & 5444 &\\ Dos$_{X}$ & [years] & 800 & 327 & 237 & 342 & 129 & 316 &\\ $t_2=t($Eff$^{max}_{X})$ & [years] & 5700 & 6900 & 5450 & 11807 & 4668 & 8337 &\\ Eff.$^{max}_{\rm GeV}$ & \ldots & 11.7 & 1180 & 100.8 & 6541 & 22681 & 5.5 &\\ Dos$_{\rm GeV}$ & [years] & 439 & 127 & 67 & 58 & 24 & 8 &\\ $t($Eff$^{max}_{\rm GeV})$ & [years] & 6500 & 7007 & 5547 & 11847 & 4680 & 8366 &\\ Eff.$^{max}_{\rm TeV}$ & \ldots & 0.9 & 72.4 & 6.6 & 1193 & 0.01 & 1.00 &\\ Dos$_{\rm TeV}$& [years] & \ldots & 92 & 37 & 147 & 29 & 5 &\\ $t($Eff.$^{max}_{\rm TeV})$ & [years] & 6250 & 6960 & 5510 & 11832 & 4680 & 8356 &\\ $t_3=t(R_{min})$ & [years] & 6841.7 & 7044.9 & 5577.9 & 11861.6 & 4682.7 & 8373.9 &\\ $t_4=t(@Sedov)$ & [years] & 8011.4 & 8002.9 & 5993.1 & 13025.7 & 5007.6 & 8988.8 & \\ $B_{t_4}$ & [G] & $2.2\times10^{-4}$ & $2.2\times10^{-4}$ & $2.7\times10^{-4}$ & $1.7\times10^{-4}$ & $3.0\times10^{-4}$ & $2.1\times10^{-4}$ &\\ $B_{today}$ & [G] & $1.1\times10^{-4}$ & $1.4\times10^{-5}$ & $8.5\times10^{-5}$ & $1.2\times10^{-5}$ & $2.5\times10^{-5}$ & $4.9\times10^{-6}$ &\\ \hline \end{tabular} \label{table1} \end{table*}
\section{Introduction} The Neumann-Poincar\'e (abbreviated by NP) operator is a boundary integral operator which appears naturally when solving classical boundary value problems using layer potentials. Its study goes back to C. Neumann \cite{Neumann-87} and Poincar\'e \cite{Poincare-AM-87} as the name of the operator suggests. Lately interest in the spectral properties of NP operator is growing rapidly, which is due to their relation to plasmonics \cite{ACKLM, AMRZ, MFZ}, and significant progress is being made among which are work on continuous spectrum in two dimensions \cite{BZ, HKL, KLY, PP2} and Weyl asymptotic of eigenvalues in three dimensions \cite{Miya} to name only a few. However, there are still several puzzling questions on the NP spectrum (spectrum of the NP operator). A question on existence of negative NP eigenvalues in three dimensions is one of them. Unlike two-dimensional NP spectrum which is symmetric with respect to $0$ and hence there are the same number of negative eigenvalues as positive ones (see, for example \cite{HKL, KPS}), not so many surfaces (boundaries of three-dimensional domains) are known to have negative NP eigenvalues. In fact, NP eigenvalues on spheres are all positive, and it is only in \cite{Ahner} which was published in 1994 that the NP operator on a very thin oblate spheroid is shown to have a negative eigenvalue. We emphasize that the NP eigenvalues on ellipsoids can be found explicitly using Lam\'e functions for which we also refer to \cite{AA, FK, Mart, Ritt}. As far as we are aware of, there is no surface other than ellipsoids known to have a negative NP eigenvalue. It is the purpose of this paper to present a simple geometric condition which guarantees existence of a negative NP eigenvalue. To present the condition, let $\Omega$ be a bounded domain with the $C^{1,\alpha}$ boundary for some $\alpha>0$. We say $\partial\Omega$ is concave with respect to $p \in \Omega$ if there is a point $x \in \partial\Omega$ such that \begin{equation}\label{concave} (x-p) \cdot \nu_x <0, \end{equation} where $\nu_x$ denotes the outward unit normal vector to $\partial\Omega$. We emphasize that if $\partial\Omega$ is $C^2$, then this condition is fulfilled if there is a point on $\partial\Omega$ where the Gaussian curvature is negative. In fact, if $(x-p) \cdot \nu_x \ge 0$ for all $p \in \Omega$ and $x \in \partial\Omega$, then $\Omega$ is convex and hence the Gaussian curvatures on $\partial\Omega$ are non-negative. We prove in this paper that if the concavity condition \eqnref{concave} holds for some $p \in \Omega$, then the NP operator defined either on $\partial\Omega$ or the surface of inversion with respect $p$ has at least one negative eigenvalue (see Theorem \ref{mainthm1} and Corollary \ref{mainthm2}). We emphasize that \eqnref{concave} is not a necessary condition for existence of a negative NP eigenvalue; oblate spheroids have negative NP eigenvalues as mentioned before. This paper is organized as follows. We review in section \ref{sec:main} the definition of the NP operator and state main results of this paper. Section \ref{sec:proof} is to prove the transformation formula for the NP operator under the inversion in a sphere. We use this formula to prove the main results. \section{The NP operator and statements of main results}\label{sec:main} Let $\Gamma(x)$ be the fundamental solution to the Laplacian, {\it i.e.}, \begin{equation}\label{gammacond} \Gamma (x) = \begin{cases} \displaystyle \frac{1}{2\pi} \ln |x|, \quad & d=2, \\ \noalign{\smallskip} \displaystyle -\frac{1}{4\pi |x|}, \quad & d = 3. \end{cases} \end{equation} As before, let $\Omega$ be a bounded domain with the $C^{1,\alpha}$ boundary for some $\alpha>0$. The single layer potential $\mathcal{S}_{\partial \Omega} [\varphi]$ of a density function $\varphi$ is defined by \begin{equation} \mathcal{S}_{\partial \Omega} [\varphi] (x):= \int_{\partial \Omega} \Gamma (x-y) \varphi (y) \, d\sigma(y), \quad x \in \mathbb{R}^d. \end{equation} It is well known (see, for example, \cite{AmKa07Book2, Fo95}) that $\mathcal{S}_{\partial \Omega} [\varphi]$ satisfies the jump relation \begin{equation}\label{singlejump} \frac{\partial}{\partial\nu} \mathcal{S}_{\partial \Omega} [\varphi] \Big|_\pm (x) = \biggl( \pm \frac{1}{2} I + \mathcal{K}_{\partial \Omega}^* \biggr) [\varphi] (x), \quad x \in \partial \Omega, \end{equation} where $\frac{\partial}{\partial\nu}$ denotes the outward normal derivative, the subscripts $\pm$ indicate the limit from outside and inside of $\Omega$, respectively, and the operator $\mathcal{K}_{\partial \Omega}^*$ is defined by \begin{equation}\label{introkd} \mathcal{K}_{\partial \Omega}^* [\varphi] (x):= \int_{\partial \Omega} \nu_x \cdot \nabla_x \Gamma(x-y) \varphi(y)\,d\sigma(y), \quad x \in \partial \Omega. \end{equation} The operator $\mathcal{K}_{\partial \Omega}^*$ is called the NP operator associated with the domain $\Omega$ (or its boundary $\partial\Omega$). The operator $\mathcal{S}_{\partial\Omega}$, as an operator on $\partial\Omega$, maps $H^{-1/2}(\partial\Omega)$ into $H^{1/2}(\partial\Omega)$ continuously, and is invertible if $d=3$. If $d=2$, then there are domains where $\mathcal{S}_{\partial\Omega}$ has one-dimensional kernel, but by dilating the domain, it can be made to be invertible (see \cite{Verch-JFA-84}). So, the bilinear form $\langle \cdot,\cdot \rangle_{\partial\Omega}$, defined by \begin{equation}\label{innerp} \langle \varphi,\psi \rangle_{\partial\Omega}:= -\langle \varphi, \mathcal{S}_{\partial \Omega}[\psi] \rangle, \end{equation} for $\varphi, \psi \in H^{-1/2}(\partial \Omega)$, is actually an inner product on $H^{-1/2}(\partial \Omega)$ and it yields the norm equivalent to usual $H^{-1/2}$-norm (see, for example, \cite{KKLSY}). Here, $H^s$ denotes the usual $L^2$-Sobolev space of order $s$ and $\langle \cdot, \cdot \rangle$ is the $H^{-1/2}$-$H^{1/2}$ duality pairing. We denote the space $H^{-1/2}(\partial \Omega)$ equipped with the inner product $\langle \cdot,\cdot \rangle_{\partial\Omega}$ by $\mathcal{H}^*$. It is proved in \cite{KPS} that the NP operator $\mathcal{K}_{\partial \Omega}^*$ is self-adjoint with respect to the inner product $\langle \cdot,\cdot \rangle_{\partial\Omega}$. In fact, it is an immediate consequence of Plemelj's symmetrization principle \begin{equation}\label{Plemelj} \mathcal{S}_{\partial \Omega} \mathcal{K}^*_{\partial \Omega} = \mathcal{K}_{\partial \Omega} \mathcal{S}_{\partial \Omega}. \end{equation} Here $\mathcal{K}_{\partial \Omega}$ is the adjoint of $\mathcal{K}^*_{\partial \Omega}$ with respect to the usual $L^2$-inner product. Since $\mathcal{K}_{\partial \Omega}^*$ is compact on $\mathcal{H}^*$ if $\partial\Omega$ is $C^{1,\alpha}$, it has eigenvalues converging to $0$. For a fixed $r>0$ and $p \in \mathbb{R}^d$, let $T_p : \mathbb{R}^d \setminus \{p\} \rightarrow \mathbb{R}^d \setminus \{p\}$, $d =2,3$, be the inversion in a sphere, namely, \begin{equation} T_p x := \frac{r^2}{|x-p|^2} (x-p) + p. \end{equation} For a given bounded domain $\Omega$ in $\mathbb{R}^d$, let $\partial \Omega_p^*$ be the inversion of $\partial \Omega$, {\it i.e.}, $\partial \Omega_p^*= T_p(\partial \Omega)$. If we invert $\Omega$ in spheres of two different radii, then the resulting domains are dilations of each other. Since NP spectrum is invariant under dilation as one can see easily by a change of variables, we may fix the radius of the inversion sphere once for all. The following is the main results of this paper. \begin{theorem}\label{mainthm1} Let $\Omega$ be a bounded domain whose boundary is $C^{1,\alpha}$ smooth for some $\alpha>0$. If the concavity condition \eqnref{concave} holds for some $p \in \Omega$, then either $\mathcal{K}_{\partial\Omega}^*$ or $\mathcal{K}_{\partial\Omega_p^*}^*$ has a negative eigenvalue. \end{theorem} We have the following corollary as an immediate consequence of Theorem \ref{mainthm1}. \begin{cor}\label{mainthm2} Suppose $\partial\Omega$ is $C^{2}$ smooth. If there is a point on $\partial\Omega$ where the Gaussian curvature is negative, then either $\mathcal{K}_{\partial\Omega}^*$ or $\mathcal{K}_{\partial\Omega_p^*}^*$ for some $p \in \Omega$ has a negative eigenvalue. \end{cor} \section{Inversion in a sphere}\label{sec:proof} Just for simplicity we now assume the center $p$ of the inversion sphere is $0$, and denote $\partial\Omega_p^*$ and $T_p$ by $\partial\Omega^*$ and $T$, respectively. Let $x^*:= Tx$. Since $$ \frac{\partial x_i}{\partial x^*_j} = \frac{r^2 \delta_{ij}}{|x^*|^2} - 2r^2 \frac{x^*_i x^*_j}{|x^*|^4}, $$ the Jacobian matrix of $T^{-1}$ is given by \begin{equation}\label{Jacobian} J_{T^{-1}} = \frac{r^2}{|x^*|^2} \Big(I - 2\frac{x^*}{|x^*|}\frac{(x^*)^t}{|x^*|} \Big) = \frac{|x|^2}{r^2} \Big(I - 2\frac{x}{|x|}\frac{x^t}{|x|} \Big). \end{equation} Here $t$ denotes transpose. So, $T$ is conformal. The change of variable formulas for line and surface are respectively given as follows: \begin{align} & ds(x^*) = \frac{r^2}{|x|^2} ds(x), \label{line}\\ & dS(x^*) = \frac{r^4}{|x|^4} dS(x). \label{surface} \end{align} It is known (see \cite{MacMillan-book}) that \begin{align} |x^*-y^*| = \frac{r^2}{|x||y|} |x-y|. \end{align} So we have \begin{equation}\label{tildefund} \Gamma(x^*-y^*) = \begin{cases} \Gamma(x-y) -\Gamma(x) -\Gamma(y) + \Gamma(r^2) &\text{if } d = 2, \\ \noalign{\smallskip} \displaystyle \frac{|x||y|}{r^2} \Gamma(x-y) &\text{if } d = 3. \end{cases} \end{equation} For a function $\varphi$ defined on $\partial\Omega$, define $\varphi^*$ on $\partial\Omega^*_p$ by \begin{equation}\label{inversionfunc} \varphi^*(y^*) := \varphi (y) \frac{|y|^d}{r^d}. \end{equation} Then, we can easily see using \eqref{tildefund} that the following relation between the single layer potentials on domains $\partial \Omega$ and $\partial\Omega^*$ holds (see also \cite{MacMillan-book}): \begin{equation}\label{singleform} \mathcal{S}_{\partial\Omega^*} [ \varphi^* ](x^*) = \begin{cases} \mathcal{S}_{\partial \Omega} [\varphi](x) - \mathcal{S}_{\partial \Omega} [\varphi](0) + \Big( \displaystyle \int_{\partial\Omega} \varphi ds \Big) \big(\Gamma(r^2) - \Gamma(x)\big) &\text{if } d = 2, \\ \displaystyle \frac{|x|}{r} \mathcal{S}_{{\partial \Omega}} [ \varphi ](x) &\text{if } d = 3 . \end{cases} \end{equation} We note that the map $\varphi \mapsto \varphi^*$ is a conformal map from $\mathcal{H}^*(\partial \Omega)$ to $\mathcal{H}^*(\partial \Omega^*)$, in three dimensions, that is, \begin{equation} \langle \varphi^*, \psi^* \rangle_{\partial\Omega^*} = \langle \varphi, \psi \rangle_{\partial\Omega}. \end{equation} This relation is also true in two dimensions if $\varphi$ and $\psi$ are of mean zero. The relationship between outward unit normal vectors $\nu_{x^*}$ on $\partial\Omega^*$ and $\nu_x$ on ${\partial \Omega}$ are given as follows: \begin{equation}\label{normalform} \nu_{x^*} = (-1)^m \Big( I - 2\frac{x}{|x|} \frac{x^t}{|x|} \Big) \nu_x, \end{equation} where $m = 1$ if $0$ is an exterior point of $\Omega$ and $m= 0$ if $0$ is an interior point of $\Omega$. We emphasize that $0$ is the inversion center. The NP operators $ \mathcal{K}^{*}_{\partial \Omega}$ and $\mathcal{K}^{*}_{\partial\Omega^*}$ are related in the following way: \begin{lemma} \label{tildNP} Suppose that $0$ is the center of the inversion sphere. \begin{itemize} \item[(i)] If $0 \in \Omega$, then \begin{equation} \label{tildNPinterior} \mathcal{K}^{*}_{\partial\Omega^*} [ \varphi^* ](x^*) = \begin{cases} \displaystyle -\frac{|x|^2}{r^2} \mathcal{K}^{*}_{\partial \Omega} [ \varphi ](x) + \Big( \int_{\partial \Omega} \varphi ds \Big) \frac{ x \cdot \nu_x }{2\pi r^2} \quad &\text{if } d = 2, \\ \noalign{\smallskip} \displaystyle -\frac{|x|^3}{r^3} \mathcal{K}^{*}_{\partial \Omega} [ \varphi ](x) - \frac{|x|(x \cdot \nu_x)}{r^3} \mathcal{S}_{{\partial \Omega}} [ \varphi ](x) \quad &\text{if } d = 3. \end{cases} \end{equation} \item[(ii)] If $0 \in \overline{\Omega}^c$, then \begin{equation} \label{tildNPexterior} \mathcal{K}^{*}_{\partial\Omega^*} [ \varphi^* ](x^*) = \begin{cases} \displaystyle \frac{|x|^2}{r^2} \mathcal{K}^{*}_{\partial \Omega} [ \varphi ](x) - \Big( \int_{\partial \Omega} \varphi ds \Big) \frac{x \cdot \nu_x}{2\pi r^2} \quad &\text{if } d = 2, \\ \noalign{\smallskip} \displaystyle \frac{|x|^3}{r^3} \mathcal{K}^{*}_{\partial \Omega} [ \varphi ](x) + \frac{|x|(x \cdot \nu_x)}{r^3} \mathcal{S}_{{\partial \Omega}} [ \varphi ](x) \quad &\text{if } d = 3. \end{cases} \end{equation} \end{itemize} \end{lemma} \begin{proof} Since the difference of proofs for \eqnref{tildNPinterior} and \eqnref{tildNPexterior} is just the sign of the normal vector, we only prove the first one. If $d=2$, we use \eqnref{Jacobian}, \eqnref{line}, \eqnref{tildefund}, \eqnref{inversionfunc}, and \eqnref{normalform} to have \begin{align*} \mathcal{K}^{*}_{\partial\Omega^*} [ \varphi^* ](x^*) &= \int_{\partial\Omega^*} \nu_{x^*} \cdot \nabla_{x^*} \Gamma(x^* - y^*) \varphi^*(y^*) \; ds(y^*) \\ &= \int_{{\partial \Omega}} - \Big( I - 2\frac{x}{|x|} \frac{x^t}{|x|} \Big) \nu_x \cdot J_{T^{-1}}^t \nabla_{x} \Big( \Gamma(x-y) -\Gamma(x) \Big) \varphi (y) \; ds(y) \\ &= \int_{{\partial \Omega}} - \nu_x \cdot \Big( I - 2\frac{x}{|x|} \frac{x^t}{|x|} \Big)^t J_{T^{-1}}^t \nabla_{x} \Big( \Gamma(x-y) -\Gamma(x) \Big) \varphi (y) \;ds(y) \\ &= - \frac{|x|^2}{r^2} \int_{{\partial \Omega}} \nu_x \cdot \Big( \nabla_x \Gamma(x-y) - \nabla_x \Gamma(x) \Big) \varphi (y) \; ds(y) \\ &= -\frac{|x|^2}{r^2} \mathcal{K}^{*}_{\partial \Omega} [ \varphi ](x) + \Big( \int_{\partial \Omega} \varphi ds \Big) \frac{x \cdot \nu_x}{2\pi r^2}. \end{align*} The three-dimensional case can be proved similarly. In fact, we have \begin{align*} \mathcal{K}^{*}_{\partial\Omega^*} [ \varphi^* ](x^*) &= \int_{\partial\Omega^*} \nu_{x^*} \cdot \nabla_{x^*} \Gamma(x^* - y^*) \; \varphi^*(y^*) \; dS(y^*) \\ &= \int_{{\partial \Omega}} - \Big( I - 2\frac{x}{|x|} \frac{x^t}{|x|} \Big) \nu_x \cdot J_{T^{-1}}^t \nabla_{x} \Big( \frac{|x||y|}{r^2} \Gamma(x-y) \Big) \varphi (y) \; \frac{r}{|y|}dS(y) \\ &= \int_{{\partial \Omega}} - \nu_x \cdot \Big( I - 2\frac{x}{|x|} \frac{x^t}{|x|} \Big)^t J_{T^{-1}}^t \nabla_{x} \Big( \frac{|x||y|}{r^2} \Gamma(x-y) \Big) \varphi (y) \; \frac{r}{|y|}dS(y) \\ &= - \frac{|x|^2}{r} \int_{{\partial \Omega}} \nu_x \cdot \Big( \frac{|x|}{r^2} \nabla_x \Gamma(x-y) + \frac{x}{r^2|x|}\Gamma(x-y) \Big) \varphi (y) \; dS(y) \\ &= \displaystyle -\frac{|x|^3}{r^3} \mathcal{K}^{*}_{\partial \Omega} [ \varphi ](x) - \frac{|x|(x \cdot \nu_x)}{r^3} \mathcal{S}_{{\partial \Omega}} [ \varphi ](x). \end{align*} This completes the proof. \end{proof} If $\varphi$ is an eigenvector of $\mathcal{K}^{*}_{\partial \Omega}$ with corresponding eigenvalue $\lambda \neq 1/2$, then $\int_{\partial \Omega} \varphi ds=0$. So \eqnref{inversionfunc} and Lemma \ref{tildNP} for $d=2$ show that $\varphi^*$ is an eigenvector of $\mathcal{K}^{*}_{\partial\Omega^*}$ and the corresponding eigenvalue is $-\lambda$ if $0\in \Omega$ and $\lambda$ if $0 \in \overline{\Omega}^c$. Since the spectrum $\sigma(\mathcal{K}^{*}_{\partial \Omega})$ of the NP operator in two dimensions is symmetric with respect to $0$, we infer that $\sigma(\mathcal{K}^{*}_{\partial\Omega^*}) = \sigma(\mathcal{K}^{*}_{\partial \Omega})$, namely, the spectrum is invariant under inversion. This fact is known \cite{Schi}, but the above yields an alternative proof. In three dimensions, we obtain the following identities. \begin{prop}\label{tildeNPinnerprod} Suppose $d=3$ and $0$ is the center of the inversion sphere. \begin{itemize} \item[(i)] If $0 \in \Omega$, then \begin{equation}\label{inverform1} \langle \mathcal{K}^{*}_{\partial\Omega^*} [ \varphi^* ], \varphi^* \rangle_{\partial\Omega^*} + \langle \mathcal{K}^{*}_{\partial \Omega} [ \varphi ], \varphi \rangle_{\partial\Omega} = \int_{\partial \Omega} \frac{x \cdot \nu_x}{|x|^2} | \mathcal{S}_{{\partial \Omega}} [ \varphi ](x)|^2 \; dS. \end{equation} \item[(ii)] If $0 \in \overline{\Omega}^c$, then \begin{equation}\label{inverform2} \langle \mathcal{K}^{*}_{\partial\Omega^*} [ \varphi^* ], \varphi^* \rangle_{\partial\Omega^*} - \langle \mathcal{K}^{*}_{\partial \Omega} [ \varphi ], \varphi \rangle_{\partial\Omega} = -\int_{\partial \Omega} \frac{x \cdot \nu_x}{|x|^2} | \mathcal{S}_{{\partial \Omega}} [ \varphi ](x)|^2 \; dS. \end{equation} \end{itemize} \end{prop} \begin{proof} The identity follows from \eqnref{singleform} and \eqnref{tildNPinterior} immediately. In fact, we have \begin{align*} \langle \mathcal{K}^{*}_{\partial\Omega^*} [ \varphi^* ], \varphi^* \rangle_{\partial\Omega^*} &= -\int_{\partial\Omega^*} \mathcal{K}^{*}_{\partial\Omega^*} [ \varphi^* ](x^*) \; \overline{\mathcal{S}_{\partial\Omega^*} [ \varphi^* ](x^*)} dS(x^*) \\ &= \int_{\partial \Omega} \Big( \frac{|x|^3}{r^3} \mathcal{K}^{*}_{\partial \Omega} [ \varphi ](x) + \frac{|x|(x \cdot \nu_x)}{r^3} \mathcal{S}_{{\partial \Omega}} [ \varphi ](x) \Big) \overline{\mathcal{S}_{{\partial \Omega}} [ \varphi ](x)} \frac{r^3}{|x|^3} dS(x) \\ &= -\langle \mathcal{K}^{*}_{\partial \Omega} [ \varphi ], \varphi \rangle_* + \int_{\partial \Omega} \frac{x \cdot \nu_x}{|x|^2} \; | \mathcal{S}_{{\partial \Omega}} [ \varphi ](x) |^2 dS(x), \end{align*} which proves \eqnref{inverform1}. \eqnref{inverform2} can be proved similarly. \end{proof} \medskip We are now ready to prove Theorem \ref{mainthm1}. \noindent{\sl Proof of Theorem \ref{mainthm1}}. Suppose $\Omega$ satisfies \eqnref{concave} at $p \in \Omega$. Without loss of generality we assume that $p=0$. Then there is $x_0 \in \partial\Omega$ such that $x_0 \cdot \nu_{x_0} <0$. Choose an open neighborhood $U$ of $x_0$ in $\partial \Omega$ so that $x \cdot \nu_x <0$ for all $x \in U$. Since $\mathcal{S}_{\partial\Omega}: H^{-1/2}(\partial\Omega) \to H^{1/2}(\partial\Omega)$ is invertible in three dimensions (see \cite{Verch-JFA-84}), we may choose $\varphi \neq 0$ so that $\mathcal{S}_{\partial\Omega}[\varphi]$ is supported in $U$. We then infer from \eqnref{inverform1} that $$ \langle \mathcal{K}^{*}_{\partial\Omega^*} [ \varphi^* ], \varphi^* \rangle_{\partial\Omega^*} + \langle \mathcal{K}^{*}_{\partial \Omega} [ \varphi ], \varphi \rangle_{\partial\Omega} <0. $$ Therefore, the numerical range of either $\mathcal{K}^{*}_{\partial\Omega^*}$ or $\mathcal{K}^{*}_{\partial \Omega}$ has a negative element. It implies that either $\mathcal{K}^{*}_{\partial\Omega^*}$ or $\mathcal{K}^{*}_{\partial \Omega}$ has at least one negative eigenvalue. This completes the proof. $\Box$ \section*{Acknowledgement} We thank Yoshihisa Miyanishi for many inspiring discussions.
\section{Introduction} Blockchain is the backend of decentralized digital currencies one famous example of which is Bitcoin\cite{ref_article1}. Compared with traditional systems, blockchain has such features as being decentralized and immutable. According to the survey paper Bitcoin and Beyond\cite{ref_article5}, blockchain creatively combines existing contributions from decades of research to solve the foundational problem of passing the value over Internet. Now Blockchain has become well-known and widespread. The field has gradually broadened, several limitations and disadvantages of the original design are showing up, one of the problems concerning the scalability of capacity and performance. The earliest famous example of blockchain network jam happened in a blockchain based game named CryptoKitties in 2017. Too many people were trying to purchase CryptoKitties over Ethereum\cite{ref_article7} network, soon Ethereum was exceeding its maximum processing capacity, all the transactions over Ethereum were delayed. So far, Bitcoin\cite{ref_article1} and Ethereum\cite{ref_article7} have met the Transactions Per Second(TPS) bottom neck of performance. Both of them are looking for improvement solution. New protocol needs to be carried out as the new solution should address the previous blockchain's disadvantages. Commercial applications relay on the high performance blockchain. Most of public chain requires the ability to handle user requests from around the world. So the performance matters. Limited open literature to date has reported, few studies have yielded in this field and the attempt to increase the performance was rarely made in academic world either. In contrast, many industrial blockchain products claim the performance as their products selling points, most of them approaching higher performance by tweaking blockchains parameters. There are only a few systematical methods that have been carried out, such as Bitcoin-NG\cite{ref_article2} (see below), Bitshares\cite{ref_article3}/EOS, IoTA and earlier DagCoin\cite{ref_article4}. It is worth while mentioning that in paper Bitcoin-NG\cite{ref_article2}: A Scalable Blockchain Protocol, improvement was made by leader election. Nevertheless, only one leader was allowed to operate on the blockchain at one moment, which made the operation sequential, the capacity and performance still are a significant challenge. Based on this idea, we proposed this method to increase the blockchain performance. For a high performance blockchain protocol which can increase the fundamental performance, data structure change is required. The chain data structure and Proof of Work algorithm are designed like a single-user operation system, only one user is allowed to touch the blockchain data. In our experiment, the parallel mining could visibly increase the TPS. Meanwhile, multi leaders could increase the network stability, to prevent the situation of network jam by no miners available. Changing data structure from chain to graph can allow more than one leaders to mine parallelly. The graph data structure was named GraphChain in this experiment. GraphChain and parallel mining changed the blockchain to a multi-users operation system, more than one leaders was allowed to contribute their computing resources. It also benefited transaction confirm time. This paper details the new protocol of a blockchain system. The key contribution of this work is the solution which provides a method to build a blockchain with practical performance. The new data structure plays the flexible role of framework and the new mining mechanism increases the overall performance. The outcome could be use scenario, such as a micro transactions system, blockchain with big data or a new generation banking system. \section{Model and Goal} It is well established that a blockchain system is consisted with N full nodes. Full node comes with the whole history transactions information, and the nodes are connected with reliable peer-to-peer network. Meanwhile there are M miners waiting for transaction requests and being ready to pack the transaction data into blockchain. In the classic blockchain, the whole Miners are competing to solve a mathematics puzzle by iterating a number called nonce. The puzzle has a target with certain difficulty. When the puzzle is solved, a new block will be created. The recent transactions are packed into the new block. As will be described below, several problems has been discovered on this model: 1. Most of the power energy for calculation is wasted, as too much competition results in only one winner. Allowing one winner only means this miner acts like a central lock to limit the blockchains performance. 2. The transactions need to wait for the next new block generation to be confirmed. It means transactions can not be finished in real time. The construction of a better-performing blockchain system can be done by simply tweaking the blockchain parameters, for example increasing block size. However, from a technical survey's\cite{ref_article5} point, imply changing block size or time interval of block can not increase the performance and capacity all the way. There is a bottle neck from other aspects, such as ”the full node size limitation” or ”too much chain node forking”. Therefore a radically different design/model is needed to overcome this limitation. The researchers increased the performance and the capacity systemically and designed architecture that includes the data structure, mining mechanism and storage partition. See the concrete process of this experiment below: 1. Changed the current chain data structure into graph data structure. The changing of fundamental data structure made the following mechanism (see the 2rd below) improvement possible. 2. Changed the single miner to multiple miners for parallel mining. This improved the performance of blockchain and transactions would be handle in shortened time. The key contribution of this work was that it improved the performance of blockchain and transactions would be handle in shorten time. 3. Data shard. While the TPS was increased by parallel mining, data shard got the blockchain to store more transactions across different nodes. The full node would no longer exist as each node may store a different part of the whole transactions history. This process of this experiment showed that the goal of changing the data structure to GraphChain was to break the central lock of traditional blockchain system, to get the scalable blockchain performance by parallel mining, increasing TPS and reducing transactions conformation time. \section{Chain and Graph} \begin{figure}[htbp] \includegraphics[width=\linewidth]{graphchain_color.pdf} \caption{The structure of GraphChain} \label{fig1} \end{figure} As is well-known the chain data structure has been widely used in Bitcoin\cite{ref_article1} and other products. Directed acyclic graph(DAG) was used in IoTA and DagCoin\cite{ref_article4}. The GraphChain data structure idea was inspired from DAG. The main reason to change the data structure is to find a way to replace sequential operations with parallel operations. The data structure GraphChain is showed in Fig 1. GraphChain is a customized data structure, it's not a typicial DAG. The block usually has two inputs and two outputs, and the block represents the accounts' status after transaction. Another important point is that the inputs have the direction. If it's a sending account, it should connect to the input point above. Hence, the receiving account should be connected with the input point below. Unlike chains, GraphChain don't need to pack the transactions into a single thread. With GraphChain, transactions can be added in parallel by different miners. \section{Parallel Mining} The new mechanism is proposed to choose m (numbers of) leaders among M (as many as possible) miners world wide. In paper Bitcoin-NG\cite{ref_article2}, leader was introduced. Miners used to get rewarded by solving the puzzle and generating a new block. Now in parallel mining by solving the puzzle, miners have become the leader. The leader is on duty for the next period of time. Unlike the traditional blockchain for example Bitcoin\cite{ref_article1}, the new mechanism requires the miner, who won the election, to stay online for its duty time. Sometimes accidents, like the power issue, or an Internet connection issue, happens unexpectedly. If the leader is offline, no one else can stay online to process the transactions instead of him. It makes the whole blockchain system to be blocked (transactions take too long time to be confirmed). In such cases, redundancy is required to keep the system running. It requires more than one leaders stand by to increase the stability of the system. The leaders work as a team. A set of rules is set up to get the miners cooperating. Below, there are specific details and elements: \subsection{Miner to Leader} On the basis of parallel mining, when a miner is elected as a leader, the leader serves his duty for a certain time. In a sliding time window, m (number of) miners are elected to leaders. According to Bitcoin\cite{ref_article1} system, the researchers set the election interval time to 10 minutes and the service time to 1 hour. It results that 6 leaders are online in a sliding time window. The leaders listen to the peer-to-peer network and wait for new transaction requests while they are on duty. Once the new transaction is broadcasting, leaders pack it into GraphChain. As the delay of communication between leaders, there are chances that same transaction is packed into the GraphChain multiple times by different leaders. Only m (number of) leaders are working in parallel, resulting in maximum of m (number of) forks of the GraphChain. \subsection{Accounts} An account usually starts with zero balance. Account balance changes because of transactions. At least two accounts are involved within a transaction. The account block is a non-transaction block, usually only having one output(Fig 1). The transaction block represents two account's balance status. \subsection{Issue and Revoke Assets} The block issuing or revoking assets requires special signature from certain private key, or more than one keys. Any non-transaction block with assets above zero should be verified carefully in the mechanism design. \subsection{Transactions} Any transaction should happen between at least two ac- counts. The senders balance must be above zero. As shown in Fig 1, each transaction block usually has two inputs and two outputs. A transaction block stands for two accounts current balances, one of them being a sender account and the other a receiver account. \subsection{Scalability} The scalability of Bitcoin\cite{ref_article1} and related system is limited. The reasons include block size, the overall data amount, the block propagation speed and miner's capacity. In Bitcoin\cite{ref_article1}'s design, one miner is selected to pack the transactions from the past 10 minutes. The rule acts like a central lock, preventing other miners from contribution. Parallel mining enables independent transactions to happen at the same time. Let's take a look at two types of scenarios in real life: 1. the parents give the kid some pocket money 2. the shop accepts money for goods sold. The transaction of pocket money example happens in every family. They are independent, lots of parents can transfer money in parallel. The second type of transactions is made in sequence, the commerce accepting each transaction will change its own balance. Both types of transactions are very common, sometimes they're mixed. Parallel mining will speed up transactions processing by allowing more leaders to play the mining task. \subsection{Election for the Leaders} In GraphChain and Bitcoin-NG's design, leaders play the role of Bitcoin\cite{ref_article1}'s miner. In Bitcoin, miner who finds the new block has the privilege to pack the transactions from the past 10 minutes into that new block. In GraphChain system, leaders are elected to pack the transactions for the certain time. It comes with a problem: the Bitcoin's miner finishes his task once the mining is over, the GraphChain and Bitcoin-NG's leaders need continue to work once the election is done. Any leader may go offline any time due to exception, it unable to ensure availability unless adding redundancy. In GraphChain or Bitcoin-NG, if there is no leader online, the whole system will be jammed, that's why there should be more than one leaders online as the replicas. Leaders work together while they are competing. The amount of leaders depends on system performance requirement. The leader is elected in the similar way that Bitcoin miner finds the new block. The method is PoW based. A miner who wants to be an leader, the world wide competition is required. The difference is that Bitcoin rewards the new block to the winner miner, GraphChain grants the qualify to the winner miner. The miner became a leader will work with other leaders for a while to pack the user transactions into GraphChain. \subsection{Append Transaction} The original PoW algorithm sets a difficult target. Whoever first calculates the puzzle will broadcast the result and create the next block. In this case, there are unlimited competitors and only one of them can win. In parallel mining scenario, limited number of leaders try to solve much simpler puzzle. If a leader retries certain times and still can not find the result meeting the target, this leader will give up. Because the puzzle is simple enough, it's assumed that at least one leader should be able to get the puzzle answer and create the next transaction block. The result is that several blocks may be created by different leaders for one transaction. The block whose creator spends less retries will be the lucky new block. The simple modification of PoW algorithm is called Proof of Luck(PoL). The leaders append the transaction to the GraphChain data structure. As there are a limited number of leaders, PoL algorithm plays an efficiency way. Any leader can choose from any unpacked transaction to append into GraphChain, and different orders are fine. For efficiency, algorithm can be applied that different leaders rank transactions by different orders, to make sure all the transactions should be appended into data structure for at least once. This is a kind of redundancy that the computation is verified. \section{Data sharding} The chain data structure is hard to be 'sharded' because the blockchain can not be split by account. The existing solution suggests keeping the certain period of times blockchain by snapshot. The accounts balance list also need to keep stand-alone. Dropping part of the blockchain data will cause the difficulty in data verification. Also, the term 'sharding' here is different from Ethereum\cite{ref_article7}'s 'sharding', which is described at Github project page https://github.com/ethereum/sharding/blob/develop/docs/doc.md. Ethereum's sharding is to increase the capacity with a two-layer design. In GraphChain, the sharding can be done by splitting data by user. As the high TPS's requirement for the production environment, the overall size of data will be increased very fast. Assume there are 2000 TPS, about 24G data will be generated per day. Less PC will meet the condition to act as the full clone node. Data shard on GraphChain divides the data by accounts. In general a user account internally is represented as hash. A node can be simply designed to keep all the transaction information related the accounts whose hash starts with 'a' or 'b'. By this configuration, the huge data can be kept separately by many nodes with redundancy. In GraphChain, each block represent the history of two accounts’ states. Verifying the correctness of transactions can split into two steps: verify all the transactions history related to one user account and repeat the same action on all the user accounts. When the history data is big enough, it will be a nice choice to have the parallel verification on multi nodes. \section{Metrics} To prove the performance improvement proposed, single leader and multi leaders performances need measuring. The first experiment(Fig 2) assumed 4000 transactions were waiting to be packed, and performances were measured by the different numbers of leaders. 4000 transactions under waiting is actually a big jamming case. In practical the new transactions should be processed as soon as possible. In this experiment, the leaders are free to choose any transactions to write to GraphChain. If network delay, a leader may try to pack a transaction which is already done by other leaders. According to the longest chain rule, in the case of two chains with same length, PoL algorithm is used to decide which fork to go. It's also found that the overall performance would be going down while more transactions are appended into GraphChain. The reason is when the chain length increases, the database need to lookup the chain to verify if the transaction exists already in the blocks. This issue is solved by adding cache. After applying this technique we can observe quite average performance in Fig 2. The second experiment(Fig 3) measured the stability of the blockchain network. If all the leaders were offline, the network was in jam as no transaction could be processed. Researchers used Simple Gilbert model\cite{ref_article6} method to model the network status. It was assumed that all the leaders each had chance p to go offline and 1-p chance to get back online. The stability for solo leader and multi leaders was measured. \section{Experimental Setup} \begin{figure}[htbp] \includegraphics[width=\linewidth]{Figure_2.png} \caption{The performance of parallel mining by adding miners} \label{fig2} \end{figure} The experimental source code is listed on Github https://github.com/ProofOfLuck/graph MySQL database was used to store the graph, leaders and transactions data. Its assumed that the peer-to-peer network transportation was reliable. The experiment didn't implement that part. In Bitcoin, data is stored in different full-nodes, and be replicated (copy from each others). This part is already be proven to be feasible. In GraphChain, this part is following the Bitcoin. Hence, the data is stored in centralized MySQL database would not affect performance measure. Transactions are inserted into the databases table directly. Below, there are two major steps and details for each script files: \subsection{Simulate the Election} The miners first become leaders through election. In real cases, difficulty and competition was required to the election. In this simulation code, miners will become a leader by solving simple puzzles (iteration hash with some fixed target). \subsection{Simulate the Mining} The leaders observe the transactions table of database to see if new transaction turns up. Once new transaction appears, the free leaders query in the GraphChain to see if other leaders have finished packing the transaction into block already. If not, packing will be started by the current leader immediately. Check the code below (the experimental source code in Github repositories https://github.com/ProofOfLuck/graph): election.py elects the miner to become a leader by solving simple hash based puzzles. leader.py plays the leaders role, packing transaction into block. leader auto.py combines the election and leaders function, keep playing leaders role and re-election when the leader period expires. send.py is a script for user to send balance to another user. send\_auto.py simulates auto transaction between a group of users. wallet\_new.py generates a private key. The private key is the identity, could be used for both miner or normal user. To keep it simple, the public key of the identity will be used as wallet address. The first experiment(Fig 2) looked for the proof that how much performance the blockchain could achieve. In Fig 2, different number of miners are simulated in mining tasks from the same amount of transactions. It's observed that more transactions were processed by the system, as the number of miners working on the GraphChain grew. This simulation was finished on one computer. The simulation code had been adjusted to slow down intentionally to prevent over using CPU. The second experiment(Fig 3) was to simulate that miners each had the chance to go offline and get back online. Simple Gilbert model\cite{ref_article6} was used in this simulation. From the result, it's observed that with 5 miners working together(p set to 0.1 and q set to 0.5) there was little down time. \begin{figure}[htbp] \includegraphics[width=\linewidth]{Figure_3.png} \caption{The availability of multi miners} \label{fig3} \end{figure} \section{Evaluation} In this paper the new protocol is proposal to increase the blockchain performance. The major approach is to change the chain data structure to GraphChain and use new mining mechanism to enable parallel mining. From the experiment, it was observed that the more miners worked, the more transactions could be processed. Although the growth was not linearly increased, adding miner to the existing blockchain can benefit the performance. It was similar to the distributed database system, when a central database running on a super computer can not meet the demand of data storage and processing capacity, people go to another direction by using thousands of small PC to build a big data system. It's also observed that as the numbers of miners increased, the chance of all the nodes going offline would be close to zero. Parallel mining was good for building high availability blockchain systems. There are several directions that GraphChain and parallel mining could be applied for: 1. Micro transactions. Now Bitcoin and Ethereum are valued at high price, even a small transaction fee will be expensive if converted to a legal currency. GraphChain allowing multi miners could be useful in the decentralized currency system which supports the micro transactions, as in GraphChain's design each block contain only one transaction. No block waiting time is required to confirm the transaction if enough miners are available. 2. Blockchain for data. Now privacy problems are a big issue, personal data have already become giant companies' private assets. In future there will be blockchain for certain field, for example the health data. If huge amount of data is insert into blockchain, it will be expensive to store it. GraphChain split the data unit into the smallest transaction level and the data are linked across different nodes. As a result, shard data are possible through this data structure. 3. Blockchain for banking. The banking is looking for digital currency solution. Existing blockchain can not meet the demand due to the performance and scalability issues. In this situation, new technologies will change the industry completely. The traditional banking system accepts deposits and loans to enterprises. To get deposit safely, huge costs were invested in IT systems as the election version of pen and paper. Regulation policies have been made, but they still need humans to follow it. Blockchain is a gorgeous invention, because that regulation part is no longer required for humans. The costs in regulation can be unbelievably low. A scalable and high performance blockchain will play an important role in the banking industry. GraphChain and parallel mining are useful improvements to current blockchain systems. The performance and capacity issues will be fixed if correctly being implemented. \section{Relatived Work} Bitcoin-NG\cite{ref_article2}: Bitcoin-NG is proposed as an performance improvement of original Bitcoin\cite{ref_article1}. It introduces the microblock which acts a lighter block between the two original blocks on the chain. Compared with Bitcoin-NG, parallel mining is introduced to increase the system availability. A GraphChain structure is also introduced to enable miners to work together, especially when the transactions are not co-related. BitShares\cite{ref_article3}/EOS: BitShares and EOS developed Delegated Proof-of-Stake(DPoS) from the Proof of Stake. The DPoS's delegation method tries to reduce the number of decision makers to increase the whole system's efficiency. DPoS takes a bit similar idea as leaders election: get less miners involved in transactions processing. It saves the time for decision making (less miners competing for mining) for the next block generation. GraphChain is pure PoW based, there is no PoS or DPoS consensus used by GraphChain. IoTA/DagCoin\cite{ref_article4}: IoTA and earlier DagCoin introduce the DAG data structure, which is believed the direction for blockchain in the future. The idea Directed acyclic graph(DAG) is borrowed by lots of following systems. One of the most famous and successful examples is IoTA. In IoTA's design, there are no miners. Any transaction which is required to be confirmed by later transaction. Compare with IoTA/DagCoin, current acts more like a Bitcoin system, keeping the original PoW consensus and mining as the necessary part. Although the GraphChain borrows the DAG idea, GraphChain is not DAG. \section*{Acknowledgment} The authors thank Brahma OS and the team advisors' help on information collection of performance related blockchain solutions.\\ This work was supported by the National Natural Science Foundation of China under Grant No. 61701418, in part by the Jiangsu Province National Science Foundation under Grant BK20150376, in part by the Suzhou Science and Technology Development Plan under Grant SYG201516, in part by Innovation Projects of The Next Generation Internet Technology under Grant NGII20170301, in part by SIP \& XJTLU Technology Transfer Project KSF-T-03, and in part by the XJTLU research development fund projects under Grant RDF140243 and Grant RDF150246.
\section{Introduction} Extreme value theory is concerned with describing the tail behavior of a possibly multivariate distribution. Respective statistical models and methods find important applications in fields like finance, insurance, environmental sciences, hydrology or meteorology. In the multivariate case, a key part of statistical inference is estimation of the dependence structure. Mathematically, the dependence structure can be described in various equivalent ways (see, e.g., \citealp{Res87, BeiGoeSegTeu04, DehFer06}): by the stable tail dependence function $L$ \citep{Hua92}, by the exponent measure $\mu$ \citep{BalRes77}, by the Pickands dependence function $A$ \citep{Pic81}, by the tail copula $\Lambda$ \citep{SchSta06}, by the spectral measure $\Phi$ \citep{DehRes77}, by the madogram $\nu$ \citep{NavGuiCooDie09}, or by other less popular objects. Estimators for these objects typically rely on one of two basic principles allowing one to move into the tail of the distribution: the \textit{block maxima method} (BM) and the \textit{peak-over-threshold approach} (POT). More precisely, suppose that $\bm X_1, \dots, \bm X_n$, with $\bm X_i=(X_{i,1}, \dots, X_{i,d})'$, is an i.i.d.\ sample from a multivariate cumulative distribution function $F$. For some large number $k$ (in the asymptotics, one commonly considers $k=k_n\to\infty$ such that $k=o(n)$), let \[ \mathcal X_{p} = \{ \bm X_i \mid \text{rank}(X_{i,j} \text{ among } X_{1,j}, \dots, X_{n,j}) \ge n-k \text{ for some } j=1, \dots, d\}, \] that is, $\mathcal X_{p}$ comprises all observations for which at least one coordinate is large. Any estimator defined in terms of these observations represents the multivariate POT method. The vanilla nonparametric estimator within this class is probably the \textit{empirical stable tail dependence function} \citep{Hua92}. To introduce the BM approach, let $1\le r \le n$ denote a large block size, and let $k=\lfloor n/r \rfloor$ denote the number of blocks (again, in the asymptotics, one commonly considers $k=k_n\to\infty$ such that $k=o(n)$). For $\ell=1, \dots, k$, let $\bm M_{\ell,r} =(M_{\ell, 1,r}, \dots, M_{\ell,1,r})'$ denote the vector of componentwise block-maxima in the $\ell$th block of observations of size $r$, that is, $M_{\ell, j,r}=\max(X_{i,j}: (\ell-1)r+1 \le i \le \ell r\} )$. Any estimator defined in terms of the sample \[ \mathcal X_{{b}} = (\bm M_{1,r}, \dots, \bm M_{k,r}) \] represents the BM approach. Asymptotic theory for estimators based on the POT approach is typically formulated under a suitable second order condition (see Section~\ref{sec:secor} below for details). The asymptotic variance of resulting estimators is then typically of the order $k_n^{\scriptscriptstyle -1}$ (see, e.g., \citealp{Hua92, EinKraSeg12, EinSeg09, SchSta06,FouDehMer15}, among others), whereas the rate of the bias is given by $(n/k_n)^{\rho_{p}}$, with $\rho_{p} <0$ denoting the \textit{second order parameter} in the aforementioned second order condition. Balancing the bias and variance leads to the choice $k_n\asymp n^{-2\rho_{p}/(1-2\rho_{p})}$, which results in an asymptotic MSE of order $n^{2\rho_{p}/(1-2\rho_{p})}$. For a particular class of models, this resulting convergence rate is in fact minimax-optimal \citep{DreHua98}. Perhaps surprisingly, results on asymptotic theory for estimators based on the BM approach are typically based on the assumption that the block size $r$ is fixed and that the sample $\mathcal X_{{b}}$ is a genuine i.i.d. sample from the limiting attractor distribution (see, e.g., \citealp{GenSeg09} and references therein). Thereby, a potential bias is completely ignored and a fair comparison between estimators based on the POT and the BM approach is not feasible. This imbalance has recently been recognized by \cite{Dom15,FerDeh15,BucSeg18,DomFer17} in the univariate case; see also the overview article \cite{BucZho18}. To the best of our knowledge, the only reference in the multivariate case is \cite{BucSeg14}. {In analogy to the POT case, the results in the latter paper can be simply reformulated in terms of a suitable second order condition (see Section~\ref{sec:secor} below for details). Based on these results, an estimator for the Pickands dependence function can then shown to have asymptotic variance of order $k_n^{\scriptscriptstyle -1}=(n/r_n)^{-1}$, while the bias is again typically governed by a second order parameter $\rho_{{b}}<0$ and has order $r_n^{\rho_{{b}}}$. Similar calculations as in the preceding paragraph show that the best possible MSE is of order $n^{2\rho_{b}/(1-2\rho_{b})}$. } As indicated by the above discussion, ``best'' convergence rates for the BM and POT approaches depend on the second order parameters in their respective second order conditions. This motivates to study the relationship between the two types of second order conditions. Our first major contribution is to show that {a natural} POT second order condition, in case $\rho_{p} \in {(-1,0]}$, implies {a natural} BM second order condition with $\rho_{b} = \rho_{p}$, and vice versa. As a consequence, if ${\rho_{b} =\rho_{p} \in (-1,0)}$, the best attainable rates for POT and BM estimators coincides. The situation changes when $\rho_{p} < -1$, in which case we obtain that under mild additional conditions $\rho_{b} = \max(\rho_{p}, -1)$; similarly we prove that typically $\rho_{b} < -1$ implies $\rho_{p} = \max(\rho_{b}, -1)$. This identifies scenarios in which either BM or POT estimators can attain better rates of convergence. Finally, when $\rho_{p} = -1$ both $\rho_{b} = -1$ and $\rho_{b} < -1$ is possible (and vice versa), and additional conditions to verify which of the two cases occurs are provided. Note that a similar relationship between second order parameters in the univariate case has been worked out in \cite{DreDehLi03}. As a second major contribution, we provide a detailed analysis of second order conditions (BM and POT) for the class of Archimax copulas \citep{ChaFouGen14}. Simple sufficient conditions are formulated in terms of the Archimedean generator associated with such copulas. In particular, we show that the class of Archimax copulas copulas contains examples where either the POT or BM method can lead to faster convergence rates. This is also illustrated in a small finite-sample simulation study. The remaining part of this article is organized as follows: in Section~\ref{sec:secor}, we introduce the second order conditions of interest and work out the connections between the two, including the above mentioned main result. In Section~\ref{sec:ex}, we work out details in two particular examples: the general class of Archimax copulas and outer power transforms of the Clayton copula. In Section~\ref{sec:est}, we illustrate the consequences for the rate of convergence of respective estimators, both by theoretical means and by a simulation study. \section{Second Order Conditions for the BM and the POT approach} \label{sec:secor} Let $(\bm X_t)_{t\in\mathbb{N}}$ denote an i.i.d.\ sequence of $d$-variate random vectors $\bm X_t=(X_{t1}, \dots, X_{td})$ with joint cumulative distribution function (c.d.f.) $F$ and continuous marginal c.d.f.s $F_1, \dots, F_d$. Let $C$ denote the associated unique copula. For integer $r \in\mathbb{N}$ and $j=1, \dots, d$, let $M_{1:r,j} = \max_{t=1}^r X_{tj}$ denote the maximum over the first $r$ observations in the $j$th coordinate, and let $\bm M_{1:r} = (M_{1:r,1}, \dots, M_{1:r,d})$. By independence, $\bm M_{1:r}$ has joint c.d.f.\ $F_r$ and copula~$C_r$, defined as $F_r(x) = F(x)^r$ and $C_r(\bm u) = C(\bm u^{1/r})^r$, where $\bm u^{s} = (u_1^s, \dots, u_d^s)$. We assume that $C$ lies in the copula domain of attraction of some extreme-value copula $C_\infty$, that is \begin{align} \label{eq:dombm} C_\infty(\bm u) = \lim_{r\to\infty} C_r(\bm u) = \lim_{r\to\infty} C(\bm u^{1/r})^r , \qquad \bm u \in [0,1]^d. \end{align} Hence, {$C_\infty(\bm u^{1/s})^s=C_\infty(\bm u)$ for all $s>0$ and $\bm u \in [0,1]^d$ and} \[ C_\infty(\bm u) = \exp\{- L(-\log u_1, \dots, -\log u_d) \}, \quad \bm u \in [0,1]^d, \] for some \textit{stable tail dependence function} $L:[0,\infty]^d \to [0,\infty]$ satisfying \begin{enumerate} \item $L$ is homogeneous: $L(s\, \cdot) = sL(\cdot)$ for all $s>0$; \item $L(\bm e_j)=1$ for $j=1, \dots, d$, where $\bm e_j$ denotes the $j$th unit vector; \item $\max(x_1, \dots, x_d) \le L(\bm x) \le x_1+ \dots + x_d$ for all $\bm x\in [0,\infty)^d$; \item $L$ is convex; \end{enumerate} see, e.g., \cite{BeiGoeSegTeu04}. By Taylor expansions, the assumption in \eqref{eq:dombm} is equivalent to assuming that \begin{align} \label{eq:dompot} \lim_{t \to \infty} t \{ 1- C(\bm 1- \bm x / t)\} = L(\bm x), \qquad \bm x \in [0,\infty]^d, \end{align} where the copula $C$ is naturally extended to a c.d.f.\ on $[-\infty,\infty]^d$. Note that the convergence is necessarily uniform on $[0,T]^d$, for any fixed $T>0$, by Lipschitz-continuity of $C$ and $L$. Consider the following natural second order conditions. \begin{definition}[Second order conditions] \label{def:secor} Let $C$ be a copula satisfying one of the equivalent limit relations in \eqref{eq:dombm} or \eqref{eq:dompot}. \begin{compactenum}[$(SO)_{{b},d} \quad $] \renewcommand{\theenumi}{$\mathrm{(SO)_{p}}$} \renewcommand{\labelenumi}{\theenumi} \item\label{cond:sopot} Suppose there exists a positive function $\alpha_{p}:(0,\infty) \to (0,\infty)$ with $\lim_{t\to\infty } \alpha_{p}(t) = 0$ and a non-null function $S_{p}$, such that, \begin{equation*} \lim_{t \to \infty} \frac{t \{ 1- C(\bm 1- \bm x / t)\} - L(\bm x)}{\alpha_{{p}}(t)} = S_{p}(\bm x), \qquad \bm x \in [0,\infty)^d, \end{equation*} uniformly on $[0,T]^d$, for any fixed $T>0$. \renewcommand{\theenumi}{$\mathrm{(SO)_{{b},d}}$} \renewcommand{\labelenumi}{\theenumi} \item \label{cond:sobmbs} Suppose there exists a positive sequence $\alpha_{{b},d}: \mathbb{N} \to (0,\infty)$ with $\lim_{r\to\infty } \alpha_{{b},d}(\floor{r}) = 0$ and a non-null function $S_{{b},d}$, such that, \[ \lim_{r \to \infty} \frac{C_{\floor{r}}(\bm u) - C_\infty(\bm u)}{\alpha_{{b},d}(\floor{r})} = S_{{b},d}(\bm u), \qquad \bm u \in [0,1]^d, \] uniformly on $[\delta,1]^d$ for each $\delta>0$. \renewcommand{\theenumi}{$\mathrm{(SO)_{b}}$} \renewcommand{\labelenumi}{\theenumi} \item \label{cond:sobm} Suppose there exists a positive function $\alpha_{b}:(0,\infty) \to (0,\infty)$ with $\lim_{r\to\infty } \alpha_{b}(r) = 0$ and a non-null function $S_{b}$, such that, \begin{equation*} \lim_{r \to \infty} \frac{C(\bm u^{1/r})^r - C_\infty(\bm u)}{\alpha_{{b}}(r)} = S_{b}(\bm u), \qquad \bm u \in [0,1]^d, \end{equation*} uniformly on $[\delta,1]^d$ for each $\delta>0$. \end{compactenum} \end{definition} {Condition~\ref{cond:sobmbs}, with the additional requirement that the convergence be uniform on $[0,1]^d$, can be applied to the results in \cite{BucSeg14} to obtain an explicit rate of the bias term for the empirical copula of block maxima (see also Section~\ref{sec:est} below for details).} We will show {in Section~\ref{subsec:prop}} below that Condition~\ref{cond:sobmbs} is actually equivalent to {the seemingly stronger Condition~\ref{cond:sobm}} (with $S_{b}=S_{{b},d}$, Lemma~\ref{lem:sobdtosob}) and that further the convergence in \ref{cond:sobm} must in fact be uniform on $[0,1]^d$ {(Lemma~\ref{lem:unif})}. Finally, note that Condition~\ref{cond:sopot} was imposed in \cite{FouDehMer15}, among others. \subsection{Some simple properties of the second order conditions} \label{subsec:prop} {The auxiliary functions $\alpha_m$, $m\in \{{b}, {p}\}$, in the second order conditions are necessarily regularly varying and imply a homogeneity property of the limit function $S_m$. See also \cite{FouDehMer15} for part (i) of the following lemma.} \begin{lemma} \label{lem:reg} (i) Suppose that \ref{cond:sopot} is met. Then there exists $\rho_{p} \le 0$ such that $\alpha_{p}$ is regularly varying of order $\rho_{p}$. As a consequence, $S_{p}$ is homogeneous of order $1-\rho_{p}$, that is, \[ S_{p}(s\bm x) = s^{1-\rho_{p}}S_{p}(\bm x) \] for all $s>0, \bm x \in [0,\infty)^d$. \smallskip \noindent (ii) Suppose that \ref{cond:sobm} is met. Then there exists $\rho_{b} \le 0$ such that $\alpha_{b}$ is regularly varying of order $\rho_{b}$. As a consequence, \[ \frac{S_{b}(\bm u^s)}{C_\infty(\bm u^s)} = s^{1-\rho_{b}} \frac{S_{b}(\bm u)}{C_\infty(\bm u)} \] for all $s>0, \bm u\in(0,1]^d$. \end{lemma} Note that the latter display also implies a growth condition on $S_{b}$ when one coordinate approaches zero: with the constant $K_{b}=e^d \sup_{\bm v \in [e^{-1},1]} |S_{b}(\bm v)|$, which is independent of $\bm{u}$ but can depend on $S_{b}$, we have \begin{align} \label{eq:gsb} |S_{b}(\bm u)| \le K_{b} u_\wedge (-\log u_\wedge)^{1+|\rho_{b}|}, \qquad u_\wedge = \min(u_1, \dots, u_d), \end{align} for all $\bm u \in [0,1]^d$, with the upper bound to be interpreted as zero if $u_\wedge=0$. Indeed, for all $\bm x\ge0$ with $x_\vee = \max(x_1, \dots, x_d) \in(0,\infty)$ we have \[ |S_{b}(e^{-\bm x})| = |S_{b}( (e^{-\bm x/{x_\vee}})^{x_\vee})| = x_\vee^{1+|\rho_{b}|} \frac{|S_{b}(e^{-\bm x/{x_\vee}})|}{C_\infty(e^{-\bm x/{x_\vee}})} C_\infty(e^{-\bm x}) \le K_{b} x_\vee^{1+|\rho_{b}|} e^{-x_\vee}, \] since $e^{-\bm x/x_\vee} \in[e^{-1},1]^d$ and since $\prod_{i=1}^d u_i \le C_\infty(\bm u) \le u_\wedge$. \begin{proof}[Proof of Lemma~\ref{lem:reg}] We only consider assertion (ii) and for notational brevity, we omit the index ${b}$ at all instances throughout the proof. By Theorem B.1.3 in~\cite{DehFer06}, regular variation of $\alpha$ follows if we prove that there exists $\mathcal{X} \subset (0,\infty)$, a measurable set of positive Lebesgue measure, such that, for all $x \in \mathcal{X}$, $\alpha(rx)/{\alpha(r)}$ converges, for $r \to \infty$, to a finite, positive function of $x$. Pick a point $\bm{u}\in (0,1)^d$ with $S(\bm{u}) \neq 0$ and let $\mathcal{X}$ denote a neighborhood of $1$ specified below. For $r,x>0$, we may write, by max-stability of $C_\infty$, \begin{align*} \frac{\alpha(rx)}{\alpha(r)} = \frac{ \left\{ \frac{C((\bm u^{1/x})^{1/r})^{rx} - C_\infty(\bm u^{1/x})^{x}}{\alpha(r)} \right\} }{ \left\{ \frac{C(\bm u^{1/(rx)})^{rx} - C_\infty(\bm u)}{\alpha(rx)} \right\} }, \end{align*} for some arbitrary point $\bm u \in (0,1]^d$ such that $S(\bm u) \ne 0$. The denominator converges to $S(\bm u)$. By the mean-value theorem, the numerator is equal to \[ \{ xC_\infty(\bm u)^{1-1/x}+o(1) \} \left\{ \frac{C((\bm u^{1/x})^{1/r})^{r} - C_\infty(\bm u^{1/x})}{\alpha(r)} \right\}, \quad r \to \infty, \] which converges to $xC_\infty(\bm u)^{1-1/x} S(\bm u^{1/x})$. By continuity of $S$, the latter limit is positive for all $x$ in a sufficiently small neighborhood of $1$. The assertion regarding $S_{b}$ follows from elementary calculations. \end{proof} \begin{lemma}\label{lem:sobdtosob} If \ref{cond:sobmbs} is met, then \ref{cond:sobm} holds with $\alpha_{{b}}(r) = \alpha_{b,d}(\floor{r})$ and $S_{{b}} = S_{{b}, d}$. \end{lemma} \begin{proof} Throughout the proof, we omit the index ${b}$ at all instances. For $\bm u \in [0,1]^d$, let $\bm u_r := \bm u^{\floor{r}/r}$ and note that $\bm{u}_r \to \bm{u}$ uniformly on $[\delta,1]^d$. As explained below, the following expansion, which implies the assertion of the lemma, holds uniformly in $\bm{u} \in [\delta,1]^d$: \begin{align*} C(\bm{u}^{1/r})^r &= \Big\{C(\bm{u}_r^{1/\floor{r}})^{\floor{r}} \Big\}^{r/\floor{r}} = \Big\{C_{\floor{r}}(\bm{u}_r) \Big\}^{r/\floor{r}} \\ &= \Big\{C_\infty(\bm{u}_r) + \alpha_{d}(\floor{r})S_{d}(\bm{u}_r) + o(\alpha_{d}(\floor{r})) \Big\}^{r/\floor{r}} \\ &\stackrel{(a)}= \Big\{C_\infty(\bm{u}_r) + \alpha_{d}(\floor{r})S_{d}(\bm{u}) + o(\alpha_{d}(\floor{r})) \Big\}^{r/\floor{r}} \\ &\stackrel{(b)}= C_\infty(\bm{u}_r)^{r/\floor{r}} + \frac{r}{\floor{r}} \{ C_\infty(\bm{u}_r) + o(1) \} ^{r/\floor{r}-1} \Big\{ \alpha_{d}(\floor{r})S_{d}(\bm{u}) + o(\alpha_{d}(\floor{r})) \Big\} \\ &\stackrel{(c)}= C_\infty(\bm{u}) + \alpha_{d}(\floor{r})S_{d}(\bm{u}) + o(\alpha_{d}(\floor{r})). \end{align*} Explanations: (a) is a consequence of uniform continuity of $S_{d}$. (b) follows by a Taylor expansion; note that $C_\infty(\bm u_r)$ is bounded away from $0$ uniformly in $\bm u\in[\delta,1]^d$ and $r\in\mathbb{N}$. This latter fact together with the fact that $r/\floor{r}$ converges to 1 implies (c). \end{proof} \begin{lemma} \label{lem:unif} Let \ref{cond:sobm} be met. Then the convergence \[ \lim_{r \to \infty} \frac{C(\bm u^{1/r})^r - C_\infty(\bm u)}{\alpha_{{b}}(r)} = S_{b}(\bm u), \qquad \bm u \in [0,1]^d, \] is uniform on $[0,1]^d$. \end{lemma} \begin{proof} Write $f_r(\bm u) = C(\bm u^{1/r})^r - C_\infty(\bm u)$ and omit the index ${b}$ at $S_{b}$ and $\alpha_{b}$. Recall that $\alpha \in {\operatorname{RV}}_\rho$ with $\rho\le 0$ by Lemma~\ref{lem:reg}, and define $\gamma_r = r^{-(1+|\rho|)}=o(\alpha(r))$. Since $C(\bm u),C_\infty(\bm u) \le u_\wedge=\min(u_1, \dots, u_d)$ by the upper Fr\'echet-Hoeffding bound, we obtain that \[ \sup_{\bm u \in [0,1]^d \setminus [\gamma_r,1]^d} \Big| \frac{f_r(\bm u)}{\alpha(r)} - S(\bm u) \Big| \le \sup_{\bm u \in [0,1]^d \setminus [\gamma_r,1]^d} \frac{2 u_\wedge }{\alpha(r)} + |S(\bm u)| =o(1) \] by \eqref{eq:gsb}. It is hence sufficient to show that the claimed convergence is uniform in $\bm u\in[\gamma_r,1]^d$. Suppose this is not the case. Then there exists $\varepsilon>0$ and sequences $r_n \to \infty, \bm{u}_n \in [\gamma_{r_n},1]^d$ with \[ \Big| \frac{f_{r_n}(\bm u_n)}{\alpha(r_n)} - S(\bm u_n) \Big| \ge 2 \varepsilon \quad \forall n. \] Here, the sequence $\bm{u}_n$ must satisfy $(\bm{u}_n)_\wedge \to 0$: indeed, for any $\eta > 0$, there exists $n_0$ with $\sup_{\bm{u} \in [\eta,1]^d}|f_{r_n}(\bm u)/{\alpha(r_n)} - S(\bm u)| < \varepsilon$ for all $n \geq n_0$, which implies that $(\bm{u}_n)_\wedge < \eta $ for all $n \geq n_0$. By \eqref{eq:gsb} and since $(\bm{u}_n)_\wedge \to 0$ we have $S(\bm u_n) = o(1)$. As a consequence, we may without loss of generality assume that \begin{align} \label{eq:cont} \Big| \frac{f_{r_n}(\bm u_n)}{\alpha(r_n)} \Big| \ge \varepsilon \quad \forall n. \end{align} Further, by \eqref{eq:gsb}, we may choose $\delta\in(0,1)$ such that $|S(\bm u)| \le \varepsilon$ for all $\bm u$ with $u_\wedge \le \delta$. Next, note that $|\log \delta|/|\log ((\bm{u}_n)_\wedge) | = (\log \delta)/\log ((\bm{u}_n)_\wedge) $ and define \[ \bm v_n= \bm u_n^{s_n}, \qquad s_n= \frac{|\log \delta|}{|\log ((u_n)_\wedge) |} \ge \frac{|\log \delta|}{|\log (\gamma_{r_n}) |} = \frac{|\log \delta|}{1+|\rho|} \times \frac1{\log r_n}, \] so that $s_n \to 0$ and \[ (\bm v_n)_\wedge = \min(v_{n,1}, \dots, v_{n,d}) = ((\bm{u}_n)_\wedge)^{s_n} = \delta \] and thus $\bm v_n\in [\delta,1]^d$. Hence, by the mean value theorem and the Fr\'echet-Hoeffding bounds, \begin{align*} |f_{r_n}(\bm u_n)| = |f_{r_n}(\bm v_n^{1/s_n}) | &= \big|\{ C(\bm v_n^{1/(r_ns_n)})^{r_ns_n}\}^{1/s_n} - C_\infty(\bm v_n)^{1/s_n}\big| \\ &\le \frac1{s_n} \delta^{1/s_n - 1} |f_{r_ns_n}(\bm v_n)| \le \frac1{s_n} \delta^{1/s_n - 1} \sup_{\bm v \in [\delta, 1]^d}| f_{r_ns_n}(\bm v)|. \end{align*} Further, recall the Potter bounds (e.g., Proposition B.1.9(5) in \citealp{DehFer06}): since $\alpha\in {\operatorname{RV}}_\rho$, there exists $r_0> 0$ such that \[ \frac{\alpha(rx)}{\alpha(r)} \le 2 x^{-(1+|\rho|)} \qquad \forall\ x \in(0,1], r \ge r_0: rx\ge r_0. \] The preceding two displays (note that $r_ns_n \gtrsim r_n/\log r_n \to \infty$) imply that, for sufficiently large $n$, \begin{align*} \Big| \frac{f_{r_n}(\bm u_n)}{\alpha(r_n)} \Big| &\le 2 {s_n}^{-(2+|\rho|)} \delta^{1/s_n - 1} \sup_{\bm v \in [\delta, 1]^d} \Big| \frac{f_{r_ns_n}(\bm v)}{\alpha(r_ns_n)}\Big| \\ &= 2 {s_n}^{-(2+|\rho|)} \delta^{1/s_n - 1} \Big\{ \sup_{\bm v \in [\delta, 1]^d} |S(\bm v)| + o(1) \Big\}. \end{align*} The upper bound converges to $0$, which yields a contradiction to \eqref{eq:cont}. \end{proof} \subsection{The relationship between \ref{cond:sobm} and \ref{cond:sopot}.} This section contains the first main result of the paper on the relationship between the two second order conditions \ref{cond:sobm} and \ref{cond:sopot}. Depending on the speed of convergence of $\alpha_{m}$, we will occasionally need the following functions \begin{align} \label{eq:gamdir1} \Gamma_1(\bm x) &= \partial_{\bm x^2}L(\bm x) = \lim_{r \to \infty} r\Big\{L\Big(\bm x + \frac{\bm x^2}{r}\Big) - L(\bm x)\Big\}, \qquad \bm x \in [0,\infty)^d, \\ \label{eq:gamdir2} \Gamma_2(\bm x) &= - \partial_{-\bm x^2}L(\bm x) = \lim_{r \to \infty} r\Big\{L(\bm x) - L\Big(\bm x - \frac{\bm x^2}{r}\Big)\Big\}, \qquad \bm x \in [0,\infty)^d. \end{align} Note that both limits necessarily exist for all $\bm x \in [0,\infty)^d$: indeed, by convexity of $L$, the difference quotients inside the limits are monotone functions of $r$ (see Theorem 23.1 in \citealp{Roc70}) and, by Lipschitz continuity of $L$, they are uniformly bounded. Furthermore, the functions $\Gamma_1, \Gamma_2$ must be homogeneous of order $2$, satisfy $0\le \Gamma_\ell(\bm x) \le \sum_{j=1}^d x_j^2$ and may be discontinuous. For a class of examples regarding the last assertion, consider the case $d=2$ with Pickands dependence function $A(t) = L(1-t,t)$. A straightforward but tedious calculation utilizing the homogeneity of $L$ shows that \[ L\Big(1-t + \frac{(1-t)^2}{r},t + \frac{t^2}{r}\Big) = A\Big(t+\frac{t(1-t)(2t-1)}{r}\Big) + A(t)\frac{1-2t+2t^2}{r} + O(r^{-2}). \] Hence, we have \[ \Gamma_1(1-t,t) = A(t)(1-2t+2t^2) + \lim_{r \to \infty} r\Big\{A\Big(t+\frac{t(1-t)(2t-1)}{r}\Big) - A(t)\Big\}. \] For $t \in (1/2,1)$ this limit is continuous if and only if $s \mapsto \lim_{h \downarrow 0} (A(s+h) - A(s))/h$ is continuous at $t$ which can fail for piecewise linear functions $A$. For the general result to come, the convergences in \eqref{eq:gamdir1} and \eqref{eq:gamdir2} must be uniform on $[0,T]^d$. Sufficient conditions are formulated in the next lemma, where we also provide a representation of $\Gamma_\ell$ in terms of the partial derivatives of $L$. \begin{lemma}\label{lem:gamma} (i) If the limit $\Gamma_1$ in \eqref{eq:gamdir1} is continuous, then the convergence is uniform on $[0,T]^d$ for any $T>0$. The same assertion holds for $\Gamma_2$ and the convergence in \eqref{eq:gamdir2}. \smallskip \noindent (ii) If, for all $j=1, \dots, d$, the first order partial derivative $\dot L_j$ of $L$ exists and is continuous on $\{\bm x \in [0,\infty)^d:x_j>0\}$, then the convergences in \eqref{eq:gamdir1} and \eqref{eq:gamdir2} are uniform on $[0,T]^d$ for any $T>0$ and we have $\Gamma_1=\Gamma_2=\Gamma$ with \[ \Gamma(\bm x) = \sum_{j: x_j>0} x_j^2\dot L_j(\bm x). \] \end{lemma} \begin{proof} The assertion in (i) is a consequence of Dini's theorem: \[ \Gamma_r(\bm x) := r \{ L(\bm x + \bm x^2/r) -L(\bm x ) \} \] is a continuous function of $\bm x$ and a monotone function of $r$ converging point-wise to a limit $\Gamma$ which is continuous by assumption. For the proof of (ii), apply the mean value theorem to write \[ \Gamma_r(\bm x) = \sum_{j: x_j>0} x_j^2 \dot L_j(\bm x + o(1)), \] where the $o$-term is uniform on $[0,T]^d$. As a consequence, \[ \big| \Gamma_r(\bm x) - \Gamma(\bm x) \big| \le \sum_{j: x_j>0} x_j^2 | \dot L_j(\bm x+o(1)) - \dot L (\bm x)|. \] It is now sufficient to show uniform convergence to zero for each summand on the right-hand side separately. For arbitrary $\varepsilon>0$, decompose $[0,T]^d$ into $\{\bm x\in[0,T]^d: x_j < \varepsilon\}$ and $\{\bm x\in[0,T]^d: x_j \ge \varepsilon\}$. On the first set, we have $x_j^2 | \dot L_j(\bm x+o(1)) - \dot L (\bm x)|< \varepsilon^2$ by boundedness of $\dot L_j$. On the second set, the function $\dot L_j$ is uniformly continuous, whence $x_j^2 | \dot L_j(\bm x+o(1)) - \dot L (\bm x)| = o(1)$ uniformly.\end{proof} The next two theorems are the main results of this section, and provide simple conditions that allow to derive \ref{cond:sobm} from \ref{cond:sopot} and vice versa. The most important consequence is that, under minimal extra conditions, \ref{cond:sobm} with second order parameter $\rho_{b} \ne -1$ implies \ref{cond:sopot} with second order parameter $\rho_{p}=\max(\rho_{b}, -1)$, and vice versa. Let \[ L_\vee (\bm x) = \max(x_1, \dots, x_d), \quad \bm x\in [0,\infty)^d \] denote the stable tail dependence function corresponding to perfect tail dependence. \begin{theorem} \label{theo:bp} (a) Suppose that \ref{cond:sopot} is met with $\alpha_{p}$ regularly varying of order $\rho_{p}\le 0$ and assume that $\lim_{r \to \infty} 2r\alpha_{p}(r) = c_{p}\in [0, \infty]$. \begin{enumerate} \item[(i)] If $c_{p} = \infty$, then \ref{cond:sobm} holds with $\alpha_{b} \equiv \alpha_{p}$ and $S_{b}(e^{-\bm x})= -C_\infty(e^{-\bm x}) S_{p}(\bm x) $. \item[(ii)] If $c_{p} = 0$ and $L\ne L_\vee$, then \ref{cond:sobm} holds if and only if $\Gamma_2$ in \eqref{eq:gamdir2} is continuous. We may choose $\alpha_{b}(r) = (2r)^{-1}$ and $S_{b}(e^{-\bm x}) = C_\infty(e^{-\bm x}) \{ \Gamma_2(\bm x) - L^2(\bm x) \}$. \item[(iii)] If $c_{p} \in (0,\infty)$, $\Gamma_2$ is continuous, and $S_{b}$ defined below is not the null function, then \ref{cond:sobm} is met with % \[ \alpha_{b}(r) = \alpha_{p}(r) + \frac1{2r}, \] and with \[ S_{{b}} (e^{- \bm x}) = C_\infty(e^{-\bm x}) \big\{ \lambda_{p} \{\Gamma_2(\bm x) - L^2(\bm x) \} - (1-\lambda_{p}) S_{p}(\bm x) \big\}, \qquad \lambda_{p}=\frac{1}{1+c_{p}}. \] \end{enumerate} \medskip \noindent (b) Suppose that \ref{cond:sobm} is met with $\alpha_{b}$ regularly varying of order $\rho_{b}\le 0$ and assume that $\lim_{r \to \infty} 2r\alpha_{b}(r) = c_{b}\in [0, \infty]$. \begin{enumerate} \item[(i)] If $c_{b} = \infty$, then \ref{cond:sopot} holds with $\alpha_{p} \equiv \alpha_{b}$ and $S_{p}(\bm x) = - S_{b}(e^{-\bm x})/C_\infty(e^{-\bm x})$. \item[(ii)] If $c_{b} = 0$ and $L\ne L_\vee$, then \ref{cond:sopot} holds if and only if $\Gamma_1$ in \eqref{eq:gamdir1} is continuous. We may choose $\alpha_{p}(r) = (2r)^{-1}$ and $S_{p}(\bm x) = \Gamma_1(\bm x) - L^2(\bm x)$. \item[(iii)] If $c_{b} \in (0,\infty)$, $\Gamma_1$ is continuous, and $S_{p}$ defined below is not the null function, then \ref{cond:sopot} is met with % \[ \alpha_{p}(r) = \alpha_{b}(r) + \frac1{2r}, \] and with \[ S_{p}(\bm x) = \lambda_{b} \{\Gamma_1(\bm x) - L^2(\bm x) \} - (1-\lambda_{b}) \frac{S_{b}(e^{-\bm x}) }{C_\infty(e^{-\bm x})} , \qquad \lambda_{b}=\frac{1}{1+c_{b}}. \] \end{enumerate} \end{theorem} In other words, if one of the two conditions holds with $c_{m}=\infty$, which is only possible for $\rho_m\in[-1,0]$ and necessarily the case if $\rho_{m} \in( -1,0]$, then the other condition holds as well with $\rho_{b} = \rho_{p}$; in that case we can choose $\alpha_{p} = \alpha_{b}$. When \ref{cond:sopot} is met with $c_{p} =0$, which is only possible for $\rho_{p}\le -1$ and necessarily the case if $\rho_{p} <-1$, the proof of Theorem~\ref{theo:bp} actually shows that the limit relation required for \ref{cond:sobm}, \[ \lim_{r \to \infty} \frac{\{ C(\bm u^{1/r})^r - C_\infty(\bm u)\}}{1/(2r)} = C_\infty(\bm u)\{\Gamma_2(-\log \bm u) - L^2(-\log \bm u)\}, \qquad \bm u \in [0,1]^d, \] holds point-wise in $\bm u$, and that this limit is not the zero function if and only if $L \ne L_\vee$ (i.e., only $\rho_{b}=-1$ is possible). However, even if the limit is non-zero, \ref{cond:sobm} can still fail due to a lack of uniformity. If $L = L_\vee$, a close look at the proofs (keeping track of higher order terms) reveals that \ref{cond:sopot} implies \ref{cond:sobm} provided that $\lim_{r \to \infty} r^2 \alpha_{p}(r) = \infty$. In that case we can choose $\alpha_{b} \equiv \alpha_{p}$ and $S_{b}(e^{-\bm x}) = - S_{p}(\bm x)C_\infty(e^{-\bm x})$. If $\lim_{r \to \infty} r^2 \alpha_{p}(r) < \infty$, even higher order expansions along similar lines are possible. Similar comments apply to case (b) in Theorem~\ref{theo:bp}. When \ref{cond:sopot} is known to hold with $c_{p}\in(0,\infty)$, which is only possible for $\rho_{p} = -1$, then both $\rho_{b} = -1$ and $\rho_{b} < -1$ is possible (and vice versa), and additional case-by-case calculations are necessary. As a matter of fact, the function $S_{b}$ defined in Theorem~\ref{theo:bp}(a), and likewise $S_{p}$ in (b), may be zero. Indeed, in Section~\ref{sec:est} we provide an example where $\rho_{p} = -1, \rho_{b} = -2$ (and vice versa). Starting from $\rho_{p} = -1$ we see that $S_{b}$ defined in Theorem~\ref{theo:bp} (a) must be zero since otherwise we would have $\rho_{b} = -1$. A further, more direct calculation, is possible for the bivariate independence copula. A simple calculation shows that \ref{cond:sopot} is met with $\alpha_{p}(r) = 1/(2r)$ and $S_{p}(x,y) = -2xy$. Further, $\lambda_{p}=1/2$, $L(x,y) = x+y$ and $\Gamma_2(x,y) =\Gamma(x,y) = x^2+y^2$, which implies that the function $S_{b}$ in part (iii) of (a) is the null-function. Hence, Theorem~\ref{theo:bp} does not make any assertion about whether \ref{cond:sobm} holds. In fact, since the independence copula is an extreme-value copula, the numerator on the right-hand side of \ref{cond:sobm} is actually zero, so \ref{cond:sobm} is not met at all as the limit cannot be nonzero. \begin{proof}[Proof of Theorem~\ref{theo:bp}] It suffices to consider the case $\bm u = e^{-\bm x} \in (0,1]^d$, that is, $\bm x = - \log \bm u \in[0,\infty)^d$. Subsequently, let $\delta\in(0,1)$ and $T>1$ be arbitrary, but fixed. All $o$- and $O$-notations within the proof are to be understood uniformly in $[\delta,1]^d$ or $[0,T]^d$, depending on whether $\bm u$ or $\bm x$ is involved. Now, either \ref{cond:sobm} or \ref{cond:sopot} implies \eqref{eq:dombm} (and the convergence is uniform on $[\delta, 1]^d$) and \eqref{eq:dompot} (and the convergence is uniform on $[0,T]^d$), and we begin by collecting two properties implied by the latter two limit relations. First of all, since \[ r \log C(\bm u^{1/r}) - \log C_\infty(\bm u) =o(1) \] by~\eqref{eq:dombm} and $C_\infty(\bm u) > 0$, a Taylor expansion of the exponential function implies that \begin{align*} \frac{C(\bm u^{1/r})^r - C_\infty(\bm u)}{\alpha_{{b}}(r)} &= \frac{r \log C(\bm u^{1/r}) - \log C_\infty(\bm u)}{\alpha_{{b}}(r)} \\ &\hspace{1cm}\times \Big[ C_\infty(\bm u) + \frac12 \big\{ C_\infty(\bm u) + o(1) \big\} \Big\{ r \log C(\bm u^{1/r}) - \log C_\infty(\bm u) \Big\} \Big] \\ &= \frac{r \log C(\bm u^{1/r}) - \log C_\infty(\bm u)}{\alpha_{{b}}(r)} \{ C_\infty(\bm u) + o(1) \}. \end{align*} As a consequence, the convergence in \ref{cond:sobm} for $\bm u \in (0,1]^d$ is actually equivalent to \begin{align} \label{eq:sobm2} \lim_{r \to \infty} \frac{r \log C(\bm u^{1/r}) - \log C_\infty(\bm u)}{\alpha_{{b}}(r)} = \frac{S_{b}(\bm u) }{C_\infty(\bm u)}, \end{align} and if either the convergence in \ref{cond:sobm} or in \eqref{eq:sobm2} is uniform on $[\delta,1]^d$, then so is the other. Second, since $C$ is Lipschitz continuous, we obtain that, by~\eqref{eq:dompot}, \begin{align} \label{eq:r1c} r \{ 1-C(e^{-\bm x/r})\} = r \{ 1-C(1-\bm x/r)\} + O(r^{-1}) = L(\bm x) + o(1). \end{align} Let us now prove the assertions in (a). As argued above, it suffices to show \eqref{eq:sobm2}. Now, the second order condition \ref{cond:sopot} can be rewritten as \[ r \{ 1-C(1-\bm x/r) \} = L(\bm x) + \alpha_{p}(r) \{ S_{p}(\bm x) + o(1) \}. \] Let $\bm y_r = r(1-e^{-\bm x/r}) - \bm x = - \bm x^2/(2r) + O(r^{-2})$, and note that $e^{-\bm x/r}=1-(\bm x + \bm y_r)/r$. We may thus write \begin{align*} r \{ 1-C(e^{-\bm x/r}) \} &= r \{ 1-C(1-(\bm x+ \bm y_r)/r) \} \\ &= L(\bm x + \bm y_r ) + \alpha_{p}(r) \{ S_{p}(\bm x+ \bm y_r) + o(1) \} \\ &= L(\bm x - \bm x^2/(2r)) + \alpha_{p}(r) \{ S_{p}(\bm x) + o(1) \} + O(r^{-2}) \end{align*} by uniform continuity of $S_{p}$ and Lipschitz continuity of $L$. As a consequence, by a Taylor expansion of the logarithm, \begin{align} - r \log C(\bm u^{1/r}) &= - r \log(1+C(e^{-\bm x/r}) - 1) \nonumber \\ &= r \{ 1 - C(e^{-\bm x/r}) \} + [ r \{ 1- C(e^{-\bm x/r})) ]^2/(2r) + O(r^{-2}) \label{eq:tayl} \\ &= L(\bm x - \bm x^2/(2r)) + \alpha_{p}(r) \{ S_{p}(\bm x) + o(1) \} + \{ L(\bm x)^2 + o(1)\}/(2r) + O(r^{-2}),\nonumber \end{align} where we have used \eqref{eq:r1c} in the last equality. Hence, we have \begin{align*} r \log C(\bm u^{1/r}) - \log C_\infty(\bm u) &= \frac{1}{2r}\Big[ 2r \{ L(\bm x) - L(\bm x - \bm x^2/(2r)) \} - L(\bm x)^2\Big] -\alpha_{p}(r) S_{p}(\bm x) \\ &\qquad + o(\alpha_{p}(r) + r^{-1}). \end{align*} The claim in (i) now follows from boundedness of the term in square brackets, which is a consequence of Lipschitz continuity of $L$. The claim in (iii) follows after some elementary calculations taking into account that the convergence in~\eqref{eq:gamdir2} is uniform by Lemma~\ref{lem:gamma}. For the proof of (ii), note that the latter display implies that \begin{align*} \lim_{r \to \infty} 2r \{r \log C(\bm u^{1/r}) - \log C_\infty(\bm u)\} &= - L(\bm x)^2 + \lim_{r \to \infty} 2r \{ L(\bm x) - L(\bm x - \bm x^2/(2r)) \} \\ & = \Gamma_2(\bm x) - L^2(\bm x) \end{align*} point-wise in $\bm x \in [0,\infty)^d$. By \eqref{eq:sobm2}, this is equivalent to pointwise convergence in \ref{cond:sobm} with $\alpha_{b} = 1/(2r)$ and $S_{b}(e^{-\bm x}) = C_\infty(e^{-\bm x}) \{ \Gamma_2(\bm x) - L^2(\bm x) \}$. The assertion in (ii) then follows from the facts that the convergence is uniform if and only if the convergence in~\eqref{eq:gamdir2} is uniform (which is equivalent to continuity of $\Gamma_2$ by Lemma~\ref{lem:gamma}) and that the limit is non-zero if and only if $L \ne L_\vee$. To see the latter, a simple calculation shows that $\Gamma_2=L^2$ holds for $L=L_\vee$. On the other hand, if $\Gamma_2=L^2$, then $L^2(\bm x)= \Gamma_2(\bm x) = \sum_{j=1}^d x_j^2 \dot L_j(\bm x)$ for all $\bm x$ in the set $\mathcal C$ of points where $L$ is continuously differentiable; note that the complement of $\mathcal C$ is a Lebesgue null set by Theorem 25.5 in \citealp{Roc70}. A version of Euler's homogeneous function theorem then implies \[ |L(\bm x) - L^2(\bm x)| = |L(\bm x) - \Gamma_2(\bm x)| = | \sum_{j=1}^d (x_j - x_j^2) \dot L_j(\bm x) | \le \max(x_1, \dots, x_d) \sum_{j=1}^d |x_j-1| \] for all $\bm x \in \mathcal C$. Taking limits along a sequence in $\mathcal C$ converging to $\bm 1$, we obtain that $L(\bm 1)=L^2(\bm 1)$ and hence $L(\bm 1)=1$, which only occurs for $L=L_\vee$. Let us now prove part (b) of the theorem. The assertion in \eqref{eq:sobm2}, which is equivalent to \ref{cond:sobm}, may be rewritten as \[ -r \log C(e^{-\bm x/r})= L(\bm x) - \alpha_{b}(r) \{ S_{b} (e^{-\bm x}) / C(e^{-\bm x}) + o(1) \}. \] The Taylor expansion in the first two lines of \eqref{eq:tayl}, together with \eqref{eq:r1c}, allows to rewrite this as \[ r\{ 1-C(e^{-\bm x/r}) \} = L(\bm x) - \alpha_{b}(r) \{ S_{b} (e^{-\bm x}) / C(e^{-\bm x}) + o(1) \} - \{ L(\bm x)^2 + o(1)\}/(2r) + O(r^{-2}). \] Let $\bm z_r = -r\log(1 - \bm x/r) - \bm x = \bm x^2/(2r) + O(r^{-2})$, and note that $1-\bm x/r=e^{-(\bm x+\bm z_r)/r}$. The previous display then implies \begin{align*} r\{1- C(1-\bm x/r)\} &= r\{1-C(e^{-(\bm x+\bm z_r)/r})\} \\ &= L(\bm x + \bm z_r) - \alpha_{b}(r) \{ S_{b} (e^{-\bm x-\bm z_r}) / C(e^{-\bm x-\bm z_r}) + o(1) \} \\ & \hspace{2cm} - \{ L(\bm x+ \bm z_r)^2 + o(1)\}/(2r) + O(r^{-2}) \\ &= L(\bm x + \bm x^2/(2r) ) - \alpha_{b}(r) \{ S_{b} (e^{-\bm x}) / C(e^{-\bm x}) + o(1) \} \\ & \hspace{2cm} - \{ L(\bm x)^2 + o(1)\}/(2r) + O(r^{-2}), \end{align*} and therefore, \begin{align*} r\{1- C(1-\bm x/r)\} - L(\bm x) &= \frac{1}{2r} \Big[ 2r \{ L(\bm x + \bm x^2/(2r)) - L(\bm x) \} -L(\bm x)^2 \Big] - \alpha_{b}(r) \frac{S_{b}(e^{-\bm x})}{C(e^{-\bm x})} \\ & \qquad + o(r^{-1}+\alpha_{b}(r)). \end{align*} The remaining part of the proof is now similar to the proof of (a). \end{proof} \section{Second Order Conditions in Particular Models} \label{sec:ex} \subsection{Outer Power Transform of a Clayton Copula} \label{ex:opc} For $\theta>0$ and $\beta \ge 1$, the outer power transform of a Clayton Copula is defined as \[ C_{\theta, \beta}(u,v) \equiv \Big[ 1+ \big\{ (u^{-\theta} - 1)^\beta + (v^{-\theta} - 1)^{\beta} \big\}^{1/\beta} \Big]^{-1/\theta}, \qquad (u,v)\in[0,1]^2, \] to be interpreted as zero if $\min(u,v)=0$. Note that $C_{\theta,\beta}$ is an Archimedean copula with generator $\varphi(t) = \{ (t^{-\theta}-1)/\theta\}^\beta$. It follows from Theorem 4.1 in \cite{ChaSeg09} that $C_{\theta,\beta}$ is in the copula domain of attraction of the Gumbel--Hougaard copula with shape parameter $\beta$, that is, \[ C_\infty(u,v) = C_{\beta}(u,v) \equiv \exp\Big[ - \big\{ (- \log u)^\beta + (-\log v)^{\beta} \big\}^{1/\beta} \Big], \qquad (u,v)\in[0,1]^2, \] again to be interpreted as zero if $\min(u,v)=0$. Moreover, by Proposition 4.3 in \cite{BucSeg14}, Condition~\ref{cond:sobm} is met with $\rho_{b} = -1$ and \[ \alpha_{b}(r) = (2r)^{-1} \quad \text{ and } \quad S_{b}(u,v)= \theta\, \Lambda_{b}(u,v;\beta), \] where \begin{align*} \Lambda_{b}(u,v;\beta) & =C_{\beta}(u,v) \, \{ (x^\beta + y^\beta)^{2/\beta} - (x^\beta + y^\beta)^{1/\beta-1} (x^{\beta+1} + y^{\beta+1}) \} \\ &= C_{\beta}(u,v) L_\beta(x,y) \, \Big\{ L_\beta(x,y) -\frac{x^{\beta+1} + y^{\beta+1}}{x^\beta + y^\beta} \Big\} \end{align*} with $x=-\log u$ and $y = -\log v$. The constant $c_{b}$ in Theorem~\ref{theo:bp} is hence equal to $c_{b}=1$. By similar calculations as in the above reference, Condition~\ref{cond:sopot} could be verified from scratch. However, a much simpler calculation shows that $L_\beta$ satisfies the conditions from Lemma~\ref{lem:gamma} (ii) and hence we obtain \[ \Gamma_1(\bm x) = \Gamma(\bm x) = L_\beta(x,y) \frac{x^{\beta+1} + y^{\beta+1}}{x^\beta + y^\beta}. \] We may hence apply Theorem~\ref{theo:bp} to obtain that \ref{cond:sopot} is met with $\rho_{p}=-1$ and \[ \alpha_{{p}}(t) = t^{-1} \quad \text{ and } \quad S_{{p}}(x,y)= \frac{1+\theta}{2}\,L_\beta(x,y) \, \Big\{ \frac{x^{\beta+1} + y^{\beta+1}}{x^\beta + y^\beta} - L_\beta(x,y) \Big\}. \] \subsection{Archimax Copulas} \label{subsec:archimax} Let $L_0$ be an arbitrary stable tail dependence function. Further, let $\psi:[0,\infty) \to [0,1]$ be a $d$-Archimedean generator \citep{McnNes09}, that is, a $d$-monotone function which is strictly decreasing on $[0, \inf\{x \ge 0: \psi(x) = 0\}]$ and satisfies the conditions $\psi(0)=1$ and $\lim_{x\to \infty} \psi(x)=0$. Here, $d$-monotonicity means that the first $d-2$ derivatives of $\psi$ exist on $(0,\infty)$ and satisfy $(-1)^j \psi^{(j)} \ge 0$ for all $j=0, \dots, d-2$, with $(-1)^{d-2} \psi^{(d-2)}$ being convex and non-increasing on $(0,\infty)$. In particular, in the bivariate case, $\psi$ must be convex. The Archimax copula associated with $(\psi, L_0)$ is defined as \[ C(\bm u) = \psi[ L_0\{ \psi^{-1}(u_1), \dots, \psi^{-1}(u_d) \} ], \quad \bm u \in [0,1]^d, \] where $\psi^{-1}$ denotes the inverse of $\psi$ on $(0,1]$ and where $\psi^{-1}(0) = \inf\{x \ge 0: \psi(x) = 0\}$, see \cite{ChaFouGen14}. By Proposition 6.1 in that reference, the copula $C$ is in the max-domain of attraction of the copula \[ C_\infty(\bm u) = \exp\{ - L_0^\alpha( x_1^{1/\alpha}, \dots, x_d^{1/\alpha}) \}, \quad \bm u \in [0,1]^d, \] where $x_j=-\log u_j$, provided that the function $\kappa_{{p}}: w \mapsto 1-\psi(1/w)$ is regularly varying with index $-\alpha$ for some $\alpha \in (0,1]$. Equivalently, the function $\lambda_{{p}}: w \mapsto \psi^{-1}(1-1/w)$ is regularly varying with index $-1/\alpha$, see equation (15) in \cite{ChaFouGen14}. Finally, note that $C$ itself is an extreme-value copula provided $\psi(x)=\exp(-x)$ and that the outer-power transform of the Clayton copula considered in Section~\ref{ex:opc} is an Archimax copula with parameter $\psi(x) = (1+\theta x^{1/\beta})^{-1/\theta}$ (i.e., $\kappa_{p} \in {\operatorname{RV}}_{-1/\beta}$) and $L_0(x,y) = x+y$. Define yet another function $\kappa_{{b}}: w \mapsto -\log \psi(1/w)$, and note that $\kappa_{{p}} \in {\operatorname{RV}}_{-\alpha}$ if and only if $\kappa_{b} \in {\operatorname{RV}}_{-\alpha}$. It is further possible to prove that this is equivalent to the function $\lambda_{b}: w \mapsto \psi^{-1}(e^{-1/w})$ being regularly varying with index $-1/\alpha$.\footnote{Indeed, we have $\kappa_b=-\log \psi(1/\cdot) \in {\operatorname{RV}}_{-\alpha}$ iff $1/(-\log \psi(1/\cdot)) \in {\operatorname{RV}}_\alpha$. Since the latter function is necessarily strictly increasing, this implies $\{ 1/(-\log \psi(1/\cdot)) \} ^{-1} = 1/\psi^{-1}(e^{-1/\cdot}) \in {\operatorname{RV}}_{1/\alpha}$, by Proposition B.1.9(9) in \cite{DehFer06}. This implies $\lambda_b \in{\operatorname{RV}}_{-1/\alpha}$. The other direction is similar. }. Consider the following second order strengthening for ${m} \in \{{b}, {p}\}$: there exists a positive function $B_{{m}}$ with $\lim_{t \to\infty} B_{{m}}(t) = 0$ and a function $h_{\kappa,{m}}$ which is not of the from $cx^{-\alpha}$ for some $c\in\mathbb{R}$ such that \begin{align} \label{eq:sophi1} \lim_{t\to\infty} \frac{1}{B_{{m}} (t)} \Big\{ \frac{\kappa_{m}(tx)}{\kappa_{m}(t)} - x^{-\alpha} \Big\} = h_{\kappa,{m}}(x) \end{align} for all $x>0$. In that case, by applying Theorem B.2.1 in \cite{DehFer06} to the functions $f(t) = t^\alpha \kappa_{m}(t)$ and $a(t)=t^\alpha \kappa_{m}(t) B_{{m}}(t)$, the limit $h_{\kappa,{m}}$ is necessarily of the form \begin{align} \label{eq:hkappa} h_{\kappa,{m}}(x) = c_{m} x^{-\alpha} \frac{x^{\rho_{m}'}-1}{\rho_{m}'} \end{align} for some constant $c_{m}\ne 0$ and $\rho_{m}'\le 0$; when $\rho_{m}' = 0$ the fraction $(x^{\rho_{m}'}-1)/{\rho_{m}'}$ should be interpreted as $\log x$. Moreover, $B_{{m}}$ is regularly varying with index $\rho'_{m}$. As an example, consider the continuously differentiable $2$-Archimedean generator \[ \psi(x) = (1-x+x^2/2)\bm 1(x \in [0,1/2]) + (7/8 -x/2) \bm 1(x \in [1/2, 14/8]), \] such that $\kappa_{b}, \kappa_{p} \in{\operatorname{RV}}_{-1}$, i.e, $\alpha=1$. In that case, it can be shown that \eqref{eq:sophi1} is met for ${m} = {b}, {p}$ with \[ B_{{b}}(t) = t^{-2}, \quad \rho_{b}' = -2 \quad\text{ and }\quad B_{{p}}(t) = t^{-1}, \quad \rho_{p}' = -1. \] \begin{proposition} \label{prop:archso} Suppose that, for $j=1, \dots, d$, the $j$th first-order partial derivative $\dot L_{0,j}$ of $L_0$ exists and is continuous on $\{\bm x \in [0,\infty)^d: x_j>0\}$. For completeness, define \[ \dot L_{0,j}(\bm x) = \limsup_{h \downarrow 0} \frac{L_0(\bm x +h \bm e_j)-L_0(\bm x)}{h} \in[0,1] \] for $\bm x$ such that $x_j=0$. If \eqref{eq:sophi1} is met for ${m} = {p}$ and with $\rho_{{p}}'<0$, then \ref{cond:sopot} is met with $\alpha_{p}(t) = B_{{p}}(t^{1/\alpha}) \in {\operatorname{RV}}_{\rho_{{p}}'/\alpha}$. Similarly, if \eqref{eq:sophi1} is met for ${m}= {b}$ and with $\rho_{b}'<0$, then \ref{cond:sobm} is met with $\alpha_{b}(t) = B_{{b}}(t^{1/\alpha}) \in {\operatorname{RV}}_{\rho_{{b}}'/\alpha} $. \end{proposition} \begin{proof} The proof heavily relies on Lemma~\ref{lem:inv_short} below. Slightly abusing notation, we write $f(\bm x) = (f(x_1), \dots, f(x_d))$, provided $f$ is a real-valued function on a subset of the extended real line. {Depending on the context, all convergences are for $t\to \infty$ or $r\to\infty$, if not mentioned otherwise.} Consider the case ${m}={p}$ first. Using the homogeneity of $L_0$ and the fact that the convergence in \eqref{eq:sophi1} is uniform on sets $[\varepsilon,\infty)$ (Lemma~\ref{lem:inv_short} below), we may write, using the notation $C_{p}$ defined in Lemma~\ref{lem:inv_short}, \begin{align} \label{eq:decall1} t\{ 1- C(1-\bm x/t) \} &= \nonumber \kappa_{p}\Big( \frac{1}{L_0( \lambda_{p}(t/\bm x) ) } \Big) \Big / \kappa_{p}\Big( \frac{1}{ \lambda_{p}(t) } \Big) \\ &\stackrel{(a)}{=} \nonumber \kappa_{p}\bigg(\frac{1}{\lambda_{p}(t) } \frac{1}{L_0\big( \frac{\lambda_{p}(t/\bm x) }{\lambda_{p}(t) } \big) } \bigg) \Big/ \kappa_{p}\Big( \frac{1}{ \lambda_{p}(t) } \Big) \\ &\stackrel{(b)}{=} \nonumber L_0^\alpha\Big( \frac{\lambda_{p}(t/\bm x) }{\lambda_{p}(t) } \Big) + \bigg\{ h_{\kappa,{p}}\bigg( \frac{1}{L_0\big( \frac{\lambda_{p}(t/\bm x) }{\lambda_{p}(t) } \big) } \bigg) +o(1) \bigg\} B_{{p}}\Big( \frac{1}{ \lambda_{p}(t) } \Big) \\ &\stackrel{(c)}{=} \nonumber L_0^\alpha\Big( \frac{\lambda_{p}(t/\bm x) }{\lambda_{p}(t) } \Big) + \bigg\{ h_{\kappa,{p}}\bigg( \frac{1}{L_0\big(\bm x^{1/\alpha} \big) } \bigg) +o(1) \bigg\} B_{{p}}\Big( \frac{1}{ \lambda_{p}(t) } \Big) \\ &\stackrel{(d)}{=} L_0^\alpha\Big( \frac{\lambda_{p}(t/\bm x) }{\lambda_{p}(t) } \Big) + \bigg\{ h_{\kappa,{p}}\bigg( \frac{1}{L_0\big(\bm x^{1/\alpha} \big) } \bigg) +o(1) \bigg\} C_{p}^{\rho'/\alpha}B_{{p}}(t^{1/\alpha}) \end{align} where all $o$-terms are uniform in $\bm x\in[0,T]^d$, and where $1/0$ is interpreted as $\infty$ and converging functions on $(0,\infty)$ are naturally extended to $(0,\infty]$. Explanations: (a) follows from homogeneity of $L_0$, (b) from the fact that the convergence in \eqref{eq:sophi1} in uniform on $[\varepsilon,\infty)$ by Lemma~\ref{lem:inv_short}, (c) from uniform continuity of $h_{\kappa,{p}}$ on $[\varepsilon,\infty]$ and continuity of $L_0$, and (d) from \eqref{eq:B1lambda} in the proof of Lemma~\ref{lem:inv_short}. We are next going to show that the first summand on the right-hand side of \eqref{eq:decall1} can be written as \begin{align} \label{eq:con1} L_0^\alpha\Big( \frac{\lambda_{p}(t/\bm x) }{\lambda_{p}(t) } \Big) = L_0^\alpha(\bm x^{1/\alpha}) + B_{{p}}(t^{1/\alpha}) \big\{ S_{{p},1}(\bm x) + o(1) \big\}, \end{align} where the $o$-term is uniform in $\bm x\in[0,T]^d$ and where \begin{align*} S_{{p},1}(\bm x) = \alpha L_0^{\alpha-1}(\bm x^{1/\alpha}) \sum_{j=1}^d \dot L_{0,j}(\bm x^{1/\alpha}) h_{\lambda, {p}}(x_j^{-1}) \end{align*} with $S_{{p},1}(\bm 0)$ being interpreted as $0$ and {$h_{\lambda, {p}}$ being defined in \eqref{eq:lambdalim} in Lemma~\ref{lem:inv_short} below.} For that purpose, let $\varepsilon>0$, and note that we may find $\delta>0$ such that $|S_{p,1}(\bm x)| \le \varepsilon/2$ for all $\bm x \in [0, \delta]^d$. Further, note that $\bm x \mapsto L_0^\alpha(\bm x^{1/\alpha})$ is Lipschitz-continuous. {Indeed, using that \[ z_1^\alpha - z_2^\alpha = \alpha (z_1 -z_2) \int_0^1 \{s z_1 + (1-s) z_2\}^{\alpha-1} {\,\mathrm{d}} s \] for all $z_1, z_2 \ge 0$ with $z_1z_2\ne 0$, we have, for all $\bm x, \bm y$ not both being equal to $\bm 0$, \begin{align*} |L^\alpha(\bm x^{1/\alpha}) - L^\alpha(\bm y^{1/\alpha})| &= \textstyle \alpha |L(\bm x^{1/\alpha}) - L(\bm y^{1/\alpha})| \int_0^1 \{s L(\bm x^{1/\alpha}) + (1-s) L(\bm y^{1/\alpha})\}^{\alpha-1} {\,\mathrm{d}} s \\ &\le \textstyle \alpha \sum_{j: x_j y_j >0}|x_j^{1/\alpha} - y_j^{1/\alpha}| \int_0^1 \{s x_j^{1/\alpha} + (1-s)y_j^{1/\alpha}\}^{\alpha-1} {\,\mathrm{d}} s \\ &= \textstyle \sum_{j=1}^d |x_j - y_j|, \end{align*} where we used Lipschitz-continuity of $L$, $L(\bm x) \ge \max\{x_1, \dots, x_d\}$ and $\alpha \le 1$.} As a consequence, we further find that \begin{align*} \frac{1}{B_{{p}}(t^{1/\alpha})} \Big| L_0^\alpha\Big( \frac{\lambda_{p}(t/\bm x) }{\lambda_{p}(t) } \Big) - L_0^\alpha(\bm x^{1/\alpha}) \Big| \le \sum_{j: x_j>0} \frac{1}{B_{{p}}(t^{1/\alpha})} \Big| \Big( \frac{\lambda_{p}(t/x_j) }{\lambda_{p}(t) } \Big)^{\alpha} - (x_j^{1/\alpha})^\alpha \Big| \end{align*} and each summand on the right-hand side can be written as \begin{multline*} \frac{\alpha}{B_{{p}}(t^{1/\alpha})} \Big| \frac{\lambda_{p}(t/x_j) }{\lambda_{p}(t) } - x_j^{1/\alpha} \Big| \times \int_0^1 \Big\{ s \frac{\lambda_{p}(t/x_j) }{\lambda_{p}(t) } + (1-s) x_j^{1/\alpha}\Big\}^{\alpha-1} {\,\mathrm{d}} s \\ \le \frac{\alpha}{B_{{p}}(t^{1/\alpha})} \Big| \frac{\lambda_{p}(t/x_j) }{\lambda_{p}(t) } - x_j^{1/\alpha} \Big| \times x_j^{1-1/\alpha} \times \int_0^1 (1-s)^{\alpha-1} {\,\mathrm{d}} s \end{multline*} where we have used that $\lambda_{p}(t/x_j) / \lambda_{p}(t) \ge 0$ and $\alpha\le 1$. By \eqref{eq:lambdalim} below, the right-hand side of the previous display can be written as \[ O(1) \times \alpha x_j \times \int_0^1 (1-s)^{\alpha-1} {\,\mathrm{d}} s \] where the $O(1)$ is uniform for $x_j \in (0,\delta]$. Hence, for sufficiently large $t$, this expression can be made smaller than $\varepsilon/2$ uniformly in $x_j\in(0,\delta]^d$ by decreasing $\delta>0$ if necessary. As a consequence, it remains to show that \eqref{eq:con1} holds uniformly in $\bm x \in [0,T]^d \setminus [0,\delta]^d$. For such $\bm x$, using the notation from Lemma~\ref{lem:inv_short} below, \begin{align*} &\, L_0^\alpha\Big( \frac{\lambda_{p}(t/\bm x) }{\lambda_{p}(t) } \Big) \\ \stackrel{(a)}{=}&\, L_0^\alpha\Big( \bm x^{1/\alpha} + \big\{ h_{\lambda, {p}}( \bm x^{-1}) + o(1) \big\} B_{{p}}(t^{1/\alpha}) \Big) \\ \stackrel{(b)}{=} &\, L_0^\alpha(\bm x^{1/\alpha}) + \alpha L_0^{\alpha-1}(\bm x^{1/\alpha}+o(1)) \sum_{j=1}^d \dot L_{0,j}(\bm x^{1/\alpha}+o(1)) \big\{ h_{\lambda, {p}}( x_j^{-1}) + o(1) \big\} B_{{p}}(t^{1/\alpha}) \\ \stackrel{(c)}{=} &\, L_0^\alpha(\bm x^{1/\alpha}) + \{ S_{{p},1}(\bm x) + o(1)\} B_{{p}}(t^{1/\alpha}), \end{align*} where the $o(1)$ terms in each line are uniform in $\bm x \in [0,T]^d \setminus [0,\delta]^d$. Explanations: (a) follows from \eqref{eq:lambdalim} below, (b) from a Taylor expansion and (c) from uniform continuity of $\dot L_{0,j}$ on $[0,T]^d \setminus [0,\delta]^d$. It thus follows from \eqref{eq:decall1} and \eqref{eq:con1} that \ref{cond:sopot} is met with \[ S_{p}(\bm x) = C_{p}^{\rho'/\alpha} h_{\kappa,{p}} \big(1/{L_0 \big( \bm x^{1/\alpha} \big)} \big) + S_{{p},1}(\bm x)\footnote{Note that, by Lemma~\ref{lem:reg}, the function $S_{p}$ must be homogeneous of order $1-\rho_{p}'/\alpha$. This can also be verified by some lengthy calculations, using the fact that $h_{\kappa, {p}}(sx) = s^{\rho_{p}'-\alpha}h_{\kappa, {p}}(x)+x^{-\alpha}h_{\kappa, {p}}(s)$ and $L_0(\bm x) = \sum_{j=1}^d x_j \dot{L}_{0,j}(\bm x) $; the latter follows since $L_0$ is homogenous of order $1$.}. \] Next, let ${m}={b}$. Note that is sufficient to show that the convergence in \eqref{eq:sobm2} is uniform on $[\delta, 1]^d$. For $\bm u\in [\delta,1]^d$, let $\bm x=-\log \bm u \in [0,|\log \delta|]^d$. Then, similarly as before, \begin{align*} - r \log C(\bm u^{1/r}) &= \kappa_{b}\bigg(\frac{1}{\lambda_{b}(r) } \frac{1}{L_0\big( \frac{\lambda_{b}(r/\bm x) }{\lambda_{b}(r) } \big) } \bigg) \Big/ \kappa_{b}\Big( \frac{1}{ \lambda_{b}(r) } \Big) \\ &= L_0^\alpha\Big( \frac{\lambda_{b}(r/\bm x) }{\lambda_{b}(r) } \Big) + \bigg\{ h_{\kappa,{b}}\bigg( \frac{1}{L_0\big(\bm x^{1/\alpha} \big) } \bigg) +o(1) \bigg\} C_{b}^{\rho'/\alpha}B_{{b}}(r^{1/\alpha}) \end{align*} for $r\to\infty$, where all $o$-terms are uniform in $\bm u\in[\delta, 1]^d$, and where $1/0$ is interpreted as $\infty$ and converging functions on $(0,\infty)$ are naturally extended to $(0,\infty]$. The proof is now the same as for $m={p}$. \end{proof} \begin{lemma} \label{lem:inv_short} Let ${m} \in \{{p}, {b}\}$. Suppose that $\kappa_{m}$ satisfies \eqref{eq:sophi1} for some $B_{{m}}\in {\operatorname{RV}}_{\rho_{m}'}$ with $\rho_{m}'<0$ and denote by $c_{m} \neq 0$ the constant in~\eqref{eq:hkappa}. Then the convergence in \eqref{eq:sophi1} is uniform on sets of the form $[\varepsilon,\infty)$ for $\varepsilon > 0$. Moreover, there exists a constant $C_{m}>0$ such that, for $t\to\infty$, \begin{align} \label{eq:lambdarepr} \lambda_{m}(t) = (C_{m} t)^{-{1/\alpha}}\Big\{1 - \frac{1}{\alpha}\frac{c_{m}}{\rho_{m}'} C_{m}^{\rho_{m}'/\alpha} B_{{m}}(t^{1/\alpha}) (1+o(1))\Big\}. \end{align} Finally, \begin{align} \label{eq:lambdalim} \lim_{t \to \infty} \frac{1}{B_{{m}}(t^{1/\alpha})} \Big\{ \frac{\lambda_{m}(xt)}{\lambda_{m}(t)} - x^{-1/\alpha} \Big\} = -c_{m} \alpha^{-2} C_{m}^{\rho'/\alpha} x^{-1/\alpha} \frac{x^{\rho_{m}'/\alpha}-1}{\rho_{m}'/\alpha} =: h_{\lambda,{m}}(x) \end{align} with the latter convergence being uniform on sets of the form $[\varepsilon,\infty)$, $\varepsilon > 0$. \end{lemma} \begin{proof} The proof of uniformity in \eqref{eq:sophi1} is similar to the proof of uniformity in \eqref{eq:lambdalim} and is omitted for the sake of brevity. Since the proof is the same for ${m}={p}$ and ${m}={b}$, we occasionally omit the index ${m}$. Recall from the discussion following~\eqref{eq:sophi1} that the functions $f(t) = t^\alpha \kappa(t)$ and $a(t)=t^\alpha \kappa(t) B(t)$ satisfy \[ \frac{f(tx)-f(t)}{a(t)} \to c \frac{x^{\rho'}-1}{\rho'} \] where by assumption $\rho' < 0$ and $c \neq 0$. Assume without loss of generality that $c>0$, otherwise replace $f$ by $-f$ in the arguments that follow and make corresponding adjustments. By part 2 of Theorem B.2.2 in \cite{DehFer06} the limit $C_{m} := C := \lim_{t \to \infty} f(t)$ exists and we have \[ C - t^\alpha \kappa(t) = - \frac{c}{\rho'}t^\alpha \kappa(t) B(t)(1+o(1)), \] which implies \[ \kappa(t) = C t^{-\alpha} \big\{ 1 + \frac{c}{\rho'}B(t)(1+o(1))\big\}. \] Note that $C \geq 0$ since $\kappa(t) \geq 0$ and that $C \neq 0$ since otherwise Theorem~B.2.2 in \cite{DehFer06} would imply $-1/B(t) = - f(t)/a(t) \to -c/\rho'$, which contradicts $B(t) = o(1)$. Next note that $1/t=\kappa(1/\lambda(t))$ for all sufficiently large $t$. Hence, by the previous display, \begin{align}\label{eq:helplambda} t^{-1} = \lambda(t)^{\alpha}C\big\{ 1 + \frac{c}{\rho'}B(1/\lambda(t))(1+o(1))\big\}. \end{align} Since $\lambda(t)=o(1)$ (by definition of $\lambda$), we first obtain $t^{-1} = \lambda(t)^{\alpha}C(1+o(1))$, i.e. $\lambda(t) = (t C)^{-1/\alpha}(1+o(1))$. By regular variation of $B$ combined with the Uniform Convergence Theorem (see Theorem B.1.4 in \citealp{DehFer06}) we obtain \begin{align} \label{eq:B1lambda} B_{m}(1/\lambda_{m}(t)) = B_{m}(t^{1/\alpha})C_{m}^{\rho_{m}'/\alpha}(1+o(1)), \end{align} {where we added the indices for ease of reference.} After plugging this into~\eqref{eq:helplambda} and rearranging terms, a Taylor expansion implies that \begin{align*} \lambda(t) &= (C t)^{-1/\alpha} \big\{ 1 + \frac{c}{\rho'}C^{\rho'/\alpha}B(t^{1/\alpha})(1+o(1) \big\}^{-1/\alpha} \\ &= (C t)^{-1/\alpha} \big\{ 1 - \frac{c}{\alpha \rho'}C^{\rho'/\alpha}B(t^{1/\alpha})(1+o(1)\big\}, \end{align*} and hence~\eqref{eq:lambdarepr} follows. The fact that~\eqref{eq:lambdalim} holds for any fixed $x$ follows from~\eqref{eq:lambdarepr} by straightforward calculations. Hence it remains to prove that the convergence in~\eqref{eq:lambdalim} is actually uniform. Letting $f(t) := -c \alpha^{-2} C^{\rho'/\alpha}t^{1/\alpha}\lambda(t)$ and $a(t) := t^{1/\alpha}\lambda(t)B(t^{1/\alpha})$, the claim can be equivalently formulated as \[ \lim_{t\to\infty} \frac{f(tx)-f(t)}{a(t)} = \frac{x^{\rho'/\alpha}-1}{\rho'/\alpha} \] uniformly in $x\in[\varepsilon, \infty)$. It follows from the properties of $\lambda$ established earlier that $f(\infty) = \lim_{t\to\infty} f(t) = -c \alpha^{-2} C^{(\rho'-1)/\alpha}$ exists. Let $a_0(t) = |\rho'/\alpha|\{f(\infty) - f(t)\}$ and note that $\lim_{t\to\infty} a_0(t)/a(t) = 1$ by Theorem B.2.2 in \cite{DehFer06}. Moreover, by Theorem B.2.18 in that reference, we can find, for any $\delta>0$, some $t_0>0$ such that, for all $t\ge t_0$, \[ \sup_{x\ge \varepsilon} \Big| \frac{f(tx)-f(t)}{a_0(t)} - \frac{x^{\rho'/\alpha}-1}{\rho'/\alpha} \Big| \le \delta \sup_{x\ge \varepsilon} \max\{x^{\rho'/(2\alpha)}, x^{3\rho'/(2\alpha)}\} = \delta \varepsilon^{3\rho'/(2\alpha)}. \] In other words, \[ \lim_{t\to\infty} \sup_{x\ge \varepsilon} \Big| \frac{f(tx)-f(t)}{a_0(t)} - \frac{x^{\rho'/\alpha}-1}{\rho'/\alpha} \Big| = 0. \] The decomposition \[ \frac{f(tx)-f(t)}{a(t)} - \frac{x^{\rho'/\alpha}-1}{\rho'/\alpha} = \frac{a_0(t)}{a(t)} \Big\{ \frac{f(tx)-f(t)}{a_0(t)} - \frac{x^{\rho'/\alpha}-1}{\rho'/\alpha} \Big\} + \Big\{ \frac{a_0(t)}{a(t)} - 1 \Big\} \frac{x^{\rho'/\alpha}-1}{\rho'/\alpha} \] then implies the assertion. \end{proof} \section{Consequences for estimation precision} \label{sec:est} In this section, we illustrate the consequences of the results in the previous sections for estimating multivariate extremal dependence. Suppose $\bm X_1, \dots, \bm X_n$ is a finite sample from a distribution with continuous marginal cdfs and copula $C$ such that \eqref{eq:dombm} or, equivalently, \eqref{eq:dompot} is met. For the sake of a clear exposition, we will concentrate on the bivariate case and on estimating the Pickands dependence function $A(t)=L(1-t,t)$ based on one estimation method from the BM and POT approach, respectively. For the POT approach, we concentrate on the empirical stable tail dependence function, evaluated at the point $(1-t,t)$, defined as \[ \hat A_{p}(t) = \frac1k \sum_{i=1}^n \operatorname{\bf{1}}}%{\operatorname{1}(\hat F_{n,1}(X_{i,1}) > 1 - (1-t) \tfrac{k}{n} \text{ or } \hat F_{n,2}(X_{i,2}) > 1- t \tfrac{k}{n}), \] where $\hat F_{n,j}$ denotes the $j$th marginal empirical cdf, for $j=1,2$. Let \[ A_n(t) = \frac{1-C(1-(1-t)k/n, 1-t k/n )}{k/n} = \frac{\Prob(U_1 > 1-(1-t)k/n \text{ or } U_2 >1-t k/n )}{k/n} \] denote the pre-asymptotic version of $A(t)$, where $(U_1, U_2) \sim C$. The asymptotic analysis of $\hat A_{p}$ is based on the bias-variance type decomposition \[ \sqrt k \{ \hat A_{p}(t) - A(t) \} = \sqrt k \{ \hat A_{p}(t) - A_n(t)\} + \sqrt k \{ A_n(t) - A(t)\}. \] First, it follows from simple adaptations of the results in \cite{Hua92} that \[ \sqrt k \{ \hat A_{p}(t) - A_n(t)\} \] is asymptotically centered normal (in fact, even functional weak convergence holds), provided that $k\to\infty$ and $k=o(n)$ as $n\to\infty$ and that some mild regularity conditions on $L$ are met. Moreover, if \ref{cond:sopot} is met, the dominating bias term satisfies \[ \sqrt k \{ A_n(t) - A(t)\} = \sqrt k \alpha_{p}(n/k) \frac{A_n(t) - A(t)}{\alpha_p(n/k)} = \sqrt k \alpha_{p}(n/k) \{ S_{p}(1-t, t) + o(1)\} \] as $n\to\infty$. Hence, in the typical case $\alpha_{p}(t) = c t^{\rho_{p}}$ for some $\rho_{p}<0$, choosing $k$ proportional to $n^{-2\rho_{p}/(1-2\rho_{p})}$ leads to the best convergence rate for this estimator, with the resulting rate being of order $n^{\rho_{p}/(1-2\rho_{p})}$. Under additional assumptions, \cite{DreHua98} proved that this is the minimax-optimal convergence rate. Next, consider the block maxima method. For some block size $r\in\{1,\dots, n\}$, decompose the data into $k= \lfloor{n/r}\rfloor$ disjoint blocks of size $r$, that is, let the $i$th block maxima in coordinate $j$ be defined as \[ M_{r,i,j} = \max\{ X_{t,j}: t=(i-1)r+1, \dots, ir\}. \] By \eqref{eq:dombm}, the copula of the i.i.d.\ sample $(M_{r,i,1}, M_{r,i,2}), i=1, \dots, k,$ is approximately given by $C_\infty$, whence $A$ can be estimated by any method of choice, like the Pickands or CFG-estimator. For simplicity, we concentrate on the madogram whose asymptotic behavior can be immediately deduced from the results in \cite{BucSeg14}. Let $\hat U_{i,j} = \hat G_{k,j}(M_{r,i,j})$, where $\hat G_{k,j}$ denotes the $j$th marginal empirical cdf of the sample of block maxima. The madogram-based estimator for $A$ is defined as \[ \hat A_{b}(t) = \frac{\hat \nu(t)}{1-\hat \nu(t)}, \qquad \hat \nu(t) = \frac{1}k \sum_{i=1}^k \max\{ \hat U_{i,1}^{1/(1-t)}, \hat U_{i,2}^{1/t} \}, \] which is motivated by the fact that \[ A(t) = \frac{\nu(t)}{ 1- \nu(t)}, \qquad \nu(t) = \operatorname{E}[\max(U_1^{1/(1-t)}, U_2^{1/t})]. \] Under Condition~\ref{cond:sobm} it can be shown that the best rate of convergence which can be attained by this estimator is $n^{\rho_{b}/(1-2\rho_{b})}$. We sketch a proof: first, by some simple calculations, one may write \begin{align} \label{eq:sc} \nu(t) = 1- \int_0^1 C_\infty(y^{1-t}, y^t) {\,\mathrm{d}} y, \qquad \hat \nu(t) = 1- \int_0^1 \hat C_{b}(y^{1-t}, y^t) {\,\mathrm{d}} y, \end{align} where $\hat C_{b}$ denotes the empirical cdf of the sample $(\hat U_{1,1},\hat U_{1,2}), \dots, (\hat U_{k,1},\hat U_{k,2})$, i.e., the empirical copula of the sample of block maxima. Second, by Corollary~3.6 in \cite{BucSeg14}, the process \[ \sqrt k \{\hat C_{b}(\bm u) - C_r(\bm u) \} \] converges weakly to a centred Gaussian process, provided $r\to\infty, r/n\to0$ and some regularity conditions on $C_\infty$ are met. Under Condition~\ref{cond:sobm}, the decomposition \begin{align*} \sqrt k \{\hat C_{b}(\bm u) - C_\infty(\bm u) \} &= \sqrt k \{\hat C_{b}(\bm u) - C_r(\bm u) \} + \sqrt k \{ C_r(\bm u) - C_\infty(\bm u) \} \\ &= \sqrt k \{\hat C_{b}(\bm u) - C_r(\bm u) \} + \sqrt k \alpha_{b}(r) \{ S_{b}(\bm u) + o(1)\} \end{align*} then shows that we obtain a proper (possibly non-centred) limit process if we choose $r$ such that $\sqrt k \alpha_{b}(r) $ is converging. In the typical case $\alpha_{b}(t) = c t^{\rho_{b}}$, choosing $r$ proportional to $n^{1/(1-2\rho_{b})}$ leads to the optimal convergence rate $n^{\rho_{b}/(1-2\rho_{b})}$. By standard arguments based on the continuous mapping theorem and \eqref{eq:sc}, the convergence rate of the empirical copula easily transfers to $\hat A_{b}$. We illustrate the results in the preceding two paragraphs with three example models from the Archimax family. The parameter $L_0$ is chosen as the stable tail dependence function from the Gumbel copula (also known as the symmetric logistic model), that is, \[ L_0(x_1, x_2) = (x_1^\theta + x_2^\theta)^{1/\theta}. \] Throughout, we fix $\theta=\log(2) / \log(3/2)$ such that $A_0(1/2)=A_0(1/2,1/2)=3/4$ and $\lambda=1/2$. We consider the following three Archimedean generators \begin{align*} \psi_1(x) & = (1-x+x^2/4) \bm 1(x \in [0,1/2]) + (15/16 -3x/4) \bm 1(x \in (1/2, 5/4]), \nonumber \\ \psi_2(x) & = (1-x+x^2/2)\bm 1(x \in [0,1/2]) + (7/8 -x/2) \bm 1(x \in (1/2, 7/4]), \\ \psi_3(x) & = (1-x+x^3/6)\bm 1(x \in [0,1/2]) + (23/24 -7x/8) \bm 1(x \in (1/2, 23/21]), \nonumber \end{align*} which are continuously differentiable on their respective supports. The second order expansions of the associated functions $\kappa_{b}$ and $\kappa_{p}$ at $\infty$ are given by \begin{center} \renewcommand{\arraystretch}{1.2} \begin{tabular}{c|cc|cc} \hline \hline Generator & $\rho_{p}'$ & $\rho_{b}'$ & Expansion $\kappa_{p}$ & Expansion $\kappa_{b}$ \\ \hline $\psi_1$ & $-1$ & $-1$ & $\frac1x-\frac1{4x^2}$ & $\frac1x+\frac{1}{4x^2}+O(x^{-3})$ \\ $\psi_2$ & $-1$ & $-2$ & $\frac1x-\frac1{2x^2}$ & $\frac1x - \frac{1}{6x^3}+O(x^{-4})$ \\ $\psi_3$ & $-2$ & $-1$ & $\frac1x-\frac1{6x^3}$ & $\frac1x + \frac{1}{2x^2}+O(x^{-3})$ \\ \hline \hline \end{tabular} \end{center} \noindent Note the symmetry between the expansions of $\kappa_{b}(\psi_2)$ and $\kappa_{p}(\psi_3)$. By Proposition~\ref{prop:archso}, the corresponding second order parameters $\rho_{m}=\rho_{m}(\psi_j), {m} \in \{{b}, {p}\},$ of the associated archimax copulas are given by $\rho=\rho'/\alpha=\rho'$ and thus \[ \rho_{{b}}(\psi_j) = \begin{cases} -1 &, j=1 \\ -2 &, j=2 \\ -1 &, j=3 \end{cases} \qquad \qquad \rho_{{p}}(\psi_j) = \begin{cases} -1 &, j=1 \\ -1 &, j=2 \\ -2 &, j=3. \end{cases} \] Hence, if either the threshold $k$ (POT-estimator) or the block size $r$ (BM-estimator) is chosen at the best attainable rate of convergence as indicated at the beginning of this section, one would expect that estimators behave similarly for $j=1$ (convergence rate $n^{-1/3}$), that the BM-estimator outperforms the POT-estimator for $j=2$ (convergence rate $n^{-2/5}$ vs.\ $n^{-1/3}$), and vice versa for $j=3$. Let $\Gamma_{b}=\{1,2,3,\dots, 30\}$ denote a set of block sizes, and let $\Gamma_{p}=\Gamma_{p}(n) = \{k=\lfloor{pn}\rfloor: p \in \{0.01, 0.02, \dots, 0.39, 0.4\}\}$ denote a set of thresholds. In Table~\ref{tab:releff}, we state the relative efficiency \[ \text{RE} = \frac{\min_{r \in \Gamma_{b}} \operatorname{MSE}(\hat A_{{b},r}(1/2) ) }{\min_{k \in \Gamma_{p}} \operatorname{MSE}(\hat A_{{p},k}(1/2) ) } \] of the \textit{best} (optimal choice of $r$) BM-estimator $\hat A_{b}(1/2)=\hat A_{{b},r}(1/2)$ to the \textit{best} (optimal choice of $k$) POT-estimator $\hat A_{p}(1/2)=A_{{p},k}(1/2)$, considered as estimators for $A(1/2)=3/4$, for four different sample sizes $n=1000, 2000, 5000, 10000$. The values are calculated based on $3000$ Monte Carlo repetitions. Simulated samples from the Archimax copulas are generated by the algorithm described in Section 5.2 in \cite{ChaFouGen14}. The results perfectly match the expected behavior: for model $\psi_1$, the relative efficiencies are close to 1 (in fact, they are all slightly above 1), while they are decreasing for $\psi_2$ and increasing for $\psi_3$. \begin{table}[!htbp] \centering \renewcommand{\arraystretch}{1.0} \begin{tabular}{r|rrr} \hline \hline Sample size $n$ & $\psi_1$ & $\psi_2$ & $\psi_3$ \\ \hline 1000 & 1.214 & 0.233 & 3.253 \\ 2000 & 1.127 & 0.198 & 3.751 \\ 5000 & 1.141 & 0.147 & 4.104 \\ 10000 & 1.088 & 0.123 & 4.762 \\ \hline \hline \end{tabular} \medskip \caption{Relative efficiencies for estimating $A_0(1/2,1/2)$ based on Monte Carlo Simulation. Values below 1 indicate that the BM-estimator is more efficient.}\label{tab:releff} \end{table} As a further illustration, Figure~\ref{fig:MSE} depicts variance, squared bias and MSE as a function of the block size~$r$ (BM-estimator) or the threshold parameter $k$ (POT-estimator) for fixed sample size $n=5000$; again based on 3000 Monte Carlo replications. The following observation can be made estimator-wise: the variance curves behave similarly for all models, while the squared bias curve is much smaller for the respective model with $\rho_{{m}}=-2$ than for the other two models. \begin{figure}[!htbp] \begin{center} \centerline{\includegraphics[width=0.975\textwidth]{MSE-all.eps}} \vspace{-.5cm} \caption{\label{fig:MSE} Variance, Squared Bias and MSE for estimating $A_0(1/2,1/2)$ based on Monte Carlo Simulation (3000 repetitions, Sample Size $n=5000$). } \end{center} \end{figure} \section*{Acknowledgments} Axel Bücher gratefully acknowledges support by the Collaborative Research Center ``Statistical modeling of nonlinear dynamic processes'' (SFB 823) of the German Research Foundation, Project A7. Stanislav Volgushev gratefully acknowledges support by a discovery grant from NSERC of Canada. \newpage \bibliographystyle{chicago}
\section{Introduction} The process of automatically determining the sensor that produced a given image is referred to as {\em sensor identification}. While a number of sensor identification methods have been discussed in the literature~\cite{Relwork2, Geradts_SPIE_01, Bayram_ICIP_05}, the ones based on Photo Response Non-Uniformity (PRNU)~\cite{Lukas_TIFS_06, Lukas_TIFS_08, Jess_ISP_09} have gained prominence in the recent literature. PRNU refers to the non-uniform response of individual pixels across the sensor array to the same illumination as a consequence of manufacturing defects introduced during sensor production. PRNU manifests itself as a noise pattern in the images generated by a sensor. This noise pattern is believed to be unique to every sensor~\cite{UniquePRNU}. A number of schemes have been designed to compute the PRNU noise of a sensor based on the images generated by it~\cite{SPN_Ref1_2017}. More recently, the principle of PRNU has been used to perform sensor identification in the context of iris biometrics by processing the near-infrared (NIR) ocular images acquired by typical iris sensors~\cite{Uhl_2012_Baseline2,Kalka_CVPRW_15, Uhl0_IWBF_14,Uhl1_IWBF_15,Uhl3_IWBF_16,Ross_IWBF_17,IrisPRNU_18,SPN_Ref2_2017,Vatsa_18}. In this case, sensor identification (or device identification) can be used in conjunction with biometric recognition to authenticate both the identity of a device (e.g., a smartphone) as well as the individual using the device~\cite{Galdi_PRL_15}. Given the forensic value of PRNU in determining the origin of an image (\ie, the sensor or device that produced it), we explore if it is possible to alter an image such that its source, as assessed by a PRNU estimation scheme, is confounded. We impose two constraints: \begin{enumerate} \item The modified image must spoof the PRNU pattern of a pre-specified target sensor. \item The biometric utility of the modified image must be retained, viz., the modified ocular image must match successfully with the original image. \end{enumerate} \begin{figure}[t] \begin{center} \includegraphics[width=0.95\linewidth]{figs/isba2019-figure1-Page-1.png} \end{center} \caption{The objective of this work is to perturb an ocular (iris) image such that its PRNU pattern is modified to spoof that of another sensor, while not adversely impacting its biometric utility.} \label{fig:paperoutline} \end{figure} \begin{figure*}[t] \begin{center} \includegraphics[width=0.95\linewidth]{figs/isba2019-figure2.png} \end{center} \caption{The proposed algorithm for deriving perturbations for the input image using the candidate image. (a) Steps involved in modifying the original image from the source sensor using a candidate image from the target sensor (see Algorithm~\ref{alg:find-candidate}), and (b) role of the candidate image in the perturbation engine (see Algorithm~\ref{alg:perturbations}).} \label{fig:algorithm-graphic} \end{figure*} This kind of attack can be considered as a `targeted attack', since the sensor whose PRNU pattern has to be spoofed is pre-specified. In the literature, it is also referred to as fingerprint-copy attack~\cite{Ref_Fingerprintcopy2, Uhl_2012_Baseline2}, because the objective is to copy the sensor pattern or `fingerprint' corresponding to the target sensor to an image acquired using a different source sensor. The proposed work has two distinct benefits. Firstly, it allows us to assess the feasibility of PRNU spoofing from a counter-forensic perspective. The widespread use of forensic techniques for examining the validity and origin of digital media~\cite{CounterImageForensics_Ref1, CounterImageForensics_Ref2} necessitates the study of attacks that can potentially undermine the performance of such forensic methods. For example, an adversary may maliciously attempt to link an image to a different camera in an effort to mislead law enforcement investigators~\cite{Ref_Fingerprintcopy2}. Secondly, establishing the viability of such spoof attacks would promote the development of more robust PRNU estimation schemes~\cite{SPN_Ref2_2017}. In addition, effective methods to detect such attacks can be developed if the process of spoofing is better understood. Figure~\ref{fig:paperoutline} summarizes the objective of this work. The remainder of the paper is organized as follows. Section~\ref{PRNU} briefly reviews the PRNU based sensor identification scheme used in this work. Section~\ref{RelatedWork} presents methods that have been described in the literature for sensor anonymization and spoofing. Section~\ref{ProposedMethod} describes the proposed method for spoofing PRNU patterns. Section~\ref{Expts} provides details about the datasets used, the experimental protocols employed, and reports the results obtained using the proposed method. Section~\ref{Summary} summarizes the paper and indicates future work. \section{Photo Response Non-Uniformity (PRNU)} \label{PRNU} PRNU estimation entails computing the {\em reference pattern} of a sensor based on a set of training images acquired using the sensor. This reference pattern is then used by a sensor classifier to identify the sensor that was used to acquire a given test image. This is accomplished by correlating the reference pattern of the sensor with the {\em noise residual} of the test image to compute a correlation score. The image is assigned to the sensor whose reference pattern yields the highest correlation value. Here, we used Normalized Cross-Correlation (NCC) for computing the correlation score~\cite{Uhl1_IWBF_15, Ross_IWBF_17}. PRNU estimation can be done using numerous approaches~\cite{Lukas_TIFS_06, Li_TIFS_10, Kang_TIFS_12, Li2_TIFS_16, Li3_SPL_16, SPN_Ref1_2017}. In this work, we used the Maximum Likelihood Estimation (MLE) based PRNU estimation scheme~\cite{Lukas_TIFS_08}, which has been demonstrated to suppress image artifacts not associated with the sensor-specific pattern and has resulted in very good performance~\cite{Uhl0_IWBF_14, Uhl1_IWBF_15}. MLE based PRNU estimation uses a weighted averaging of the noise residuals extracted from a set of training images pertaining to the sensor; each noise residual is weighted by its corresponding training image, to derive the maximum-likelihood estimate of the reference pattern. Wiener filtering and zero-mean operations are applied to the noise residuals to address interpolation artifacts arising due to the Bayer pattern. In our experiments, $L_2-$normalization of the test noise residual is performed to account for the variations in the PRNU strength of different sensors~\cite{Uhl5_IJCB_17}. The MLE of the reference pattern corresponding to a sensor is computed as, $\mathbf{\hat{K}} = \frac{\sum_{i=1}^{N} \mathbf{w}_i\mathbf{I}_i}{\sum_{i=1}^{N} \mathbf{I}_i^2}.$ Here, $\mathbf{w}_i$ is the noise residual obtained using a wavelet-based denoising filter applied to training image $\mathbf{I}_i$ and $\mathbf{w}_i = \mathbf{I}_i - F (\mathbf{I}_i)$, where, $F$ denotes the Daubechies Quadrature Mirror Filter~\cite{Lukas_TIFS_06}. \section{Perturbing the PRNU Pattern} \label{RelatedWork} The counter-forensics literature describes techniques that can be used to suppress or perturb the PRNU pattern embedded in an image. This is often referred to as \textit{source anonymization}~\cite{PRNU_Perturb1_2014}, \ie, obscuring the `fingerprint' of the source sensor in an image so as to anonymize the origin of the image. Source anonymization can be used as a privacy preservation scheme, particularly relevant when the sensor-specific details can be used to associate a sensor with its owner. Assuming that each device is typically associated with a single user, device identification can be indirectly used to reveal the identity of the person possessing that specific device~\cite{AnonRef_2011}. There have been primarily two approaches to perturb the PRNU pattern for this purpose, namely, (i) compression and filtering based schemes, which typically use strong filtering schemes such as, flat-field subtraction~\cite{PRNU_attack2} or Wiener filtering~\cite{PRNU_attack4_2013} that can degrade the PRNU pattern leading to incorrect source attribution; and (ii) geometric perturbation based schemes such as `seam carving'~\cite{PRNU_attack3_2014,PRNU_attack4_2013} that distorts the alignment between the sensor reference pattern and the test noise residual, thereby impeding the process of correlating the reference pattern with the test noise residual. In contrast to source anonymization, \textit{PRNU spoofing} not only suppresses the fingerprint of the source sensor, but it also inserts the fingerprint of the target sensor. An adversary may tamper with the digital evidence to maliciously exculpate a guilty person or worse, incriminate an innocent person. In recent literature, PRNU spoofing has been performed by two methods, namely, (i) PRNU injection and (ii) PRNU substitution. The first method adds the weighted reference pattern of a pre-selected target sensor to the input image, $\mathbf{I}$~\cite{Ref_Fingerprintcopy2}. The modified image becomes $\mathbf{I'}=[\mathbf{I}+\mathbf{I}\times\gamma \mathbf{\hat{K}_{T}}]$. Here, $\mathbf{\hat{K}_{T}}$ is the reference pattern of the target sensor $T$ and $\gamma$ is a scalar parameter. The second method subtracts the PRNU pattern of the source sensor in an image and then adds the PRNU pattern of a target sensor~\cite{PRNU_attack5_2010}. The modified image is represented as $\mathbf{I'}=\mathbf{I} - \gamma \mathbf{\hat{K}_{S}} + \beta \mathbf{\hat{K}_{T}}$. $\mathbf{I}$ belongs to the source sensor $S$, whose reference pattern is $\mathbf{\hat{K}_{S}}$. $\gamma$ and $\beta$ are scalar terms. We will use the two methods described above, \ie, PRNU injection and PRNU substitution, as baseline algorithms for comparative evaluation. The first method will be referred to as Baseline 1 and the second method will be referred to as Baseline 2. Both baseline algorithms have been shown to be successful on images acquired using commercial cameras that employ RGB sensors. In~\cite{Uhl_2012_Baseline2}, the authors examine the viability of PRNU spoofing via injection in the context of \textit{iris sensors} operating in the NIR spectrum~\cite{PRNU_attack_NEW}. In their work, they computed the forged image as $\mathbf{I'}=[\textit{F}(\mathbf{I}) + \gamma \mathbf{\hat{K}_{T}}]$. Here, $F(\cdot)$ is the wavelet based denoising filter discussed in Section~\ref{PRNU}, and $\gamma$ is a scalar parameter. The authors further performed the triangle test to detect the spoof attack, but did not analyze the impact of the PRNU spoofing on iris recognition performance. In this paper, our objective is to perform PRNU spoofing in a principled manner, that works for any arbitrary pair of source and target iris sensors. In addition, we wish to retain the biometric utility of the PRNU-spoofed image. The task of spoofing can be potentially accomplished through different techniques, an example will be the use of adversarial networks that have been successfully utilized for perturbing images in the current literature~\cite{SAN,mirjalili_semi_2018}. However, a significant bottleneck of deep-learning based techniques is the need for large amount of training data for driving the perturbation process. We will demonstrate the success of the proposed PRNU spoofing scheme using small number of images ($<$1000). \section{Proposed method} \label{ProposedMethod} In this section, we formally describe the objective and the method used to address this objective. \subsection{Problem formulation} Let $X$ denote an NIR iris image of width $w$ and height $h$, and $\mathbf{S} = \{S_1, S_2, .., S_n\}$, denote a set of $n$ sensors. Let $\phi(X,S_i)$ be the function that computes the normalized cross-correlation (NCC) between the noise residual of $X$ and the PRNU reference pattern of sensor $S_i$. Then, the sensor label for the input iris image $X$ can be determined using $\displaystyle \arg \max_{i}\{\phi(X,S_i)\}$. Furthermore, let $M$ be a biometric matcher where $M(X_1, X_2)$ determines the match score between two iris samples $X_1$ and $X_2$. Given an input iris image $X$ acquired using sensor $S_o$, a candidate image $X_c$ from the target sensor $S_t$, and an iris matcher $M$ our goal is to devise a perturbation engine $\Psi$ that can modify the input image as $Y = \Psi(X,X_c)$ such that $\phi(Y,S_o)<\phi(Y,S_t)$, and thereby predict $S_t$ as the sensor label of the perturbed image $Y\!$, while the iris matcher, $M\!$, will successfully match $Y$ with $X$. As a result, the target sensor will be spoofed, while the biometric utility of the image will be retained. This implies that the match score between a pair of perturbed images $[M(Y_1, Y_2)]$ as well as that of a perturbed sample with an original sample, $[M(X_1, Y_2)]$ and $[M(Y_1,X_2)]$, are expected to be similar to the match scores between the original samples $[M(X_1,X_2)]$. The steps used to achieve this task are described next. \begin{table*} \centering \caption{Specifications of the datasets used in this work.} \label{Tab1:Datasets} \scalebox{0.75}{ \begin{tabular}{|llccc|} \hline \textbf{Dataset} & \textbf{Sensor Name (Abbreviation) } & \textbf{Image Size} & \begin{tabular}[c]{@{}l@{}}\textbf{Number of Images Used} \\ \textbf{(Training set+Testing set)}\end{tabular}& \textbf{Number of Subjects} \\ \hline \hline BioCOP 2009 Set I & Aoptix Insight (Aop) & 640$\times$480 & 995 (55+940) & 100 \\ IITD~\cite{IITD} & Jiristech JPC 1000 (JPC) & 320$\times$240 & 995 (55+940) & 100 \\ CASIAv2 Device2~\cite{CASv2} & CASIA-IrisCamV2 (IC) & 640$\times$480 & 995 (55+940) & 50 \\ IIITD Multi-spectral Periocular (NIR subset)~\cite{IIITD} & Cogent (Cog) & 640$\times$480 & 588 (55+533) & 62 \\ ND CrossSensor Iris 2013 Set II~\cite{ND} & LG 4000 (LG40) & 640$\times$480 & 615 (55+560) & 99 \\ MMU2~\cite{MMU} & Panasonic BM-ET 100US Authenticam (Pan) & 320$\times$238 & 55 (55+0) & 6\\ ND Cosmetic Contact Lens 2013~\cite{ND} & IrisGuard IG AD100 (AD) & 640$\times$480 & 55 (55+0)&4\\ WVU Off-Axis & EverFocus Monochrome CCD (Ever)~\cite{WVU} & 640$\times$480 & 55 (55+0)&7\\ CASIAv2 Device 1~\cite{CASv2} & OKI IrisPass-h (OKI) & 640$\times$480 & 55 (55+0)&3\\ CASIAv4-Iris Thousand subset~\cite{CASv4} & IrisKing IKEMB100 (IK) & 640$\times$480 & 55 (55+0)&3 \\ ND CrossSensor Iris 2013 Set I~\cite{ND} & LG 2200 (LG22) & 640$\times$480 & 55 (55+0)&5 \\ \hline \end{tabular}} \end{table*} \begin{algorithm} \small{ \caption{\label{alg:find-candidate}Selection of the candidate image.} \KwIn{An image $X$ from sensor $S_o$, a gallery of images $G = \{X_1, ..., X_L\}$ from the target sensor $S_t$} \KwOut{A candidate image, $X_{c}$, selected from the gallery.} Set static parameters $K=10$ (number of random patches) and $w_p=10, h_p=10$, (patch width and height). Generate a set of $K$ random patch locations $P=\{p_1, \cdots, p_K\}$, where each patch size is $h_p \times w_p$. Compute the average pixel intensity in each patch $p_k\in P$ of the input image $X$ to obtain a vector $\mathbf{v}_X$ (of size $K$). Repeat step 3 for each of the gallery images to obtain a set of vectors $\mathbf{v}_{G_i}$, where, $i = 1,\cdots,L$. The value of $L$ (the target gallery size) depends on the number of test images indicated in the fourth column in Table~\ref{Tab1:Datasets}. Compute the correlation between $\mathbf{v}_X$ and $\mathbf{v}_{G_i}$ corresponding to each gallery image to obtain a set of $L$ correlation scores. Return candidate image $X_{c} \in G$ that has the highest correlation, \ie $X_{c} = X_{f}$ where $f = \displaystyle \argmax_{i\in [1,\cdots,L]} \{Corr(\mathbf{v}_X,\mathbf{v}_{G_i})\}$.} \end{algorithm} \subsection{Deriving perturbations and PRNU Spoofing} \label{Derivingperturbations} Given a single image $X$ from the source sensor $S_o$, a gallery of images $G = \{X_1, ..., X_L\}$ from the target sensor $S_t$, and a set of $K$ random patch locations $P=\{p_1, ..., p_K\}$, we first select a candidate image, $X_c$, $c\in [1,\cdots,L]$, from the gallery to perturb the input image. The candidate image is selected from the gallery such that it is maximally correlated with the input image $X$. To accomplish this goal, we select 10 patches in the input image, each of size $10\times10$ (\ie, $K=10,~h_p=10,~w_p=10$ in Algorithm~\ref{alg:find-candidate}). Now, we compute the average pixel intensity in each of these patches and create a $K$-dimensional vector $\mathbf{v}_X$. Next, for each of the $L$ gallery images, we create $\mathbf{v}_{G_i}$ where $i=[1, \cdots, L]$, by computing the average pixel intensity in the 10 patches selected previously in the input image. Finally, we compute the correlation between the vectors $\mathbf{v}_X$ and $\mathbf{v}_{G_i}$, and select the candidate image with the maximum correlation value. The steps for selecting the candidate image are described in Algorithm~\ref{alg:find-candidate}. After obtaining the candidate image $X_{c}$ from the gallery of the target sensor $S_t$, the perturbations for image $X$ are then derived with the help of $X_{c}$ as described in Algorithm~\ref{alg:perturbations}. The perturbation routine employs the following parameters: (i) $\alpha$ (the learning rate), (ii) $\eta$ (the termination criterion), and (iii) $m$ (the maximum number of iterations). Initially, the output perturbed image $Y^{(0)}$ is identical to the input image $X$. Next, we select a random patch location from $Y^{(0)}$, and create a mask matrix, $\mathit{Mask}$, of the same size as $Y^{(0)}$, such that the elements in $\mathit{Mask}$ are set to 1 for the row and column indices corresponding to the selected patch location. Then, the image $Y^{(0)}$ is perturbed iteratively using pixels from the same patch location in $X_c$. In each iteration, the pixels inside the selected patch are updated along two directions. The candidate image guides the direction of perturbation~\cite{vahidRef}. In the first case the perturbation is along a positive direction (implemented using line 9 in Algorithm~\ref{alg:perturbations}), which generates $Y^u$. The other direction corresponds to a negative perturbation (see line 11 in Algorithm~\ref{alg:perturbations}), which produces $Y^v$. Figure~\ref{fig:algorithm-graphic}(b) illustrates the role of the candidate image in the perturbation routine. Next, the noise residuals extracted from $(Y^u,Y^v)$ are correlated with the reference pattern of the target sensor. The perturbed image yielding the maximum correlation value is then selected as the seed image for the next iteration, $iter$. This process is repeated until the relative difference between the NCC values of perturbed image $Y^{iter}$ with respect to target sensor $S_t$ and the original sensor $S_o$ exceeds 10\%, \ie, $\eta=0.1$, or the maximum number of iterations is reached. The parameters employed in the perturbation routine are selected intuitively; for example, the learning rate is set to a small value $\alpha=0.01$ because our objective is to perturb the image while preserving its biometric utility. \begin{algorithm} \small{ \caption{\label{alg:perturbations}Spoofing PRNU pattern.} \KwIn{An image $X_{h\times w}$ from sensor $S_o$, a candidate image $X_{c}$ from sensor $S_t$, a function $\phi(X,S_i)$ that returns the NCC value when image $X$ is correlated with the PRNU pattern of sensor $S_i$ ($i\in\{o,t\}$).} \KwOut{perturbed image $Y$.} Set static parameters $\alpha=0.01$ (learning rate), $\eta = 0.1$ (threshold), $m = 3000$ (maximum number of iterations) and $h_p=10, w_p=10$ (patch size). Initialize $iter = 0$ and $Y^{(0)} = X$. \Repeat{$\displaystyle \frac{\phi(Y^{(iter)}, S_t) - \phi(Y^{(iter)}, S_o)}{\phi(X, S_o)} > \eta$}{ \nl -- Choose a random patch location $\left(p_x,p_y\right)$ from $[0,\frac{h}{h_p}]$ and $[0,\frac{w}{w_p}]$ such that $0\le p_x<\frac{h}{h_p},0 \le p_y < \frac{w}{w_p}$. \nl -- Construct the mask matrix $\mathit{Mask}$ such that $\mathit{Mask}[i,j]=1$ if $\left(\lfloor \frac{i}{h_p} \rfloor , \lfloor \frac{j}{w_p} \rfloor \right) = \left(p_x,p_y\right)$, and $\mathit{Mask}[i,j]=0$ elsewhere. \nl -- Create a perturbed image in the positive direction $Y^{u} = Y^{(iter)} + \alpha \mathit{Mask}\odot \left(X_c - Y^{(iter)}\right)$. \nl -- Create a perturbed image in the negative direction $Y^{v} = Y^{(iter)} - \alpha \mathit{Mask}\odot \left(X_c - Y^{(iter)}\right)$. \nl -- Compute the NCC values of $Y^u$ and $Y^v$ for the target sensor $S_t$, $\phi(Y^{u},S_t)$ and $\phi(Y^{v},S_t)$, respectively. \nl -- Set $Y^{(iter+1)} = Y^u$ if $\phi(Y^{u},S_t) > \phi(Y^{v},S_t)$, otherwise set $Y^{(iter+1)} = Y^v$, \nl -- $iter++$, \nl -- If $iter>m$ break the loop. } Return the final perturbed image, $Y^{(iter)}.$} \end{algorithm} At the end of the routine, the perturbed image will have to be incorrectly attributed to $S_t$ by the sensor classifier. The steps of the PRNU spoofing algorithm are illustrated in Figure~\ref{fig:algorithm-graphic}(a). The sequence of modified images undergoing the perturbation routine is illustrated for two example iris images in Figure~\ref{fig:Illus_moreeg} \begin{figure*} \begin{center} \includegraphics[width=0.85\linewidth]{figs/DemoPerturbation_View2_Lessimgs.png} \end{center} \caption{Illustration of PRNU spoofing using images belonging to the source sensor JPC and the candidate images belonging to the target sensor Aoptix.} \label{fig:Illus_moreeg} \end{figure*} \section{Experiments and Results} \label{Expts} In this section, we describe the datasets and sensors employed in this work, followed by the experiments conducted on the datasets. Results are reported and analyzed in the context of PRNU spoofing and iris recognition. \subsection{Datasets} Experiments are conducted using 11 different sensors from 11 iris datasets. The PRNU spoofing process typically involves a single source sensor and a single target sensor from the set of 11 sensors. The sensor details and image specifications of the 11 sensors are described in Table~\ref{Tab1:Datasets}. Thus, there can be a total of $\Perms{2}{11} =110$ combinations for PRNU spoofing. However, for the sake of brevity, we performed 20 different PRNU spoofing experiments involving 5 sensors: $\{Aop, JPC, IC, Cog, LG40\}$. From the set of 5 sensors listed above, each sensor serves as the source sensor while the remaining 4 sensors serve as target sensors one at a time, thus resulting in 20 different PRNU spoofing experiments. \begin{table*}[h] \centering \caption{Confusion matrix for sensor identification involving unperturbed but resized images. The test noise residuals of images from 5 sensors are compared against reference patterns from 11 sensors. The last column indicates sensor identification accuracy.} \label{ConfMat_Ori} \scalebox{0.85}{ \begin{tabular}{|l|lllllllllll||l|} \hline \diagbox[width=5em]{\scriptsize{Actual}}{\scriptsize{Predicted}} & Aop & JPC & IC & Cog & \small{LG 40} & Pan&AD&Ever&OKI&IK& \small{LG 22} & \begin{tabular}[c]{@{}l@{}}Accuracy \\(\%)\end{tabular} \\ \hline Aop & \textbf{900} & 1 & 2 & 1 & 9 &4&3&3&9&7&1 & 95.74 \\ JPC & 2 & \textbf{919} & 4 & 2 &5 &0&0&4&1&2&1 & 97.77 \\ IC & 0 & 0 & \textbf{940} & 0 & 0 &0&0&0&0&0&0 & 100 \\ Cog & 2 & 1 & 2 & \textbf{546} & 2 &0&2&0&0&5&0 & 97.51 \\ LG40 & 0 & 0 & 0 & 0 & \textbf{529} & 0&0&3&1&0&0 & 99.25 \\ \hline \end{tabular}} \end{table*} \subsection{Sensor identification before PRNU spoofing} Due to variations in image size of the source and target sensors, all images were resized to a fixed spatial resolution of 160 $\times$ 120 to facilitate PRNU spoofing. We then evaluated the sensor identification accuracy based on these resized images prior to PRNU spoofing. This is to determine if resizing impacts sensor identification accuracy. The sensor identification involves deriving sensor reference patterns using 55 training images, as used in~\cite{Ross_IWBF_17} from each of the 11 sensors, followed by extraction of test noise residuals from images belonging to the 5 sensors, and finally correlating them. The subjects in the training set and the test set are disjoint. The sensor identification accuracy and the corresponding confusion matrix is presented in Table~\ref{ConfMat_Ori}. The results indicate a very high sensor identification accuracy using the MLE PRNU scheme on the resized images. So we use the resized images in the experiments below. \subsection{Sensor identification after PRNU spoofing} \label{B1B2_Reference} The PRNU spoofing process involves perturbing the original image from a source sensor using a candidate image belonging to the target sensor, whose PRNU needs to be spoofed. The impact of the perturbations on spoofing the PRNU pattern has been reported in terms of \textit{Spoof Success Rate} (SSR), which computes the proportion of test images from the source sensor classified as belonging to the target sensor after perturbing using Algorithm~\ref{alg:perturbations}. The results of spoofing are presented in Table~\ref{Tab:PerturbAop}. We implemented Baseline 1 and Baseline 2 algorithm described in Section~\ref{RelatedWork}. Baseline 2 is implemented following normalization of the source and target reference patterns with respect to the maximum intensity of the PRNU present in the two reference patterns. The normalization is required to account for the variation in the PRNU strength associated with different sensors. Ideally, the scalar terms $\gamma$ and $\beta$, which serve as parameters in the baseline algorithm, need to be optimized through grid-search for a specific pair of source ($S_o$) and target ($S_t)$ sensors. However, we set the scalars to a static value of 1 for two reasons: (i) for ease of computation and (ii) to provide fair comparison with the proposed algorithm which also uses fixed values of parameters for all pairs of sensors. The baseline algorithms are state-of-the art to the best of our knowledge and are, therefore, used for comparative evaluation. Examples of perturbed outputs of images spoofed using Baseline 1, Baseline 2, and the proposed algorithm are presented in Figure~\ref{fig:demoperturbed}. \begin{table*}[t] \centering \caption{Results of PRNU spoofing where the target sensors (along the second column) are spoofed by perturbing the images from 5 source sensors, namely, Aop, JPC, IC, Cog and LG40 (along the first column). The test noise residual after the perturbation process is compared against the reference patterns of 11 sensors (see Table~\ref{Tab1:Datasets}). The last 3 columns indicate the proportion of the perturbed images successfully classified as belonging to the target sensor and is denoted as the Spoof Success Rate (SSR). The highest values of the SSR are bolded.} \label{Tab:PerturbAop} \scalebox{0.8}{ \begin{tabular}{|l|l|lllllllllll|c|c|c|} \hline \begin{tabular}[c]{@{}l@{}}Original\\ Sensor\end{tabular} & \begin{tabular}[c]{@{}l@{}}Target \\ Sensor\end{tabular} & \multicolumn{11}{c|}{Sensor classes compared against perturbed PRNU} & \begin{tabular}[c|]{@{}l@{}}SSR (\%) for \\proposed method \end{tabular} & \begin{tabular}[c|]{@{}l@{}}SSR (\%) for \\Baseline 1\end{tabular} & \begin{tabular}[c|]{@{}l@{}}SSR (\%) for \\Baseline 2\end{tabular}\\ \hline \multirow{5}{*}{Aop} & & Aop & JPC & IC & Cog & LG40 & Pan & AD & Ever & OKI & IK & LG22 & & & \\ \cline{3-13} & JPC & 4 & \textbf{894} & 3 & 3 & 8 & 2 & 2 & 2 & 9 & 12 & 1 &\textbf{ 95.11} & 92.55 &67.98 \\ & IC & 21 & 0 & \textbf{891} & 0 & 6 & 2 & 1 & 5 & 6 & 5 & 3 & \textbf{94.79} & 92.77 &13.51 \\ & Cog & 7 & 2 & 3 & \textbf{890} & 7 & 5 & 2 & 2 & 13 & 5 & 4 & \textbf{94.68} & 79.89 &0.21 \\ & LG40 & 66 & 4 & 4 & 4 & \textbf{836} & 3 & 0 & 4 & 7 & 8 & 4 & \textbf{88.94} & 79.15 &10.00 \\ \hline \hline \multirow{4}{*}{JPC} & Aop & \textbf{905} & 18 & 3 & 3 & 4 & 0 & 0 & 2 & 2 & 2 & 1 & \textbf{96.28} & 49.15 &1.91 \\ & IC & 2 & 209 & \textbf{712} & 2 & 4 & 2 & 1 & 3 & 2 & 2 & 1 & 75.74 & 99.79 &\textbf{100} \\ & Cog & 3 & 94 & 4 & \textbf{817} & 5 & 5 & 0 & 5 & 2 & 1 & 4 & \textbf{86.91 } & 35.53 &0.21 \\ & LG40 & 1 & 61 & 3 & 1 & \textbf{861} & 5 & 0 & 3 & 1 & 2 & 2 & \textbf{91.60} & 8.09 &9.26 \\ \hline \hline \multirow{4}{*}{IC} & Aop & \textbf{910} & 0 & 30 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \textbf{96.81 } & 48.72 &0 \\ & JPC & 0 & \textbf{797} & 143 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 84.79 & \textbf{100}&53.09 \\ & Cog & 0 & 0 & 243 & \textbf{697} & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \textbf{74.15} & 46.70&0 \\ & LG40 & 0 & 0 & 46 & 0 & \textbf{894} & 0 & 0 & 0 & 0 & 0 & 0 &\textbf{95.11 } & 1.91 &0.11 \\ \hline \hline \multirow{4}{*}{Cog} & Aop & \textbf{552} & 0 & 0 & 0 & 2 & 0 & 2 & 0 & 0 & 4 & 0 & 98.57 & \textbf{100}&38.57 \\ & JPC & 1 & \textbf{546} & 0 & 0 & 1 & 0 & 2 & 2 & 0 & 8 & 0 & 97.50 & \textbf{100}&\textbf{100} \\ & IC & 2 & 0 & \textbf{545} & 2 & 2 & 0 & 2 & 0 & 1 & 5 & 1 & 97.32 & \textbf{100}&\textbf{100} \\ & LG40 & 1 & 0 & 0 & 0 & \textbf{550} & 0 & 2 & 1 & 0 & 6 & 0 & \textbf{98.21} & 82.32 &35.00 \\ \hline \hline \multirow{4}{*}{LG40} & Aop & \textbf{330} & 0 & 3 & 0 & 198 & 0 & 0 & 0 & 1 & 1 & 0 & \textbf{61.91} & 9.94&1.31 \\ & JPC & 0 & \textbf{491} & 0 & 0 & 38 & 0 & 0 & 2 & 1 & 1 & 0 &\textbf{92.12} & 9.38 &24.20 \\ & IC & 0 & 0 & \textbf{393} & 0 & 136 & 0 & 0 & 3 & 1 & 0 & 0 & 73.73 & 11.44&\textbf{99.44} \\ & Cog & 0 & 0 & 0 & \textbf{479} & 50 & 0 & 0 & 2 & 1 & 1 & 0 &\textbf{89.87} & 4.69 &0.19 \\ \hline \hline \multicolumn{13}{|l|}{\textbf{Average SSR (\%)}}& \textbf{89.21}& 57.60&32.75 \\ \hline \end{tabular}} \end{table*} \textbf{Results in Table~\ref{Tab:PerturbAop} indicate that 15 out of 20 times the proposed algorithm outperforms Baseline 1 technique, and performs considerably better than Baseline 2 method 16 out of 20 times. The average SSR of the proposed algorithm outperforms the baseline algorithms by a significant margin.} We believe that the parameters $\gamma$ and $\beta$ need to be tuned accurately for each pair of source and target sensors to ensure the success of the baseline algorithms. On the other hand, the proposed algorithm is successful for static parameter values: the size of patches ($h_p\times w_p$), the threshold $\eta$, the learning rate $\alpha$, and the number of patches ($K$) (see Section~\ref{Derivingperturbations}). The PRNU is successfully spoofed by the proposed method in most of the cases barring the case where the target sensor is Aoptix and the source sensor is LG 4000 ($\approx$62\% SSR). Inspection of the images acquired using LG 4000 sensor reveals the presence of image padding, which may negatively impact the PRNU spoofing process. Figure~\ref{Fig:Results_Perturb} shows an input image undergoing iterative perturbations. The original (unperturbed) image belongs to the Aoptix sensor and is perturbed using a candidate image from the target sensor, Cogent. The subsequent shift of the NCC values from being the highest for the source sensor (Aoptix) to being the highest for the target sensor (Cogent), indicates the success of the proposed method. \begin{figure}[h] \centering \includegraphics[width=0.7\linewidth]{figs/Figure4_NEWEDIT.png} \caption{\label{fig:demoperturbed}Example of PRNU spoofed images originating from the JPC 1000 sensor (first column) is illustrated for Baseline 1 (second column), Baseline 2 (third column) and the proposed method (last column). Here, the target sensor is Aoptix.} \end{figure} The average number of iterations required for successful PRNU spoofing varied between 200 to 2200. Another experiment is conducted to study the impact of increasing the number of iterations on the proposed PRNU spoofing process. This experiment is conducted for the specific case where the source sensor is LG 4000 and the target to be spoofed is the Aoptix sensor. The reason for selecting this pair is due to the poor SSR reported for this specific set of sensors (see the fifth block in Table~\ref{Tab:PerturbAop}). We speculate that with an increase in the number of iterations, the PRNU spoofing process will succeed and improve the SSR as a result. In this regard, in the new experimental set-up, the maximum number of iterations was set to 6000 (twice the earlier terminating criterion). As a result, the SSR increased considerably from 61.91\% to 79.73\%, \ie, a $\approx$ 18\% increase was observed. 425 out of 533 test images belonging to the LG 4000 sensor were successfully classified as originating from the Aoptix sensor when the number of iterations was increased. \begin{figure}[h] \centering \includegraphics[width=0.98\linewidth]{figs/Figure5_NEW.png} \caption{\label{Fig:Results_Perturb}Intermediate images generated when an image from the Aoptix ($S_o$) sensor is perturbed using a candidate image from Cogent ($S_t$). For the sake of brevity, NCC values corresponding to the reference patterns of the first 5 sensors in Table~\ref{Tab1:Datasets} are mentioned in the figure. The arrows indicate the increase in the NCC values corresponding to the target sensor.} \end{figure} \subsection{Retaining biometric matching utility} \label{IrisMatching} The impact of the perturbations on iris recognition performance is evaluated next using the VeriEye iris matcher~\cite{VeriEye}. We designed three experiments for analyzing biometric matching performance. First, the match scores between all pairs of iris samples before perturbation were computed. In the second experiment, we computed the match scores between all pairs of perturbed samples. In the third experiment, we computed match scores between all iris samples before perturbation and all samples after perturbation. This is referred to as the cross-matching scenario. In the third set of experiments, the genuine scores are computed by employing 2 sample images (from the same subject): one sample belonging to the set of unperturbed images and the other sample from the set of perturbed images. The impostor scores are generated by pairing samples belonging to different subjects: one image is taken from the set of unperturbed images, while the other is taken from the set of perturbed images. \begin{figure*} \centering \includegraphics[width=0.98\linewidth]{figs/results-verieye-matching_NEW.png} \caption{\label{fig:roc-matching}ROC curves of matching performance obtained using the VeriEye iris matcher software. The terms `Original', `Perturbed' and `Original vs. Perturbed' indicate the three different matching scenarios (see Section~\ref{IrisMatching}). `Original' indicates matching only unperturbed images; `Perturbed' indicates matching only perturbed images; `Original vs. Perturbed' indicates the cross-matching case where unperturbed images are matched against perturbed images. Note that the curves obtained from perturbed images match very closely with the curves corresponding to the unperturbed images illustrating preservation of iris recognition for each sensor depicted in each column. The results are compared with Baseline 1 and 2 algorithms discussed in Section~\ref{B1B2_Reference}.} \end{figure*} Figure~\ref{fig:roc-matching} shows the ROC curves obtained from these three experiments. The ROC curves confirm that the perturbed images do not negatively impact the matching utility. In the case of all the sensors, the ROC curves of the perturbed images are within a $1\%$ deviation from the ROC curve of the original samples before perturbation, except for the IrisCam (IC) sensor. Further, we note that the matching performance of original samples from the Cogent (Cog) sensor is degraded to begin with. We believe the reason for this degraded performance is due to the low quality of the original images. Yet, perturbations have not further deteriorated the matching performance, as evidenced by the before- and after-perturbation ROC curves that are very similar to each other. In addition, the iris recognition performance after PRNU spoofing using the baseline algorithms is analyzed. The results indicate that the proposed method is comparable to the baseline algorithms in terms of iris recognition performance. Furthermore, we conducted a fourth experiment, where we analyzed the matching performance of those LG4000 iris images that were perturbed to spoof the Aoptix sensor after increasing the number of iterations. The result confirms that increasing the number of iterations to improve the SSR does not degrade matching performance, as is evident in Figure~\ref{fig:roc-matching-und-more}. \paragraph{In summary, the following salient observations in the context of both PRNU spoofing and iris recognition preservation can be made.} \begin{itemize} \item The PRNU pattern of a sensor can be successfully spoofed by \textit{directly} modifying an input image, without invoking the sensor reference pattern of the target sensor. Experiments are conducted using 11 iris sensors, and the PRNU spoofing process is demonstrated using 5 sensors and compared with existing approaches. Results show that the proposed spoofing method outperforms Baseline 1 by 31.6\% and Baseline 2 by 56.4\% in terms of average spoof success rate. \item The proposed spoofing algorithm uses identical parameters, such as the size of patches and learning rate for all pairs of source and target sensors. This obviates the need to fine tune the method for different pairs of sensors. \item The iris recognition performance of the images perturbed using the proposed algorithm is retained within 1\% of the original. This suggests the success of the proposed spoofing method in retaining the biometric utility of the modified images. \end{itemize} \section{Summary and Future Work} \label{Summary} In this work, we design a method for PRNU spoofing that preserves biometric recognition in the context of NIR iris images. In the proposed strategy, a test image belonging to a particular sensor is modified iteratively using patches from a candidate image belonging to a target sensor, whose PRNU is to be spoofed. We examine the impact of these perturbations on PRNU spoofing as well as iris recognition performance. Experiments are conducted in this regard using 11 sensors and compared with two existing PRNU spoofing algorithms. Results show that the proposed method can successfully spoof the PRNU pattern of a target sensor and does not significantly impact the iris recognition performance in a majority of the cases. \par Future work will involve testing the proposed PRNU spoofing process on a larger set of sensors and analyzing the impact of the number of candidate images on the spoof success rate. The iterative spoofing routine can be expedited by perturbing multiple image patches simultaneously (instead of one patch at a a time). Finally, we will look into developing new sensor identification schemes that are resilient to spoof attacks as well as methods to detect such attacks. \begin{figure} \centering \includegraphics[width=0.7\linewidth]{figs/results-verieye-matching_und-aop-more.eps} \caption{\label{fig:roc-matching-und-more} Impact of increase in the number of iterations on iris recognition performance for the pair of LG 4000 (source) and Aoptix (target) sensors. } \end{figure} \section*{Acknowledgement} We would like to thank Denton Bobeldyk and Steven Hoffman from the iPRoBe Lab for sharing their iris recognition code. This material is based upon work supported by the National Science Foundation under Grant Number $1618518$. {\small \bibliographystyle{ieee} \balance
\section{Introduction} Un {\em empilement de disques} est un ensemble de disques d'intérieurs disjoints. Il est dit {\em compact} si le graphe qui relie les centres des disques tangents est triangulé, c'est-à-dire que les interstices entre les disques sont tous des triangles curvilignes (notion introduite par L\'aszl\'o Fejes T\'oth dans \cite{FT64}).\\ Il n'y a qu'un seul empilement compact avec des disques tous identiques, celui où les disques sont centrés sur les sommets du réseau triangulaire ({\em empilement hexagonal compact}). Les empilements compacts avec deux tailles de disque ont été classifiés dans \cite{Ken06}. Il y a neuf ratios de rayons possibles. Dans tous les cas, l'empilement compact le plus dense est périodique (même si des empilements apériodiques peuvent être possibles). De plus, dans $7$ des $9$ cas, il a également été montré que l'empilement le plus dense avec ces deux tailles de disque est un empilement compact (\cite{Hep00,Hep03,Ken04}).\\ On s'intéresse ici aux empilements compacts avec des disques de rayon $s<r<1$, où chaque type de disque apparaît. Sauf précision contraire, un ``empilement'' désignera un tel empilement dans tout ce qui suit. Ce problème a été examiné dans \cite{Mes17}, où il est montré qu'il y a au plus $11462$ couples $(r,s)$ possibles. Plusieurs exemples d'empilements sont donnés, mais l'auteur suggère qu'une caractérisation complète est hors de portée des moyens de calcul informatiques actuels. On montre ici : \begin{theorem} \label{th:164} Il y a exactement $164$ couples $(r,s)$ permettant un empilement. \end{theorem} Les empilements possibles ne sont pas tous classifiés : on se contente d'en exhiber un, périodique, pour chaque valeur. La question de dé\-ter\-miner quels sont les empilements les plus denses reste ouverte. En particulier, en existe-t-il toujours un périodique ? Reste également ouverte la question de savoir si, quand ils existent, ces empilements maximisent la densité parmi {\em tous} les empilements, {\em i.e.}, sans hypothèse de compacité. \section{Notations} Le grand disque est supposé de rayon $1$. On note $r$ et $s$ les rayons du moyen et du petit disque, avec $0<s<r<1$. On appelle {\em couronne} d'un disque dans un empilement compact saturé l'ensemble des disques auquel il est tangent. Elle est dite {\em petite}, {\em moyenne} ou {\em grande} selon que le disque entouré est petit, moyen ou grand. Un {\em codage} d'une couronne est un mot formé des rayons des disques qui la constituent, ordonnés de sorte à ce que l'un soit tangent au suivant et le dernier au premier. Toute permutation circulaire ou renversement de ce mot correspond à la même couronne : on choisira généralement l'écriture minimale pour l'ordre lexicographique. \'Etant donnés des disques de rayons $x$, $y$ et $z$ deux à deux tangents, on note $\widehat{xyz}$ l'angle non-orienté entre les segments reliant le centre du disque de rayon $y$ aux deux autres centres. La figure~\ref{fig:notations} illustre cela. \begin{figure} \centering \includegraphics[width=0.4\textwidth]{angle.pdf} \caption{La petite couronne $1rsrs$ et l'angle $\widehat{rs1}$.} \label{fig:notations} \end{figure} \section{Petites couronnes} \label{sec:petites} Une petite couronne est formée d'au plus $6$ disques, et dans ce cas ce sont nécessairement tous des petits disques (c'est l'empilement hexagonal habituel). Si elle comporte un disque moyen ou un grand, elle est donc formée d'au plus $5$ disques. En particulier, il y a un nombre fini de petites couronnes différentes, quelque soient les valeurs de $r$ et $s$. On va ici toutes les expliciter.\\ \noindent Soit $P_{\vec{k}}(r,s)$ la fonction définie pour $\vec{k}\in\mathbb{N}^6$ et $1>r>s>0$ par $$ P_{\vec{k}}(r,s):=k_1\widehat{1s1}+k_2\widehat{1sr}+k_3\widehat{1ss}+k_4\widehat{rsr}+k_5\widehat{rss}+k_6\widehat{sss}. $$ Les six angles impliqués sont ceux qui, dans un triangle rejoignant les centres de trois disques deux à deux tangents, peuvent apparaître au centre d'un petit disque. Le vecteur $\vec{k}$ sera appelé {\em vecteur d'angles}. Une petit couronne correspond alors une solution de l'équation \begin{equation}\label{eq:petite_couronne} P_{\vec{k}}(r,s)=2\pi. \end{equation} Chacun des six angles impliqués, vu comme une fonction de $r$ et $s$, est croissant en $r$ et décroissant en $s$. La fonction $P_{\vec{k}}$ est donc majorée par sa limite en $(1,0)$ et minorée par sa plus petite limite sur la diagonale $r=s$. On calcule $$ \lim_{r\to 1\atop s\to 0}P_{\vec{k}}(r,s)=k_1\pi+k_2\pi+k_3\frac{\pi}{2}+k_4\pi+k_5\frac{\pi}{2}+k_6\frac{\pi}{3}, $$ $$ \inf_{r}\lim_{s\to r}P_{\vec{k}}(r,s)=\lim_{r\to 1\atop s\to 1}P_{\vec{k}}(r,s)=k_1\frac{\pi}{3}+k_2\frac{\pi}{3}+k_3\frac{\pi}{3}+k_4\frac{\pi}{3}+k_5\frac{\pi}{3}+k_6\frac{\pi}{3}. $$ Comme tous ces angles, excepté $\widehat{sss}$, sont de plus {\em strictement} décroissants en $s$, $P_{\vec{k}}$ n'atteint pas son maximum sur l'ouvert $1>r>s>0$ et les bornes sont strictes, sauf si $k_1=k_2=k_3=k_4=k_5=0$, ce qui correspond à une petite couronne formée de $6$ petits disques. Outre ce cas, l'équation $P_{\vec{k}}(r,s)=2\pi$ a donc une solution si et seulement si \begin{equation} k_1+k_2+k_3+k_4+k_5+k_6< 6<3k_1+3k_2+\frac{3}{2}k_3+3k_4+\frac{3}{2}k_5+k_6. \end{equation} Cette condition donne $383$ valeurs de $\vec{k}$ possibles. Pour qu'une valeur de $\vec{k}$ corresponde réellement à une couronne, il faut aussi qu'il existe, dans le graphe représenté Fig.~\ref{fig:couronnable}, un cycle tel que $\vec{k}$ compte les passages de ce cycle dans chaque type d'arête. Une boucle de ce graphe peut ne pas être empruntée par le cycle, mais si elle l'est il faut pouvoir y accéder, à moins que le cycle n'emprunte qu'elle. Ceci se traduit par les trois conditions \begin{eqnarray} (k_1=0) \lor (k_2\neq 0 \lor k_3\neq 0) \lor (k_2=k_3=k_4=k_5=k_6=0)\\ (k_4=0) \lor (k_2\neq 0 \lor k_5\neq 0) \lor (k_1=k_2=k_3=k_5=k_6=0)\\ (k_6=0) \lor (k_3\neq 0 \lor k_5\neq 0) \lor (k_1=k_2=k_3=k_4=k_5=0) \end{eqnarray} Outre ces boucles, le cycle fait $k_0:=\min(k_2,k_3,k_5)$ tours entre les trois sommets, plus éventuellement quelques aller-retours qui empruntent un nombre pair de fois chaque arête par laquelle ils passent. Ceci se traduit par les conditions \begin{equation} k_2-k_0\in2\mathbb{N},\qquad k_3-k_0\in2\mathbb{N},\qquad k_5-k_0\in2\mathbb{N}. \end{equation} \begin{figure} \centering \includegraphics[width=0.3\textwidth]{couronnable.pdf} \caption{Les cycles de ce graphe codent les couronnes associées à $\vec{k}$.} \label{fig:couronnable} \end{figure} Toutes les conditions précédentes réduisent à $56$ le nombre de vecteurs d'angles possibles. La table~\ref{tab:petites_couronnes} donne un codage des couronnes correspondantes\footnote{Un vecteur d'angles pourrait correspondre à des couronnes différentes. Par exemple, $\vec{k}=(0,2,2,0,2,0)$ correspond à 1rsr1s, 1r1srs, 1rs1sr et 1rs1rs. Mais ce n'est jamais le cas ici.}.\\ \begin{table}[hbtp] \centering \begin{tabular}{cccccccccc} rrrrr & rrrrs & rrrss & rrsrs & rrrr & rrsss & rsrss & rrrs & rrr & rrss\\ 11111 & 1111s & 111ss & 11s1s & 1111 & 11sss & 1s1ss & 111s & 111 & 11ss\\ 1111r & 111rs & 11rss & 11srs & 111r & 1rsss & 1srss & 11rs & 11r & 1rss\\ 111rr & 11r1s & 1r1ss & 1rs1s & 11rr & & & 1r1s & 1rr & \\ 11r1r & 11rrs & 1rrss & 1rsrs & 1r1r & & & 1rrs & & \\ 11rrr & 1r1rs & r1rss & rrs1s & 1rrr & & & r1rs & & \\ 1r1rr & 1rr1s & & & & & & & & \\ 1rrrr & 1rrrs & & & & & & & & \\ & r11rs & & & & & & & & \\ & r1rrs & & & & & & & & \\ \end{tabular} \caption{ Les $55$ petites couronnes possibles, outre $ssssss$. Les couronnes de la première ligne n'ont pas de grand disque, celles de la deuxième n'ont pas de moyen disque. Les codages d'une même colonne ont tous la même image par l'application qui remplace chaque 1 par un r (utilisé dans le lemme~\ref{lem:ratio_minimal}). } \label{tab:petites_couronnes} \end{table} \section{Polynôme associé à une petite couronne} \label{sec:equation} En prenant le cosinus de chaque membre de l'équation \ref{eq:petite_couronne} puis en développant grâce aux formules d'addition et aux polynômes de Tchebychev, on obtient une équation polynomiale à coefficients entiers en les sinus et cosinus des six angles impliquées dans $P_{\vec{k}}(r,s)$. La loi des cosinus permet d'exprimer les cosinus des angles $\widehat{1s1}$, $\widehat{1sr}$, $\widehat{1ss}$, $\widehat{rsr}$, $\widehat{rss}$ et $\widehat{sss}$ en fonction de $r$ et $s$ (dans cet ordre) : $$ 1-\frac{2}{(1+s)^2},\quad 1-\frac{2r}{(r+s)(1+s)},\quad \frac{s}{1+s},\quad 1-\frac{2r^2}{(r+s)^2},\quad \frac{s}{r+s},\quad \frac{1}{2}. $$ Le carré des sinus s'en déduit (dans le même ordre) : $$ \frac{4s(s+2)}{(s + 1)^4},\quad \frac{4rs(r + s + 1)}{(s + 1)^2(r + s)^2},\quad \frac{2s + 1}{(s + 1)^2},\quad \frac{4s(2r + s)r^2}{(r + s)^4},\quad \frac{r(r + 2s)}{(r + s)^2},\quad \frac{3}{4}. $$ On exprime les sinus eux-mêmes avec des variables auxiliaires : $$ \frac{2X_1}{(s + 1)^2},\quad \frac{2X_2}{(s + 1)(r + s)},\quad \frac{X_3}{s + 1},\quad \frac{2rX_4}{(r + s)^2},\quad \frac{X_5}{r + s},\quad \frac{X_6}{2}, $$ où les carrés des $X_i$ valent respectivement $$ s(s+2),\quad rs(r+s+1),\quad 2s+1,\quad s(2r+s),\quad r(r + 2s),\quad 3. $$ Ceci donne un système d'équations polynomiales à coefficients entiers en les variables $r$, $s$ et $X_1,\ldots,X_6$. Quitte à remplacer $X_i^2$ par son expression en $r$ et $s$, on peut toujours supposer que $X_i$ n'apparaît jamais à une puissance $k\geq 2$. On élimine ensuite successivement les $X_i$ qui restent en remarquant : $$ AX_i+B=0~\Rightarrow~ A^2X_i^2-B^2=0. $$ On obtient un polynôme entier bivarié dont les valeurs de $r$ et $s$ compatibles avec la petite couronne considérée sont racines. Il peut y avoir d'autres racines (l'élimination des $X_i$ n'est pas bijective) qu'il faudra écarter {\em in fine} en vérifiant l'équation \ref{eq:petite_couronne}. On peut aussi simplifier le polynôme en supprimant les multiplicités des facteurs, ainsi que les facteurs qui n'ont pas de racine $0<s<r<1$.\\ \begin{table}[hbtp] \centering \begin{tabular}{lll} 11111 & $5s^4+20s^3+10s^2-20s+1$ & $0.701$ \\ 1111s & $s^4 - 10s^2 - 8s + 9$ & $0.637$ \\ 111ss & $s^8 - 8s^7 - 44s^6 - 232s^5 - 482s^4 - 24s^3 + 388s^2 - 120s + 9$ & $0.545$ \\ 11s1s & $8s^3 + 3s^2 - 2s - 1$ & $0.533$ \\ 1111 & $s^2 + 2s - 1$ & $0.414$ \\ 11sss & $9s^4 - 12s^3 - 26s^2 - 12s + 9$ & $0.386$ \\ 1s1ss & $s^4 - 28s^3 - 10s^2 + 4s + 1$ & $0.349$ \\ 111s & $2s^2 + 3s - 1$ & $0.280$ \\ 111 & $3s^2 + 6s - 1$ & $0.154$ \\ 11ss & $s^2 - 10s + 1$ & $0.101$ \end{tabular} \caption{Couronne, polynôme minimal et valeur approchée de $s$.} \label{tab:petites_couronnes_deux_disques} \end{table} En procédant ainsi, on obtient un polynôme univarié en $s$ pour les $10$ petites couronnes qui n'ont pas de moyen disque (Tab.~\ref{tab:petites_couronnes_deux_disques}). Chacune des $10$ petites couronnes sans grand disque donne le même polynôme que la couronne où $r$ a été remplacé par $1$, avec la variable $\tfrac{s}{r}$ au lieu de $s$. Les $35$ autres petites couronnes donnent un polynôme explicite mais parfois assez complexe (Tab.~\ref{tab:degre_petites_couronnes}). Par exemple, 11rs donne : $$ r^2s^4 - 2r^2s^3 - 2rs^4 - 23r^2s^2 - 28rs^3 + s^4 - 24r^2s - 58rs^2 - 2s^3 + 16r^2 - 8rs + s^2. $$ \begin{table}[hbtp] \centering \begin{tabular}{lr|lr|lr|lr|lr} 1r1r & $2$ & 11rr & $4$ & 1rrsr & $6$ & 1rsss & $8$ & 111rr & $12$ \\ 1r1s & $2$ & 1rss & $4$ & 1111r & $7$ & 1srrs & $8$ & 11rrr & $12$ \\ 1rsr & $2$ & 11r1s & $6$ & 11r1r & $7$ & 1srss & $8$ & 111rs & $18$ \\ 111r & $3$ & 11rs & $6$ & 1rs1s & $7$ & 1r1rr & $10$ & 1rrrs & $18$ \\ 11r & $3$ & 11rsr & $6$ & 11srs & $8$ & 1rrrr & $10$ & 11rss & $24$ \\ 1rr & $3$ & 1rr1s & $6$ & 1r1ss & $8$ & 1rsrs & $10$ & 1rrss & $24$ \\ 1rrr & $3$ & 1rrs & $6$ & 1rssr & $8$ & 1r1rs & $11$ & 11rrs & $28$ \\ \end{tabular} \caption{Degré du polynôme en $r$ et $s$ imposé par chaque petite couronne. \label{tab:degre_petites_couronnes} \end{table} \section{Moyennes couronnes et polynômes associés} \label{sec:moyennes} Un moyen disque peut être entouré d'un nombre arbitrairement grand de petits disques si ceux-ci sont suffisamment petits. Il y a donc un nombre infini de moyennes couronnes. Mais les empilements considérés contiennent toujours un petit disque, donc une petite couronne qui, elle, donne une contrainte sur la taille des disques : \begin{lemma} \label{lem:ratio_minimal} Le ratio $\tfrac{s}{r}$ est uniformément minoré dans les empilements. \end{lemma} \begin{proof} Considérons un empilement. Par définition, il contient des disques de toutes les tailles. Il contient donc une petite couronne différente de ssssss. Remplacer tous les 1 par des r (sans changer les autres lettres) dans ce codage s'avère donner le codage d'une autre petite couronne (voir Table~\ref{tab:petites_couronnes}). De plus, dans cette nouvelle petite couronne, le ratio $\tfrac{s}{r}$ est plus petit que dans la couronne originale. En effet, les gros disques ayant été ``dégonflés'' en moyens, le périmètre de la couronne a diminué, donc la taille du disque qu'elle entoure aussi. Or il n'y a que $10$ ratios $\tfrac{s}{r}$ possibles pour une couronne de disques de tailles $s<r$ autour d'un disque de taille $s$ (Table~\ref{tab:petites_couronnes_deux_disques}). \end{proof} Soit $\alpha$ la minoration de $\tfrac{s}{r}$ donné par une petite couronne de l'empilement considéré. On a alors un nombre fini de moyennes couronnes possibles. Plus précisément, soit $M_{\vec{l}}(r,s)$ la fonction définie pour $\vec{l}\in\mathbb{N}^6$ et $1>r>s>\alpha r$ par $$ M_{\vec{l}}(r,s):=l_1\widehat{1r1}+l_2\widehat{1rr}+l_3\widehat{1rs}+l_4\widehat{rrr}+l_5\widehat{rrs}+l_6\widehat{srs}. $$ Les angles impliqués sont tous strictement décroissants en $r$, sauf $\widehat{rrr}$ (qui n'apparaît seul que dans la couronne rrrrrr qu'on ignore ici) et tous croissants en $s$. La fonction $M_{\vec{l}}$ est donc strictement majorée par sa plus grande limite sur la diagonale $r=s$ et strictement minorée par sa plus petite limite sur la droite $\tfrac{s}{r}=\alpha$. D'un côté on a $$ \lim_{s\to r}M_{\vec{l}}(r,s)=l_1\widehat{1r1}+(l_2+l_3)\widehat{1rr}+(l_4+l_5+l_6)\frac{\pi}{3}, $$ d'où $$ \sup_r\lim_{s\to r}M_{\vec{l}}(r,s)=l_1\pi+(l_2+l_3)\frac{\pi}{2}+(l_4+l_5+l_6)\frac{\pi}{3}. $$ De l'autre côté, la loi des cosinus permet de montrer $$ \lim_{\tfrac{s}{r}\to\alpha}\cos(\widehat{rrs})=\frac{1}{1+\alpha} \quad\textrm{et}\quad \lim_{\tfrac{s}{r}\to\alpha}\cos(\widehat{srs})=1-\frac{2\alpha^2}{(1+\alpha)^2}. $$ Comme $\widehat{1rs}\geq \widehat{rrs}$, on en déduit $$ \lim_{\tfrac{s}{r}\to\alpha}M_{\vec{l}}(r,s)\geq (l_1+l_2+l_4)\frac{\pi}{3}+(l_3+l_5)u_\alpha+l_6v_\alpha, $$ où $$ u_\alpha:=\arccos\left(\frac{1}{1+\alpha}\right) \quad\textrm{et}\quad v_\alpha:=\arccos\left(1-\frac{2\alpha^2}{(1+\alpha)^2}\right). $$ Une moyenne couronne correspond à une solution de l'équation $M_{\vec{l}}=2\pi$. L'existence d'une moyenne couronne impose donc \begin{equation} l_1+l_2+l_4+\frac{3}{\pi}(l_3u_\alpha+l_5u_\alpha+l_6v_\alpha)< 6< 3l_1+\frac{3}{2}l_2+\frac{3}{2}l_3+l_4+l_5+l_6. \end{equation} Comme une moyenne couronne a au plus $5$ disques moyens ou grands, on a aussi \begin{equation} l_1+l_2+l_4+\frac{1}{2}(l_3+l_5)<6. \end{equation} Combinée avec des conditions de cycle similaires au cas des petites couronnes, on en déduit une majoration du nombre de moyennes couronnes possibles selon la minoration $\alpha$ de $\tfrac{s}{r}$ donnée par une petite couronne de l'empilement (Tab.~\ref{tab:nombre_moyennes_couronnes}).\\ \begin{table}[hbtp] \centering \begin{tabular}{c|c|c|c|c|c|c|c|c|c} $0.701$ & $0.637$ & $0.545$ & $0.533$ & $0.414$ & $0.386$ & $0.349$ & $0.280$ & $0.154$ & $0.101$\\ $84$ & $94$ & $130$ & $143$ & $197$ & $241$ & $272$ & $386$ & $889$ & $1654$ \end{tabular} \caption{Majoration du nombre de moyennes couronnes en fonction de $\alpha$.} \label{tab:nombre_moyennes_couronnes} \end{table} Pour associer ensuite un polynôme en $r$ et $s$ à chaque moyenne couronne, on procède comme pour les petites couronnes. On développe le cosinus de chaque membre de l'équation $M_{\vec{l}}=2\pi$. La loi des cosinus permet d'exprimer les cosinus des angles $\widehat{1r1}$, $\widehat{1rr}$, $\widehat{1rs}$, $\widehat{rrr}$, $\widehat{rrs}$ et $\widehat{srs}$ en fonction de $r$ et $s$ (dans cet ordre) : $$ 1-\frac{2}{(1+r)^2},\quad \frac{r}{1+r},\quad 1-\frac{2s}{(r+s)(1+r)},\quad \frac{1}{2},\quad \frac{r}{r+s},\quad 1-\frac{2s^2}{(r+s)^2}. $$ Le carré des sinus s'en déduit (dans le même ordre) : $$ \frac{4r(r + 2)}{(r + 1)^4},\quad \frac{2r + 1}{(r + 1)^2},\quad \frac{4rs(r + s + 1)}{(r + 1)^2(r + s)^2},\quad \frac{3}{4},\quad \frac{s(2r + s)}{(r + s)^2},\quad \frac{4r(r + 2s)s^2}{(r + s)^4}. $$ On exprime les sinus eux-mêmes avec des variables auxiliaires : $$ \frac{2X_7}{(r + 1)^2},\quad \frac{X_8}{r + 1},\quad \frac{2X_2}{(r + 1)(r + s)},\quad \frac{X_6}{2},\quad \frac{X_4}{r + s},\quad \frac{2sX_5}{(r + s)^2}, $$ où $X_1,\ldots,X_6$ ont déjà été définies et $X_7$ et $X_8$ ont respectivement pour carré $$ r(r+2),\quad 2r+1. $$ L'élimination des $X_i$ donne un polynôme entier bivarié associé à la moyenne couronne considérée. Comme il y a en généralement plus de disques dans une moyenne couronne que dans une petite (jusqu'à $33$ petits disques), ces polynômes sont plus compliqués que ceux associés aux petites couronnes\footnote{Le calcul de tous les $1654$ polynômes prend 2h 21min sur notre ordinateur et crée un fichier de $36$Mo. Il montre que le degré moyen est $57$, avec un maximum à $416$ pour $\textrm{11rrssssssssssss}=\textrm{11rrs}^{12}$.}. \section{Rayons et couronnes} \label{sec:calcul} Pour déterminer les rayons possibles, il suffit en théorie de considérer chaque couple formée d'une petite couronne et d'une moyenne couronne, de calculer les deux polynômes associés et de trouver les racines de ce système d'équations polynomiales vérifiant $0<s<r<1$. La résolution d'un tel système est cependant en pratique souvent délicate.\\ Par exemple, la petite couronne 111rr et la moyenne couronne 111rrs donnent deux polynômes de degré respectifs $12$ et $38$ (avec des coefficients valant jusqu'à $10^{14}$ pour le second), et leur résolution exacte avec le logiciel SageMath \cite{sage} nécessite une heure et $21$ minutes sur notre ordinateur de bureau.\\ La résolution d'un système polynomial par un logiciel de calcul formel utilise généralement les {\em bases de Gröbner} pour calculer la variété de l'idéal engendré par les polynômes (quand elle est de dimension $0$). Mais le calcul de ces bases peut être très coûteux, même pour seulement deux équations quand celles-ci sont de degré élevé. Les $X_i$ ont d'ailleurs été éliminés des équations (Parties \ref{sec:equation} et \ref{sec:moyennes}) sans recourir aux bases de Gröbner mais par une méthode plus ``manuelle'' (multiplier $AX_i+B$ par $AX_i-B$) qui utilise le fait que $X_i^2$ s'exprime facilement en fonction de $r$ et $s$ (ce que le logiciel de calcul formel, destiné à traiter le cas général, n'utilise sans doute que partiellement). On s'inspire ici de \cite{sage2} (page 201).\\% pour contourner à nouveau les bases de Gröbner.\\ Rappelons que le résultant de deux polynômes univariés est un scalaire qui s'annule si et seulement si les deux polynômes ont une racine commune. Si $P$ et $Q$ sont deux polynômes de $\mathbb{Z}[r,s]$, on peut les voir comme des polynômes en $r$ à coefficients dans $\mathbb{Z}[s]$ : leur résultant est alors un polynôme $\textrm{Res}_r(s)$ qui s'annule en $s_0$ si et seulement si $P(r,s_0)$ et $Q(r,s_0)$ ont une racine $r$ commune. Symétriquement, échanger $r$ et $s$ donne un polynôme $\textrm{Res}_s(r)$ qui s'annule en $r_0$ si et seulement si $P(r_0,s)$ et $Q(r_0,s)$ ont une racine $s$ commune. Les couples annulant $P$ et $Q$ sont alors dans le produit cartésien des racines de ces résultants.\\ Le calcul des résultants est rapide : ce sont les déterminants des matrices de Sylvester des polynômes. Le calcul exact de leurs racines aussi\footnote{Pour un logiciel de calcul formel, {\em calculer} une racine d'un polynôme revient juste à déterminer un intervalle qui ne contient que cette racine, à partir de quoi il peut fournir à l'utilisateur une approximation à la précision voulue de cette racine (via, par exemple, la méthode de Newton).}. Le produit cartésien nous donne alors de nombreux couples $(r,s)$ {\em candidats} parmi lesquels il faut trouver les solutions des équations d'angles associées aux couronnes.\\ On filtre d'abord ces candidats en trois passes en utilisant l'{\em arithmétique d'intervalles}. Chaque passe ne garde que les couples $(r,s)$ tels que : \begin{enumerate} \item $0<\overline{s}$, $\underline{s}<\overline{r}$ et $\underline{r}<1$, où $[\underline{x},\overline{x}]$ est l'intervalle représentant $x$ ; \item $0$ est dans les intervalles représentant $2\pi-P_{\vec{k}}$ et $2\pi-M_{\vec{l}}$, où $P_{\vec{k}}$ et $M_{\vec{l}}$ correspondent à la petite et à la moyenne couronnes ayant donné $(r,s)$ ; \item il existe $\vec{n}\in\mathbb{N}^6$ tel que $0$ soit dans l'intervalle représentant $2\pi-G_{\vec{n}}$, où $$ G_{\vec{n}}(r,s):=n_1\widehat{111}+n_2\widehat{11r}+n_3\widehat{11s}+n_4\widehat{r1r}+n_5\widehat{r1s}+n_6\widehat{s1s}. $$ \end{enumerate} En d'autres termes, la première passe élimine {\em des} couples hors du domaine, la seconde {\em des} couples qui n'admettent pas de petite ou moyenne couronne, la dernière {\em des} couples qui n'admettent pas de grande couronne\footnote{Les valeurs de $r$ et $s$ permettent de borner la norme des vecteurs $\vec{n}$ à rechercher}. Plus la précision sur les intervalles est grande et plus le filtrage est efficace, mais plus il est lent. Une quatrième et dernière passe vérifie alors que les candidats restants sont {\em réellement} des racines des équations de couronnes. On procède pour chaque couronne comme pour calculer son polynôme associé (Partie~\ref{sec:equation}), avec deux ajouts : \begin{enumerate} \item Lors de chaque multiplication par $AX_i-B$, on vérifie que ce terme n'est pas nul. On essaie d'abord en arithmétique d'intervalle (plus rapide), et seulement à défaut\footnote{Cas qui ne s'est présenté que pour le couple petite/moyenne couronnes 1r1r/11r1s.} avec les valeurs exactes de $r$ et $s$. \item Lorsque les $X_i$ ont tous été éliminés, on vérifie l'équation obtenue avec les valeurs exactes de $r$ et $s$.\\ \end{enumerate} On peut alors, pour chaque couple $(r,s)$ retenu, procéder comme dans les troisième et dernière passes pour trouver {\em toutes} les couronnes (petites, moyennes et grandes) compatibles. Ceci afin de pouvoir ensuite déterminer (de façon combinatoire) les empilements possibles.\\ Reprenons l'exemple de la petite couronne 111rr et de la moyenne 111rrs. Les résultants sont deux polynômes de degré $336$, chacun ayant $85$ racines réelles. Il y a donc $7225$ couples candidats. La première passe en garde $45$. La deuxième n'en laisse qu'un seul. La troisième l'élimine. Aucune vérification finale n'est donc nécessaire ! Le tout en environ $15$ secondes sur un ordinateur de bureau avec $53$ bits de précision pour les intervalles.\\ Certains cas restent néanmoins impraticable. Par exemple, la petite couronne 11rrs et la moyenne couronne $\textrm{11rrssssssssssss}=\textrm{11rrs}^{12}$ donnent un polynôme de degré $28$ et un de degré $416$ avec des coefficients ayant jusqu'à $155$ chiffres. Rien qu'obtenir ce polynôme de degré $416$ demande $6$ minutes de calcul, et le calcul du résultant excède la capacité mémoire de notre ordinateur.\\ Surtout, si l'on croise le nombre de petites couronnes selon la minoration du ratio $\tfrac{s}{r}$ associée (Tab.~\ref{tab:petites_couronnes}) et le nombre de moyennes couronnes pour cette minoration (Tab.~\ref{tab:nombre_moyennes_couronnes}), on obtient un total de $16805$ couples de couronnes ! L'approche purement calculatoire précédente semble donc vouée à l'échec. Aussi l'avons nous complétée par une approche combinatoire. Le principe est d'éliminer autant de cas que possible en montrant que la combinatoire des petites et moyennes couronnes exclue la possibilité d'un empilement, indépendamment des valeurs de $r$ et $s$ (et donc des grandes couronnes). Nous avons pour cela partitionné les empilements en trois types, successivement étudiés dans les trois parties suivantes. \section{Deux phases} Un empilement est dit admettre {\em deux phases} s'il n'y a pas de contact entre petits et moyens disques. Les grands disques font ``tampon'' entre les petits et les moyens. Une petite couronne ne contenant pas de moyen disque, elle donne une des $10$ équations en $s$ données Tab.~\ref{tab:petites_couronnes_deux_disques}. De même pour une moyenne couronne, qui ne contient pas de petit disque, en remplaçant $s$ par $r$ dans les équations Tab.~\ref{tab:petites_couronnes_deux_disques}. Comme $s<r$, il y a $C_{10}^2=45$ couples $(r,s)$ candidats.\\ Parmi ces $45$ candidats, $18$ admettent un empilement périodique (voir Annexe \ref{sec:empilements}). Ce sont exactement ceux qui ont une grande couronne qui contient à la fois un petit et un moyen disque et permet ainsi de lier les deux phases. Montrons que l'absence d'une telle couronne dans les $27$ cas restants interdit l'existence d'un empilement (qui a, par définition, des disques des trois tailles). \begin{lemma} \label{lem:biphase1} Si aucune grande couronne d'un candidat à deux phases \begin{enumerate} \item ne contient trois grands disques consécutifs et un moyen disque ; \item ne contient à la fois un petit et un moyen disque. \end{enumerate} Alors aucun empilement n'est possible. \end{lemma} \begin{proof} Supposons qu'un tel empilement existe et obtenons une contradiction. Appelons disque $1_r$ un grand disque en contact avec au moins un moyen disque. Considérons un grand disque $D$ dans la couronne d'un disque $1_r$. Comme cette couronne contient un moyen disque (par définition d'un disque $1_r$), la première hypothèse assure que $D$ a un voisin qui n'est pas un grand disque. La seconde hypothèse assure que ce voisin est forcément moyen, et donc que $D$ est lui-même un disque $1_r$. Ainsi, les seuls voisins d'un disque $1_r$ sont des disques moyens ou $1_r$. De même, les seuls voisins d'un moyen disque sont moyens ou $1_r$ (il ne peuvent pas être petits par définition d'un empilement à deux phases, et s'ils sont grands ils sont $1_r$ par définition d'un disque $1_r$). Considérons maintenant un moyen disque de l'empilement. Ses voisins sont des disques moyens ou $1_r$. Les voisins de ses voisins aussi d'après ce qu'on vient de voir, et ainsi de suite. L'empilement ne contient pas de petit disque : contradiction. \end{proof} \begin{figure}[hbtp] \includegraphics[width=\textwidth]{biphase_impossible_1.pdf} \caption{Un des $24$ candidats à deux phases, représenté par ses couronnes, qui n'admet pas d'empilement d'après le lemme~\ref{lem:biphase1}.} \label{fig:biphase_impossible_1} \end{figure} Le lemme~\ref{lem:biphase1} reste valable en échangeant partout ``moyen'' et ``petit'' (dans l'énoncé et dans la preuve). Il élimine $24$ des $27$ candidats restants (Fig.~\ref{fig:biphase_impossible_1}). Il en reste trois (Fig.~\ref{fig:biphase_impossible_2}), éliminés en allant un cran plus loin que dans le lemme~\ref{lem:biphase1} :\\ \begin{figure}[hbtp] \includegraphics[width=\textwidth]{biphase_impossible_2.pdf} \caption{Trois candidats à deux phases, représentés ligne par ligne par leurs couronnes, qui n'admettent pas d'empilement d'après le lemme~\ref{lem:biphase2}.} \label{fig:biphase_impossible_2} \end{figure} \begin{lemma} \label{lem:biphase2} Aucun des candidats représentés Figure~\ref{fig:biphase_impossible_2} ne permet d'empilement. \end{lemma} \begin{proof} Supposons qu'un empilement existe. Considérons la seule grande couronne qui contienne un moyen disque et trois grands consécutifs (en quatrième position Fig.~\ref{fig:biphase_impossible_2}). Si elle n'apparaît pas dans l'empilement, alors le lemme~\ref{lem:biphase1} s'applique et donne une contradiction. Sinon, soit {\bf a} le grand disque de cette couronne qui a deux grands voisins (Fig.~\ref{fig:biphase_impossible_3}, premier dessin). Supposons qu'il n'ait aucun moyen voisin. Ses deux grands voisins dans la couronne lui imposent deux grands voisins {\bf b} et {\bf c} (Fig.~\ref{fig:biphase_impossible_3}, deuxième dessin). Comme ces mêmes voisins ayant au plus trois grands disques consécutifs dans leur couronne, ils imposent à {\bf b} et {\bf c} des moyens voisins {\bf d} et {\bf e} (Fig.~\ref{fig:biphase_impossible_3}, troisième dessin). Par ailleurs, {\bf a} ayant maintenant $5$ grands voisins, il a forcément un sixième et dernier grand voisin {\bf f} (Fig.~\ref{fig:biphase_impossible_3}, troisième dessin). Enfin, {\bf b} et {\bf c} ayant eux aussi au plus trois grands disques consécutifs dans leur couronne, ils imposent à {\bf f} des moyens voisins {\bf g} et {\bf h} (Fig.~\ref{fig:biphase_impossible_3}, dernier dessin). Ainsi, les seuls grands disques sans moyen voisin de l'empilement sont encerclés par des grands disques avec un moyen voisin. L'empilement ne contient donc pas de petit disque : contradiction. \end{proof} \begin{figure}[hbtp] \centering \includegraphics[width=1\textwidth]{biphase_impossible_3.pdf} \caption{Dans un empilement avec la couronne de gauche, un grand disque touche un moyen ou est encerclé par $6$ grands disques qui touchent un moyen.} \label{fig:biphase_impossible_3} \end{figure} \section{Deux petites couronnes} On cherche ici les empilements où peuvent apparaître (au moins) deux petites couronnes différentes (autres que ssssss). L'intérêt est double. D'une part, comme il n'y a que $55$ petites couronnes, il y a au plus $C_{55}^2=1485$ couples à considérer (au lieu de $16688$). D'autre part, les petites couronnes correspondent à des équations généralement beaucoup plus simples que les moyennes.\\% (degré maximal $28$ contre $416$, degré moyen $x$ contre $x$).\\ Si les deux petites couronnes ne contiennent que des petits et grands disques, alors chacune caractérise une valeur différente de $s$. On élimine donc ces paires, tout comme celles qui ne contiennent que des petits et moyens disques (valeur différente de $\tfrac{s}{r}$). Il reste $1395$ systèmes de deux équations en $r$ et $s$.\\ On calcule les résultants et leurs racines comme détaillé Partie~\ref{sec:calcul}. Il y a trois paires pour lesquelles le calcul des racines par SageMath est problématique : l'exécution s'arrête pour rrrs/11rss et rrss/1111r en renvoyant respectivement \verb+AssertionError+ et \verb+RuntimeError('maximum recursion depth exceeded')+, quant à 1rrss/1111r, nous avons interrompu l'exécution au bout de $4$ heures. Dans ces trois cas, les racines sont (facilement) calculées en arithmétique d'intervalles : on obtient un ensemble $\mathcal{C}_{\textrm{err}}$ de $2276$ couples $(r,s)$ candidats. Les $1392$ autres cas ne posent pas de problème et donnent un ensemble $\mathcal{C}$ de $185813$ couples $(r,s)$ candidats.\\ La première passe, sur le domaine, réduit $\mathcal{C}_{\textrm{err}}$ à $179$ couples et $\mathcal{C}$ à $1394$ couples. La deuxième passe est ici effectuée sur les équations d'angles des deux petites couronnes, et non sur celles d'une petite et d'une moyenne couronne comme dans le cas général exposé Partie~\ref{sec:calcul}. Elle réduit $\mathcal{C}_{\textrm{err}}$ à $0$ couple, ce qui règle le problème des trois erreurs ci-dessus, et $\mathcal{C}$ à $312$ couples. La troisième passe réduit $\mathcal{C}$ à $37$ couples, que la dernière passe valide tous (avec toutes leurs couronnes). Le tout (résultants, racines et les quatre passes) en moins de $2$ minutes sur notre ordinateur de bureau.\\ Ces $37$ couples peuvent donc former des petites, moyennes et grandes couronnes, mais il reste à vérifier qu'ils admettent un empilement. Ils s'avèrent tous partager une propriété bien particulière : il n'y a jamais de moyen disque dans leurs grandes couronnes. Ceci permet de montrer : \begin{lemma} \label{lem:2pc} Si aucune petite couronne d'un candidat à deux petites couronnes \begin{enumerate} \item ne contient trois petits disques consécutifs et un grand disque ; \item ne contient à la fois un moyen et un grand disque. \end{enumerate} Alors aucun empilement n'est possible. \end{lemma} \begin{proof} Supposons qu'un tel empilement existe et obtenons une contradiction. Appelons disque $s_1$ un petit disque en contact avec au moins un grand disque. Considérons un petit disque $d$ dans la couronne d'un disque $s_1$. Comme cette couronne contient un grand disque (par définition d'un disque $s_1$), la première hypothèse assure que $d$ a un voisin qui n'est pas un petit disque. La seconde hypothèse assure que ce voisin est forcément grand, et donc que $d$ est lui-même un disque $s_1$. Ainsi, les seuls voisins d'un disque $s_1$ sont des disques grands ou $s_1$. De même, les seuls voisins d'un grand disque sont grands ou $s_1$ (il ne peuvent pas être moyen car les grandes couronnes des $37$ candidats ne contiennent jamais de moyen disque, et s'ils sont petits ils sont $s_1$ par définition d'un disque $s_1$). Considérons maintenant un grand disque de l'empilement. Ses voisins sont des disques grands ou $s_1$. Les voisins de ses voisins de même, et ainsi de suite. L'empilement ne contient donc pas de moyen disque : contradiction. \end{proof} \begin{figure}[hbtp] \centering \includegraphics[width=\textwidth]{2pc_impossible.pdf} \caption{Un candidat à deux petites couronnes qui n'a pas d'empilement.} \label{fig:2pc_impossible} \end{figure} \begin{figure}[hbtp] \centering \includegraphics[width=0.83\textwidth]{2pc_possible.pdf} \caption{Le seul candidat à deux petites couronnes admettant un empilement.} \label{fig:2pc_possible} \end{figure} Le lemme~\ref{lem:2pc} reste valable en échangeant partout ``moyen'' et ``grand'' (dans l'énoncé et dans la preuve). Il élimine tous les candidats (Fig.~\ref{fig:2pc_impossible}), sauf le cas des petites couronnes 1srrs et 1s1ss (Fig.~\ref{fig:2pc_possible}). Ce cas admet en effet un empilement (périodique, voir Appendix~\ref{sec:empilements}), bien qu'une seule petite couronne soit utilisable : \begin{proposition} Pour $r$ et $s$ compatibles avec les deux petites couronnes 1srrs et 1s1ss, il n'existe pas d'empilement contenant la petite couronne 1s1ss. \end{proposition} \begin{proof} Les deux petites couronnes caractérisent $r$ et $s$, donc toutes les couronnes. Il n'y a que ces deux petites couronnes, les moyennes couronnes rrsssrs et rrssrss (même vecteur d'angles), et la grande couronne $\textrm{s}^{12}$. Supposons qu'un empilement contienne la petite couronne 1s1ss et considérons le centre de cette couronne. On montre par induction sur $k$ que les disques à distance $k$ de ce centre sont soit des grands disques, soit des petits disques qui ont un facteur 1ss, 1s1 ou s1s dans leur couronne. C'est vrai pour $k=0$. Supposons que ce soit vrai pour $k>0$ et considérons un disque à distance $k+1$. Il est dans une couronne d'un disque à distance $k$, donc soit une grande couronne, soit une petite couronne qui, par hypothèse d'induction, contient 1ss, 1s1 ou s1s : ça ne peut être que 1s1ss. C'est donc un disque petit ou grand, et comme tout petit disque dans la grande couronne $\textrm{s}^{12}$ ou la petite couronne 1s1ss a un facteur 1ss, 1s1 ou s1s dans sa couronne, l'hypothèse d'induction est vérifiée pour $k+1$. On en déduit qu'il ne peut y avoir de moyen disque dans cet empilement, ce qui contredit la définition d'un empilement. \end{proof} \section{Une petite couronne} Le dernier type d'empilement sont ceux qui n'ont qu'une phase et qu'une petite couronne (autre que ssssss). Chacun contient donc (au moins) une moyenne couronne avec un petit disque (sinon il y a deux phases), et tous les petits disques de cette moyenne couronne ont la même couronne. Aussi supposera-t-on toujours que, dans les couples petite/moyenne couronnes utilisés pour calculer $(r,s)$, la moyenne couronne contient un petit disque. L'intérêt est que cela impose une contrainte combinatoire simple mais forte sur les couples considérés.\\ Considérons, par exemple, le cas de la petite couronne 11rrs et de la moyenne couronne $\textrm{11rrs}^{12}$ (où le simple calcul du résultant posait problème Partie~\ref{sec:calcul}). Si les centres s et r de ces deux couronnes se touchent, alors il existe un facteur xry de la petite\footnote{C'est-à-dire un facteur d'une des codages de la couronne.} et un facteur xsy de la moyenne, où x et y sont les deux disques qui touchent à la fois s et r. Ici, le facteur sss de $\textrm{11rrs}^{12}$ impose srs dans 11rrs : ce couple peut être éliminé sans se lancer dans les calculs décrits Partie~\ref{sec:calcul} !\\ Les couples considérés sont cependant des solutions (potentielles) des é\-qua\-tions $P_{\vec{k}}=2\pi$ et $M_{\vec{l}}=2\pi$, c'est-à-dire des vecteurs d'angles et non leur codage par un mot sur $\{1,r,s\}$. Les vecteurs d'angles des petites couronnes n'admettent jamais qu'un seul codage, mais ceux des moyennes en ont généralement plusieurs. Dans l'exemple précédent, $\textrm{11rrs}^{12}$ est l'unique codage de $(1,1,1,1,1,11)$, mais le vecteur $(0, 0, 4, 0, 6, 10)$, par exemple, admet $1022$ codages différents. Il faut vérifier qu'au moins un des codages vérifie cette contrainte.\\ Formellement, on dit qu'un petit vecteur d'angles $\vec{k}$ {\em couvre} un moyen vecteur d'angles $\vec{l}$ s'il existe un codage de $\vec{l}$ tel que pour tout facteur xsy de ce codage, le codage de $\vec{k}$ contient $xry$. On dit aussi que $\vec{k}$ {\em précouvre} $\vec{l}$ s'il existe un codage de $\vec{l}$ tel que pour tout facteur xs de ce codage, le codage de $\vec{k}$ contient $xr$. Cette condition est plus faible, mais elle se vérifie directement sur les vecteurs d'angles (qui comptent justement les facteurs de taille $2$), donc plus rapidement.\\ Considérons les $16805$ couples petit/moyen vecteurs d'angles candidats. Ne garder que ceux où la la petite couronne contient un moyen disque et la moyenne un petit réduit à $12265$ couples. La vérification de précouverture réduit à $2889$ couples en quelques millisecondes, puis celles de couverture à $803$ couples en moins de $2$ minutes\footnote{Mais en plus de $15$ minutes si on ne vérifie pas la précouverture avant.}. Ces $803$ couples correspondent à $192$ moyennes couronnes différentes, au lieu des $1654$ initiales, et leurs polynômes sont de plus souvent parmi les plus simples\footnote{Le calcul de ces $192$ polynômes prend 1min 51s sur notre ordinateur et crée un fichier de $256$Ko. Il montre que le degré moyen est $14$, avec un maximum à $80$ pour 11rrsrss.}.\\ Le calcul des résultants donne un ensemble $\mathcal{C}$ de $469808$ couples $(r,s)$ candidats en moins de $4$ minutes. Ici encore, il y a quelques cas problématiques : $8$ erreurs d'exécution et $15$ couples de couronnes qui ne caractérisent pas un nombre fini de valeurs de $r$ et $s$. Les $8$ erreurs sont traitées en arithmétique d'intervalles et donnent un ensemble $\mathcal{C}_{\textrm{err}}$ de $43448$ couples $(r,s)$ candidats (environ $1$ minutes). Parmi les $15$ cas qui ne caractérisent pas $r$ et $s$ ({\em i.e.}, le système d'équations associées aux couronnes n'est pas de dimension $0$), $13$ sont formés de petite et moyenne couronnes qui n'ont pas de grand disque. Ces seules couronnes ne permettent pas un empilement avec trois tailles de disques : il en faut donc une autre, {\em i.e.}, on retombe dans un des autres cas. Les $2$ cas restants sont 1rr/1r1srs et 11r/111s1s. Le premier est impossible car il correspond à une moyenne couronne 1r1r avec des s ajoutés dans les interstices, or une telle moyenne couronne est impossible. Le second est en fait un sous cas de 1rr/1s1s1s1s, où certains trous entre deux grands disques et un moyen ne sont pas remplis par un petit disque.\\ La première passe, sur le domaine, réduit $\mathcal{C}$ à $57017$ couples et $\mathcal{C}_{\textrm{err}}$ à $5875$ couples. La deuxième passe, sur les petites et moyennes couronnes, réduit $\mathcal{C}$ à $601$ couples et $\mathcal{C}_{\textrm{err}}$ à $6$ couples. La troisième passe, sur les grandes couronnes, réduit $\mathcal{C}$ à $175$ couples et $\mathcal{C}_{\textrm{err}}$ à $1$ couple. Le tout en $4$ minutes environ. Le dernier couple de $\mathcal{C}_{\textrm{err}}$ qui résiste (\verb+AssertionError+) correspond à la paire petite/moyenne couronnes 1rr1s/11rrs. Résoudre les deux équations bivariées associées (via les bases de Gröbner) donne $29$ couples en 45 minutes\footnote{Ce qui montre l'intérêt d'avoir utilisé le résultant pour les $802$ autres couples !}, réduit à $1$ par les trois passes. Il reste donc $176$ candidats, que la dernière passe valide tous (et leurs couronnes) en moins de $4$ minutes. Il reste à déterminer quand un empilement est possible. \begin{lemma} \label{lem:1pc_impossible_1} Si un empilement contient une petite couronne 1rss, 11rss, 1rrss ou 1srss, alors il contient une seconde petite couronne autre que ssssss. \end{lemma} \begin{proof} La preuve ne repose pas sur les valeurs de $r$ ou $s$. Les quatre cas, similaires, sont illustrés Fig.~\ref{fig:1pc_impossible_1}. On considère un s (légèrement grisé) et sa petite couronne. On considère un des s de cette couronne (moyennement grisé) : il n'y a qu'une seule façon de disposer sa couronne. Un des s (fortement grisé) a alors dans sa couronne un facteur (1ss1 dans le premier cas, rssr dans les trois autres) qui n'apparaît ni dans une de ces quatre petites couronnes ni dans ssssss. \end{proof} \begin{figure}[hbtp] \centering \includegraphics[width=0.9\textwidth]{1pc_impossible_1.pdf} \caption{Quatre petites couronnes qui imposent deux petites couronnes.} \label{fig:1pc_impossible_1} \end{figure} Le lemme~\ref{lem:1pc_impossible_1} élimine $24$ couples petit/moyenne couronne qui ne permettent pas d'empilement. Le lemme \ref{lem:1pc_impossible_2} ci-dessous en élimine encore $7$, et les $145$ restants admettent tous un empilement périodique (Annexe~\ref{sec:empilements}). \begin{lemma} \label{lem:1pc_impossible_2} Il n'y a pas d'empilement avec des couples petite/moyenne couronnes 1rsrs/1rr1ss, 11rr/11rrs, 1rr1s/11rrs, rrrrr/1rsrsr, rrrrs/11rssr, rrrss/11rssr et rrrs/11rssr. \end{lemma} \begin{proof} On traite les cas un par un.\\ {\bf 1rsrs/1rr1ss.} Les valeurs de $r$ et $s$ ne sont compatibles avec aucune autre moyenne couronne. Le r entre deux s de la petite couronne, qui touche trois s (ses voisins et le centre) n'a pas de couronne.\\ {\bf 11rr/11rrs.} Les valeurs de $r$ et $s$ ne sont compatibles avec aucune autre moyenne couronne. Dans la moyenne couronne, la couronne du r avec un voisin s impose 1rr1 dans la couronne de son voisin r : c'est impossible.\\ {\bf 1rr1s/11rrs.} Les valeurs de $r$ et $s$ ne sont compatibles avec aucune autre moyenne couronne. Dans la moyenne couronne, la couronne du r voisin de 1 impose le facteur srrs dans la couronne du r voisin de s. C'est impossible car la moyenne couronne n'a pas de facteur srrs.\\ {\bf rrrrr/1rsrsr.} Les valeurs de $r$ et $s$ ne sont compatibles avec aucune autre moyenne couronne. Il y a deux façons symétriques de placer la couronne d'un r dans une petite couronne. Ce choix impose alors, de proche en proche, un placement unique des couronnes des autres r de la petite couronne. Il n'y a pas de couronne possible pour le dernier r.\\ {\bf rrrrs/11rssr.} Les valeurs de $r$ et $s$ sont compatibles avec deux autres moyennes couronnes, rsrsrss et 1111r, ainsi qu'avec la grande couronne, 1r1r1rr. Appelons disque $r_1$ un moyen disque qui touche au moins un grand disque. Si un empilement ne contient pas la moyenne couronne 11rssr, alors en partant d'un disque $1$ les autres couronnes ne permettent d'atteindre que des disques $1$ ou $r_1$, donc il n'y a pas de petit disque dans l'empilement : contradiction. Considérons donc une moyenne couronne 11rssr. Soit deux disques r et s voisins dans cette couronne. Il y a une seule façon de placer la couronne du r et elle impose au s un facteur sss dans sa propre couronne, ce que ne permet pas la petite couronne.\\ {\bf rrrss/11rssr.} Les valeurs de $r$ et $s$ sont compatibles avec les moyennes couronnes rrsrrss, rrrsrss et 111rr, ainsi qu'avec les grandes couronnes 11r11rr et 111r1rr. Le même argument que pour rrrrs/rsrsrss impose la présence d'une moyenne couronne 11rssr. Soit deux disques r et s voisins dans cette couronne. Il y a une seule façon de placer la couronne du r et elle impose au s un facteur srrs dans sa propre couronne, ce que ne permet pas la petite couronne.\\ {\bf rrrs/11rssr.} Les valeurs de $r$ et $s$ sont compatibles avec les moyennes couronnes rsrsrsrsss, rsrsrssrss, rsrssrsrss, rrrrsrss, rrrsrrss, rrrsrss, 1rsrsssr, 1rssrssr et 111r. La petite couronne interdit trois s consécutifs dans une couronne, ce qui élimine 1rsrsssr (et rsrsrsrsss). Le même argument que pour rrrrs/rsrsrss impose la présence d'une moyenne couronne 1rssrssr ou 11rssr. Considérons une de ces couronnes (l'autre cas est similaire). La petite couronne force les paires de s voisins dans cette couronne a être encerclés par quatre r. Considérons un des deux r qui, dans cette couronne, est entre 1 et s : il a alors un facteur 1rsr dans sa couronne, ce qui est impossible. \end{proof} \section{Conclusion} Il y a donc $18$ couples $(r,s)$ qui permettent un empilement à deux phases, un seul qui permet deux petites couronnes et admet un empilement (qui ne contient qu'une de ces petites couronnes) et $145$ qui ne permettent qu'une seule petite couronne et admettent un empilement avec une seule phase. Au total, il y a donc $164$ couples $(r,s)$ qui permettent un empilement : le théorème~\ref{th:164} est démontré. La figure~\ref{fig:repartition_r_sr} illustre la répartition des rayons (les numéros correspondent à ceux de l'annexe~\ref{sec:empilements}) et la table~\ref{tab:degre_rayons} celle de leur degré algébrique.\\ \begin{figure}[hbtp] \centering \includegraphics[width=0.85\textwidth]{repartition_r_sr.pdf} \label{fig:repartition_r_sr} \caption{ Répartition des $164$ couples $(r,s)$ qui permettent un empilement, avec $r$ en abscisse et $\tfrac{s}{r}$ en ordonnée. Les couples sous la courbe rouge sont {\em interstitiels} : le petit disque tient dans le trou entre trois grands disques. Les cellules de Voronoï donnent une idée de la proximité entre couples. } \end{figure} \begin{table}[hbtp] \centering \resizebox{\textwidth}{!}{ \begin{tabular}{c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c} $1$ & $2$ & $3$ & $4$ & $5$ & $6$ & $7$ & $8$ & $9$ & $10$ & $11$ & $12$ & $14$ & $16$ & $20$ & $22$ & $24$\\ $10$ & $52$ & $29$ & $79$ & $20$ & $30$ & $4$ & $47$ & $2$ & $10$ & $6$ & $18$ & $2$ & $9$ & $4$ & $2$ & $4$ \end{tabular}} \caption{Nombre de rayons $r$ et $s$ en fonction de leur degré algébrique.} \label{tab:degre_rayons} \end{table}
\section{Introduction} Text classification is a common task in Natural Language Processing. Its goal is to assign a label to a text document from a predefined set of classes. Researchers have extensively focused on designing best features along with the choice of the best possible machine learning classifier. Traditional methods used in text classification such as n-grams~\cite{joachims1998text} captured the linguistic structure from a statistical point of view, however, recent methods successfully employ deep learning techniques and CNNs for text classification~\cite{kimconvolutional,zhang2015character}. Image classification has a similar aim to text classification and recently CNNs have become the de-facto standard in this field~\cite{krizhevsky2012imagenet,szegedy2015going}. Word embedding models~\cite{Mikolov2013nips,pennington2014glove,le2014distributed} convert words or sentences into vectors of real numbers. Typically these models are trained on large corpus of text documents to capture semantic relationships among words. Thus they can produce similar word embeddings for words occurring in similar contexts. We exploit this fundamental property of word embedding models to transform a text document into a sequence of colors, obtaining an artificial (encoded) image, as shown in Figure~\ref{fig:idea}. Intuitively, semantically related words obtain similar colors or encodings in the encoded image while uncorrelated words are represented with different colors. We present a novel text classification approach to cast text documents into visual domain. Our approach transforms text documents into encoded images capitalizing on word embeddings. We evaluate the method on several large scale datasets obtaining promising and, in some cases, state-of-the-art results. In summary, main contributions of our paper include:\\ -- We present an approach to transform text documents into encoded images based on Word2Vec word embedding.\\ -- A real-world multi-modal application based on the proposed approach that uses a single model to manage joint representations of image and encoded text. A previous version of our encoding scheme was published in ICDAR 2017~\cite{gallosemantic2017}. In this work, we explore various parameters associated with encoding scheme. We extensively evaluate the improved encoding scheme on benchmark datasets. Furthermore, we present an application scenario based on our encoding scheme to fuse encoded text and image for multi-modal classification. \begin{figure*} \centering \includegraphics[width=0.8\textwidth]{fig-proposed.pdf} \caption{Starting from an encoded text document, the resulting image is classified by a CNN model normally employed in image classification. The first convolutional layers look some particular features of visual words while the remaining convolutional layers can recognize sentences and increasingly complex concepts.} \label{fig:proposed-model} \end{figure*} \section{Related Work} \label{sec:related-work} Much of the work with deep learning methods for text documents involved learning word vector representations through neural language models~\cite{Mikolov2013nips,pennington2014glove}. This vector representation serves as a foundation of our work where word vectors are transformed into a sequence of colors. Tang et al. \cite{tang2014learning} adopted an ad-hoc model using three neural networks to encode the sentiment information from text. They concluded that word embedding models presented in~\cite{Mikolov2013nips} and~\cite{collobert2011natural} are not effective for sentiment classification. \begin{figure} \centering \includegraphics[width=0.70\columnwidth]{fig-visual-word.pdf} \caption{A graphical representation of our encoding scheme. The figure shows an encoded image of size $W\times H$, with $5$ visual words $\hat{t}_k$ having width $V$ which contains superpixels of size $P\times P$.} \label{fig:visual-word} \end{figure} There are many works in literature like~\cite{zheng2017dual,wehrmann2018order,wang2016learning,wang2017learning} that deal with both images and texts to achieve semantic alignment. However, they need to employ different deep models making their approaches computationally intensive, reinforced by~\cite{nawaz2018revisiting}. Moreover, they have to create ad-hoc loss functions to achieve the result. With our proposed method, to solve similar task we need just a single deep neural network. Zhang et al.~\cite{zhang2015character} treated text as a raw signal at character level and employed deep architecture to perform text classification. Similarly, Conneau et al.~\cite{conneau2017very} presented a deep architecture that operates at character level with $29$ convolutional layers to learn hierarchical representations of text. This architecture is inspired by recent progress in computer vision~\cite{simonyan2014very,he2016deep}. In our work, we leverage on recent success in computer vision, but instead of adapting deep neural network to be fed with text information, we propose an approach that converts text documents into encoded text. Once we have encoded text, we can apply state-of-the-art deep neural architectures. We compared our proposed approach with deep learning models based on word embedding and lookup tables along with the method proposed in~\cite{zhang2015character} and~\cite{conneau2017very} using same datasets. In Section~\ref{sec:experiments}, experimental results of our proposed approach are shown, highlighting that, in some cases, it overtakes state-of-the-art results while in other cases, it obtains comparative results. \begin{figure*} \centering \begin{center} \begin{tabular}{ccccc} conv1 & conv2 & conv3 & conv4 & conv5\\ \includegraphics[width=0.175\textwidth]{input-image+conv1.png} & \includegraphics[width=0.175\textwidth]{input-image+conv2.png} & \includegraphics[width=0.175\textwidth]{input-image+conv3.png} & \includegraphics[width=0.175\textwidth]{input-image+conv4.png} & \includegraphics[width=0.175\textwidth]{input-image+conv5.png} \\ \end{tabular} \end{center} \caption{An example of five feature maps (conv1,\dots, conv5) displayed over the input image of the DBPedia dataset. In this particular example images are encoded with $12$ Word2Vec features and $16$ pixels of space between visual words. The convolutional map generated by the conv1 layer shows activations of individual superpixel or sequence of superpixels, while other convolutional layers show larger activation areas affecting more visual words.} \label{fig:feature-maps-example} \end{figure*} \section{Proposed Approach} \label{sec:encodinbg} \subsection{Encoding Scheme} \label{sec:proposed-encoding-technique} The proposed encoding approach is based on Word2Vec word embedding~\cite{Mikolov2013nips}. We encode a word $t_k$ belonging to a document $D_i$ into an artificial image of size $W\times H$. The approach uses a dictionary $F(t_k,v_k)$ with each word $t_k$ associated with a feature vector $v_k(t_k)$ obtained from a trained version of Word2Vec word embedding model. Given a word $t_k$, we obtained a visual word $\hat{t}_k$ having width $V$ that contains subset of a feature vector, called superpixels (see example in Fig.~\ref{fig:visual-word-example}). A superpixel is a square area of size $P\times P$ pixels with a uniform color that represents a sequence of contiguos features $(v_{k,j},v_{k,j+1},v_{k,j+2})$ extracted as a sub-vector of $v_k$. A graphical representation is shown in Fig.~\ref{fig:visual-word}. We normalize each component $v_{k,j}$ to assume values in the interval $[0\dots255]$ with respect to $k$, then we interpret triplets from feature vector $v_k$ as RGB sequence. For this very reason, we use feature vector with a length multiple of $3$. The blank space $s$ around each visual word $\hat{t}_k$ plays an important role in the encoding approach. We found out that the parameter $s$ is directly related to the shape of a visual word. For example if $V = 16$ pixels then $s$ must also have a value close to $16$ pixels to let the network understand where a word ends and another begins. A CNN in the first convolutional layer mainly extracts features for a single superpixel (see the \textit{conv1} example in Fig.~\ref{fig:feature-maps-example}) and so it is important to understand if two activated superpixels belong to same or different visual words. Each convolutional layer produces convolutive maps from input to the last layer, as shown in Fig.~\ref{fig:proposed-model} and Fig.~\ref{fig:feature-maps-example}. We noticed that the first convolutional layer recognizes some particular features of visual words associated to single or multiple superpixels. Remaining CNN layers, instead, aggregate these simple activations to create increasingly complex relationships between words or parts of a sentence in a text document, similarly to image classification tasks. \subsection{CNN Configuration} \label{sec:cnn-configuration} We encode the text document in an image to exploit the power of CNNs typically used in image classification. Usually, CNNs use ``\textit{mirror}'' data augmentation technique to obtain robust models in image classification. In this work, this parameter is removed because mirroring an encoded text image changes the semantics of text documents and thus hampers the result. Another way to increase the training data in image classification, is to ``\textit{crop}'' a certain number of patches from each training image and to use them as input to the CNN. This process has been used and slightly improved results of our approach. The ``\textit{stride}'' parameter is very primary in decreasing the complexity of the network, however, this value must not be bigger than the superpixel size, because larger values can skip too many pixels, which leads to information lost during the convolution, invalidating results. \section{Dataset} \label{sec:datasets} In this section we provide an overview of several large-scale data sets introduced in~\cite{zhang2015character} which covers several classification tasks such as sentiment analysis, topic classification or news categorization. In addition, we used 20news-bydate dataset to test different parameters associated with the encoding approach. Table~\ref{tab:dataset-stats} reports a summary statistics of datasets. \textbf{20news-bydate.} We used 20news-bydate version of 20news dataset available on the web\footnote{\small http://qwone.com/$\sim$jason/20Newsgroups/}. We selected $4$ major categories: comp, politics, rec and religion as described in~\cite{hingmire2013document}. These categories contain $7,975$ and $5,319$ samples for training and test sets respectively. \textbf{AG's news corpus.} We used the version created by Zhang~\textit{et al.} who selected $4$ largest classes from AG news corpus on the web~\cite{zhang2015character}\footnote{\small http://www.di.unipi.it/$\sim$gulli/AG\_corpus\_of\_news\_articles.html}. The number of training instances for each class is $30,000$ and $1,900$ for testing with each instance containing class index, title and description fields. \textbf{Sogou news corpus.} Zhang~\textit{et al.} proposed a revised version of this dataset by selecting top $5$ categories from the SogouCA and SogouCS news corpora. The number of training instances selected for each class is $90,000$ and $12,000$ for testing with each instance containing title and content fields~\cite{zhang2015character}. This dataset is in Chinese language, Zhang~\textit{et al.} used a pypinyin package combined with the jieba Chinese segmentation system to produce the pinyin, a phonetic romanization of Chinese characters of words so that they were able to employ the same models for the English language without changes~\cite{zhang2015character}. \textbf{DBPedia ontology dataset.} This dataset was created by selecting $14$ non-overlapping classes from DBPedia 2014. $40,000$ training samples and $5,000$ testing samples were randomly selected from these classes with each instance containing the title and abstract of each Wikipedia article. \textbf{Yelp reviews.} Zhang~\textit{et al.} used Yelp Dataset Challenge 2015 dataset to perform two classification tasks~\cite{zhang2015character}. The first task predicts stars assigned by the user and the other task predicts the polarity label by considering stars 1 and 2 as negative while 3 and 4 as positive. These two tasks led to the construction of two datasets: the full dataset has $130,000$ training samples and $10,000$ testing samples for each star while the polarity dataset has $280,000$ training samples and $19,000$ test samples for each polarity. \textbf{Yahoo! Answers dataset.} Zhang~\textit{et al.} obtained Yahoo! Answers Comprehensive Questions and Answers version 1.0 dataset through the Yahoo! Webscope program~\cite{zhang2015character}. The $10$ largest classes are selected from this corpus to create a topic classification dataset with each instance containing question title, question content and best answer. Each class contains $140,000$ training and $5,000$ testing samples. \textbf{Amazon reviews.} Zhang~\textit{et al.} used Amazon review dataset from Stanford Network Analysis Project (SNAP) to perform full score prediction and create polarity prediction datasets~\cite{zhang2015character}. The full dataset contains $600,000$ training samples and $130,000$ testing samples in each class, whereas the polarity dataset contains about $1,800,000$ training and $200,000$ testing samples. \begin{table}[htbp] \caption{ Statistics of 20news-bydate and large-scale datasets presented in Zhang~\textit{et al.}~\cite{zhang2015character}. The $2$ rightmost columns show the average (Avg) and standard deviation (Std) for the number of words contained in text documents.} \label{tab:dataset-stats} \begin{minipage}{.001\linewidth} \scalebox{0.80}{ \begin{tabular}{lccccc} \hline \textbf{Dataset} & {\textbf{Classes}} & \textbf{Training} & \textbf{Test} & \textbf{Avg} & \textbf{Std} \\ \hline 20news-bydate & 4 & 7,977 & 7,321 & 339 & 853 \\ AG's News & 4 & 120,000 & 7,600 & 43 & 13 \\ Sogou News & 5 & 450,000 & 60,000 & 47 & 73 \\ DBPedia & 14 & 560,000 & 70,000 & 54 & 25 \\ Yelp Review Polarity & 2 & 560,000 & 38,000 & 138 & 128 \\ Yelp Review Full & 5 & 650,000 & 50,000 & 140 & 127 \\ Yahoo! Answers & 10 & 1,400,000 & 60,000 & 97 & 105 \\ Amazon Review Full & 5 & 3,000,000 & 650,000 & 91 & 49 \\ Amazon Review Polarity & 2 & 3,600,000 & 400,000 & 90 & 49 \\ \hline \end{tabular}} \end{minipage} \end{table} \begin{figure} \centering \includegraphics[width=1.0\columnwidth]{image-augmentations-results.pdf} \caption{Classification error using data augmentation: (\textit{mirror} and \textit{crop}) over the 20news-bydate test set. } \label{fig:image-augmentations-results} \end{figure} \begin{figure*}[t] \centering \includegraphics[width=0.17\textwidth]{comp10001-imgsize100.png} \includegraphics[width=0.17\textwidth]{comp10001-imgsize200.png} \includegraphics[width=0.17\textwidth]{comp10001-imgsize300.png} \includegraphics[width=0.17\textwidth]{comp10001-imgsize400.png} \includegraphics[width=0.17\textwidth]{comp10001-imgsize500.png} \caption{Five different sizes of encoded image ($100\times100$, $200\times200$, $300\times300$, $400\times400$, $500\times500$) obtained using the same document belonging to the 20news-bydate dataset. All images use the same encoding with $24$ Word2Vec features, space $s=12$, superpixel size $4\times4$. It is important to note that the two leftmost images cannot represent all words in the document due to the small size.} \label{fig:image-size-configuration} \end{figure*} \begin{figure*} \centering \includegraphics[width=0.17\textwidth]{10001-imgsize256-12feat.png} \includegraphics[width=0.17\textwidth]{10001-imgsize256-24feat.png} \includegraphics[width=0.17\textwidth]{10001-imgsize256-36feat.png} \includegraphics[width=0.17\textwidth]{10001-imgsize256-48feat.png} \includegraphics[width=0.17\textwidth]{10001-imgsize256-60feat.png} \caption{Five encoded images obtained using different Word2Vec features length and using the same document belonging to the 20news-bydate dataset. All the images are encoded using space $s=12$, superpixel size $4\times4$, image size $= 256\times256$ and visual word width $V=16$. The two leftmost images contain all words in the document encoded with $12$ and $24$ Word2Vec features respectively, while $3$ rightmost encoded images with $36$, $48$ and $60$ features length cannot encode entire documents.} \label{fig:image-size-example} \end{figure*} \begin{table*}[tpb] \caption{Comparison of different parameters over the 20news-bydate dataset. In the leftmost table we changed the size of the encoded image from $100\times100$ to $500\times500$ and the crop size is also changed by multiplying the image size with a constant i.e. $1.13$. Here \textit{sp} stands for superpixel, \textit{w2v} is for number of Word2Vec features, \textit{Mw} stands for Max number of visual words that an image can contain and \textit{\#w} is the number of text documents in the test set having a greater number of words than \textit{Mw}. We fixed the remaining non-specified parameters as follow: $s=12$, $V=4$, $sp=4$, image size$=256$.} \label{tab:comp-image-sizes} \begin{minipage}{.31\linewidth} \centering \begin{tabular}{crr} \hline \textbf{image size} & \textbf{crop} & \textbf{error} \\ \hline $500\times500$ & 443 & \textbf{8.63} \\ 400x400 & 354 & 9.30 \\ 300x300 & 266 & 10.12 \\ 200x200 & 177 & 10.46 \\ 100x100 & 88 & 15.70 \\ \hline \end{tabular} \end{minipage} \begin{minipage}{.17\linewidth} \centering \begin{tabular}{cr} \hline \textbf{sp} & \textbf{error} \\ \hline 5x5 & 8.96 \\ 4x4 & \textbf{8.87} \\ 3x3 & 10.27 \\ 2x2 & 10.82 \\ 1x1 & 10.89 \\ \hline \end{tabular} \end{minipage} \begin{minipage}{.185\linewidth} \centering \begin{tabular}{cr} \hline \textbf{stride} & \textbf{error} \\ \hline 5 & 8.7 \\ 4 & 8.87 \\ 3 & 8.33 \\ 2 & \textbf{7.78} \\ 1 & 12.5 \\ \hline \end{tabular} \end{minipage} \begin{minipage}{.18\linewidth} \centering \begin{tabular}{crrr} \hline \textbf{w2v} & \textbf{Mw} & \textbf{\#w} & \textbf{error} \\ \hline 12 & 180 & 50\% & 9.32 \\ 24 & 140 & 64\% & 8.87 \\ 36 & 120 & 71\% & \textbf{7.20} \\ 48 & 100 & 79\% & 8.21 \\ 60 & 90 & 83\% & 20.66 \\ \hline \end{tabular} \end{minipage} \end{table*} \begin{figure*}[t] \centering \begin{minipage}{.25\linewidth} \begin{tabular}{ >{\centering\arraybackslash}m{1.5cm} >{\centering\arraybackslash}m{2.5cm} } $VW-1$ & \includegraphics[width=0.26\textwidth]{visual-word-1.pdf} \\ $VW-2$ & \includegraphics[width=0.26\textwidth]{visual-word-2.pdf} \\ $VW-3$ & \includegraphics[width=0.40\textwidth]{visual-word-3.pdf} \\ $VW-4$ & \includegraphics[width=0.40\textwidth]{visual-word-4.pdf} \\ $VW-5$ & \includegraphics[width=0.40\textwidth]{visual-word-5.pdf} \\ \end{tabular} \end{minipage} \begin{minipage}{.5\linewidth} \centering \includegraphics[width=0.9\textwidth]{different-visual-words-comparison.pdf} \end{minipage} \caption{On the left, five different designs for visual words ($VW$) represented by $36$ Word2Vec features, over the 20news-bydate dataset. The width V of these words is $4$ for the first two on the top and $6$ for the rest. The first four visual words consist of super pixels with different shapes to form particular visual words. On the right, a comparison over these different shapes of visual words.} \label{fig:different-visual-words-comparison} \end{figure*} \begin{table} \centering \caption{Comparison between CNNs trained with different configurations on our proposed approach. The width $V$ (in superpixels) of visual words is fixed while the Word2Vec encoding vector size and space $s$ (in pixel) varies. $H$ is the height of visual word obtained.} \label{tab:height-space} \begin{tabular}{lcccc} \hline $s$ & $V$ & $H$ & w2v feat.& error (\%) \\ \hline 4 & 4 & 1 & 12 & 7.63 \\ 8 & 4 & 1 & 12 & 5.93 \\ 12 & 4 & 1 & 12 & \textbf{4.45} \\ 16 & 4 & 1 & 12 & 4.83 \\ \hline 4 & 4 & 2 & 24 & 6.94 \\ 8 & 4 & 2 & 24 & 5.60 \\ 12 & 4 & 2 & 24 & 5.15 \\ 16 & 4 & 2 & 24 & \textbf{4.75} \\ \hline 4 & 4 & 3 & 36 & 6.72 \\ 8 & 4 & 3 & 36 & 5.30 \\ 12 & 4 & 3 & 36 & \textbf{4.40} \\ 16 & 4 & 3 & 36 & 4.77 \\ \hline \end{tabular} \end{table} \section{Experiments} \label{sec:experiments} The aim of these experiments is threefold: (i) to evaluate configuration parameters associated with the encoding approach; (ii) to compare the proposed approach with other deep learning methods; (iii) to validate the proposed approach on a real-world application scenario. In our experiments, percentage error is used to measure the classification performance. The encoding approach mentioned in Section~\ref{sec:proposed-encoding-technique} produces encoded image based on Word2Vec word embedding. These encoded images can be used to train and test a CNN. We used AlexNet~\cite{krizhevsky2012imagenet} and Googlenet~\cite{szegedy2015going} architectures as base models. We used a publicly available Word2Vec word embedding with default configuration parameters as in~\cite{Mikolov2013nips} to train word vectors on all datasets. Normally, Word2Vec is trained on a large corpus and used in different contexts. However, in our work, we trained this model with the same training set for each dataset. \subsection{Parameters setting} We used 20news-bydate dataset to perform a series of experiments with different settings to find out the best configuration for the proposed method. In our first experiment, we changed the space $s$ among visual words and the number of Word2Vec features to identify relationships between these parameters. The result is shown in Table~\ref{tab:height-space}; we used the best result from this table to perform other experiments shown in Table~\ref{tab:result-comparison}. We obtained a lower percentage error with higher values of $s$ parameter and higher number of Word2Vec features. The length of feature vector $v_k(t_k)$ depends on the nature of the dataset. For example in Fig.~\ref{fig:image-size-example}, a text document composed of a large number of words cannot be encoded completely using high number of Word2Vec features, because each visual word occupies more space in the encoded image. Furthermore, we found out that error does not decrease linearly with the increase of Word2Vec features, as shown in Table~\ref{tab:comp-image-sizes}. We tested various shapes for visual words before selecting the best one, as shown in Fig.~\ref{fig:different-visual-words-comparison} (on the left). We showed that with rectangular shaped visual words, we obtained higher results, as highlighted in Fig.~\ref{fig:different-visual-words-comparison} (on the right). Moreover, the space $s$ between visual words plays an important role in the final classification, in fact using a high value for the $s$ parameter, the convolutional layer can effectively distinguish among visual words, also demonstrated from the results in Table~\ref{tab:height-space}. As shown in Fig.~\ref{fig:feature-maps-example}, the first level of a CNN (\textit{conv1}) specializes convolution filters in the recognition of a single superpixel. Hence, it is important to distinguish between superpixels of different visual words by increasing the parameter $s$. These experiments led us to the conclusion that we have a trade-off between the number of Word2Vec features to encode each word and the number of words that can be represented in an image. In fact, increasing the number of Word2Vec features increases the space required in the encoded image to represent a single word. Moreover, this aspect affects the maximum number of words that can fit in an image. The choice of this parameter must be done considering the nature of the dataset, whether it is characterized by short or long text documents. For our experiments, we used a value of $36$ for Word2Vec features, considering results presented in Table~\ref{tab:comp-image-sizes}. \subsection{Data augmentation} We showed that the \textit{mirror} data augmentation technique, successfully used in image classification, is not recommended here because it changes the semantics of the encoded words and can deteriorate the classification performance. Results are presented in Fig.~\ref{fig:image-augmentations-results}. In addition, we showed that increasing the number of training samples by using the \textit{crop} parameter, results are improved. More precisely, during the training and test phases, $10$ random $227\times227$ crops are extracted from a $256\times256$ image (or proportional crop for different image size, as reported in the leftmost Table~\ref{tab:result-comparison}) and then fed to the network. During the testing phase we extracted a $227\times227$ patch from the center of the image. \begin{table*} \centering \caption{Testing error of our encoding approach on $8$ datasets with Alexnet and GoogleNet. In addition, results obtained by Zhang~\textit{et al.}~\cite{zhang2015character} and Conneau~\textit{et al.}~\cite{conneau2017very} are included. } \label{tab:result-comparison} \begin{tabular}{lcccccccc} \hline \textbf{Model} & {\textbf{AG}} & \textbf{Sogou} & \textbf{DBP.} & \textbf{Yelp P.} & \textbf{Yelp F.} & \textbf{Yah. A.} & \textbf{Amz. F.} & \textbf{Amz. P.} \\ \hline Zhang \textit{et al.} & \textbf{7.64} & \textbf{2.81} & 1.31 & 4.36 & 37.95 & 28.80 & 40.43 & 4.93 \\ Conneau \textit{et al.} & 8.67 & 3.18 & 1.29 & \textbf{4.28} & \textbf{35.28} & 26.57 & \textbf{37.00} & 4.28 \\ \hline Encoding scheme + AlexNet & 9.19 & 8.02 & 1.36 & 11.55 & 49.00 & 25.00 & 43.75 & 3.12 \\ Encoding scheme + GoogleNet & 7.98 & 6.12 & \textbf{1.07} & 9.55 & 43.55 & \textbf{24.90} & 40.35 & \textbf{3.01} \\ \hline \end{tabular} \end{table*} \subsection{Encoded image size} We used various image sizes for the encoding approach. Fig.~\ref{fig:image-size-configuration} shows artificial images built on top of Word2Vec features with different sizes. As illustrated in Table~\ref{tab:comp-image-sizes}, percentage error decreases by increasing the size of an encoded image; however, we observed that sizes above $300\times300$ is computationally intensive; hence, this lead us to chose an image size of $256\times256$, typically used in AlexNet and GoogleNet architectures. \subsection{Comparison with other state-of-the-art text classification methods} We compared our approach with state-of-the-art methods. Zhang \textit{et al.} presented a detailed analysis between traditional and deep learning methods. From the paper, we selected best results and reported them in Table~\ref{tab:result-comparison}. In addition, we also compared our results with Conneau \textit{et al.} We obtained state-of-the-art results on DBPedia, Yahoo Answers! and Amazon Polarity datasets, while comparative results on AGnews, Amazon Full and Yelp Full datasets. However, we obtained higher error on Sogou dataset due to the translation process explained in Section~\ref{sec:datasets}. \subsection{Comparison with state-of-the-art CNNs} We obtained better performance using GoogleNet, as expected. This lead us to believe that recent state-of-the-art network architectures, such as Residual Network would further improve results. To work successfully with huge datasets and powerful models, a high-end hardware and large training time are required, thus we conducted experiments only on 20news-bydate dataset with three network architectures: AlexNet, GoogleNet and ResNet. Results are shown in Table~\ref{tab:result-comparison-netrworks}. We achieved better performance with powerful network architecture. \begin{table} \centering \caption{Percentage errors on 20news-bydate dataset with three different CNNs. } \label{tab:result-comparison-netrworks} \begin{tabular}{lc} \hline CNN architecture & error \\ \hline Encoding scheme + AlexNet & 4.10 \\ Encoding scheme + GoogleNet & 3.81 \\ Encoding scheme + ResNet & 2.95 \\ \hline \end{tabular} \end{table} \setlength{\tabcolsep}{4pt} \begin{table} \begin{center} \caption{Percentage error between proposed approach and single sources.} \label{tab:main-results} \begin{tabular}{lccc} \hline Dataset & Image & Text & \textbf{Proposed}\\ \hline Amazon & 53.93 & 35.93 & \textbf{27.48}\\ Ferramenta & 7.64 & 12.14 & \textbf{5.16}\\ \hline \end{tabular} \end{center} \end{table} \setlength{\tabcolsep}{1.4pt} \begin{figure} \centering \begin{tabular}{ccc} \frame{\includegraphics[width=0.12\textwidth]{amazon_image.jpg}} & \frame{\includegraphics[width=0.12\textwidth]{amazon_text.png}} & \frame{\includegraphics[width=0.12\textwidth]{amazon_multimodal.png}} \\ (a) & (b) & (c) \\ \end{tabular} \caption{An example of multi-modal fusion from the Amazon dataset belonging to the class "Baby". (a) shows the original image, (b) is a encoded text image and (c) shows the image with the superimposition of the encoded text in the upper part. The text in this example contains only the following 4 words "Kidco Safeway white G2000". The size of all images is $256\times256$. } \label{fig:multimodal-fusion-example} \end{figure} \subsection{An Application Scenario} \subsubsection{Classification Scenario} One of the main advantages of the proposed approach is the ability of converting a text document into the same feature space of an image. We therefore believe that the proposed approach can be exploited to improve the solution of problems requiring the combined use of image and text. For example, an advertisement on e-commerce websites consists of image and text description, therefore it becomes useful to exploit both these sources in a multi-modal strategy. Therefore, we use two multi-modal datasets to demonstrate that our approach brings significant benefits. The first dataset named Ferramenta dataset~\cite{gallo2017multimodal} consists of $88,010$ advertisements split in $66,141$ adverts for train and $21,869$ for test sets, belonging to $52$ classes. We used another publicly available real-world dataset called \textit{Amazon Product Data}~\cite{he2016ups}. We randomly selected $10,000$ adverts belonging to $22$ classes. Finally, we split $10,000$ advertisements for each class into train and test sets with $7,500$ and $5,000$ advertisements respectively. Both datasets provide a text and representative image for each advertisement. Text descriptions in Ferramenta dataset are in Italian language and we preferred not to translate to English, because we believe that the translation process would alter the nature of the text descriptions. However, text descriptions in Amazon Product Data dataset are in English. We compare the classification of advertisement using only the encoded text description, only the image and their combination. A sample image for these experiments is shown in Fig.~\ref{fig:multimodal-fusion-example}. The model trained on images only for Amazon dataset obtained the following first two predictions: \textbf{$\textbf{77.42\%}$ Baby} and \textbf{$\textbf{11.16\%}$ Home and Kitchen} on this example. While the model trained on the multi-modal Amazon dataset obtained the following first two predictions: \textbf{$\textbf{100\%}$ Baby} and $\textbf{0\%}$ \textbf{Patio Lawn and Garden} for the same example. This indicates that our encoding technique leads to a better classification result than the classification of text or image alone. Table~\ref{tab:main-results} shows that the combination of text and image into a single image, outperforms best result obtained using only a uni-modality on both multi-modal datasets. \subsubsection{Retrieval Scenario} The work in~\cite{nawaz2018revisiting} employs our encoding scheme for cross-modal retrieval system. With our encoding scheme, the retrieval system uses a single network trained in an end-to-end fashion. The results presented verify that raw text features are not necessary to map text descriptions to a similar embedding space with their respective images. \section{Conclusion} \label{sec:con} In this work, we presented a novel text classification approach to transform Word2Vec features of text documents into artificial images to exploit CNNs capabilities for text classification. We obtained state-of-the-art results on some datasets while in other cases our approach obtained comparative results. We showed that the CNN model generally used for image classification is successfully employed for different task such as text classification. As shown in the experiment section, the trend in results clearly show that, we can further improve results with more recent and powerful deep learning models for image classification. \section{Acknowledgment} We gratefully acknowledge the support of NVIDIA Corporation, which donated the GeForce GTX 980 GPU used in some experiments. We also acknowledge E4 Computer Engineering S.p.a. for providing an NVIDIA DGX-1, which allowed us to run experiments on computationally intensive datasets. \bibliographystyle{spmpsci}
\section{Context and motivation } Leaders, managers, and decision-makers critically rely on information and feedback. Decision-makers first need information about the current set of circumstances which provide the context of the decision, and then need feedback on how the decision could play out. To get such information in a format that allows them to appropriately understand the entity they are seeking to comprehend is of critical importance to come to a high-quality decision. Often only qualitative insight into the opinions, interpretations and assumptions of large numbers of people will allow us to understand a set of circumstances properly and are therefore required to make high-quality decisions and consequently outcomes. In the context of surveys, qualitative or open-ended answers are valuable since on the one side they acknowledge humans as the kinds of beings who interpret and re-interpret the world; on the other hand, by expressing precisely this human quality, surveys allow respondents to express unique perspectives and nuances that the researchers may not have been able to foresee. However, researchers have often reached for quantitative or closed-form questions where answers are expressed on a numerical scale, since this means the respondent is the chief source of the error of measurement \cite[104]{gorard_2003}. The relative ease with which numerical answers can be analyzed compared to open-ended answers is an obvious explanation for this preference. However, research inevitably makes ontological assumptions and claims about the nature of the object of study. For instance, \citet[104]{gorard_2003} gives the example of reported crime, where reported crime levels were higher when the survey instruments used closed scales, compared to open-ended questions. Furthermore, there is evidence suggesting that respondents are more consistent when using a self-defined or open-ended numerical rating scale, compared to a closed numerical scale \cite[218]{johnson_2008}. Thus, in addition to the extrinsic value of open-ended survey questions (e.g.\ in the form of improved revenue or business decision making), there are also clear ethical implications stemming from the choice of research instrument. We argue that the practical obstacles to analyzing open-ended answers should be met by an increased focus on open-source Natural Language Processing (NLP) applications that focus on aiding understanding. Such a move inevitably requires merging the linguistic facts with domain knowledge \cite[766]{friedman2013natural}. In suggesting research based on qualitative data we are confronted with a challenge. Research on quantitative data is naturally well-suited for analysing large amounts of information. On the other hand, the analysis of free-text responses has been notoriously tedious and time-consuming as it up to now typically required significant human intervention. In addition to this, there is the constant challenge of analysing such free-text data in an unbiased way, where human judgement is minimized in favour of an objective description and transparent analysis of the data. The risk of confirmation bias when working with textual and linguistic data was pointed out already by \citet[97]{kroeber1937quantitative}, noting that it is all too easy to unconsciously overlook evidence opposing some interesting or desirable affiliation in the data, while mentally taking note of every item corroborating it. The particular challenge that the proposed analysis seeks to address is that on the one hand the sample sizes are too big to be analysed manually. On the other hand, error margins are tolerated in analyses of large amounts of text, such as Twitter feeds, because they are likely to be evened out due to the large numbers of statements analysed, but the sample sizes at hand are too small allow for such large margins of errors. This dilemma -- the availability of too much text to analyze manually, and the need for small error margins -- is at the heart of the argument made in this paper. In this context, NLP provides an opportunity to develop solutions that allow increasing levels of automation in processing and analysing qualitative data input. Automating the processing of qualitative data also allows us to analyse and address issues of bias in a more structured way than would be the case when the process is manual. The inherent transparency of the approach proposed here makes it easier to analyse the elements of the linguistic algorithm that generates a bias compared to doing the same for a human being who generates a bias. This permits a more structured and transparent interrogation to explore which parts of the approach cause a bias and find technical solutions to reduce such bias. In this article we focus on a limited linguistic domain, namely the set of employee responses to a specific survey question. Our aim is to apply a series of NLP and Information Retrieval techniques with the practical goal of developing an open-source pipeline for extracting keywords from free-text survey responses that can be employed by non-specialists. The applied nature of this work aims to fill the gap between the algorithms developed in the context of research in theoretical computational linguistics and commercial software that provides so-called ``black-box'' systems that cannot be easily modified and adapted. \section{Philosophical and ethical argument, and example} Typically, research is commissioned to help the decision-making process in order to chart an appropriate course of action to address an issue or multiple issues. Because such research is intended to inform action, the assessment of the appropriateness of such action falls into the field of ethics. Ethics, broadly speaking, is the inquiry of whether the decisions made or actions taken based on research are desirable or undesirable, better or worse, right or wrong. Therefore, any technology that can improve the insight gained from such research has positive ethical import. For research to support desirable outcomes, it needs to be not only based on a methodology which is applied correctly and thus leads to correct outcomes, but it also needs to emphasize those aspects of the entity or entities to be researched that are relevant to making a desirable decision of leading constructive action. Such research needs to not only apply a given methodology correctly, but also needs to apply the methodology that gives a good understanding of the entity or entities to be researched. To get to an understanding of the aspects of an entity or a group of similar entities is the domain of ontology. Ontology in its broad definition is understood as the branch of metaphysics dealing with the nature of being and is also understood to be the study of beings as such, because we need an understanding of what something is in the first instance before we can decide what is desirable or undesirable for an entity. Intuitively we know that certain aspects of human life, such as true friendship, can hardly be quantified, and in some cases quantification can be downright misleading, for example when evaluating art by the price it can command in an auction. It should therefore already be clear that quantifying certain phenomena in itself has an ethical import, whether this ethical import is explicitly understood or not in each case when it is applied. As \citet{morgan1980case} pointed out some time ago, in committing to a particular research methodology, the researcher makes particular assumptions about the entity to be researched, whether the researcher is aware of this or not. Morgan and Smircich point out that choosing quantitative methods for researching social phenomena, one makes the assumption that the social world consists fundamentally of concrete structures similar to those entities researched in the natural sciences \cite[498]{morgan1980case}: ``Once one relaxes the ontological assumption that the world is a concrete structure, and admits that human beings, far from merely responding to the social world, may actively contribute to its creation, the dominant [quantitative] methods become increasingly unsatisfactory, and indeed, inappropriate.'' And they go further ``to point to a neglected feature of \textit{all} social research -- that it is based on implicit and untested ground assumptions.'' \cite[499]{morgan1980case}. The inquiry of testing ground assumptions falls into the domain of ontology, which interrogates the very nature of entities such as people and human collectives. In particular, in the twentieth century philosophers like \citet{wittgenstein1953philosophical} and \citet{heidegger} demonstrated that core to humans is their relation to language and their ability to interpret and re-interpret the world both individually and collectively. It can be deduced from there that any research that does not articulate such interpretations does not capture what is essential to humans and human communities. It should therefore be obvious that only research that acknowledges the qualitative nature of the data can achieve this. It is noteworthy that these comments by Morgan and Smircich were made already in 1980, in presumably one of the most prominent publications for management research, arguing for the adoption of more qualitative research for understanding social phenomena. Presumably the reason why qualitative research has not gained more prominence in research related to social phenomena is twofold. The first one is articulated by \citet{powell_2003} that the dominant approaches of research are not open to be investigated by the required ontological discourse. This is done without noticing that related research approaches are actually not ontologically neutral and lead to ethically questionable and misleading research \cite[27--32]{heil2011ontological}. It is beyond the scope of this paper to give a comprehensive overview of an appropriate ontological investigation into social phenomena and their ethical implications, and suggest specifics about appropriate research approaches beyond stating that qualitative research should play a much more prominent role in the research of social phenomena. Rather, this paper will focus on the much more practical question of why qualitative research has not become more prominent. This reason is that doing qualitative research on a large scale so far has been prohibitively time-consuming. It is hardly fruitful to criticize quantitative research methodologies for their ontological inadequacies when at the same time it is simply not feasible to do qualitative research in such a way that it can be applied on a large scale and with high levels of confidence to give a representative understanding of a large population. Rather, we hope that by contributing to making qualitative research significantly less time-consuming, the insights gained from such research will speak for themselves, and this supports the ethical and ontological claims by demonstrating them in practice. As such, the approach we are putting forward is intended to be a prime example of a technology with positive ethical import at the most fundamental level. \section{Background} As mentioned above, free-format text data are valuable, but unlike structured data such as ratings or binary questions, they are not easily accessible for analysis without substantial pre-processing. Such pre-processing can be done manually, but the process is time-consuming and does not scale well to large sets of data. The alternative to such manual analyses is to turn to computational techniques from the domains of NLP and information retrieval. \subsection{NLP algorithms for keyword extraction} Keyword extraction remains an unsolved problem with lower performance than in many other NLP tasks \citep{hasan2014automatic,lahiri2017keyword}. Keyword extraction is used both in general domains, such as news articles \citep{hasan2014automatic}, and more narrow genres such as medical texts or scientific writing \citep{hasan2014automatic, friedman2013natural}. The approach can also be based on specific channels of communication, such as emails \citep{lahiri2017keyword} or Twitter messages \citep{abilhoa2014keyword}. To our knowledge, no work has been done specifically targeting keyword extraction for survey response data. The general difficulty of the keyword extraction task depends on several factors, including the length of the text, their structural consistency, the number of topics in the texts and how they correlate \citep{hasan2014automatic}. Typically, keyword extraction is a multi-step process that starts with basic text processing to ensure higher quality input to the keyword candidate steps \citep{lahiri2017keyword}. An initial step is tokenization, the process of splitting the text into individual discrete units (tokens) for further analysis. Building on tokenization, part of speech tagging assigns a part of speech to each word or token in the text. Further, lemmatization makes use of the output from the two previous algorithms for grouping tokens together based on their lemma, or dictionary look-up form. Such pre-processing steps are useful to obtain an intermediate-level overview of free-form text, since they enable easy searches for all forms of a lemma, e.g. \textit{buy} for `bought', `buying', `buys', or all words with a given part of speech, e.g. all nouns in a dataset. However, such pre-processing is not sufficient to convey a high-level semantic overview of the data at hand. Following Zipf's law, which states a statistical relationship between the logarithmic frequency of a word and its logarithmic rank in a list of ordered frequencies \cite[15]{baayen2001word}, the most frequent words in a text, displaying the highest Zipf ranks, tend to be function words \cite[17]{baayen2001word}, which offer little insight on the content of a text, and are typically removed. Further algorithms have been developed that build on pre-processed data, aiming to extract the most salient keywords from free text data, thus providing a keyword summary of the text. Automatic keyword extraction at scale can be done by means of linguistic rules, statistical approaches, or machine learning approaches. See \cite{siddiqi2015keyword} for an overview. To some extent, the methodology is field dependent. In corpus linguistics, a field of research that relies heavily on statistical metrics, statistical approaches are widely used for studying keyword-related phenomena \citep{pojanapunya2018log}. Other approaches focus on the vector space representation of the words themselves, rather than on formal statistical tests \citep{hu2018domain}. Graph based approaches, among them RAKE \citep{rose2010automatic}, are widely used for automatic keyword extraction, in several adapted variants \citep{zhang2018adapted}. A related effort involves grouping words or keywords together into clusters or topics. Such topic extraction represents an added level of processing for dealing with synonyms such as \emph{staff} and \emph{employee}, or word senses such as \emph{screen} in the sense of physical display and \emph{screen} in the sense of what a software application displays. In this article we will focus on keyword extraction. The crucial step in any keyword extraction pipeline is the filtering stage, where potential keywords are ranked and evaluated. The means to perform this varies, and the approaches can be categorized in different ways \citep{hasan2014automatic,beliga2015overview}. From a machine learning point of view, the problem of keyword extraction can be recast as a supervised or unsupervised classification problem \citep{hasan2014automatic}. A deeper focus on the methods to achieve the classification reveals a wider range of methods \citep{beliga2015overview}. These include simple distributional methods such as TF-IDF (Term Frequency-Inverse Document Frequency), linguistic approaches that use lexical, syntactic, and semantic features, (supervised) machine learning, (unsupervised) vector space models, and graph models that model texts as graphs whose nodes are words and whose edges are relations between words, e.g.\ co-occurrence relations. These approaches are not mutually exclusive, so that linguistic features can be used as training features in a supervised classifier, for instance. Evaluation of keyword extraction requires a manually annotated gold standard. Typical evaluation measures include precision, recall, F-scores, and the Jaccard index \citep{hasan2014automatic,friedman2013natural,lahiri2017keyword}. Since keywords are contextual, a high performance in one channel or domain cannot be taken as absolute indication of high performance in another. Equally, some domains or channels might be more challenging than others, according to the dimensions mentioned above. This situation opens an interesting scenario when it comes to practical applications of keyword extraction. Without a uniform task difficulty, some domains or channels might be more susceptible than others to certain approaches. Since some keyword extraction algorithms are more challenging to implement than others, this implies that the threshold for adopting keyword extraction successfully in a domain or channel might vary substantially. Such a threshold for adoption will depend on several factors, not least what is already available out of the box. The subsequent section provides a brief overview of some existing packages and frameworks, with an eye towards their application in keyword extraction for survey data. \subsection{Existing software packages} A number of software packages exist for processing free-form text data. A full overview falls outside the scope of this article, but packages such as RapidMiner and IBM's SPSS Text Analytics Modeler provide keywords and topics. Additionally, a number of packages aimed at the corpus linguistic research community exist, such as WordSmith, MonoConc, and AntConc, and have a rather narrow, specialized focus. In addition to the software packages listed above, a number of programming languages implement toolkits for processing text. Interpreted languages such as Perl and Python have a long history in text processing, and in the case of the latter the NLTK toolkit has a wealth of NLP functions available. Even a specialized language such as the R platform for statistical computing has user-contributed packages for text mining, e.g.\ \citet{meyer2008text}. For a non-scripting language such as Java, toolkits include OpenNLP, Stanford NLP, LingPipe and GATE, to mention a few. The GitHub keyword extraction topic page provides an overview of some of code available, in several different programming languages (\url{https://github.com/topics/keyword-extraction}, accessed 14/04/2019). As with the other packages mentioned above, a full survey is beyond the scope of the present article. Whereas the software packages mentioned above lack flexibility, the programming language toolkits have an abundance of flexibility, but typically require a deep technical expertise to be used. Additionally, since software packages tend to come with a graphical user interface, they require extra (external) documentation. Documentation is crucial when working with free text data, because, as noted above, the process of extracting information from such data nearly always involves a series of steps that follow one another in a sequence. Since each step is dependent on the output of the previous step, fine-tuning the whole process might require manipulation of parameters and settings in several software components. In an iterative process, or a process being applied to a new dataset, documentation is typically required to have full control over, and thus a complete understanding of, the final information being produced. Conversely, computer code lends itself well to reproducible, documented multi-module processes, but the learning curve and the time investment might prove prohibitive. In short, while software packages tend to be less flexible (as well as sometimes costly), programming languages and their toolkits are flexible but complex, requiring both expertise and development time. We believe that a reasonable compromise is an open-source pipeline implemented in a high-level language such as Python. We prefer Python over Java or C++ because we have observed that Python is easy to learn for practitioners or academics with a non-computer science background, making it easier for them to contribute to existing code. Moreover, Python has a large community of programmers, which provides valuable support, as well as a wide range of libraries for NLP. Additionally, Python packages PySurvey (\url{https://pypi.python.org/pypi/PySurvey/0.1.2}, accessed 14/04/2019) already exist to deal with numerical survey data. Extending Python's survey capabilities to cover free text responses seems a natural next step. \section{The pipeline} A modular pipeline approach is desirable, since it allows different modules with different algorithms to feed into each other, thus producing a reasonably unbiased, objective summary of the input text. However, a knowledge extraction process can never be completely neutral or objective. For this reason, we stress the need for open source NLP systems and modules, where the assumptions of the developers can be scrutinized in detail, even at the implementation level. This alone constitutes an advantage for open source systems over proprietary ones, such as SPSS's Survey Analyzer. Such a philosophy has the drawback that it risks separating those with the programming skills to both use and evaluate existing code or modules, from those without such skills, who have no choice but to rely on proprietary software. Furthermore, an open toolkit allows further developments and improvements to be shared. We argue that a desirable pipeline should have the following properties: \begin{itemize} \item Extensive reuse of existing modules where possible; \item Focus on relatively user-friendly pipelines, where the focus is on outputs that aid understanding of the data; \item Open-access code, in a high-level language such as Python; \item Practical usability combined with transparency. \end{itemize} This section will demonstrate how the pipeline we have developed fulfils these criteria. We implemented the pipeline using the open-source programming language Python, version 2.7 and we are in the process of creating a version that is compatible with Python's version 3. The code is available on GitHub at the url \url{https://github.com/BarbaraMcG/survey-mining}. \subsection{Pipeline components} The pipeline consists of the following main components, organized in a modular way: \begin{enumerate} \item Initialization \item Text pre-processing \item Keyword extraction \end{enumerate} The input to the code is a file (in a spreadsheet format) which contains one row per survey response. In the test dataset we have used, for example, the following survey question was submitted to the employees of a private telecommunication company: ``What makes you proud of working in this company?'' and the input file was an Excel spreadsheet with 599 responses. Table \ref{table-examples-responses} shows some of the responses from this dataset. The code also takes as input a file containing a tailor-made list of acronyms, compiled specifically while keeping in mind the context and sector in which the company operates, and contains acronyms such as \emph{IT} and \emph{ICT}. This list is used in the code to exclude such acronyms from the list of keywords it produces, but is not a strict requirement for the pipeline. In the initialization stage, the code collects the names of relevant input and output directories and files; it also adds the target word, i.e.\ the object of the survey question (\emph{pride}, in the example above), and the company's name to the set of words to be excluded from the keyword list, which is pre-populated with the acronyms contained in the input file. In the text pre-processing phase, line breaks, bulleted lists, and numbered lists are deleted from the response texts. Next, the response texts are tokenized, part-of-speech tagged, and lemmatized using the tokenizer, part-of-speech tagger, and the WordNet lemmatizer from the NLTK package \citep{nltk_book}. The initial keyword extraction is performed using the Python library topia.termextract \citep{topia}. In addition, we extracted keyword noun compounds when two noun keywords occurred one after the other; an example of this is /emph{training centre} in the third response from Table 2. In order to add a further level of analysis, we also extracted any adjectives modifying the keywords, together with their frequencies. This heuristic has the advantage of bringing about a linguistically richer set of keywords. As in \citet{lahiri2017keyword}, the term ``keyword'' is used collectively about words and phrases. The output of the pipeline consists of two files. The first file displays, for each response, the list of its keywords and their modifying adjectives. As an example, see Table \ref{table-responses-kws-pipeline} for the output relative to the third response from Table \ref{table-examples-responses}. The second file lists all keywords extracted from the dataset, with their frequency (i.e.\ the number of responses containing it), and the adjectives modifying them, with their frequency (i.e.\ the number of responses containing the keyword and the adjectives together). \begin{table} \caption{Example survey responses describing what makes the respondent proud to work for the company.} \begin{tabular}{l} \hline\hline Response\\ \hline Providing services e.g.\ fibre to the home \\ \hline \parbox[t]{7cm}{Get work satisfaction working with new \\technologies +constantly learning}\\ \hline You can further your studies, have an internal training centre \\ \hline \parbox[t]{7cm}{Where we've come from challenges we have \\faced +now giving investors returns} \\ \hline \hline\hline \end{tabular} \label{table-examples-responses} \end{table} \begin{table} \caption{Subset of the keywords extracted by the pipeline (second column), together with the adjectives modifying them (third column), and the corresponding survey response (first column, corresponding to the third response from Table \ref{table-examples-responses}).} \begin{tabular}{lcc} \hline\hline Response & Keyword & Adjectives \\ \hline You can further your studies, have an& study & \\internal training centre. && \\\hline You can further your studies, have an & training centre & internal \\internal training centre.&& \\\hline You can further your studies, have an& training & internal \\internal training centre. && \\\hline You can further your studies, have an& centre & \\internal training centre. && \\ \hline\hline \end{tabular} \label{table-responses-kws-pipeline} \end{table} \section{Evaluation} To our knowledge, there is no gold standard dataset for keyword extraction evaluation. To evaluate our pipeline, we compared it with a manually annotated dataset. Furthermore, since our work sits at the interface between research and NLP applied to commercial contexts where the tools can be used by non-specialists, we also used the output from a commercial software package specifically aimed at survey data. Finally, we also compared the pipeline against a baseline open computational method (TF-IDF). In order to prepare a comparison set for the evaluation, we manually analyzed the test dataset. This analysis aimed at a high-level description of the content of each survey response by means of keywords; an example of such keywords is given in Table \ref{table-responses-kws-manual} and relates to the second response in Table \ref{table-examples-responses}. \begin{table} \caption{Subset of keywords manually assigned to the second response from Table \ref{table-examples-responses}} \begin{tabular}{lrr} \hline\hline Response & Keyword & Description \\ \hline \parbox[t]{3cm}{Get work satisfaction\\constantly learning\\ working with new\\ technologies + constantly learning} &new technology & \parbox[t]{3cm}{New technology\\ and innovation} \\\hline \parbox[t]{3cm}{Get work satisfaction\\ working with new\\ technologies + \\constantly learning} & learning & \parbox[t]{3cm}{Skills development, learning,\\ personal development} \\\hline \parbox[t]{3cm}{You can further your\\ studies , have \\a internal \\training centre.} & training centre & \parbox[t]{3cm}{Skills development, learning,\\ personal development} \\\hline \parbox[t]{3cm}{Give better security\\ re new products \\launched.} & new product & \parbox[t]{3cm}{New technology\\ and innovation} \\ \hline\hline \end{tabular} \label{table-responses-kws-manual} \end{table} As we can see from Table \ref{table-responses-kws-manual}, the keyword assigned to the first response text is ``new technology''; the adjective \emph{new} associated with technology is important to convey the fact that one of the company's qualities is its innovation. This example demonstrates the need to extract adjectives of the keywords, in addition to the keywords themselves. For the comparison with commercial software, we chose SPSS Survey Analyzer 4.0.1 because it is specifically designed to handle survey data. Additionally, following \citet{liu2009unsupervised}, the baseline method we chose was keyword extraction with TF-IDF. TF-IDF is a well-known metric for statistically retrieving topic or index terms associated with a collection of documents \citep{sparck1972statistical}. TF-IDF is both simple to compute and widely used for practical applications \citep{sparck2004idf}. In order to demonstrate added value, our new pipeline ought to show improved results over a simple TF-IDF approach. When comparing the set of keywords extracted by our system with the baseline, the set from the manual analysis, and the one from SPSS, we performed exact match after stemming, i.e.\ we first stemmed the keywords from all sets, and then assessed when the stemmed keywords appeared in the different sets. Table \ref{table-kws-nb} displays the number of stemmed keyword types in each system. The purpose of the evaluation was to assess the quality of the pipeline against the other methods (commercial software, baseline, and manual analysis) according to the following metrics: \begin{enumerate} \item Response coverage: number of responses for which at least a keyword was found in each of the four systems; \item Precision, recall, and F-score for each response, calculated by comparing each system with the manual analysis; \item Correlation between the set of frequency-ordered keywords produced by the manual analysis and the set of keywords produced by each of the three systems; \item Similarity between the set of keywords produced by the manual analysis and the set of keywords from the three systems, on a per-response basis. \end{enumerate} \begin{table} \caption{Number of stemmed keyword types in each of the systems used in the evaluation.} \begin{tabular}{ll} \hline\hline Data set & Number of stemmed keyword types \\ \hline Manual analysis & 1,163\\ Pipeline & 365\\ SPSS & 37\\ Baseline (TF-IDF) & 471\\ \hline\hline \end{tabular} \label{table-kws-nb} \end{table} Table \ref{table-kws-nb} displays the number of keywords and Table \ref{table-coverage} displays the coverage metric, for the four approaches: manual analysis, the pipeline, SPSS, and the baseline keyword extraction with TF-IDF. We note that SPSS's coverage is the lowest one. This can be explained by the fact that this software package extracts a low number of keywords compared to the other methods considered. Furthermore, note that the manual analysis has a lower coverage compared to the pipeline and the baseline. The first row in table 6 displays the number of keywords shared by the set extracted by the manual analysis on the one side and the set extracted by the pipeline (first column), SPSS (second column), and the TF-IDF baseline (third column) on the other side. If we consider the manually extracted keywords as a gold standard, this represents the absolute number of correct keywords in each of the three systems. The second row shows the precision of each of the three systems, defined as the number of correct keywords out of all extracted keywords. The third row shows the systems' recall, defined as the number of correct keywords out of all keywords from the manual analysis. Finally, the fourth column contains the F-score, defined as \[F1 = 2*\frac{precision*recall}{precision+recall}.\] As we can see from Table \ref{table-evaluation}, the pipeline outperforms (or equals) the other two systems in all three metrics. \begin{table} \caption{Coverage of each system in the evaluation.} \begin{tabular}{ll} \hline\hline Data set & \% Coverage\\ \hline Manual analysis & 93\\ Pipeline & 100\\ SPSS & 49\\ Baseline (TF-IDF) & 100\\ \hline\hline \end{tabular} \label{table-coverage} \end{table} Another criterion for evaluating the pipeline concerns how accurately it describes the frequency of the keywords in the dataset, i.e. the number of responses containing each of the keywords. Table \ref{table-freq} shows the top 10 keywords extracted by the pipeline, with their frequencies. \begin{table} \caption{Different evaluation metrics for the three systems analyzed.} \begin{tabular}{llll} \hline\hline Measure & Pipeline & SPSS & Baseline (TF-IDF)\\ \hline Number of correct keywords & 152 & 31 & 138\\ Precision & 0.33 & 0.33 & 0.26 \\ Recall & 0.42 & 0.09 & 0.38 \\ F-score & 0.37 & 0.14 & 0.31 \\\hline\hline \end{tabular} \label{table-evaluation} \end{table} We compared the list of keywords frequencies of the manual analysis against the three methods and ran Spearman's correlation test \citep{daniel1990spearman}. This test assesses monotonic relationships between two datasets. Unlike Pearson's correlation test, this test does not assume that both datasets are normally distributed. The Spearman's correlation coefficient varies between -1 and +1; a coefficient equal to 0 shows no correlation; if the coefficient is positive and close to 1, this means that, as one dataset increases, so does the other one and that this association is strong. The results of the correlation tests are shown in Table \ref{table-corr}. \begin{table} \caption{Number of survey responses containing the top 10 keywords at least once. Note that each response may contain more than one keyword.} \begin{tabular}{ll} \hline\hline Keyword & Num.\ responses\\\hline company & 104\\ service & 83\\ product & 75\\ work & 65\\ benefit & 56\\ offer & 49\\ customer & 45\\ job & 40\\ technology & 38\\ staff & 36\\\hline\hline \end{tabular} \label{table-freq} \end{table} The test gave significant results in all cases, and showed a moderate correlation between the manual analysis and the pipeline and between the TF-IDF baseline and the manual analysis, and strong correlation between the SPSS and the manual analysis. According to this measure, the pipeline performs worse than the other two systems. However, a correlation is always calculated for vectors of equal length. This means that correlation could only be calculated for the overlap between the gold standard and each of the sets of extracted keywords. Since SPSS only identified a very small number of keywords, the correlation coefficient is based on a much smaller sample compared to the pipeline or the TF-IDF baseline. Finally, for each response, we compared the set of stemmed keywords extracted by each system again the manual analysis, in order to account for the general distribution of the similarity between the systems. We calculated the Jaccard coefficient \cite[299]{manning1999foundations} to measure the similarity between the keyword sets. This coefficient tends to penalize small number of shared entries, which is appropriate to the case at hand. \begin{table} \caption{Results of correlation test on the list of keywords frequencies of the manual analysis against the three methods in the evaluation.} \begin{tabular}{lll} \hline\hline Dataset & Spearman's correlation & $p$-value\\ \hline Pipeline & 0.30 & $<<0.05$ \\ SPPS & 0.73 & $<<0.05$ \\ Baseline (TF-IDF) & 0.44 & $<<0.05$ \\ \hline\hline \end{tabular} \label{table-corr} \end{table} Figure \ref{fig_jaccard} shows a box and whiskers plot of the Jaccard similarity between the manual analysis and the three methods and Table \ref{table-jaccard} shows the summary statistics of the distributions in terms of minimum, maximum, mean, and standard deviation. \begin{figure} \includegraphics[width=0.7\textwidth]{img/jaccard_bw_v1.png}\\ \caption{Box and whiskers plot comparing the Jaccard similarities for the Python pipeline, SPSS, and TF-IDF.}\label{fig_jaccard} \end{figure} As we can see from Table \ref{table-jaccard}, our pipeline's performance is the best one, because the keywords it extracts are closer to the manually-extracted keywords compared to the TF-IDF and SPSS systems. \begin{table} \caption{Summary statistics of the distributions of Jaccard similarity between the keywords extracted with manual analysis and the keywords extracted by the three methods.} \begin{tabular}{llll} \hline\hline Jaccard Index & Pipeline & TF-IDF & SPSS \\ \hline Minimum & 0.00 & 0.00 & 0.00 \\ Maximum & 0.80 & 0.70 & 0.70 \\ Mean & 0.30 & 0.09 & 0.09 \\ Standard deviation & 0.22 & 0.16 & 0.17 \\ \hline \end{tabular} \label{table-jaccard} \end{table} \section{Discussion} The pipeline discussed above seeks to fill a gap in the field of keyword extraction by focusing explicitly on free-text survey response data. As mentioned above, some commercial software packages with such a focus exist, in addition to general approaches such as TF-IDF. However, the special nature of survey responses, namely their short length and dependence on the context provided by the survey question, begs the question of how well a general approach will fare. As the evaluation of the pipeline in section 5 demonstrated, TF-IDF performed quite well, but still worse than our pipeline. This might be explained by the fact that, as a result of having fewer words, short texts will also have a lower TF-IDF score. This will penalize terms during the extraction phase not due to the frequencies of the words themselves, but due to the length of texts they appear in. The commercial SPSS add-on package covered a small number of the same keywords as the pipeline, but also missed out on a high proportion of the keywords in the manually-analyzed data and overall performed worse than our pipeline in all but one evaluation metric, the one based on Spearman's correlation. In contrast, our linguistically motivated unsupervised pipeline performed well. Compared to the gold standard, the pipeline achieved an F-score of 0.37. This result is comparable with the F-scores reported by \citet{lahiri2017keyword}, who report a maximum F-score of 0.39 for a keyword extraction system for email data. We also saw that the Jaccard similarity for the pipeline keywords was much higher than for the other approaches. This result may indicate that short survey answers, with their crucial dependence on the semantic and pragmatic coherence provided by the context of the survey question, benefit particularly from the pipeline's use of linguistic information. Nevertheless, we should consider one possible objection and limitation to the pipeline, the question of scalability. The current pipeline was not constructed with Big Data technologies in mind, i.e. large-scale distributed systems for dealing with datasets too large to be processed on a single computer. However, we do not consider this a major objection, given the intended use case. Although some surveys might collect data truly too large for a single computer to process, there are probably more survey data collected on a smaller scale, sufficiently small to be processed on a single computer. In this respect the pipeline is similar to a commercial single-computer application for mining survey data. However, due to the open and transparent nature of the pipeline, it can be re-implemented for a Big Data system, should the need arise. This flexibility constitutes an advantage over proprietary, commercial systems. Furthermore, when it comes to free-form text data, even a small or medium-sized sample, such as the one analyzed here, is sufficiently large to present the researcher with complexities of a sufficient scale that automated, unsupervised processes are valuable. The interpretation process itself, which is never entirely free from human judgment, can be improved by the addition of an automated step. This is not because such a step is closer to some pre-existing objective reality, but simply because it performs predictably and consistently in its assigned tasks. In addition to the sheer workload of manually analyzing free-format text survey responses, a researcher resorting to intuition alone might easily become biased when noting ``a certain affiliation that is real enough, but perhaps secondary; thereafter [noting] mentally every corroborative item, but unconsciously overlooks or weighs more lightly items which point in other directions.'' \cite[97]{kroeber1937quantitative}. An automatic keyword extraction process helps protect against bias and unconscious oversights, while offering valuable input for the human interpretation performed by the researcher. The choice of keyword extraction system will always depend on a number of variables. We have shown that our pipeline stands up well compared with some alternative approaches. Beyond the performance in terms of specific metrics, it is worth noting the arguments by \citet{church2017emerging} and \citet{manning2015computational} regarding the importance of transparency in computational NLP models. The same point can be extended to analysis of survey data. A linguistic or hybrid keyword extraction approach will by its nature be more transparent than a purely statistical approach, other things being equal. Such transparency is not only of interest in academic research, but also in the realm of applied NLP for decision making, where the transparency supports accountability. Another consideration is the nature of the text to be analyzed. In our case, the application area was survey questions, which have a number of special features. In most cases they are short, and since short texts will yield fewer potential keywords, linguistic rules perform better \citep{hasan2014automatic}. However, it would be misleading to suggest that the survey responses are merely keywords surrounded by stopwords. The higher performance of our pipeline compared to a simple approach such as TF-IDF shows that there is added value in the extra steps involved in the pipeline. Finally, the context provided by the survey itself makes a linguistic-based approach attractive. Unlike many other classification tasks, the answers are constrained into a topic (the survey question), which further restricts the number of potential keywords. \section{Conclusion} Initially, we set out some desirability criteria for an open source, computational pipeline for free form text data: \begin{itemize} \item Extensive reuse of existing models where possible; \item Focus on relatively user-friendly pipelines, where the focus is on outputs that aid understanding of the data; \item Open-source code, in a high-level language such as Python; \item Practical usability combined with transparency. \end{itemize} As sections 4 and 5 showed, the pipeline matches these criteria. Section 2 provided the basis for the importance of these criteria. In the past the analysis of large amounts qualitative, free-text research data has proven very time intensive and was always at risk of research bias leading to unreliable results. While there have been software packages that support the coding of responses to open ended questions, this still meant that the researcher had to read each and every response. With the advent of commercial text analytics packages for annotation this effort has been lessened, but still requires significant time and manual effort from researchers to extract keywords and topics. With purely statistical approaches to keyword extraction, including commercial software packages, the lack of transparency presents the researcher with a hidden and unquantified bias. In sum, these factors in many cases make free-text data unattractive for researchers when compared with ease with which large amounts of quantitative data can be analysed. The software developed for this paper demonstrates how transparent, linguistically motivated keyword extraction can be performed in a way that allows for automating the analysis of large amounts of responses to open-ended questions in a survey. With an open source approach it is possible for an observer to test the process for possible biases in the way keywords are extracted. This will hopefully make it more feasible and attractive to apply qualitative questionnaires to much larger sample sizes. A side effect of larger sample sizes is that it allows for statistical analysis of qualitative data that also satisfies the requirements of quantitative researchers. Furthermore, due to the reduction in the time required to analyse large amounts of qualitative data, the automation of the analysis leads to a significant reduction in costs, making it viable to conduct qualitative research on a large scale for commercial purposes. The profound consequences of this have been outlined at the beginning of this article. While the academic case for this has been made, we contend that ultimately the easiest way to make the case for more qualitative research is by showing a way to do the analysis of qualitative data in a quick and transparent way, producing appropriate summaries of the topics covered in large amounts of qualitative responses and let the results and ease of use speak for themselves. Meanwhile, the open source Python implementation ensures that the pipeline is both flexible and available for extensions, modifications, and improvements \subsection*{Acknowledgements} This work was supported by The Alan Turing Institute under the EPSRC grant EP/N510129/1. \subsection*{Author contributions} All authors contributed to the conceptualization of the study and for writing the original draft. BMcG and GBJ were responsible for developing the software and the computational methodology, and reviewing and editing the article. BMcG was additionally responsible for the evaluation, the statistical analysis, and the visualization. DH was responsible for acquiring the data. DH was responsible for the philosophical and practical justification for the software. All authors contributed to curating the data. All authors gave final approval for publication.
\section{Details about View Synthesis} \section{View Synthesis Details} \subsection{Details of Point Cloud Rendering} Here we provide more details about the point cloud interpolation and view selection part of view synthesis. For a view $v_j$ that we want to synthesis, we get the rendered point cloud from the nearest $k$ views $v_{j1}, v_{j2}, \dots, v_{jk}$ based on Euclidean distance. Denote the reprojected point clouds as $p_{j1}, p_{j2}, \dots, p_{jk}$. Assuming the target resolution is $w\times h$, each point cloud is a set of projected points $\{(x,y)\}$, with $0\leq x \leq w$ and $0 \leq y \leq h$. We do two operations on each project point cloud. First, we run a kernel density estimator on the point cloud with a Gaussian kernel. This provides information about the density of points from a certain view at a certain region. Second, for each grid point in $x,y$-plane we query the nearest 4 points and did a bilinear sampling in an irregular polygon. Denote the density of point cloud image of view $k$ as $d_{jk}\in R^{w\times h}$. The weight for view $k$ is $w_{jk} = d_{jk}/ (\sum_i d_{ji})$. Denote the interpolated image from source view $k$ as $I_{jk} \in R^{w\times h\times 3}$, then the final output of view selection and interpolation is $I_j = \sum_i w_{ji} \circ I_{ji}$. We implement these steps in CUDA and thus they have small effects on point cloud rendering speed. The benefit of the point cloud interpolation and view selection is that they create a smooth transition across point clouds from different source views, making the imperfection easier to fix by Neural Network Filler $f$. \subsection{Details of Training Neural Network Filler} \textbf{Network Architecture.} The details of the network architecture are shown in Table~\ref{tbl:archiecture}. We use a combination of convolutional layers, deconvolutional layers and dilated convolutional layers. Batch normalization is applied to each output feature map of all types of convolutional layers. We use leaky ReLU with slope $0.1$ as activation function for all layers. \textbf{Identity initialization.} For image processing or filtering, [11] advocates using adaptive normalization for identity initialization, where they also design kernels to force identity mapping. Empirically, we find that using a stochastic version that ensures an overall identity function but preserves the diversity of Gaussian random initialization works better and achieves faster convergence. We initialize half of the weight with Gaussian random and \emph{freeze} them and optimize the rest with back propagation so the network outputs the same input image. After convergence, the weights are our stochastic identity initialization. \textbf{Hyperparameter setting.} For the network architecture, the number of kernels of the network is configurable with a parameter $n_f$. In the experiments, we use two settings where $n_f$ is either 12 or 64. For domain adaptation and view synthesis experiments we use $n_f = 64$. For RL training we use $n_f = 12$ to reduce RL training time. In rendering speed benchmarking we used $n_f=12$. For the loss, there are two hyperparameters to tune. The first is $\lambda_l$, which is the coefficient for each layer of VGG feature map. We normalize it the number of elements in the feature map, i.e. $\lambda_l = 1/n_l$. The second parameter is the coefficient for color match loss $\gamma$. We set it to $0.05$ across the experiments. \begin{figure*} \centering \includegraphics[width=\linewidth]{figures/figS2_large.pdf} \caption{\textbf{Additional view synthesis results.} We provide additional view synthesis and domain adaptation results. The format is similar to Fig. 6 in the main paper. The results have high resolution and are very rich in details, so we encourage readers to zoom in to see details. } \label{fig:additional_vs} \end{figure*} \begin{table} \centering \begin{tabular}{llllll} \hline Type & Kernel & Dilation & Stride & Output \\ \hline conv. & $5\times 5$ & 1 & $1\times1$ & 6 \\ conv. & $5\times 5$ & 1 & $2\times2$ & $n_f$ \\ conv. & $3\times 3$ & 1 & $1\times1$ & $n_f$ \\ conv. & $5\times 5$ & 1 & $2\times2$ & $4n_f$ \\ \hline dilated conv. & $3\times 3$ & 1 & $1\times1$ & $4n_f$ \\ dilated conv. & $3\times 3$ & 1 & $1\times1$ & $4n_f$ \\ dilated conv. & $3\times 3$ & 2 & $1\times1$ & $4n_f$ \\ dilated conv. & $3\times 3$ & 4 & $1\times1$ & $4n_f$ \\ dilated conv. & $3\times 3$ & 8 & $1\times1$ & $4n_f$ \\ dilated conv. & $3\times 3$ & 16 & $1\times1$ & $4n_f$ \\ dilated conv. & $3\times 3$ & 32 & $1\times1$ & $4n_f$ \\ dilated conv. & $3\times 3$ & 1 & $1\times1$ & $4n_f$ \\ dilated conv. & $3\times 3$ & 1 & $1\times1$ & $4n_f$ \\ \hline deconv. & $4\times 4$ & 1 & $2\times2$ & $n_f$ \\ conv. & $3\times 3$ & 1 & $1\times1$ & $n_f$ \\ deconv. & $4\times 4$ & 1 & $2\times2$ & $6$ \\ conv. & $3\times 3$ & 1 & $1\times1$ & $6$ \\ conv. & $3\times 3$ & 1 & $1\times1$ & $3$ \\ \hline \end{tabular} \caption{\textbf{Network Architecture.} The network architecture is detailed in this table. We use three types of layers: convolutional layers(conv.), dilated convolutional layers(dilated conv.) and deconvolutional layers(deconv.). The network size is configurable with parameter $n_f$.} \label{tbl:archiecture} \end{table} \section{Details about Semantic Modality} Some models in our system are semantically annotated. For those models, we are able to output a semantic segmented frame. Examples are shown in Fig.~\ref{fig:semantics}. We provide semantic labels for 13 classes, including floor, ceiling, wall, beam, window, column, door, table, chair, bookcase, sofa, board, and clutter. \begin{figure} \includegraphics[width=1.0\linewidth]{figures/semantics.pdf} \caption{\textbf{Sample frames with semantic annotation}. Top: NN filled images; Bottom: Corresponding semantic labels of pixels. } \label{fig:semantics} \end{figure} \section{Additional Experiments} \subsection{Additional View Synthesis Results} We provide additional view synthesis results to provide a more thorough understanding of the qualitative results. The results are shown in Fig.~\ref{fig:additional_vs}. \subsection{Additional RL Experiment Setup} We used Gibson environment with default physical settings (gravity = 9.8$m^2/s^2$, friction coefficient = 0.7) for our experiments. In Visual Obstacle Avoidance and Visual Navigation we used default discrete action space in Gibson for Husky robot, which translates four dimensional (left/right/forward/backward) control signal to four sets of predefined torques. In Visuomotor Control we used default continuous action space for Ant robot, which accepts eight real value torque signals. At every time step, the nonviz sensor output received by the agent includes robot position, orientation, velocity, and distance and angle towards target. In Visuomotor Control experiment, this also includes the number of feed the Ant robot has in contact with the ground. In Visual Obstacle Avoidance, Navigation and Visuomotor Control tasks, our primary reward for the agent is the change in potential (negative distance towards the target), specifically $-\frac{d L_{target}}{dt}$. In visual obstacle avoidance we added another distance term $c * L_{nearest}$, where $L_{nearest}$ is the length of the beam coming out from the front of the robot. This mimics the effect of front LiDAR and encourages the agent to move in unobstructed directions. We didn't use any additional term in our reward: alive score, collision, contact, etc. The agent learns to utilize it's DoF, minimize collisions and maximize its lifespan to reach the highest score. \subsection{Additional RL Experiment Results} {\bf Network Architecture and Training Details} In order to account for the different input modalities of inputs, we use different Neural Network policies. For sensor-only RL agents, we used a policy with two identical networks for value and policy function: MLP with two hidden layers using $tanh$ activation. For perceptual agents, we used a sensor-vision policy that has the same MLP structure to process sensor input, and another CNN with two hidden layers using $relu$ activation to process camera input. We use a densely connected layer to combine MLP and CNN at the end. The implementations are based on OpenAI baselines. We used Proximal Policy Optimization for training our RL policies. We used linearly decreasing learning rate, gamma of $0.99$ and optimization batch size of $64$. Our average episode length is 400 for Navigation and 60 for Visuomotor Control. We set time step per actor batch for these two tasks as 3000 and 2000. Since there is no ending condition for Obstacle Avoidance task, we set its time step per batch as 1024. Our reward curves for Obstacle Avoidance, Navigation, and Visuomotor Control stabilize after 100K, 600K and 700K time steps. \begin{figure} \includegraphics[width=1.0\linewidth]{figures/ant_stairway_v1_nonviz_comp.pdf} \caption{\textbf{Ant climbing downstairs tasks reward curve}. Left: ending position of sensor-only (red) and perceptual (green) agent. Right: reward curves and test score. Here we plot the reward curve over the first 700K frames when the agent starts to acquire stair climbing ability.} \label{fig:reward_climb} \end{figure} {\bf Visuomotor Control Results} During training, we modified the ant robot's size and body shape to be reasonable based on the size of stairs in real life. We initialize the ant at random location at the midpoint of the stairs and train it to reach the bottom of the stairs using the sensor-only network, and sensor-vision fusion network with depth as perceptual input. Both agents know their relative location towards the target. To prevent the agent from learning suboptimal policies (e.g. rolling down the stairs), we terminate the agent when its leaning angle is more than 90 degrees. Within the same amount of clock time, we trained the sensor-only agent for 4M frames, and perceptual agent for 900K frames, due to longer CNN processing time in fusion network. Sensor-only agent reached a final score of 34 and perceptual agent reached a final score of 25.6. To evaluate how robust our learned visuomotor control policies are, we modified the target positions in test time. In Fig.~\ref{fig:reward_climb} the target (light red cube) is moved from the bottom of stairs to behind the corner by 0.5$m$. In order to reach it, the agent needs to first climb the stairs and then walk towards the target. Red and green small cubes show the death/finish locations of sensor-only and perceptual agents. Performance of sensor only agent drops significantly from 34.0 to 22.7 (-11.3), while the perceptual agent's performance slightly drops from 25.6 to 23.3. Failure cases for the sensor-only robot are: (1) being obstructed by the wall, (2) not approaching the target after going downstairs. This shows that policy learned by the sensor-only robot is limited in either only knowing to move in target direction, or only knowing to climb downstairs. \end{document} \section{Introduction} \label{sec:intro} \vspace{-1mm} We would like our robotic agents to have compound perceptual and physical capabilities: a drone that autonomously surveys buildings, a robot that rapidly finds victims in a disaster area, or one that safely delivers our packages, just to name a few. Apart from the application perspective, the findings supportive of a close relationship between visual perception and being physically active are prevalent on various fronts: evolutionary and computational biologists have hypothesized a key role for intermixing perception and locomotion in development of complex behaviors and species~\cite{parker2011origin, wolpert2000computational, churchland1994critique}; neuroscientists have extensively argued for a hand in hand relationship between developing perception and being active~\cite{smith2005development, held1963movement}; pioneer roboticists have similarly advocated entanglement of the two~\cite{brooks1990elephants, brooks1991intelligence}. This all calls for developing principled perception models specifically with active agents in mind. By perceptual active agent, we are generally referring to an agent that receives a visual observation from the environment and accordingly effectuates a set of actions which can lead a physical change in the environment ($\sim$manipulation) and/or the agent's own particulars ($\sim$locomotion). Developing such perceptual agents entails the questions of \emph{how} and \emph{where} to do so. \vspace{2mm} On the \emph{how} front, the problem has been the focus of a broad set of topics for decades, from classical control~\cite{pomerleau1989alvinn, boyd1994linear, khatib1987unified} to more recently sensorimotor control~\cite{finn2016deep, levine2016end, levine2016learning, abbeel2010autonomous}, reinforcement learning~\cite{abbeel2007application, schulman2015trust, schulman2017proximal}, acting by prediction~\cite{dosovitskiy2016learning}, imitation learning~\cite{codevilla2017end}, and other concepts~\cite{mottaghi2016newtonian, zhu2017target,wu2015galileo,wu2016physics}. These methods generally assume a sensory observation from environment is given and subsequently devise one or a series of actions to perform a task. A key question is \emph{where} this sensory observation should come from. Conventional computer vision datasets~\cite{everingham2010pascal,deng2009imagenet, lin2014microsoft} are passive and static, and consequently, lacking for this purpose. Learning in the physical world, though not impossible~\cite{gupta2016supersizing, agrawal2016learning, levine2016learning, pinto2016supersizing}, is not the ideal scenario. It would bound the learning speed to real-time, incur substantial logistical cost if massively parallelized, and discount rare yet important occurrences. Robots are also often costly and fragile. This has led to popularity of learning-in-simulation with a fruitful history going back to decades ago~\cite{pomerleau1989alvinn,langley1981simulated,carbonell1986world} and remaining an active topic today. The primary questions around this option are naturally around \emph{generalization from simulation to real-world}: how to ensure I. the \emph{semantic complexity} of the simulated environment is a good enough replica of the intricate real-world, and II. the \emph{rendered visual observation} in simulation is close enough to what a camera in real-world would capture (photorealism). We attempt to address some of these concerns and propose Gibson, a virtual environment for training and testing \emph{real-world} perceptual agents. An arbitrary agent, e.g. a humanoid or a car (see Fig.~\ref{fig:pull}) can be imported, it will be then embodied (i.e. contained by its physical body) and placed in a large and diverse set of real spaces. The agent is subject to constraints of space and physics (e.g. collision, gravity) through integration with a physics engine, but can freely perform any mobility task as long as the constraints are satisfied. Gibson provides a stream of visual observation from arbitrary viewpoints as if the agent had an on-board camera. Our novel rendering engine operates notably faster than real-time and works given sparsely scanned spaces, e.g. 1 panorama per 5-10 $m^2$. The main goal of Gibson is to facilitate transferring the models trained therein to real-world, i.e. holding up the results when the stream of images switches to come from a real camera rather than Gibson's rendering engine. This is done by: first, resorting to the world itself to represent its own semantic complexity~\cite{simon1996sciences, brooks1990elephants} and forming the environment based off of scanned real spaces, rather than artificial ones~\cite{song2016ssc,kempka2016vizdoom,johnson2016malmo}. Second, embedding a mechanism to dissolve differences between Gibson's renderings and what a real camera would produce. As a result, an image coming from a real camera vs the corresponding one from Gibson's rendering engine look statistically indistinguishable to the agent, and hence, closing the (perceptual) gap. This is done by employing a neural network based rendering approach which jointly trains a network for making renderings look more like real images (forward function) as well as a network which makes real images look like renderings (backward function). The two functions are trained to produce equal outputs, thus bridging the two domains. The backward function resembles deployment-time \emph{corrective glasses} for the agent, so we call it \emph{Goggles}. Finally, we showcase a set of active perceptual tasks (local planning for obstacle avoidance, distant navigation, visual stair climbing) learned in Gibson. Our focus in this paper is on the vision aspect only. The statements should not be viewed to be necessarily generalizable to other aspects of learning in virtual environments, e.g. physics simulation. Gibson Environment and our software stack are available to public for research purposes at \href{http://gibson.vision/}{http://gibson.vision/}. Visualizations of Gibson space database can be seen \href{http://gibson.vision/database/}{here}. \section{Related Work} \label{sec:related} \textbf{Active Agents and Control:} As discussed in Sec.\ref{sec:intro}, operating and controlling active agents have been the focus of a massive body of work. A large portion of them are non-learning based~\cite{khatib1987unified, desai2001modeling,khatib1986real}, while recent methods have attempted learning visuomotor policies end-to-end~\cite{zhu2017target, levine2016end} taking advantage of imitation learning~\cite{ross2011reduction}, reinforcement learning~\cite{schulman2017proximal, heess2017emergence,schulman2015trust, heess2017emergence, abbeel2010autonomous, abbeel2007application}, acting by prediction~\cite{dosovitskiy2016learning} or self-supervision~\cite{gupta2016supersizing,pinto2016supersizing,dosovitskiy2016learning,pathak2017curiosity, hirose2018gonet}. These methods are all potential users of (ours and other) virtual environments. \textbf{Virtual Environments for Learning:} Conventionally vision is learned in static datasets~\cite{everingham2010pascal,deng2009imagenet, lin2014microsoft} which are of limited use when it comes to active agent. Similarly, video datasets~\cite{laptev2008learning,rodriguez2008action,xu2016end} are pre-recorded and thus passive. Virtual environments have been a remedy for this, classically~\cite{pomerleau1989alvinn} and today~\cite{zhu2017target, Gaidon:Virtual:CVPR2016, dosovitskiy2017carla, airsim2017fsr, jiang2017configurable, gupta2017cognitive, bellemare2013arcade, mattersim, ros2016synthia,ammirato2017dataset,wu2018building}. Computer games, e.g. Minecraft~\cite{johnson2016malmo}, Doom~\cite{kempka2016vizdoom} and GTA5~\cite{richter2016playing} have been adapted for training and benchmarking learning algorithms. While these simulators are deemed reasonably effective for certain planning or control tasks, the majority of them are of limited use for perception and suffer from oversimplification of the visual world due to using synthetic underlying databases and/or rendering pipeline deficiencies. Gibson addresses some of such concerns by striving to target perception in real-world via using real spaces as its base, a custom neural view synthesizer, and a baked-in adaption mechanism, \emph{Goggles}. \begin{figure*} \vspace{-0.6cm} \includegraphics[width=1\linewidth]{figures/fig_B_v3.pdf} \vspace{-0.6cm} \caption{{\textbf{Overview of our view synthesis pipeline.}} The input is a sparse set of RGB-D Panoramas with their global camera pose. (a,b) Each RGB-D panorama is projected to the target camera pose and rendered. (b) View Selection determines from which panorama each target pixel should be picked, favoring panoramas that provide denser pixels for each region. (c) The pixels are selected and local gaps are interpolated with bilinear sampling. (d) A neural network ($f$) takes in the interpolated image and fills in the dis-occluded regions and fixes artifacts.\vspace{-5mm}} \label{fig:vs} \end{figure*} \textbf{Domain Adaptation and Transferring to Real-World:} With popularity of simulators, different approaches for domain adaption for transferring the results to real world has been investigated~\cite{blitzer2006domain,daume2009frustratingly,sun2016return, saenko2010adapting,tobin2017domain,wulfmeier2017addressing}, e.g. via domain randomization~\cite{sadeghi2016rl, tobin2017domain} or forming joint spaces~\cite{sener2016learning}. Our approach is relatively simple and makes use of the fact that, in our case, large amounts of paired data for target-source domains are available enabling us to train forward and backward models to form a joint space. This makes us a baked-in mechanism in our environment for adaption, minimizing the need for additional and custom adaptation. \textbf{View Synthesis and Image-Based Rendering:} Rendering novel views of objects and scenes is one of the classic problems in vision and graphics~\cite{seitz1996view, shechtman2010regenerative, suwajanakorn2014total,chen1993view,levoy1996light}. A number of relevantly recent methods have employed neural networks in a rendering pipeline, e.g. via an encoder-decoder like architecture that directly renders pixels~\cite{dosovitskiy2015learning,kulkarni2015deep, tatarchenko2016multi} or predicts a flow map for pixels~\cite{zhou2016view}. When some from of 3D information, e.g. depth, is available in the input~\cite{hartley2003multiple,mark1997post,chang1999ldi, shade1998layered}, the pipeline can make use of geometric approaches to be more robust to large viewpoint changes and implausible deformations. Further, when multiple images in the input are available, a smart selection mechanism (often referred to as Image Based Rendering) can help with lighting inconsistencies and handling more difficult and non lambertian surfaces~\cite{hedman2016scalable,ortiz2015bayesian, waechter2014let}, compared to rendering from a textured mesh or as such entirely geometric methods. Our approach is a combination of above in which we geometrically render a base image for the target view, but resort to a neural network to correct artifacts and fill in the dis-occluded areas, along with jointly training a backward function for mapping real images onto the synthesized one. \section{Real-World Perceptual Environment} \label{sec:system} Gibson includes a neural network based view synthesis (described in Sec.~\ref{subsec:viewsyn}) and a physics engine (described in Sec.~\ref{subsec:physics}). The underlying scene database and integrated agents are explained in sections~\ref{subsec:data} and~\ref{subsec:physics}, respectively. \subsection{Gibson Database of Spaces} \label{subsec:data} Gibson's underlying database of spaces includes 572 full buildings composed of 1447 floors covering a total area of 211k $m^2$. Each space has a set of RGB panoramas with global camera poses and reconstructed 3D meshes. The base format of the data is similar to 2D-3D-Semantics dataset~\cite{2017arXiv170201105A}, but is more diverse and includes 2 orders of magnitude more spaces. Various 2D, 3D, and video visualizations of each space in Gibson database can be accessed \href{http://gibson.vision/database/}{here}. This dataset is released in asset files of Gibson\footnote{Stanford AI lab has the copyright to all models.}. We have also integrated 2D-3D-Semantics dataset~\cite{2017arXiv170201105A} and Matterport3D~\cite{chang2017matterport3d} in Gibson for optional use. \subsection{View Synthesis} \label{subsec:viewsyn} Our view synthesis module takes a sparse set of RGB-D panoramas in the input and renders a panorama from an arbitrary novel viewpoint. A `view' is a 6D camera pose of $x,y,z$ Cartesian coordinates and roll, pitch, yaw angles, denoted as $\theta, \phi, \gamma$. An overview of our view synthesis pipeline can be seen in Fig.~\ref{fig:vs}. It is composed of a geometric point cloud rendering followed by a neural network to fix artifacts and fill in the dis-occluded areas, jointly trained with a backward function. Each step is described below: {\bf Geometric Point Cloud Rendering}. Scans of real spaces include sparsely captured images, leading to a sparse set of sampled lightings from the scene. The quality of sensory depth and 3D meshes are also limited by 3D reconstruction algorithms or scanning devices. Reflective surfaces or small objects are often poorly reconstructed or entirely missing. All these prevent simply rendering from textured meshes to be a sufficient approach to view synthesis. We instead adopt a two-stage approach, with the first stage being geometrically rendering point clouds: the given RGB-D panoramas are transformed into point clouds and each pixel is projected from equirectangular coordinates to Cartesian coordinates. For the desired target view $v_j = (x_j, y_j, z_j, \theta_j, \phi_j, \gamma_j)$, we choose the nearest $k$ views in the scene database, denoted as $v_{j,1}, v_{j,2},\dots, v_{j,k}$. For each view $v_{j,i}$, we transform the point cloud from $v_{j,i}$ coordinate to $v_{j}$ coordinate with a rigid body transformation and project the point cloud onto an equirectangular image. The pixels may open up and show a gap in-between, when rendered from the target view. Hence, the pixels that are supposed to be occluded may become visible through the gaps. To filter them out, we render an equirectangular depth as seen from the target view $v_j$ since we have the full reconstruction of the space. We then do a depth test and filter out the pixels with a difference $>0.1m$ in their depth from the corresponding point in the target equirectangular depth. We now have sparse RGB points projected in equirectangulars for each reference panorama~(see Fig.~\ref{fig:vs}~(a)). The points from all reference panoramas are aggregated to make one panorama using a locally weighted mixture (see Density Map in Fig.~\ref{fig:vs}~(b)). We calculate the point density for each spatial position (average number of points per pixel) of each panorama, denoted as $d_1, \dots, d_k$. For each position, the weight for view $i$ is ${\exp(\lambda_d d_i)}/{\sum_m\exp(\lambda_d d_m)}$, where $\lambda_d$ is a hyperparameter. Hence, the points in the aggregated panorama are adaptively selected from all views, rather than superimposed blindly which would expose lighting inconsistency and misalignment artifacts. Finally, we do a bilinear interpolation on the aggregated points in one equirectangular to reduce the empty space between rendered pixels (see Fig.~\ref{fig:vs}~(c)). See the first row of Fig.~\ref{fig:synth_qual} which shows the so-far output still includes major artifacts, including stitching marks, deformed objects, or large dis-occluded regions. {\bf Neural Network Based Rendering}. We use a neural network, $f$ or ``filler", to fix artifacts and generate a more real looking image given the output of geometric point cloud rendering. We use a set of novelties to produce good results efficiently, including a stochastic identity initialization and adding color moment matching in perceptual loss. \begin{figure} \includegraphics[width=1\linewidth]{figures/fig_E-eps-converted-to.pdf} \caption{ \textbf{Loss configuration for neural network based view synthesis.} The loss contains two terms. The first is to transform the renderings to ground truth target images. The second is to alter ground truth target images to match the transformed rendering. A sample case is shown. (Best viewed on screen and zoomed-in.) \vspace{-4mm}} \label{fig:loss} \end{figure} {\it Architecture: } The architecture and hyperparameters of our convolutional neural network $f$ are detailed in the \href{http://gibson.vision/supplementary_material/}{supplementary material}. We utilize dilated convolutions~\cite{yu2015multi} to aggregate contextual information. We use a 18-layer network, with $3\times3$ kernels for dilated convolution layers. The maximal dilation is $32$. This allows us to achieve a large receptive field but not shrink the size of the feature map by too much. The minimal feature map size is $\frac{1}{4} \times \frac{1}{4}$ of the original image size. We also use two architectures with the number of kernels being $48$ or $256$, depending on whether speed or quality is prioritized. {\it Identity Initialization: } Though the output of the point cloud rendering suffers from notable artifacts, it is yet quite close to the ground truth target image numerically. Thus, an identity function (i.e. input image=ouput image) is a good place for initializing the neural network $f$ at. We develop a stochastic approach to initializing the network at identity, to keep the weights nearly randomly distributed. We initialize \emph{half} of the weights randomly with Gaussian and \emph{freeze} them, then optimize the rest with back propagation to make the network's output the same as input. After convergence, the weights are our stochastic identity initialization. Other forms of identity initialization involve manually specifying the kernel weights, e.g. \cite{chen2017fast}, which severely skews the distribution of weights (mostly 0s and some 1s). We found that to lead to slower converge and poorer results. {\it Loss:} We use a perceptual loss~\cite{johnson2016perceptual} defined as: {\small \begin{align} \small D(I_1, I_2) &= \sum_l \lambda_l ||\Psi_l(I_1) - \Psi_l(I_2) ||_1 + \gamma \sum_{i,j} ||\bar{I}_{1_{i,j}} - \bar{I}_{2_{i,j}} ||_1. \nonumber \end{align} }% For $\Psi$, we use a pretrained VGG16~\cite{simonyan2014very}. $\Psi_l(I)$ denotes the feature map for input image $I$ at $l$-th convolutional layer. We used all layers except for output layers. $\lambda_l$ is a scaling coefficient normalized with the number of elements in the feature map. We found perceptual loss to be inherently lossy w.r.t. color information (different colors were projected on one point). Therefore, we add a term to enforce matching statistical moments of color distribution. ${\bar{I}_{i,j}}$ is the average color vector of a $32\times 32$ tile of the image which is enforced to be matching between $I_1$ and $I_2$ using L1 distance and $\gamma$ is a mixture hyperparameter. We found our final setup to produce superior rendering results to GAN based losses (consistent with some recent works~\cite{chen2017photographic}). \subsubsection{Closing the Gap with Real-World: \textbf{\emph{Goggles}} } \label{sec:dt} With all of the imperfections in 3D inputs and geometric renderings, it is implausible to gain fully photo-realistic rendering with neural network fixes. Thus a domain gap with real images would remain. Therefore, we instead formulate the rendering problem as forming a joint space~\cite{sener2016learning} (elaborated below) ensuring a correspondence between rendered and real images, and consequently, dissolving the gap. If one wishes to create a mapping $S \mapsto T$ between domain $S$ and domain $T$ by training a function $f$, usually a loss with the following form is optimized: \begin{align} \mathcal{L} = \mathop{\mathbb{E}}\left[D(f(\mathcal{I}_s) , \mathcal{I}_t\right)], \end{align} where $\mathcal{I}_s \in S, \mathcal{I}_t \in T$, and $D$ is a distance function. However, in our case the mapping between $S$ (renderings) and $T$ (real images) is not bijective, or at least the two directions $S \mapsto T$ and $T \mapsto S$ do not appear to be equally difficult. As an example, there is no unique solution to dis-occlusion filling, so the domain gap cannot reach zero exercising only $S \mapsto T$ direction. Hence, we add another function $u$ to jointly utilize $T \mapsto S$ and define the objective to be minimizing the distance between $f(\mathcal{I}_s)$ and $u(\mathcal{I}_t)$. Network $u$ is trained to alter an image taken in real-world, $\mathcal{I}_t$, to look like the corresponding rendered image in Gibson, $\mathcal{I}_s$, after passing through network~$f$ (see Fig.~\ref{fig:loss}). Function $u$ can be seen as corrective glasses of the agent, thus the name \emph{Goggles}. To avoid the trivial solution of all images collapsing to a single point, we add the first term in the following final loss to enforce preserving a one-to-one mapping. The loss for training networks $u$ and $f$ is: \begin{align} \mathcal{L} = \mathop{\mathbb{E}}\left[D(f(\mathcal{I}_s) , \mathcal{I}_t\right)] + \mathop{\mathbb{E}}\left[D(f(\mathcal{I}_s) , u(\mathcal{I}_t)\right)]. \end{align} See Fig.~\ref{fig:loss} for a visual example. $D$ is the distance defined in Sec~\ref{subsec:viewsyn}. We use the same network architecture for $f$ and $u$. \subsection{Embodiment and Physics Integration} \label{subsec:physics} Perception and physical constraints are closely related. For instance, the perception model of a human-sized agent should seamlessly develop the notion that it does not fit in the gap under the door and hence should not attend such areas when solving a navigation task; a mouse-sized agent though could fit and its perception should attend such areas. It is thus important for the agent to be constantly subject to constraints of space and physics, e.g. collision, gravity, friction, throughout learning. We integrated Gibson with a physics engine PyBullet \cite{coumans2018} which supports rigid body and soft body simulation with discrete and continuous collision detection. We also use PyBullet's built-in fast collision handling system to record agent's certain interactions, such as how many times it collides with physical obstacles. We use Coulomb friction model by default, as scanned models do not come with material property annotations and certain physics aspects, such as friction, cannot be directly simulated. \begin{figure} \includegraphics[width=1\linewidth]{figures/fall_test_v1.pdf} \vspace{-0.68cm} \caption{\textbf{Physics Integration and Embodiment.} A Mujoco humanoid model is dropped onto a stairway demonstrating a physically plausible fall along with the corresponding visual observations by the humanoid's eye. The first and second rows show the physics engine view of 4 sampled time steps and their corresponding rendered RGB views, respectively.} \label{fig:physics} \end{figure} \begin{figure*} \vspace{-0.4cm} \includegraphics[width=\linewidth]{figures/spaces_v3-eps-converted-to.pdf} \vspace{-0.8cm} \caption{\textbf{Sample spaces in Gibson database.} The spaces are diverse in terms of size, visuals, and function, e.g. businesses, construction sites, houses. Upper: Sample 3D models. Lower: Sample images from Gibson database (left) and some of other environments~\cite{dosovitskiy2017carla,johnson2016malmo,RosCVPR16, airsim2017fsr,kempka2016vizdoom,wymann2000torcs,geiger2013vision, zhu2017target} (right). \vspace{-0.2cm} } \label{fig:spaces} \end{figure*} \textbf{Agents:} Gibson supports importing arbitrary agents with URDFs. Also, a number of agents are integrated as entry points, including humanoid and ant of Roboschool~\cite{roboschool,2017arXiv170706347S}, husky car~\cite{Husky}, drone, minitaur~\cite{minitaur}, Jackrabbot~\cite{JR}. Agent models are in ROS or Mujoco XML format. \textbf{Integrated Controllers:} To enable (optionally) abstracting away low-level control and robot dynamics for the tasks that are wished to be approached in a more high-level manner, we also provide a set of practical and ideal controllers to deduce the complexity of learning to control from scratch. We integrated a PID controller and a Nonholonomic controller as well as an ideal positional controller which completely abstracts away agent's motion dynamics. \subsection{Additional Modalities} Besides rendering RGB images, Gibson provides additional channels, such as depth, surface normals, and semantics. Unlike RGB images, these channels are more robust to noise in input data and lighting changes, and we render them directly from mesh files. Geometric modalities, e.g. depth, are provided for all models and semantics are available for 52,561 $m^2$ of area with semantic annotations from 2D-3D-S~\cite{2017arXiv170201105A} and Matterport3D~\cite{chang2017matterport3d} datasets. Similar to other robotic simulation platforms, we also provide configurable proprioceptive sensory data. A typical proprioceptive sensor suite includes information of joint positions, angle velocity, robot orientation with respect to navigation target, position and velocity. We refer to this typical setup as ``non-visual sensory" to distinguish from ``visual" modalities in the rest of the paper. \section{Tasks} \label{sec:learn} \textbf{Input-Output Abstraction:} Gibson allows defining arbitrary tasks for an agent. To provide a common abstraction for this, we follow the interface of OpenAI Gym~\cite{brockman2016openai}: at each timestep, the agent performs an action at the environment; then the environment runs a forward step (integrated with the physics engine) and returns the accordingly rendered visual observation, reward, and termination signal. We also provide utility functions to keyboard operate an agent or visualize a recorded run. \subsection{Experimental Validation Tasks} \label{sec:valtasks} In our experiments, we use a set of sample active perceptual tasks and static-recognition tasks to validate Gibson. The active tasks include: \textbf{Local Planning and Obstacle Avoidance:} An agent is randomly placed in an environment and needs to travel to a random nearby target location provided as relative coordinates (similar to flag run~\cite{roboschool}). The agent receives no information about the environment except a continuous stream of depth and/or RGB frames and needs to plan perceptually (e.g. go around a couch to reach the target behind). \textbf{Distant Visual Navigation:} Similar to the the previous task, but the target location is significantly further away and fixed. Agent's initial location is still randomized. This is similar to the task of auto-docking for robots from a distant location. Agent receives no external odometry or GPS information, and needs to form a contextual map to succeed. \textbf{Stair Climb}: An (ant~\cite{roboschool}) agent is placed on on top of a stairway and the target location is at the bottom. It needs to learn a controller for its complex dynamics to plausibly go down the stairway without flipping, using visual inputs. To benchmark how close to real images the renderings of Gibson are, we used two static-recognition tasks: depth estimation and scene classification. We train a neural network using $(rendering,ground$ $truth)$ pairs as training data, but test them on $(real$ $image, ground$ $truth)$. If Gibson renderings are close enough to real images and \emph{Goggles} mechanism is effective, test results on real images are expected to be satisfactory. This also enables quantifying the impact of \emph{Goggles}, i.e. using $u(\mathcal{I}_t)$ vs. $\mathcal{I}_s, f(\mathcal{I}_s)$, and $\mathcal{I}_t$. \textbf{Depth Estimation:} Predicting depth given a single RGB image, similar to~\cite{eigen2014depth}. We train 4 networks to predict the depth given one of the following 4 as input images: $\mathcal{I}_s$ (pre-neural network rendering),$f(\mathcal{I}_s)$ (post-neural network rendering), $u(\mathcal{I}_t)$ (real image seen with \emph{Goggles}), and $\mathcal{I}_t$ (real image). We compare the performance of these in Sec.~\ref{sec:transfer_exp}. \textbf{Scene Classification:} The same as previous task, but the output is scene classes rather than depth. As our images do not have scene class annotations, we generate them using a well performing network trained on Places dataset~\cite{zhou2017places}. \begin{figure*} \vspace{-0.68cm} \includegraphics[width=1\linewidth]{figures/fig_D-eps-converted-to.pdf} \vspace{-6mm} \caption{\textbf{Qualitative results of view synthesis and \emph{Goggles}.} Top to bottom rows show images before neural network correction, after neural network correction, target image seen through \emph{Goggles}, and target image (i.e. ground truth real image). The first column shows a pano and the rest are sample zoomed-in patches. Note the high similarity between $2^{nd}$ and $3^{rd}$ row, signifying the effectiveness of \emph{Goggles}. (Best viewed on screen and zoomed-in.) \vspace{-4mm}} \label{fig:synth_qual} \end{figure*} \section{Experimental Results} \label{sec:exp} \subsection{Benchmarking Space Databases} The spaces in Gibson database are collected using various scanning devices, including NavVis, Matterport, or DotProduct, covering a diverse set of spaces, e.g. offices, garages, stadiums, grocery stores, gyms, hospitals, houses. All spaces are fully reconstructed in 3D and post processed to fill the holes and enhance the mesh. We benchmark some of the existing synthetic and real databases of spaces (SUNCG~\cite{song2016ssc} and Matterport3D~\cite{chang2017matterport3d}) vs Gibson's using the following metrics in Table~\ref{tbl:modelcomp}: {\bf Specific Surface Area (SSA)}: the ratio of inner mesh surface and volume of convex hull of the mesh. This is a measure of clutter in the models. {\bf Navigation Complexity}: Longest $A^*$ navigation distance between randomly placed two points divided by the straight line distance. We compute the highest navigation complexity $\max_{s_i, s_j} \frac{d_{A^*}(s_i, s_j)}{d_{l2}(s_i, s_j)}$ for every model. {\bf Real-World Transfer Error:} We train a neural network for depth estimation using the images of each database and test them on real images of 2D-3D-S dataset~\cite{2017arXiv170201105A}. Training images of SUNCG and Matterport3D are rendered using MINOS~\cite{savva2017minos} and our dataset is rendered using Gibson's engine. The training set of each database is 20k random RGB-depth image pairs with $90^\circ$ field of view. The reported value is average depth estimation error in meters. {\bf Scene Diversity}: We perform scene classification on 10k randomly picked images for each database using a network pretrained on~\cite{zhou2017places}. We report the entropy of the distribution of top-1 classes for each environment. Gibson, SUNCG~\cite{song2016ssc}, and THOR~\cite{zhu2017target} gain the scores of $3.72$, $2.89$, and $3.32$, respectively (highest possible entropy = $5.90$). \vspace{-7mm} \begin{flushleft} \begin{table} \small \centering \begin{tabular}{l{c}{c}{c}} Dataset & Gibson & SUNCG & Matterport3D \\ \hline {Number of Spaces} & 572 & 45622 & 90\\ {Total Coverage~$m^2$} & 211k & 5.8M & 46.6K\\ {SSA} & 1.38 & 0.74 & 0.92\\ {Nav. Complexity} & 5.98 & 2.29 & 7.80\\ {Real-World Transfer Err} & 0.92$^\S$ & 2.89$^\dagger$ & 2.11$^\dagger$\\ \end{tabular} \vspace{-0.2cm} \caption{\textbf{Benchmarking Space Databases:} Comparison of Gibson database with SUNCG~\cite{song2016ssc} (hand designed synthetic), and Matterport3D~\cite{chang2017matterport3d}. $^\S$ Rendered with Gibson, $^\dagger$ rendered with MINOS~\cite{savva2017minos}.\vspace{-3mm}} \label{tbl:modelcomp} \end{table} \end{flushleft} \subsection{Evaluation of View Synthesis} To train the networks $f$ and $u$ of our neural network based synthesis framework, we sampled 4.3k $1024\times 2048$ $\mathcal{I}_s$|$\mathcal{I}_t$ panorama pairs and randomly cropped them to $256\times 256$. We use Adam~\cite{kingma2014adam} optimizer with learning rate $2\times 10 ^{-4}$. We first train $f$ for 50 epochs until convergence, then we train $f$ and $u$ jointly for another 50 epochs with learning rate $2\times 10^{-5}$. The learning finishes in 3 days on 2 Nvidia Titan X GPUs. Sample renderings and their corresponding real image (ground truth) are shown in Fig.~\ref{fig:synth_qual}. Note that pre-neural network renderings suffer from geometric artifacts which are partially resolved in post-neural network results. Also, though the contrast of the post-neural network images is lower than real ones and color distributions are still different, \emph{Goggles} could effectively alter the real images to match the renderings (compare $2^{nd}$ and $3^{rd}$ rows). In additional, the network $f$ and \emph{Goggles} $u$ jointly addressed some of the pathological domain gaps. For instance, as lighting fixtures are often thin and shiny, they are not well reconstructed in our meshes and usually fail to render properly. Network $f$ and \emph{Goggles} learned to just suppress them altogether from images to not let a domain gap remain. The scene out the windows also often have large re-projection errors, so they are usually turned white by $f$ and $u$. Appearance columns in Table~\ref{tbl:transfer} quantify view synthesis results in terms image similarity metrics L1 and SSIM. They echo that the smallest gap is between $f(\mathcal{I}_s)$ and $u(\mathcal{I}_t)$. \textbf{Rendering Speed} of Gibson is provided in Table~\ref{fig:efficiency}. \begin{table} \small \begin{tabular}{l|*{3}{c}r} Resolution & 128\small{x}128 & 256\small{x}256 & 512\small{x}512 \\ \hline RGBD, pre network$f$ & 109.1 & 58.5 & 26.5 \\ RGBD, post network$f$ & 77.7 & 30.6 & 14.5 \\ RGBD, post small network$f$ & 87.4 & 40.5 & 21.2 \\ Depth only & 253.0 & 197.9 & 124.7 \\ Surface Normal only & 207.7 & 129.7 & 57.2 \\ Semantic only & 190.0 & 144.2 & 55.6 \\ Non-Visual Sensory & 396.1 & 396.1 & 396.1 \end{tabular} \vspace{-0.2cm} \caption{\textbf{Rendering speed (FPS)} of Gibson on a single GPU for different resolutions and output configurations. Tested on E5-2697 v4 with Tesla V100 in headless rendering mode. As a faster setup (``small network"), we also trained a smaller filler network with donwsized input geometric renderings. This setup achieves a higher FPS at the expense of inferior visual quality compared to full-size filler network.\vspace{-3mm}} \label{fig:efficiency} \end{table} \begin{table} \centering \begin{tabular}{l|l|p{1.2cm} p{1.2cm} |ll} \multirow{2}{*}{Train} & \multirow{2}{*}{Test} & \multicolumn{2}{c|}{Static Tasks} & \multicolumn{2}{c}{Appearance} \\ \hhline{~~----} & & \footnotesize{Scene Class Acc.} & \footnotesize{Depth Est. Error} & SSIM & L1 \\ \hline $\mathcal{I}_s$ & $\mathcal{I}_t$ & 0.280 & 1.026 & 0.627 & 0.096 \\ $f(\mathcal{I}_s)$ & $\mathcal{I}_t$ & 0.266 & 1.560 & 0.480 & 0.10 \\ $f(\mathcal{I}_s)$ & $u(\mathcal{I}_t)$ & \bf{0.291} & \bf{0.915} & \bf{0.816} & \bf{0.051} \end{tabular} \caption{\textbf{Evaluation of view synthesis and transferring to real-world.} \emph{Static Tasks} column shows on both scene classification task and depth estimation tasks, it is easiest to transfer from $f(\mathcal{I}_s)$ to $u(\mathcal{I}_t)$ compared with other cross-domain transfers. \emph{Appearance} columns compare L1 and SSIM distance metrics for different pairs showing the combination of network $f$ and \emph{Goggles} $u$ achieves best results.\vspace{-5mm}} \label{tbl:transfer} \end{table} \subsection{Transferring to Real-World} \label{sec:transfer_exp} We quantify the effectiveness of \emph{Goggles} mechanism in reducing the domain gap between Gibson renderings and real imagery in two ways: via the static-recognition tasks described in Sec.~\ref{sec:valtasks} and by comparing image distributions. Evaluation of transferring to real images via scene classification and depth estimation are summarized in Table.~\ref{tbl:transfer}. Also, Fig.~\ref{fig:domain_adapt_res}~(a) provides depth estimation results for all feasible train-test combinations for reference. The diagonal values of the $4\times 4$ matrix represent training and testing on the same domain. The gold standard is train and test on $\mathcal{I}_t$ (real images) which yields the error of 0.86. The closest combination to that in the entire table is train on $f(I_s)$ ($f$ output) and test on $u(I_t)$ (real image through \emph{Goggles}) giving 0.91, which signifies the effectiveness of \emph{Goggles}. In terms of distributional quantification, we used two metrics of Maximum Mean Discrepancy (MMD)~\cite{gretton2012kernel} and CORAL~\cite{sun2016deep} to test how well $f(\mathcal{I}_s)$ and $u(\mathcal{I}_t)$ domains are aligned. The metrics essentially determine how likely it is for two samples to be drawn from different distributions. We calculate MMD and CORAL values using the features of the last convolutional layer of VGG16~\cite{simonyan2014very} and kernel $k(x,y) = x^Ty$. Results are summarized in Fig.~\ref{fig:domain_adapt_res}~(b) and (c). For each metric, $f(\mathcal{I}_s)$ - $u(\mathcal{I}_t)$ is smaller than other pairs, showing that the two domains are well matching. In order to quantitatively show the networks $f$ and $u$ do not give degenerate solutions (i.e. collapsing all images to few points to close the gap by cheating), we use $f(\mathcal{I}_s)$ and $u(\mathcal{I}_t)$ as queries to retrieve their nearest neighbor using VGG16 features from $\mathcal{I}_s$ and $\mathcal{I}_t$, respectively. Top-1, 2 and 5 accuracies for $f(\mathcal{I}_s)\mapsto\mathcal{I}_s$ are 91.6\%, 93.5\%, 95.6\%. Top-1, 2 and 5 accuracies for $u(\mathcal{I}_t)\mapsto\mathcal{I}_t$ are 85.9\%, 87.2\%,89.6\%. This indicates a good correspondence between pre and post neural network images is preserved, and thus, no collapse is observed. \begin{figure} \vspace{-0.2cm} \centering {\includegraphics[width=1\linewidth]{figures/transfers_v4-eps-converted-to.pdf}} \caption{\textbf{Evaluation of transferring to real-world from Gibson.} (a) Error of depth estimation for all train-test combinations. (b,c) MMD and CORAL distributional distances. All tests are in support of \emph{Goggles}.} \label{fig:domain_adapt_res} \end{figure} \subsection{Validation Tasks Learned in Gibson} \vspace{-1mm} The results of the active perceptual tasks discussed in Sec.~\ref{sec:valtasks} are provided here. In each experiment, the non-visual sensor outputs include agent position, orientation, and relative position to target. The agents are rewarded by the decrease in their distance towards their targets. In Local Planning and Visual Obstacle Avoidance, they receive an additional penalty for every collision. {\bf Local Planning and Visual Obstacle Avoidance Results:} We trained a perceptual and non-perceptual husky agent according to the setting in Sec.~\ref{sec:valtasks} with PPO~\cite{schulman2017proximal} for 150 episodes (300 iterations, 150k frames). Both agents have a four-dimensional discrete action space: forward/backward/left/right. The average reward over 10 iterations are plotted in Fig~\ref{fig:reward_flagrun}. The agent with perception achieves a higher score and developed obstacle avoidance behavior to reach the goal faster. \begin{figure} \includegraphics[width=0.45\linewidth]{figures/flagrun_reward.pdf} \includegraphics[width=0.45\linewidth]{figures/car_traj_3-eps-converted-to.pdf} \caption{\textbf{Visual Local planning and obstacle avoidance.} Reward curves for perceptual vs non-perceptual husky agents and a sample trajectory.\vspace{-0.2cm}} \label{fig:reward_flagrun} \end{figure} {\bf Distant Visual Navigation Results:} Fig.~\ref{fig:reward_navigation} shows the target and sample random initial locations as well as the reward curves. Global navigation behavior emerges after 1700 episodes (680k frames), and only the agent with visual state was able to accomplish the task. The action space is the same as previous experiment. Also, we use the trained policy of distant navigation to evaluate the impact of \emph{Goggles} on an active task: we go to camera locations where $\mathcal{I}_t$ is available. Then we measure the policy discrepancy in terms of L2 distance of output action logits when different renderings and $\mathcal{I}_t$ are provided as input. Training on $f(\mathcal{I}_s)$ and testing on $u(\mathcal{I}_t)$ yields discrepancy of 0.204 (best), while training on $f(\mathcal{I}_s)$ and testing on $\mathcal{I}_t$ gives 0.300 and training on $\mathcal{I}_s$ and testing on $\mathcal{I}_t$ gives 0.242. After the initial release of our work, a paper recently reported an evaluation done on a real robot for adaptation using backward mapping from real images to renderings~\cite{zhang2018vr}, with positive results. They did not use paired data, unlike Gibson, which would be expected to further enhance the results. \begin{figure} \vspace{-0.2cm} \includegraphics[width=1\linewidth]{figures/fig_exp_1_v6-eps-converted-to.pdf} \vspace{-0.5cm} \caption{\textbf{Distant Visual Navigation.} The initial locations and target are shown. The agent succeeds only when provided with visual inputs. \vspace{-0.5cm} } \label{fig:reward_navigation} \end{figure} {\bf Stair Climb:} As explained in Sec.~\ref{sec:valtasks}, an ant~\cite{roboschool} is trained to perform the complex locomotive task of plausibly climbing down a stairway without flipping. The action space is eight dimensional continuous torque values. We train one perceptual and one non-perceptual agent starting at a fixed initial location, but at test time slightly and randomly move their initial and target location around. They start to acquire stair-climbing skills after 1700 episodes (700k time steps). While the perceptual agent learned slower, it showed better generalizability at test time coping with the location shifts and outperformed the non-perceptual agent by 70\%. Full details of this experiment is privded in the \href{http://gibson.vision/supplementary_material/}{supplementary material}. \vspace{-1mm} \section{Limitations and Conclusion} \label{sec:conclution} \vspace{-2mm} We presented Gibson Environment for developing real-world perception for active agents and validated it using a set of tasks. While we think this is a step forward, there are some limitations that should be noted. First, though Gibson provides a good basis for learning complex navigation and locomotion, currently it does not include dynamic content (e.g. other moving objects) and does not support manipulation. This can be potentially solved by integrating our approach with synthetic objects~\cite{chang2015shapenet,karsch2011rendering}. Second, we do not have full material properties and no existing physics simulator is optimal; this may lead to physics related domain gaps. Finally, we provided quantitative evaluations of \emph{Goggles} mechanism for transferring to real world mostly using static recognition tasks. The ultimate test is evaluating \emph{Goggles} on real robots. \\ \\ \noindent\textbf{Acknowledgement:} We gratefully acknowledge the support of Facebook, Toyota (1186781-31-UDARO), ONR MURI (N00014-14-1-0671), ONR (1165419-10-TDAUZ); Nvidia, CloudMinds, Panasonic (1192707-1-GWMSX). {\small \bibliographystyle{ieee}
\section{Introduction} We study the approximation of expectations $\operatorname{E}(f(X))$, where $X=(X(t))_{t\in [0,1]}$ is the $r$-dimensional solution of an autonomous SDE with deterministic initial value and Lipschitz continuous drift and diffusion coefficients, driven by a $d$-dimensional Brownian motion. Moreover, $f \in \operatorname{Lip}_1$, i.e., \[ f \colon C([0,1],{\mathbb R}^r) \to {\mathbb R} \] is Lipschitz continuous with respect to the supremum norm with Lipschitz constant at most one. We consider randomized (Monte Carlo) algorithms that are only allowed to use random bits instead of random numbers. By assumption, all other operations (arithmetic operations, evaluations of elementary functions, and oracle calls to evaluate $f$ as well as the drift and diffusion coefficients of the SDE) are performed exactly. Algorithms of this type are called random bit Monte Carlo algorithms, and the approximation of expectations by algorithms of this type is called random bit quadrature. Due to the path-dependence of $f$ the approximation of $\operatorname{E}(f(X))$ is an infinite-dimensional quadrature problem. In a worst case setting algorithms $A$ are compared according to their worst case error ${\mathrm{e}}(A,\operatorname{Lip}_1)$ and their worst case cost $\operatorname{cost}(A,\operatorname{Lip}_1)$ on the class $\operatorname{Lip}_1$. The cost takes into account, in particular, the number of random bits used and the information cost, i.e., the cost for the evaluations of $f$. For the latter, we suppose that any $f \in \operatorname{Lip}_1$ can be evaluated at any piecewise linear function $x \in C([0,1],{\mathbb R}^r)$ with equidistant breakpoints $0,1/2^\ell, \dots, 1$ at cost $2^\ell+1$ for any $\ell \in {\mathbb N}_0$. See Sections \ref{seccomp}, \ref{ls1}, and \ref{s53} for details. The main contribution of this paper is the construction of a random bit multilevel Euler algorithm $A_\varepsilon^\mathrm{Bbit}$ that is almost optimal. First of all, we have the following upper bound: There exists a constant $c>0$ such that \[ {\mathrm{e}}\bigl(A_\varepsilon^\mathrm{Bbit},\operatorname{Lip}_1\bigr) \leq c \cdot \varepsilon \] and \begin{align}\label{costbound} \operatorname{cost}\bigl(A_\varepsilon^\mathrm{Bbit},\operatorname{Lip}_1\bigr) \leq c \cdot \varepsilon^{-2} \cdot (\ln(\varepsilon^{-1}))^3 \end{align} for every $\varepsilon \in {]0,1/2[}$, see Theorem~\ref{theo3}. This result coincides with the best known upper bound for general randomized algorithms, which are achieved by the classical multilevel Euler algorithm. See \citet{G15} for a survey on multilevel algorithms. An important ingredient for the construction of $A_\varepsilon^\mathrm{Bbit}$ is Bakhvalov's trick: A small number of independent random variables, each uniformly distributed on $\{1,\dots, 2^q\}$, yields a much larger number of pairwise independent random variables with the same uniform distribution. The number of random bits used by the algorithm $A_\varepsilon^{\mathrm{Bbit}}$ is of the order $\varepsilon^{-2} \cdot (\ln(\varepsilon^{-1}))^{5/2}$, see the proof of Theorem~\ref{theo3}, and it can be reduced further to $\varepsilon^{-2} \cdot (\ln(\varepsilon^{-1}))^{2} \cdot \ln(\ln(\varepsilon^{-1}))$, as outlined in Remark~\ref{cr2}. Since the upper bound in \eqref{costbound} is sharp, the number of random bits is asymptotically negligible compared to the overall cost of $A_\varepsilon^\mathrm{Bbit}$. Secondly, the algorithm $A_\varepsilon^\mathrm{Bbit}$ is optimal, up to logarithmic factors. Under a slightly stronger smoothness assumption as well as a non-degeneracy assumption on the diffusion coefficient of the SDE, which in particular exclude pathological cases yielding a deterministic solution $X$, the following holds true: There exist constants $c,\varepsilon_0>0$ such that \[ \operatorname{cost}\bigl(A,\operatorname{Lip}_1\bigr) \geq c \cdot \varepsilon^{-2} \] for every random bit Monte Carlo algorithm $A$ and for every $\varepsilon \in {]0,\varepsilon_0]}$ such that \[ {\mathrm{e}}\bigl(A,\operatorname{Lip}_1\bigr) \leq \varepsilon. \] Actually, there are two variants of this result, both of which hold for a much broader class of algorithms. In the first variant, the evaluation of $f$ is allowed at arbitrary points $x \in C([0,1],{\mathbb R}^r)$ at cost one, while the number of random bits is taken into account as before, see Theorem~\ref{t23}. In the second variant, which is due to \citet[Thm.~11]{CDMGR09}, roughly speaking, any kind of randomness is allowed for free, but the cost model with evaluations of $f$ only at piecewise linear functions is kept. We do not know whether random bits are as powerful as random numbers for the quadrature problem under investigation, but the upper and lower bounds imply that random bits are at least almost as powerful as random numbers. This work is a continuation of \citet{GHMR17}. Two approximation problems involving random bits have been considered there: Random bit quadrature, as in the present paper, and random bit approximation of probability measures, which is closely related to quantization. Furthermore, two classes of processes have been considered there: Gaussian processes and solution processes of SDEs. For three of the possible four combinations results have already been obtained in \citet{GHMR17}. The combination of random bit quadrature for SDEs, which remained open, is addressed in the present paper. This work is partially motivated by reconfigurable architectures like field programmable gate arrays (FPGAs). These devices allow users to choose the precision of each individual operation on a bit level and provide a generator for random bits. In the setting and analysis of the present paper we take into account the latter fact, while we ignore all finite precision issues for arithmetic operations. We refer to \citet{6924076,bookbits} for the construction and for extensive tests of a finite precision multilevel algorithm for FPGAs with applications in computational finance. For an error analysis of the Euler scheme for SDEs in a finite precision arithmetic we refer to \citet{O16}. A complete analysis on a bit level for the arithmetic operations, the random number generator, and the oracle is not yet available. In most of the papers on randomized algorithms for continuous problems, uniformly distributed random numbers from $[0,1]$ are assumed to be available. Random bit Monte Carlo algorithms are studied for the classical, finite-dimensional quadrature problem to approximate $\int_{[0,1]^d} f(x)\,\mathrm dx$ in, e.g., \citet{GYW06,MR2076605,N85,N88,N01,TW92,YH08}. See \citet{NP04} for a related approach to integral equations. In \citet{MR2076605}, random bit quadrature with respect to the uniform distribution on $[0,1]^d$ and Sobolev and H\"older classes of functions $f \colon [0,1]^d \to {\mathbb R}$ are considered. It is shown that random bit Monte Carlo algorithms are as powerful as general randomized algorithms, and a very small number of random bits suffice to achieve asymptotic optimality. The proofs of these results are based on a reduction of the quadrature problem to a summation problem and on Bakhvalov's trick. In contrast to, e.g., \citet{MR2076605}, we do not derive lower bounds that separately take into account the number of random bits and the information cost. Instead, we establish lower bounds in terms of the overall cost, which includes, in particular, the sum of both of these quantities. A general framework to study Monte Carlo algorithms that only have access to generators for an arbitrary, but fixed set of probability distributions has recently been introduced in \citet{H18}. Within the latter framework the information cost and the cost associated to the calls of the available random number generators are naturally studied separately. This paper is organized as follows. In Section~\ref{seccomp} we formulate the computational problem. Section~\ref{Euler:schemes} is devoted to the definition and strong error analysis of a random bit Euler scheme. In Section~\ref{sec5} we present the construction of the random bit multilevel Euler algorithm with corresponding error and cost bounds. Lower bounds for random bit Monte Carlo methods are derived in Section~\ref{bounds}. In Appendix~\ref{app} we present Bakhvalov's trick in a form that fits to our needs. \section{The Computational Problem}\label{seccomp} Let $r,d \in {\mathbb N}$. Henceforth we use $|\cdot|$ to denote the Euclidean norm, and we consider the corresponding supremum norm $\|\cdot\|$ on $C([0,1],{\mathbb R}^r)$. We consider an autonomous system \[ \phantom{\qquad\quad t \in [0,1]} \mathrm{d}X(t) = a(X(t))\,\mathrm{d}t + b(X(t))\,\mathrm{d}W(t), \qquad\quad t \in [0,1], \] of SDEs with a deterministic initial value \[ X(0) = x_0 \in {\mathbb R}^r \] and a $d$-dimensional Brownian motion $W$, and with Lipschitz-continuous drift and diffusion coefficients $a \colon {\mathbb R}^r \to {\mathbb R}^r$ and $b \colon {\mathbb R}^r \to {\mathbb R}^{r \times d}$, respectively. We study the approximation of \begin{equation}\label{g20} S(f) = \operatorname{E}(f(X)) \end{equation} for functionals $f \colon C([0,1],{\mathbb R}^r) \to {\mathbb R}$ that are Lipschitz continuous with Lipschitz constant at most one, i.e., \[ |f(x) - f(y)| \leq \|x - y\| \] for all $x,y \in C([0,1],{\mathbb R}^r)$. The class of all such Lipschitz functionals $f$ is denoted by $\operatorname{Lip}_1$. We employ the real-number model, i.e., we assume that algorithms can perform comparisons, arithmetic operations on real numbers, and the evaluation of elementary functions at unit cost. Furthermore, we assume that the drift coefficient $a$ and the diffusion coefficient $b$ can be evaluated at each point $x \in {\mathbb R}^r$ at unit cost. Moreover, we suppose that any functional $f \in \operatorname{Lip}_1$ can be evaluated at any piecewise linear function with breakpoints $k/2^\ell$ for $k=0,\dots,2^\ell$ at cost $2^\ell+1$ for any $\ell \in {\mathbb N}_0$. Monte Carlo algorithms have access to a random number generator at cost one per call. Here, we distinguish two cases, namely algorithms with access to random numbers from $[0,1]$, and algorithms with access to random bits only, which we refer to as random bit Monte Carlo algorithms. The cost, $\operatorname{cost}(A,f)$, of applying the Monte Carlo algorithm $A$ to the functional $f$ is defined as the sum of the cost associated to every instruction that is carried out. Observe that under appropriate measurability assumptions $\operatorname{cost}(A,f)$ is a random quantity. We define the worst case cost of $A$ on the class $\operatorname{Lip}_1$ as \[ \operatorname{cost}(A,\operatorname{Lip}_1) = \sup_{f \in \operatorname{Lip}_1} \operatorname{E}(\operatorname{cost}(A,f)). \] Since the output $A(f)$ of a Monte Carlo algorithm $A$ applied to an input functional $f$ from $\operatorname{Lip}_1$ is a random quantity, too, its error is defined by \[ {\mathrm{e}}(A,f) = \bigl(\operatorname{E}|S(f) - A(f)|^2\bigr)^{1/2} \] under appropriate measurability assumptions. Accordingly, the worst case error on the class $\operatorname{Lip}_1$ is defined by \[ {\mathrm{e}}(A,\operatorname{Lip}_1) = \sup_{f \in \operatorname{Lip}_1} {\mathrm{e}}(A,f). \] See Section \ref{ls1} for a rigorous definition of a more general cost model that only takes into account the information cost concerning $f$ and the number of random bits used. \section{Euler Schemes}\label{Euler:schemes} The key ingredient for the construction and analysis of random bit multilevel algorithms, see Section~\ref{sec5}, is a random bit Euler scheme and strong error bounds thereof, which will be presented in Sections~\ref{scheme1} and~\ref{scheme1:analysis}. Let \[ t_k = t_{k,m} = k/m, \] where $m \in {\mathbb N}$ and $k=0,\ldots,m$. A corresponding Euler scheme is given by \begin{align*} X_m(t_{0,m}) &= x_0,\\ X_m(t_{k,m}) &= X_m(t_{k-1,m}) + m^{-1} \cdot a(X_m(t_{k-1,m})) + b(X_m(t_{k-1,m})) \cdot V_{k,m} \end{align*} with suitable random vectors $V_{k,m}$ to be defined below. The multilevel approach relies on a coupling of $X_m$ with an even number $m\in{\mathbb N}$ of steps to an Euler scheme \begin{align*} {\widetilde{X}}_{m/2}(t_{0,m/2}) &= x_0,\\ {\widetilde{X}}_{m/2}(t_{k,m/2}) &= {\widetilde{X}}_{m/2}(t_{k-1,m/2}) \begin{aligned}[t] &+ (m/2)^{-1} \cdot a\bigl({\widetilde{X}}_{m/2}(t_{k-1,m/2})\bigr)\\ &+ b\bigl({\widetilde{X}}_{m/2}(t_{k-1,m/2})\bigr) \cdot {\widetilde{V}}_{k,m/2} \end{aligned} \end{align*} with $m/2$ steps. Suitable random vectors ${\widetilde{V}}_{k,m/2}$ will be defined below. In order to approximate $X$ at any point $t \in [0,1]$ we extend $X_m(t_0),\ldots,X_m(t_m)$ and ${\widetilde{X}}_{m/2}(t_0),\ldots,{\widetilde{X}}_{m/2}(t_{m/2})$ by linear interpolation onto the subintervals $\left]t_{k-1},t_k\right[$. \subsection{The Classical Euler Scheme}\label{cleu} In the vast majority of papers, $X_m$ is based on the Brownian increments \[ V_{k,m} = W(t_{k,m}) - W(t_{k-1,m}), \] which are naturally coupled via \begin{equation}\label{g10} {\widetilde{V}}_{k,m/2} = V_{2k,m} + V_{2k-1,m} = W(t_{k,m/2}) - W(t_{k-1,m/2}). \end{equation} Obviously, ${\widetilde{V}}_{k,m/2} = V_{k,m/2}$, which is convenient in the analysis of multilevel algorithms. For the corresponding classical Euler scheme we use the notation $X_m^{\mathrm{c}}$ and ${\widetilde{X}}_{m/2}^{\mathrm{c}}$, and likewise we use $V_{k,m}^{\mathrm{c}}$ and ${\widetilde{V}}_{k,m/2}^{\mathrm{c}}$ for the corresponding increments. \subsection{A Random Bit Euler Scheme}\label{scheme1} In the present paper we study an Euler scheme that only uses random bits instead of random numbers from $[0,1]$. This excludes the use of Brownian increments. At first we discuss the approximation of standard normal distributions based on random bits. Let $\Phi$ denote the distribution function of $N(0,1)$ with inverse function $\Phi^{-1}$, and let $Y \sim N(0,1)$. We introduce the rounding function \begin{align*} T^{(q)} \colon {[0,1[} \to D^{(q)}, \quad x \mapsto \frac{\lfloor{2^q x}\rfloor}{2^q} + 2^{-(q+1)}, \end{align*} where $q \in {\mathbb N}$ and \[ D^{(q)} = \{\sum_{i=1}^q b_i \cdot 2^{-i} + 2^{-(q+1)} : b_i \in \{0,1\} \ \text{for} \ i=1,\ldots,q\}. \] Then \[ Y^{(q)} = \Phi^{-1} \circ T^{(q)} \circ \Phi(Y) \] serves as a canonical approximation of $Y$. Observe that $T^{(q)} \circ \Phi(Y)$ is uniformly distributed on $D^{(q)}$. Consequently, $q$ random bits suffice to simulate the distribution of $Y^{(q)}$. Further properties of $Y^{(q)}$ have been established in \citet{GHMR17}, see also Remark~\ref{rem:prop} below. For a standard normally distributed random vector $Y$ an approximation $Y^{(q)}$ is obtained by applying $\Phi^{-1} \circ T^{(q)} \circ \Phi$ to each of the components of $Y$ separately. We use this approximation in a straightforward way, i.e., we study a random bit Euler scheme with \begin{align}\label{eq10} V_{k,m} = m^{-1/2} \cdot \bigl( m^{1/2} \cdot (W(t_{k,m}) - W(t_{k-1,m}))\bigr)^{(q)}. \end{align} A suitable coupling is easily achieved by \begin{align}\label{eq2} {\widetilde{V}}_{k,m/2} = V_{2k,m} + V_{2k-1,m}, \end{align} cf.\ \eqref{g10}. To indicate the dependence of this coupled Euler scheme on the bit number $q$ we use the notation $X_{m,q}^\mathrm{bit}$ and ${\widetilde{X}}_{m/2,q}^\mathrm{bit}$, and likewise $V^\mathrm{bit}_{k,m,q}$ and ${\widetilde{V}}^\mathrm{bit}_{k,m/2,q}$ for the approximations of the Brownian increments. Proper relations between the number $q$ of bits and the number $m$ of Euler steps will be presented in Section~\ref{sec5}. The simulation of the joint distribution of $X_{m,q}^\mathrm{bit}$ and ${\widetilde{X}}_{m/2,q}^\mathrm{bit}$ requires $d \cdot m \cdot q$ random bits. We stress that the distributions of ${\widetilde{V}}^\mathrm{bit}_{k,m/2,q}$ and $V^\mathrm{bit}_{k,m/2,q}$ do not coincide, and therefore \begin{align}\label{eqend100} \operatorname{E}(f(X_{m/2})) \neq \operatorname{E}(f({\widetilde{X}}_{m/2})) \end{align} in general. This introduces an additional bias term in the multilevel analysis, cf.\ \citet[Thm.~6.1]{MSS15}. \subsection{Strong Error Analysis}\label{scheme1:analysis} It is well known that there exists a constant $c > 0$ such that \begin{equation}\label{g5} \Bigl(\operatorname{E} \|X - X_m^\mathrm{c}\|^2\Bigr)^{1/2} \leq c \cdot m^{-1/2} \cdot (\ln(m+1))^{1/2} \end{equation} for every $m \in {\mathbb N}$. Thus we will provide an upper bound for the difference between the random bit Euler scheme $X_{m,q}^\mathrm{bit}$ and the classical Euler scheme $X_m^\mathrm{c}$. The difference between ${\widetilde{X}}_{m/2,q}^\mathrm{bit}$ and ${\widetilde{X}}_{m/2}^\mathrm{c}$ may be treated in the same way. \begin{rem}\label{rem:prop} We gather some properties of the random vectors $V_{k,m}^\mathrm{c}$ and $V^\mathrm{bit}_{k,m}$ and of the scheme $X^\mathrm{bit}_{m,q}$. \begin{itemize} \item[(a)] We have independence of $(V^\mathrm{bit}_{k,m,q})_{k=1,\dots,m}$. \item[(b)] There exists a constant $c > 0$ such that \begin{align*} \Bigl(\operatorname{E}\bigl|V_{k,m}^\mathrm{c}-V^\mathrm{bit}_{k,m,q}\bigr|^2\Bigr)^{1/2} \leq c \cdot m^{-1/2} \cdot 2^{-q/2} \cdot q^{-1/2} \end{align*} and \begin{align*} \operatorname{E}\bigl(V^\mathrm{bit}_{k,m,q}\bigr) = 0 \end{align*} for all $m \in \mathbb{N}$, $k=1,\ldots,m$, and $q \in {\mathbb N}$. Furthermore, we have \begin{align*} \sup_{m \in \mathbb{N}} \sup_{k=1,\ldots,m} \sup_{q \in {\mathbb N}} \bigl(m^{1/2} \cdot \bigl(\operatorname{E}\bigl|V^\mathrm{bit}_{k,m,q}\bigr|^r\bigr)^{1/r}\bigr) < \infty \end{align*} for all $r \geq 1$. See \citet[Thm.~1]{GHMR17}. \item[(c)] We have $\operatorname{E} \|X^\mathrm{bit}_{m,q}\|^2 < \infty$ for every $m \in \mathbb{N}$ and $q \in \mathbb{N}$. \end{itemize} \end{rem} In the sequel, we assume that the Lipschitz constants of the drift coefficient $a$ and of the diffusion coefficient $b$ are bounded by $\gamma$. \begin{lem}\label{l:euler_vs_rbit-euler} There exists a constant $c > 0$ such that for all $m,q \in {\mathbb N}$ we have \begin{align*} \max_{k=0,\ldots,m} \Bigl(\operatorname{E} \bigl|X_m^\mathrm{c}(t_k) - X^\mathrm{bit}_{m,q}(t_k)\bigr|^2\Bigr)^{1/2} \leq c \cdot 2^{-q/2} \cdot q^{-1/2}. \end{align*} \end{lem} \begin{proof} This proof follows the standard analysis for the classical Euler scheme. For $k=0,\ldots,m-1$ we have \begin{align*} X_m^\mathrm{c}(t_{k+1}) - X^\mathrm{bit}_{m,q}(t_{k+1}) = \xi + \zeta, \end{align*} where \begin{align*} \xi = X_m^\mathrm{c}(t_k) - X^\mathrm{bit}_{m,q}(t_k) + m^{-1} \cdot \bigl(a(X_m^\mathrm{c}(t_k)) - a(X^\mathrm{bit}_{m,q}(t_k))\bigr) \end{align*} and \begin{align*} \zeta = b(X_m^\mathrm{c}(t_k)) \cdot V_{k+1,m}^\mathrm{c} - b(X^\mathrm{bit}_{m,q}(t_k)) \cdot V^\mathrm{bit}_{k+1,m,q}. \end{align*} For any pair of components $\xi_i$ and $\zeta_i$ of $\xi$ and $\zeta$, respectively, we have \begin{align*} \operatorname{E} \bigl(\xi_i \cdot \zeta_i\bigr) = 0, \end{align*} due to properties (a)--(c) from Remark~\ref{rem:prop}. It follows that \begin{align*} \operatorname{E}\bigl|X_m^\mathrm{c}(t_{k+1}) - X^\mathrm{bit}_{m,q}(t_{k+1})\bigr|^2 = \operatorname{E}\bigl(|\xi|^2\bigr) + \operatorname{E}\bigl(|\zeta|^2\bigr). \end{align*} The Lipschitz continuity of $a$ yields \begin{equation}\label{g1} \bigl(\operatorname{E}|\xi|^2\bigr)^{1/2} \leq (1+\gamma/m) \cdot \Bigl(\operatorname{E}\bigl|X_m^\mathrm{c}(t_k) - X^\mathrm{bit}_{m,q}(t_k)\bigr|^2\Bigr)^{1/2}. \end{equation} Moreover, \begin{align*} \operatorname{E}(|\zeta|^2) &\leq 2 \cdot \Bigl(\operatorname{E} \bigl|b(X_m^\mathrm{c}(t_k)) \cdot \bigl(V_{k+1,m}^\mathrm{c} - V^\mathrm{bit}_{k+1,m,q}\bigr)\bigr|^2\\ & \phantom{\leq} \mbox{} + \operatorname{E}\bigl|\bigl(b(X_m^\mathrm{c}(t_k)) - b\bigl(X^\mathrm{bit}_{m,q}(t_k)\bigr)\bigr) \cdot V^\mathrm{bit}_{k+1,m,q}\bigr|^2\Bigr). \end{align*} Due to the independence of $(V^\mathrm{c}_{k,m})_{k=1,\dots,m}$ we have \begin{align*} \operatorname{E}\bigl|b(X_m^\mathrm{c}(t_k)) \cdot \bigl(V_{k+1,m}^\mathrm{c} - V^\mathrm{bit}_{k+1,m,q}\bigr)\bigr|^2 \leq \operatorname{E}|b(X_m^\mathrm{c}(t_k))|^2 \cdot \operatorname{E}\bigl|V_{k+1,m}^\mathrm{c} - V^\mathrm{bit}_{k+1,m,q}\bigr|^2. \end{align*} Using \begin{align*} \operatorname{E}\bigl|b(X_m^\mathrm{c}(t_k))\bigr|^2 \leq 2 \cdot \gamma^2 \cdot \operatorname{E}|X_m^\mathrm{c}(t_k)|^2 + 2 \cdot |b(0)|^2 \end{align*} together with property (b) from Remark~\ref{rem:prop} we obtain a constant $c_1 > 0$ such that \begin{align*} \operatorname{E}\bigl|b(X_m^\mathrm{c}(t_k)) \cdot \bigl(V_{k+1,m}^\mathrm{c} - V^\mathrm{bit}_{k+1,m,q}\bigr)\bigr|^2 \leq c_1 \cdot m^{-1} \cdot 2^{-q} \cdot q^{-1} \end{align*} for all $m,q \in {\mathbb N}$ and $k=0,\ldots,m-1$. Property (a) from Remark~\ref{rem:prop} also gives \begin{align*} \operatorname{E}\bigl|\bigl(b(X_m^\mathrm{c}(t_k)) - b\bigl(X^\mathrm{bit}_{m,q}(t_k)\bigr)\bigr) \cdot V^\mathrm{bit}_{k+1,m,q}\bigr|^2 \leq \operatorname{E}\bigl|b(X_m^\mathrm{c}(t_k)) - b\bigl(X^\mathrm{bit}_{m,q}(t_k)\bigr)\bigr|^2 \cdot \operatorname{E}\bigl|V^\mathrm{bit}_{k+1,m,q}\bigr|^2. \end{align*} Moreover, \begin{align*} \operatorname{E}\bigl|b(X_m^\mathrm{c}(t_k)) - b\bigl(X^\mathrm{bit}_{m,q}(t_k)\bigr)\bigr|^2 \leq \gamma^2 \cdot \operatorname{E} \bigl|X_m^\mathrm{c}(t_k) - X^\mathrm{bit}_{m,q}(t_k)\bigr|^2, \end{align*} and property (b) from Remark~\ref{rem:prop} yields the existence of a constant $c_2 > 0$ such that \begin{align*} \operatorname{E}\bigl|\bigl(b(X_m^\mathrm{c}(t_k)) - b\bigl(X^\mathrm{bit}_{m,q}(t_k)\bigr)\bigr) \cdot V^\mathrm{bit}_{k+1,m,q}\bigr|^2 \leq c_2 \cdot m^{-1} \cdot \operatorname{E} \bigl|X_m^\mathrm{c}(t_k) - X^\mathrm{bit}_{m,q}(t_k)\bigr|^2 \end{align*} for all $m,q \in {\mathbb N}$ and $k=0,\ldots,m-1$. It follows that \begin{equation}\label{g2} \operatorname{E}(|\zeta|^2) \leq c_3/m \cdot \left( 2^{-q} \cdot q^{-1} + \operatorname{E} \bigl|X_m^\mathrm{c}(t_k) - X^\mathrm{bit}_{m,q}(t_k)\bigr|^2 \right) \end{equation} with $c_3 = 2 \cdot \max(c_1,c_2)$. Combining \eqref{g1} and \eqref{g2} we get the existence of a constant $c > 0$ such that \begin{align}\label{eq:proof} \operatorname{E}\bigl|X_m^\mathrm{c}(t_{k+1}) - X^\mathrm{bit}_{m,q}(t_{k+1})\bigr|^2 \leq (1+c/m) \cdot \operatorname{E}\bigl|X_m^\mathrm{c}(t_k) - X^\mathrm{bit}_{m,q}(t_k)\bigr|^2 + c/m \cdot 2^{-q} \cdot q^{-1} \end{align} for all $m,q \in {\mathbb N}$ and $k=0,\ldots,m-1$. A discrete Gronwall-inequality or a straightforward computation yields \begin{align*} &\operatorname{E} \bigl|X_m^\mathrm{c}(t_{k+1}) - X^\mathrm{bit}_{m,q}(t_{k+1})\bigr|^2\\ &\qquad\leq (1 + c/m)^{k+1} \cdot \operatorname{E} \bigl|X_m^\mathrm{c}(t_0) - X^\mathrm{bit}_{m,q}(t_0)\bigr|^2 + \sum_{j=0}^k (1 + c/m)^j \cdot c/m \cdot 2^{-q} \cdot q^{-1}\\ &\qquad\leq (1 + c/m)^m \cdot c/m \cdot (k+1) \cdot 2^{-q} \cdot q^{-1} \end{align*} with $c$ according to \eqref{eq:proof}, and hereby the statement for $X_m^\mathrm{c} - X^\mathrm{bit}_{m,q}$ follows. \end{proof} \begin{lem}\label{l:euler_vs_rbit-euler:sup} There exists a constant $c > 0$ such that for all $m,q \in {\mathbb N}$ we have \begin{align*} \Bigl(\operatorname{E} \bigl\|X_m^\mathrm{c} - X^\mathrm{bit}_{m,q}\bigr\|^2\Bigr)^{1/2} \leq c \cdot 2^{-q/2} \cdot q^{-1/2}. \end{align*} \end{lem} \begin{proof} This proof uses standard martingale arguments to exchange the maximum with the expectation in the error bound of Lemma~\ref{l:euler_vs_rbit-euler}. It suffices to consider the error at the point $t_k$, since $X_m^\mathrm{c}$ and $X^\mathrm{bit}_{m,q}$ are piecewise linear with breakpoints $t_k$. For $k=1,\ldots,m$ we have \begin{align}\label{eq:proof:1} X_m^\mathrm{c}(t_k) - X^\mathrm{bit}_{m,q}(t_k) &= m^{-1} \cdot \sum_{\ell=1}^k \Bigl(a(X_m^\mathrm{c}(t_{\ell-1})) - a(X^\mathrm{bit}_{m,q}(t_{\ell-1}))\Bigr)\\ &\qquad\mbox{}+ \sum_{\ell=1}^k \Bigl(b(X_m^\mathrm{c}(t_{\ell-1})) \cdot V_{\ell,m}^\mathrm{c} - b(X^\mathrm{bit}_{m,q}(t_{\ell-1})) \cdot V^\mathrm{bit}_{\ell,m,q}\Bigr),\notag \end{align} and therefore \[ \operatorname{E} \max_{k=0,\ldots,m} \bigl|X_m^\mathrm{c}(t_k) - X^\mathrm{bit}_{m,q}(t_k)\bigr|^2 \leq 2 \cdot \operatorname{E} \max_{k=1,\ldots,m} \bigl| Z_k \bigr|^2 + 2 \cdot \operatorname{E} \max_{k=1,\ldots,m} \bigl| R_k \bigr|^2 \] with \[ Z_k = m^{-1} \cdot \sum_{\ell=1}^k \Bigl(a(X_m^\mathrm{c}(t_{\ell-1})) - a(X^\mathrm{bit}_{m,q}(t_{\ell-1}))\Bigr) \] and \[ R_k = \sum_{\ell=1}^k \Bigl(b(X_m^\mathrm{c}(t_{\ell-1})) \cdot V_{\ell,m}^\mathrm{c} - b(X^\mathrm{bit}_{m,q}(t_{\ell-1})) \cdot V^\mathrm{bit}_{\ell,m,q}\Bigr). \] For the drift term we have \begin{align}\label{g3} \operatorname{E} \max_{k=1,\ldots,m} \bigl|Z_k\bigr|^2 &\leq \operatorname{E} \max_{k=1,\ldots,m} \frac{k}{m^2} \sum_{\ell=1}^k \bigl|a(X_m^\mathrm{c}(t_{\ell-1})) - a(X^\mathrm{bit}_{m,q}(t_{\ell-1}))\bigr|^2\\ &\leq \frac{\gamma^2}{m} \cdot \sum_{\ell=1}^m \operatorname{E} \bigl|X_m^\mathrm{c}(t_{\ell-1}) - X^\mathrm{bit}_{m,q}(t_{\ell-1})\bigr|^2 \notag \\ &\leq \gamma^2 \cdot \max_{k=0,\ldots,m} \operatorname{E} \, \bigl|X_m^\mathrm{c}(t_k) - X^\mathrm{bit}_{m,q}(t_k)\bigr|^2. \notag \end{align} For the diffusion term, we note that $(R_k)_{k=1,\ldots,m}$ is a martingale due to properties (b) and (c) from Remark~\ref{rem:prop}. Consequently, the Doob maximal inequality yields \begin{align*} \operatorname{E} \max_{k=1,\ldots,m} |R_k|^2 \leq 4 \cdot \operatorname{E} |R_m|^2. \end{align*} Use \eqref{eq:proof:1} and \eqref{g3} to obtain \begin{align*} \operatorname{E} |R_m|^2 &= \operatorname{E} \bigl|X_m^\mathrm{c}(t_m) - X^\mathrm{bit}_{m,q}(t_m) - Z_m \bigr|^2\\ &\leq 2 \cdot \operatorname{E} \bigl|X_m^\mathrm{c}(t_m) - X^\mathrm{bit}_{m,q}(t_m)\bigr|^2 + 2 \cdot \operatorname{E} \bigl|Z_m\bigr|^2\\ &\leq 2 \cdot (1 + \gamma^2) \cdot \max_{k=0,\ldots,m} \operatorname{E} \bigl|X_m^\mathrm{c}(t_k) - X^\mathrm{bit}_{m,q}(t_k)\bigr|^2. \end{align*} We conclude that \[ \operatorname{E} \max_{k=0,\ldots,m} \bigl|X_m^\mathrm{c}(t_k) - X^\mathrm{bit}_{m,q}(t_k)\bigr|^2 \leq 18\cdot(1+\gamma^2) \cdot \max_{k=0,\ldots,m} \operatorname{E} \bigl|X_m^\mathrm{c}(t_k) - X^\mathrm{bit}_{m,q}(t_k)\bigr|^2. \] Apply Lemma~\ref{l:euler_vs_rbit-euler} to derive the statement for $X_m^\mathrm{c}-X^\mathrm{bit}_{m,q}$. \end{proof} \begin{rem} Let $\Delta$ denote the Wasserstein distance of order two on the space of all Borel probability measures on a separable Banach space. For any such measure $\mu$ the asymptotics of \begin{align*} \operatorname{rbit}(\mu,p) = \inf\{ \Delta(\mu, \nu) \colon \nu\text{ uniform distribution with support of size } 2^p\}, \qquad p\in{\mathbb N}, \end{align*} have been recently studied in \citet{C18,GHMR17,XB17,Berger2018, 2018arXiv180907891B}. Combining Lemma~\ref{l:euler_vs_rbit-euler:sup} with \eqref{g5} we get the existence of a constant $c>0$ such that \begin{align}\label{ineq} \operatorname{rbit}(\mu,p) \leq c\cdot\min_{d\cdot m\cdot q\leq p}\left(m^{-1/2} \cdot (\ln(m+1))^{1/2} + 2^{-q/2} \cdot q^{-1/2}\right) \end{align} for all $p\in{\mathbb N}$, where $\mu$ is the distribution of the solution $X$ on the Banach space $C([0,1],{\mathbb R}^r)$. It can be shown that the right hand side of \eqref{ineq} is of the order $p^{-1/2}\cdot \ln(p)$. In the scalar case, i.e., $r=d=1$, and under a slightly stronger smoothness assumption on the coefficients $a,b$ as well as a non-degeneracy assumption on the diffusion coefficients $b$ of the SDE, which in particular exclude pathological cases yielding a deterministic solution, it has been shown in \citet[Thm.~4]{GHMR17} that $\operatorname{rbit}(\mu,p)$ is of the order $p^{-1/2}$ for the Banach space $L_2[0,1]$. Hence the upper bound obtained via \eqref{ineq} is sharp, up to logarithmic factors, but matching upper and lower bounds seem to be unknown in this case. \end{rem} Following the proofs of Lemma~\ref{l:euler_vs_rbit-euler} and Lemma~\ref{l:euler_vs_rbit-euler:sup}, one may establish analogous results for the difference ${\widetilde{X}}_{m/2}^\mathrm{c} - {\widetilde{X}}^\mathrm{bit}_{m/2,q}$. We only formulate the analogue to Lemma~\ref{l:euler_vs_rbit-euler:sup}. \begin{lem}\label{lem3} There exists a constant $c > 0$ such that for every $q \in {\mathbb N}$ and every even $m\in {\mathbb N}$ we have \begin{align*} \Bigl(\operatorname{E} \bigl\|{\widetilde{X}}_{m/2}^\mathrm{c} - {\widetilde{X}}^\mathrm{bit}_{m/2,q}\bigr\|^2\Bigr)^{1/2} \leq c \cdot 2^{-q/2} \cdot q^{-1/2}. \end{align*} \end{lem} Lemma \ref{l:euler_vs_rbit-euler:sup} and Lemma \ref{lem3}, together with \eqref{g5}, will be used to control the variances and the bias of multilevel algorithms in the following section. Concerning the variances, a different approach is provided in \citet[Sec.~3.1]{BN17}. \section{Multilevel Euler Algorithms}\label{sec5} At first we give a general description of a multilevel algorithm based on either of the two Euler schemes in Section~\ref{Euler:schemes}. Let $L \in {\mathbb N}$ be the maximum level that is used by this algorithm. On every level $\ell=1,\ldots,L$ the algorithm involves a fine approximation $X_{2^\ell}$ and a coarse approximation ${\widetilde{X}}_{2^{\ell-1}}$ according to Section~\ref{Euler:schemes}. On level $\ell=0$ we only need the fine approximation $X_{2^0}$, but we set ${\widetilde{X}}_{2^{-1}} = 0$ for notational convenience. Furthermore, let $N=(N_0,\ldots,N_L)\in{\mathbb N}^{L+1}$ be the vector of replication numbers on the levels $\ell=0,\ldots,L$. To define the multilevel algorithm we consider a family \[ {\boldsymbol{X}}_{L,N} = \bigl((X_{2^\ell,i}, {\widetilde{X}}_{2^{\ell-1},i})\bigr)_{\ell=0,\ldots,L, i=1,\ldots,N_\ell} \] of random elements $(X_{2^\ell,i},{\widetilde{X}}_{2^{\ell-1},i})$ such that \[ \bigl(X_{2^\ell,i},{\widetilde{X}}_{2^{\ell-1},i}\bigr) \stackrel{\mathrm{d}}{=} \bigl(X_{2^\ell},{\widetilde{X}}_{2^{\ell-1}}\bigr) \] for $\ell=0,\ldots,L$ and $i=1,\ldots,N_\ell$. The joint distribution of ${\boldsymbol{X}}_{L,N}$ will be specified later. The multilevel Euler algorithm finally reads as \[ A_{L,N}(f) = \frac{1}{N_0} \cdot \sum_{i=1}^{N_0} f\bigl( X_{2^0,i}\bigr) + \sum_{\ell=1}^L \frac{1}{N_\ell} \cdot \sum_{i=1}^{N_\ell} \bigl(f\bigl(X_{2^\ell,i}\bigr) - f\bigl({\widetilde{X}}_{2^{\ell-1},i}\bigr)\bigr). \] Subsequently we study three different variants of this algorithm. In the first two variants ${\boldsymbol{X}}_{L,N}$ is independent, i.e., the family ${\boldsymbol{X}}_{L,N}$ of random variables $(X_{2^\ell,i}, {\widetilde{X}}_{2^{\ell-1},i})$ is independent, which is a standard assumption for multilevel algorithms. In the first case we use the classical Euler scheme with normally distributed increments. In the other two cases we consider random bit Monte Carlo algorithms. In the second case we simply employ random bit approximations of the normally distributed increments. In the third case we apply Bakhvalov's trick in order to reduce the number of random bits; consequently, ${\boldsymbol{X}}_{L,N}$ is no longer independent. \subsection{The Classical Multilevel Algorithm}\label{classicml} In this section ${\boldsymbol{X}}_{L,N}$ is assumed to be independent and \[ \bigl(X_{2^\ell},{\widetilde{X}}_{2^{\ell-1}}\bigr) \stackrel{\mathrm{d}}{=} \bigl(X_{2^\ell}^\mathrm{c},{\widetilde{X}}_{2^{\ell-1}}^\mathrm{c}\bigr) \] for $\ell=0,\dots,L$, where ${\widetilde{X}}_{2^{-1}}^\mathrm{c} = 0$ for notational convenience. See Section~\ref{cleu}. Hereby we get the classical multilevel Euler algorithm, which we denote by $A_{L,N}^\mathrm{c}$. We estimate the cost of $A_{L,N}^\mathrm{c}$. For that purpose we consider the cost on level $\ell$. The cost for the arithmetic operations, the evaluations of $a,b$ and $f$ as well as $\Phi^{-1}$ on level $\ell$ is, up to a multiplicative constant, given by $N_\ell \cdot 2^\ell$. The number $r_\ell$ of calls to the random number generator on level $\ell$ is given by \begin{align*} r_\ell=N_\ell\cdot 2^\ell \cdot d. \end{align*} Consequently, there exists a constant $c > 1$ such that for all $L$ and $N$ the multilevel Euler algorithm satisfies \begin{align*} c^{-1} \cdot \sum_{\ell=0}^L 2^\ell\cdot N_\ell \leq \operatorname{cost}\bigl(A_{L,N}^\mathrm{c},\operatorname{Lip}_1\bigr) \leq c \cdot \sum_{\ell=0}^L 2^\ell\cdot N_\ell. \end{align*} For $\varepsilon \in {]0,1/2[}$ we consider the algorithm \[ A_\varepsilon^\mathrm{c} = A_{L(\varepsilon),N(\varepsilon)}^\mathrm{c} \] with maximal level \[ L= L(\varepsilon) = \bigl\lceil\log_2(\varepsilon^{-2}) + \log_2(\log_2(\varepsilon^{-2}))\bigr\rceil \] and with replication numbers \[ N_\ell= N_\ell(\varepsilon) = \bigl\lceil(L+1) \cdot 2^{-\ell} \cdot \max(\ell,1) \cdot \varepsilon^{-2} \bigr\rceil \] for $\ell=0,\ldots,L$. The following result is known, see, e.g., \citet[Rem.\ 8]{CDMGR09}. For convenience of the reader we present a proof. \begin{thm}\label{t:ML-EM} There exists a constant $c > 1$ such that the multilevel Euler algorithm $A_\varepsilon^\mathrm{c}$ satisfies \begin{align*} {\mathrm{e}}(A_\varepsilon^\mathrm{c},\operatorname{Lip}_1) \leq c \cdot \varepsilon \end{align*} and \begin{align*} c^{-1} \cdot \varepsilon^{-2} \cdot (\ln(\varepsilon^{-1}))^3 \leq \operatorname{cost}(A_\varepsilon^\mathrm{c},\operatorname{Lip}_1) \leq c \cdot \varepsilon^{-2} \cdot (\ln(\varepsilon^{-1}))^3 \end{align*} for every $\varepsilon \in {]0,1/2[}$. \end{thm} \begin{proof} We show that both the squared bias and the variance of $A_\varepsilon^\mathrm{c}$ are bounded by $\varepsilon^2$, up to a constant. Use \eqref{g5} to obtain a constant $c_1>0$ such that \[ \operatorname{E}\|X-X_{2^\ell}^\mathrm{c}\|^2 \leq c_1 \cdot 2^{-\ell} \cdot \max(\ell,1) \] for every $\ell \geq 0$ and $\operatorname{E}\|X_{2^0}\|^2 \leq c_1$. Hence we get \[ \left|S(f) - \operatorname{E} ( A_{L,N}^\mathrm{c} (f)) \right|^2= \left|\operatorname{E}(f(X)) - \operatorname{E} ( f(X_{2^L}^\mathrm{c})) \right|^2 \leq c_1 \cdot 2^{-L} \cdot L \] for all $L$ and $N$ and for every $f \in \operatorname{Lip}_1$. With $L=L(\varepsilon)$ this upper bound is of the order $\varepsilon^{2}$, as claimed. For the variance we get \[ \operatorname{Var}(A_{L,N}^\mathrm{c}(f)) \leq 6c_1 \cdot \sum_{\ell=0}^L \frac{\max(\ell,1)}{2^{\ell} \cdot N_\ell} \] for all $L$ and $N$ and for every $f \in \operatorname{Lip}_1$. With $N = N(\varepsilon)$ and $L = L(\varepsilon)$ this upper bound is of the order $\varepsilon^{2}$, too. To derive the cost bounds for $A_\varepsilon^\mathrm{c}$ it remains to observe that there exists a constant $c_2>1$ such that \begin{equation}\label{g4} c_2^{-1} \cdot \varepsilon^{-2} \cdot (\ln(\varepsilon^{-1}))^3 \leq \sum_{\ell=0}^{L(\varepsilon)} N_\ell(\varepsilon) \cdot 2^\ell \leq c_2 \cdot \varepsilon^{-2} \cdot (\ln(\varepsilon^{-1}))^3 \end{equation} for all $\varepsilon$. \end{proof} \subsection{A Random Bit Multilevel Algorithm}\label{section1} In this section we consider a multilevel Euler algorithm that is based on random bits. As before, we assume that ${\boldsymbol{X}}_{L,N}$ is independent, but now we take \[ \bigl(X_{2^\ell},{\widetilde{X}}_{2^{\ell-1}}\bigr) \stackrel{\mathrm{d}}{=} \bigl(X^\mathrm{bit}_{2^\ell,q},{\widetilde{X}}^\mathrm{bit}_{2^{\ell-1},q}\bigr) \] for $\ell=0,\dots,L$ and $q \in {\mathbb N}$, where ${\widetilde{X}}^\mathrm{bit}_{2^{-1},q} = 0$ for notational convenience. See Section~\ref{scheme1}. The resulting algorithm is denoted by $A^\mathrm{bit}_{L,N,q}$. A different construction of a random bit multilevel algorithm, which is based on the coupling \eqref{eq2} and which ensures that \begin{equation}\label{eqend} {\widetilde{X}}_{2^{\ell-1}} \stackrel{\mathrm{d}}{=} X_{2^{\ell-1}} \end{equation} is satisfied, is studied in \citet{BN17}. Recall that \eqref{eqend} is violated in our construction, except in trivial cases, see \eqref{eqend100}. The cost of $A^\mathrm{bit}_{L,N,q}$ can be bounded as in Section~\ref{classicml}. In fact, the number $r_\ell$ of calls to the random number generator on level $\ell$ is given by \begin{align*} r_\ell=N_\ell \cdot 2^\ell \cdot d\cdot q. \end{align*} Furthermore, there exists a constant $c>1$ such that for all $L$, $N$, and $q$ the multilevel Euler algorithm satisfies \begin{align*} c^{-1} \cdot q\cdot \sum_{\ell=0}^L 2^\ell\cdot N_\ell \leq \operatorname{cost}\bigl(A^\mathrm{bit}_{L,N,q},\operatorname{Lip}_1\bigr) \leq c \cdot q\cdot \sum_{\ell=0}^L 2^\ell\cdot N_\ell. \end{align*} For $\varepsilon \in {]0,1/2[}$ we choose the bit number \[ q(\varepsilon) = L(\varepsilon) \] and $L(\varepsilon)$ as well as $N(\varepsilon)$ as in Section~\ref{classicml} to obtain the algorithm \[ A^\mathrm{bit}_\varepsilon = A^\mathrm{bit}_{L(\varepsilon),N(\varepsilon),q(\varepsilon)}. \] \begin{thm}\label{theo2} There exists a constant $c>1$ such that the random bit multilevel Euler algorithm $A^\mathrm{bit}_\varepsilon$ satisfies \begin{align*} {\mathrm{e}}\bigl(A^\mathrm{bit}_\varepsilon,\operatorname{Lip}_1\bigr) \leq c \cdot \varepsilon \end{align*} and \begin{align*} c^{-1} \cdot \varepsilon^{-2} \cdot (\ln(\varepsilon^{-1}))^4 \leq \operatorname{cost}\bigl(A^\mathrm{bit}_\varepsilon,\operatorname{Lip}_1\bigr) \leq c \cdot \varepsilon^{-2} \cdot (\ln(\varepsilon^{-1}))^4 \end{align*} for every $\varepsilon \in {]0,1/2[}$. \end{thm} \begin{proof} At first we establish the error bound. Due to Theorem~\ref{t:ML-EM} it suffices to show the existence of a constant $c>0$ such that \begin{align*} \sup_{f \in \operatorname{Lip}_1} \Bigl(\operatorname{E}\bigl| A_\varepsilon^\mathrm{c}(f) - A^\mathrm{bit}_\varepsilon(f)\bigr|^2\Bigr)^{1/2} \leq c \cdot \varepsilon \end{align*} for every $\varepsilon \in {]0,1/2[}$. For $f \in \operatorname{Lip}_1$ we have \[ \Bigl(\operatorname{E}\bigl|A_{L,N}^\mathrm{c}(f) - A^\mathrm{bit}_{L,N,q}(f)\bigr|^2\Bigr)^{1/2}\\ \leq \sum_{\ell=0}^L \Bigl(\operatorname{E} \bigl\|X_{2^\ell}^\mathrm{c} - X^\mathrm{bit}_{2^\ell,q} \bigr\|^2 \Bigr)^{1/2} + \sum_{\ell=1}^L \Bigl(\operatorname{E} \bigl\|{\widetilde{X}}_{2^{\ell-1}}^\mathrm{c} - {\widetilde{X}}^\mathrm{bit}_{2^{\ell-1},q}\bigr\|^2\Bigr)^{1/2}. \] Apply Lemma~\ref{l:euler_vs_rbit-euler:sup} as well as Lemma~\ref{lem3} to obtain the existence of a constant $c_1>0$ such that \begin{align*} \Bigl(\operatorname{E}\bigl|A_{L,N}^\mathrm{c}(f) - A^\mathrm{bit}_{L,N,q}(f)\bigr|^2\Bigr)^{1/2} \leq c_1 \cdot L \cdot 2^{-q/2} \cdot q^{-1/2} \end{align*} for all $L$, $q$, and $N$ and every $f \in \operatorname{Lip}_1$. With $q=L=L(\varepsilon)$ this upper bound is of the order $\varepsilon$. The cost bounds follow immediately from \eqref{g4}. \end{proof} \subsection{A Random Bit Multilevel Algorithm Based on Bakhvalov's Trick}\label{secbah} In this section we consider a variant of the random bit multilevel algorithm $A^\mathrm{bit}_{L,N,q}$ from Section~\ref{section1}, which is based on Bakhvalov's trick, see \citet{MR0172463} and also \citet{MR2076605} and the references therein. In our case this trick yields $n^2$ pairwise independent random variables, each of which is uniformly distributed on $D^{(q)}$, from $2n$ independent random variables, each of which is uniformly distributed on $D^{(q)}$, see Lemma~\ref{bahvalov} in Appendix~\ref{app}. Of course, the same is true in the $d$-dimensional situation, i.e., with $D^{(q)}$ replaced by $(D^{(q)})^d$. We construct a random bit multilevel Euler algorithm $A_{L,N,q}^{\mathrm{Bbit}}$ that achieves the following properties at a reduced number of random bits compared to $A^\mathrm{bit}_{L,N,q}$: \begin{itemize} \item[(i)] The family ${\boldsymbol{X}}_{L,N}$ is pairwise independent. \item[(ii)] For every $\ell=0,\ldots,L$ we have \[ \bigl(X_{2^\ell},{\widetilde{X}}_{2^{\ell-1}}\bigr) \stackrel{\mathrm{d}}{=} \bigl(X^\mathrm{bit}_{2^\ell,q},{\widetilde{X}}^\mathrm{bit}_{2^{\ell-1},q}\bigr) \] as in Section~\ref{section1}. \end{itemize} These properties already ensure that the expectations and the variances of $A^\mathrm{bit}_{L,N,q}(f)$ and $A_{L,N,q}^{\mathrm{Bbit}}(f)$ coincide for every $f\in \operatorname{Lip}_1$, so that ${\mathrm{e}}(A^\mathrm{bit}_{L,N,q},f)={\mathrm{e}}(A_{L,N,q}^{\mathrm{Bbit}},f)$. In particular, \begin{align}\label{error} {\mathrm{e}}\bigl(A^\mathrm{bit}_{L,N,q},\operatorname{Lip}_1\bigr) ={\mathrm{e}}\bigl(A_{L,N,q}^{\mathrm{Bbit}},\operatorname{Lip}_1\bigr). \end{align} We describe the construction of $A_{L,N,q}^{\mathrm{Bbit}}$ or, equivalently, the distribution of ${\boldsymbol{X}}_{L,N}$ in detail. Let \begin{align*} n_\ell=\bigl\lceil{N_\ell}^{1/2}\bigr\rceil \end{align*} for $\ell=0,\dots,L$. Consider an independent family \[ {\boldsymbol{G}} = (G_{k,2^\ell,j})_{k=1,\dots,2^\ell,\, \ell=0,\dots,L,\, j=1,\dots,2n_\ell} \] of random vectors $G_{k,2^\ell,j}$ that are uniformly distributed on $(D^{(q)})^d$. For $x\in{\mathbb R}$ we denote by $x\mod 1$ the fractional part of $x$, i.e., the real number $y\in \left[0,1\right[$ that satisfies $x-y\in{\mathbb Z}$. For $k=1,\dots,2^\ell$, $\ell=0,\dots,L$, and $j_1,j_2=1,\dots,n_\ell$ define \begin{align*} U_{k,2^\ell,(j_1-1)n_\ell+j_2} = G_{k,2^\ell,j_1}+G_{k,2^\ell,j_2+n_\ell}+ 2^{-(q+1)}\cdot \boldsymbol{1} \mod 1, \end{align*} where the fractional part is taken in each component separately and $\boldsymbol{1}\in{\mathbb R}^d$ denotes the vector with all components equal to $1$. Let \[ {\boldsymbol{U}}_\ell = (U_{k,2^\ell,i})_{k=1,\dots,2^\ell, i=1,\dots,N_\ell} \] for $\ell=0,\dots,L$. Obviously, the following holds true: \begin{itemize} \item[(I)] The family $({\boldsymbol{U}}_\ell)_{\ell=0,\dots,L}$ is independent. \item[(II)] For all $\ell=0,\dots,L$ and $i=1,\dots,N_\ell$ the family $(U_{k,2^\ell,i})_{k=1,\dots,2^\ell}$ is independent. \end{itemize} Let \[ {\boldsymbol{U}}_{\ell,i} = (U_{k,2^\ell,i})_{k=1,\dots,2^\ell} \] for $\ell=0,\dots,L$ and $i=1,\dots,N_\ell$. Lemma~\ref{bahvalov} from Appendix~\ref{app} yields: \begin{itemize} \item[(III)] For every $\ell=0,\dots,L$ the family $({\boldsymbol{U}}_{\ell,i})_{i=1,\dots,N_\ell}$ is pairwise independent. \item[(IV)] For all $k=1,\dots,2^\ell$, $\ell=0,\dots,L$, and $i=1,\dots,N_\ell$ the random vector $U_{k,2^\ell,i}$ is uniformly distributed on $(D^{(q)})^d$. \end{itemize} For $k=1,\dots,2^\ell$, $\ell=0,\dots,L$, and $i=1,\dots,N_\ell$ let \begin{align*} V_{k,2^\ell,i} =2^{-\ell/2}\cdot \Phi^{-1}\left(U_{k,2^\ell,i}\right), \end{align*} where the function $\Phi^{-1}$ is applied to each of the components of the $d$-dimensional random vector $U_{k,2^\ell,i}$ separately, cf.\ \eqref{eq10}, and for $k=1,\dots,2^{\ell-1}$, $\ell=1,\dots,L$, and $i=1,\dots,N_\ell$ let \begin{align*} {\widetilde{V}}_{k,2^{\ell-1},i} = V_{2k,2^\ell,i} + V_{2k-1,2^\ell,i}, \end{align*} cf.\ \eqref{eq2}. Finally, for $\ell=0,\ldots,L$ and $i=1,\ldots,N_\ell$ the random element $X_{2^\ell,i}$ is given by the Euler scheme using the increments $(V_{k,2^\ell,i})_{k=1,\dots,2^\ell}$, for $\ell=1,\ldots,L$ and $i=1,\ldots,N_\ell$ the random element ${\widetilde{X}}_{2^{\ell-1},i}$ is given by the Euler scheme using the increments $({\widetilde{V}}_{k,2^{\ell-1},i})_{k=1,\dots,2^{\ell-1}}$, and for $\ell=0$ and $i=1,\ldots,N_\ell$ we set ${\widetilde{X}}_{2^{\ell-1},i}=0$. Observe that (I) and (III) imply (i). Furthermore, (II) and (IV) imply \[ (V_{k,2^\ell,i})_{k=1,\dots,2^\ell} \stackrel{\mathrm{d}}{=} (V^\mathrm{bit}_{k,2^\ell,q})_{k=1,\dots,2^\ell} \] for $\ell = 0, \dots,L$ and $i=1,\dots, N_\ell$, so that we also have (ii). The cost of $A_{L,N,q}^{\mathrm{Bbit}}$ can be bounded as in Sections~\ref{classicml} and \ref{section1}. The number of calls to the random number generator is the number of random bits needed to simulate the distribution of ${\boldsymbol{G}}$. Therefore it is given by $\sum_{\ell=0}^L r_\ell$ with \begin{align*} r_\ell=2n_\ell\cdot 2^\ell\cdot q\cdot d. \end{align*} We add that $r_\ell$ is the number of calls to the random number generator on level $\ell$. Furthermore, there exists a constant $c>1$ such that for all $L$, $N$, and $q$ the multilevel Euler algorithm satisfies \begin{align*} c^{-1} \cdot \sum_{\ell=0}^L \left( 2^\ell\cdot N_\ell + n_\ell\cdot 2^\ell\cdot q \right) \leq \operatorname{cost}\bigl(A_{L,N,q}^{\mathrm{Bbit}},\operatorname{Lip}_1\bigr) \leq c \cdot \sum_{\ell=0}^L \left( 2^\ell\cdot N_\ell + n_\ell\cdot 2^\ell\cdot q \right). \end{align*} For $\varepsilon \in {]0,1/2[}$ we consider the algorithm \[ A_\varepsilon^{\mathrm{Bbit}} = A_{L(\varepsilon),N(\varepsilon),q(\varepsilon)}^{\mathrm{Bbit}} \] with $L(\varepsilon)$ and $N(\varepsilon)$ as in Section~\ref{classicml} and $q(\varepsilon)$ as in Section~\ref{section1}. \begin{thm}\label{theo3} There exists a constant $c>1$ such that the random bit multilevel Euler algorithm $A_\varepsilon^{\mathrm{Bbit}}$ satisfies \begin{align}\label{thm8error} {\mathrm{e}}\bigl(A_\varepsilon^{\mathrm{Bbit}},\operatorname{Lip}_1\bigr) \leq c \cdot \varepsilon \end{align} and \begin{align*} c^{-1} \cdot \varepsilon^{-2} \cdot (\ln(\varepsilon^{-1}))^3 \leq \operatorname{cost}\bigl(A_\varepsilon^{\mathrm{Bbit}},\operatorname{Lip}_1\bigr) \leq c \cdot \varepsilon^{-2} \cdot (\ln(\varepsilon^{-1}))^3 \end{align*} for every $\varepsilon \in {]0,1/2[}$. \end{thm} \begin{proof} The error bound follows directly from \eqref{error} and Theorem~\ref{theo2}. The cost bounds follow directly from \eqref{g4} and the following observation. Let $n_\ell(\varepsilon) = \bigl\lceil N^{1/2}_\ell(\varepsilon) \bigr\rceil$. Then there exists a constant $c>1$ such that \begin{align*} c^{-1} \cdot \varepsilon^{-2} \cdot (\ln(\varepsilon^{-1}))^{3/2} \leq \sum_{\ell=0}^{L(\varepsilon)} n_\ell(\varepsilon) \cdot 2^\ell \leq c \cdot \varepsilon^{-2} \cdot (\ln(\varepsilon^{-1}))^{3/2} \end{align*} for all $\varepsilon$. \end{proof} Up to a multiplicative constant the error and cost bounds for the algorithm $A_\varepsilon^{\mathrm{Bbit}}$, which uses only random bits, and the classical multilevel algorithm $A_\varepsilon^\mathrm{c}$, which uses random numbers from $[0,1]$, coincide. A proper comparison, based on lower bounds, of the corresponding classes of randomized algorithms is given in Section \ref{s53}. \begin{rem}\label{cr2} We sketch an algorithm that uses asymptotically fewer random bits than the algorithm $A_\varepsilon^{\mathrm{Bbit}}$, but still has the desired distributional properties (i) and (ii). However, the overall cost will not be improved. The idea is to use the following variant of Lemma~\ref{bahvalov}. Consider an independent family $(G_{i,j})_{i=1,2,\, j=1,\dots,n}$ of random variables that are uniformly distributed on $D^{(q)}$. Then the family $(G_{i_1,1}+G_{i_2,2}+\dots+G_{i_n,n}+ 2^{-(q+1)}\cdot(n-1) \mod 1)_{i_1=1,2,\dots,i_n=1,2}$ is pairwise independent with each random variable being uniformly distributed on $D^{(q)}$. Proceeding similar to the construction of $A_{L,N,q}^{\mathrm{Bbit}}$, we obtain an algorithm that only needs $d\cdot \sum_{\ell=0}^{L}2^\ell\cdot q\cdot 2\hat n_\ell$ random bits, where \[ \hat n_\ell=\lceil\log_2{N_\ell}\rceil \] if $N_\ell\geq 2$ and $\hat n_\ell=1/2$ if $N_\ell=1$. With the choice of the parameters $L,N,q$ as above this number of bits is of the order $\varepsilon^{-2} \cdot (\ln(\varepsilon^{-1}))^2 \cdot \ln(\ln(\varepsilon^{-1}))$. See Appendix~\ref{apprem10} for the upper bound, and observe that the number of bits needed on the highest level is already of this order. Recall that the number of random bits needed for the algorithm $A_\varepsilon^{\mathrm{Bbit}}$ is of the order $\varepsilon^{-2} \cdot (\ln(\varepsilon^{-1}))^{5/2}$, see the proof of Theorem~\ref{theo3}, and the number of random bits needed for one path on the finest level is given by $d\cdot q\cdot 2^L$, which is of the order $\varepsilon^{-2} \cdot (\ln(\varepsilon^{-1}))^{2}$. \end{rem} \section{Lower Bounds for Random Bit Monte Carlo Algorithms}\label{bounds} We derive a general lower bound for random bit Monte Carlo algorithms, which is applied to the quadrature problem for SDEs. At first, we modify a basic setting from information-based complexity in order to formally introduce the class of all random bit Monte Carlo algorithms, cf.\ \citet{H18}. \subsection{Random Bit Monte Carlo Algorithms}\label{ls1} Consider a non-empty class $F$ of real-valued functions on a set ${\mathfrak{X}} \neq \emptyset$ and a mapping \[ S \colon F \to {\mathbb R}, \] which is to be approximated. By assumption, a random bit Monte Carlo algorithm has access to the functions $f \in F$ via an oracle (subroutine) that provides function values $f(x)$ for points $x \in {\mathfrak{X}}$ and to an ideal generator for random bits. This generator is modelled by the probability space $(\Omega,\mathfrak{A},P)$, where \[ \Omega = \{0,1\}^{\mathbb N} \] and where $\mathfrak{A}$ and $P$ denote the product $\sigma$-algebra and the product measure of the power set of $\{0,1\}$ and the uniform distribution on $\{0,1\}$, respectively. The cost per evaluation of $f \in F$ is modelled by a mapping \[ {\mathfrak{c}} \colon {\mathfrak{X}} \to {\mathbb N}\cup\{\infty\}, \] see \citet[Sec.~2]{CDMGR09}. For any function $f \in F$, its sequential evaluation, which may be interlaced with calls to the random bit generator, is formally defined by a sequence of mappings \[ \psi_1 \colon \{0,1\} \to {\mathfrak{X}} \] and \[ \psi_\ell \colon \{0,1\}^\ell \times {\mathbb R}^{\ell-1} \to {\mathfrak{X}} \] with $\ell \geq 2$. For every $f \in F$, the first step consists of a call to the random bit generator, which yields a bit $\omega_1 \in \{0,1\}$, followed by the evaluation of $f$ at $\psi_1(\omega_1) \in {\mathfrak{X}}$. After $n$ steps $n$ bits $\omega_1,\dots,\omega_n \in \{0,1\}$ have been obtained, and the function values \[ y_1 = f(\psi_1(\omega_1)) \] and \[ y_\ell = f(\psi_\ell(\omega_1,\dots,\omega_\ell,y_1,\dots,y_{\ell-1})) \] with $\ell = 2,\dots,n$ are known. Trivially, $\omega \mapsto (y_1,\dots,y_n)$ yields a measurable mapping from $\Omega$ to ${\mathbb R}^n$ for all $f \in F$ and $n \in {\mathbb N}$. A decision to stop or to further evaluate $f$ is made after each step. This is formally described by a sequence of mappings \[ \tau_\ell \colon \{0,1\}^\ell \times {\mathbb R}^{\ell} \to \{0,1\} \] with $\ell \geq 1$, and the total number $n(\omega,f)$ of evaluations of $f$ is given by \[ n(\omega,f) = \min\{\ell\in{\mathbb N}\colon \tau_\ell(\omega_1,\dots,\omega_\ell, y_1,\dots,y_\ell)=1\} \in {\mathbb N} \cup \{\infty\} \] for $\omega \in \Omega$. Trivially, $n(\cdot,f)$ is a measurable mapping from $\Omega$ to ${\mathbb N} \cup \{\infty\}$. We assume that \[ \forall\, f \in F \colon P(\{n(\cdot,f) < \infty\})=1. \] Finally, a sequence of mappings \[ \phi_\ell \colon \{0,1\}^\ell \times {\mathbb R}^\ell \to {\mathbb R} \] with $\ell \geq 1$ yields the approximation \[ \widehat{S}(\omega,f) = \phi_{n(\omega,f)} (\omega_1,\dots,\omega_{n(\omega,f)}, y_1,\dots,y_{n(\omega,f)}) \] to $S(f)$ for all $\omega \in \Omega$ and $f \in F$ with $n(\omega,f)< \infty$. Otherwise, i.e., if $n(\omega,f)= \infty$, we put $\widehat{S}(\omega,f)=0$. Trivially, $\widehat{S}(\cdot,f)$ is a measurable mapping for every $f \in F$. The tuple $\widehat{{\mathcal{S}}} = ((\psi_\ell)_\ell,(\tau_\ell)_\ell,(\phi_\ell)_\ell)$ will be considered as a random bit Monte Carlo algorithm, with algorithm being understood in a broad sense, cf.\ Section~\ref{seccomp}, and the class of all such algorithms is denoted by ${\mathbb S}^{\mathrm{bit}}$. For $\widehat{{\mathcal{S}}} \in {\mathbb S}^{\mathrm{bit}}$ the corresponding mapping $\widehat{S}: \Omega \times F \to {\mathbb R}$ will be called the input-output mapping induced by $\widehat{{\mathcal{S}}}$. For $\ell \in {\mathbb N}$ let $\pi_\ell\colon \Omega\to\{0,1\}^\ell$ be given by \[ \pi_\ell(\omega)=(\omega_1,\dots,\omega_\ell). \] The information cost and the error for applying the algorithm $\widehat{{\mathcal{S}}} \in {\mathbb S}^{\mathrm{bit}}$ to $f \in F$ are defined by \[ \operatorname{cost}_{\mathfrak{c}} (\widehat{{\mathcal{S}}},f) = \operatorname{E} \left(\sum_{\ell=1}^{n(\cdot,f)} {\mathfrak{c}}(\psi_\ell(\pi_\ell(\cdot),y_1,\dots,y_{\ell-1})) \right) \] and \[ {\mathrm{e}} (\widehat{{\mathcal{S}}},f) = \left( \operatorname{E} |S(f) - \widehat{S}(\cdot,f)|^2 \right)^{1/2}, \] respectively. Obviously, $\operatorname{cost}_{\mathfrak{c}}(\widehat{{\mathcal{S}}},f)$ is also an upper bound for the expected number $\operatorname{E}(n(\cdot,f))$ of random bits that are used by $\widehat{{\mathcal{S}}}$, when applied to $f$. The worst case information cost and the worst case error of $\widehat{{\mathcal{S}}}$ are defined by \begin{equation}\label{g21} \operatorname{cost}_{\mathfrak{c}}(\widehat{{\mathcal{S}}}) = \sup_{f \in F} \operatorname{cost}_{\mathfrak{c}} (\widehat{{\mathcal{S}}},f) \end{equation} and \begin{equation}\label{g22} {\mathrm{e}}(\widehat{{\mathcal{S}}}) = \sup_{f \in F} {\mathrm{e}} (\widehat{{\mathcal{S}}},f), \end{equation} respectively. The $\varepsilon$-complexity for the approximation of $S$ by means of random bit Monte Carlo algorithms is defined by \[ \operatorname{comp}^{\mathrm{bit}}_{\mathfrak{c}} (\varepsilon) = \inf \{ \operatorname{cost}_{\mathfrak{c}}(\widehat{{\mathcal{S}}}) \colon \widehat{{\mathcal{S}}} \in {\mathbb S}^{\mathrm{bit}},\ {\mathrm{e}}(\widehat{{\mathcal{S}}}) \leq \varepsilon\} \] for $\varepsilon > 0$. If for every $\ell \geq 1$ none of the mappings $\psi_\ell$, $\tau_\ell$, and $\phi_\ell$ depends on $\omega_1,\dots,\omega_\ell$, then $\widehat{{\mathcal{S}}}$ is called a deterministic algorithm, and the corresponding proper subclass of ${\mathbb S}^{\mathrm{bit}}$ is denoted by ${\mathbb S}^{\mathrm{det}}$. For $\widehat{{\mathcal{S}}} \in {\mathbb S}^{\mathrm{det}}$ the expectations may be dropped in the definitions of the worst case information cost and error, and the $\varepsilon$-complexity for the approximation of $S$ by means of deterministic algorithms is defined by \[ \operatorname{comp}^{\mathrm{det}}_{\mathfrak{c}} (\varepsilon) = \inf \{ \operatorname{cost}_{\mathfrak{c}}(\widehat{{\mathcal{S}}}) \colon \widehat{{\mathcal{S}}} \in {\mathbb S}^{\mathrm{det}},\ {\mathrm{e}}(\widehat{{\mathcal{S}}}) \leq \varepsilon\} \] for $\varepsilon > 0$. Monte Carlo algorithms from the class ${\mathbb S}^{\mathrm{bit}}$ may only use random bits. Let us drop this constraint and consider randomized algorithms in general. A randomized algorithm is defined by any probability space $(\Omega,\mathfrak A, P)$ and a mapping $\widehat{{\mathcal{S}}} \colon \Omega \to {\mathbb S}^{\mathrm{det}}$, which induces an input-output mapping $\widehat{S} \colon \Omega \times F \to {\mathbb R}$. Roughly speaking, $(\Omega,\mathfrak A, P)$ is the computational probability space, which may carry any kind of random number generator. If for a fixed $\omega \in \Omega$ all random numbers that may potentially be used in the computation are fixed in advance, then the randomized algorithm is turned into the deterministic algorithm $\widehat{{\mathcal{S}}}(\omega)$ with input-output mapping $\widehat{S} (\omega,\cdot)$. Under the appropriate measurability assumptions, the worst case error and the worst case information cost of a randomized algorithm $\widehat{{\mathcal{S}}}$ are defined analogously to \eqref{g21} and \eqref{g22}. The class of all randomized algorithms that satisfy the measurability assumptions is denoted by ${\mathbb S}^{\mathrm{ran}}$, and \[ \operatorname{comp}^{\mathrm{ran}}_{\mathfrak{c}} (\varepsilon) = \inf \{ \operatorname{cost}_{\mathfrak{c}}(\widehat{{\mathcal{S}}}) \colon \widehat{{\mathcal{S}}} \in {\mathbb S}^{\mathrm{ran}},\ {\mathrm{e}}(\widehat{{\mathcal{S}}}) \leq \varepsilon\} \] is the $\varepsilon$-complexity for the approximation of $S$ by means of randomized algorithms. We refer to, e.g., \citet[Sec.~2.3]{CDMGR09} for further details. Obviously, \begin{align}\label{g77} \operatorname{comp}^{\mathrm{ran}}_{\mathfrak{c}}(\varepsilon) \leq \operatorname{comp}^{\mathrm{bit}}_{\mathfrak{c}}(\varepsilon) \leq \operatorname{comp}^{\mathrm{det}}_{\mathfrak{c}}(\varepsilon) \end{align} for every $\varepsilon >0$. \begin{rem} Every algorithm $\widehat{{\mathcal{S}}} \in {\mathbb S}^{\mathrm{bit}}$ is asking for exactly one new random bit prior to a new function evaluation. In a refined model, this number of random bits could vary; observe that the latter is actually the case for the random bit multilevel algorithms that have been studied in Sections~\ref{section1} and \ref{secbah}. On the other hand, cost one should be charged explicitly for every call of the random bit generator in a refined model. Formally an algorithm in this refined model may be turned into an algorithm $\widehat{{\mathcal{S}}} \in {\mathbb S}^{\mathrm{bit}}$ by additional calls of the random bit generator and additional evaluations of $f$ at a fixed element $y \in {\mathfrak{X}}$ with no impact on the further computation. Observe that the expected cost for applying the original algorithm in the refined model to $f \in F$ is bounded from above by ${\mathfrak{c}}(y) \cdot \operatorname{cost}_{\mathfrak{c}}(\widehat{{\mathcal{S}}},f)$. We stress that even this refined model disregards further details of the real-number model, cf.\ Section~\ref{seccomp}. However, for the purpose of establishing lower bounds with unspecified multiplicative constants, it suffices to study algorithms $\widehat{{\mathcal{S}}} \in {\mathbb S}^{\mathrm{bit}}$ and $\operatorname{cost}_{\mathfrak{c}}(\widehat{{\mathcal{S}}},f)$, i.e., the information cost, in the non-trivial case that there exists an element $y \in {\mathfrak{X}}$ with $c(y) < \infty$. The refined model is formally introduced in \citet{H18}. In this model upper and lower bounds that separately take into account the number of random bits and the information cost may be established in a natural way. Furthermore, this framework allows to consider Monte Carlo algorithms that only have access to generators for an arbitrary, but fixed set $\mathcal{Q}$ of probability distributions. Random bit Monte Carlo algorithms, as studied in the present paper, correspond to the case $\mathcal{Q} = \{Q\}$ with $Q$ denoting the uniform distribution on $\{0,1\}$, while $\mathcal{Q} = \{Q\}$ with $Q$ denoting the uniform distribution on $[0,1]$ is most often considered for quadrature problems. \end{rem} \subsection{A General Lower Bound}\label{ls2} Let $\widehat{{\mathcal{S}}} = ((\psi_\ell)_\ell,(\tau_\ell)_\ell,(\phi_\ell)_\ell) \in {\mathbb S}^{\mathrm{bit}}$, and suppose that there exist $k,c \in {\mathbb N}$ with the following properties: For all $\omega \in \Omega$, $f \in F$, and $y_1,\dots,y_{k-1} \in {\mathbb R}$ we have $n(\omega,f) = k$ and \[ \sum_{\ell=1}^{k} {\mathfrak{c}}(\psi_\ell(\omega_1,\dots,\omega_\ell,y_1,\dots,y_{\ell-1})) = c, \] i.e., $k$ random bits are used in any case and the information cost is deterministic and does not depend on $f$. Then $\widehat{{\mathcal{S}}}$ can be emulated by $2^k$ deterministic algorithms, each with information cost $c$ for every $f$, plus a random choice among the outputs of the deterministic algorithms. This observation can be generalized to any $\widehat{{\mathcal{S}}} \in {\mathbb S}^{\mathrm{bit}}$, and it leads to a lower bound for $\operatorname{comp}^{\mathrm{bit}}_{\mathfrak{c}} (\varepsilon)$ in terms of $\operatorname{comp}^{\mathrm{det}}_{\mathfrak{c}} (\varepsilon)$. Under the particular assumptions mentioned above this lower bound has already been established in \citet[Prop.~1]{MR2076605}. \begin{lem}\label{l22} For every algorithm $\widehat{{\mathcal{S}}} \in {\mathbb S}^{\mathrm{bit}}$ with $\operatorname{cost}_{\mathfrak{c}}(\widehat{{\mathcal{S}}})<\infty$ there exists an algorithm $\widehat{{\mathcal{S}}}^* \in {\mathbb S}^{\mathrm{det}}$ such that \[ \operatorname{cost}_{\mathfrak{c}}(\widehat{{\mathcal{S}}}^*) \leq 2 \cdot (\operatorname{cost}_{\mathfrak{c}} (\widehat{{\mathcal{S}}})+1) \cdot 4^{\operatorname{cost}_{\mathfrak{c}} (\widehat{{\mathcal{S}}})+1} \] and \[ {\mathrm{e}}(\widehat{{\mathcal{S}}}^*) \leq 2 \cdot {\mathrm{e}}(\widehat{{\mathcal{S}}}). \] \end{lem} \begin{proof} Let $\widehat{{\mathcal{S}}} = ((\psi_\ell)_\ell,(\tau_\ell)_\ell,(\phi_\ell)_\ell) \in {\mathbb S}^{\mathrm{bit}}$ with input-output mapping $\widehat{S}$. We may assume that ${\mathrm{e}}(\widehat{{\mathcal{S}}})<\infty$, in addition to $\operatorname{cost}_{\mathfrak{c}}(\widehat{{\mathcal{S}}}) < \infty$. Hence $\widehat{S}(\cdot,f)$ is integrable for every $f\in F$. Moreover, let $n (\cdot,\cdot)$ be the corresponding total number of evaluations. Put \begin{align*} k=\lceil\operatorname{cost}_{\mathfrak{c}}(\widehat{{\mathcal{S}}})\rceil\in{\mathbb N}. \end{align*} For $f\in F$ we define \begin{align*} A_f=\Big\{\omega\in\Omega\colon \sum_{\ell=1}^{n(\omega,f)} {\mathfrak{c}}(\psi_\ell(\pi_\ell(\omega),y_1,\dots,y_{\ell-1})) \leq 2k \Big\} \end{align*} and \begin{align*} \widehat{S}^*(f) = \operatorname{E}(\widehat{S}(\cdot,f)\,\vert\, A_f). \end{align*} Since $P(A_f)\geq 1/2$, we get the error bound \begin{align*} |S(f)-\widehat{S}^*(f)| =|S(f)-\operatorname{E}(\widehat{S}(\cdot,f)\,\vert\, A_f)| \leq \operatorname{E}\big(|S(f)-\widehat{S}(\cdot,f)| \,\big\vert\, A_f\big) \leq 2 \cdot {\mathrm{e}} (\widehat{{\mathcal{S}}},f) \end{align*} for the conditional expectation $\widehat{S}^*(f)$. It remains to show that $\widehat{S}^*$ is the input-output mapping of an algorithm $\widehat{{\mathcal{S}}}^* \in {\mathbb S}^{\mathrm{det}}$ with a cost bound as claimed. For $\ell\in {\mathbb N}$ let $\widetilde{\pi}_\ell\colon \{0,1\}^\ell\to\Omega$ be given by \begin{align*} \widetilde{\pi}_\ell(\omega) =(\omega,0,0,\dots). \end{align*} Since ${\mathfrak{c}} \geq 1$, we have $n(\omega,f) \leq 2k$ for $\omega \in A_f$. Hereby it follows that \begin{align*} 1_{A_f} =1_{A_f} \circ \widetilde{\pi}_{2k}\circ \pi_{2k} \end{align*} and \begin{align*} \widehat{S}(\cdot,f) \cdot 1_{A_f} = \widehat{S}(\cdot,f) \circ \widetilde{\pi}_{2k}\circ \pi_{2k} \cdot 1_{A_f} = \bigl(\widehat{S}(\cdot,f) \cdot 1_{A_f} \bigr) \circ \widetilde{\pi}_{2k}\circ \pi_{2k}. \end{align*} Furthermore, $\pi_{2k}$ is uniformly distributed on $\{0,1\}^{2k}$. Hence we get \begin{align*} \widehat{S}^*(f) =\frac{1}{|B_f|} \cdot \sum_{\omega\in \{0,1\}^{2k}} \widehat{S}(\widetilde{\pi}_{2k}(\omega),f)\cdot 1_{B_f}(\omega), \end{align*} where \begin{align*} B_f = \{\omega\in \{0,1\}^{2k}\colon \widetilde{\pi}_{2k}(\omega)\in A_f\}. \end{align*} For every $\omega\in \{0,1\}^{2k}$ and every $f \in F$ the information cost of simultaneously computing $1_{B_f}(\omega)$ and $\widehat{S}(\widetilde{\pi}_{2k}(\omega),f)\cdot 1_{B_f}(\omega)$ is bounded by $2k$. We conclude that there exists an algorithm $\widehat{{\mathcal{S}}}^* \in {\mathbb S}^{\mathrm{det}}$ with input-output mapping $\widehat{S}^*$ and $\operatorname{cost}_{\mathfrak{c}}(\widehat{{\mathcal{S}}}^*) \leq 2k \cdot 4^{k}$. \end{proof} \begin{thm}\label{t22} There exist universal constants $c_1,c_2 > 0$ such that \[ c_1 \cdot \ln \left(\operatorname{comp}^{\mathrm{det}}_{\mathfrak{c}} (2 \varepsilon)\right) - c_2 \leq \operatorname{comp}^{\mathrm{bit}}_{\mathfrak{c}} (\varepsilon) \] for every $\varepsilon>0$ with $\operatorname{comp}^{\mathrm{det}}_{\mathfrak{c}} (2 \varepsilon)<\infty$. Furthermore, $\operatorname{comp}^{\mathrm{bit}}_{\mathfrak{c}} (\varepsilon)=\infty$ if $\operatorname{comp}^{\mathrm{det}}_{\mathfrak{c}} (2 \varepsilon)=\infty$. \end{thm} \begin{proof} Let $\widehat{{\mathcal{S}}} \in {\mathbb S}^{\mathrm{bit}}$ with ${\mathrm{e}}(\widehat{{\mathcal{S}}}) \leq \varepsilon$ and $\operatorname{cost}_{\mathfrak{c}}(\widehat{{\mathcal{S}}}) < \infty$. Choose $\widehat{{\mathcal{S}}}^* \in {\mathbb S}^{\mathrm{det}}$ according to Lemma~\ref{l22}, and put $z = \operatorname{cost}_{\mathfrak{c}}(\widehat{{\mathcal{S}}}) + 1$. We obtain \[ \operatorname{comp}^{\mathrm{det}}_{\mathfrak{c}}(2 \varepsilon) \leq \operatorname{cost}_{\mathfrak{c}}(\widehat{{\mathcal{S}}}^*) \leq 2 z \cdot 4^z \leq 2 \cdot \exp( (1+ \ln (4)) \cdot z), \] which yields the lower bound for $\operatorname{cost}_{\mathfrak{c}}(\widehat{{\mathcal{S}}})$ as claimed. \end{proof} In many cases the lower bound from Theorem~\ref{t22} is far from sharp, see, e.g., \citet{MR2076605} for finite-dimensional quadrature problems. The lower bound is useful, however, for the one-dimensional case studied in Example~\ref{ex1}, where we do not have any regularity, as well as for the quadrature problem for SDEs. \begin{rem} Suppose that ${\mathfrak{X}}$ is a Banach space, $F=\operatorname{Lip}_1$, and $S$ is defined by integration with respect to a Borel probability measure $\mu$ on ${\mathfrak{X}}$. It is well known that $\operatorname{comp}^{\mathrm{det}}_{\mathfrak{c}}$ is determined by the quantization numbers of $\mu$ of order one, if ${\mathfrak{c}}=1$, see, e.g., \citet{CDMGR09}. This relation is exploited in the proof of Theorem~\ref{t23} below. \end{rem} We present a computational problem that is trivial when random numbers may be used, but unsolvable if only random bits are available. \begin{exmp}\label{ex1} Let ${\mathfrak{X}} = [0,1]$, let $F$ denote the class of all functions $f \colon [0,1] \to {\mathbb R}$ that are constant $\lambda$-a.e., and let \[ S(f) = \int_{[0,1]} f\,\mathrm d \lambda \] for $f \in F$. Consider ${\mathfrak{c}}=1$, which is most natural in the present setting, and let $\varepsilon > 0$. Obviously $\operatorname{comp}^{\mathrm{det}}_{\mathfrak{c}}(\varepsilon) = \infty$, so that Theorem \ref{t22} yields \[ \operatorname{comp}^{\mathrm{bit}}_{\mathfrak{c}}(\varepsilon) = \infty. \] On the other hand, $S(f) = f(\omega)$ for $\lambda$-a.e. $\omega \in [0,1]$, and therefore \[ \operatorname{comp}^{\mathrm{ran}}_{\mathfrak{c}}(\varepsilon) = 1. \] The same phenomenon is present for Monte Carlo algorithms that only have access to any fixed set $\mathcal{Q}$ of probability distributions: For any such $\mathcal{Q}$ there exists a computational problem that is trivial for the class ${\mathbb S}^{\mathrm{ran}}$, but is unsolvable by means of Monte Carlo algorithms with generators only for the distributions from $\mathcal{Q}$. See \citet[Thm.~3.1]{H18}. \end{exmp} \subsection{A Lower Bound for Quadrature of SDEs}\label{s53} We return to the quadrature problem for SDEs, see Section~\ref{seccomp}. Hence we have \[ {\mathfrak{X}} = C([0,1],{\mathbb R}^r) \] and \[ F = \operatorname{Lip}_1, \] and $S$ is given by \eqref{g20}. The function ${\mathfrak{c}}$ is given as follows. For $\ell \in {\mathbb N}_0$ let ${\mathfrak{X}}_\ell$ denote the set of all piecewise linear functions $x \in {\mathfrak{X}}$ with breakpoints $k/2^\ell$ for $k=0,\dots,2^\ell$, so that the spaces ${\mathfrak{X}}_\ell$ form an increasing sequence of finite-dimensional subspaces of ${\mathfrak{X}}$, whose union is dense in ${\mathfrak{X}}$. Obviously, $\dim({\mathfrak{X}}_\ell) = 2^\ell+1$, and ${\mathfrak{c}}$ is defined by \begin{equation}\label{g23} {\mathfrak{c}}(x) = \inf \{ \dim({\mathfrak{X}}_\ell) \colon x \in {\mathfrak{X}}_\ell\} \end{equation} for $x \in {\mathfrak{X}}$. Compared to Sections~\ref{seccomp}--\ref{sec5}, we impose slightly stronger smoothness assumption as well as a non-degeneracy assumption on the diffusion coefficient $b$ of the SDE, which in particular exclude pathological cases yielding a deterministic solution of the SDE. \begin{thm}\label{t23} Assume that $r=d$ and that \begin{itemize} \item $b:{\mathbb R}^r\to {\mathbb R}^{r\times r}$ has bounded first and second order partial derivatives and is of class $C^\infty$ in some neighborhood of $x_0$, \item $\det b(x_0)\not=0$, \end{itemize} in addition to the Lipschitz continuity of $a:{\mathbb R}^r\to {\mathbb R}^r$. Then there exist constants $c,\varepsilon_0>0$ such that \[ \operatorname{comp}^{\mathrm{bit}}_{\mathfrak{c}}(\varepsilon) \geq c \cdot \varepsilon^{-2} \] for every $\varepsilon \in {]0,\varepsilon_0]}$. \end{thm} \begin{proof} According to \citet[Thm.~1, Prop.~3]{CDMGR09} there exist constants $c,\varepsilon_0>0$ such that $\operatorname{comp}^{\mathrm{det}}_1(\varepsilon) \geq \exp(c \cdot \varepsilon^{-2})$ for every $\varepsilon \in {]0,\varepsilon_0]}$. Apply Theorem~\ref{t22}. \end{proof} We combine Theorems~\ref{theo3} and \ref{t23}. \begin{cor}\label{c1} Under the assumptions from Theorem \ref{t23} the following holds true: There exist constants $c_1,c_2,\varepsilon_0 >0$ such that \[ c_1 \cdot \varepsilon^{-2} \leq \operatorname{comp}^{\mathrm{bit}}_{\mathfrak{c}}(\varepsilon) \leq c_2 \cdot \varepsilon^{-2} \cdot \bigl(\ln(\varepsilon^{-1})\bigr)^3 \] for every $\varepsilon \in {]0,\varepsilon_0]}$, and the random bit multilevel Euler algorithm $A_\varepsilon^\mathrm{Bbit}$ that achieves the upper bound is almost optimal. \end{cor} We stress that the lower bounds from Theorem \ref{t23} and from Corollary \ref{c1} hold even for ${\mathfrak{c}}=1$, i.e., in the most generous cost model, where every $f \in \operatorname{Lip}_1$ may be evaluated at any point $x \in C([0,1],{\mathbb R}^r)$ at unit cost. The key to prove the lower bound is the number of random bits together with the number of function evaluations being used by any algorithm $\widehat{{\mathcal{S}}} \in {\mathbb S}^{\mathrm{bit}}$. Due to \citet[Thm.~11]{CDMGR09} we have the following lower bound for the class ${\mathbb S}^{\mathrm{ran}}$ under the assumptions from Theorem \ref{t23}: There exist constants $c_1,\varepsilon_0 >0$ such that \[ \operatorname{comp}^{\mathrm{ran}}_{\mathfrak{c}}(\varepsilon) \geq c_1 \cdot \varepsilon^{-2} \] for every $\varepsilon \in {]0,\varepsilon_0]}$. Obviously the latter estimate together with \eqref{g77} yields a second proof of Theorem~\ref{t23}. We stress that this lower bound is no longer valid for ${\mathfrak{c}}=1$, i.e., it does not suffice to only consider the number of function evaluations being used by any algorithm $\widehat{{\mathcal{S}}} \in {\mathbb S}^{\mathrm{ran}}$. The lower bound is valid, however, for every ${\mathfrak{c}}$ according to \eqref{g23} based on any increasing sequence of finite-dimensional subspaces ${\mathfrak{X}}_\ell \subset {\mathfrak{X}}$. While the asymptotic behavior of $\operatorname{comp}^{\mathrm{bit}}_{\mathfrak{c}}(\varepsilon)$ and $\operatorname{comp}^{\mathrm{ran}}_{\mathfrak{c}}(\varepsilon)$ for $\varepsilon \to 0$ is not known exactly, their ratio is bounded by a multiple of $(\ln(\varepsilon^{-1}))^3$. In particular, we do not know whether random bits are as powerful as random numbers for the quadrature problem under investigation, but random bits are at least almost as powerful as random numbers. Note that $\operatorname{comp}^{\mathrm{bit}}_{\mathfrak{c}}(\varepsilon)$ is dramatically smaller than $\operatorname{comp}^{\mathrm{det}}_1(\varepsilon)$.
\section{Introduction} \renewcommand{\thesection}{\arabic{section}} \renewcommand{\theequation}{\thesection.\arabic{equation}} \setcounter{equation}{0} \label{intro} Let $M$ be an $n$-dimensional compact Riemannian manifold with boundary and denote by $\overline{\Delta}$ and $\Delta$ the Laplace-Beltrami operators on $M$ and $\partial M$, respectively. Assume that $\beta$ is a real number and consider the eigenvalue problem with Wentzell boundary conditions \be\label{int1}\left\{\begin{array}{l} \ov{\Delta} u =0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\rm in \ }\ M,\\ -\beta\Delta u+\pa_{\nu} u= \laa u\ \ \ \quad~ {\rm on \ } \pa M, \end{array}\right. \en where $\pa_{\nu}$ denotes the outward unit normal derivative. When $M$ is a bounded domain in a Euclidean space, the above problem has been studied in \cite{DKL,G}. Some estimates for the eigenvalues of the problem (\ref{int1}) have been obtained recently (see, e.g., \cite{DWX,WX3}), when $M$ is a Riemannian manifold. Note that when $\beta=0$, (\ref{int1}) becomes the second order Steklov eigenvalue problem \be \label{int2}\left\{\begin{array}{l} \ov{\Delta} u =0 \ \ \ \ \ \ ~ {\rm in \ \ } M,\\ \pa_{\nu} u= p u \ \ ~~ {\rm on \ \ } \pa M, \end{array}\right. \en which has a discrete spectrum consisting in a sequence \be \no p_0=0<p_1\leq p_2\leq\cdots \rightarrow +\infty.\en For the Steklov eigenvalue problem, many interesting results have been obtained and one can find some of them - see, e.g., \cite{ceg,E1,E2,FS,HPS,kk, K,ST,WX1,WX2, yy} and the references therein. When $\beta\geq 0$, the spectrum of the Laplacian with Wentzell condition consists in an increasing countable sequence of eigenvalues \be \no\laa_{0, \beta}=0<\laa_{1, \beta}\leq\laa_{2, \beta}\leq\cdots\rightarrow +\infty, \en with corresponding real orthonormal (in $L^2(\pa M)$ sense) eigenfunctions $u_0, u_1, u_2,\cdots.$ We adopt the convention that each eigenvalue is repeated according to its multiplicity. Consider the Hilbert space \be H(M)=\{ u\in H^1(M), {\rm Tr}_{\pa M}(u)\in H^1(\pa M) \}, \en where ${\rm Tr}_{\pa M}$ is the trace operator. We define on $H(M)$ the two bilinear forms \be A_{\beta}(u, v)=\int_{M}\ov{\nabla}u\cdot\ov{\nabla}v +\beta\int_{\pa M} \na u\cdot\na v, \ B(u, v)=\int_{\pa M}uv, \en where, as before, $\ov{\nabla}$ and $\na$ are the gradient operators on $M$ and $\pa M$, respectively. Since we assume that $\beta$ is nonnegative, the two bilinear forms are positive and the variational characterization for the $k$-th eigenvalue is \be \label{vc}\laa_{k, \beta}=\min\left\{\frac{A_{\beta}(u, u)}{B(u, u)}, u\in H(M), u\neq 0,\ \int_{\pa M} u u_i=0, i=0,\cdots,k-1\right\}. \en When $k=1$, the minimum is taken over the functions orthogonal to the eigenfunctions associated to $\laa_{0, \beta}= 0,$ i.e., constant functions. If $M$ is an $n$-dimensional Euclidean ball of radius $R$, then (cf. \cite{DKL}) $$\laa_{1, \beta}=\laa_{2, \beta}=\cdots \laa_{n, \beta}=\fr{(n-1)\beta + R}{R^2}$$ and the corresponding eigenfunctions are the coordinate functions $x_i, i=1,\cdots,n.$ For the Steklofv problem (\ref{int2}), Brock \cite{B} proved the following well-known result: \begin{theorem} \label{th0} Let $\Omega$ be a bounded domain with smooth boundary in a Euclidean space $\R^n$ and denote by $p_1(\om),\cdots p_n(\om)$ the first $n$ non-zero Steklov eigenvalues of $\om$. Then \be\label{th0.0} \sum_{i=1}^n\fr 1{p_i(\om)} \geq n\left(\fr{|\om|}{\omega_{n}}\right)^{\fr 1n}, \en where $\omega_n$ and $|\om|$ denote the volume of the unit ball in $\R^n$ and of $\om$, respectively. \end{theorem} The proof of Brock's theorem is a nice application of an inequality for sums of reciprocals of eigenvalues by Hile-Xu in \cite{hx} and a weighted isoperimetric inequality obtained by Betta-Brock-Mercaldo-Posterar in \cite{bb}. Brock's method has been used by Dambrine-Kateb-Lamboley in \cite{DKL} to obtain an estimate for eigenvalues of the Wentzell-Laplace eigenvalue problem (\ref{int1}). In the first part of this paper, we use the variational characterization (\ref{vc}) to prove the following isoperimetric bound. \begin{theorem} \label{th1} Let $\beta\geq 0$ and $\Omega$ be a bounded domain with smooth boundary $\p \Omega$ in $\R^n$. Let $|\p\Omega|$ be the area of $\p\Omega$ and denote by $\laa_{1, \beta}\leq\laa_{2, \beta}\leq\cdots\leq \laa_{n, \beta}$ the first $n$ non-zero eigenvalues of the following problem with the Wentzell boundary condition \be\label{th1.1}\left\{\begin{array}{l} \ov{\Delta} u =0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\rm in \ }\ \om,\\ -\beta\Delta u+\pa_{\nu} u= \laa u\ \ \ \ \quad ~~ {\rm on \ } \pa \om, \end{array}\right. \en Then we have \begin{small} \be\label{th1.2} \sum_{i=1}^n\frac{|\Omega|}{\lambda_{i,\b}}+\sum_{i=1}^{n-1}\frac{\b|\p\Omega|}{\lambda_{i,\b}} \geq n\omega_n\left(\fr{|\om|}{\omega_{n}}\right)^{1+\fr 1n}\left[1+\fr{(n+1)(2^{1/n}-1)}{4n}\left(\fr{|\om\Delta B|}{|B|}\right)^2\right], \en \end{small} where $B$ is the ball of volume $|\om|$ and with the same center of mass than $\pa \om$ and $\om\Delta B$ is the symmetric difference of $\om$ and $B$. Equality holds in (\ref{th1.2}) if and only if $\om$ is a ball. \end{theorem} \begin{remark}{\rm Taking $\beta=0$ in Theorem \ref{th1}, one gets Theorem \ref{th0}.} \end{remark} \begin{theorem}\label{th2} Let $Q^n$ be a Hadamard manifold and let $\om$ be a bounded domain with smooth boundary in $Q^n$. Let $\beta\geq 0$ and $\rho$ be a continuous positive function on $\pa\om$. Then the first $n$ non-zero eigenvalues of the problem \be\label{th2.1}\left\{\begin{array}{l} \ov{\Delta} u =0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\rm in \ }\ \om,\\ -\beta\Delta u+\pa_{\nu} u= \laa \rho u\ \ \ \ \qquad {\rm on \ } \pa \om, \end{array}\right. \en satisfy \be\label{th2.2} \sum_{i=1}^n\frac{1}{\lambda_{i,\b}}+\sum_{i=1}^{n-1}\frac{\b|\p\Omega|}{\lambda_{i,\b}|\om|} \geq\fr{n^2|\om|}{\int_{\pa\om} \rho^{-1}}. \en Moreover, when $\rho=\rho_0$ is constant, equality holds in (\ref{th2.2}) if and only if $\om$ is isometric to an $n$-dimensional Euclidean ball. \end{theorem} In the second part of the present paper, we consider eigenvalues of the Lapacian acting on functions on closed hypersurfaces in a Euclidean space or a Hardamard manifold. \begin{theorem} \label{th3} Let $M$ be a connected closed hypersurface in $\R^{n}(n\geq 3)$. (i) The first $(n-1)$ non-zero eigenvalues of the Laplacian of $M$ satisfy \begin{eqnarray}\label{th3.1} \sum_{j=1}^{n-1}\la_j^{\frac{1}{2}}\leq (n-1)^{\frac{3}{2}}\left\{\fr{\int_M |{\H}|^2}{A(M)}\right\}^\frac{1}{2}, \end{eqnarray} where ${\H}$ denotes the mean curvature vector of $M$ in $\R^{n}$ and $A(M)$ is the area of $M$. The equality holds in (\ref{th3.1}) if and only if $M$ is a hypersphere. (ii) If $M$ is embedded and bounds a region $\om$, then \be\label{the3.2} \sum_{i=1}^{n-1} \fr{1}{\la_i}\geq\fr{n\omega_n}{A(M)}\left(\fr{|\om|}{\omega_{n}}\right)^{1+\fr 1n}\left[1+\fr{(n+1)\left(2^{1/n}-1\right)}{4n}\left(\fr{|\om\Delta B|}{|B|}\right)^2\right], \en where $B$ is the ball of volume $|\om|$ and with the same center of mass than $M$. Equality holds in (\ref{the3.2}) if and only if $M$ is a hypersphere. \end{theorem} \begin{theorem} \label{th4} Let $Q^n(n\geq 3)$ be a Hadamard manifold. Let $M$ be a connected closed hypersurface embedded in $Q^n$ and $\om$ be the region bounded by $M$. Then the first $(n-1)$ non-zero eigenvalues of the Laplacian of $M$ satisfy\be\label{the4.1} \sum_{i=1}^{n-1} \fr{1}{\la_i}\geq\fr{n^2|\om|^2}{A(M)^2}. \en Equality holds in (\ref{the4.1}) if and only if $\om$ is isometric to an $n$-dimensional Euclidean ball. \end{theorem} Now we come to a Steklov problem of fourth order. Let $\tau$ be a positive constant and $\ov{\nabla}^2$ be the Hessian operator on $\R^{n}$. Let $\om$ be a bounded domain in $\R^{n}$ and consider the following Steklov problem of fourth order \begin{eqnarray}\label{th6.0} \left\{\begin{array}{ccc} \ov{\D}^2 u-\tau \ov{\D} u =0,&&~\mbox{in} ~~ \om, \\[2mm] \frac{\p^2u}{\p\nu^2}=0, &&~~\mbox{on}~~\partial \om,\\[2mm] \tau\frac{\p u}{\p \nu}-\mathrm{div}_{\p M}\(\ov{\nabla}^2 u(\nu)\)-\frac{\p\ov{\D} u}{\p\nu}=\lambda u, &&~~\mbox{on}~~\partial \om. \end{array}\right. \end{eqnarray} This problem has a discrete spectrum which can be listed as $$0=\lambda_{0,\tau}<\lambda_{1,\tau}\leq\lambda_{2,\tau}\leq\cdots\leq\lambda_{k,\tau}\leq\cdots.$$ The eigenvalue $0$ is simple and the corresponding eigenfunctions are constants. The $k(\geq 1)$-th eigenvalue $\lambda_{k,\tau}$ has the following variational characterization \begin{small} \begin{eqnarray}\label{th6.1} \lambda_{k,\tau}=\mathrm{min}\left\{\frac{\int_{\om}\(|\ov{\na}^2u|^2+\tau|\na u|^2\)}{\int_{\pa\om} u^2}, u\in H^2(\om), u\neq0 \Bigg|\int_{\pa\om} u u_j=0, j=0,\cdots,k-1\right\}. \end{eqnarray} \end{small} In \cite{bp}, an isoperimetric inequality for the sums of the reciprocals of the first $n$ non-zero eigenvalues of the problem (\ref{th6.0}) was proved. In this paper, we get the following sharp upper bound. \begin{theorem} \label{th6} Let $\Omega$ be a bounded domain with smooth boundary $\p \Omega$ in $\R^n$. Denoting by $\lambda_{i,\tau}$ the $i$-th eigenvalue of the (\ref{th6.0}), we have \begin{eqnarray}\label{th6.2} \frac{1}{n-1}\sum_{j=1}^{n-1}\lambda_{j,\tau}^{\frac{1}{2}}\leq \frac{\left\{ n\tau |\Omega|\inpo |\H|^2\right\}^\frac{1}{2}}{|\p \Omega|}, \end{eqnarray} where $\H$ is the mean curvature vector of $\p \Omega$ in $\R^n$. Equality holds in (\ref{th6.2}) if and only if $\Omega$ is a ball. \end{theorem} \section{Proofs of Theorems \ref{th1} and \ref{th2}} \renewcommand{\thesection}{\arabic{section}} \renewcommand{\theequation}{\thesection.\arabic{equation}} \setcounter{equation}{0} \label{intro} In this section, we will give the proofs of Theorems \ref{th1} and \ref{th2}. First, we recall the following lemma from \cite{bpr}. \begin{lemma}\label{le1} Let $\om$ be a bounded, open Lipschitz set in $\R^n$. Then \be\label{sec2.1} \int_{\pa\om} |x|^2 \geq R^2|\pa B_R|\(1+\fr{(n+1)(2^{1/n}-1)}{4n}\left(\fr{|\om\Delta B_R|}{|B_R|}\right)^2\), \en where $B_R$ is the ball centered at the origin such that $|B_R|=|\om|$. \end{lemma} $\\${\it Proof of Theorem \ref{th1}.} Let $u_0, u_1, u_2,\cdots$ be the orthonormal (in $L^2(\pa \om)$ sense) eigenfunctions corresponding to the eigenvalues $0=\lambda_{0,\b}<\lambda_{1,\b}\leq \lambda_{2,\b}\leq \cdots, $ of the problem (\ref{th1.1}), that is, \be\label{pth1.1}\left\{\begin{array}{l} \ov{\Delta} u_i =0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\rm in \ }\ \om,\\ -\beta\Delta u+\pa_{\nu} u_i= \laa_i u_i\ \ \ \ \quad {\rm on \ } \pa \om,\\ \int_{\pa \om} u_iu_j=\delta_{ij}. \end{array}\right. \en The eigenvalues $\lambda_{i,\b}, i=1, 2,\cdots,$ are characterized by \be \label{pth1.2} \lambda_{i,\b}=\underset{\underset{u\perp{\rm span}\{u_0,\cdots, u_{i-1}\}}{u\in H(\om)\setminus\{0\}}}{\min} \fr{\int_{\om}|\ov{\na}u|^2 +\beta\int_{\pa\om} |\na u|^2}{\int_{\pa\om} u^2}.\en We need to choose nice trial functions $\phi_i$ for each of the eigenfunctions $u_i$ and insure that these are orthogonal to the preceding eigenfunctions $u_0,\cdots, u_{i-1}$. For the $n$ trial functions $\phi_1, \phi_2, \cdots, \phi_n,$ we simply choose the $n$ coordinate functions: \be \phi_i=x_i, \ \ {\rm for}\ \ i=1,\cdots, n, \en but before we can use these we need to make adjustments so that $\phi_i \perp{\rm span}\{u_0,\cdots, u_{i-1}\}$ in $L^2(\pa\om)$. Simply by translating the origin appropriately we can assume that \be \int_{\pa\om} x_i=0, \ i=1,\cdots,n, \en that is, $x_i\perp u_0$ (which is actually just the constant function $1/\sqrt{|\pa\om|}$). Nextly we show that a suitable rotation of axes can be made so as to insure that \be\label{pth1.} \int_{\pa\om}\phi_j u_i=\int_{\pa\om} x_j u_i=0, \en for $j=2,3,\cdots, n$ and $i=1,\cdots,j-1$. To see this, we define an $n \times n$ matrix $Q=\(q_{ji}\),$ where $q_{ji}=\int_{\p\om} x_j u_i$, for $i,j=1,2,\cdots,n.$ Using the orthogonalization of Gram and Schmidt (QR-factorization theorem), we know that there exist an upper triangle matrix $T=(T_{ji})$ and an orthogonal matrix $U=(a_{ji})$ such that $T=UQ$, i.e., \begin{eqnarray*} T_{ji}=\sum_{\gamma=1}^n x_{jk}q_{ki}=\inpo \sum_{k=1}^n a_{jk}x_k u_i =0,\ \ 1\leq i<j\leq n. \end{eqnarray*} Letting $y_j=\sum_{k=1}^n a_{jk}x_k$, we get \begin{eqnarray}\label{c2} \inpo y_j u_i =\inpo \sum_{k=1}^n a_{jk}x_k u_i =0,\ \ 1\leq i<j\leq n. \end{eqnarray} Since $U$ is a orthogonal matrix, $y_1, y_2, \cdots, y_n$ are also coordinate functions on $\R^n$. Therefore, denoting these coordinate functions still by $x_1, x_2,\cdots, x_n$, we arrived at the the condition (\ref{pth1.}). It then follows (\ref{pth1.2}) that for each fixed $i=1,\cdots,n$, \begin{eqnarray}\label{d5} \lambda_{i,\b}\inpo x_i^2 \leq\ino |\ov{\n} x_i|^2 +\beta\inpo|\n x_i|^2= |\Omega|+\beta\inpo|\n x_i|^2, \end{eqnarray} with equality holding if and only if \be\label{pth}\beta\Delta x_i +\pa_{\nu} x_i = -\laa_{i, \beta} x_i, \ \ \ {\rm on}\ \ \ \pa\Om. \en Hence \begin{eqnarray}\label{pth1.3} \inpo x_i^2\leq\frac{|\Omega|}{\lambda_{i,\b}}+\frac{\beta}{\lambda_{i,\b}}\inpo|\n x_i|^{2}. \end{eqnarray} Observing \begin{eqnarray*} \sum_{i=1}^n|\n x_i|^2=n-1,\ |\n x_i|^2\leq1, \end{eqnarray*} we get \begin{eqnarray}\label{pth1.4} \nonumber\sum_{i=1}^n\frac{|\n x_i|^2}{\lambda_{i,\b}}&=&\sum_{i=1}^{n-1}\frac{|\n x_i|^2}{\lambda_{i,\b}}+\frac{|\n x_n|^2}{\lambda_{n,\b}} \\\nonumber&=&\sum_{i=1}^{n-1}\frac{|\n x_i|^2}{\lambda_{i,\b}}+\frac{1}{\lambda_{n,\b}}\sum_{i=1}^{n-1}\(1-|\n x_i|^2\) \\\nonumber&\leq&\sum_{i=1}^{n-1}\frac{|\n x_i|^2}{\lambda_{i,\b}}+\sum_{i=1}^{n-1}\frac{1}{\lambda_{i,\b}}\(1-|\n x_i|^2\) \\&=&\sum_{i=1}^{n-1}\frac{1}{\lambda_{i,\b}}. \end{eqnarray} Combining (\ref{pth1.3}) and (\ref{pth1.4}), we have \begin{eqnarray}\label{c8} \sum_{i=1}^n\inpo x_i^2\leq\sum_{i=1}^n\frac{|\Omega|}{\lambda_{i,\b}}+\sum_{i=1}^{n-1}\frac{\b|\p\Omega|}{\lambda_{i,\b}}. \end{eqnarray} Substituting (\ref{le1}) into (\ref{c8}), one gets (\ref{th1.2}). If the equality holds in (\ref{th1.2}), then the inequality (\ref{pth1.4}) must take equality sign and (\ref{pth}) holds. It is easy to see from the equality case of (\ref{pth1.4}) at any point of $\pa\om$ that \be\lambda_{1,\b}=\lambda_{2,\b}\cdots=\lambda_{n,\b}.\en It then follows that the position vector $x=(x_1,\cdots, x_n)$ when restricted on $\pa\Om$ satisfies \be\label{p1} \Delta x=(\Delta x_1,\cdots, \Delta x_n) = -\fr{1}{\beta}\nu-\fr{\laa_{1, \beta}}{\beta}(x_1,\cdots, x_n). \en On the other hand, it is well known that \be\label{p2} \Delta x =(n-1){\mathbf H}, \en where ${\mathbf H}$ is the mean curvature vector of $\pa \Om$ in ${\R}^n$. Combining (\ref{p1}) and (\ref{p2}), we have \be\label{p3} x=-\fr 1{\laa_{1,\beta}}\nu-\fr{(n-1)\beta}{\laa_{1,\beta}}{\mathbf H}, \ \ \ \ {\rm on\ \ \ }\pa \Om. \en Consider the function $g = |x|^2 : M\rightarrow {\R}$. It is easy to see from (\ref{p3}) that \be\no Z g =2\langle Z, x\rangle = 0, \ \ \ \forall Z\in {\mathfrak{X}}(\pa\Om). \en Thus $g$ is a constant function and so $\pa \Om$ is a hypersphere. Theorem \ref{th1} follows. \hfill $\Box$ $\\${\it Proof of Theorem \ref{th2}.} Let $\{u_i\}_{i=0}^{+\infty}$ be an orthonormal set of eigenfunctions corresponding to the eigenvalues $\{\laa_i\}_{i=0}^{+\infty}$ of the problem (\ref{th2.1}), that is, \be\label{pth2.1}\left\{\begin{array}{l} \ov{\Delta} u_i =0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \quad \ {\rm in \ }\ \om,\\ -\beta\Delta u+\pa_{\nu} u_i= \laa_{i, \beta} u_i\ \ \ \ {\rm on \ } \pa \om,\\ \int_{\pa \om} \rho u_iu_j=\delta_{ij}. \end{array}\right. \en We have \be \label{pth2.2} \lambda_{i,\b}=\underset{\underset{\int_{\pa \om} \rho uu_l=0, l=0, 1,...,i-1}{u\in H(\om)\setminus\{0\}}}{\min} \fr{\int_{\om}|\ov{\na}u|^2 +\beta\int_{\pa\om} |\na u|^2}{\int_{\pa\om} \rho u^2}.\en The idea is to use globally defined coordinate functions suitably chosen on $Q^n$ as trial functions for the first $n$ non-zero eigenvalues of the problem (\ref{th2.1}). To do this, let us denote by $\langle, \rangle$ the Riemannian metric on $Q^n$. For any $p\in Q^n$, let ${\rm exp}_p$ and $UQ_p^n$ be the exponential map and unit tangent space of $Q^n$ at $p$, respectively. Let $\{e_1,\cdots, e_n\}$ be an orthonormal basis of $T_pQ^n$, the tangent space of $Q^n$ at $p$, and $y : M\ri \R^n$ be the Riemannian normal coordinates on $Q^n$ determined by $(p; e_1,\cdots,e_n)$. It follows from the Cartan-Hadamard theorem \cite{car} that $y$ is well-defined on all of $Q^n$ and is a diffeomorphism of $Q^n$ onto $\R^n$. We can choose $p$ and $\{e_1,\cdots, e_n\}$ so that the respective coordinate functions $ y^i : M\ri \R, i=1,\cdots,n,$ of $y : Q^n \ri \R^n$ satisfy \be \label{pth2.3}\int_{\pa \om} \rho y_i =0. \en In fact, parallel translate the frame $\{e_1,\cdots, e_n\}$ along every geodesic emanating from $p$ and thereby obtain a differentiable orthonormal frame field $\{E_1, \cdots, E_n\}$ on $Q^n$. Let $y^q : M\ri \mathbb{R}^n$ denote the Riemannian normal coordinates of $Q^n$ determined by $\{E_1, \cdots, E_n\}$ at $q$, and let $y^q_i, i=1,\cdots, n,$ be the coordinate functions of $y^q$. By definition, $ y^q_i : M\ri \mathbb{R}$ is given by $y_i^q(z)=\langle {\rm exp}_q^{-1}(z), E_i(q)\ra$, $i=1,\cdots,n.$ Then \be Y(q)=\sum_{i=1}^n \left\{\int_{\pa\om}\rho y^q_i \right\} E_i(q) \en is a continuous vector field on $Q^n$. If we restrict $Y$ to a geodesic ball $B$ containing $\overline{\om}$ then the convexity of $B$ implies that on the boundary of $B$, $Y$ points into $B$. The Brouwer fixed point theorem then implies that $Y$ has a zero. So we may assume that $p$ and $\{e_1,\cdots, e_n\}$ actually satisfy (\ref{pth2.3}). For any $w\in UQ^n_p$, let $\theta_w$ be the function on $Q^n$ defined by $\theta_w(z)=\langle {\rm exp}_p^{-1}(z), w\ra $. Then (\ref{pth2.3}) is equivalent to say that for $i=1, \cdots, n,$ \be \int_{\pa\om} \rho\theta_{e_i} =0. \en Thus for any $\sigma\in UQ^{n}_p$, \be\label{pth2..} \int_{\pa\om} \rho\theta_{\sigma}=0. \en Next we show that there exists an orthonormal basis $\{\sigma_j\}_{j=1}^n$ of $T_pQ^n$ such that the coordinate functions $x_{\a}=\theta_{\sigma_{\alpha}}, \a=1,\cdots,n$ of the Riemannian normal coordinate system of $Q^{n}$ determined by $(p; \sigma_1,\cdots, \sigma_n)$ satisfy \be\label{pth2.5} \int_{\pa\om} \rho x_i u_j=0, \ \ {\rm for} \ \ i=2, 3,\cdots, n,\ {\rm and}\ j=1,\cdots, i-1.\en In fact, let us consider the $n\times n$ matrix $P=\(p_{\a\b}\),$ where $p_{\a\b}=\int_{\pa\om} \rho y_\a u_\b=\int_{\pa\om} \rho\theta_{e_{\alpha}} u_\b$, for $\a,\b=1,2,\cdots,n.$ Using the same discussion as in the proof of Theorem \ref{th1}, we can find an orthogonal matrix $U=(a_{\a\b})$ such that \begin{eqnarray*} \inpo \sum_{\gamma=1}^n a_{\a\gamma}\rho y_\gamma u_\b =0,\ \ 1\leq\b<\a\leq n. \end{eqnarray*} Setting $\sigma_\a=\sum_{\gamma=1}^n a_{\a\gamma}e_\gamma$, we know that $\{\sigma_j\}_{j=1}^n$ is an orthonormal basis of $T_{p}Q^{n}$ and that the condition (\ref{pth2.5}) is satisfied. Therefore, we have from (\ref{pth2.2}), (\ref{pth2..}) and (\ref{pth2.5}) that \be\label{pth2.7} \lambda_{i,\b}\int_{\pa\om} \rho x_i^2\leq \int_{\om}|\ov{\na}x_i|^2 +\beta\int_{\pa\om} |\na x_i|^2, \ i=1,\cdots,n. \en Let $\left\{\fr{\pa}{\pa x_k}, k=1,\cdots, n\right\}$ be the natural basis of the tangent spaces associated with the coordinate chart $x$ and let $g_{kl}= \langle\fr{\pa}{\pa x_k}, \fr{\pa}{\pa x_l}\rangle $, $k, l=1,\cdots, n$. Since $Q^n$ has non-positive sectional curvature, the Rauch comparison theorem \cite{car} implies that the eigenvalues of the matrix $(g_{kl})$ are all $\geq 1$. Thus the eigenvalues of $(g^{kl})=: (g_{kl})^{-1}$ are $\leq 1$ and so we have $g^{kk}\leq 1, \ k=1,\cdots, n$. Thus we have for $i=1,\cdots, n,$ \be\label{pth2.8}|\na x_i|^2\leq |\ov{\na} x_i|^2 = g^{ii} \leq 1. \en We claim that \be\label{pth2.9} \sum_{i=1}^n |\na x_i|^2 \leq n-1 \ \ {\rm on}\ \ \pa\om. \en In fact, for a fixed point $z\in \pa\om$, let $\{v_1,\cdots,v_{n-1}\}$ be an orthonormal basis of $T_z(\pa\om)$. From the fact that the eigenvalues of $(g_{ij})$ are all $\geq 1$, we conclude that \be \sum_{i=1}^n |\na x_i|^2&=&\sum_{i=1}^n \sum_{\alpha=1}^{n-1} (v_{\alpha}x_i)^2\\ \no &=& \sum_{\alpha=1}^{n-1}\sum_{i,j=1}^n (v_{\alpha}x_i) \delta_{ij}(v_{\alpha}x_j)\\ \no &\leq& \sum_{\alpha=1}^{n-1}\sum_{i,j=1}^n (v_{\alpha}x_i) g_{ij}(v_{\alpha}x_j)\\ \no &=& \sum_{\alpha=1}^{n-1} |v_{\alpha}|^2=n-1. \en Using (\ref{pth2.7})-(\ref{pth2.9}) and the same arguments as in the proof of Theorem \ref{th1}, we obtain \be\label{pth2.10} \int_{\pa\om} \rho r^2 = \int_{\pa\om} \rho \sum_{i=1}^n x_i^2\leq \sum_{i=1}^n\frac{|\om|}{\lambda_{i,\b}}+\sum_{i=1}^{n-1}\frac{\b|\p\Omega|}{\lambda_{i,\b}}, \en where $r = d(p, \cdot): \om\ri {\R}$ denotes the distance function from $p$. The Cauchy-Schwarz inequality implies that \be\label{pth2.11} \int_{\pa\om} \rho r^2 \geq\fr{(\int_{\pa \om} r )^2}{\int_{\pa\om} \rho^{-1}} \en with equality holding if and only if $r\rho=const.$ on $\pa\om$. From the Laplace comparison theorem (cf. \cite{sy}), we have \be\label{pth2.12} \D r^2 \geq 2n. \en Integrating (\ref{pth2.12}) on $\om$ and using the divergence theorem, we get \be\label{pth2.13} n|\om|\leq \int_{\pa \om} r\langle \na r, \nu\ra\leq \int_{\pa \om} r |\na r|=\int_{\pa \om} r. \en Combining (\ref{pth2.10}), (\ref{pth2.11}) and (\ref{pth2.13}), we get (\ref{th2.2}). Assume now that $\rho=\rho_0$ is constant and that the equality holds in (\ref{th2.2}). In this case, we have $r|_{\pa\om}=const.$ and so $\om$ is a geodesic ball with center $p$. Also, we have \be \Delta r^2|_{\om}= 2n. \en It then follows from the equality case in the Laplace comparison theorem \cite{sy} and the Cartan's theorem \cite{car} that $\om$ is isometric to an $n$-dimensional Euclidean ball. This completes the proof of Theorem \ref{th2}.\hfill $\Box$ \section{Proofs of Theorems \ref{th3}-\ref{th6}} \renewcommand{\thesection}{\arabic{section}} \renewcommand{\theequation}{\thesection.\arabic{equation}} \setcounter{equation}{0} \label{intro} In this section, we will give the proofs of Theorems \ref{th3}-\ref{th6}. $\\${\it Proof of Theorem \ref{th3}.} Let $\{u_i\}_{i=0}^{+\infty}$ be the orthonormal system of eigenfunctions corresponding to the eigenvalues \be\label{pth3.1} 0=\la_0<\la_1\leq \la_2\leq\cdots\ri\infty \en of the Laplacian of $M$, that is, \be\label{th3.2} \Delta u_i = -\la_i u_i, \quad \int_M u_iu_j =\delta_{ij}. \en We have $u_0=1/\sqrt{|M|}$ and for each $i=1,\cdots,$ \be \label{pth3.3} \la_i=\underset{u\neq 0, \int_M uu_j=0, j=0,\cdots i-1}{\min}\fr{\int_M |\na u|^2}{\int_M u^2}. \en Let $x_1, \cdots, x_{n}$ be the coordinate functions on $\R^{n}$. By using the same arguments as in the proof of Theorem \ref{th1}, we can assume that \begin{eqnarray*} \ino x_i u_j =0,\ i=1,\cdots,n;\ j=0,\cdots,i-1 \end{eqnarray*} and so we have \be\label{pth3.4} \la_i\int_M x_i^2\leq \int_M |\na x_i|^2, \ i=1,\cdots, n, \end{eqnarray} with equality holding if and only if \be\label{pth3.5} \D x_i= -\la_i x_i. \en Since \be\label{pth3.51} |\na x_i|^2\leq 1, \quad \sum_{i=1}^n |\na x_i|^2=n-1, \en we have\be \label{pth3.6} \sum_{i=1}^n \la_i^{\fr 12}|\na x_i|^2&=&\sum_{i=1}^{n-1} \la_i^{\fr 12}|\na x_i|^2+\la_n^{\fr 12}|\na x_n|^2\\ \no &=& \sum_{i=1}^{n-1} \la_i^{\fr 12}|\na x_i|^2+\la_n^{\fr 12}\sum_{i=1}^{n-1}(1-|\na x_i|^2) \\ \no &\geq & \sum_{i=1}^{n-1} \la_i^{\fr 12}|\na x_i|^2+\sum_{i=1}^{n-1}\la_i^{\fr 12}(1-|\na x_i|^2) \\ \no &=& \sum_{i=1}^{n-1}\la_i^{\fr 12}, \en which gives \be \label{pth3.6}\sum_{i=1}^n \la_i^{\fr 12}\int_M |\na x_i|^2 \geq A(M)\sum_{i=1}^{n-1}\la_i^{\fr 12}. \en For any positive constant $\delta$, we have from Schwarz inequality and (\ref{pth3.4}) that \be\label{pth3.7} \sum_{i=1}^n \la_i^{\fr 12}\int_M |\na x_i|^2 &=&\sum_{i=1}^n \la_i^{\fr 12}\int_M (-x_i \D x_i)\\ \no &\leq& \fr 12\sum_{i=1}^n\left\{\delta\la_i\int_M x_i^2 + \fr 1{\delta}\int_M (\D x_i)^2\right\}\\ \no &\leq& \fr 12\left\{ (n-1)\delta A(M)+ \fr 1{\delta}\int_M (n-1)^2 |{\bf H}|^2\right\}. \en Taking $$\delta =\left\{\fr{\int_M (n-1)|{\bf H}|^2}{A(M)}\right\}^{\fr 12}$$ in (\ref{pth3.7}) and using (\ref{pth3.6}), we get (\ref{th3.1}) with equality holding if and only if $M$ is a hypersphere. On the other hand, one can use (\ref{pth3.4}), (\ref{pth3.51}) and the same discussion as in the proof of Theorem \ref{th1} to obtain \be \sum_{i=1}^n \int_M x_i^2 \leq A(M)\sum_{i=1}^{n-1} \fr 1{\la_i}, \en which, combining with (\ref{sec2.1}) gives (\ref{th3.2}). Also, one can deduce as in the proof of the final part of Theorem \ref{th1} that equality holds in (\ref{th3.1}) if and only if $M$ is a sphere of $\R^{n}$. This completes the proof of Theorem \ref{th3}. \hfill $\Box$ $\\${\it Proof of Theorem \ref{th4}.} From the proof of Theorem \ref{th2}, we know that there exist a point $p\in Q^n$ and an orthonormal basis $\{e_i\}_{i=1}^n$ of $T_pQ^n$ such that the coordinate functions of the Riemannian normal coordinate system determined by $\{p; (e_1,\cdots, e_n)\}$ satisfy \be \label{pth4.1} \int_M x_i \phi_j =0, \ i=1,\cdots,n, \ j=0,\cdots, i-1, \en where $\{\phi_j\}_{j=0}^{+\infty}$ are orthonormal eigenfunctions corresponding to the eigenvalues \be 0=\la_0<\la_1\leq \la_2\leq \cdots \ri +\infty \en of the Laplacian of $M$. Thus we have \be \la_i\int_M x_i^2 \leq \int_M |\na x_i|^2, \ i=1,...,n. \en Using the same arguments as in the proof of Theorem \ref{th2}, we conclude \be\sum_{i=1}^{n-1} \fr 1{\la_i}\geq \fr{\int_M r^2}{A(M)} \geq \fr{n^2|\om|^2}{A(M)^2}, \en with equality holding if and only if $\om$ is isometric a ball in $\R^n$, where $r=d(p,\cdot): \om\ri \R$ is the distance function from the point $p$. The proof of Theorem \ref{th4} is finished.\hfill $\Box$ $\\$ {\it Proof of Theorem \ref{th6}.} Let $x=(x_1, \cdots, x_n)$ be the coordinate functions on $\R^n$. Since $\Omega$ is a bounded domain with smooth boundary $\p \Omega$ in $\R^n$, we can regard $\p \Omega$ as a closed hypersurface of $\R^n$ without boundary. Let $\D,\n$ be the Laplace operator and the gradient operator on $\p \om$, respectively. The position vector $x=(x_1, \cdots, x_n)$ when restricted on $\pa\Omega$ satisfies \begin{eqnarray}\label{c1} \sum_{\a=1}^n \(\D x_\a\)^2=(n-1)^2|\H|^2, \end{eqnarray} where $|\H|$ is the mean curvature of $\p \Omega$ in $\R^n$. Let $u_i$ be the eigenfunction corresponding to eigenvalue $\lambda_{i,\tau}$ such that $\{u_i\}_ {i=0}^{\infty}$ becomes an orthonormal basis of $L^2(\partial \Omega)$, that is, \begin{eqnarray*} \left\{\begin{array}{ccc} \L^2 u_i-\tau\L u_i =0,&&~\mbox{in}~~\Omega, \\[2mm] \frac{\p^2u_i}{\p\nu^2}=0, &&~~\mbox{on}~~\partial \Omega,\\[2mm] \tau\frac{\p u_i}{\p \nu}-\mathrm{div}_{\p \Omega}\(\bar{\nabla}^2 u_i(\nu)\)-\frac{\p\D u_i}{\p\nu}=-\lambda_{i,\tau} u_i,&&~~\mbox{on}~~\partial \Omega,\\[2mm] \inpo u_i u_j =\delta_{ij}. \end{array}\right. \end{eqnarray*} Observe that $u_0= 1/\sqrt{|\pa \om|}$. We can assume as before that \be \int_{\pa\om} x_i u_j=0, \ i=1,\cdots, n, \ j=0,\cdots, i-1.\en It follows from the variational characterization (\ref{th6.1}) that \begin{eqnarray}\label{c4} \lambda_{i,\tau}\int_{\pa\om} x_i^2\leq \int_{\om} \(|\ov{\na}^2x_i|^2 +\tau|\ov{\na} x_i|^2\) = \tau |\om|. \end{eqnarray} Thus we have \begin{eqnarray}\label{c7} \sum_{i=1}^n\lambda_{i,\tau}\int_{\pa\om} x_i^2\leq n\tau|\om|, \end{eqnarray} which implies that \begin{eqnarray}\label{pth5.4} \sum_{i=1}^n\lambda_{i,\tau}^{\fr 12}\int_{\pa\om}|\na x_i|^2 &=&\sum_{i=1}^n\lambda_{i,\tau}\int_{\pa\om}(-x_i \D x_i)\\ \no &\leq& \fr 12\sum_{i=1}^n\left\{\delta \lambda_{i,\tau}\int_{\pa\om} x_i^2 +\fr 1{\delta} \int_{\pa\om}(\D x_i)^2\right\}\\ \no &\leq& \fr 12 \left\{ \delta n\tau|\om|+ \fr 1{\delta} \int_{\pa\om}(n-1)^2|{\bf H}|^2\right\} \en for any $\delta >0.$ From the proof of Theorem \ref{th3}, we know that \be\label{pth5.5} \sum_{i=1}^n \la_{i,\tau}^{\fr 12}\int_{\pa\om} |\na x_i|^2\geq |\pa\om|\sum_{i=1}^{n-1} \la_{i,\tau}^{\fr 12}.\en Combining (\ref{pth5.4}) with (\ref{pth5.5}) and taking $$\delta=\left\{\frac{\inpo (n-1)^2 |\H|^2\dn}{n\tau \mathrm{Vol}(\Omega)}\right\}^{\frac{1}{2}},$$ we obtain \begin{eqnarray}\label{pth6.6} \frac{1}{n-1}\sum_{j=1}^{n-1}\lambda_{j,\tau}^{\frac{1}{2}}\leq \frac{\left\{ n\tau |\Omega|\inpo |\H|^2\right\}^\frac{1}{2}}{|\p \Omega|}. \end{eqnarray} If the equality holds in above inequality, we know that \begin{eqnarray*} \lambda_{1,\tau}=\cdots=\lambda_{n,\tau}\equiv \Lambda \end{eqnarray*} and \begin{eqnarray}\label{c12} \D x_i =-\delta\sqrt{\lambda_{n,\tau}} x_i, \ i=1,\cdots, n, \ \ {\rm on}\ \ \pa\om. \end{eqnarray} Since $\pa\Omega$ is a closed hypersurface of $\R^n$, we conclude that $\p \om$ is a round sphere. This completes the proof of Theorem \ref{th6}. \hfill $\Box$ \section*{Acknowledgements} F. Du was partially supported by the NSF of Hubei Provincial Department of Education (Grant No. D20184301). J. Mao was partially supported by the NSF of China (Grant No. 11401131), the Fok Ying-Tung Education Foundation (China), and Hubei Key Laboratory of Applied Mathematics (Hubei University). Q. Wang was partially supported by CNPq, Brazil (Grant No. 307089/2014-2). C. Xia was partially supported by CNPq, Brazil (Grant No. 306146/2014-2).
\section{Summary paragraph} {\bf High speed optical telecommunication is enabled by wavelength division multiplexing, whereby hundreds of individually stabilized lasers encode the information within a single mode optical fiber. Higher bandwidths require higher a total optical power, but the power sent into the fiber is limited by optical non-linearities within the fiber and energy consumption of the light sources starts to become a significant cost factor \cite{kahn_communications_2017}. Optical frequency combs have been suggested to remedy this problem by generating multiple laser lines within a monolithic device, their current stability and coherence lets them operate only in small parameter ranges \cite{pfeifle_coherent_2014,ataie_ultrahigh_2015,marin-palomo_microresonator-based_2017}. Here we show that a broadband frequency comb realized through the electro-optic effect within a high quality whispering gallery mode resonator can operate at low microwave and optical powers. Contrary to the usual third order Kerr non-linear optical frequency combs we rely on the second order non-linear effect which is much more efficient. Our result uses a fixed microwave signal which is mixed with an optical pump signal to generate a coherent frequency comb with a precisely determined carrier separation. The resonant enhancement enables us to operate with microwave powers three orders of magnitude smaller than in commercially available devices. Such an implementation will be advantageous for next generation long distance telecommunication which relies on coherent emission and detection schemes to allow for operation with higher optical powers and at reduced cost \cite{temprana_overcoming_2015}.} \begin{figure*} \includegraphics[width=1.0\textwidth]{Figure_1.pdf} \caption{\label{fig:theo} \textbf{Principles of $\chi^{(2)}$ WGM-based frequency combs generation} a) Schematic of the setup for the creation of electro-optic $\chi^{(2)}$-frequency combs. The interacting fields are resonantly enhanced by an optical lithium niobate whispering gallery mode resonator (WGM) and an external 3D metallic microwave cavity. Light is coupled evanescently through frustrated total internal reflection into the WGM. The microwave {field} phase-modulates the light via the Pockels effect and a frequency comb is generated as illustrated schematically in b): The optical modes are separated by a nearly constant free spectral range (FSR) which approximately matches the frequency of the microwave tone $\Omega$ allowing for sum- and difference frequency generation (SFG, DFG) of sidebands. Due to the fixed microwave frequency, the comb lines are generated strictly equidistantly. This leads to a detuning of the comb lines from the optical modes, which are subject to dispersion, and eventually breaks the comb as illustrated in Figure \ref{fig:figure2}. } \end{figure*} The {data capacity of the internet} is expected to grow by a factor of two every year \cite{mitchell17}, but current optical techniques are not able to meet the rising demand {on} the bandwidth of the undersea fibre network \cite{Rev2018ofc}. Techniques such as space division multiplexing \cite{Kahn2017}, mode-division multiplexing \cite{Luo2014} and wavelength division multiplexing (WDM) \cite{temprana_overcoming_2015} in combination with time domain multiplexing (TDM) are being investigated {}to exploit the existing network to its full capacity. Current WDM systems employ an array of individually stabilized lasers, which are not phase locked to each other. For the next generation a major shift in the paradigm from multiple independent optical carriers to coherent optical frequency combs (OFCs) \cite{Rev2018ofc} combined with real time numerical calculation of the nonlinear pulse \cite{temprana_overcoming_2015} will be necessary. The advantage of OFCs is that they can be generated from a single laser, potentially reducing the overall energy consumption of the system considerably. Furthermore, depending on the method of comb generation, OFCs can feature high phase and frequency stability, and may also offer tunability of the comb line spacing. Of particular interest for future WDM applications is the intrinsic phase lock between all comb lines which allows the numerical counteracting of one of the main limitations, the nonlinear pulse distortion, for {accepting} higher optical powers within the telecommunication fibres \cite{temprana_overcoming_2015}. Commercial OFCs are currently based on femotosecond lasers \cite{Hansch2000,Liang2015}, however, over recent years combs generated in micro-resonators via the Kerr effect became more and more successful \cite{Kippenberg2014,suh_gigahertz-repetition-rate_2018,kippenberg_microresonator-based_2011,Liang2015}. An alternative approach of comb generation is electro-optic modulation (EOM) \cite{Torres2014}. This scheme exploits a second-order non-linearity, whereby two continuous waves, e.g.\ one in the optical range (carrier) and one in the microwave range (modulating wave), are mixed within a non-linear non-centrosymmetric crystal. In the past, over-driving of conventional electro-optic modulators was explored for comb generation \cite{kovacich_short-pulse_2000,jiang_spectral_2007,wu_generation_2010,beha_electronic_2017}. These EOM based combs have unique advantages such as tunable central-frequency and comb-line spacing crucial for a range of applications ranging from telecommunication to spectroscopy. However, these combs suffer from inherent phase instabilities and excess multiplication of microwave phase noise \cite{beha_electronic_2017} which limits their usage in long-distance data transfer \cite{temprana_overcoming_2015}. Here, we report the first experimental demonstration of efficient resonantly enhanced electro-optic comb generation. Such a fully coherent comb with intrinsic phase noise suppression allows to increase the information content and data rate in optical communication. The phase stability between the comb lines is inherently given due to the fixed interaction of two stable sources, high quality optical resonators filter the fundamental electro-optic noise \cite{beha_electronic_2017}. Our experiment draws on an in-depth theoretical description of the resonantly enhanced non-linear interaction and we show in a first experiment the potential of this method by reporting on a coherent comb with 8.9\,GHz spacing with a span of almost 200 lines in the C-Band (1530\,nm -- 1565\,nm) with only 20\,dBm of microwave modulation power. The results clearly demonstrate a resurgence of EOM based comb generation and show the large potential of resonantly enhanced electro-optic modulation for the next generation of ultra dense WDM. \begin{figure*}[t!] \includegraphics[width=1.0\textwidth]{Figure_2.pdf} \caption{\label{fig:figure2}\textbf{Theoretical scaling of the sideband power and dispersion induced breakdown of the comb} a) shows the power of the sidebands as a function of the sideband order for different modulation strengths ($G$). The dashed lines represent the analytic solution given by equation (\ref{eq:fourier}) and the straight colored lines are numeric solutions which include the optical dispersion of lithium niobate (see Supplement). The dispersion leads to a detuning of the equidistantly generated comb lines from the optical resonance frequencies as shown in the bottom part. When a certain detuning of the comb lines from the optical resonance frequency is reached, the comb breaks down drastically. The $G$ dependence of the breakdown can be understood by the nonlinear induced broadening of the modes shown in b): in the yellow contour plot, we show the measured mode splitting as a function of $G$, which is proportional to the microwave power sent to the system. } \end{figure*} The scheme we use for comb generation is based on the Pockels effect: an electric field applied to a non-centrosymmetric crystal such as lithium niobate, results in a change of the optical refractive index of the material directly proportional to the applied voltage. As a consequence, light passing through the crystal encounters a varying optical path length and is thus phase modulated with the frequency of the applied voltage. This phase modulation generates sidebands separated from the optical carrier frequency by multiples of the modulation frequency and forms a comb. One can observe this behavior already in a standard EOM \cite{kourogi_wide-span_1993,ye_optical_2003}, but the magnitude of the sidebands usually decay quickly with distance from the carrier. The length of the comb is determined by the modulation index which scales with the amplitude of the applied electric field \cite{pozar_microwave_2011}. To boost the electric field and thus the efficiency of the process and generate a wide spanning comb, we embed a high quality optical whispering gallery mode resonator into a high quality microwave resonator. Another, equivalent way to view the process is sum and difference frequency generation: the energy of the microwave photons is either added to or subtracted from the carrier photon yielding new frequencies. These sidebands are themselves interacting with microwave photons and give rise to new frequencies again by the same process. For an efficient comb generation the sidebands have to match an optical resonance, as a consequence, the microwave resonator needs to be designed such that its resonance frequency coincides with the free spectral range (FSR) of the optical resonator. Mathematically the system is described by an infinite but simple set of linear equations each representing an optical mode participating in the nonlinear process. It can be solved analytically under the condition of a constant FSR (see supplement and \cite{ilchenko_whispering-gallery-mode_2003}), and for the time dependent optical field amplitudes in reflection of the resonator, we find \begin{eqnarray} \frac{A_{\text{out}}(t)}{A_\text{in}(t)}&=&\frac{ 2\gamma/\Gamma-1 -i(\Delta +2\sqrt{G}\cos(\Omega t))}{1+i(\Delta+2\sqrt{G}\cos(\Omega t))}.\label{eq:allmodes} \end{eqnarray} Here $\Gamma = \gamma + \gamma'$ is the half linewidth of the optical modes with $\gamma$ and $\gamma'$ being the optical coupling rate and intrinsic field loss rate, respectively. The detuning of the optical carrier frequency $\omega_0-\omega$ from its resonance frequency $\omega_0$ is normalized to half of the optical linewidth $\Delta=(\omega_0-\omega)/\Gamma$ and $\Omega$ is the microwave frequency which we assumed to be on resonance. The figure of merit is $G = {n_\Omega} g^2 / |\Gamma|^2$, where $n_\Omega$ is the number of microwave photons in the resonator and $g$ is the single photon coupling rate which is a function of the electro-optic coefficient and the overlap between the optical and the microwave modes. $G$ is often referred to as electro-optic cooperativity \cite{tsang_cavity_2010} and represents the ratio between the nonlinear photon conversion rate and photon decay rate and is hence a measure for the strength of the nonlinear interaction. It is interesting to compare the modulation of a resonant EOM with a non-resonant EOM which is simply described by $A_\text{out}(t) = e^{i \xi \cos(\Omega t)} A_\text{in}(t)$ with the modulation index $\xi \approx 4\sqrt{G}$. The non-resonant EOM does not contain any amplitude modulation, while the resonant EOM, on the other hand, does. Only when the resonant EOM is strongly over-coupled ($\gamma \gg \gamma'$) and for very small nonlinearities $G\approx 0$ are the two systems are comparable. At critical coupling ($\gamma = \gamma'$) and increasing $G$, the resonant EOM starts generating pulses with a repetition rate of $1/2\tau$ where $\tau$ is the roundtrip time of the optical cavity. We show in the supplement that the pulse width $\Delta\tau$ can be approximated as $\Delta\tau \approx \tau/(2\pi \sqrt{G})$. The power of the comb lines can also be analytically described as \begin{equation} \frac{P(\omega \pm k\Omega)}{P_\text{in}}=\frac{4\gamma^2}{\Gamma^2}\left|\frac{e^{-\beta(G)}}{\sqrt{G}+\sqrt{G}e^{-2\beta(G)}}\right|^2 e^{-2|k|\beta(G)}\mbox{ for } k\ne0\label{eq:fourier}, \end{equation} where $k$ represents the order of the sideband, $P^\text{in}$ is the input optical power and $2\beta(G)$ is the decay constant and can be approximated to $1/\sqrt{G}$ in the limit of strong nonlinear interaction $4G\gg1$ (see supplement). The resonant comb scales strictly exponential, which is another difference to the non-resonant comb, where the comb line power is described by Bessel functions \cite{hobbs2011building}. In Figure \ref{fig:figure2}a we plot Eq.~(\ref{eq:fourier}) for different modulation strengths {as dashed lines} on a logarithmic scale. It is apparent that the slope of the exponential decay decreases with increasing $G$ leading to the generation of longer combs. \begin{figure*} \includegraphics[width=1.0\textwidth]{Figure_3.pdf} \caption{\label{fig:comb}\textbf{Experimental realization } a) Measurement Network. A monochromatic coherent laser source in the telecommunication domain goes through a phase modulator, used for measuring the optical free spectral range and linewidth of the modes. The polarization controller sets the GRIN-lens output beam to TE polarization. 99\% of the light is coupled into the resonator, while 1\% of the light is used for power calibration (photo detector~1). The reflected optical carrier is sent to PD2 to characterize the optical spectrum of the resonator. The comb lines, also out-coupled through the silicon prism, are detected on an optical spectrum analyzer (OSA). The microwave tone was sent through a cable to the pin coupler inside the cavity. This transmission line was also used to characterize the microwave mode with a vector network analyzer (VNA). b) Spectrum of the frequency comb with 20\,dBm microwave power at 8.9\,GHz spanning over 180 comb lines resulting in a width of about 1.6\,THz. In blue we shown the spectrum of the pump laser without the microwave tone.} \end{figure*} To derive the previous analytic solution for the system, we neglected optical dispersion, which is intrinsic due to geometric and material dispersion. As a consequence, the optical modes are not exactly equally spaced and the generated comb lines become increasingly detuned from the optical resonance frequencies with distance from the carrier mode (compare Figure \ref{fig:theo}b). This eventually breaks the comb generation as illustrated in Figure \ref{fig:figure2}a. The straight lines show the sideband power as function of the sideband order obtained from numerically solving the rate equations including optical dispersion of lithium niobate \cite{zelmon_infrared_1997} (see supplement for details). Close to the pump frequency the power decreases exponentially as expected from equation (\ref{eq:fourier}) till a certain $G$ dependent sideband order where it drastically drops. This can be intuitively understood from Figure \ref{fig:figure2}b: with increasing microwave power, the optical modes broaden and show a mode splitting by $(4\sqrt{G} - 1.2) \Gamma$. As a consequence, the dispersion induced detuning of the optical eigenfrequencies from the generated sidebands impacts the comb generation considerably not already at the half-width of a cold cavity mode ($\Gamma$) but at $2\sqrt{G} - 0.6$. Figure \ref{fig:figure2}b shows that this intuitive picture is accurate. As soon as the detuning, shown in Figure \ref{fig:theo}b, equals the nonlinear broadening, the comb starts to break down. Nevertheless, with reasonable parameters we expect a few hundred lines as shown in Figure \ref{fig:figure2}a. To experimentally demonstrate our highly efficient scheme, we embedded a high quality resonator machined from single crystalline lithium niobate into a microwave cavity made from copper. The optical resonator is a so called whispering gallery mode resonator manufactured from lithium niobate: a convex shaped disk which guides light via total internal reflection along its inner surface interfering with itself after each roundtrip \cite{reviewdmitry}. Since lithium niobate is quite transparent, the light can do many roundtrips before being absorbed which boosts the optical intensity by orders of magnitude facilitating efficient nonlinear interactions \cite{strekalov_microwave_2009,Rueda:16,botello_sensitivity_2018}. The microwave resonator is a 3D copper cavity enclosing the optical resonator designed such that the resonantly enhanced microwave field has maximum overlap with the optical whispering gallery mode. The cavity contains two protruded copper rings facing each other which clamp the optical resonator when the cavity is closed. This ensures that the microwave field is focused on the rim of the optical resonator where the optical modes are located maximizing the overlap between the two vastly different frequencies. Two holes are used to couple optical light into and out from the cavity. Apart from that the copper cavity is closed to prevent the microwave mode from radiating into the far field which would decrease its {quality} $Q$ factor. Inside the cavity, we use a silicon prism placed close to the optical resonator to couple the light into the lithium niobate disk. The WGM resonator has a radius of $2.45\,$mm and a thickness of 0.4\,mm resulting in a free spectral range of about $8.9\,$GHz at the used pump frequency $\omega_0 = 2\pi \times 193.5\,$THz. Based on numerical simulations of the microwave mode ({see Methods}), we designed the copper cavity such that the microwave resonance matches approximately the optical free spectral range and added a fine tuning mechanism to compensate for small fabrication tolerances. Our system has a single photon coupling rate of $g = 2\pi \times 7.43$ Hz, the optical and microwave quality factors are $Q_o =1.4\times10^8$ and $Q_\Omega =241.4 $ respectively. The optical resonator is critically coupled resulting in $\gamma = \gamma' = 2\pi \times 0.35\,$MHz while the microwave resonator is undercoupled with $\gamma_\Omega = 2\pi \times 3.6\,$MHz and $\gamma_\Omega' = 2\pi \times 16.20\,$MHz. For convenient comparison with canonical electro-optic phase-modulators, one can estimate the $\pi-$voltage from these parameters to be $V_\pi = 260$ mV (see supplement). Typical non-resonant modulators have values of a few volts showing the high efficiency of our system. This is traded, of course, by having only a few MHz bandwidth compared to several GHz bandwidth of non-resonant systems. To observe the comb, we couple a 317 $\mu$W of optical power into a fundamental whispering gallery mode and modulate it with $20\,$dBm of microwave power ($\sqrt{G} \approx 25$). The light emitted from the cavity is coupled to an optical fiber and measured with an optical spectrum analyzer. Figure \ref{fig:comb}b shows the generated comb to have a span of about $11\,$nm corresponding to 1.6\,THz and 90 visible comb lines in each direction. The comb is, as expected, symmetric and decays approximately exponential. According to our theory, we expect a dispersion induced breakdown of the comb at a span of 160 lines which we cannot observe due to the noise floor of the OSA. In summary, we have demonstrated that multi-resonant electro-optic modulation can lead to the formation of a broadband frequency comb at very low electrical power consumption. We present a complete analytic solution for a dispersionless system describing the comb formation thoroughly, including phase and amplitude of the generated comb lines and its temporal behavior in steady state. Our numerical simulations show that even if considering optical dispersion, the comb can span hundreds of lines due to nonlinear line-broadening of the optical modes before breaking down. Since two stabilized sources are used to generate such an electro-optic comb via a second order non-linear effect, the resulting comb lines have a fixed and pre-determined phase relation to each other. We believe that the combination of a compact high quality resonant enhancement with a careful microwave field engineering and a fast way to calculate the nonlinear pulse propagation in real time can become a key concept for power-efficient optical interconnects and extend the range of long distance interconnects due to the inherent phase relation of all the comb lines. \section*{Acknowledgments} \noindent This work was supported by the Marsden Fund of the Royal Society of New Zealand, the Julius von Haast Fellowship of the Royal Society of New Zealand, and the Max Planck Institute for the Science of Light, Erlangen, Germany. \section*{Author Contributions} \noindent A.R. and F.S. performed all the experiments and developed the theory. A.R. performed the theoretical and numerical modeling. H.G.L.S. proposed the experiment. A.R., F.S., M.K., G.L., and H.G.L.S. wrote the manuscript. All authors contributed to discussing and interpreting the results. \section*{Additional information} \noindent Correspondence and requests for materials should be addressed to H.G.L.S. \section*{Competing financial interests} \noindent The authors declare no competing financial interests. \clearpage \subsection{Methods} \begin{figure*} \includegraphics[width=0.6\textwidth]{Methods-cavity.pdf} \caption{\label{fig:methods}{ \textbf{Experimental resalisation } a) COMSOL simulation and b) top, and bottom-half of the copper cavity. The lithium niobate WGM is mounted in the top-half. }} \end{figure*} \textbf{Theory} Theoretically we can describe the system of a strong microwave field coupled nonlinearly to two optical fields by their total energy, its Hamiltonian. {Assuming no depletion of the microwave field (due to the presence of both sum- and difference generation) the nonlinear interaction Hamiltonian is given by (see supplement):} \begin{equation} \hat{H}_\text{int}=\hbar |\alpha| g (\hat{a}_1\hat{a}_2^\dagger +\hat{a}_1^\dagger\hat{a}_2). \label{eqMethods:hamscat} \end{equation} This is also known as the beam splitter Hamiltonian where $|\alpha|^2$ is the number of microwave photons in the cavity, $\hat{a}_1$ and $\hat{a}_2^\dagger$ are the annihilation and the creation operators of the two optical fields and can represent sum- as well as difference frequency generation. This linearisation of the Hamiltonian is also known as a zero-photon process characterized by photons scattering from one mode into another without changing the total number of photons \cite{Law}. The single photon coupling rate $g$ is defined as \begin{equation} g=2\epsilon_0 \chi^{(2)} \sqrt{\frac{\hbar \omega_0\omega_s\omega_\Omega}{8\epsilon_0\epsilon_s\epsilon_\Omega V_0V_sV_\Omega}} \int dV \psi_\Omega \psi^\dagger_s\psi_0,\label{eqMethods:defgg} \end{equation} where $\chi^{(2)}$ is the second order nonlinear susceptibility, $\epsilon_0$ the vacuum permittivity, and $\omega_i,\epsilon_i,V_i, \psi_i$ are the frequency, relative permittivity, mode volume and normalised electric field distribution of the optical pump, sideband and microwave tone indicated by $i \in\{0,s,\Omega\}$, respectively. The integral over the fields is only nonzero if the so called phase-matching relation between the individual fields is fulfilled which leads to the relation $m_s=m_0+ m_\Omega$, where $m$ is the angular momentum number for the sideband, pump and microwave field, respectively (see supplement). In a system with multiple modes $\omega_k$, equidistantly separated from the optical pump field frequency $\omega_0$, a strong microwave field {leads} to {a} cascade of the sum- and difference frequency generation. Assuming the same nonlinear coupling constant $g$ between the optical and microwave fields and noting that due to the phase-matching only {spectrally adjacent} modes can interact, the Hamiltonian can be written as: \begin{equation} \hat{H}_\text{int}=\hbar |\alpha| g \sum\limits_{k=-N}^{N-1}(\hat{a}_k\hat{a}_{k+1}^\dagger +\hat{a}_k^\dagger\hat{a}_{k+1}), \label{eqMethods:hamsqu} \end{equation} where $2N+1$ is the number of optical modes involved in the system and $\hat{a}_k$ denotes the operator of the $k$ participating optical modes. To describe their dynamics under the presence of a coherent microwave drive, we find the equations of motion using the Heisenberg picture to be: \begin{equation} \dot{\hat{a}}_k= \frac{i}{\hbar}[\hat{H}_\text{int},\hat{a}_k]=-i\sqrt{n_\Omega}g(\hat{a}_{k-1}+\hat{a}_{k+1}),\label{eqMethods:eqsum} \end{equation} where $n_\Omega$ is the number of microwave photons in the system. We introduce coupling and loss channels and solve these equations for the steady state in the rotating wave approximation and classical limit. Taking into account that we need to out couple the fields from the resonator we get equations (\ref{eq:allmodes}) and (\ref{eq:fourier}) in the main text. \textbf{Numerical cavity design} {The microwave cavity was designed with the help of numerical simulations using COMSOL. The goal was to maximize the overlap between microwave and optical fields while choosing the system geometry such that the optical free spectral range coincides with the $m_\Omega$ = 1 microwave mode with a frequency around $10\,$GHz. In compliance with these boundaries, we optimized the microwave coupling and allowed for an optical coupling port to the WGM resonator.} {We found a solution for efficient} type I phase matching ($\text{TE}+\text{TE} \rightarrow \text{TE}$) {for which the electro-optic coefficient of lithium niobate is largest}. We note that this hybrid system is very similar to our previous work on coherent microwave up-conversion, showing the versatility of this approach \cite{Rueda:16}. \textbf{Experiment} We fabricate a lithium niobate WGM resonator ($n_\text{o}=2.211$, $n_\text{eo}=2.138$, for the ordinary and extra-ordinary polarisation) with $R=2.45$\,mm and minor radius $r=1.5$\,mm, and height $h=0.4$\,mm, mounted within the copper cavity shown in Fig.~\ref{fig:methods} a,b) (see also supplement). As the optical pump we use a narrow-band tunable laser ({Toptica} DL pro, $\lambda \approx 1550$\,nm, linewidth of 100\,kHz) which goes through a polarization controller. {The pump} is split 99:1, with the weak {port} sent to the detector to keep {track} of the {pump power} (see Fig.~\ref{fig:comb} c). The other arm goes to the graded index lens for WGM-prism coupling to a transverse {(TE)} electric mode. We use a silicon prism ($n_\text{Si}=3.47$) mounted within the copper cavity. Two holes in the copper cavity allow the optical pump light to enter and the light reflected and the emitted sideband from the WGM resonator to leave the cavity. The {signal and reflected pump are coupled to a} fiber and sent to {an} InGaAs photodetector PDA10CS {(Thorlabs)} and its output signal to the oscilloscope. We can use a signal generator to sweep the lasers frequency and scan over the optical modes of the cavity, measure the optical FSR and optical loaded $Q$ using sideband spectroscopy \cite{Li:12}. The microwave signal {generated by an SMR20, Rohde \& Schwarz,} is coupled via a coaxial pin coupler introduced close to the WGM resonator inside the cavity. The same transmission line was used for reflection measurements with a vector network analyzer ENA E5072A, Keysight to obtain central frequency, coupling and loss rate of the microwave mode. A metallic tuning screw is used to perturb the microwave field for fine adjustment of its resonance frequency (see Fig.~\ref{fig:figure2} a). The whole setup is thermally stabilized at $30^\circ$ to the mK level with a proportional-integral-derivative (PID) controller TC200 in combination with temperature sensor (AD590) and a thermoelectric element attached on the outer side of the closed copper cavity. Once the laser is set to the mode, we send the microwave tone and create the sidebands (see Fig.~\ref{fig:comb} d). These signals are outcoupled through the prism and coupled to the fibers. {The sidebands, together with the reflected optical pump are measured with an} OSA (YOKOGAWA AQ6370C).
\section{Introduction} The NuMI\footnote{Neutrinos at the Main Injector} Off-Axis $\nu_{e}$ Appearance experiment (NOvA) \cite{nova,nova2} is the flagship long-baseline neutrino experiment in the United States, designed to study the properties of neutrino oscillations. NOvA consists of two functionally equivalent detectors each located 14.6 mrad off the central axis of the Fermilab NuMI neutrino beam, the world's most intense neutrino beam. The Near Detector is located 1 km downstream from the neutrino production source, and the Far Detector is located 810 km away in Ash River, Minnesota. This long baseline, combined with the ability of the NuMI facility to switch between neutrino and anti-neutrino enhanced beams, allows NOvA to make precision measurements of neutrino mixing angles, constrain the neutrino mass hierarchy, and begin searching for CP violating effects in the lepton sector. We study 4 oscillation channels $\overset{\scriptscriptstyle(-)}{\nu}_\mu \rightarrow \overset{\scriptscriptstyle(-)}{\nu}_\mu$ and $\overset{\scriptscriptstyle(-)}{\nu}_\mu \rightarrow \overset{\scriptscriptstyle(-)}{\nu}_e$. NOvA released its latest oscillation results from a full detector equivalent exposures of 8.85$\times10^{20}$ protons on target neutrino beam and 6.9$\times10^{20}$ protons on target antineutrino beam~\cite{Neutrino2018,mendez_diana_patricia,back_ashley} collected between February 2014 and April 2018. This paper presents the assessment of systematic uncertainties and cross-check studies done in making these precise measurements. It is organized as follows. In Sec.~\ref{sec:Detectors}, we give brief descriptions of NOvA detectors. Sec.~\ref{sec:oscillations} and Sec.~\ref{sec:systematics} describe the neutrino oscillation measurements and associated systematics. The data-driven cross-checks using muon-removed electrons and muon-removed bremsstrahlung showers are explained in Sec.~\ref{sec:mre} and in Sec.~\ref{sec:mrbrem}. \section{The Detectors} \label{sec:Detectors} The NOvA detectors were designed for electron identification. The two detectors are functionally equivalent, fine-grained, low-Z (0.18 radiation lengths per layer), liquid scintillator calorimeters made of 65\% active material. The Far Detector (FD) is 14~ktons and sits on the surface in Minnesota. The Near Detector (ND) is 290~tons placed 300~ft underground at Fermilab. These two detectors consist of layered reflective polyvinyl chloride (PVC) cells, filled with liquid scintillator arranged in alternating horizontal and vertical planes for 3D reconstruction, to form a tracking sampling calorimeter. When a charged particle passes through the liquid scintillator, which is comprised primarily of mineral oil solvent with a 5\% pseudocumene admixture and PPO and bis-MSB as secondary fluors\cite{oil}, it produces scintillation light. The scintillation light is picked up by a 0.7~mm wavelength shifting fiber within every cell (each cell is read out individually) which is coupled to a 32 pixel avalanche photo-diode (APD) where the light is collected and amplified.\\ The FD cells are 3.9~cm $\times$ 6.6~cm in cross section, with the 6.6 cm dimension along the beam direction, and 15.5~m long. The ND cells are identical to those of the FD but shorter in length, 3.9~m. In total, there are 344,054 cells in the FD and 21,192 cells in the ND. To improve muon containment, the downstream end of the ND has a "muon catcher" composed of a stack of sets of planes in which a pair of one vertically-oriented and one horizontally-oriented scintillator plane is interleaved with one 10 cm thick plane of steel. The relative sizes of the detectors are shown diagrammatically in Fig.~\ref{fig:novadetectors}. Both detectors are 14.6~mrad off-axis of the NuMI beam. This results in a neutrino flux with a narrow band energy spectrum centered around 2 GeV. Such a spectrum emphasizes $\nu_\mu\rightarrow\nu_e$ oscillations for the NOvA baseline and reduces backgrounds from higher energy neutral current interaction events. \begin{figure}[!htbp] \begin{center} \includegraphics[width=0.99\textwidth]{Figures/NOvADetectors.pdf} \caption{The relative sizes of the NOvA Far and Near detectors. The structure of the NOvA detector layers and a single PVC cell coupled to an APD via a wavelength shifting fiber are also shown.} \label{fig:novadetectors} \end{center} \end{figure} \begin{figure}[!htbp] \begin{center} \includegraphics[width=0.99\textwidth]{Figures/evd.png} \caption{5 ms data readout from the NOvA Far Detector.} \label{fig:5msreadout} \end{center} \end{figure} \section{Neutrinos in NOvA}\label{sec:oscillations} The NuMI beam at Fermilab creates a "spill" of neutrinos every 1.3 seconds. Each spill lasts for only 10~$\mu$s. NOvA data is recorded in 550~$\mu$s intervals centered on the beam spill, in which hundreds of particle tracks can be seen as shown in Fig.~\ref{fig:5msreadout}.\\ An event display of $\nu_\mu$ and $\bar\nu_\mu$ candidate data events are shown on the left and right of Fig.~\ref{fig:NumuCC-AntiNumuCC-Evds}, respectively. Typically, $\nu_\mu$ events have a long, forward going track with recorded hits coming from $\mu^-$'s MIP interaction and hadronic activity coming from protons around the interaction vertex. Typical $\bar\nu_\mu$ event characteristics are a similar, long track with recorded hits coming from $\mu^+$'s MIP. Antineutrino events tend to have lower visible hadronic activity near the vertex due to interaction kinematics and the high neutron content of their final states, neutrons can soft absorb with no signs of recorded hits for its interaction. Due to the smaller hadronic energy, the $\mu^+$ will tend to be more aligned with the beam direction. The color scale shown underneath the event display remains proportional to the light seen in each cell of the detector: the light is turned into charge on the APD in order to be measured.\\ A zoomed in event display of $\nu_e$ and $\bar\nu_e$ candidate core data events are shown on left and right of Fig.~\ref{fig:NueCC-AntiNumuCC-Evds}, respectively. Typical $\nu_e$ event characteristics are a forward going EM shower with recorded hits coming from $e^-$'s interaction and hadronic activity coming from protons around the interaction vertex, and $\bar\nu_e$ event characteristics are an EM shower more aligned with the beam direction with recorded hits coming from $e^+$'s and, similar to $\bar\nu_\mu$, less hadronic activity around the vertex.\\ NOvA has pioneered the use of Convolutional Neural Networks (CNN) for reconstruction tasks in neutrino physics. The core of neutrino selection is the use of a CNN known as the Convolutional Visual Network (CVN), based on GoogLeNet~\cite{Aurisano:2016jvx, groh_micah_2018} a CNN for image recognition tasks. NOvA was the first experiment to utilize CNNs in a HEP result~\cite{Adamson:2017gxd}. The neutrino signal selections includes cosmic rejection, containment, data quality, and pre-selection cuts along with neutrino flavor identification from CVN.\\ Electron neutrino events passing all these selections form the "core" sample at both detectors. These events are further split into two samples of low PID and high PID score. We also construct a third, "peripheral" sample of FD events by considering events that fail containment or cosmic rejection selections, but have very high PID scores from the neural network classifier. Candidate $\nu_\mu$ events are split into four "quartiles" based on the ratio of hadronic energy to total energy in the event. \\ \begin{figure}[!htbp] \begin{center} \includegraphics[width=0.49\textwidth]{Figures/NumuCC_Candidate_EVD.pdf} \includegraphics[width=0.49\textwidth]{Figures/AntiNumuCC_Candidate_EVD.pdf} \caption{A candidate $\nu_\mu$-CC and $\bar\nu_\mu$-CC events in the Y-Z view are shown on the left and right respectively. The charge deposited information of each event is shown underneath the event display. Both events exhibit the characteristic muon track of $\nu_\mu$-CC interactions.} \label{fig:NumuCC-AntiNumuCC-Evds} \end{center} \end{figure} \begin{figure}[!htbp] \begin{center} \includegraphics[width=0.49\textwidth]{Figures/NueCC_Candidate_EVD.pdf} \includegraphics[width=0.49\textwidth]{Figures/AntiNueCC_Candidate_Evd.pdf} \caption{A candidate $\nu_e$-CC and $\bar\nu_e$-CC events in the Y-Z view are shown on the left and right respectively. The charge deposited information of each event is shown underneath the event display. Both events exhibit the characteristic electron shower of $\nu_e$-CC interactions.} \label{fig:NueCC-AntiNumuCC-Evds} \end{center} \end{figure} The neutrino energy spectrum at the NOvA ND is measured close to the neutrino source before neutrino oscillations have occurred. This large statistics data sample is used to validate the MC prediction of the expected beam flux and the simulation of the detector response. The $\nu_e$ and $\nu_\mu$ FD signal prediction is based on simulation of the $\nu_\mu$ beam flux, constrained by the observed selected $\nu_\mu$-CC candidates in the ND and oscillated appropriately. Discrepancies between data and MC calculations in the ND energy spectrum are extrapolated to produce a predicted FD spectrum~\cite{Suter:2015ozi,nosek_tomas}.\\ The demonstration of the extrapolation procedure from the ND to the FD is shown in Fig.~\ref{fig:extrapolation}. We first convert the ND reconstructed energy spectrum into a true energy spectrum using the reconstructed-to-true migration matrix obtained from the ND simulation. The ratio of the data's unfolded spectrum to the simulated spectrum in bins of true energy is then used as a scale factor to the simulated true energy spectrum of $\nu_\mu$-CC events selected in the FD. That true energy spectrum is also weighted by the oscillation probability computed for three-flavor neutrino oscillations, including matter effects, for any particular choice of the oscillation parameters. Finally, the true energy spectrum is smeared to a reconstructed energy spectrum, again using the simulated migration matrix. In the final step, the data-based cosmic and simulation-based beam induced backgrounds are added to the prediction, which is then compared to the FD data. As the two detectors are functionally equivalent this ratio based extrapolation allows for reductions in many uncertainties, particularly beam related uncertainties and cross section uncertainties, as shown in Sec.~\ref{sec:systematics}.\\ \begin{figure}[!htbp] \begin{center} \includegraphics[width=0.99\textwidth]{Figures/nue-extrap.pdf} \caption{The ND to FD extrapolation method used to predict the $\nu_{e}$-CC signal is shown here. The same extrapolation procedure is used to measure the systematic uncertainties in the oscillation analyses.} \label{fig:extrapolation} \end{center} \end{figure} The ND selected $\nu_{e}$ are oscillated to the FD by component to make a prediction of the background components. Each component is propagated independently in bins of energy and particle ID bins. The cosmic background is measured using data from the NuMI timing sideband around the known beam window. A separate, 10~Hz, periodic trigger is used for zero-bias cosmic studies. The signal spectrum, background spectrum, and cosmic prediction together make up the extrapolated prediction. This is shown for neutrino mode in Fig.~\ref{fig:PredictedFarDetectorSpectrum}.\\ \begin{figure}[!htbp] \begin{center} \includegraphics[width=0.99\textwidth]{Figures/nd-to-fd-prediction.pdf} \caption{The data-corrected near detector MC decomposed into each of the background components and the far detector prediction including the $\nu_e$-CC oscillated signal.} \label{fig:PredictedFarDetectorSpectrum} \end{center} \end{figure} \section{Oscillation Systematics} \label{sec:systematics} We discuss the dominant systematic uncertainties associated with the joint $\nu_e+\nu_\mu$ analysis using both neutrino and antineutrino beams in NOvA. Many other effects are considered, for example the detector response modeling and normalization systematics, but will not be discussed here as the effect on event selection and final measurements is negligible. \\ The impact of systematic uncertainties are estimated by producing shifted ND and FD simulation samples by event reweighing, producing specially shifted files, or altering kinematic values within events. Systematic uncertainties in the analysis are extrapolated from the ND to the FD using the same extrapolation technique shown in Sec.~\ref{sec:oscillations}. Systematic uncertainties in the analysis are applied by replacing the systematically shifted ND spectrum in place of the nominal simulation prior to extrapolation to the FD. The systematically shifted FD predictions can then be compared to the nominal prediction for each systematic. As an example, the extrapolated FD prediction in 3 CVN bins for the dominant absolute calibration systematic uncertainty with the systematic error band is shown Fig.~\ref{fig:Systematic} for neutrino mode on left and antineutrino mode on right.\\ \begin{figure}[!htbp] \begin{center} \includegraphics[width=0.99\textwidth]{Figures/CalibrationSystematics.pdf} \caption{Extrapolated FD prediction in 2 CVN bins and the peripheral for the dominant absolute calibration systematic is shown for $\nu_e$ signal (left) and $\bar\nu_e$ signal (right).} \label{fig:Systematic} \end{center} \end{figure} Systematic uncertainties are included as nuisance parameters in the fit in the oscillation analyses. In the simultaneous fit of the $\nu_e$ appearance and $\nu_\mu$ disappearance data, the nuisance parameters associated with the systematic uncertainties which are common between the two data sets, are correlated appropriately. By extrapolating from the ND to the functionally equivalent FD, the impact of many systematic uncertainties are reduced or canceled. The one sigma uncertainty in the predicted $\nu_{e}$ signal (background) events is shown in Fig.~\ref{fig:Syst_extrap}. The percentage reduction of total systematic uncertainty after the extrapolation for each component is shown in Table~\ref{tab:syst-reduction-extrap}. In particular, the variations due to uncertainties in the beam flux are almost canceled.\\ \begin{figure}[!htbp] \begin{center} \includegraphics[width=0.92\textwidth]{Figures/extrapolatedsystematics.pdf} \caption{The reduction in systematic uncertainties on the number of selected $\nu_e$ events due to using the extrapolation procedure from the ND to the FD.} \label{fig:Syst_extrap} \end{center} \end{figure} \begin{table} \caption{The total reduction in systematic uncertainties on the number of selected $\nu_e$ events due to using the extrapolation procedure from the ND to the FD.}\label{tab:syst-reduction-extrap} \centering% \begin{tabular}{|l|c|c|} \hline & \multicolumn{1}{|c|}{Unextrapolated} &Extrapolated \\ Component & \multicolumn{1}{c}{systematic uncertainty (\%)} & \multicolumn{1}{|c|}{systematic uncertainty (\%)} \\ \hline $\nu_{e}$ signal&15.9&7.9\\ $\nu_{e}$ background&14.5&6.0\\ $\bar\nu_e$ signal&13.9&5.9\\ $\bar\nu_e$ background&13.9&7.0\\ \hline \end{tabular} \end{table} The dominant systematic uncertainties to the joint analysis are Detector Calibration, Neutrino cross-sections, Muon energy scale, and Neutron uncertainty as shown in Fig.~\ref{fig:SystematicsonOsciParam}. These combine to contribute over 95\% of the uncertainty to $\mathrm{sin}^2\theta_{23}$ and $\Delta m^2_{32}$. The measurements are still dominated by statistical uncertainties.\\ \begin{figure}[!htbp] \begin{subfigure}[b]{0.5\linewidth} \centering \includegraphics[width=0.96\linewidth]{Figures/SystDeltam32.pdf} \end{subfigure \begin{subfigure}[b]{0.5\linewidth} \centering \includegraphics[width=0.96\linewidth]{Figures/SystSin2theta23.pdf} \end{subfigure} \hfill\\ \centering \begin{subfigure}[b]{0.5\linewidth} \centering \includegraphics[width=0.96\linewidth]{Figures/SystedeltaCP.pdf} \end{subfigure \caption{Sources of systematic uncertainties for the oscillation parameters are shown here.} \label{fig:SystematicsonOsciParam} \end{figure} Calibration uncertainties were assessed by the introduction of deliberate miscalibrations to the MC prior to reconstruction. These artificial miscalibrations take the form of an absolute calibration shift of all cells and a calibration shift as a function of position along cell length (separate for x and y views). The calibration uncertainties are evaluated separately for the near and far detectors. For this reason, the detector calibration and response systematics are increased when using the extrapolation method. Detector calibration and response systematics will be improved by the 2019 test beam program which aims to improve our understanding of detector calibration and response\cite{NOva-TestbeamProg}.\\ Cross section systematics are evaluated by reweighing events in the MC. Some cross section uncertainties come from the event reweighing tools built into GENIE\cite{genie}. Other uncertainties are drawn from observations made by NOvA using data from the near detector as well as external guidance from recent theory work and cross section measurements from other experiments\cite{NeutrinoXsecTune}. The cross section uncertainties considered fall into three categories: primary process (quasielastic scattering, resonance production, deep inelastic scattering, and concomitant nuclear effects like multinucleon knockout), hadronization of parton-scattering processes, and final state interactions (hadron absorption, rescattering, etc. as particles exit the nucleus). There are over 80 cross section systematics evaluated for NOvA. The largest cross section uncertainties to the $\nu_e$ and $\nu_\mu$ oscillation analyses are used directly in the oscillation fit. The remaining cross section uncertainties are used to generate principal components which are then used in the fit.\\ Principle Component Analysis (PCA) is used on NOvA to decorrelate and reduce the number of the remaining cross section systematics. The systematics are used to create an ensemble of universes in which each systematic is shifted randomly. Each universe is broken down into samples at the ND and the corrsponding F/N ratios. In practice, the uncertainties in the analysis are driven by the F/N ratios used in the extrapolation. PCA is then used to break down the RMS of the universe ensemble into principal components (PC) by diagonalizing the covariance matrix constructed from the variance within each sample. For this analysis, the largest five PCs were used with a scale factor to cover the RMS of the systematic universes.\\ PCA is also used to evaluate systematics related to operation of the beam. Two types of systematics are considered. The first account for differences between operation of the NuMI beam and the simulation of the beam. These include the horn current and position, the target position, and the beam spot size. The second type are uncertainties in the hadron production, pions and kaons, at the beam target. The NuMI beam flux is tuned using the Package to Predict the FluX using external data~\cite{Aliaga:2016oaz}. Both types of uncertainties are used to produce principal components in a similar manner to be used in the fit. \\ On NOvA, Muon energy is reconstructed using a piecewise, linear fit between the reconstructed length of the muon track and the true energy of the muon. A systematic was considered on the correspondence between muon range and energy within the NOvA detectors. Both the absolute error in each detector and the error on the ratio used in extrapolation is considered. Many sources of uncertainty were considered, but the errors are dominated by the parameterization of the density effect and the mass accounting in the detector.\\ An uncertainty in the response of the detector to neutrons is new in the antineutrino oscillations analysis. Antineutrino charge current interactions are much more likely to produce final-state neutrons often with several hundred MeV of energy, while neutrino charged current interactions produce final state protons. Modeling these fast neutrons is known to be challenging due to the lack of tagged neutron data. A highly selected neutron rich $\bar\nu_\mu$ CC Quasi-elastic like event sample with neutron angle consistent with the QE hypothesis is selected from NOvA ND data and MC. There is a discrepancy in the total calorimetric energy of reconstructed neutron prongs from $\bar\nu_\mu$ CC events shown in the left of Fig.~\ref{fig:NeutronSystematic}. A new systematic is introduced which scales the amount of deposited energy of some neutrons to cover the low-energy discrepancy. This scaling shifts the mean $\bar\nu_\mu$ energy by 1\% and the mean $\nu_\mu$ energy by 0.5\%~\cite{tyler_numusyst}. \begin{figure}[!htbp] \begin{center} \includegraphics[width=0.96\textwidth]{Figures/Neutronsystematic.pdf} \caption{Prongs are broken down in selected $\bar\nu_\mu$ CC events by the particle, or parent if the parent was a neutrino, that deposited energy in the event. The selection used here is to select a neutron rich sample. \label{fig:NeutronSystematic} \end{center} \end{figure} \section{Cross-Checks with Muon-Removed Electron-Added Sample} \label{sec:mre} The low number of $\nu_{e}$ events makes the cross-checks of the modeling of the hadronic component in the $\nu_e$ signal challenging. Muon-Removed Electron-Added (MRE) is a unique data-driven technique for this channel that uses the large statistics of the $\nu_{\mu}$ CC data events in the ND data sample. A muon-removal algorithm~\cite{Sachdev:2013ema} replaces the muon in selected $\nu_{\mu}$ CC events with a simulated electron of the same energy in Data and Monte Carlo while preserving the nuclear/hadronic portion of the interaction. These hybrid Data/Monte Carlo events allows us to study the impact of any mis-modeling of the hadronic shower on the $\nu_{e}$ selection efficiency.\\ \noindent MRE event generation has three steps as shown in Fig~\ref{fig:MRE}: \begin{enumerate}[label=\textbf{\arabic*}.] \item{\textbf{Generating a muon-removed charged-current (MRCC) sample:} We select the muon track in the event using the muon PID and remove all its associated track hits. Far from the vertex, muon track hits are clean, however, for hits close to the vertex, given that there may be some contamination from the hadronic energy, only a minimum ionizing particle energy (MIP) from each hit near the vertex is removed.} \item{\textbf{Generation of the electron:} Once the muon is removed from the event, an electron with the same starting point, direction, and reconstructed energy of the original muon track is simulated in its place using the standard NOvA GEANT4 tool.} \item{\textbf{Creating a muon-removed, electron-added event:} The simulated electron hits are overlaid with the hits of the MRCC event and the NOvA reconstruction algorithm runs from the beginning.} \end{enumerate} \begin{figure}[!htbp] \begin{center} \includegraphics[width=0.99\textwidth]{Figures/MRE.pdf} \caption{Muon-removed electron-added technique. The ND candidate data $\nu_\mu$-CC event is shown at the left, the muon-removed CC event is shown in middle, and the muon-removed simulated electron (with same energy and direction) replaced event display is shown at the right. } \label{fig:MRE} \end{center} \end{figure} \begin{figure}[!htbp] \begin{center} \includegraphics[width=0.49\textwidth]{Figures/NeutrinoMRECalE.pdf} \includegraphics[width=0.49\textwidth]{Figures/AntineutrinobeamMRECalE.pdf} \caption{The PID selection efficiency as a function of calorimetric energy is shown.} \label{fig:MRECalE} \end{center} \end{figure} The CVN $\nu_e$ and $\bar\nu_e$ events selection efficiencies in Data and Monte Carlo with respect to the pre-selection are compared in Fig~\ref{fig:MRECalE} using the CVN $\nu_e$ selection efficiency on the calorimetric energy (at the left for $\nu_e$ and at the right for $\bar\nu_e$). The data and MC total efficiencies agree at the $2\%$ level for MRE events both in neutrino and antineutrino beams. \section{Cross-Check using Muon Removed Bremsstrahlung Showers} \label{sec:mrbrem} The $\nu_e$ ($\bar\nu_e$) events are identified by the electromagnetic showers induced by $e^-$, or $e^+$, in the final state interactions. The NOvA FD sits on the surface, but it is covered by 3~m of barite rock and concrete which provides an overburden of more than ten radiation lengths to reduce background from cosmic rays. Still, there is a high rate (148 kHz) of cosmic muons observed in the FD. These muons can induce EM showers by three different means: energetic muons undergoing bremsstrahlung radiation (Brem), muons decaying into electrons in flight (DiF), and muons stopping in the detectors and decaying into Michel electrons. Michel electrons typically have energies much smaller than $\nu_{e}$ events, which have energies of 0.5~GeV \-- 4~GeV, and have instead been used as a calibration check. Brem and DiF, on the other hand, provide abundant EM showers in the few-GeV energy region. A pure sample of EM showers is obtained from cosmic data through a modified EM shower filtering algorithm~\cite{Duyang:2015cvk} from the Muon-Removal (MR) algorithm~\cite{Sachdev:2013ema} for charged current events. This sample can be used to characterize the EM signature and provide valuable cross-checks of the MC simulation, reconstruction, CVN algorithms, and calibration of the FD~\cite{Duyang:2015cvk}. The results shown in this section are from Brem showers only. DiF events requires additional event selections which gives lower statistics, but more pure EM samples, and are not included in this section. \\\\ The EM shower filtering algorithm first looks at events for a cosmic EM shower, which has a muon track inside the EM shower region. Then, the MR algorithm removes hits that belong to the muon corresponding to the energy of a MIP in the shower region and saves the remaining EM showers as raw DAQ hits. An example EM shower event display before and after MR from FD cosmic data is shown in Fig.~\ref{fig:MRBrem}. The shower digits can then be put into standard $\nu_e$ reconstruction and PID algorithms. Data and MC comparison is performed with reconstructed shower variables and PID outputs to validate EM shower modeling and PID. Calibration effects can be checked by comparing PID efficiencies as a function of vertex position. \\ \begin{figure}[!htbp] \begin{center} \includegraphics[width=0.97\textwidth]{Figures/MRBrem.pdf} \caption{Bremsstrahlung shower from cosmic moun before (left) and after (right) muon removal.} \label{fig:MRBrem} \end{center} \end{figure} \begin{figure}[!htbp] \begin{center} \includegraphics[width=0.96\textwidth]{Figures/MRBrem_E_angle.pdf} \caption{Brem shower energy vs $\nu_e$ shower energy is shown on left, and the comparison of shower angle $\mathrm{cos(\theta_{beam})}$ is shown on right.} \label{fig:MRBremEnergyangle} \end{center} \end{figure} \begin{figure}[!htbp] \begin{center} \includegraphics[width=0.47\textwidth]{Figures/NeutrinoModeMRBremShowerE.pdf} \includegraphics[width=0.52\textwidth]{Figures/AntineutrinoModeMRBremShowerE.pdf} \caption{The PID selection efficiency as a function of EM showers energy is shown.} \label{fig:MRBremShowerE} \end{center} \end{figure} \noindent MR Brem Shower extraction takes place through the following steps: \begin{enumerate}[label=\textbf{\arabic*}.] \item{\textbf{Muon track selection:} Apply selections to search for a cosmic muon candidate in the FD. A muon track should be long enough to generate bremsstrahlung showers, thus require the number of planes that the muon track traverses to be greater than 30. The muon track is also required to be in the horizontal direction requiring $\mathrm{cos\theta}>0.5$, where $\mathrm\theta$ is the angle of the muon track with respect to the beam axis (Z-axis).} \item{ \textbf{Shower finding:} The shower region is found within the muon track candidate. The shower region is determined by measuring the energy deposition per plane (dE/dx) information.} \item {\textbf{Muon removal:} Once the EM showers are identified, muon hits are removed to get EM shower events.} \item{\textbf{Shower Reconstruction and PID:} The EM shower events are fed into standard $\nu_e$ reconstruction and PID algorithms.} \end{enumerate} \noindent Reconstructed shower energy and angle comparison for Brem showers and $\nu_e$ signal induced EM showers are shown on top plots of Fig.~\ref{fig:MRBremEnergyangle}. The main differences between $\nu_e$ signal and Brem sample is that beam-related $\nu_e$ energy peaks at 2 GeV and its direction is along the NuMI beam line direction whereas cosmic EM shower is mostly coming from vertically into the FD. As a result the CVN selection efficiency is low for muon removed brem showers. To correct this, we reweigh the Brem sample according to $\nu_e$ signal angle to resemble the sample.\\ The CVN $\nu_e$ and $\bar\nu_e$ event selection efficiencies with respect to the pre-selection are calculated to compare Brem data and cosmic simulation. The CVN selection efficiency of EM shower energy in $\nu_e$ and $\bar\nu_e$ events is shown in left and right of Fig~\ref{fig:MRBremShowerE}, respectively. The Data and MC CVN selection efficiency in core sample agrees well within 6\% (3\%) level in neutrino (antineutrino) mode. Efficiency of data and simulated Brem showers agrees within the total extrapolated systematic uncertainties shown in Fig.~\ref{fig:Syst_extrap} for neutrino and antineutrino datasets. \iffalse \section{Results} \label{sec:results} With a full detector equivalent exposure of 8.85$\times10^{20}$ (6.91$\times10^{20}$) protons on target in neutrino (antineutrino) beam modes, NOvA obtained the $\nu_\mu(\bar\nu_\mu)\rightarrow \nu_e(\bar\nu_e)$ data as shown in Table~\ref{tab:nueandantinue}, and the $\nu_\mu(\bar\nu_\mu)\rightarrow\nu_\mu(\bar\nu_\mu)$ data as shown in Table~\ref{tab:numuandantinumu}, see Ref.~\cite{back_ashley}. NOvA has analyzed its first antineutrino data and observed $>4\sigma$ evidence of $\bar\mathrm\nu_e$ appearance~\cite{Neutrino2018}.\\ \begin{table}[t] \caption{$\nu_e$ and $\bar\nu_e $ appearance analysis results} \begin{minipage}{0.30\textwidth} \centering \footnotesize \begin{tabular}{|c|c|c|c|c|c|c|} \hline \multicolumn{6}{|c|}{ Observed 58 $\nu_e$ CC events}\\ \hline \multicolumn{6}{|c|}{\normalsize Expected 30 ($\pi/2$ IH) - 75 ($3\pi/2$ NH) events}\\ \hline \multicolumn{6}{|c|}{ Total background 15.1 events}\\ \hline \hline {$\bar{\nu}_e$ CC}&\normalsize beam $\nu_e$&$\nu_\mu$ CC&$\nu_\tau$ CC& NC&\normalsize cosmic\\ \hline 0.66 & 6.85 & 0.63 & 0.37 & 3.21 & 3.33\\ \hline \end{tabular} \end{minipage} \hfill \begin{minipage}{0.47\textwidth} \footnotesize \centering \begin{tabular}{|c|c|c|c|c|c|c|} \hline \multicolumn{6}{|c|}{ Observed 18 $\bar{\nu}_e$ CC events}\\ \hline \multicolumn{6}{|c|}{ \normalsize Expected 10 ($3\pi/2$ NH) - 22 ($\pi/2$ IH) events}\\ \hline \multicolumn{6}{|c|}{Total background 5.3 events}\\ \hline \hline {$\nu_e$ CC} & \normalsize beam $\nu_e$&$\nu_\mu$ CC&$\nu_\tau$ CC& NC&\normalsize cosmic\\ \hline 1.13 & 2.57 & 0.07 & 0.15 & 0.67 & 0.71\\ \hline \end{tabular} \end{minipage} \label{tab:nueandantinue} \end{table} \begin{table}[t] \caption{$\nu_\mu$ and $\bar\nu_\mu$ disappearance analysis results} \begin{minipage}{0.30\textwidth} \centering \begin{tabular}{|c|c|c|c|} \hline \multicolumn{4}{|c|}{ Observed 113 $\nu_\mu$ CC events}\\ \hline \multicolumn{4}{|c|}{Total background 11.0 events}\\ \hline \hline $\bar{\nu}_\mu$ CC \ & \quad NC \quad \ & other beam bkg & cosmic\\ \hline 7.24 & 1.19 & 0.51 & 2.07\\ \hline \end{tabular}\\ \end{minipage} \hfill \begin{minipage}{0.47\textwidth} \centering \begin{tabular}{|c|c|c|c|} \hline \multicolumn{4}{|c|}{ Observed 65 $\bar{\nu}_\mu$ CC events}\\ \hline \multicolumn{4}{|c|}{Total background 13.7 events}\\ \hline \hline $\nu_\mu$ CC \ & \quad NC \quad \ & other beam bkg & cosmic\\ \hline 12.58 & 0.39 & 0.23 & 0.46\\ \hline \end{tabular} \end{minipage} \label{tab:numuandantinumu} \end{table} The neutrino oscillation results come from a joint fit to neutrino and antineutrino data, $\nu_e+\nu_\mu$. Systematics are treated together, although some affect the samples differently. The three-flavor oscillation parameters measurement from the best fit~\cite{Neutrino2018} prefer Normal Hierarchy, with $\mathrm{\delta_{CP}}$ = $0.17\pi$, $\mathrm{sin}^2\theta_{23} = 0.58 \pm 0.03 (\mathrm{UO})$, and $\Delta m^2_{32}=2.51^{+0.12}_{-0.08}\times 10^{-3} \mathrm{eV}^2$.\\ \section{Future Analysis Improvements} \label{sec:futureana} Significant upgrades to the Fermilab's accelerator complex are planned for next few years, the Proton Improvement Plan - II (PIP-II), is under development to increase the beam power to 900 - 1000~kW from the current design power at 700~kW~\cite{Shiltsev:2017mle}. Higher beam power will produce more neutrinos increasing the statistical power of the measurements.\\ The reduction of systematic uncertainties will be addressed through the NOvA Test Beam program currently under development at Fermilab Test Beam Facility (FTBF)~\cite{NOva-TestbeamProg}. It aims to characterize the NOvA detector response to electromagnetic and hadronic interactions by directing tagged electrons, muons, pions, kaons, and protons in the momentum ranging from 0.2 to 2.0 GeV/c, onto a scaled-down NOvA detector. It will also provide a thorough cross-check of the existing NOvA calibration procedures. Finally, the test beam run can be used to assemble a library of particles at known energies and multiple angles of incidence to help develop a deep learning-based particle identification algorithm, to be used in reconstructing the final state of neutrino interactions in scintillator. The construction and commissioning of the detector is underway. Data taking is planned for the first half of 2019. \vskip 0.3in \fi \section{Summary and Conclusions} \label{sec:summary} NOvA has analyzed it's first $6.9\times10^{20}$ POT antineutrino data together with that of it's $8.85\times10^{20}$ POT neutrino data to set new constraints on neutrino oscillation parameters, and observed $>4\sigma$ evidence of $\bar\nu_e$ appearance. The study of systematic uncertainties and muon-removed cross-checks are crucial elements of this analysis. The efficiency agrees between data and MC at the $2\%$ level for MRE events both in neutrino and antineutrino beam modes and the efficiency of data and simulated MRBrem showers agrees within systematics for neutrino and antineutrino datasets. \section{Acknowledgments} This work was supported by the US Department of Energy; the US National Science Foundation; the Department of Science and Technology, India; the European Research Council; the MSMT CR, Czech Republic; the RAS, RMES, and RFBR, Russia; CNPq and FAPEG, Brazil; and the State and University of Minnesota. We are grateful for the contributions of the staffs at the University of Minnesota module assembly facility and Ash River Laboratory, Argonne National Laboratory, and Fermilab. Fermilab is operated by Fermi Research Alliance, LLC under Contract No. De-AC02-07CH11359 with the US DOE. \bigskip
\section{Introduction} \label{sec:Introduction} Recently, it was revealed that entire families of convergent space discretisations for the incompressible Navier--Stokes equations \begin{subequations} \label{eq:transient:navier:stokes} \begin{empheq}[left=\empheqlbrace]{alignat=2} \partial_t{ \boldsymbol{u} } - \nu \Delta { \boldsymbol{u} } + \rb{{ \boldsymbol{u} } \ip \nabla} { \boldsymbol{u} } + \nabla p & = { \boldsymbol{f} }, \\ \DIV { \boldsymbol{u} } & = 0, \end{empheq} \end{subequations} may deliver inaccurate velocity solutions when strong pressure gradients develop, i.e.\ they suffer from a lack of {\em pressure-robustness} \cite{JLMNR:sirev, cmame:linke:merdon:2016, lr:2018}. Nearly all classical mixed methods like the Taylor--Hood element or (`only' $\LP{2}{}$-conforming) Discontinuous Galerkin (DG) methods belong to these families. Strong pressure gradients reflect strong forces of gradient type within the Navier--Stokes momentum balance, e.g., in the terms ${ \boldsymbol{f} }$, $\rb{{ \boldsymbol{u} } \ip \nabla} { \boldsymbol{u} }$ or $\partial_t{ \boldsymbol{u} }$. Indeed, the lack of {\em pressure-robustness} has been a rather hot research topic in the beginning of the history of finite element methods for CFD \cite{pfc:1989, ff:1985, st:1987, glcl:1980, DGT94, gerbeau:1997} --- sometimes called {\em poor mass conservation} --- and continued to be investigated for many years \cite{GLRW:2012, s:1997, ganesan:john:pressure:separation, SchroederEtAl18}, often in connection with the so-called \emph{grad-div stabilisation} \cite{FH88, olhl2009, CELR:2011, jjlr:2014, AkbasEtAl18, john:novo:2018}. Also, in the geophysical fluid dynamics community and in numerical astrophysics {\em well-balanced} schemes have been proposed to overcome similar issues for related Euler and shallow-water equations, especially in connection to nearly-hydrostatic and nearly-geostrophic flows; cf., for example, \cite{CotterShipton:2012,CotterThuburn:2014, BottaKlein:2004,Klingenberg:2019}. ~\\ However, only recently it was understood better that exactly the relaxation of the divergence constraint for incompressible flows, which was invented in classical mixed methods in order to construct discretely inf-sup stable discretisation schemes, introduces the lack of {\em pressure-robustness}, since it leads to a poor discretisation of the Helmholtz--Hodge projector \cite{lm:2018}. The reason is that the relaxation of the divergence constraint implies a relaxation of the $\LTWO$-orthogonality between discretely divergence-free velocity test functions and arbitrary gradient fields. ~\\ Fortunately, pressure-robust space discretisations behave in a robust manner when confronted with strong pressure gradients, and many different ways to construct such schemes have been found recently. To name only a few, inf-sup stable $\HM{1}{}$-conforming and divergence-free mixed methods \cite{zhang:2005}, inf-sup stable $\HDIV$-conforming DG methods \cite{CockburnEtAl07, Lehrenfeld10} and inf-sup stable $H^1$-conforming and nonconforming finite element methods (FEM), finite volume (FVM) methods, and Hybrid High Order methods (HHO) with appropriately modified velocity test functions \cite{Linke:2012, linke:cmame:2014, dPEL:2016, JLMNR:sirev, lmt:2016, cmame:linke:merdon:2016} are pressure-robust. Moreover, also in the context of isogeometric analysis various pressure-robust discretisations have been developed \cite{BuffaEtAl11,EvansHughes13,EvansHughes13b}. However, it is still not generally widely accepted in the numerical analysis community that {\em pressure-robustness} is simply a prerequisite for the accurate space discretisation of non-trivial Navier--Stokes flows. ~\\ Thus, the goals of this contribution are threefold: \begin{enumerate} \item It will be shown that the need for {\em pressure-robustness} emanates from an improved understanding of mixed methods and the divergence constraint in incompressible flows. It is argued that the {\em divergence constraint} induces equivalence classes of forces that are connected to a semi-norm. The involved semi-norm, in turn, is connected to the Helmholtz--Hodge projector of a vector field and vanishes for arbitrary gradient fields. \item It will be argued that exactly the quadratic nonlinearity of the incompressible Navier--Stokes equations is a major source for strong pressure gradients. An example are vortex-dominated flows with a typical balance of the centrifugal forces --- represented by the nonlinear convection term --- and the pressure gradient. Then, the nonlinear convection term contains a strong gradient part in the sense of the Helmholtz--Hodge decomposition. The corresponding pressure is strong and complicated to approximate due to the balance of a linear term (the pressure gradient) with a quadratic term (the nonlinear convection). \item It will be demonstrated that pressure-robust schemes outperform non-pressure-robust schemes for entire classes of transient incompressible flows at high Reynolds numbers. For generalised Beltrami flows and vortex-dominated flows it will be demonstrated that a pressure-robust scheme with polynomial order $k \geq 2$ for the discrete velocity will be comparably accurate to a non-pressure-robust scheme of order $2 k$ on coarse grids. The astonishing factor $2$ in the possible reduction of the polynomial approximation order stems from the balance of the quadratic nonlinear term with the linear pressure gradient. \end{enumerate} We only briefly remark that the question of an appropriate discretisation of the nonlinear convection term is intimately connected to the issue of numerical convection stabilisation techniques like upwinding or SUPG \cite{Riviere08,brooks:hughes:1982}. With the help of generalised Beltrami flows, we will demonstrate that in real-world flows the nonlinear convection term can be strong, even if the dynamics of the flow is not convection-dominated at all, i.e.\ when measured in the appropriate semi-norm. Thus, our contribution opens the way to an improved understanding of convection stabilisation for incompressible Navier--Stokes flows. Here, the notion of numerical {\em pseudo-dominant convection} is decisive, see Remark \ref{rem:pseudo:dominant:convection}. ~\\ The arguments will be supported by a comparative and paradigmatic numerical analysis of $\HM{1}{}$-conforming pressure-robust and non-pressure-robust space discretisations for transient incompressible Navier--Stokes flows. The analysis exploits essentially the following three observations \cite{alm:2018, lm:2018}: \begin{itemize} \item a pressure-robust space discretisation of the time-dependent Stokes equation for \emph{small viscosities} is essentially error-free on finite (sufficiently short w.r.t.\ the viscosity) time intervals, i.e., the approximation error of the initial values does not grow in time; \item under the same conditions, classical space discretisations of the time-dependent Stokes problem only suffer from large gradient fields in the momentum balance (large pressures), and discrete velocity errors induced by gradient fields accumulate over time; \item the nonlinear convection term is a major source for complicated pressure gradients. \end{itemize} Several numerical experiments will illustrate the theory. In order to explicitly focus on space discretisation, in the practical examples always small time steps are chosen together with second-order time-stepping schemes. Therefore, the error due to time discretisation is always negligible in this work. \paragraph{Organisation of the article} As a basis for this work, Section \ref{sec:FluidDynamics} presents some fundamental reflections on the transient incompressible Navier--Stokes equations, which help to understand the significance of a pressure-robust space discretisation. Among other things, we explain why equivalence classes of forces are important for Navier--Stokes flows, we introduce the notion of generalised Beltrami flows, and we emphasise that the material derivative in incompressible Euler flows with ${ \boldsymbol{f} }={ \boldsymbol{0} }$ is always a gradient field. Afterwards, in Section \ref{sec:NSAndDiscretisation}, the time-dependent Navier--Stokes problem, its weak formulation, the Helmholtz--Hodge projector and its discrete counterpart are discussed in an $\HM{1}{}$-conforming FE setting. Also for $\HM{1}{}$-conforming FEM, a comparative time-dependent $\LP{2}{}$ \emph{a priori} error analysis is presented in Section \ref{sec:ErrorAnalysisH1}. Section \ref{sec:Taylor} discusses how and when non-pressure-robust high-order methods lose about half of their formal convergence order on coarse meshes. In Section \ref{sec:GreshoH1}, the relevance of our considerations for vortex-dominated flows is explained showing numerical results for the Gresho vortex problem computed with $\HM{1}{}$-FEM. Moving to computationally much more versatile $\LP{2}{}$- and $\HDIV$-DG methods, Section \ref{sec:dGFEM} describes their space discretisation and the corresponding DG Helmholtz projectors. The remainder of the work is dedicated to numerical experiments. While Section \ref{sec:ExperimentsKnownSol} deals with generalised Beltrami flows with exact solutions in 2D and 3D, in Section \ref{sec:KarmanBeltrami} we go beyond this and investigate the material derivative of a real-world flow: a von K\'arm\'an vortex street. Finally, some conclusions are drawn and an outlook is given in Section \ref{sec:Conclusions}. \section{Some background from fluid dynamics} \label{sec:FluidDynamics} In this section, we will review some classical concepts from fluid dynamics and put them into perspective with regard to their importance in the subsequent parts of this work. \subsection{Velocity-equivalence of forces} \label{sec:VelocityEquivalence} The dynamics of the incompressible Navier--Stokes equations is driven by its vorticity equation \begin{equation} {\bm \omega}_t -\nu \Delta {\bm \omega} + \rb{{ \boldsymbol{u} } \ip \nabla} {\bm \omega} = \nabla \times { \boldsymbol{f} } + \rb{{\bm \omega} \ip \nabla} { \boldsymbol{u} }, \end{equation} which is formally derived from \eqref{eq:transient:navier:stokes} by applying the curl operator to the momentum balance and substituting ${\bm \omega} \coloneqq \nabla \times { \boldsymbol{u} }$ \cite{chorin:marsden:1993}. Due to $\nabla \times \nabla \phi = { \boldsymbol{0} }$, the two forces ${ \boldsymbol{f} }$ and ${ \boldsymbol{f} } + \nabla \phi$ induce the same velocity field ${ \boldsymbol{u} }$, independent of the scalar potential $\phi$. This leads to an equivalence class of forces, where two forces will be called {\em velocity-equivalent} if they differ only by an arbitrary gradient field, i.e., \begin{equation} \label{eq:equiv:classes} { \boldsymbol{f} } \simeq { \boldsymbol{f} } + \nabla \phi. \end{equation} Indeed, the gradient part (in the sense of the Helmholtz--Hodge decomposition) of any force ${ \boldsymbol{f} }$ in the Navier--Stokes momentum balance only determines the pressure gradient $\nabla p$. In Section \ref{sec:NSAndDiscretisation} this purely formal argument is made precise by introducing the Helmholtz--Hodge projector and a semi-norm that is connected to it. Though the concept of the {\em velocity-equivalence} of forces is relevant for all forces in the Navier--Stokes momentum balance, this contribution will mainly focus on the consequences for the nonlinear convection term $\rb{{ \boldsymbol{u} } \ip \nabla} { \boldsymbol{u} }$ at high Reynolds numbers. \subsection{Generalised Beltrami flows} \label{sec:GenBeltramiFlows} Velocity-equivalence of forces is especially relevant in a specific, but very rich and important class of transient incompressible flows, namely generalised Beltrami flows. E.g., as far as we know, all known {\em exact solutions} (with ${ \boldsymbol{f} }={ \boldsymbol{0} }$) \cite{drazin:riley:2006} of the incompressible Navier--Stokes equations are Galilean-invariant to generalised Beltrami flows. Some of them will be used for our numerical benchmarks below. Generalised Beltrami flows are those flows, whose nonlinear convection term is velocity-equivalent to a zero-force, i.e., it holds \begin{equation*} \rb{{ \boldsymbol{u} } \ip \nabla} { \boldsymbol{u} } \simeq { \boldsymbol{0} }. \end{equation*} Thus, their velocity solution is likewise the solution of an incompressible Stokes problem --- with a different pressure. The main observation for the understanding of generalised Beltrami flows is the following pointwise identity for the nonlinear convection term: \begin{equation} \label{eq:nonlin:identity} \rb{{ \boldsymbol{u} } \ip \nabla} { \boldsymbol{u} } = \rb{\nabla \times { \boldsymbol{u} }} \times { \boldsymbol{u} } + \frac{1}{2} \nabla \abs{ { \boldsymbol{u} } }^2 = {\bm \omega} \times { \boldsymbol{u} } + \frac{1}{2} \nabla \abs{ { \boldsymbol{u} } }^2, \end{equation} where ${\bm \omega} \times { \boldsymbol{u} }$ is usually called the \emph{Lamb vector}. Thus, generalised Beltrami flows can be subdivided into three different subclasses: \begin{enumerate} \item The most famous generalised Beltrami flows are classical potential flows with ${ \boldsymbol{u} } = \nabla h$, where $h$ denotes a (possibly time-dependent) harmonic potential fulfilling $-\Delta h = 0$. Since potential flows are irrotational, it holds ${\bm \omega} = \nabla \times { \boldsymbol{u} } = \nabla \times \rb{\nabla h} = { \boldsymbol{0} }$ and the nonlinear convection term is a gradient field \begin{equation} \rb{{ \boldsymbol{u} } \ip \nabla} { \boldsymbol{u} } = \frac{1}{2} \nabla \abs{ { \boldsymbol{u} } }^2, \end{equation} and the nonlinear convection term is balanced by a pressure gradient $\nabla p= -\frac{1}{2} \nabla \abs{ { \boldsymbol{u} } }^2$. \item The second subclass consists of Beltrami flows. Contrary to potential flows, they are not irrotational, i.e., it holds ${\bm \omega} \not= { \boldsymbol{0} }$, however it holds ${\bm \omega} \times { \boldsymbol{u} } = { \boldsymbol{0} }$, i.e., the vorticity vector of Beltrami flows is parallel to the velocity field. They exist only in the three-dimensional case, because the vorticity of two-dimensional flows is always perpendicular to the velocity field. Again, the pressure gradient is given by $\nabla p= -\frac{1}{2} \nabla \abs{ { \boldsymbol{u} } }^2$. \item Finally, for {\em generalised Beltrami flows} the vorticity is neither zero, nor parallel to the flow field, but the Lamb vector is a gradient field \begin{equation} {\bm \omega} \times { \boldsymbol{u} } = \nabla \phi. \end{equation} Here, the pressure gradient is different, namely $\nabla p= - \nabla \left ( \frac{1}{2} \abs{ { \boldsymbol{u} } }^2 + \phi \right )$. \end{enumerate} It should be remarked that the vorticity equation of a generalised Beltrami flow (with ${ \boldsymbol{f} }={ \boldsymbol{0} }$) is linear and given by \begin{equation} \partial_t{\bm \omega} - \nu \Delta {\bm \omega} = { \boldsymbol{0} }. \end{equation} Thus, a generalised Beltrami flow with ${ \boldsymbol{f} }={ \boldsymbol{0} }$ and time-independent boundary conditions presents a nearly-steady behaviour over long time intervals, at least for small kinematic viscosities $\nu \ll 1$. As a first connection to {\em vortex-dominated flows}, we remark that the slow decay of {\em vortex structures} like the 2D planar lattice flow problem is modelled by such flows \cite{Schroeder2019}. For such a process, a steady Eulerian description is sufficient. \subsection{Galilean invariance and the material derivative} \label{sec:GalileanFlows} In this short subsection, we briefly want to discuss the role of the divergence-free part of the nonlinear convection term $\rb{{ \boldsymbol{u} } \ip \nabla} { \boldsymbol{u} }$. It enters the game whenever a steady Eulerian description is not sufficient anymore. ~\\ Recalling that the incompressible Navier--Stokes equations are Galilean-invariant, we start from a generalised Beltrami flow $({ \boldsymbol{u} }_0, p_0)$, fulfilling \begin{equation*} \partial_t{ \boldsymbol{u} }_0 - \nu \Delta { \boldsymbol{u} }_0 + \rb{{ \boldsymbol{u} }_0 \ip \nabla} { \boldsymbol{u} }_0 + \nabla p_0 = { \boldsymbol{0} }, \qquad \DIV { \boldsymbol{u} }_0 = 0, \end{equation*} and add a constant velocity field ${ \boldsymbol{w} }_0$ such that one obtains a new flow field \begin{equation*} { \boldsymbol{u} }(t, { \boldsymbol{x} }) = { \boldsymbol{w} }_0 + { \boldsymbol{u} }_0(t, { \boldsymbol{x} } - t { \boldsymbol{w} }_0). \end{equation*} Below, the corresponding pressure will be demonstrated to be \begin{equation*} p(t, { \boldsymbol{x} }) = p_0(t, { \boldsymbol{x} } - t { \boldsymbol{w} }_0). \end{equation*} Then, one computes \begin{equation*} \partial_t { \boldsymbol{u} }(t, { \boldsymbol{x} }) = \partial_t \sqb{ { \boldsymbol{u} }_0(t, { \boldsymbol{x} } - t { \boldsymbol{w} }_0) } = \partial_t { \boldsymbol{u} }_0(t, { \boldsymbol{x} } - t { \boldsymbol{w} }_0) - \rb{{ \boldsymbol{w} }_0 \ip \nabla} { \boldsymbol{u} }_0(t, { \boldsymbol{x} } - t { \boldsymbol{w} }_0) \end{equation*} and \begin{subequations} \label{eq:transformed:nonlin:conv} \begin{align} \rb{{ \boldsymbol{u} }(t, { \boldsymbol{x} }) \ip \nabla} { \boldsymbol{u} }(t, { \boldsymbol{x} }) & = \rb{{ \boldsymbol{w} }_0 + { \boldsymbol{u} }_0(t, { \boldsymbol{x} }-t { \boldsymbol{w} }_0) \ip \nabla} { \boldsymbol{u} }_0(t, { \boldsymbol{x} }-t { \boldsymbol{w} }_0) \\ & = \rb{{ \boldsymbol{w} }_0 \ip \nabla} { \boldsymbol{u} }_0(t, { \boldsymbol{x} } - t { \boldsymbol{w} }_0) + \rb{{ \boldsymbol{u} }_0(t, { \boldsymbol{x} }-t { \boldsymbol{w} }_0) \ip \nabla} { \boldsymbol{u} }_0(t, { \boldsymbol{x} }-t { \boldsymbol{w} }_0). \end{align} \end{subequations} Therefore, for the material derivative of ${ \boldsymbol{u} }$ it holds \begin{equation*} \frac{{ \mathrm{D} } { \boldsymbol{u} }(t, { \boldsymbol{x} })}{{ \mathrm{D} } t} \coloneqq \partial_t { \boldsymbol{u} }(t, { \boldsymbol{x} }) + \rb{{ \boldsymbol{u} }(t, { \boldsymbol{x} }) \ip \nabla} { \boldsymbol{u} }(t, { \boldsymbol{x} }) = \partial_t { \boldsymbol{u} }_0(t, { \boldsymbol{x} } - t { \boldsymbol{w} }_0) + \rb{{ \boldsymbol{u} }_0(t, { \boldsymbol{x} } - t { \boldsymbol{w} }_0) \ip \nabla} { \boldsymbol{u} }_0(t, { \boldsymbol{x} } - t { \boldsymbol{w} }_0), \end{equation*} which is invariant under the Galilean transformation. Since it further holds \begin{equation*} -\nu \Delta { \boldsymbol{u} }(t, { \boldsymbol{x} })=-\nu \Delta { \boldsymbol{u} }_0(t, { \boldsymbol{x} } - t { \boldsymbol{w} }_0) \end{equation*} and $\DIV { \boldsymbol{u} }(t, { \boldsymbol{x} }) = 0$, the pair $({ \boldsymbol{u} }(t, { \boldsymbol{x} }), p(t, { \boldsymbol{x} }))$ does indeed fulfil the incompressible Navier--Stokes equations with ${ \boldsymbol{f} }={ \boldsymbol{0} }$. ~\\ Besides the gradient part $\rb{{ \boldsymbol{u} }_0(t, { \boldsymbol{x} }-t { \boldsymbol{w} }_0) \ip \nabla} { \boldsymbol{u} }_0(t, { \boldsymbol{x} }-t { \boldsymbol{w} }_0)$ (due to the generalised Beltrami property of ${ \boldsymbol{u} }_0$), the transformed nonlinear convection term \eqref{eq:transformed:nonlin:conv} does contain the new contribution $\rb{{ \boldsymbol{w} }_0 \ip \nabla} { \boldsymbol{u} } = \nabla { \boldsymbol{u} }_0(t, { \boldsymbol{x} } - t { \boldsymbol{w} }_0) { \boldsymbol{w} }_0$. For this contribution, it holds \begin{equation*} \DIV \rb{ \nabla { \boldsymbol{u} }_0(t, { \boldsymbol{x} } - t { \boldsymbol{w} }_0) { \boldsymbol{w} }_0 } = \DIV \rb{ \rb{{ \boldsymbol{w} }_0 \ip \nabla} { \boldsymbol{u} } } = \rb{{ \boldsymbol{w} }_0 \ip \nabla} (\DIV { \boldsymbol{u} }) = 0. \end{equation*} Thus, the nonlinear convection term of flows that are Galilean-invariant to a generalised Beltrami flow contains {\em both a divergence-free and a gradient-field} part. The corresponding vorticity equation remains linear, but contains an additional linear convection term \begin{equation} \partial_t{\bm \omega} - \nu \Delta {\bm \omega} + \rb{{ \boldsymbol{w} }_0 \ip \nabla} {\bm \omega} = { \boldsymbol{0} }. \end{equation} By means of an example in the next subsection we will demonstrate that the divergence-free part of the nonlinear convection term is responsible for the transport of geometric structures in the flow (like vortices, vortex filaments, \ldots), while the gradient field part prevents the dispersion of geometric structures, thereby ensuring conservation of mass. Thus, the gradient field part of the nonlinear convection term is of major importance for incompressible high Reynolds number flows, although it represents a challenge for non-pressure-robust space discretisations. \subsection{Steady solutions of the incompressible Euler equations, Galilean invariance and the Euler material derivative} \label{sec:EulerFlows} In this subsection we will slightly go beyond generalised Beltrami flows with ${ \boldsymbol{f} }={ \boldsymbol{0} }$ and discuss the limit case $\mathrm{Re} \to \infty$, leading to the incompressible Euler equations with ${ \boldsymbol{f} }={ \boldsymbol{0} }$; that is, \begin{subequations} \label{eq:transient:euler} \begin{empheq}[left=\empheqlbrace]{alignat=2} \partial_t{ \boldsymbol{u} } + \rb{{ \boldsymbol{u} } \ip \nabla} { \boldsymbol{u} } + \nabla p & = { \boldsymbol{0} }, \\ \DIV { \boldsymbol{u} } & = 0. \end{empheq} \end{subequations} First, we want to remind the reader that vortices, vortex lines and vortex filaments are the building blocks of fluid dynamics \cite{chorin:marsden:1993}. Vortex-like solutions can be obtained as steady solutions of the incompressible Euler equations \eqref{eq:transient:euler}, for which it holds \begin{equation*} \rb{{ \boldsymbol{u} } \ip \nabla} { \boldsymbol{u} } = - \nabla p. \end{equation*} Thus, every steady solution ${ \boldsymbol{u} }$ of the incompressible Euler equations has a nonlinear convection term which is velocity-equivalent to a zero force, \begin{equation*} \rb{{ \boldsymbol{u} } \ip \nabla} { \boldsymbol{u} } \simeq { \boldsymbol{0} }, \end{equation*} in the sense of corresponding equivalence classes of forces as introduced above. In the frictionless Euler setting, there exist even steady solutions with a compact support like the famous Gresho vortex, see Section \ref{sec:GreshoH1}. Indeed, for steady solutions of the incompressible Euler equations with a compact support mainly the centrifugal force and the pressure gradient balance, similar to a tornado. Self-evidently, the centrifugal force is modelled by the (quadratic) convection term of the incompressible Euler and Navier--Stokes equations. We remark that steady solutions of the incompressible Euler equations can contain an immense amount of kinetic energy, which is contained in {\em rotational degrees of freedom}, though. This rotational kinetic energy can be unleashed, whenever vortices or vortex filaments interact with each other or interact with the boundary of the domain. ~\\ Since all considerations from Subsection \ref{sec:GalileanFlows} about the Galilean invariance of the incompressible Navier--Stokes equations are valid for the Euler equations as well, the divergence-free part of the nonlinear convection term leads to a transport of structures; cf.\ the example of the Gresho vortex in Section \ref{sec:GreshoH1} in the case ${ \boldsymbol{w} }_0 \neq { \boldsymbol{0} }$. ~\\ Moreover, looking at \eqref{eq:transient:euler}, we recognise that for the material derivative of incompressible Euler flows with ${ \boldsymbol{f} }={ \boldsymbol{0} }$ it holds \begin{equation} \frac{{ \mathrm{D} } { \boldsymbol{u} }}{{ \mathrm{D} } t} = \partial_t{ \boldsymbol{u} } + \rb{{ \boldsymbol{u} } \ip \nabla} { \boldsymbol{u} } = -\nabla p, \end{equation} i.e., for the Euler material derivative one obtains \begin{equation} \frac{{ \mathrm{D} } { \boldsymbol{u} }}{{ \mathrm{D} } t} \simeq { \boldsymbol{0} }. \end{equation} Thus, strong forces of gradient field type are typical for incompressible Euler and Navier--Stokes flows at high Reynolds numbers, e.g., due to a force balance of the nonlinear centrifugal force and a strong, nontrivial pressure gradient. ~\\ The next subsection serves to illustrate that strong and `complicated' gradient fields in the Navier--Stokes momentum balance lead to numerical errors for {\em non-pressure-robust} space discretisations, while {\em pressure-robust} discretisations behave well. \subsection{Hydrostatics: Complicated pressure} \label{sec:ComplicatedPressure} Let us explain in more detail, what we usually mean by `complicated pressures'. The most important point is that `complicated' is always meant \emph{compared to the velocity}. In this sense, a complicated pressure in a particular flow is always a relative concept. ~\\ In hydrostatics (flow at rest, no-flow), the pressure usually balances an external (gradient) force field, which makes it a perfect example for presenting `complicated pressures'. For ease of presentation, suppose we want to solve the incompressible Stokes problem ($\nu=1$), with a right-hand side forcing term ${ \boldsymbol{f} }=\nabla\phi / \int_\Omega \phi$. Here, the normalisation is made to ensure comparable situations for different potentials $\phi$. The left-hand side column in Figure~\ref{fig:no-flow-stokes} shows different potentials $\phi=y^\gamma$ for $\gamma=1,2,4,9$ in a domain $\Omega$ which resembles a glass geometry. Note that the pressure behaves analogously as these potentials and thus, they can be considered `complicated' compared to the exact velocity solution ${ \boldsymbol{u} }={ \boldsymbol{0} }$ in hydrostatics problems. ~\\ \begin{figure}[h] \centering \includegraphics[width=0.9\textwidth]{no-flow/pdf/Stokes-no-flow.pdf} \caption{Stokes no-flow problem in a glass, demonstrating the concept of complex pressures and the advantages of using pressure-robust methods. The left-hand side column shows the potential $\phi=y^\gamma$ for $\gamma=1,2,4,9$ and the underlying triangular mesh for all computations. The other columns show velocity magnitude $\abs{{ \boldsymbol{u} }_h}$ for the non-pressure-robust $\protect\PPdk{k}{}/\Pdk{k-1}{}$ method and the pressure-robust and divergence-free $\protect\BDMk{1}{}/\Pdk{0}{}$ method.} \label{fig:no-flow-stokes} \end{figure} Now, all other plots in Figure~\ref{fig:no-flow-stokes} show the velocity solution of different numerical methods for the particular problem. The chosen methods are $\LTWO$- ($\PPdk{k}{}/\Pdk{k-1}{}$) and $\HDIV$-based ($\BDMk{1}{}/\Pdk{0}{}$) DG methods on triangular meshes of different order $k$ (polynomial order of the discrete velocity approximations), In the present context, it suffices to know that the former are non-pressure-robust whereas the latter are pressure-robust and divergence-free; cf.\ Section~\ref{sec:dGFEM} for more details. ~\\ One can see that the low-order ($k=1$) pressure-robust method computes the correct velocity solution ${ \boldsymbol{u} }_h={ \boldsymbol{0} }$ \emph{independent} of the pressure/potential, even though the discrete pressure space only consists of piecewise constants. The non-pressure-robust method, on the other hand, only leads to ${ \boldsymbol{u} }_h={ \boldsymbol{0} }$ if $k-1\geqslant \gamma$, as in this situation the pair $\rb{{ \boldsymbol{u} },p}$ is contained in the discrete FE spaces. Moreover, one can see that whenever the non-pressure-robust method gives ${ \boldsymbol{u} }_h\neq{ \boldsymbol{0} }$, the quality of the solution decreases as $\gamma$ increases, i.e.\ as the pressure becomes more and more complicated. On the other hand, increasing the order $k$ of the discretisation improves the solution; this is simply $k$-convergence. \section{Time-dependent Navier--Stokes problem and ${\emph{\textbf{H}}^{\mathbf{1}}}$ discretisation} \label{sec:NSAndDiscretisation} After a very brief introduction to the governing equations on the continuous level, we introduce the spatial $\HM{1}{}$-conforming discretisation schemes which will be used for the error analysis in the first part of this work. They consist of an exactly divergence-free, pressure-robust method and a classical non-pressure-robust FEM. \subsection{Infinite-dimensional Navier--Stokes equations} We consider the time-dependent incompressible Navier--Stokes problem, which reads \begin{subequations}\label{eq:TINS} \begin{empheq}[left=\empheqlbrace]{alignat=2} \partial_t{ \boldsymbol{u} } - \nu\Delta { \boldsymbol{u} } + \rb{{ \boldsymbol{u} }\ip\nabla}{ \boldsymbol{u} } +\nabla p &= { \boldsymbol{f} } \qquad\quad &&\text{in }\rsb{0,{ T }}\times\Omega, \\ \DIV{ \boldsymbol{u} } &= 0 &&\text{in }\rsb{0,{ T }}\times\Omega, \\ { \boldsymbol{u} }\rb{0,{ \boldsymbol{x} }} &={ \boldsymbol{u} }_0\rb{{ \boldsymbol{x} }} &&\text{for } { \boldsymbol{x} }\in\Omega. \end{empheq} \end{subequations} For the space dimension $d\in\set{2,3}$, $\Omega\subset\mathbb{R}^d$ denotes a connected bounded Lipschitz domain and ${ T }$ is the end of time considered in the particular problem. Since in the numerical analysis below we want to compare the best possible convergence rates for pressure-robust and classical space discretisations in the $\LPOne{2}{}$-norm, we will assume for technical reasons that $\Omega$ is convex, leading to elliptic regularity. Moreover, ${ \boldsymbol{u} } \colon\sqb{0,{ T }}\times\Omega\to\mathbb{R}^d$ indicates the velocity field, $p\colon\sqb{0,{ T }}\times\Omega\to\mathbb{R}$ is the (zero-mean) kinematic pressure, ${ \boldsymbol{f} }\colon\sqb{0,{ T }}\times\Omega\to\mathbb{R}^d$ represents external body forces and ${ \boldsymbol{u} }_0\colon \Omega\to\mathbb{R}^d$ stands for a suitable initial condition for the velocity. The underlying fluid is assumed to be Newtonian with constant (dimensionless) kinematic viscosity $0<\nu\ll 1$. We impose either the general Dirichlet boundary condition ${ \boldsymbol{u} }={ \boldsymbol{g}_\Drm }$ on $\rsb{0,{ T }}\times\partial\Omega$, or periodic boundary conditions (or a mixture of them). \paragraph{Notation} In what follows, for $K\subseteq\Omega$ we use the standard Sobolev spaces $\Wmp{m}{p}{\rb{K}}$ for scalar-valued functions with associated norms $\norm{\cdot}_{\Wmp{m}{p}{\rb{K}}}$ and seminorms $\abs{\cdot}_{\Wmp{m}{p}{\rb{K}}}$ for $m\geqslant 0$ and $p\geqslant 1$. We obtain the Lebesgue space $\Wmp{0}{p}{\rb{K}}=\Lp{p}{\rb{K}}$ and the Hilbert space $\Wmp{m}{2}{\rb{K}}=\Hm{m}{\rb{K}}$. Additionally, the closed subspaces $\Hmz{1}{\rb{K}}$ consisting of $\Hm{1}{\rb{K}}$-functions with vanishing trace on $\partial K$ and the set $\Lpz{2}{\rb{K}}$ of $\Lp{2}{\rb{K}}$-functions with zero mean in $K$ play an important role. The $\Lp{2}{\rb{K}}$-inner product is denoted by $\rb{\cdot,\cdot}_K$ and, if $K=\Omega$, we sometimes omit the domain completely when no confusion can arise. Furthermore, with regard to time-dependent problems, given a Banach space $\XX$ and a time instance $t$, the Bochner space $\Lp{p}{\rb{0,t;\XX}}$ for $p\in\sqb{1,\infty}$ is used. In the case $t={ T }$, we frequently use the abbreviation $\Lp{p}{\rb{\XX}}=\Lp{p}{\rb{0,{ T };\XX}}$. Further, $C^1(0, t; \XX)$ denotes the function space mapping $\sqb{0, t}$ into $\XX$, which is continuously differentiable in time w.r.t.\ the norm $\norm{{ \boldsymbol{u} }}_{C^1(0, t; \XX)} \max_{s \in \sqb{0,{ T }}} (\norm{{ \boldsymbol{u} }}_\XX + \norm{{ \boldsymbol{u} }_t}_\XX)$. Spaces and norms for vector- and tensor-valued functions are indicated with bold letters. For example, for a vector-valued function ${ \boldsymbol{v} }=\rb{v_1,\dots,v_n}^\dag$, we consider $\norm{{ \boldsymbol{v} }}_\LP{p}{{ \rb{\Omega} }}^p=\sum_{i=1}^n \norm{v_i}_\Lp{p}{{ \rb{\Omega} }}^p =\int_\Omega \abs{{ \boldsymbol{v} }}_p^p { \,\drm\xx }$, where $\abs{{ \boldsymbol{v} }}_p^p=\sum_{i=1}^n \abs{v_i}^p$. The vorticity of a 2D velocity field ${ \boldsymbol{u} }=\rb{u_1,u_2}^\dag$ is defined as $\omega =\partial_{x_1}u_2 - \partial_{x_2}u_1$. ~\\ Depending on the particular boundary conditions, let $\VV/{ Q }$ be the continuous solution spaces for velocity and pressure, respectively. Note that it holds $\VV\subset\HM{1}{{ \rb{\Omega} }}$ and ${ Q }\subset\Lp{2}{{ \rb{\Omega} }}$. For the numerical analysis in this and the next section, we will always choose $\VV=\HH^1_0{ \rb{\Omega} }$ and $Q_h=L^2_0{ \rb{\Omega} }$. The subspace of weakly divergence-free functions is defined as \begin{equation*} \VV^{ \mathrm{div} } = \set{{ \boldsymbol{v} }\in\VV\colon \rb{q,\DIV{ \boldsymbol{v} }}=0,~\forall\,q\in{ Q }}. \end{equation*} A weak velocity solution ${ \boldsymbol{u} } \in \Lp{2}{\rb{0,{ T };\VV^{ \mathrm{div} }}}$ of \eqref{eq:TINS} fulfils that for all test functions ${ \boldsymbol{v} } \in \VV^{ \mathrm{div} }$ holds \begin{equation} \label{eq:weak:NSE} \frac{{ \mathrm{d} }}{{ \mathrm{d} } t} \rb{{ \boldsymbol{u} }(t), { \boldsymbol{v} }} + \nu \rb{\nabla { \boldsymbol{u} }(t), \nabla { \boldsymbol{v} }} + \rb{({ \boldsymbol{u} }(t) \ip \nabla) { \boldsymbol{u} }(t), { \boldsymbol{v} }} = \bra{{ \boldsymbol{f} }(t), { \boldsymbol{v} }}_{\HH^{-1}, \HH^1_0} \end{equation} in the sense of distributions in $\mathcal{D}'(]0, T[)$ and such that ${ \boldsymbol{u} }(0) = { \boldsymbol{u} }_0$ \cite{BoyerFabrie13}. Note that the pressure $p$ is not part of the weak formulation of the incompressible Navier--Stokes problem, see Remark \ref{rem:weak:eq:forces}. For the numerical analysis, we will further assume the regularity ${ \boldsymbol{u} } \in \Lp{1}{\rb{\WMP{1}{\infty}{}}}$, ensuring, e.g., uniqueness of the weak solution in time \cite{bt:2013, SchroederLube17b}. Further (technical) regularity assumptions will be made at appropriate places in the contribution. Then, $({ \boldsymbol{u} }, p)$ fulfils \begin{subequations} \label{eq:WeakContinuous} \begin{empheq}[left=\empheqlbrace]{align} \text{Find }\rb{{ \boldsymbol{u} },p}&\colon\rsb{0,{ T }}\to\VV\times{ Q } \text{ with }{ \boldsymbol{u} }\rb{0}={ \boldsymbol{u} }_{0} \text{ s.t., }\forall\,\rb{{ \boldsymbol{v} },q}\in\VV\times{ Q },\\ \rb{\partial_t{ \boldsymbol{u} },{ \boldsymbol{v} }} &+\nu \rb{\nabla{ \boldsymbol{u} },\nabla{ \boldsymbol{v} }} + \rb{\rb{{ \boldsymbol{u} }\ip\nabla}{ \boldsymbol{u} },{ \boldsymbol{v} }} - \rb{p,\DIV{ \boldsymbol{v} }} + \rb{q,\DIV{ \boldsymbol{u} }} = \rb{{ \boldsymbol{f} },{ \boldsymbol{v} }}. \end{empheq} \end{subequations} \subsection{Helmholtz--Hodge decomposition in $\textbf{L}^\textbf{2}$} In order to understand the significance of pressure-robustness for the discretisation theory of the incompressible Navier--Stokes equations \eqref{eq:TINS}, the concept of the Helmholtz--Hodge projector is introduced. Since the numerical analysis below is essentially an $\LP{2}{}$ analysis (assuming all forces $\partial_t{ \boldsymbol{u} }(t)$, $({ \boldsymbol{u} }(t) \ip \nabla) { \boldsymbol{u} }(t)$, \ldots to be in $\LP{2}{}$), we will restrict our considerations to the Helmholtz--Hodge decomposition in $\LP{2}{}$. Below in this section, some functional analytic prerequisites are summarised that show that only the divergence-free parts, i.e., the Helmholtz--Hodge projectors of the forces in the Navier--Stokes momentum balance influence the velocity solution of the incompressible Navier--Stokes equations, see also \cite{JLMNR:sirev}. ~\\ The space of square-integrable divergence-free (solenoidal) vector fields is defined by \begin{equation} \label{eq:def:lp:sigma} \LPOne{2}_{\sigma}{ \rb{\Omega} } \coloneqq \set{ { \boldsymbol{w} } \in \LPOne{2}{ \rb{\Omega} }\colon -\rb{{ \boldsymbol{w} }, \nabla \phi} = 0,~\forall\,\phi \in H^1(\Omega) }. \end{equation} \begin{remark} \label{rem:helm:bcs} First note that for $\phi \in C^\infty_0{ \rb{\Omega} }$ the mapping $\phi \mapsto -({ \boldsymbol{w} }, \nabla \phi)$ denotes the distributional divergence of ${ \boldsymbol{w} }$. Thus, vector fields in $\LPOne{2}_{\sigma}{ \rb{\Omega} }$ are divergence-free \cite{JLMNR:sirev}. Further note that definition \eqref{eq:def:lp:sigma} implies that $\restr{{ \boldsymbol{w} }\ip{ \boldsymbol{n} }}{\partial\Omega}=0$, where ${ \boldsymbol{n} }$ denotes the outer unit normal vector on $\partial\Omega$, since test functions $\phi \in H^1$ do not vanish on the boundary of $\Omega$. In this context, please also note that a Helmholtz--Hodge decomposition is made unique only by prescribing certain boundary conditions. The reason is that any gradient of a harmonic function with $-\Delta h = 0$ is irrotational and divergence-free at the same time. Thus, the boundary conditions determine whether $\nabla h$ is called 'divergence-free' or 'gradient field'. In our setting, all gradients of harmonic functions are called 'gradient fields', and vector fields in $\LPOne{2}_{\sigma}{ \rb{\Omega} }$ are orthogonal to all gradient fields in $\LPOne{2}$. \end{remark} \begin{remark} \label{rem:lp} Our considerations regard the Helmholtz--Hodge decomposition in $\LP{2}{}$ of $({ \boldsymbol{u} } \ip \nabla) { \boldsymbol{u} }$. Since we assume that ${ \boldsymbol{u} } \in \WW^{1, \infty}$, it holds $({ \boldsymbol{u} } \ip \nabla) { \boldsymbol{u} } \in \LP{2}{}$. \end{remark} Due to the special choice of the boundary conditions and Remark \ref{rem:helm:bcs} one obtains the following theorem, for which the proof will be repeated for completeness and readability of the manuscript from \cite{JLMNR:sirev}: \begin{theorem}[Helmholtz--Hodge decomposition in $\textbf{L}^\textbf{2}$] For every vector field ${ \boldsymbol{v} } \in \LP{2}{{ \rb{\Omega} }}$, there exists a unique Helmholtz--Hodge decomposition \begin{equation} \label{helmholtz:hodge:decomposition} { \boldsymbol{v} } = { \boldsymbol{w} } + \nabla \psi, \end{equation} where it holds ${ \boldsymbol{w} } \in \LPOne{2}_{\sigma}(\Omega)$, and $\psi \in H^1{ \rb{\Omega} }$ and ${ \boldsymbol{w} }$ and $\nabla \psi$ are $\LPOne{2}$-orthogonal. Then, ${ \boldsymbol{w} } \eqqcolon { \mathbb{P} }({ \boldsymbol{v} })$ is called the Helmholtz--Hodge projector of ${ \boldsymbol{v} }$. \end{theorem} \begin{proof} A potential $\psi \in H^1(\Omega) / \mathbb{R}$ in the Helmholtz--Hodge decomposition is obtained by: for all $\chi \in H^1(\Omega) / \mathbb{R}$ holds \begin{equation} \label{eq:weak:helm:problem} (\nabla \psi, \nabla \chi) = ({ \boldsymbol{v} }, \nabla \chi). \end{equation} This Neumann problem for $\psi$ is uniquely solvable \cite{JLMNR:sirev}. Then, define ${ \boldsymbol{w} } \coloneqq { \boldsymbol{v} } - \nabla \psi$. One can test ${ \boldsymbol{w} }$ with arbitrary gradient fields $\nabla (\phi + C)$, where $C$ denotes an arbitrary real number and where it holds $\phi \in H^1{ \rb{\Omega} }/\mathbb{R}$. Then, one obtains $({ \boldsymbol{w} }, \nabla (\phi + C)) = ({ \boldsymbol{w} }, \nabla \phi)= ({ \boldsymbol{v} } - \nabla \psi, \nabla \phi) = 0$, due to \eqref{eq:weak:helm:problem}. Thus, it holds ${ \boldsymbol{w} } \in \LPOne{2}_{\sigma}{ \rb{\Omega} }$. Due to the definition of $\LPOne{2}_{\sigma}{ \rb{\Omega} }$, ${ \boldsymbol{w} }$ and $\nabla \psi$ are orthogonal in $\LPOne{2}$. Assuming that ${ \boldsymbol{v} } = { \boldsymbol{w} }_1 + \nabla \psi_1={ \boldsymbol{w} }_2 + \nabla \psi_2$ are two Helmholtz--Hodge decompositions of ${ \boldsymbol{v} }$, then it holds \begin{equation*} { \boldsymbol{w} }_1 - { \boldsymbol{w} }_2 = \nabla (\psi_2 - \psi_1) \end{equation*} with ${ \boldsymbol{w} }_1 - { \boldsymbol{w} }_2 \in \LPOne{2}_{\sigma}{ \rb{\Omega} }$. Testing this equality by $\nabla (\psi_1-\psi_2)$ yields by the $\LPOne{2}$-orthogonality of \eqref{eq:weak:helm:problem} \begin{equation*} \norm{\nabla (\psi_2 - \psi_1)}^2_{\LPOne{2}{ \rb{\Omega} }}=0, \end{equation*} and one concludes ${ \boldsymbol{w} }_1={ \boldsymbol{w} }_2$ and $\psi_1=\psi_2$ using $\psi_1, \psi_2 \in H^1(\Omega)/\mathbb{R}$. Thus, the Helmholtz--Hodge decomposition is unique. \end{proof} \begin{remark} Formally, the Helmholtz--Hodge decomposition of ${ \boldsymbol{v} }\in\LP{2}{{ \rb{\Omega} }}$ can be written as the solution of the PDE problem \begin{subequations} \label{eq:HelmholtzLeray} \begin{empheq}[left=\empheqlbrace]{alignat=2} \HL{{ \boldsymbol{v} }} + \nabla \psi &= { \boldsymbol{v} } \qquad\quad &&\text{in }\Omega, \\ \DIV\HL{{ \boldsymbol{v} }} &= 0 &&\text{in }\Omega, \\ \HL{{ \boldsymbol{v} }}\ip{ \boldsymbol{n} } &=0 &&\text{on } \partial\Omega. \end{empheq} \end{subequations} \end{remark} The most important property of the Helmholtz--Hodge projector for our contribution is given as follows: \begin{lemma} \label{lem:helm:vanishes:for:gradients}% For all $\psi \in H^1{ \rb{\Omega} }$, it holds \begin{equation*} { \mathbb{P} }(\nabla \psi) = { \boldsymbol{0} }. \end{equation*} \end{lemma} \begin{proof} Note that $\nabla \psi = { \boldsymbol{0} } + \nabla \psi$ is the unique Helmholtz--Hodge decomposition of $\nabla \psi$. Thus, it follows ${ \mathbb{P} }(\nabla \psi) = { \boldsymbol{0} }$. \end{proof} Finally, it is emphasised that the velocity solution ${ \boldsymbol{u} }$ of \eqref{eq:weak:NSE} is completely determined by testing the momentum equation with divergence-free velocity test functions ${ \boldsymbol{v} } \in \VV^{ \mathrm{div} }$ and by its initial value ${ \boldsymbol{u} }_0$. Assuming smoothness of ${ \boldsymbol{u} }$ in space and time, ${ \boldsymbol{u} }$ fulfils for all ${ \boldsymbol{v} } \in \VV^{ \mathrm{div} }$ \begin{subequations} \begin{align} \label{eq:helm:equiclasses} \rb{\partial_t{ \boldsymbol{u} },{ \boldsymbol{v} }} &+\nu \rb{\nabla{ \boldsymbol{u} },\nabla{ \boldsymbol{v} }} + \rb{\rb{{ \boldsymbol{u} }\ip\nabla}{ \boldsymbol{u} },{ \boldsymbol{v} }} = \rb{{ \boldsymbol{f} },{ \boldsymbol{v} }} \qquad \Leftrightarrow \\ &\rb{{ \mathbb{P} }(\partial_t{ \boldsymbol{u} }),{ \boldsymbol{v} }} -\nu \rb{{ \mathbb{P} }(\Delta { \boldsymbol{u} }), { \boldsymbol{v} }} + \rb{{ \mathbb{P} }(\rb{{ \boldsymbol{u} }\ip\nabla}{ \boldsymbol{u} }),{ \boldsymbol{v} }} = \rb{{ \mathbb{P} }({ \boldsymbol{f} }),{ \boldsymbol{v} }}. \end{align} \end{subequations} \begin{remark} \label{rem:weak:eq:forces} Equation \eqref{eq:helm:equiclasses} shows that the velocity solution ${ \boldsymbol{u} }$ of the incompressible Navier--Stokes equations is not determined by the forces ${ \boldsymbol{f} }$ in the momentum equation themselves, but by their Helmholtz--Hodge projectors ${ \mathbb{P} }({ \boldsymbol{f} })$. Therefore, two forces ${ \boldsymbol{f} }$ and ${ \boldsymbol{g} }$ that differ by a gradient field ${ \boldsymbol{f} }={ \boldsymbol{g} } + \nabla \phi$, lead to the same velocity solution. Thus, the velocity solution of the incompressible Navier--Stokes equations is naturally determined by equivalence classes of forces, where it holds \begin{equation*} { \boldsymbol{f} } \simeq { \boldsymbol{g} } \qquad \Leftrightarrow \qquad { \mathbb{P} }({ \boldsymbol{f} }) = { \mathbb{P} }({ \boldsymbol{g} }). \end{equation*} \end{remark} \subsection{$\emph{\textbf{H}}^{\mathbf{1}}$ finite element methods} \label{sec:H1FEM} Let $\VV_h/{ Q }_h$ be the considered discretely inf-sup stable velocity/pressure FE pair, where $\VV_h\subset\VV$ and ${ Q }_h\subset{ Q }$. We assume that the discrete velocity space contains polynomials up to degree ${k_{{ \boldsymbol{u} }}}$ and the discrete pressure space contains polynomials up to degree $k_p$. Note that for most discretely inf-sup stable schemes it holds $k_p = {k_{{ \boldsymbol{u} }}}-1$. An example is the Taylor--Hood finite element family $\PPk{k}{}/\Pk{k-1}{}$ with $k \geqslant 2$ \cite{John16}. However, for the famous mini element it holds $k_p={k_{{ \boldsymbol{u} }}} (= 1)$ \cite{abf:1984}. In the following numerical analysis, $C>0$ always denotes a generic constant, whose value is independent of the mesh size but possibly dependent on the mesh-regularity. ~\\ In order to approximate \eqref{eq:TINS}, or equivalently \eqref{eq:WeakContinuous}, the following generic semi-discrete FEM is considered: \begin{subequations} \label{eq:H1-FEM} \begin{empheq}[left=\empheqlbrace]{align} \text{Find }\rb{{ \boldsymbol{u} }_h,p_h}\colon\rsb{0,{ T }}\to\VV_h\times{ Q }_h \text{ with }{ \boldsymbol{u} }_h\rb{0}={ \boldsymbol{u} }_{0h} \text{ s.t., }\forall\,\rb{{ \boldsymbol{v} }_h,q_h}\in\VV_h\times{ Q }_h&,\\ \rb{\partial_t{ \boldsymbol{u} }_h,{ \boldsymbol{v} }_h} +\nu \rb{\nabla{ \boldsymbol{u} }_h,\nabla{ \boldsymbol{v} }_h} + \rb{\rb{{ \boldsymbol{u} }_h\ip\nabla}{ \boldsymbol{u} }_h + \frac{1}{2}\rb{\DIV{ \boldsymbol{u} }_h}{ \boldsymbol{u} }_h,{ \boldsymbol{v} }_h} - \rb{p_h,\DIV{ \boldsymbol{v} }_h} &= \rb{{ \boldsymbol{f} },{ \boldsymbol{v} }_h} \\ \rb{q_h,\DIV{ \boldsymbol{u} }_h} &= 0. \end{empheq} \end{subequations} Now, the choice of the FE spaces decides whether an exactly divergence-free, pressure-robust method is applied or not. For example, the Scott--Vogelius element $\PPk{k}{}/\Pdk{k-1}{}$ is discretely inf-sup stable on shape-regular, barycentrically refined meshes for $k \geqslant d$ \cite{zhang:2005}, or on meshes without singular vertices for $k\geqslant 2d$; then it yields an exactly divergence-free and thus pressure-robust method. On the other hand, for example, a classical $\PPk{k}{}/\Pk{k-1}{}$ Taylor--Hood element is a non-pressure-robust method. Note that the explicit skew-symmetrisation of the convective term is only necessary for a non-divergence-free FEM. ~\\ The subspace of discretely divergence-free functions is given by \begin{align*} \VV_h^{ \mathrm{div} } = \set{{ \boldsymbol{v} }_h\in\VV_h\colon (q_h,\DIV{ \boldsymbol{v} }_h)=0,~\forall\,q_h\in{ Q }_h}, \end{align*} where we note that for exactly divergence-free (and thus pressure-robust) FEM, ${ \boldsymbol{v} }_h\in\VV_h^{ \mathrm{div} }$ follows $\DIV{ \boldsymbol{v} }_h=0$, i.e., $\VV_h^{ \mathrm{div} } \subset \LPOne{2}_{\sigma}{ \rb{\Omega} }$. In this context, a frequently used tool in finite element error analysis is the discrete Stokes projector, defined by \begin{align*} &{ \mathbb{S} }_h\colon\VV^{ \mathrm{div} } \to \VV_h^{ \mathrm{div} }, \quad { \mathbb{S} }_h({ \boldsymbol{v} }) = \argmin_{{ \boldsymbol{v} }_h\in\VV_h^{ \mathrm{div} }} \norm{\nabla\rb{{ \boldsymbol{v} }-{ \boldsymbol{v} }_h}}_\LP{2}{{ \rb{\Omega} }}, \quad \int_\Omega \nabla\sqb{{ \mathbb{S} }({ \boldsymbol{v} })-{ \boldsymbol{v} }}\Fip\nabla{ \boldsymbol{v} }_h { \,\drm\xx } =0,~\forall\,{ \boldsymbol{v} }_h\in\VV_h^{ \mathrm{div} }. \end{align*} The Stokes projector possesses optimal approximation properties due to discrete inf-sup stability \cite{alm:2018}. Last but not least, the Lagrange interpolation into the $H^1$-conforming subspace of the discrete pressure-space $Q_h$ is denoted by \begin{equation} \label{eq:lagrange:press:interpol} L_h: C(\bar{\Omega}) \to Q_h \cap H^1(\Omega). \end{equation} \begin{remark} \label{rem:h1:press:approx} For discrete discontinuous pressure spaces with $k_p \geqslant 1$ it holds for all $q \in H^{k_p+1}$ \begin{equation*} \norm{\nabla (q - L_h q)}_{L^2} \leqslant C h^{k_p} \abs{q}_{H^{k_p+1}{ \rb{\Omega} }}, \end{equation*} where $C$ does only depend on the shape-regularity of the triangulation. \end{remark} \begin{lemma}[Convergence of the nonlinear convection term as $h \to 0$] \label{lem:conv:nonlinear:term}% Assume that ${ \boldsymbol{u} }_h \to { \boldsymbol{u} } \in \WW^{1, \infty}(\Omega)$ converges strongly in $\HH^{1}(\Omega)$ and that $\norm{{ \boldsymbol{u} }_h}_{\WW^{1, \infty}(\Omega)} \leqslant C$ is uniformly bounded. Then, $({ \boldsymbol{u} }_h \ip \nabla) { \boldsymbol{u} }_h \to ({ \boldsymbol{u} } \ip \nabla) { \boldsymbol{u} }$ converges strongly in $\LPOne{2}(\Omega)$. Further, it holds that ${ \mathbb{P} }(({ \boldsymbol{u} }_h \ip \nabla) { \boldsymbol{u} }_h) \to { \mathbb{P} }(({ \boldsymbol{u} } \ip \nabla) { \boldsymbol{u} })$ converges strongly for the Helmholtz--Hodge projector in $\LPOne{2}(\Omega)$. \end{lemma} \begin{proof} One can derive \begin{align*} \norm{ ({ \boldsymbol{u} }_h \ip \nabla) { \boldsymbol{u} }_h - ({ \boldsymbol{u} } \ip \nabla) { \boldsymbol{u} } }_{\LPOne{2}(\Omega)} & \leqslant \norm{ (({ \boldsymbol{u} }_h - { \boldsymbol{u} }) \ip \nabla) { \boldsymbol{u} }_h}_{\LPOne{2}(\Omega)} + \norm{ ({ \boldsymbol{u} } \ip \nabla) ({ \boldsymbol{u} }_h - { \boldsymbol{u} })}_{\LPOne{2}(\Omega)} \\ & \leqslant \norm{ { \boldsymbol{u} }_h - { \boldsymbol{u} } }_{\LPOne{2}(\Omega)} \norm{ \nabla { \boldsymbol{u} }_h }_{\LPOne{\infty}(\Omega)} + \norm{ { \boldsymbol{u} } }_{\LPOne{\infty}(\Omega)} \norm{ \nabla ({ \boldsymbol{u} }_h - { \boldsymbol{u} })}_{\LPOne{2}(\Omega)}. \end{align*} Due to ${ \boldsymbol{u} }_h \to { \boldsymbol{u} }$ strongly in $\HH^1(\Omega)$, $\norm{ { \boldsymbol{u} }_h - { \boldsymbol{u} } }_{\LPOne{2}(\Omega)}$ and $\norm{ \nabla ({ \boldsymbol{u} }_h - { \boldsymbol{u} })}_{\LPOne{2}(\Omega)}$ converge to zero. Further, $\norm{\nabla { \boldsymbol{u} }_h}_{\LPOne{\infty}(\Omega)}$ and $\norm{{ \boldsymbol{u} }}_{\LPOne{\infty}(\Omega)}$ are assumed to be bounded. The convergence of the Helmholtz--Hodge projectors ${ \mathbb{P} }(({ \boldsymbol{u} }_h \ip \nabla) { \boldsymbol{u} }_h) \to { \mathbb{P} }(({ \boldsymbol{u} } \ip \nabla) { \boldsymbol{u} })$ in $\LPOne{2}(\Omega)$ is an immediate consequence of the well-posedness of the Neumann problem \eqref{eq:weak:helm:problem} in $H^{1}(\Omega) / \mathbb{R}$. \end{proof} \begin{remark}[Pseudo-dominant convection] \label{rem:pseudo:dominant:convection} When confronted with generalised Beltrami flows at high Reynolds numbers, Lemma \ref{lem:conv:nonlinear:term} is decisive in order to understand the behaviour of space discretisations of the incompressible Navier--Stokes equations. While ${ \mathbb{P} }( ({ \boldsymbol{u} } \ip \nabla) { \boldsymbol{u} } ))$ vanishes for generalised Beltrami flows since $({ \boldsymbol{u} } \ip \nabla) { \boldsymbol{u} }$ is a gradient field, on the discrete level ${ \mathbb{P} }( ({ \boldsymbol{u} }_h \ip \nabla) { \boldsymbol{u} }_h )) \to { \boldsymbol{0} }$ holds since $({ \boldsymbol{u} }_h \ip \nabla) { \boldsymbol{u} }_h$ \emph{only converges} to a gradient field as $h\to 0$. Thus, one can observe some kind of \emph{pseudo-dominant} convection at high Reynolds numbers \cite{cmame:linke:merdon:2016}, i.e., the infinite-dimensional generalised Beltrami problem is not convection-dominated due to ${ \mathbb{P} }( ({ \boldsymbol{u} } \ip \nabla) { \boldsymbol{u} } )) = { \boldsymbol{0} }$, but the discretised problem experiences some non-negligible, artificial convective force. A similar effect can be observed also for the linear Stokes problem when one uses numerical quadratures in the discretisation of forces of gradient fields, see \cite[Subsection 6.2]{lmn:2018}. \end{remark} \subsection{Discrete $\emph{\textbf{H}}^{\mathbf{1}}$-conforming Helmholtz--Hodge projector} \label{sec:DiscreteH1Projectors} A discrete Helmholtz--Hodge projector in $\LTWO$ is defined straightforward as the $\LTWO$ projector onto $\VV_h^{ \mathrm{div} }$: \begin{equation} \label{eq:disc:helm} { \mathbb{P} }_h\colon\LP{2}{{ \rb{\Omega} }} \to \VV_h^{ \mathrm{div} }, \quad { \mathbb{P} }_h({ \boldsymbol{v} }) = \argmin_{{ \boldsymbol{v} }_h\in\VV_h^{ \mathrm{div} }} \norm{{ \boldsymbol{v} }-{ \boldsymbol{v} }_h}_\LP{2}{{ \rb{\Omega} }} , \quad \int_\Omega \sqb{{ \mathbb{P} }_h({ \boldsymbol{v} })-{ \boldsymbol{v} }}\ip{ \boldsymbol{v} }_h { \,\drm\xx } =0,~\forall\,{ \boldsymbol{v} }_h\in\VV_h^{ \mathrm{div} }. \end{equation} \begin{remark} Under the assumptions of elliptic regularity of $\Omega$, shape-regular meshes and discrete inf-sup stability of the method, the corresponding discrete Helmholtz projector has optimal approximation properties \begin{equation} \norm{{ \boldsymbol{u} }-{ \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{2}{{ \rb{\Omega} }} + h\norm{\nabla\sqb{{ \boldsymbol{u} }-{ \mathbb{P} }_h({ \boldsymbol{u} })}}_\LP{2}{{ \rb{\Omega} }} \leqslant C h^{k+1} \norm{{ \boldsymbol{u} }}_\HM{k+1}{{ \rb{\Omega} }}. \end{equation} The proof follows directly from \cite[Lemma 11]{alm:2018}. \end{remark} \begin{lemma}[$\WMP{1}{\infty}{}$ stability of discrete Helmholtz--Hodge projector] \label{lem:W1inftyHelmholtz}% Assume elliptic regularity of $\Omega$, shape-regular meshes, discrete inf-sup stability of the method and that the exact solution ${ \boldsymbol{u} }$ is sufficiently smooth. Then, the corresponding discrete Helmholtz--Hodge projector fulfils \begin{equation} \norm{\nabla{ \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{\infty}{{ \rb{\Omega} }} \leqslant C\norm{\nabla{ \boldsymbol{u} }}_\LP{\infty}{{ \rb{\Omega} }} + h^{{k_{{ \boldsymbol{u} }}}-\nf{d}{2}} \norm{{ \boldsymbol{u} }}_\HM{{k_{{ \boldsymbol{u} }}}+1}{{ \rb{\Omega} }}, \end{equation} where $C>0$ is independent of $h$ and ${k_{{ \boldsymbol{u} }}}$ denotes the polynomial order of discrete velocities in $\VV_h$. \end{lemma} \begin{proof} The first step is to use the Stokes projector and the triangle inequality to obtain \begin{equation*} \norm{\nabla { \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{\infty}{{ \rb{\Omega} }} \leqslant \norm{\nabla { \mathbb{S} }_h({ \boldsymbol{u} })}_\LP{\infty}{{ \rb{\Omega} }} + \norm{\nabla { \mathbb{P} }_h({ \boldsymbol{u} }) - \nabla { \mathbb{S} }_h({ \boldsymbol{u} })}_\LP{\infty}{{ \rb{\Omega} }}. \end{equation*} Note that the $\WMP{1}{\infty}{}$ stability of the Stokes projector has been shown in \cite{GiraultEtAl15}. For shape-regular decompositions $\T$, the discrete space $\VV_h$ (and thus also $\VV_h^{ \mathrm{div} }$) satisfies the local inverse inequality \cite[Lemma 1.138]{ErnGuermond04} \begin{equation} \label{eq:LocInvEq} \forall{ \boldsymbol{v} }_h\in\VV_h\colon\quad \norm{{ \boldsymbol{v} }_h}_{\WMP{\ell}{p}{\rb{K}}} \leqslant C_{ \mathrm{inv} } h_K^{m-\ell+d\rb{\frac{1}{p}-\frac{1}{q}}}\norm{{ \boldsymbol{v} }_h}_{\WMP{m}{q}{\rb{K}}}, \quad \forall K\in\T, \end{equation} where $0\leqslant m\leqslant \ell$ and $1\leqslant p,q\leqslant \infty$. Choosing $\ell=m=1$, $p=\infty$ and $q=2$, the inverse estimate can be applied to further estimate the right-hand side as \begin{align*} \norm{\nabla { \mathbb{P} }_h({ \boldsymbol{u} }) - \nabla { \mathbb{S} }_h({ \boldsymbol{u} })}_\LP{\infty}{{ \rb{\Omega} }} &\leqslant C_{ \mathrm{inv} } h^{-\nf{d}{2}} \norm{\nabla \sqb{{ \mathbb{P} }_h({ \boldsymbol{u} }) - { \mathbb{S} }_h({ \boldsymbol{u} })}}_\LP{2}{{ \rb{\Omega} }} \\ &\leqslant C_{ \mathrm{inv} } h^{-\nf{d}{2}} \sqb{ \norm{\nabla \sqb{{ \boldsymbol{u} } - { \mathbb{P} }_h({ \boldsymbol{u} })}}_\LP{2}{{ \rb{\Omega} }} + \norm{\nabla \sqb{{ \boldsymbol{u} } - { \mathbb{S} }_h({ \boldsymbol{u} }) }}_\LP{2}{{ \rb{\Omega} }} } \\ &\leqslant C h^{{k_{{ \boldsymbol{u} }}}-\nf{d}{2}} \norm{{ \boldsymbol{u} }}_\HM{{k_{{ \boldsymbol{u} }}}+1}{{ \rb{\Omega} }}, \end{align*} where the optimal approximation properties of both ${ \mathbb{P} }_h$ and ${ \mathbb{S} }_h$ are essential. \end{proof} Combining Lemmas \ref{lem:W1inftyHelmholtz} and \ref{lem:conv:nonlinear:term} yields a result which is essential for good convergence properties of the Galerkin method on pre-asymptotic meshes, see also Theorems \ref{thm:pr} and \ref{thm:classical}: \begin{remark} \label{rem:p:uhnablauh:conv} Assuming ${k_{{ \boldsymbol{u} }}} \geqslant d/2$, it holds for $h \to 0$ that \begin{equation*} { \mathbb{P} }( ({ \mathbb{P} }_h({ \boldsymbol{u} }) \ip \nabla) { \mathbb{P} }_h({ \boldsymbol{u} })) \stackrel{\LPOne{2}{}}{\to} { \mathbb{P} }(({ \boldsymbol{u} } \ip \nabla) { \boldsymbol{u} }). \end{equation*} \end{remark} Now, let us first consider the situation where ${ \mathbb{P} }_h$ belongs to a pressure-robust (divergence-free) method. \begin{lemma} \label{lem:DiscHelmDivFreeH1}% For pressure-robust (divergence-free) $\HM{1}{}$ methods, for all $\psi \in \Hm{1}{{ \rb{\Omega} }}$ it holds \begin{equation*} { \mathbb{P} }_h(\nabla \psi) = { \boldsymbol{0} }. \end{equation*} \end{lemma} \begin{proof} Since for divergence-free methods $\DIV{ \boldsymbol{v} }_h=0$ holds for all ${ \boldsymbol{v} }_h \in \VV_h^{ \mathrm{div} }$, one obtains \begin{equation*} (\nabla \psi, { \boldsymbol{v} }_h) = -(\psi, \DIV { \boldsymbol{v} }_h) = 0, \end{equation*} for all ${ \boldsymbol{v} }_h \in \VV_h^{ \mathrm{div} }$. \end{proof} Finally, for non-pressure-robust methods, the situation is not exactly the same as in the infinite-dimensional case. In fact, for the steady Navier--Stokes problem, i.e., for the elliptic problem, one has to estimate the consistency error of ${ \mathbb{P} }_h(\nabla \phi)$ in a discrete $\HMh{-1}{}$ norm, which yields an $\mathcal{O}(h^{k_p+1})$ consistency error \cite{lm:2018}, where $k_p$ denotes the formal approximation order of the discrete pressure space in the $L^2$ norm. However, for the fully time-dependent \emph{a priori} error analysis below we will have to estimate this consistency error in the stronger $\LP{2}{{ \rb{\Omega} }}$ norm, which was seemingly done for the first time in \cite{lr:2018}. \begin{lemma} \label{lem:DiscHelmLerayNonDivFreeH1}% For non-pressure-robust $\HM{1}{}$ methods with $k_p \geqslant 1$, it holds for all gradient fields $\nabla \psi$ with $\psi \in \Hm{k_p+1}{{ \rb{\Omega} }}$ \begin{equation} \norm{{ \mathbb{P} }_h(\nabla \psi)}_\LP{2}{{ \rb{\Omega} }} \leqslant C h^{k_p} \abs{\psi}_\Hm{k_p + 1}{{ \rb{\Omega} }}. \end{equation} \end{lemma} \begin{proof} Given $\psi \in \Hm{k_p+1}{{ \rb{\Omega} }}$, it holds for all discretely divergence-free ${ \boldsymbol{v} }_h\in\VV_h^{ \mathrm{div} }$ \begin{equation*} 0 = -(L_h \psi, \DIV { \boldsymbol{v} }_h) = \rb{\nabla (L_h \psi), { \boldsymbol{v} }_h}, \end{equation*} due to $L_h \psi \in Q_h \cap H^1(\Omega)$. Thus, one obtains \begin{equation*} \rb{\nabla \psi,{ \boldsymbol{v} }_h} = \rb{\nabla (\psi - L_h \psi) ,{ \boldsymbol{v} }_h} \leqslant \norm{\nabla (\psi - L_h \psi)}_{\LP{2}{{ \rb{\Omega} }}} \norm{{ \boldsymbol{v} }_h}_{\LPOne{2}(\Omega)}. \end{equation*} The result is proven using Remark \ref{rem:h1:press:approx}. \end{proof} \begin{remark} The numerical experiments in \cite{lr:2018} indicate that Lemma \ref{lem:DiscHelmLerayNonDivFreeH1} is sharp. Indeed, for non-pressure-robust, inf-sup stable mixed methods with discontinuous $\Pk{0}{}$ pressures, i.e., $k_p=0$, like the nonconforming Crouzeix--Raviart and the conforming Bernardi--Raugel element, it is demonstrated that it holds \begin{equation*} \norm{{ \mathbb{P} }_h(\nabla q)}_\LP{2}{{ \rb{\Omega} }}=\mathcal{O}(1), \end{equation*} leading to a pressure-induced locking phenomenon for the time-dependent Stokes equations in the presence of large pressure gradients. \end{remark} \begin{remark} Remark \ref{rem:p:uhnablauh:conv} assures that at least for ${k_{{ \boldsymbol{u} }}} \geqslant d/2$ one obtains for $h \to 0$ the convergence result \begin{equation*} { \mathbb{P} }( ({ \mathbb{P} }_h({ \boldsymbol{u} }) \ip \nabla) { \mathbb{P} }_h({ \boldsymbol{u} })) \stackrel{\LPOne{2}{}}{\to} { \mathbb{P} }(({ \boldsymbol{u} } \ip \nabla) { \boldsymbol{u} }). \end{equation*} However, the quality of the space discretisation \eqref{eq:H1-FEM} is determined by whether and how \begin{equation*} { \mathbb{P} }_h( ({ \mathbb{P} }_h({ \boldsymbol{u} }) \ip \nabla) { \mathbb{P} }_h({ \boldsymbol{u} })) \stackrel{\LPOne{2}{}}{\to} { \mathbb{P} }(({ \boldsymbol{u} } \ip \nabla) { \boldsymbol{u} }) \end{equation*} converges for $h\to 0$. For $k_p \geqslant 2$, convergence in $\LPOne{2}{}$ is assured. But the convergence speed of pressure-robust methods can be much faster than in classical, non-pressure-robust space discretisations due to Lemma \ref{lem:DiscHelmLerayNonDivFreeH1}, when $({ \boldsymbol{u} } \ip \nabla) { \boldsymbol{u} }$ contains a large gradient part in the sense of the Helmholtz--Hodge decomposition \eqref{helmholtz:hodge:decomposition}. This is the main reason for the superiority of pressure-robust methods for Beltrami flows, where space discretisations suffer from an artificial, pseudo-dominant convection on coarse meshes, see Remark \ref{rem:pseudo:dominant:convection}. Exactly this artificial pseudo-dominant convection is reduced by pressure-robust methods. \end{remark} \section{A special $\emph{\textbf{H}}^{\mathbf{1}}$ finite element error analysis} \label{sec:ErrorAnalysisH1} In the following, we present a numerical error analysis for the time-dependent Navier--Stokes problem which is based on a new understanding of the velocity error in the time-dependent Stokes problem, see \cite{lr:2018} and \cite[Section 4]{alm:2018}. The key point is that in the case of low viscosities, pressure-robust space discretisations do not show an increase in the velocity error as long as the time interval is small compared with $\nu^{-1}$. On the other hand, in non-pressure-robust methods the only source of error is a dominating pressure gradient in the momentum balance \cite[Theorem 5.2]{AhmedLinkeMerdon18}; namely in the special case ${ \boldsymbol{f} } = \mathrm{const}$ one gets (for $\nu \ll 1$) ${ \boldsymbol{u} }_h \approx { \mathbb{P} }_h({ \boldsymbol{u} }) + t{ \mathbb{P} }_h(\nabla p)$ for $t\in\sqb{0,{ T }}$. ~\\ In the following, we will give two different error estimates for the Navier--Stokes equations in the pressure-robust and the non-pressure-robust case. The convergence analysis is inspired by novel discrete velocity error estimates for the transient Stokes equations \cite{lr:2018, lm:2018, alm:2018}, which estimate the difference between the discrete velocity ${ \boldsymbol{u} }_h(t)$ and the (discretely divergence-free) $\LTWO$ best approximation ${ \mathbb{P} }_h({ \boldsymbol{u} }(t))$. \subsection{Pressure-robust space discretisation} \begin{theorem}[Pressure-robust estimate] \label{thm:pr}% For the discrete velocity for all $t \in \sqb{0, { T }}$ the following representation is chosen \begin{equation*} { \boldsymbol{u} }_h(t) = { \mathbb{P} }_h({ \boldsymbol{u} }(t)) + { \boldsymbol{e} }_h(t), \end{equation*} and the time-dependent evolution of ${ \boldsymbol{e} }_h(t)$ is considered. Then, assuming ${ \boldsymbol{u} } \in \Lp{2}{\rb{\WMP{1}{\infty}{} \cap \HM{3}{}}}$, $\partial_t{ \boldsymbol{u} } \in \Lp{1}{\rb{\LP{2}{}}}$, on the time interval $\sqb{0, { T }}$, ${ \boldsymbol{e} }_h$ can be estimated by \begin{align*} \norm{{ \boldsymbol{e} }_h({ T })}_\LP{2}{}^2 + \nu \norm{\nabla { \boldsymbol{e} }_h}_\Lp{2}{\rb{\LP{2}{}}}^2 &\leqslant e^{1 + 2\norm{\nabla { \mathbb{P} }_h({ \boldsymbol{u} })}_\Lp{1}{\rb{\LP{\infty}{}}}} \times \left ( \nu \norm{\nabla \sqb{{ \mathbb{S} }_h({ \boldsymbol{u} }) - { \mathbb{P} }_h({ \boldsymbol{u} })}}_\Lp{2}{\rb{\LP{2}{}}}^2 \right. \\ & \left. + 2 { T } \int_0^{ T } \norm{ \nabla { \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{\infty}{}^2\norm{{ \boldsymbol{u} } - { \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{2}{}^2 + \norm{{ \boldsymbol{u} }}_\LP{\infty}{}^2 \norm{\nabla \sqb{{ \boldsymbol{u} } - { \mathbb{P} }_h({ \boldsymbol{u} })}}_\LP{2}{}^2 { \,\drm\tau } \right ). \end{align*} \end{theorem} \begin{remark} Due to the explicit $2{ T }$ dependence of the error in Theorem \ref{thm:pr}, in the case ${ T } \gg \nu^{-1}$ this estimate can become pessimistic. Note that for our numerical examples in Section \ref{sec:ExperimentsKnownSol}, we indeed consider short time intervals for which Theorem \ref{thm:pr} is meaningful. In the literature, usually one can find 'long-term' estimates, e.g., \cite{BochevGunzburgerLehoucq07,BurmanFernandez07,ArndtEtAl15,SchroederLube17b,SchroederEtAl18}, which are sharper for $T \gg \nu^{-1}$, but which are pessimistic for short time intervals. \end{remark} \begin{remark} Concerning the regularity assumption ${ \boldsymbol{u} } \in \Lp{2}{\rb{\HM{3}{}}}$ in Theorem~\ref{thm:pr}, let us remark that we have chosen it in such a way that the stability of the discrete Helmholtz projector in Lemma~\ref{lem:W1inftyHelmholtz} is ensured. This is basically a technical detail and with additional effort, one can presumably reduce the necessary regularity at this point. However, in the error analysis of this work, we are only interested in relatively smooth flows anyway. \end{remark} \begin{ProofOf}{Theorem \ref{thm:pr}} Note that $\DIV{ \boldsymbol{z} }_h=0$ for all ${ \boldsymbol{z} }_h\in\VV_h^{ \mathrm{div} }$ due to $\VV_h^{ \mathrm{div} } \subset \LPOne{2}_{\sigma}{ \rb{\Omega} }$ assuming pressure-robustness. Due to Galerkin orthogonality, for all ${ \boldsymbol{z} }_h \in \VV_h^{ \mathrm{div} }$ it holds \begin{align*} \rb{\partial_t { \boldsymbol{u} }_h, { \boldsymbol{z} }_h} + \nu \rb{\nabla { \boldsymbol{u} }_h, \nabla { \boldsymbol{z} }_h} + \rb{\rb{{ \boldsymbol{u} }_h \ip \nabla} { \boldsymbol{u} }_h, { \boldsymbol{z} }_h} & = \rb{\partial_t{ \boldsymbol{u} }, { \boldsymbol{z} }_h} + \nu \rb{\nabla { \boldsymbol{u} }, \nabla { \boldsymbol{z} }_h} + \rb{\rb{{ \boldsymbol{u} }\ip\nabla}{ \boldsymbol{u} },{ \boldsymbol{z} }_h}\\ & = \rb{ \partial_t { \mathbb{P} }_h({ \boldsymbol{u} }), { \boldsymbol{z} }_h} + \nu \rb{\nabla { \mathbb{S} }_h({ \boldsymbol{u} }), \nabla { \boldsymbol{z} }_h} + \rb{\rb{{ \boldsymbol{u} }\ip\nabla}{ \boldsymbol{u} },{ \boldsymbol{z} }_h}. \end{align*} Here, it was used $(\nabla p, { \boldsymbol{z} }_h)=0$, which is equivalent to ${ \mathbb{P} }_h(\nabla p) = { \boldsymbol{0} }$, proved in Lemma \ref{lem:DiscHelmDivFreeH1} for pressure-robust space discretisations. Using the representation ${ \boldsymbol{u} }_h(t) = { \mathbb{P} }_h({ \boldsymbol{u} }(t)) + { \boldsymbol{e} }_h(t)$ leads to \begin{align*} \rb{\partial_t { \boldsymbol{e} }_h, { \boldsymbol{z} }_h} + \nu \rb{\nabla { \boldsymbol{e} }_h, \nabla { \boldsymbol{z} }_h} &+ \rb{\rb{\sqb{{ \mathbb{P} }_h({ \boldsymbol{u} }) + { \boldsymbol{e} }_h} \ip \nabla} \sqb{{ \mathbb{P} }_h({ \boldsymbol{u} }) + { \boldsymbol{e} }_h}, { \boldsymbol{z} }_h} \\ &= \nu \rb{\nabla ({ \mathbb{S} }_h({ \boldsymbol{u} }) - { \mathbb{P} }_h({ \boldsymbol{u} })), \nabla { \boldsymbol{z} }_h} + \rb{\rb{{ \boldsymbol{u} }\ip\nabla}{ \boldsymbol{u} },{ \boldsymbol{z} }_h}, \end{align*} for all ${ \boldsymbol{z} }_h \in \VV_h^{ \mathrm{div} }$, where the initial value for the ODE system is chosen as ${ \boldsymbol{e} }_h(0) = { \boldsymbol{0} }$. For the discrete nonlinear term, we obtain \begin{align*} \rb{\rb{\sqb{{ \mathbb{P} }_h({ \boldsymbol{u} }) + { \boldsymbol{e} }_h} \ip \nabla} \sqb{{ \mathbb{P} }_h({ \boldsymbol{u} }) + { \boldsymbol{e} }_h}, { \boldsymbol{z} }_h} = &\rb{ \rb{{ \boldsymbol{e} }_h \ip \nabla} { \boldsymbol{e} }_h, { \boldsymbol{z} }_h} + \rb{ \rb{{ \mathbb{P} }_h({ \boldsymbol{u} }) \ip \nabla} { \boldsymbol{e} }_h, { \boldsymbol{z} }_h } \\ &+ \rb{ \rb{{ \boldsymbol{e} }_h \ip \nabla} { \mathbb{P} }_h({ \boldsymbol{u} }), { \boldsymbol{z} }_h} + \rb{ \rb{{ \mathbb{P} }_h({ \boldsymbol{u} }) \ip \nabla} { \mathbb{P} }_h({ \boldsymbol{u} }), { \boldsymbol{z} }_h}. \end{align*} Further, due to the skew-symmetry of the first two terms plus $\DIV{ \boldsymbol{e} }_h=\DIV{ \mathbb{P} }_h({ \boldsymbol{u} })=0$, testing with ${ \boldsymbol{z} }_h = { \boldsymbol{e} }_h$ leads to \begin{align*} \frac{1}{2} \frac{{ \mathrm{d} }}{{ \mathrm{d} } t} \norm{{ \boldsymbol{e} }_h}_\LP{2}{}^2 &+ \nu \norm{\nabla { \boldsymbol{e} }_h}_\LP{2}{}^2 \\ &\!\!\!\!\!\!\!\!\!\!= \nu \rb{\nabla \sqb{{ \mathbb{S} }_h({ \boldsymbol{u} }) -{ \mathbb{P} }_h({ \boldsymbol{u} })}, \nabla { \boldsymbol{e} }_h} - \rb{ \rb{{ \boldsymbol{e} }_h \ip \nabla} { \mathbb{P} }_h({ \boldsymbol{u} }), { \boldsymbol{e} }_h} - \rb{ \rb{{ \mathbb{P} }_h({ \boldsymbol{u} }) \ip \nabla} { \mathbb{P} }_h({ \boldsymbol{u} }), { \boldsymbol{e} }_h} + \rb{\rb{{ \boldsymbol{u} }\ip\nabla}{ \boldsymbol{u} },{ \boldsymbol{e} }_h}. \end{align*} Due to Lemmas \ref{lem:conv:nonlinear:term} and \ref{lem:W1inftyHelmholtz}, the last two terms on the right-hand side can be combined and estimated by \begin{align*} \big( \rb{{ \mathbb{P} }_h({ \boldsymbol{u} }) \ip \nabla} { \mathbb{P} }_h({ \boldsymbol{u} }) &- \rb{{ \boldsymbol{u} } \ip \nabla} { \boldsymbol{u} }, { \boldsymbol{e} }_h \big) = \rb{ \rb{\sqb{{ \mathbb{P} }_h({ \boldsymbol{u} }) - { \boldsymbol{u} }} \ip \nabla} { \mathbb{P} }_h({ \boldsymbol{u} }) + \rb{{ \boldsymbol{u} } \ip \nabla} \sqb{{ \mathbb{P} }_h({ \boldsymbol{u} }) - { \boldsymbol{u} }}, { \boldsymbol{e} }_h} \\ & \leqslant \norm{ \nabla { \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{\infty}{} \norm{{ \boldsymbol{u} } - { \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{2}{} \norm{{ \boldsymbol{e} }_h}_\LP{2}{} + \norm{{ \boldsymbol{u} }}_\LP{\infty}{} \norm{\nabla \sqb{{ \boldsymbol{u} } - { \mathbb{P} }_h({ \boldsymbol{u} })}}_\LP{2}{} \norm{{ \boldsymbol{e} }_h}_\LP{2}{} \\ & \leqslant { T } \rb{ \norm{ \nabla { \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{\infty}{}^2 \norm{{ \boldsymbol{u} } - { \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{2}{}^2 + \norm{{ \boldsymbol{u} }}_\LP{\infty}{}^2 \norm{\nabla \sqb{{ \boldsymbol{u} } - { \mathbb{P} }_h({ \boldsymbol{u} })}}_\LP{2}{}^2 } + \frac{1}{2{ T }} \norm{{ \boldsymbol{e} }_h}^2_\LP{2}{}. \end{align*} Here, the weight $(2{ T })^{-1}$ in front of $\norm{{ \boldsymbol{e} }_h}^2_\LP{2}{}$ ensures that later on, the argument of the exponential Gronwall term does not catch any explicit ${ T }$ dependence. The other convection term can be treated simply by the generalised H\"older inequality; that is, \begin{align*} \rb{ \rb{{ \boldsymbol{e} }_h \ip \nabla} { \mathbb{P} }_h({ \boldsymbol{u} }), { \boldsymbol{e} }_h} \leqslant \norm{ \nabla { \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{\infty}{} \norm{{ \boldsymbol{e} }_h}_\LP{2}{}^2. \end{align*} Using Young's inequality for the remaining term involving Stokes and Helmholtz--Hodge projectors, after rearranging, one obtains the overall estimate \begin{align*} \frac{{ \mathrm{d} }}{{ \mathrm{d} } t} \norm{{ \boldsymbol{e} }_h}_\LP{2}{}^2 + \nu \norm{\nabla { \boldsymbol{e} }_h}_\LP{2}{}^2 \leqslant &\nu \norm{\nabla \sqb{{ \mathbb{S} }_h({ \boldsymbol{u} }) -{ \mathbb{P} }_h({ \boldsymbol{u} })}}_\LP{2}{}^2 + \rb{ \frac{1}{{ T }} + 2\norm{\nabla { \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{\infty}{} } \norm{{ \boldsymbol{e} }_h}_\LP{2}{}^2 \\ &+ 2{ T } \rb{ \norm{ \nabla { \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{\infty}{}^2 \norm{{ \boldsymbol{u} } - { \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{2}{}^2 + \norm{{ \boldsymbol{u} }}_\LP{\infty}{}^2 \norm{\nabla \sqb{{ \boldsymbol{u} } - { \mathbb{P} }_h({ \boldsymbol{u} })}}_\LP{2}{}^2 } . \end{align*} In such a situation, Gronwall's lemma \cite[Lemma A.54]{John16} in differential form states that for $t\in\sqb{0,{ T }}$, \begin{equation} \frac{{ \mathrm{d} }}{{ \mathrm{d} } t} \norm{{ \boldsymbol{e} }_h\rb{t}}_\LP{2}{}^2 \leqslant \alpha\rb{t} + \beta\rb{t} \norm{{ \boldsymbol{e} }_h\rb{t}}_\LP{2}{}^2 \quad \Rightarrow \quad \norm{{ \boldsymbol{e} }_h\rb{t}}_\LP{2}{}^2 \leqslant \int_0^t \alpha\rb{s} \exp\rb{\int_s^t \beta\rb{\tau} { \,\drm\tau } } { \,\drm s }. \end{equation} In order to apply this estimate, one sets \begin{equation*} \beta(t) =\frac{1}{{ T }} + 2\norm{ \nabla { \mathbb{P} }_h({ \boldsymbol{u} }) }_\LP{\infty}{} \end{equation*} and \begin{align*} \alpha(t) = &-\nu \norm{\nabla { \boldsymbol{e} }_h}_\LP{2}{}^2 + \nu \norm{\nabla \sqb{{ \mathbb{S} }_h({ \boldsymbol{u} })-{ \mathbb{P} }_h({ \boldsymbol{u} })} }_\LP{2}{}^2 \\ &+ 2{ T } \rb{ \norm{ \nabla { \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{\infty}{}^2 \norm{{ \boldsymbol{u} } - { \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{2}{}^2 + \norm{{ \boldsymbol{u} }}_\LP{\infty}{}^2 \norm{\nabla \sqb{{ \boldsymbol{u} } - { \mathbb{P} }_h({ \boldsymbol{u} })}}_\LP{2}{}^2 }, \end{align*} and computes for $t \geqslant s$ \begin{equation*} \exp\rb{\int_s^t \beta(\tau) { \,\drm\tau }} = \exp\rb{ \frac{t-s}{T} + 2\norm{\nabla { \mathbb{P} }_h({ \boldsymbol{u} })}_{\Lp{1}{\rb{s,t; \LP{\infty}{}}}} }. \end{equation*} Using $0 \leqslant s \leqslant t \leqslant T$ and $0 \leqslant \frac{t-s}{T} \leqslant 1$, one obtains \begin{align*} c \exp\rb{ \frac{t-s}{T} + 2\norm{\nabla { \mathbb{P} }_h({ \boldsymbol{u} })}_{\Lp{1}{\rb{s,t; \LP{\infty}{}}}} } \leqslant \begin{cases} c \exp\rb{1 + 2\norm{\nabla { \mathbb{P} }_h({ \boldsymbol{u} })}_{\Lp{1}{\rb{\LP{\infty}{}}}} } & \text{for $c \geqslant 0$}, \\ c & \text{for $c<0$}. \end{cases} \end{align*} Now, actually applying Gronwall's lemma yields the estimate \begin{align*} &\norm{{ \boldsymbol{e} }_h\rb{{ T }}}_\LP{2}{}^2 \leqslant \int_0^{ T } \alpha(s) \exp\rb{\int_s^{ T } \beta(\tau) { \,\drm\tau } } { \,\drm s } \leqslant -\nu \norm{\nabla { \boldsymbol{e} }_h}_\Lp{2}{\rb{\LP{2}{}}}^2 + e^{1 + 2\norm{\nabla { \mathbb{P} }_h({ \boldsymbol{u} })}_\Lp{1}{\rb{\LP{\infty}{}}}} \times \\ & \rb{ \nu \norm{\nabla \sqb{{ \mathbb{S} }_h({ \boldsymbol{u} }) - { \mathbb{P} }_h({ \boldsymbol{u} })}}_\Lp{2}{\rb{\LP{2}{}}}^2 + 2 { T } \int_0^{ T } \norm{ \nabla { \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{\infty}{}^2\norm{{ \boldsymbol{u} } - { \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{2}{}^2 + \norm{{ \boldsymbol{u} }}_\LP{\infty}{}^2 \norm{\nabla \sqb{{ \boldsymbol{u} } - { \mathbb{P} }_h({ \boldsymbol{u} })}}_\LP{2}{}^2 { \,\drm\tau } }. \end{align*} Rearranging concludes the proof. \end{ProofOf} \begin{remark} The estimate in Theorem \ref{thm:pr} is pressure-robust, since if ${ \boldsymbol{u} }(t) \in \VV_h^{ \mathrm{div} }$ holds for all $t \in \sqb{0,{ T }}$, then it also holds ${ \boldsymbol{u} }_h(t) = { \boldsymbol{u} }(t)$ due to ${ \boldsymbol{u} } = { \mathbb{S} }_h({ \boldsymbol{u} })={ \mathbb{P} }_h({ \boldsymbol{u} })$, i.e., the pressure $p$ does not spoil the discrete velocity solution ${ \boldsymbol{u} }_h$. \end{remark} \begin{remark} Note that under the assumption that ${k_{{ \boldsymbol{u} }}}$ is large enough and $h$ is small enough, one can apply Lemma \ref{lem:W1inftyHelmholtz} to obtain $\norm{ \nabla { \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{\infty}{} \leqslant C \norm{ \nabla { \boldsymbol{u} }}_\LP{\infty}{}$. \end{remark} \subsection{Classical space discretisation} \begin{theorem}[Non-pressure-robust estimate] \label{thm:classical}% For the discrete velocity for all $t \in \sqb{0, { T }}$ the following representation is chosen \begin{equation*} { \boldsymbol{u} }_h(t) = { \mathbb{P} }_h({ \boldsymbol{u} }(t)) + { \boldsymbol{e} }_h(t), \end{equation*} and the time-dependent evolution of ${ \boldsymbol{e} }_h(t)$ is considered. Then, assuming ${ \boldsymbol{u} } \in \Lp{2}{\rb{\WMP{1}{\infty}{} \cap \HM{3}{}}}$, $\partial_t{ \boldsymbol{u} } \in \Lp{1}{\rb{\LP{2}{}}}$, $p \in \Lp{2}{\rb{\Hm{1}{}}}$, on the time interval $\sqb{0, { T }}$, ${ \boldsymbol{e} }_h$ can be estimated by \begin{align*} \norm{{ \boldsymbol{e} }_h({ T })}_\LP{2}{}^2 &+ \nu \norm{\nabla { \boldsymbol{e} }_h}_\Lp{2}{\rb{\LP{2}{}}}^2 \leqslant e^{1 + 4\norm{\nabla { \mathbb{P} }_h({ \boldsymbol{u} })}_\Lp{1}{\rb{\LP{\infty}{}}}} \times \Big( \nu \norm{\nabla \sqb{{ \mathbb{S} }_h({ \boldsymbol{u} }) - { \mathbb{P} }_h({ \boldsymbol{u} })}}_\Lp{2}{\rb{\LP{2}{}}}^2 \\ &+3{ T } \norm{\nabla \sqb{p - L_h(p)}}_\Lp{2}{\rb{\LP{2}{}}}^2 + 3 { T } \int_0^{ T } \big[ \norm{{ \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{\infty}{}^2\norm{\DIV{ \mathbb{P} }_h({ \boldsymbol{u} })}_\Lp{2}{}^2 \\ & \qquad + 2\norm{\nabla { \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{\infty}{}^2\norm{{ \boldsymbol{u} } - { \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{2}{}^2 + 2\norm{{ \boldsymbol{u} }}_\LP{\infty}{}^2 \norm{\nabla \sqb{{ \boldsymbol{u} } - { \mathbb{P} }_h({ \boldsymbol{u} })}}_\LP{2}{}^2 \big]{ \,\drm\tau } \Big). \end{align*} \end{theorem} \begin{ProofOf}{Theorem \ref{thm:classical}} Following the same procedure as for the pressure-robust case, one obtains \begin{align*} \frac{1}{2} \frac{{ \mathrm{d} }}{{ \mathrm{d} } t} \norm{{ \boldsymbol{e} }_h}_\LP{2}{}^2 &+ \nu \norm{\nabla { \boldsymbol{e} }_h}_\LP{2}{}^2 = \nu \rb{\nabla \sqb{{ \mathbb{S} }_h({ \boldsymbol{u} }) -{ \mathbb{P} }_h({ \boldsymbol{u} })}, \nabla { \boldsymbol{e} }_h} + \rb{\nabla \sqb{p - L_h(p)}, { \boldsymbol{e} }_h} + \rb{\rb{{ \boldsymbol{u} }\ip\nabla}{ \boldsymbol{u} },{ \boldsymbol{e} }_h} \\ & - \rb{ \rb{{ \boldsymbol{e} }_h \ip \nabla} { \mathbb{P} }_h({ \boldsymbol{u} }) + \frac{1}{2}\rb{\DIV{ \boldsymbol{e} }_h}{ \mathbb{P} }_h({ \boldsymbol{u} }), { \boldsymbol{e} }_h} - \rb{ \rb{{ \mathbb{P} }_h({ \boldsymbol{u} }) \ip \nabla} { \mathbb{P} }_h({ \boldsymbol{u} }) + \frac{1}{2}\rb{\DIV{ \mathbb{P} }_h({ \boldsymbol{u} })}{ \mathbb{P} }_h({ \boldsymbol{u} }), { \boldsymbol{e} }_h} . \end{align*} Note that in the non-pressure-robust case the pressure contribution does not vanish, since it holds $\VV_h^{ \mathrm{div} } \not\subset \LPOne{2}_{\sigma}{ \rb{\Omega} }$ and the consistency error $\norm{{ \mathbb{P} }_h(\nabla p)}_{\LPOne{2}{ \rb{\Omega} }}$ estimated in Lemma \ref{lem:DiscHelmLerayNonDivFreeH1} unavoidably appears in the estimate. Further, the full skew-symmetric convective term has to be taken into account. In comparison to the pressure-robust case, there are only two new contributions from the skew-symmetrisation of the convective term which have to be estimated. For the first one, \begin{align*} \rb{\frac{1}{2}\rb{\DIV{ \mathbb{P} }_h({ \boldsymbol{u} })}{ \mathbb{P} }_h({ \boldsymbol{u} }), { \boldsymbol{e} }_h} &= \rb{\frac{1}{2}\rb{\DIV\sqb{{ \boldsymbol{u} }-{ \mathbb{P} }_h({ \boldsymbol{u} })}}{ \mathbb{P} }_h({ \boldsymbol{u} }), { \boldsymbol{e} }_h} \leqslant \norm{{ \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{\infty}{} \norm{\DIV\sqb{{ \boldsymbol{u} }-{ \mathbb{P} }_h({ \boldsymbol{u} })}}_\Lp{2}{} \norm{{ \boldsymbol{e} }_h}_\LP{2}{} \\ &\leqslant \frac{3{ T }}{2}\norm{{ \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{\infty}{}^2\norm{\DIV\sqb{{ \boldsymbol{u} }-{ \mathbb{P} }_h({ \boldsymbol{u} })}}_\Lp{2}{}^2 + \frac{1}{6{ T }}\norm{{ \boldsymbol{e} }_h}_\LP{2}{}^2 \end{align*} can be obtained. Applying Young's inequality slightly differently than in the pressure-robust case leads to \begin{align*} \big( \rb{{ \mathbb{P} }_h({ \boldsymbol{u} }) \ip \nabla} { \mathbb{P} }_h({ \boldsymbol{u} }) &- \rb{{ \boldsymbol{u} } \ip \nabla} { \boldsymbol{u} }, { \boldsymbol{e} }_h \big) \\ &\leqslant \frac{6{ T }}{2} \rb{ \norm{ \nabla { \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{\infty}{}^2 \norm{{ \boldsymbol{u} } - { \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{2}{}^2 + \norm{{ \boldsymbol{u} }}_\LP{\infty}{}^2 \norm{\nabla \sqb{{ \boldsymbol{u} } - { \mathbb{P} }_h({ \boldsymbol{u} })}}_\LP{2}{}^2 } + \frac{1}{6{ T }} \norm{{ \boldsymbol{e} }_h}^2_\LP{2}{}. \end{align*} With the help of integration by parts, the additional contribution in the remaining additional convective term can be estimated as \begin{equation*} \rb{\frac{1}{2}\rb{\DIV{ \boldsymbol{e} }_h}{ \mathbb{P} }_h({ \boldsymbol{u} }),{ \boldsymbol{e} }_h} = -\frac{1}{2}\rb{\rb{\nabla{ \mathbb{P} }_h({ \boldsymbol{u} })}{ \boldsymbol{e} }_h,{ \boldsymbol{e} }_h} \leqslant \norm{ \nabla { \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{\infty}{} \norm{{ \boldsymbol{e} }_h}_\LP{2}{}^2. \end{equation*} For completeness, from the pressure-robust case, we repeat \begin{align*} \rb{ \rb{{ \boldsymbol{e} }_h \ip \nabla} { \mathbb{P} }_h({ \boldsymbol{u} }), { \boldsymbol{e} }_h} \leqslant \norm{ \nabla { \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{\infty}{} \norm{{ \boldsymbol{e} }_h}_\LP{2}{}^2. \end{align*} Finally, the additional pressure term can be bounded as follows: \begin{equation*} \rb{\nabla \sqb{p - L_h(p)}, { \boldsymbol{e} }_h} \leqslant \frac{3{ T }}{2} \norm{\nabla \sqb{p - L_h(p)}}_\LP{2}{}^2 + \frac{1}{6{ T }} \norm{{ \boldsymbol{e} }_h}_\LP{2}{}^2 \end{equation*} This yields the overall estimate \begin{align*} \frac{{ \mathrm{d} }}{{ \mathrm{d} } t} &\norm{{ \boldsymbol{e} }_h}_\LP{2}{}^2 + \nu \norm{\nabla { \boldsymbol{e} }_h}_\LP{2}{}^2 \\ &\leqslant \nu \norm{\nabla \sqb{{ \mathbb{S} }_h({ \boldsymbol{u} }) -{ \mathbb{P} }_h({ \boldsymbol{u} })}}_\LP{2}{}^2 + \rb{ \frac{1}{{ T }} + 4\norm{\nabla { \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{\infty}{} } \norm{{ \boldsymbol{e} }_h}_\LP{2}{}^2 + 3{ T } \norm{\nabla \sqb{p - L_h(p)}}_\LP{2}{}^2 \\ &\quad+ 3{ T } \rb{ \norm{{ \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{\infty}{}^2\norm{\DIV{ \mathbb{P} }_h({ \boldsymbol{u} })}_\Lp{2}{}^2 + 2\norm{ \nabla { \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{\infty}{}^2 \norm{{ \boldsymbol{u} } - { \mathbb{P} }_h({ \boldsymbol{u} })}_\LP{2}{}^2 + 2\norm{{ \boldsymbol{u} }}_\LP{\infty}{}^2 \norm{\nabla \sqb{{ \boldsymbol{u} } - { \mathbb{P} }_h({ \boldsymbol{u} })}}_\LP{2}{}^2 } . \end{align*} Similarly as in the pressure-robust case, Gronwall's lemma concludes the proof. \end{ProofOf} \section{Consistency errors and the accuracy of low/high-order methods} \label{sec:Taylor} The main argument of this contribution is that pressure-robust space discretisations allow to reduce the (formal) approximation order of the algorithms, without compromising the accuracy, since the discrete Helmholtz--Hodge projector $\norm{{ \mathbb{P} }_h(\nabla p)}_\LP{2}{}$ of classical, non-pressure-robust discretisations suffers from a consistency error. This section will now interpret the numerical analysis of Section \ref{sec:ErrorAnalysisH1} according to this point of view. The main difference between Theorems \ref{thm:pr} (pressure-robust) and \ref{thm:classical} (non-pressure-robust) is the term \begin{equation} \label{eq:pr:term} 3{ T } \norm{\nabla \sqb{p - L_h(p)}}_\Lp{2}{\rb{\LP{2}{}}} \end{equation} in the $\LP{2}{}$ estimate for the non-pressure-robust error ${ \boldsymbol{e} }_h$, which is a direct consequence of the consistency error $\norm{{ \mathbb{P} }_h(\nabla p)}_\LP{2}{}$ in Lemma \ref{lem:DiscHelmLerayNonDivFreeH1}. ~\\ In the following, let ${k_{{ \boldsymbol{u} }}^{\mathrm{cl}}}$/${k_p^{\mathrm{cl}}}$ be the order of the discrete velocity/pressure polynomials for a classical, non-pressure robust method and, analogously, ${k_{{ \boldsymbol{u} }}^{\mathrm{pr}}}$/${k_p^{\mathrm{pr}}}$ the orders for a pressure-robust FE discretisation. \subsection{Lowest-order discretisations} \label{subsec_low:order:discs} An obvious, seemingly yet unknown conclusion from \eqref{eq:pr:term} is that for non-pressure-robust space discretisations, for ${k_p^{\mathrm{cl}}}=0$ no convergence order at all can be expected on pre-asymptotic meshes in presence of non-negligible pressures $p$. The reason is simple: discrete $\Pk{0}{}$ pressure do not have any approximation property w.r.t.\ the $H^1$ norm of $p$. ~\\ Recently, in \cite{lr:2018} it was numerically confirmed that the estimate \eqref{eq:pr:term} is sharp. The discretely inf-sup stable, non-pressure-robust Crouzeix--Raviart element indeed shows an error behaviour ${ \boldsymbol{e} }_h = \mathcal{O}(1)$ on pre-asymptotic meshes for $\nu \ll 1$, i.e., no convergence order at all was observed --- a classical locking phenomenon. Furhtermore, in the time-dependent Stokes problem, it was shown that classical, non-pressure-robust methods with ${k_p^{\mathrm{cl}}}={k_{{ \boldsymbol{u} }}^{\mathrm{cl}}}-1$ even lose two orders of convergence in the $\LP{2}{}$ norm w.r.t.\ comparable pressure-robust methods. E.g., while the pressure-robust Scott--Vogelius element with $({k_{{ \boldsymbol{u} }}^{\mathrm{pr}}}=2, {k_p^{\mathrm{pr}}}=1)$ converges with the optimal order $3$ in the $\LP{2}{}$ norm, the classical, non-pressure-robust Taylor--Hood method $({k_{{ \boldsymbol{u} }}^{\mathrm{cl}}}=2, {k_p^{\mathrm{cl}}}=1)$ converges only with order $1$ in the $\LP{2}{}$-norm \cite{lr:2018}. ~\\ Thus, non-pressure-robust space discretisations need higher-order discrete pressure spaces in order to get reasonable convergence orders for their discrete velocities --- since high-order discrete pressure approximations reduce the consistency error $\norm{{ \mathbb{P} }_h(\nabla p)}_\LP{2}{}$ by a simple Taylor expansion. Due to inf-sup stability, usually it holds ${k_{{ \boldsymbol{u} }}^{\mathrm{cl}}} \geqslant {k_p^{\mathrm{cl}}}$ (usually ${k_p^{\mathrm{cl}}} = {k_{{ \boldsymbol{u} }}^{\mathrm{cl}}}-1$), and high-order discrete pressure spaces require high-order discrete velocity spaces as well. As a conclusion, pressure-robust methods with ${k_p^{\mathrm{pr}}}={k_{{ \boldsymbol{u} }}^{\mathrm{pr}}}-1$ for the time-dependent Stokes problem converge with two more orders of convergence in the $\LP{2}{}$ norm than non-pressure-robust methods with ${k_p^{\mathrm{cl}}} = {k_{{ \boldsymbol{u} }}^{\mathrm{cl}}}-1$, if the pressure $\nabla p$ is non-negligible \cite{lr:2018}. \subsection{Beltrami flows} The considerations for time-dependent Stokes problems with $\nu \ll 1$ and large pressure gradients $\nabla p$ are now applied to high-Reynolds number Beltrami flows, where it holds ${ \boldsymbol{f} }={ \boldsymbol{0} }$ and $-({ \boldsymbol{u} } \ip \nabla) { \boldsymbol{u} } = -\frac{1}{2} \nabla \abs{{ \boldsymbol{u} }}^2=\nabla p$, i.e., the dominant nonlinear convection term induces a large pressure gradient. \subsubsection{Polynomial potential flows} \label{sub:sec:sec:poly} A simple consideration allows to show that pressure-robust discretisations sometimes allow to reduce the formal approximation order from ${k_{{ \boldsymbol{u} }}^{\mathrm{cl}}} = 2 k + 1$ (non-pressure-robust, ${k_p^{\mathrm{cl}}}={k_{{ \boldsymbol{u} }}^{\mathrm{cl}}}-1$) to ${k_{{ \boldsymbol{u} }}^{\mathrm{pr}}}=k$ without compromising the accuracy for the discrete velocities at all. ~\\ Let us assume that for all $t \in \sqb{0,{ T }}$, $({ \boldsymbol{u} }, p)$ is a time-dependent polynomial potential flow with $h(t) \in \Pk{k+1}{}$ for all $t$, i.e., it holds for all times that ${ \boldsymbol{u} }(t)=\nabla h(t)$, $\nabla p(t)=-\frac{1}{2}\nabla\abs{{ \boldsymbol{u} }(t)}^2$ and $\Delta h(t)=0$. Then, $({ \boldsymbol{u} }(t), p(t)) \in \PPk{k}{} \times \Pk{2k}{}$ fulfils (for all fixed $\nu > 0$) the time-dependent Navier--Stokes equations \eqref{eq:transient:navier:stokes} with ${ \boldsymbol{f} }={ \boldsymbol{0} }$, and ${ \boldsymbol{u} }$ is indeed a Beltrami flow, see Section \ref{sec:GenBeltramiFlows}. Note that one has to impose, e.g., time-dependent inhomogeneous Dirichlet velocity boundary conditions. A pressure-robust space discretisation of order ${k_{{ \boldsymbol{u} }}^{\mathrm{pr}}}=k$ will deliver the exact velocity solution ${ \boldsymbol{u} }_h(t)={ \boldsymbol{u} }(t)$ for all $t\in \sqb{0,{ T }}$ according to Theorem \ref{thm:pr} on every shape-regular mesh. On the contrary, non-pressure-robust space discretisations only deliver the exact velocity solution ${ \boldsymbol{u} }_h(t)={ \boldsymbol{u} }(t)$, if it also holds $p(t) \in Q_h$ for all $t \in \sqb{0,{ T }}$ according to the consistency error \eqref{eq:pr:term} in Theorem \ref{thm:classical}. Thus, classical space discretisations (with ${k_p^{\mathrm{cl}}}={k_{{ \boldsymbol{u} }}^{\mathrm{cl}}}-1$) require ${k_p^{\mathrm{cl}}}=2 k$, i.e., ${k_{{ \boldsymbol{u} }}^{\mathrm{cl}}}={k_p^{\mathrm{cl}}}+1 = 2k+1$. ~\\ This observation has been already published in \cite{cmame:linke:merdon:2016}. Therefore, we simply refer to the numerical results therein. \subsubsection{Non-$C^{\infty}$ Beltrami flows} In the following, it is assumed that ${ \boldsymbol{u} }$ is a time-dependent Beltrami flow with ${ \boldsymbol{u} } \in \Lp{\infty}{\rb{0,{ T }; \HH^{k+1}}}$ for $k \in \mathbb{N}$ and $k \geqslant 1+d/2$ and ${ \boldsymbol{u} } \notin \Lp{\infty}{\rb{0,{ T }; \HH^{k+1+{ \varepsilon }}}}$ for any ${ \varepsilon }>0$. According to Theorem \ref{thm:pr} for $\nu \ll 1$, one gets for pressure-robust space discretisations with ${k_{{ \boldsymbol{u} }}^{\mathrm{pr}}}=k$ a convergence order $k \leqslant {k_{{ \boldsymbol{u} }}^{\mathrm{pr}}} \leqslant k+1$ for the $\LP{2}{}$ norm; note that the nonlinearity of the problem may lead to a reduction of the convergence order on pre-asymptotic meshes, as compared to the time-dependent Stokes problem \cite{lm:2018}. ~\\ Turning to non-pressure-robust methods, one notes that due to $\nabla p=-\frac{1}{2}\nabla \abs{{ \boldsymbol{u} }}^2$ and ${ \boldsymbol{u} } \in \Lp{\infty}{\rb{0,{ T }; \HH^{k+1}}}$ it holds $p \in \Lp{\infty}{\rb{0,{ T }; H^{k+1}}}$. The result can be proven by the Leibniz formula yielding for the $\kappa$-th derivative of $\frac{1}{2} (f(x))^2$ (with $\kappa=0, 1, \ldots, k+1$) \begin{equation} \label{eq:leibniz:formula} \frac{1}{2} |(f(x))^2|^{(\kappa)} = \frac{1}{2} \sum_{i=0}^{\kappa} \binom{\kappa}{i} f^{(\kappa-i)} f^{(i)}. \end{equation} According to the Sobolev imbedding theorem for $d \leq 3$, one concludes: for $f \in H^1$ it holds also $f \in L^6$ and for $f \in H^2$ it holds also $f \in L^{\infty}$. Therefore, all the terms in \eqref{eq:leibniz:formula} are either in $L^3$ or in $L^2$, if at least $f \in H^2$. Substituting $f=\abs{{ \boldsymbol{u} }}$ and searching for partial derivatives delivers the regularity for the pressure $p$. Due to the spatial regularity $({ \boldsymbol{u} }, p) \notin \HH^{k+1+{ \varepsilon }} \times H^{k+1+{ \varepsilon }}$, one concludes that any space discretisation method with ${k_{{ \boldsymbol{u} }}^{\mathrm{cl}}} > k$ cannot converge with a better convergence order than the pressure-robust method with ${k_{{ \boldsymbol{u} }}^{\mathrm{pr}}}=k$. Also the pressure-dependent velocity error contribution \eqref{eq:pr:term} has a consistency error, which cannot be expected to be better than of order $k$. ~\\ Prescribing a certain accuracy of the velocity error of the pressure-robust method like \begin{equation*} \norm{{ \boldsymbol{e} }_h}_\Lp{\infty}{\rb{0,{ T }; \LP{2}{}}} \leqslant \frac{{ \varepsilon }}{\norm{{ \boldsymbol{u} }}_\Lp{\infty}{\rb{0,{ T }; \LP{2}{}}}} \end{equation*} for ${ \boldsymbol{u} } \not= { \boldsymbol{0} }$ and ${ \varepsilon } \ll 1$ can be fulfilled for mesh sizes $h$ which are fine enough, i.e., $h < h({ \varepsilon })$; in the case ${ \boldsymbol{u} }(t)\equiv { \boldsymbol{0} }$, every mesh allows for the exact solution ${ \boldsymbol{u} }_h(t)={ \boldsymbol{u} }(t)$ for pressure-robust methods. Now, the solution ${ \boldsymbol{u} }$ can be represented as ${ \boldsymbol{u} } = { \boldsymbol{u} }_h + ({ \boldsymbol{u} }-{ \boldsymbol{u} }_h) \eqqcolon { \boldsymbol{u} }_h + { \boldsymbol{r} }$. ~\\ Then, it holds further $\nabla p=- \nabla ( \frac{1}{2}\abs{{ \boldsymbol{u} }_h}^2 + { \boldsymbol{u} }_h\ip { \boldsymbol{r} } + \frac{1}{2} \abs{{ \boldsymbol{r} }}^2)$ with ${ \boldsymbol{r} } \in \Lp{\infty}{\rb{\HH^{k+1}}}$, $\frac{1}{2} \abs{{ \boldsymbol{r} }}^2 \in \Lp{\infty}{\rb{\HH^{k+1}}}$ and $\norm{{ \boldsymbol{r} }}_\Lp{\infty}{\rb{\LP{2}{}}} \approx {{ \varepsilon }}/{\norm{{ \boldsymbol{u} }}_\Lp{\infty}{\rb{\LP{2}{}}}}$. Due to $\frac{1}{2} \abs{{ \boldsymbol{u} }_h}^2 \in \Pk{2k}{(\T)}$ one can get (depending on the flow field ${ \boldsymbol{u} }$ and its Sobolev semi norms $|{ \boldsymbol{u} }|_{\HH^i}$ for $i=0, 1, \ldots, 2 k-1)$ that the approximation of $\frac{1}{2} \abs{{ \boldsymbol{u} }_h}^2 $ by piecewise polynomials from $\Pk{i}{(\T)}$ may lead to a non-negligible error for all $i=0, 1, \ldots, 2k-1$. Note that the higher derivatives of $-\frac{1}{2} |{ \boldsymbol{u} }|^2$ are given by a weighted sum of products of low- and high-order derivatives of ${ \boldsymbol{u} }$ according to \eqref{eq:leibniz:formula}. Then, only the choice ${k_p^{\mathrm{cl}}}=2k$ and ${k_{{ \boldsymbol{u} }}^{\mathrm{cl}}}=2k+1$ can ensure that for the classical, non-pressure-robust method also holds $\norm{\nabla \sqb{p - L_h(p)}}_\Lp{2}{\rb{\LP{2}{}}}=\mathcal{O}({ \varepsilon })$. ~\\ Thus, the considerations for purely polynomial Beltrami flows can also be extended to more general Beltrami flows, and pressure-robust discretisations of formal order ${k_{{ \boldsymbol{u} }}^{\mathrm{pr}}}=k$ can be comparably accurate as classical, non-pressure-robust discretisations of order ${k_{{ \boldsymbol{u} }}^{\mathrm{cl}}}=2 k+1$. \subsubsection{Analytic Beltrami flows} For analytic, but non-polynomial Beltrami flows no clear statements beyond Subsection \ref{subsec_low:order:discs} can be given about how much pressure-robust methods allow to reduce the formal order of the approximations without compromising the accuracy. However, in the numerical examples below we will exclusively compare numerical results on analytic flows, where high-order methods profit from exponential convergence. Nevertheless, one can confirm that for moderate formal approximation orders up to ${k_{{ \boldsymbol{u} }}^{\mathrm{cl}}}=6$ pressure-robust methods allow for halving the approximation order without compromising the accuracy on coarse meshes. \subsection{Generalised Beltrami flows} \label{subsec:gen:beltrami:flows} Actually, pure Beltrami flows are only difficult for classical, non-pressure-robust space discretisations whenever the nonlinear convection term is approximated by the so-called convective form $({ \boldsymbol{u} }_h \ip \nabla) { \boldsymbol{u} }_h$ (or a skew-symmetric variant thereof). Alternatively, one can exploit \eqref{eq:nonlin:identity} which tells us that it holds \begin{equation} \label{eq:rot:form} { \mathbb{P} }(({ \boldsymbol{u} } \ip \nabla) { \boldsymbol{u} }) = { \mathbb{P} }((\nabla \times { \boldsymbol{u} }) \times { \boldsymbol{u} }). \end{equation} Therefore, velocity solutions of the incompressible Navier--Stokes equations \eqref{eq:transient:navier:stokes} also fulfil \begin{equation*} \partial_t{ \boldsymbol{u} } - \nu \Delta { \boldsymbol{u} } + \rb{\nabla \times { \boldsymbol{u} }} \times { \boldsymbol{u} } + \nabla \pi^\mathrm{rot} = { \boldsymbol{f} }, \qquad \DIV { \boldsymbol{u} } = 0, \end{equation*} where the pressure $p$ has been replaced by the new pressure variable \begin{equation} \pi^\mathrm{rot} \coloneqq p + \frac{1}{2} \nabla |{ \boldsymbol{u} }|^2. \end{equation} This is the so-called rotational or vector-invariant form \cite{lo:2002} of the incompressible Navier--Stokes equations which is equivalent to the convective form. ~\\ It should be noted that pressure-robust (exactly divergence-free) methods, like the Scott--Vogelius element, deliver exactly the same discrete velocities for the convective and the rotational form on every mesh, since they appropriately handle the equivalence classes of forces leading to \eqref{eq:rot:form} \cite{bclr:2010}. On the other hand, classical, non-pressure robust methods, which do not respect the equivalence classes of forces exactly, deliver different discrete velocities. For Beltrami flows, one obtains \begin{equation*} \pi^{\mathrm{rot}} = -\frac{1}{2} \nabla |{ \boldsymbol{u} }|^2 + \frac{1}{2} \nabla |{ \boldsymbol{u} }|^2 = 0 \end{equation*} and the issue of a lack of pressure-robustness in classical space discretisations does not play any role for high Reynolds number Beltrami flows using the the rotational form of the Navier--Stokes equations \cite{cmame:linke:merdon:2016}. ~\\ So, why not simply using classical, non-pressure-robust methods in connection with the rotational form for the simulation of high Reynolds number flows? The reason is that there exist generalised Beltrami flows, --- where $({ \boldsymbol{u} } \ip \nabla) { \boldsymbol{u} }$ is a gradient field --- which can be accurately simulated with classical methods with the convective form, but not accurately with the rotational form at high Reynolds numbers. We also refer to e.g.\ \cite{Zang:1991} for numerical investigations showing that the rotational form of the incompressible Navier--Stokes can be inaccurate in FEM discretisations. ~\\ The easiest example is quadratic, planar Hagen--Poiseuille flow in a channel. Here, it holds $({ \boldsymbol{u} } \ip \nabla) { \boldsymbol{u} } = { \boldsymbol{0} }$, and the nonlinear convection term is a trivial gradient field, which is, e.g., always a discrete solution of the non-pressure-robust Taylor--Hood element $\PPk{2}{}/\Pk{1}{}$ for all Reynolds numbers on all meshes. However, using the quadratic Taylor--Hood element in connection with the rotational form will lead to enormous velocity errors on coarse meshes and high Reynolds numbers, since the corresponding pressure $\pi^\mathrm{rot}$ will be a fourth order polynomial, again. ~\\ Moreover, in complicated flows like in a K\'arm\'an vortex street, see Section \ref{sec:KarmanBeltrami}, usually there dominate different types of flows locally: at the inlet a situation similar to a Hagen--Poiseuille flow dominates, where the convective form is accurate for classical discretisations, and in front of the obstacle a situation like a generalised Beltrami flow may prevail, where other forms of the convective term could be more accurate for non-pressure-robust discretisations. ~\\ In conclusion, pressure-robust discretisations respect \eqref{eq:rot:form} exactly on the discrete level and are thus appropriate for all types of situations. However, if for a generalised Beltrami flow the classical discretisation in convective form is compared to a pressure-robust discretisation, the pressure-robust discretisation may have a dramatic speedup (for Beltrami-type flows), but it can also happen that there is no speedup at all, since Hagen--Poiseuille with the trivial nonlinear convection term $({ \boldsymbol{u} } \ip \nabla) { \boldsymbol{u} } = { \boldsymbol{0} }$ is also a generalised Beltrami flow. Thus, the speedup question is not really decidable, but large speedups are achievable for generalised Beltrami flows, see, e.g., the numerical results in Subsection \ref{sec:2DLatticeFlow}. \section{Gresho vortex problem with $\emph{\textbf{H}}^{\mathbf{1}}$-FEM} \label{sec:GreshoH1} A frequently used 2D model problem for investigating how well a discretisation preserves structures is the so-called `Gresho vortex' \cite{GreshoChan90} (originally called `triangle vortex'). Centred at ${ \boldsymbol{c} }=\rb{c_1,c_2}^\dag\in\mathbb{R}^2$ and with a (constant) translational velocity ${ \boldsymbol{w} }_0\in\mathbb{R}^2$, the problem setup in Cartesian coordinates is fully described by the initial condition \begin{align} \label{eq:GreshoInitialVortex} { \boldsymbol{u} }_0\rb{{ \boldsymbol{x} }} = { \boldsymbol{w} }_0 + \begin{cases} \rb{-5\widetilde{x}_2,5\widetilde{x}_1}^\dag,\quad &0\leqslant r < 0.2,\\ \rb{-\frac{2\widetilde{x}_2}{r}+5\widetilde{x}_2, \frac{2\widetilde{x}_1}{r}-5\widetilde{x}_1}^\dag, &0.2\leqslant r < 0.4,\\ \rb{0,0}^\dag, &0.4\leqslant r, \end{cases} \end{align} with Euclidean distance from the vortex centre $r=\abs{{ \boldsymbol{x} }-{ \boldsymbol{c} }}_2$ and $\rb{\widetilde{x}_1,\widetilde{x}_2}=\rb{x_1-c_1,x_2-c_2}$. The initial Gresho vortex \eqref{eq:GreshoInitialVortex} has a constant vorticity in its core for $r<0.2$ (similar to a rigid body rotation) but then, for $0.2 \leqslant r < 0.4$ it decreases linearly and vanishes for $r\geqslant 0.4$ with discontinuities at $r\in\set{0.2,0.4}$. In Figure~\ref{fig:Gresho_initial_state} one can get an impression of how the initial velocity field described by \eqref{eq:GreshoInitialVortex} looks like (left-hand side); on the right-hand side, the (discontinuous) initial vorticity is shown. When ${ \boldsymbol{w} }_0\equiv{ \boldsymbol{0} }$ is chosen, the name `standing vortex problem' is also used sometimes. ~\\ \begin{figure}[h] \centering \includegraphics[width=0.31\textwidth]{Gresho/initial/pdf/Gresho-vel0.pdf} \hspace{10pt} \includegraphics[width=0.31\textwidth]{Gresho/initial/pdf/Gresho-vort0.pdf} \caption{Initial state of Gresho vortex problem. Velocity magnitude $\abs{{ \boldsymbol{u} }_0}$ (left) and vorticity $\omega_0$ (right).} \label{fig:Gresho_initial_state} \end{figure} Our actual simulations are done in the $x_1$- and $x_2$- periodic box $\Omega=\rb{0,1}^2$ with centre ${ \boldsymbol{c} }=\rb{0.5,0.5}^\dag$ and up to an end time ${ T }=3$. For a wind ${ \boldsymbol{w} }_0=\rb{0,0}^\dag$ we obtain the standing Gresho vortex problem, while, e.g., choosing ${ \boldsymbol{w} }_0=\rb{1/3,1/3}^\dag$ corresponds to the moving Gresho vortex setting which we will consider in this work. The full time-dependent Navier--Stokes problem \eqref{eq:TINS} with ${ \boldsymbol{f} }\equiv{ \boldsymbol{0} }$ governs the problem with initial condition \eqref{eq:GreshoInitialVortex} and we fix $\nu=\num{E-5}$. For the spatial discretisation, unstructured triangular meshes are employed, and for the time-stepping we use a constant time step $\Delta t=\num{e-4}$ with the second-order Runge--Kutta (RK) variant ARS(2,2,2) of the implicit-explicit (IMEX) method introduced in \cite{AscherEtAl97}; cf., for example, \cite{Lehrenfeld10} for more details about time integration for PDEs in this context. Stokes-type subproblems are treated implicitly and the associated matrix for solving linear systems is called $M^\ast$, whereas convection is treated explicitly. All computations in this work have been done with the high-order finite element library \texttt{NGSolve} \cite{Schoeberl14}. ~\\ In the following, we compare the exactly divergence-free and pressure-robust $\PPk{k}{}/\Pdk{k-1}{}$ Scott--Vogelius method SV$_k$ with the classical non-pressure-robust $\PPk{k}{}/\Pk{k-1}{}$ Taylor--Hood method TH$_k$ for $k\in\set{4,8}$. The discrete formulation for both methods is given by \eqref{eq:H1-FEM}. Note again that while SV$_k$ is energy-stable without any modifications to the convection term, TH$_k$ is explicitly used with a skew-symmetrisation involving the divergence of discrete velocities. ~\\ In Table~\ref{tab:DOFs}, the relevant numbers of degrees of freedom (DOFs) and numbers of non-zero entries (NZEs) of $M^\ast$, which result from different triangular meshes are collected. The reference solution refSV$_k$ (no convection stabilisation) is used to assess the quality of the other less-resolved simulations. Here, the counted DOFs indicate the costs for explicit operator applications (convection), while the NZEs allow to assess the effort involved in implicit linear solves for the Stokes subproblems. Note that four different meshes are chosen in order to ensure a (relatively) fair comparison between the different methods and polynomial orders. ~\\ \begin{table}[h] \caption{Overview of number of mesh elements, DOFs and NZEs of $M^\ast$ for the Gresho problem, based on discretisations with Scott--Vogelius SV$_k$ and Taylor--Hood TH$_k$ of different order $k\in\set{4,8}$. A reference solution refSV$_8$ is also computed. The abbreviations `K' and `M' denote thousands and millions, respectively.} \label{tab:DOFs} \centering \noindent \begin{tabular}{N N N N N N} \toprule \multicolumn{1}{N}{\textbf{}} & \multicolumn{3}{c}{Scott--Vogelius} & \multicolumn{2}{c}{Taylor--Hood} \\ \cmidrule[0.05em](lr){2-4} \cmidrule[0.05em](ll){5-6} \multicolumn{1}{c}{Name} & refSV$_8$ & SV$_8$ & SV$_4$ & TH$_8$ & TH$_4$ \\ \cmidrule[0.05em](lr){1-1} \cmidrule[0.05em](lr){2-4} \cmidrule[0.05em](ll){5-6} \multicolumn{1}{l}{$\#\set{\mathrm{trigs}}$} & \numQ{23446} & \numQ{330} & \numQ{1346} & \numQ{432} & \numQ{2004} \\ \multicolumn{1}{l}{$\#\set{{ \boldsymbol{u} }\,\mathrm{DOFs}}$} & \numQ{1500544} & \numQ{21120} & \numQ{21536} & \numQ{27648} & \numQ{32064} \\ \multicolumn{1}{l}{$\#\set{p\,\mathrm{DOFs}}$} & \numQ{844056} & \numQ{11880} & \numQ{13460} & \numQ{10584} & \numQ{9018} \\ \multicolumn{1}{l}{$\#\set{\text{nze}(M^\ast)}$ } & \numQ{239864425} & \numQ{3377120} & \numQ{1302724} & \numQ{4247969} & \numQ{1713399} \\ \bottomrule \end{tabular} \end{table} Let us begin analysing the flow by first regarding the state at $t=3$, computed with the reference refSV$_8$ method in Figure~\ref{fig:Standing_Gresho_ref}. On the left-hand side, the vorticity is shown and it becomes clear that the viscosity in the Navier--Stokes problem smoothes out the discontinuities from the initial condition. For the other two figures, the discrete Helmholtz--Hodge projection \eqref{eq:disc:helm}, computed with the same SV method, has been used to obtain the decomposition ${ \boldsymbol{f} }_h=\rb{{ \boldsymbol{u} }_h\ip\nabla_h}{ \boldsymbol{u} }_h=\HLSV{{ \boldsymbol{f} }_h}+\nabla\phi_h$. One can observe that the gradient part $\nabla\phi_h$ (middle) is clearly dominating the divergence-free part $\HLSV{{ \boldsymbol{f} }_h}$ of ${ \boldsymbol{f} }_h=\rb{{ \boldsymbol{u} }_h\ip\nabla_h}{ \boldsymbol{u} }_h$. Furthermore, $\HLSV{{ \boldsymbol{f} }_h}$ is very small and thus, interestingly, this flow behaves approximately like a generalised Beltrami flow. ~\\ \begin{figure}[h] \centering \includegraphics[width=0.31\textwidth]{Gresho/standing/png/pdf/Gresho-ref-vort-t3.pdf} \includegraphics[width=0.31\textwidth]{Gresho/standing/png/pdf/Gresho-ref-gradient-t3.pdf} \includegraphics[width=0.31\textwidth]{Gresho/standing/png/pdf/Gresho-ref-divfree-t3.pdf} \caption{Reference solution for standing Gresho vortex at $t=3$. Vorticity (left), gradient part $\abs{\nabla\phi_h}_\nf{3}{2}^\nf{3}{2}$ (middle) and Helmholtz projection $\abs{\HLSV{{ \boldsymbol{f} }_h}}_\nf{3}{2}^\nf{3}{2}$ (right) of discrete convection term ${ \boldsymbol{f} }_h=\rb{{ \boldsymbol{u} }_h\ip\nabla_h}{ \boldsymbol{u} }_h$.} \label{fig:Standing_Gresho_ref} \end{figure} In view of the explanations in the previous sections, we would expect that a pressure-robust method is in general superior to a non-pressure-robust method for this kind of flow. And indeed, in the following, we show that the pressure-robust SV method is effortlessly able to preserve the vortex structure of the problem, whereas the non-pressure-robust TH method has certain difficulties with this task. \subsection{Standing Gresho vortex} At first, we consider the standing Gresho problem with ${ \boldsymbol{w} }_0=\rb{0,0}^\dag$ in \eqref{eq:GreshoInitialVortex}. Figure~\ref{fig:Standing_Gresho_H1_vorticity} shows the vorticity of the SV$_k$ (pressure-robust) and TH$_k$ (non-pressure-robust) simulations for different polynomial orders $k$ on different meshes (corresponding to Table~\ref{tab:DOFs}) for the standing Gresho problem. At first, one can observe that the pressure-robust method is able to preserve the structure of the initial condition, whereas the non-pressure-robust methods completely fails to give a reasonable approximation for this (seemingly) easy flow problem. ~\\ \begin{figure}[h] \centering \includegraphics[width=0.225\textwidth] {Gresho/standing/png/pdf/Gresho-SV-stabFalse-RK2-dtinv10000-order4-N25-subdiv5.pdf} \hspace{5pt} \includegraphics[width=0.225\textwidth] {Gresho/standing/png/pdf/Gresho-SV-stabFalse-RK2-dtinv10000-order8-N12-subdiv6.pdf} \hspace{5pt} \includegraphics[width=0.225\textwidth] {Gresho/standing/png/pdf/Gresho-TH-stabFalse-RK2-dtinv10000-order4-N30-subdiv5.pdf} \hspace{5pt} \includegraphics[width=0.225\textwidth] {Gresho/standing/png/pdf/Gresho-TH-stabFalse-RK2-dtinv10000-order8-N13-subdiv6.pdf} \\ \vspace*{5pt} \includegraphics[width=0.3\textwidth] {Gresho/png/pdf/Gresho-vorticity-colour-bar.pdf} \caption{Vorticity of standing Gresho vortex simulations at $t=3$. SV$_4$ (left); SV$_8$ (second from left); TH$_4$ (second from right); TH$_8$ (right). The used meshes, corresponding to Table~\ref{tab:DOFs}, can also be seen.} \label{fig:Standing_Gresho_H1_vorticity} \end{figure} In view of our reference solution in Figure~\ref{fig:Standing_Gresho_ref}, it becomes clear that it is of utmost importance to be able to handle the occurring curl-free gradient part of the convection term accurately. Furthermore, one can see that the higher-order method with $k=8$ gives slightly better results in the Scott--Vogelius case. This is very surprising, as one would generally not expect high-order regularity for the corresponding exact solution in this case. \subsection{Moving Gresho vortex} Now, we are dealing with the moving Gresho problem with ${ \boldsymbol{w} }_0=\rb{1/3,1/3}^\dag$. After moving in the top-right direction through the periodic domain, this means that at ${ T }=3$, the vortex is intended to be again centred around ${ \boldsymbol{c} }=\rb{0.5,0.5}^\dag$. Before taking a closer look at the vorticity (analogous to Figure~\ref{fig:Standing_Gresho_H1_vorticity}), let us consider important flow quantities monitored over the course of the particular simulation. ~\\ \begin{figure}[h] \centering \includegraphics[width=0.32\textwidth] {Gresho/moving/tikz/GreshoMove-energy.pdf} \includegraphics[width=0.32\textwidth] {Gresho/moving/tikz/GreshoMove-enstrophy.pdf} \includegraphics[width=0.32\textwidth] {Gresho/moving/tikz/GreshoMove-palinstrophy.pdf} \caption{Evolution of kinetic energy $\Kin{{ \boldsymbol{u} }_h}$ (left), enstrophy $\Ens{{ \boldsymbol{u} }_h}$ (middle) and palinstrophy $\Pal{{ \boldsymbol{u} }_h}$ (right) for SV$_k$/TH$_k$ ($k\in\set{4,8}$) and refSV$_8$; see also Table~\ref{tab:DOFs}.} \label{fig:GreshoMove_quantities} \end{figure} In Figure~\ref{fig:GreshoMove_quantities}, one can see the evolution of kinetic energy $\Kin{{ \boldsymbol{u} }_h}=\frac{1}{2}\norm{{ \boldsymbol{u} }_h}_\LP{2}{}^2$, enstrophy $\Ens{{ \boldsymbol{u} }_h}=\frac{1}{2}\norm{\omega_h}_\Lp{2}{}^2$ and palinstrophy $\Pal{{ \boldsymbol{u} }_h}=\frac{1}{2}\norm{\nabla_h\omega_h}_\LP{2}{}^2$ over time. Again, we have computed a reference solution and SV$_k$/TH$_k$ solutions for $k\in\set{4,8}$ (cf.\ Table~\ref{tab:DOFs}). For the kinetic energy, one can observe that while the non-pressure-robust solutions coincides with the pressure-robust solutions at the beginning, they show a much earlier rapid decrease in energy. Here, TH$_8$ seems to be slightly superior to TH$_4$, but still, they are both not satisfactory. The SV$_k$ solutions, on the other hand, preserve the kinetic energy quite well. Concerning the enstrophy, again SV$_k$ and refSV$_8$ are undistinguishable. On the other hand, the TH$_k$ solutions show a spontaneous increase in enstrophy which is absolutely not physical for this freely decaying 2D problem. Lastly, concerning the palinstrophy, one can observe that the non-pressure-robust methods yield huge values which are not close to the reference solution. For the pressure-robust methods, we observe that while SV$_4$ and SV$_8$ do not coincide with refSV$_8$, they at least show qualitatively the same behaviour. Furthermore, one can see SV$_8$ is slightly more precise than SV$_4$. This comparison shows that in terms of physically interesting quantities, pressure-robust methods drastically outperform non-pressure-robust methods for the moving Gresho problem. ~\\ In the following, we want to demonstrate that the material derivative of the moving Gresho problem is indeed approximately a (non-trivial) gradient field and thus velocity-equivalent to a zero force, as suggested by Section~\ref{sec:EulerFlows}. To this end, we consider the discrete Helmholtz decomposition of the (discrete) material derivative \begin{equation} \label{eq:HelmholtzMaterialSV} { \boldsymbol{f} }_h^t = \partial_t{ \boldsymbol{u} }_h + \rb{{ \boldsymbol{u} }_h\ip\nabla_h}{ \boldsymbol{u} }_h = \HLSV{{ \boldsymbol{f} }_h^t}+\nabla\phi_h^t, \end{equation} where $\HLSV{\cdot}$ is always the pressure-robust discrete Scott--Vogelius Helmholtz projector. Note that also for the TH method, the SV Helmholtz projector is used with the intention of being able to distinguish accurately between divergence-free and curl-free forces, also in the non-pressure-robust case. ~\\ \begin{figure}[h] \centering \includegraphics[width=0.32\textwidth] {Gresho/moving/tikz/GreshoMove-fht.pdf} \includegraphics[width=0.32\textwidth] {Gresho/moving/tikz/GreshoMove-phsv.pdf} \includegraphics[width=0.32\textwidth] {Gresho/moving/tikz/GreshoMove-gradphiht.pdf} \caption{Evolution of $\LP{\nf{3}{2}}{}$-norms of (discrete) material derivative ${ \boldsymbol{f} }_h^t=\partial_t{ \boldsymbol{u} }_h+\rb{{ \boldsymbol{u} }_h\ip\nabla_h}{ \boldsymbol{u} }_h$ (left), divergence-free part $\HLSV{{ \boldsymbol{f} }_h^t}$ (middle) and gradient part $\nabla \phi_h^t$ (right) for SV$_k$/TH$_k$ ($k\in\set{4,8}$) and refSV$_8$; see also Table~\ref{tab:DOFs}.} \label{fig:GreshoMove_Helmholtz} \end{figure} Now, Figure~\ref{fig:GreshoMove_Helmholtz} shows the evolution of the $\LP{\nf{3}{2}}{}$-norms of the three terms in \eqref{eq:HelmholtzMaterialSV} for the different methods from Table~\ref{tab:DOFs}. The plot for $\norm{{ \boldsymbol{f} }_h^t}_\nf{3}{2}$ shows that, compared to the reference solution refSV$_8$, the non-pressure-robust TH$_k$ TH$_k$ methods result in a completely inaccurate material derivative. From regarding $\norm{\HLSV{{ \boldsymbol{f} }_h^t}}_\nf{3}{2}$ and $\norm{\nabla \phi_h^t}_\nf{3}{2}$, it becomes clear why this is the case: At first the divergence-free part $\HLSV{{ \boldsymbol{f} }_h^t}$ of the reference solution is very small, and this can be preserved well by the divergence-free SV$_k$ methods. However, the TH$_k$ methods result in a much larger divergence-free force which is not the correct behaviour. A similar observation holds for the gradient term $\nabla \phi_h^t$: the non-pressure-robust methods do not yield accurate results here. ~\\ \begin{figure}[h] \centering \includegraphics[width=0.225\textwidth] {Gresho/moving/png/pdf/Gresho-SV-stabFalse-DtHelmTrue-RK2-dtinv10000-order4-N25-subdiv5.pdf} \hspace{5pt} \includegraphics[width=0.225\textwidth] {Gresho/moving/png/pdf/Gresho-SV-stabFalse-DtHelmTrue-RK2-dtinv10000-order8-N12-subdiv6.pdf} \hspace{5pt} \includegraphics[width=0.225\textwidth] {Gresho/moving/png/pdf/Gresho-TH-stabFalse-DtHelmTrue-RK2-dtinv10000-order4-N30-subdiv5.pdf} \hspace{5pt} \includegraphics[width=0.225\textwidth] {Gresho/moving/png/pdf/Gresho-TH-stabFalse-DtHelmTrue-RK2-dtinv10000-order8-N13-subdiv6.pdf} \\ \vspace*{5pt} \includegraphics[width=0.3\textwidth] {Gresho/png/pdf/Gresho-vorticity-colour-bar.pdf} \caption{Vorticity of moving Gresho vortex simulations at $t=3$. SV$_4$ (left); SV$_8$ (second from left); TH$_4$ (second from right); TH$_8$ (right). The used meshes, corresponding to Table~\ref{tab:DOFs}, can also be seen.} \label{fig:Moving_Gresho_H1_vorticity} \end{figure} All in all, we claim that this deficiency of non-pressure-robust methods is the main reason why they are significantly inferior to pressure-robust methods for flow problems with large gradient forces. Let us end our investigations for the Gresho problem with vorticity plots at $t={ T }=3$ for SV$_k$/TH$_k$ ($k\in\set{4,8}$); cf.\ Figure~\ref{fig:Moving_Gresho_H1_vorticity}. For SV$_k$, practically no difference to the standing Gresho problem can be observed, while the TH$_k$ results are even worse. These plots underline our previous statement that pressure-robust methods are much better suited to preserve large-scale structures -- even when the particular problem at hand is only Galilean-invariant to an approximate generalised Beltrami flow, and thus more complicated than an approximate generalised Beltrami flow. \section{\emph{\textbf{H}}(div)- and \emph{$\textbf{L}$}$^\textbf{2}$-DG finite element methods} \label{sec:dGFEM} In order to illustrate the numerical analysis developed in Section \ref{sec:ErrorAnalysisH1}, we will present several numerical studies that compare pressure-robust versus classical, non-pressure-robust space discretisations. In order to make a fair and convincing comparison we will perform the numerical benchmarks from now on with Discontinuous Galerkin (DG) methods. The reason for this choice is manifold. First and most important, with the software package \texttt{NGSolve} \cite{Schoeberl14}, there exists a versatile, well-established and efficient numerical implementation of plenty of different DG methods, allowing especially for high-order space discretisation. ~\\ We choose to compare an exactly divergence-free, pressure-robust $\HDIV$-conforming DG method with a classical, non-pressure-robust DG methods which is only $\LP{2}{}$-conforming (both discretely inf-sup stable). In this setting, our second reason for using DG methods is that after choosing elementwise polynomials of order ${k_{{ \boldsymbol{u} }}}$ for the velocity, both the $\HDIV$- and the $\LP{2}{}$-DG method work with the same (discontinuous) discrete pressure space of polynomial order $k_p={k_{{ \boldsymbol{u} }}}-1$. Thus, both methods have a roughly comparable number of degrees of freedom and we think that a comparison between these methods is quite fair. ~\\ Third, we will deal with flows at high Reynolds numbers which makes a certain convection stabilisation desirable and/or necessary. In the DG context, upwind techniques are well-established and $\HDIV$- and $\LP{2}{}$-conforming DG methods allow to apply exactly the same upwind stabilisation, facilitating a fair comparison. In Figure \ref{fig:Lattice_Stokes_comparison} the (moderately) positive effect w.r.t.\ the numerical error of a upwind stabilised versus a centred discretisation of the convection term is illustrated --- which is not at all self-evident for generalised Beltrami flows, by the way. ~\\ Last but not least, we emphasise that a similar numerical analysis as in the case of $\HH^1$-conforming space discretisations is possible for DG methods as well, but would only involve additional technical problems due to the facet terms required for DG discretisations. In fact, in the PhD thesis \cite{Schroeder2019} of the third author, an error analysis for $\HDIV$-DG methods can be found. However, note that the thesis uses the discrete Stokes projection (and not the discrete Helmholtz projection) for the error splitting. For classical DG methods, on the other hand, error analysis can already be found, for example, in the monographs \cite{Riviere08,PietroErn12}. In this sense, we do not think that a new DG error analysis would bring any new insights, but will qualitatively look similar to the $\HM{1}{}$ estimates provided in Section~\ref{sec:ErrorAnalysisH1}, with the difference that the involved constants would be quantitatively different. Instead, in the present work the issue of pressure-robustness in DG methods is described and demonstrated in this section. Again, one has to investigate the consistency errors of appropriately defined discrete Helmholtz--Hodge projectors for $\HDIV$- and $\LP{2}{}$-conforming DG methods in the $\LP{2}{}$ norm. In fact, their behaviour is exactly the same as in the context of $\HH^1$-conforming methods, analysed in Theorems~\ref{thm:pr} and \ref{thm:classical}. \subsection{DG formulation} \label{sec:DG-setting} Beginning with the standard setting in DG methods \cite{Riviere08,PietroErn12}, let $\T$ be a shape-regular FE partition (for brevity, we restrict ourselves to simplicial meshes in this work) of $\Omega$ without hanging nodes and mesh size $h=\max_{K\in\T} h_K$, where $h_K$ denotes the diameter of the particular element $K\in\T$. The skeleton $\F$ denotes the set of all facets of $\T$, $\FK=\set{F\in\F\colon F\subset\partial K}$ and $h_F$ represents the diameter of each facet $F\in\F$. Moreover, $\F=\Fi\cup\Fb$ where $\Fi$ is the subset of interior facets and $\Fb$ collects all Dirichlet boundary facets $F\subset\partial\Omega$. Facets lying on a periodic surface of $\partial\Omega$ are treated as interior facets. To any $F\in\F$ we assign a unit normal vector ${ \boldsymbol{n} }_F$ where, for $F\in\Fb$, this is the outer unit normal vector ${ \boldsymbol{n} }$. If $F\in\Fi$, there are two adjacent elements $K^+$ and $K^-$ sharing the facet $F=\overline{\partial K^+}\cap\overline{\partial K^-}$ and ${ \boldsymbol{n} }_F$ points in an arbitrary but fixed direction. Let $\phi$ be any piecewise smooth (scalar-, vector- or matrix-valued) function with traces from within the interior of $K^\pm$ denoted by $\phi^\pm$, respectively. Then, we define the jump $\jmp{\cdot}_F$ and average $\avg{\cdot}_F$ operator across interior facets $F\in\Fi$ by \begin{equation}\label{eq:DefInteriorJumps} \jmp{\phi}_F= \phi^+-\phi^- \quad \text{and}\quad \avg{\phi}_F=\frac{1}{2}\rb{\phi^+ + \phi^-}. \end{equation} For boundary facets $F\in\Fb$ we set $\jmp{\phi}_F=\avg{\phi}_F=\phi$. These operators act componentwise for vector- and matrix-valued functions. Frequently, the subscript indicating the facet is omitted. ~\\ Let $\VV_h/{ Q }_h$ be the considered discretely inf-sup stable velocity/pressure (discontinuous) FE pair. In order to approximate \eqref{eq:TINS}, the following generic semi-discrete DG method is considered: \begin{subequations} \label{eq:DG-FEM} \begin{empheq}[left=\empheqlbrace]{align} \text{Find }\rb{{ \boldsymbol{u} }_h,p_h}&\colon\rsb{0,{ T }}\to\VV_h\times{ Q }_h \text{ with }{ \boldsymbol{u} }_h\rb{0}={ \boldsymbol{u} }_{0h} \text{ s.t., }\forall\,\rb{{ \boldsymbol{v} }_h,q_h}\in\VV_h\times{ Q }_h,\\ \rb{\partial_t{ \boldsymbol{u} }_h,{ \boldsymbol{v} }_h} &+\nu a_h\rb{{ \boldsymbol{u} }_h,{ \boldsymbol{v} }_h} + c_h\rb{{ \boldsymbol{u} }_h;{ \boldsymbol{u} }_h,{ \boldsymbol{v} }_h} + b_h\rb{{ \boldsymbol{v} }_h,p_h} + b_h\rb{{ \boldsymbol{u} }_h,q_h} \\ &= \rb{{ \boldsymbol{f} },{ \boldsymbol{v} }_h} + \nu a_h^\partial\rb{{ \boldsymbol{g}_\Drm };{ \boldsymbol{v} }_h} + c_h^\partial\rb{{ \boldsymbol{g}_\Drm };{ \boldsymbol{u} }_h,{ \boldsymbol{v} }_h} + b_h^\partial\rb{{ \boldsymbol{g}_\Drm },q_h}. \end{empheq} \end{subequations} Here, ${ \boldsymbol{u} }_{0h}$ denotes a suitable approximation of the initial velocity ${ \boldsymbol{u} }_0$. In the following, based on \cite{Riviere08,PietroErn12}, we introduce the various terms which appear in \eqref{eq:DG-FEM}. Note that only the particular choice of the discrete velocity space $\VV_h$ will distinguish the pressure-robust from the non-pressure-robust method in the end. ~\\ Denote the broken gradient by $\nabla_h$. For the discretisation of the diffusion term, we choose the symmetric interior penalty method with a sufficiently large penalisation parameter $\sigma >0$: \begin{subequations} \begin{align} a_h\rb{{ \boldsymbol{u} }_h,{ \boldsymbol{v} }_h} &= \int_\Omega \nabla_h { \boldsymbol{u} }_h \Fip \nabla_h { \boldsymbol{v} }_h { \,\drm\xx } +\sum_{F\in\F} \frac{\sigma}{h_F} \int_F \jmp{{ \boldsymbol{u} }_h} \ip \jmp{{ \boldsymbol{v} }_h} {\,\drm\boldsymbol{s}} \\ &\quad -\sum_{F\in\F} \int_F \avg{\nabla_h { \boldsymbol{u} }_h} { \boldsymbol{n} }_F \ip \jmp{{ \boldsymbol{v} }_h} {\,\drm\boldsymbol{s}} -\sum_{F\in\F} \int_F \jmp{{ \boldsymbol{u} }_h} \ip \avg{\nabla_h { \boldsymbol{v} }_h} { \boldsymbol{n} }_F {\,\drm\boldsymbol{s}} \\ a_h^\partial\rb{{ \boldsymbol{g}_\Drm };{ \boldsymbol{v} }_h} &= \sum_{F\in\Fb} \frac{\sigma}{h_F} \int_F { \boldsymbol{g}_\Drm } \ip { \boldsymbol{v} }_h {\,\drm\boldsymbol{s}} -\sum_{F\in\Fb} \int_F { \boldsymbol{g}_\Drm } \ip \rb{\nabla_h{ \boldsymbol{v} }_h} { \boldsymbol{n} }_F {\,\drm\boldsymbol{s}} . \end{align} \end{subequations} Using the broken divergence $\DIVh$, the pressure-velocity coupling is realised by \begin{subequations} \begin{align} b_h\rb{{ \boldsymbol{u} }_h,q_h} &= -\int_\Omega q_h\rb{\DIVh { \boldsymbol{u} }_h} { \,\drm\xx } +\sum_{F\in\F}\int_F \rb{\jmp{{ \boldsymbol{u} }_h}\ip{ \boldsymbol{n} }_F}\avg{q_h} {\,\drm\boldsymbol{s}}, \\ b_h^\partial\rb{{ \boldsymbol{g}_\Drm };q_h} &= \sum_{F\in\Fb}\int_F \rb{{ \boldsymbol{g}_\Drm }\ip{ \boldsymbol{n} }}q_h {\,\drm\boldsymbol{s}}. \end{align} \end{subequations} For the nonlinear inertia term, we decide to use the following skew-symmetrised (upwind) discretisation in convection form: \begin{subequations} \begin{align} c_h\rb{{ \boldsymbol{w} }_h;{ \boldsymbol{u} }_h,{ \boldsymbol{v} }_h} &= \int_\Omega \rb{{ \boldsymbol{w} }_h\ip\nabla_h}{ \boldsymbol{u} }_h\ip{ \boldsymbol{v} }_h { \,\drm\xx } + \frac{1}{2}\int_\Omega \rb{\DIVh{ \boldsymbol{w} }_h}{ \boldsymbol{u} }_h\ip{ \boldsymbol{v} }_h { \,\drm\xx } \\ &\quad - \sum_{F\in\Fi} \int_F \rb{\avg{{ \boldsymbol{w} }_h}\ip{ \boldsymbol{n} }_F} \jmp{{ \boldsymbol{u} }_h}\ip\avg{{ \boldsymbol{v} }_h} {\,\drm\boldsymbol{s}} - \frac{1}{2}\sum_{F\in\F} \int_F \rb{\jmp{{ \boldsymbol{w} }_h}\ip{ \boldsymbol{n} }_F} \avg{{ \boldsymbol{u} }_h\ip{ \boldsymbol{v} }_h} {\,\drm\boldsymbol{s}} \\ &\quad +\sum_{F\in\Fi} \int_F \frac{\theta}{2} \abs{\avg{{ \boldsymbol{w} }_h}\ip{ \boldsymbol{n} }_F}\jmp{{ \boldsymbol{u} }_h}\ip\jmp{{ \boldsymbol{v} }_h} {\,\drm\boldsymbol{s}}\\ c_h^\partial\rb{{ \boldsymbol{g}_\Drm };{ \boldsymbol{u} }_h,{ \boldsymbol{v} }_h} &= -\frac{1}{2}\sum_{F\in\Fb} \int_F \rb{{ \boldsymbol{g}_\Drm }\ip{ \boldsymbol{n} }} \rb{{ \boldsymbol{u} }_h\ip{ \boldsymbol{v} }_h} {\,\drm\boldsymbol{s}}. \end{align} \end{subequations} Here, the parameter $\theta\in\set{0,1}$ decides whether the considered method term uses an upwind stabilisation ($\theta=1$) for the convection term or not ($\theta=0$). ~\\ Concerning the particular choice of FE spaces, let $\Pk{k}{\rb{K}}$ denote the local space of all polynomials on $K$ with degree less or equal to $k$. Then, given $k\geqslant 2$, the pressure space for both the $\HDIV$- and the $\LP{2}{}$-DG method coincides: \begin{equation} { Q }_h= \set{q_h\in\Lpz{2}{{ \rb{\Omega} }}\colon \restr{q_h}{K}\in\Pk{k-1}{\rb{K}},~\forall\, K\in\T}, \end{equation} i.e., it holds $k_p=k-1$. While the discrete pressure spaces for the $\HDIV$- and $\LP{2}{}$ conforming DG methods are the same, the velocity spaces, however, differ. Recalling \begin{equation*} \Hdiv = \set{{ \boldsymbol{v} }\in\LP{2}{{ \rb{\Omega} }}\colon \DIV{ \boldsymbol{v} }\in\Lp{2}{{ \rb{\Omega} }}}, \end{equation*} the FE velocity spaces are defined as follows: \begin{subequations} \begin{align} \text{$\HDIV$-DG}\colon \qquad \VV_h &= \set{{ \boldsymbol{v} }_h\in\Hdiv\colon\restr{{ \boldsymbol{v} }_h}{K}\in \PPk{k}{\rb{K}},~\forall\, K\in\T;~\restr{\rb{{ \boldsymbol{v} }_h-{ \boldsymbol{g}_\Drm }}\ip{ \boldsymbol{n} }}{\partial\Omega}=0} \label{eq:VelSpaceHdiv},\\ \text{$\LP{2}{}$-DG}\colon \qquad \VV_h &= \set{{ \boldsymbol{v} }_h\in\LP{2}{{ \rb{\Omega} }}\colon\restr{{ \boldsymbol{v} }_h}{K}\in \PPk{k}{\rb{K}},~\forall\, K\in\T}. \label{eq:VelSpaceL2} \end{align} \end{subequations} Note that the $\HDIV$ space is thus based on the Brezzi--Douglas--Marini element \cite{BoffiEtAl13} and the resulting divergence-free DG method is strongly related to \cite{CockburnEtAl07}. Finite element error analysis for the $\LP{2}{}$-DG method can be found, for example, in \cite{Riviere08,PietroErn12}. For the $\HDIV$-DG method, we refer to \cite{SchroederEtAl18}. In the DG setting, discretely divergence-free functions are defined using the pressure-velocity coupling $b_h$ by \begin{align*} \VV_h^{ \mathrm{div} } = \set{{ \boldsymbol{v} }_h\in\VV_h\colon b_h\rb{{ \boldsymbol{v} }_h,q_h}=0,~\forall\,q_h\in{ Q }_h}, \end{align*} where we note that for the $\HDIV$ method, ${ \boldsymbol{v} }_h\in\VV_h^{ \mathrm{div} }$ follows $\DIV{ \boldsymbol{v} }_h=0$ pointwise. \begin{remark} Deriving an analogous statement to Lemma \ref{lem:conv:nonlinear:term} for DG methods is straightforward, but technically demanding. The necessary compactness arguments for DG methods are described in \cite{PietroErn12}. \end{remark} All computations in this work have been done with the high-order finite element library \texttt{NGSolve} \cite{Schoeberl14}. \subsection{Discrete DG Helmholtz--Hodge projectors} Every discretely inf-sup stable numerical method for the incompressible (Navier--)Stokes equations is intrinsically connected to a particular discrete Helmholtz--Hodge projector. The aim of this subsection is to investigate the properties of the discrete DG Helmholtz--Hodge projectors of the $\HDIV$- and $\LP{2}{}$-DG methods. An analogous discussion for the discrete $\HM{1}{}$ projectors has been done in Subsection \ref{sec:DiscreteH1Projectors}. ~\\ The general definition of the discrete Helmholtz--Hodge projector ${ \mathbb{P} }_h$ of a function ${ \boldsymbol{g} } \in\LP{2}{}$ is given by \begin{equation} \label{eq:DiscDGHelm} { \mathbb{P} }_h\colon\LP{2}{{ \rb{\Omega} }} \to \VV_h^{ \mathrm{div} }, \quad { \mathbb{P} }_h({ \boldsymbol{g} }) = \argmin_{{ \boldsymbol{v} }_h\in\VV_h^{ \mathrm{div} }} \norm{{ \boldsymbol{g} }-{ \boldsymbol{v} }_h}_\LP{2}{{ \rb{\Omega} }}. \end{equation} A suitable finite element method for this problem uses the already known pressure-velocity coupling form $b_h$ and additionally, a mass bilinear form defined by $m_h\rb{{ \boldsymbol{u} }_h,{ \boldsymbol{v} }_h}=\int_\Omega { \boldsymbol{u} }_h\ip{ \boldsymbol{v} }_h { \,\drm\xx }$. The discrete weak form reads as follows: \begin{subequations} \label{eq:DiscreteHelmholtzLeray} \begin{empheq}[left=\empheqlbrace]{align} &\text{Find }\rb{\HLh{{ \boldsymbol{g} }},\phi_h}\in\VV_h\times{ Q }_h \text{ s.t., }\forall\,\rb{{ \boldsymbol{v} }_h,q_h}\in\VV_h\times{ Q }_h,\\ &m_h\rb{\HLh{{ \boldsymbol{g} }},{ \boldsymbol{v} }_h} + b_h\rb{{ \boldsymbol{v} }_h,\phi_h} + b_h\rb{\HLh{{ \boldsymbol{g} }},q_h} = \rb{{ \boldsymbol{g} },{ \boldsymbol{v} }_h}. \end{empheq} \end{subequations} Now, choosing the discrete `velocity' space according to the $\HDIV$-DG choice \eqref{eq:VelSpaceHdiv} leads to an exactly divergence-free discrete Helmholtz--Hodge projector called $\HLhd{{ \boldsymbol{g} }}$. On the other hand, choosing $\VV_h$ according to the $\LP{2}{}$-DG choice \eqref{eq:VelSpaceL2}, the resulting discrete Helmholtz--Hodge projector is denoted by $\HLhdc{{ \boldsymbol{g} }}$. Note that while $\DIV\HLhd{{ \boldsymbol{g} }}=0$, the $\LP{2}{}$-DG projector $\HLhdc{{ \boldsymbol{g} }}$ is not divergence-free. ~\\ Let us now quantify the difference between these two discrete DG Helmholtz projectors more carefully. For the divergence-free $\HDIV$-DG method, the analogue of Lemma \ref{lem:DiscHelmDivFreeH1} is the following. \begin{lemma} For the pressure-robust (divergence-free) $\HDIV$-DG method, for all gradient fields $\nabla \psi$ with $\psi \in H^1{ \rb{\Omega} }$ it holds \begin{equation*} { \mathbb{P} }_h(\nabla \psi) = { \boldsymbol{0} }. \end{equation*} \end{lemma} \begin{proof} In this case, due to ${ \boldsymbol{v} }_h \in \VV_h^{ \mathrm{div} }$ it follows $\DIV{ \boldsymbol{v} }_h=0$ pointwise. Thus, for $\nabla \psi \in \LP{2}{{ \rb{\Omega} }}$ it holds for all ${ \boldsymbol{v} }_h \in \VV_h^{ \mathrm{div} }$, \begin{equation*} (\nabla \psi, { \boldsymbol{v} }_h) = -(\psi, \DIV { \boldsymbol{v} }_h) = 0. \end{equation*} \end{proof} For the non-pressure-robust $\LP{2}{}$-DG method, the analogue of Lemma \ref{lem:DiscHelmLerayNonDivFreeH1} is again less favourable. \begin{lemma} \label{lem:DiscHelmLerayNonDivFreeDG}% For the non-pressure-robust $\LP{2}{}$-DG method, for all gradient fields $\nabla \psi$ with $\psi \in \Hm{k_p+1}{{ \rb{\Omega} }}$, it holds \begin{equation} \norm{{ \mathbb{P} }_h(\nabla \psi)}_\LP{2}{{ \rb{\Omega} }} \leqslant C h^{k_p} |\psi|_\Hm{k_p+1}{{ \rb{\Omega} }}. \end{equation} \end{lemma} \begin{proof} For all $q \in H^1{ \rb{\Omega} }$ it holds for all ${ \boldsymbol{v} }_h\in\VV_h^{ \mathrm{div} }$ \begin{equation*} \rb{\nabla q,{ \boldsymbol{v} }_h} = -\int_\Omega q\rb{\DIVh { \boldsymbol{v} }_h} { \,\drm\xx } +\sum_{F\in\F}\int_F q \rb{\jmp{{ \boldsymbol{v} }_h}\ip{ \boldsymbol{n} }_F} {\,\drm\boldsymbol{s}}\\ = b_h\rb{{ \boldsymbol{v} }_h,q}. \end{equation*} For $L_h \psi \in H^1{ \rb{\Omega} } \cap Q_h$ it holds thus $(\nabla (L_h \psi), { \boldsymbol{v} }_h) = 0$ due to \eqref{eq:DG-FEM}, leading to \begin{equation*} (\nabla \psi, { \boldsymbol{v} }_h) = (\nabla (\psi - L_h \psi), { \boldsymbol{v} }_h) \leqslant \norm{\nabla (\psi - L_h \psi)}_{\LP{2}{}} \norm{{ \boldsymbol{v} }_h}_{\LP{2}{}} \end{equation*} and the result is proved like in the $\HH^1$-conforming case in Lemma \ref{lem:DiscHelmLerayNonDivFreeH1}. \end{proof} \section{Numerical experiments with known exact solution} \label{sec:ExperimentsKnownSol} In this section, we mainly use the previously described $\HDIV$- and $\LP{2}{}$-DG methods to investigate incompressible flow problems at high Reynolds number where the exact solution is known to be a (generalised) Beltrami flow. The accuracy of the corresponding results is measured in the $\LP{2}{}$ norm exclusively because the errors in $\HM{1}{}$ do not provide any more insight. More precisely, this means that the errors in the $\HM{1}{}$ norm qualitatively show exactly the same behaviour as the ones measured in the $\LP{2}{}$ norm. Furthermore, for the 2D lattice flow problem, a brief comparison of pressure-robust and non-pressure-robust $\HM{1}{}$-conforming methods, analogous to Section~\ref{sec:GreshoH1} can be found as well. \subsection{2D planar lattice flow} \label{sec:2DLatticeFlow} Let us now compare the performance of the pressure-robust $\HDIV$- and non-pressure-robust $\LP{2}{}$-DG methods in terms of accuracy and efficiency in a two-dimensional setting. In order to do so, we fix $\nu=\num{e-5}$ and solve a problem with ${ \boldsymbol{f} }\equiv{ \boldsymbol{0} }$, where the exact solution is known and given by \begin{equation} \label{eq:LatticeExact} { \boldsymbol{u} }_0\rb{{ \boldsymbol{x} }}=\begin{bmatrix} \sin\rb{2\pi x_1}\sin\rb{2\pi x_2}\\ \cos\rb{2\pi x_1}\cos\rb{2\pi x_2} \end{bmatrix},\quad { \boldsymbol{u} }\rb{t,{ \boldsymbol{x} }} = { \boldsymbol{u} }_0\rb{{ \boldsymbol{x} }}e^{-8\pi^2 \nu t }. \end{equation} We consider the domain $\Omega=\rb{0,1}^2$ with periodic boundary conditions on all edges of $\partial\Omega$ and compute until ${ T }=10$. The exact solution \eqref{eq:LatticeExact} is a classical example of a generalised Beltrami flow as the convective term $\rb{{ \boldsymbol{u} }\ip\nabla}{ \boldsymbol{u} }$ balances the pressure gradient. For the simulation, only the initial velocity is prescribed according to ${ \boldsymbol{u} }_0$ and the evolution of the flow is observed. Varying orders $k\in\set{2,3,4,6}$ of the FE spaces with ${k_{{ \boldsymbol{u} }}}=k$ and $k_p=k-1$ are used and the resolution of the particular method is controlled via the mesh. We use unstructured triangular meshes for this 2D example and the SIP penalty parameter $\sigma=\rb{k+1}\rb{k+2}$ is chosen, which has the correct quadratic $k$-dependency; see, for example, \cite[Section 3.1]{Hillewaert13}. ~\\ The time-stepping is based on the second-order multistep implicit-explicit (IMEX) scheme SBDF2 \cite{AscherEtAl95} where the Stokes part of the problem is discretised implicitly with a BDF2 method and the convection part relies on an explicit treatment with second-order accurate extrapolation in time. The system matrix of the Stokes part is called $M^\ast$ and note that in such an IMEX scheme, only linear system associated with $M^\ast$ have to be solved in every time step. However, this particular time-stepping scheme is only a choice here and not crucial for the subsequent results. For the planar-lattice flow we use a constant time step of $\Delta t=\num{e-4}$. ~\\ We will compare the following two different quantities: total (velocity plus pressure) number of degrees of freedom (DOFs) and number of non-zero entries (NZEs) of $M^\ast$. While the DOFs indicate how rich the approximation space is, the NZEs are a more suitable measure of how efficient a particular discretisation is. Indeed, the NZEs of $M^\ast$ indicate how expensive solving linear systems is; usually, this is the most time consuming part of a flow solver (especially in 3D). In Figure \ref{fig:Lattice_errors}, the corresponding $\Lp{2}{\rb{0,{ T };\LP{2}{{ \rb{\Omega} }}}}$ errors can be seen for the two different methods introduced in Section \ref{sec:dGFEM}. ~\\ \begin{figure}[h] \centering \includegraphics[width=0.35\textwidth]{Lattice/tikz/Lattice-legend} \\ \includegraphics[width=0.48\textwidth]{Lattice/tikz/Lattice-L2L2-norm-error-DOFs} \hspace{5pt} \includegraphics[width=0.48\textwidth]{Lattice/tikz/Lattice-L2L2-norm-error-NZEs} \caption{$\Lp{2}{\rb{0,{ T };\LP{2}{}}}$, ${ T }=10$, errors for the 2D lattice flow ($\nu=\num{e-5}$). Comparison of pressure-robust $\HDIV$- and non-pressure-robust $\LP{2}{}$-DG methods with $\Delta t=\num{e-4}$, both using upwinding ($\theta=1$). The abscissae show the total number of DOFs (left) and number of NZEs of $M^\ast$ (right). } \label{fig:Lattice_errors} \end{figure} Firstly, one can observe that whenever a fixed polynomial degree of the FE space is considered, the pressure-robust $\HDIV$-FEM always leads to an at least ten times smaller error, both in terms of DOFs and NZEs. For higher-order and on finer meshes, this offset increases to such an extent that for $k=6$ the $\HDIV$-DG method's solution has an error which is at least \num{e-3} times smaller than the corresponding $\LP{2}{}$-DG's. Even more remarkably, in terms of fixing DOFs, at least on coarse meshes the pressure-robust $k=2$ $\HDIV$-DG method results in a comparable accuracy as the $k=4$ $\LP{2}{}$-DG method while, at the same time, it leads to fewer NZEs. A similar observation holds for $k=3$ $\HDIV$-DG and $k=6$ $\LP{2}{}$-DG. In practice, as higher-order methods usually lead to more NZEs, being able to use a method of order $k$ instead of $2k$, without loosing accuracy, means a considerable improvement with respect to performance. ~\\ In Section \ref{sec:GenBeltramiFlows}, it was argued that the velocity solution ${ \boldsymbol{u} }$ of a generalised Beltrami flow is simultaneously a solution of the Navier--Stokes and the Stokes problem (only the pressures are different). We now want to consider, in a time-dependent setting, instead of the nonlinear Navier--Stokes problem with ${ \boldsymbol{f} }\equiv{ \boldsymbol{0} }$, the corresponding Stokes problem with ${ \boldsymbol{f} }=-\rb{{ \boldsymbol{u} }\ip\nabla}{ \boldsymbol{u} }$, solved with the pressure-robust $\HDIV$-DG method for $k=6$. ~\\ The evolution of $\LP{2}{}$ errors can be seen in Figure \ref{fig:Lattice_Stokes_comparison}, where the left-hand side plot shows the behaviour of the Navier--Stokes solution with upwinding (solid lines) against the corresponding Stokes solution (dashed lines) for different refinement levels $r0,\dots,r3$. The main observations are that the Stokes error is a lower bound for the Navier--Stokes error at all times and that on sufficiently fine meshes, both errors are not too far apart (at least for short times). A second interesting issue is the question of the influence of upwinding on the solution. The right-hand side subfigure Figure \ref{fig:Lattice_Stokes_comparison} shows that upwinding is indeed helpful for this kind of convection dominated problems. More precisely, one can observe that the Navier--Stokes errors without upwinding (dashed lines) are always larger than with upwinding (solid lines). ~\\ \begin{figure}[h] \centering \includegraphics[width=0.48\textwidth]{Lattice/tikz/Lattice-L2-norm-error-Stokes-Hdiv-k6} \hspace{5pt} \includegraphics[width=0.48\textwidth]{Lattice/tikz/Lattice-L2-norm-error-Stokes-Hdiv-NoUpw} \caption{Evolution of $\LP{2}{}$ errors for the 2D lattice flow ($\nu=\num{e-5}$). Comparison of pressure-robust $\HDIV$ solution ($k=6$) with $\Delta t=\num{e-4}$ of the Navier--Stokes problem with upwinding (solid lines) and the Stokes problem (dashed lines) on the left-hand side. The colours indicate different levels of mesh refinement $r$t. Right-hand side: Navier--Stokes solution with upwinding $\theta=1$ (solid), and without upwinding $\theta=0$ (dashed). } \label{fig:Lattice_Stokes_comparison} \end{figure} Lastly, let us consider what happens if $\HM{1}{}$-conforming FEM are used instead of the (much more flexible) DG methods. In order to do so, we repeat the experiment presented in Figure~\ref{fig:Lattice_errors} now for the pressure-robust, divergence-free Scott--Vogelius method SV$_k$ and the non-pressure-robust Taylor--Hood element TH$_k$; cf.\ also the corresponding explanations for the Gresho problem in Section~\ref{sec:GreshoH1}. ~\\ Figure~\ref{fig:Lattice_errors_H1} shows the results of this test scenario. The left-hand side plot shows the $\Lp{2}{\rb{0,{ T };\LP{2}{}}}$ errors for ${ T }=10$ for both SV and TH simulations for different polynomial orders $k\in\set{4,8,12}$. One can observe that the Taylor--Hood method is not stable for this kind of flow problem as the solutions become unstable and long-time predictions seem to be impossible with a non-pressure-robust method. The Scott--Vogelius method, on the other hand, shows the expected convergence behaviour also for longer time integration. In order to also show that our results are consistent for short-time simulations, the right-hand side plot shows the $\Lp{2}{\rb{0,{ T };\LP{2}{}}}$ errors for ${ T }=2$. Here, one can see that the Taylor--Hood method is still stable and gives convergent results under mesh-refinement. Interestingly, one can see that the TH$_8$ method yields comparable results as the SV$_4$ method for the same amount of DOFs. This halving of approximation order has already been shown previously in the context of DG methods. In this sense, we demonstrated that the question whether $\HM{1}{}$-conforming or DG methods are used is not essential but the important distinction has to be made with respect to whether a method is pressure-robust or not. Consequently, we will not show any more numerical results with $\HM{1}{}$-FEM but only use DG methods henceforth. ~\\ \begin{figure}[h] \centering \includegraphics[width=0.35\textwidth]{Lattice/tikz/Lattice-legend-H1.pdf} \\ \includegraphics[width=0.48\textwidth]{Lattice/tikz/Lattice-L2L2-norm-error-DOFs-H1.pdf} \hspace{5pt} \includegraphics[width=0.48\textwidth]{Lattice/tikz/Lattice-L2L2-norm-error-DOFs-H1-T2.pdf} \caption{$\HM{1}{}$-FEM: $\Lp{2}{\rb{0,{ T };\LP{2}{}}}$, errors for the 2D lattice flow ($\nu=\num{e-5}$). Comparison of pressure-robust SV- and non-pressure-robust TH methods with $\Delta t=\num{e-4}$. Long-time simulation with ${ T }=10$ (left) and short-time simulation with ${ T }=2$ (right). } \label{fig:Lattice_errors_H1} \end{figure} \subsection{Classical 3D Ethier--Steinman} \label{sec:3DEthierSteinman} Now, we want to repeat our investigation from Section \ref{sec:2DLatticeFlow} with a three-dimensional flow problem (${ \boldsymbol{f} }\equiv{ \boldsymbol{0} }$). Thus, consider the exact velocity of the Ethier--Steinman problem \cite{EthierSteinman94}: \begin{equation} \label{eq:3DES-exact} { \boldsymbol{u} }_0\rb{{ \boldsymbol{x} }}= -a\begin{bmatrix} e^{ax_1}\sin\rb{ax_2 + bx_3} + e^{ax_3}\cos\rb{ax_1 + bx_2} \\ e^{ax_2}\sin\rb{ax_3 + bx_1} + e^{ax_1}\cos\rb{ax_2 + bx_3} \\ e^{ax_3}\sin\rb{ax_1 + bx_2} + e^{ax_2}\cos\rb{ax_3 + bx_1} \end{bmatrix},\quad { \boldsymbol{u} }\rb{t,{ \boldsymbol{x} }} = { \boldsymbol{u} }_0\rb{{ \boldsymbol{x} }}e^{-\nu d^2 t }. \end{equation} Here, the parameters $a=\nf{\pi}{4}$, $b=\nf{\pi}{2}$ and $\nu=0.002$ are used and we are dealing with a Beltrami flow. As domain, the cube $\Omega=\rb{-1,1}^3$ is chosen where the time-dependent Dirichlet boundary condition ${ \boldsymbol{g}_\Drm }$ according to the exact solution is imposed. Again, the initial velocity ${ \boldsymbol{u} }_0$ is prescribed at $t=0$ and the evolution of the flow is observed. We stop the simulations at ${ T }=1$ and the time-stepping is again based on the SBDF2 method, again using $\Delta t=\num{e-4}$. Unstructured tetrahedral meshes are used in the 3D example and the SIP penalty parameter $\sigma=8 k^2$ is chosen. The resulting $\Lp{2}{\rb{0,{ T };\LP{2}{{ \rb{\Omega} }}}}$ errors can be seen in Figure \ref{fig:ES_errors}. ~\\ \begin{figure}[h] \centering \includegraphics[width=0.35\textwidth]{Ethier-Steinman/tikz/ES-legend.pdf} \\ \includegraphics[width=0.48\textwidth]{Ethier-Steinman/tikz/ES-L2L2-norm-error-DOFs-cube.pdf} \hspace{5pt} \includegraphics[width=0.48\textwidth]{Ethier-Steinman/tikz/ES-L2L2-norm-error-NZEs-cube.pdf} \caption{Errors for the classical 3D Ethier--Steinman problem ($\nu=0.002$). Comparison of pressure-robust $\HDIV$- and non-pressure-robust $\LP{2}{}$-DG methods with $\Delta t=\num{e-4}$, both using upwinding ($\theta=1$). The abscissae show the total number of DOFs (left) and number of NZEs of $M^\ast$ (right). } \label{fig:ES_errors} \end{figure} Again, for each fixed $k$, the divergence-free and pressure-robust $\HDIV$-DG method always yields the smallest errors. In terms of efficiency, the plot of the number of NZEs again shows that by using a pressure-robust method, a significant amount of computational effort can be saved. However, for sufficiently fine meshes, higher-order will always be superior because of the smoothness of the problem. The next section shall pick up at exactly this point. \subsection{3D Ethier--Steinman with inaccurate Dirichlet BCs} \label{sec:3DEthierSteinmanBC} In applications, it is very rare that one has an exact geometry description of the underlying domain as, for example, curved boundaries make it necessary to approximate also the geometry to a certain accuracy. Therefore, the imposition of the \emph{correct} Dirichlet BCs is usually made on the \emph{approximated} boundary. Unavoidably, this a source for errors and in this section we want to mimic such a situation in the following equivalent way. Instead of prescribing the correct Dirichlet BCs on the approximated boundary, we will impose inaccurate BCs on the correct boundary. ~\\ \begin{figure}[h] \centering \includegraphics[width=0.39\textwidth]{Ethier-Steinman/tikz/ES-legend.pdf} \\ \includegraphics[width=0.48\textwidth]{Ethier-Steinman/tikz/ES-L2L2-norm-error-DOFs-BC.pdf} \hspace{5pt} \includegraphics[width=0.48\textwidth]{Ethier-Steinman/tikz/ES-L2L2-norm-error-NZEs-BC.pdf} \caption{Errors for the 3D Ethier--Steinman problem ($\nu=0.002$) with inaccurate BCs. Comparison of pressure-robust $\HDIV$- and non-pressure-robust $\LP{2}{}$-DG methods with $\Delta t=\num{e-4}$, both using upwinding ($\theta=1$). The abscissae show the total number of DOFs (left) and number of NZEs of $M^\ast$ (right). } \label{fig:ES_errors_BC} \end{figure} Let us revisit the 3D Ethier--Steinman example from Section \ref{sec:3DEthierSteinman}. The exact solution is also given by \eqref{eq:3DES-exact}, exactly the same parameters are used and again, time-dependent Dirichlet boundary conditions are imposed. However, as hinted at above, instead of choosing ${ \boldsymbol{g}_\Drm }$ according to the exact solution ${ \boldsymbol{u} }$, we will use a piecewise quadratic approximation of it instead. Figure \ref{fig:ES_errors_BC} shows the resulting $\Lp{2}{\rb{0,{ T };\LP{2}{{ \rb{\Omega} }}}}$ errors. ~\\ First of all, note that the pressure-robust method is again always more accurate for a fixed number of DOFs and a fixed number of NZEs. In contrast to Section \ref{sec:3DEthierSteinman}, the asymptotical behaviour for higher $k$ and finer meshes is now, by construction, dominated by the accuracy of ${ \boldsymbol{g}_\Drm }$. Thus, one can see that all methods roughly lead to the same result when the resolution is high enough. More interestingly though, on coarse meshes, the pressure-robust method is always significantly more accurate. \section{Material derivative of a K\'arm\'an vortex street} \label{sec:KarmanBeltrami} Above it was shown that for generalised Beltrami flows, and flows which are Galilean-invariant to a generalised Beltrami flow, pressure-robust mixed methods can be much more accurate than classical mixed methods. As a main reason, strong and complicated gradient fields in the Navier--Stokes momentum balance have been identified, which explain the superior accuracy of pressure-robust methods. However, a natural question is whether pressure-robust mixed methods are also superior for `real world flows'. Therefore, it is interesting to investigate whether strong gradient fields will appear also in such a situation. Indeed, Subsection \ref{sec:EulerFlows} suggests that the material derivative of transient high Reynolds number flows is approximately a non-trivial gradient field. In the following, we will confirm this conjecture for a periodic K\'arm\'an vortex street. ~\\ As an example of a practically relevant flow, let us consider the flow around an obstacle in a 2D channel of dimensions $\rb{L,H}=(3,1.01)$. Here, the obstacle is chosen as a circle with radius $r=0.1$ whose centre is placed at ${ \boldsymbol{x} }=\rb{0.4,0.5}^\dag$. In Figure~\ref{fig:Karman_VelMag}, such a flow can be seen at a time instance where the characteristic vortex shedding of a periodic K\'arm\'an vortex street has formed. Here, all flow computations are performed with the divergence-free and pressure-robust $\HDIV$-DG with order $k$. The Dirichlet inflow BC on the left part of the boundary is given by the constant free flow ${ \boldsymbol{u} }\rb{t,0,x_2}=\rb{1,0}^\dag$, which, together with $\nu=\num{e-3}$ leads to a Reynolds number $\Rey=\overline{u}r/\nu=1\times0.1\times 1000=100$. No-slip is prescribed on the boundary of the circle, whereas top, bottom and right part of the boundary represent outflow boundaries (do-nothing). Computations are performed up to ${ T }=10$ and all subsequent snapshots and norms are taken at exactly this instance in time. \\ \begin{figure}[h] \centering \includegraphics[width=0.475\textwidth]{Karman/pdf/Karman_k8_VelMag.pdf} \hspace{5pt} \includegraphics[width=0.475\textwidth]{Karman/pdf/Karman_k8_Vort.pdf} \caption{Periodic K\'arm\'an vortex shedding in the wake of a square. Visualisation of the underlying geometry, velocity magnitude $\abs{{ \boldsymbol{u} }_h}_2$ and computational mesh (left), and vorticity $\omega_h$ (right). The computations are done with eight-order elements ($k=8$) and upwinding ($\theta=1$), unless stated otherwise.} \label{fig:Karman_VelMag} \end{figure} Being in this situation and having such a flow at hand, two main questions arise: \begin{enumerate} \item In which part of the domain is the Helmholtz--Hodge projector of the material derivative small, as predicted by Subsection \ref{sec:EulerFlows}? \item Where does a pressure-robust method locally outperform a non-pressure robust one? \end{enumerate} These questions will be answered in the following two subsections. \subsection{Investigation of the material derivative} The most obvious approach for answering the first question is to begin with inspecting the (discrete) material derivative ${ \boldsymbol{f} }_h^t=\partial_t{ \boldsymbol{u} }_h+\rb{{ \boldsymbol{u} }_h\ip\nabla_h}{ \boldsymbol{u} }_h$ in a suitable norm. Note that this investigation is based on the fact that with $k=8$ and this Reynolds numbers, all essential flows features are resolved. In this way, statements about ${ \boldsymbol{u} }_h$ should also holds for ${ \boldsymbol{u} }$. We have chosen to investigate it in the $\LP{3/2}{}$ norm, since even for 3D flows at least the nonlinear convection term $\rb{{ \boldsymbol{u} }_h\ip\nabla_h}{ \boldsymbol{u} }_h$ is (for almost all times in the sense of Bochner spaces) in $\LP{3/2}{}$. Qualitatively, however, the same insights can be obtained by, for example, considering the $\LP{2}{}$ norm. ~\\ \begin{figure}[h] \centering \includegraphics[width=0.55\textwidth]{Karman/pdf/Karman_k8_ffh.pdf} \caption{Discrete material derivative $\abs{{ \boldsymbol{f} }_h^t=\partial_t{ \boldsymbol{u} }_h+\rb{{ \boldsymbol{u} }_h\ip\nabla_h}{ \boldsymbol{u} }_h}_\nf{3}{2}^\nf{3}{2}$. Note that the colour bar is chosen in such a way that all values above 50 are displayed red. } \label{fig:Karman_ffh} \end{figure} Figure~\ref{fig:Karman_ffh} shows such a qualitative approach, where we observe that in a large part of the domain the material derivative (approximately) vanishes. There, the material derivative is indeed a (trivial) gradient field. However, pressure-robust methods will only be superior to non-pressure-robust methods in parts of the domain, where the material derivative is a non-trivial and strong gradient field. However, there are also some regions in the flow where the material derivative itself is large (basically the direct vicinity of the obstacle and parts of the wake). ~\\ \begin{figure}[h] \centering \includegraphics[width=0.55\textwidth]{Karman/pdf/Karman_k8_GradPhih.pdf} \caption{Gradient part $\abs{\nabla\phi_h^t}_\nf{3}{2}^\nf{3}{2}$ of discrete Helmholtz--Hodge decomposition of ${ \boldsymbol{f} }_h^t$ with exactly divergence-free FEM. The colour bar scaling is chosen identically to that of Figure \ref{fig:Karman_ffh}.} \label{fig:Karman_GradPhih} \end{figure} Thus, we will investigate, where ${ \boldsymbol{f} }_h^t=\partial_t{ \boldsymbol{u} }_h+\rb{{ \boldsymbol{u} }_h\ip\nabla_h}{ \boldsymbol{u} }_h$ is locally a gradient. The gradient contribution of the discrete material derivative ${ \boldsymbol{f} }_h^t$ can be seen in Figure~\ref{fig:Karman_GradPhih} where, for a better comparison, the colour bar scaling is chosen identically to that of Figure~\ref{fig:Karman_ffh}. Note that the Helmholtz decomposition ${ \boldsymbol{f} }_h^t=\HLhd{{ \boldsymbol{f} }_h^t}+\nabla\phi_h^t$ is also based on the divergence-free $\HDIV$-DG method. One can observe that especially in the direct vicinity of the obstacle, there is indeed a significant gradient contribution in the material derivative ${ \boldsymbol{f} }_h^t$. ~\\ \begin{figure}[h] \centering \includegraphics[width=0.55\textwidth]{Karman/pdf/Karman_k8_Phdiv.pdf} \caption{Divergence-free part $\abs{\HLhd{{ \boldsymbol{f} }_h^t}}_\nf{3}{2}^\nf{3}{2}$ of discrete Helmholtz--Hodge decomposition of ${ \boldsymbol{f} }_h^t$ with exactly divergence-free FEM. The colour bar scaling is chosen identically to that of Figure \ref{fig:Karman_ffh}.} \label{fig:Karman_Phdiv} \end{figure} We have seen that a large part of the material derivative consists of a gradient part. Consequently, the divergence-free part of ${ \boldsymbol{f} }_h^t$ must be small. Figure~\ref{fig:Karman_Phdiv} shows that this is actually the case for this flow problem. One can observe that only the upstream side of the obstacle shows a non-zero divergence-free part $\HLhd{{ \boldsymbol{f} }_h^t}$. Note that the friction term $-\nu \Delta { \boldsymbol{u} }$ is indeed a divergence-free contribution to the Navier--Stokes material derivative, which can be strong in the vicinity of the no-slip boundary of the domain. \subsection{Pressure-robust vs.\ non-pressure-robust methods} In contrast to considering the flow itself as in the previous subsection, let us now finally focus on the numerical method for approximating the flow. In order to answer the second question, namely where a pressure-robust method outperforms a non-pressure-robust one, we solve a second discrete Helmholtz--Hodge decomposition problem of the form \eqref{eq:DiscreteHelmholtzLeray}, but this time with the $\LP{2}{}$-DG `velocity' space choice \eqref{eq:VelSpaceL2}. Note again that due to using the $\LP{2}{}$-DG method, $\HLhdc{{ \boldsymbol{f} }_h^t}$ is not exactly divergence-free, even though ${ \boldsymbol{f} }_h^t$ has been computed with the divergence-free $\HDIV$-DG method. ~\\ \begin{figure}[h] \centering \includegraphics[width=0.55\textwidth]{Karman/pdf/Karman_k8_AdvPRobust.pdf} \caption{Difference $\abs{\HLhd{{ \boldsymbol{f} }_h^t}-\HLhdc{{ \boldsymbol{f} }_h^t}}_\nf{3}{2}^\nf{3}{2}$ of the two discrete Helmholtz--Hodge projectors of ${ \boldsymbol{f} }_h^t$. High values indicate advantageous regions of the pressure-robust discretisation. Note that the colour scale is chosen logarithmically.} \label{Karman_AdvantagePRobust} \end{figure} Now, in Figure~\ref{Karman_AdvantagePRobust}, the difference of the two discrete Helmholtz--Hodge projectors $\HLhd{{ \boldsymbol{f} }_h^t}-\HLhdc{{ \boldsymbol{f} }_h^t}$ of the discrete material derivative ${ \boldsymbol{f} }_h^t$ highlights the regions in the flow where a pressure-robust method performs better than a non-pressure-robust one. This is due to the fact that the $\LP{2}{}$ Helmholtz--Hodge projector indicates that the corresponding non-divergence-free method would see a wrong force locally. Consistent with the analysis of the flow characteristics above, the pressure-robust method is advantageous in regions where the material derivative is dominated by a large gradient contribution in the sense of the Helmholtz decomposition. This is especially the case in the vicinity of the obstacle, the wake, and interestingly, the outflow. However, note that the difference between the two Helmholtz--Hodge projections seems to be small compared to the total value of the components of the Helmholtz--Hodge decomposition. The reason for this behaviour is that on the given mesh and with $k=8$, even the non-pressure-robust Helmholtz projector is comparably accurate. ~\\ \begin{table}[h] \caption{Convergence behaviour for $\LP{\nf{3}{2}}{}$-norms of the (discrete) material derivative ${ \boldsymbol{f} }_h^t=\partial_t{ \boldsymbol{u} }_h+\rb{{ \boldsymbol{u} }_h\ip\nabla_h}{ \boldsymbol{u} }_h$ and its discrete Helmholtz--Hodge projections for different polynomial orders $k\in\set{2,\dots,8}$.} \label{tab:Norms_kConvergence} \centering \begin{tabular}{lllllllll} \toprule $k$ & 2 & 3 & 4 & 5 & 6 & 7 & 8 \\ \midrule[\heavyrulewidth] $\norm{{ \boldsymbol{f} }_h^t}_\LP{\nf{3}{2}}{}$ & \pgfmathprintnumber[precision=5]{2.87349993e+00} & \pgfmathprintnumber[precision=5]{2.97578705e+00} & \pgfmathprintnumber[precision=5]{2.96509174e+00} & \pgfmathprintnumber[precision=5]{2.96072811e+00} & \pgfmathprintnumber[precision=5]{2.96032325e+00} & \pgfmathprintnumber[precision=5]{2.96001111e+00} & \pgfmathprintnumber[precision=5]{2.95996950e+00} \\ $\norm{\HLhd{{ \boldsymbol{f} }_h^t}}_\LP{\nf{3}{2}}{}$ & \pgfmathprintnumber[precision=5]{7.96556428e-01} & \pgfmathprintnumber[precision=5]{5.48187542e-01} & \pgfmathprintnumber[precision=5]{4.38494468e-01} & \pgfmathprintnumber[precision=5]{4.18748340e-01} & \pgfmathprintnumber[precision=5]{4.13535207e-01} & \pgfmathprintnumber[precision=5]{4.12409309e-01} & \pgfmathprintnumber[precision=5]{4.12135449e-01} \\ $\norm{\HLhdc{{ \boldsymbol{f} }_h^t}}_\LP{\nf{3}{2}}{}$ & \pgfmathprintnumber[precision=5]{1.06804765e+00} & \pgfmathprintnumber[precision=5]{5.75710735e-01} & \pgfmathprintnumber[precision=5]{4.41380799e-01} & \pgfmathprintnumber[precision=5]{4.19200115e-01} & \pgfmathprintnumber[precision=5]{4.13624756e-01} & \pgfmathprintnumber[precision=5]{4.12418656e-01} & \pgfmathprintnumber[precision=5]{4.12139102e-01} \\ $\norm{\sqb{{ \mathbb{P} }_h^{ \mathrm{div} }-{ \mathbb{P} }_h^0}\rb{{ \boldsymbol{f} }_h^t}}_\LP{\nf{3}{2}}{}$ & \pgfmathprintnumber[precision=0,sci]{6.78923884e-01} & \pgfmathprintnumber[precision=0,sci]{1.58786854e-01} & \pgfmathprintnumber[precision=0,sci]{4.10886877e-02} & \pgfmathprintnumber[precision=0,sci]{1.63212054e-02} & \pgfmathprintnumber[precision=0,sci]{5.92165742e-03} & \pgfmathprintnumber[precision=0,sci]{2.10554255e-03} & \pgfmathprintnumber[precision=0,sci]{8.31987666e-04} \\ \bottomrule \end{tabular} \end{table} Thus, finally, let us demonstrate that by using lower-order methods, the difference between the discrete Helmholtz--Hodge projectors of the $\LTWO$- and the $\HDIV$-DG methods increases. Table~\ref{tab:Norms_kConvergence} shows the convergence of the $\LP{\nf{3}{2}}{}$-norm of the material derivative ${ \boldsymbol{f} }_h^t=\partial_t{ \boldsymbol{u} }_h+\rb{{ \boldsymbol{u} }_h\ip\nabla_h}{ \boldsymbol{u} }_h$, the discrete Helmholtz--Hodge projectors $\HLhd{{ \boldsymbol{f} }_h^t}$ and $\HLhdc{{ \boldsymbol{f} }_h^t}$, and their difference $\HLhd{{ \boldsymbol{f} }_h^t}-\HLhdc{{ \boldsymbol{f} }_h^t}$. One can see that, as expected, for $k=8$, both methods detect a comparable amount of divergence-free forces in the discrete convective term. This is a possible explanation why non-pressure-robust methods may work comparably good whenever higher-order methods are considered. For lower-order methods, on the other hand, the difference between the Helmholtz--Hodge projectors increases considerably. ~\\ \begin{figure}[h] \centering \includegraphics[width=0.48\textwidth]{Karman/pdf/Karman_k2_Phdiff.pdf} \hspace{5pt} \includegraphics[width=0.48\textwidth]{Karman/pdf/Karman_k4_Phdiff.pdf} \\ \includegraphics[width=0.48\textwidth]{Karman/pdf/Karman_k6_Phdiff.pdf} \hspace{5pt} \includegraphics[width=0.48\textwidth]{Karman/pdf/Karman_k8_Phdiff.pdf} \\ \caption{Difference of discrete Helmholtz--Hodge projectors $\abs{\HLhd{{ \boldsymbol{f} }_h^t}-\HLhdc{{ \boldsymbol{f} }_h^t}}_\nf{3}{2}^\nf{3}{2}$ of ${ \boldsymbol{f} }_h^t$ for different polynomial orders $k\in\set{2,4,6,8}$ (from top left to bottom right). } \label{fig:Karman_higher_order} \end{figure} Consistent with these observation, Figure~\ref{fig:Karman_higher_order} shows the pointwise plots of the difference between the Helmholtz--Hodge projectors. It is especially interesting that their difference concentrates in the vicinity of the object. This potentially means that pressure-robust methods have a higher accuracy near objects which are located in a flow. \section{Conclusion and outlook} \label{sec:Conclusions} The main intention of this contribution is to illustrate that pressure-robust space discretisations outperform non-pressure-robust space discretisations for incompressible Navier--Stokes flows, especially at high Reynolds numbers. The main reason is that in the incompressible Euler limit for ${ \boldsymbol{f} }={ \boldsymbol{0} }$ the material derivative is a gradient field, which can be handled more appropriately by pressure-robust methods. Indeed, in high Reynolds number flows the pressure gradient is typically strong and non-trivial, like in vortex dominated flows where the linear pressure gradient balances the quadratic centrifugal force. Further, the superior behaviour of pressure-robust methods relies on a more consistent discrete Helmholtz--Hodge projector, which vanishes for arbitrary gradient fields. ~\\ We want to conclude our contribution with some speculations on the relation between high-order and low-order flow solvers. In recent years high-order space discretisation was proposed as an efficient means for the simulation of challenging flow problems, like incompressible Navier--Stokes flows at high Reynolds numbers or real-world applications in computational fluid dynamics \cite{2018JHyDy..30....1X, book:ks:2013}. The potential benefits of high-order discretisations are suggested to be twofold \cite{2018JHyDy..30....1X}: \begin{itemize} \item exponential convergence under certain regularity assumptions which can be achieved from a clever combination of high-quality mesh generation with $p$-refinement away from domain boundaries; \item better diffusion and dispersion properties of the spatially discretised differential operators. \end{itemize} While the approximation property argument of $h/p$ methods is convincing, there is an inherent prerequisite in the argument: the availability of high-order boundary approximations of 3D mesh generators \cite{2018JHyDy..30....1X}, since the approximation accuracy of the boundary restricts the maximally achievable approximation order of the entire algorithm. Put differently: if such a high quality mesh does not exist for a given complicated domain (as it often happens in practice; e.g.\ boundaries generated by CAD tools yield spline surfaces of third order), high-order methods will simply not achieve high-order convergence rates, see Subsection \ref{sec:3DEthierSteinmanBC}. ~\\ Our contribution shows that the accuracy of all non-pressure-robust space discretisations suffers from a hidden consistency error, namely the consistency error of the corresponding discrete Helmholtz--Hodge projector, see Lemma \ref{lem:DiscHelmLerayNonDivFreeH1} and Lemma \ref{lem:DiscHelmLerayNonDivFreeDG}. Evidently, this consistency error can be reduced by high-order methods, due to a simple Taylor expansion argument. We conjecture that such hidden consistency errors explain the better diffusion and dispersion properties of high-order methods at least partially. \bibliographystyle{plain}
\section{Introduction} Thin film transistors (TFTs) on flexible substrates promise applications such as bendable sensors and actuators \cite{flex0, flex1, flex2, flex3, flex4, flex5, flex6, flex7, flex8, flex9, flex10}, flexible energy harvesters \cite{energy1, energy2, energy3, energy4} and wearable devices for health diagnostics \cite{wear0, wear1, wear2, wear3, wear4, wear5}. In the recent past, there has been a drive towards developing TFTs on rough surfaces such as textiles \cite{TFTonthread3, TFTonthread4, TFTonthread5}, threads and fibers \cite{TFTonthread1, TFTonthread2}, paper \cite{TFTonpaper1, TFTonpaper2, TFTonpaper3, TFTonpaper4, TFTonpaper5, TFTonpaper6} and artificially corrugated surfaces \cite{sambandan2012influence, aljada2012structured, nair2017modulating, amalraj2014influence}. In such cases, the metal-insulator-semiconductor (MIS) stack of the TFT may experience significant geometric curvature. High curvature of the MIS stack would also occur when TFTs on flexible substrates are bent significantly \cite{bending1, gleskova2002electrical, sekitani2005bending, van2013high, munzenrieder2012flexible, kim2012mechanical, liao2016effect, jamshidi2008effects, bending3, bending4, bending6}. However, while the former case i.e. the deposition of TFTs on non planar surfaces, only brings in a geometric effect, the latter case of bending the TFT involves both, mechanical stress as well as a geometric effect. This work is focussed on the effect of high curvature geometry alone and not the effect of mechanical stress. High curvature geometry of the MIS stack results in changing the gate electric field distribution from nearly uniform to non-uniform. The importance of geometry on the performance of TFTs is seen from experiments performed on TFTs deposited on artificially engineered rough surfaces \cite{sambandan2012influence, nair2017modulating, aljada2012structured, amalraj2014influence}. In these experiments, the gate metal of the TFT was undulated in both convex and concave fashions by the use of corrugations or dimples. Since the semiconductor and insulator were deposited conformably on top of this gate metal, the MIS stack did not experience mechanical stress and only experienced the effect of curvature. Experiments showed significant variations in electrical performance in the TFT thereby defining the role of geometry alone to be significant in itself. Corrugated gate a-Si:H TFTs showed almost 200-300\% increase in transconductance as compared to planar TFT \cite{sambandan2012influence}. Upto $\pm$40\% variation in transconductance was observed depending on the texture orientation as compared to conventional planar gate TFTs in a-Si:H technology. Demonstrations of high gain common-source amplifiers using textured TFTs have also been reported \cite{nair2017modulating}. Patterning the gate with dimples in organic (P3HT) TFTs showed almost 400\% improvement in current \cite{aljada2012structured}. Therefore, the geometrical impact of curvature on the performance of TFTs is important. The aim of this work is the development of an analytical model to explain the purely geometrical impact of curvature on electrostatics of the MIS stack and the performance of the TFT. This is accomplished by obtaining the closed form solution to the Poisson-Boltzmann's equation in polar coordinates for positive and negative curvature. We demonstrate the occurrence of a pleasant symmetry in the positive and negative curvature case with the TFT chracteristics being strongly determined by the effective gate capacitance. Models are compared to TCAD simulations and then generalized and compared with experimental data for a corrugated gate TFTs. \begin{figure} \centering \includegraphics[width=4in]{Fig1} \caption{Geometrical definitions and \textbf{coordinate} systems (Cartesian $(x,y)$ and polar $(r,\theta)$) used. Cross-section of a TFT with no curvature (planar MIS stack), concave curvature and convex curvature.} \label{fig1} \end{figure} \section{Definitions and Assumptions} \subsection{Device Physics} The disordered nature of the semiconductor in a TFT results in the appearance of localized states in the energy bandgap. These can be classified as deep states that are present around midgap and tail states that are present close to the mobility edge. In most inorganic disordered semiconductors (eg. amorphous hydrogenated silicon (a-Si:H) \cite{shur1984physics}, amorphous metal oxides \cite{chen2009density}), the states in the gap are observed to have an exponential distribution with energy. For this analysis, we consider n-type TFTs with the electrostatics defined by the Poisson equation as $\nabla^2\varphi=q(n_{t}+n_{f})/\epsilon_{s}$ where $\varphi$ is the potential profile in the semiconductor measured with reference to the back channel (bulk) potential, $q$ the magnitude of the electron charge, $\epsilon_{s}$ the semiconductor permittivity and $n_{t}$, $n_{f}$ are the trapped and free carrier concentration, respectively. To simplify the analysis and preserve physical intuition we represent the contribution of traps at all energies and the effect of the free carrier concentration by defining an effective carrier concentration, $n_{e}$, and an effective characteristic voltage, $\phi_{e}$, and write the Poisson equation as \begin{equation} \label{electrostatics} \nabla^2\varphi=q n_{e}/\epsilon_{s}=q n_{e0}e^{\varphi/\phi_{e}}/\epsilon_{s} \end{equation} with $n_{e0}$ being the effective carrier concentration at flat band. The parameters $n_{e}$ and $\phi_{e}$ are influenced by the trapped and free carriers and tend to take values of the specie dominating the physics. This simplifies the analysis without much loss of accuracy and is justified by the simulations and experiments. Although the electrostatics of the device is determined by $n_{e}$, the current voltage (IV) characteristics is determined by the free carrier concentration, $n_{f}$. \subsection{MIS Geometry} The geometry of the MIS structure used for analysis is shown in Fig. 1. The MIS has an insulator of thickness $t_{i}$ and semiconductor of thickness $t_{s}$. We define the radius of curvature of the insulator-semiconductor interface to be $r_{si}$. For zero curvature the MIS stack is planar, $r_{si}=\infty$ and a Cartesian coordinate system $(x,y)$ is used for analysis with the vector $x$ pointing along the direction from the insulator-semiconductor interface ($x=0$) to bulk. When the MIS stack has curvature, a polar coordinate system $(r,\theta)$ is used. The curved MIS stack is said to be concave or convex as shown in Fig. 1. For simulations the arc length of the insulator-semiconductor interface was always kept constant. \subsection{Insulator Capacitance Per Unit Area} We also define an effective insulator capacitance per unit area $C_{i0}$ for the MIS stack with zero curvature, $C_{i+}$ for the case of concave curvature and $C_{i-}$ for the case of convex curvature. It is seen that, $C_{i0}=\epsilon_{i}/t_{i}$, $C_{i+}=\epsilon_{i}/(r_{si}\mbox{ln}(r_{si}/(r_{si}-t_{i})))$ and $C_{i-}=\epsilon_{i}/(r_{si}\mbox{ln}((r_{si}+t_{i})/r_{si}))$, where $\epsilon_{i}$ is the insulator permittivity. \section{Electrostatics} \subsection{Zero Curvature (or Planar)} We first consider the case when the MIS stack has no curvature. This case has been very well investigated \cite{chen2016aphysics}-\cite{deng2014anexplicit}. Poisson's equation is given by (\ref{electrostatics}) and is solved to identify the electrostatics. Using the boundary condition $\xi=0$ at $\varphi=0$ and defining a characteristic length $l_{e}=((2\epsilon_{s}\phi_{e})/(qn_{e0}))^{1/2}$, the electric field ($\xi$) in this case can be shown to vary as \begin{equation} \label{xi_planar} \xi(\varphi)=\frac{2\phi_{e}}{l_{e}}(e^{\varphi/\phi_{e}}-1)^{1/2} \end{equation} Defining the surface potential $\varphi(x=0)=\varphi_{s}$, the second boundary condition can be set as $C_{i0}(V_{gs}-V_{fb}-\varphi_{s})=\epsilon_{s}\xi(\varphi=\varphi_{s})$, with $V_{fb}$ being the flat-band voltage and $V_{gs}$ the gate to source voltage. In strong above threshold operation with $e^{\varphi_{s}/\phi_{e}}>>1$, the solution to the boundary condition is given in terms of the zero order Lambert-W function, $\textbf{W}_{0}$, as \begin{eqnarray} \label{phis_planarW} \varphi_{s}&=&V_{gs}-V_{fb}-2\phi_{e}\textbf{W}_0\left(\frac{\epsilon_{s}/l_{e}}{C_{i0}}e^{(V_{gs}-V_{fb})/2\phi_{e}}\right)\nonumber \\ &\approx& 2\phi_{e}\ln\left(\frac{C_{i0}(V_{gs}-V_{fb})}{qn_{e0}l_{e}}\right) \end{eqnarray} Here, the term $\epsilon_{s}/l_{e}$ can be imagined to be a characteristic trap capacitance per unit area. The approximated form of the above expression is obtained by approximating $\textbf{W}_{0}(.)=\mbox{ln}(.)-\mbox{ln}(\mbox{ln}(.))$ for large $V_{gs}$ \cite{ortiz2003exact}. The potential profile, $\varphi(x)$, is obtained using (\ref{xi_planar}) along with the boundary condition $\varphi=\varphi_{s}$ at $x=0$, \begin{equation} \label{phi_planar_final} \varphi(x) \approx 2\phi_{e}\ln\left(\mbox{sec}\left(\left \vert \sec^{-1}(e^{\varphi_s/2\phi_{e}})\right \vert -\frac{x}{l_{e}}\right)\right) \end{equation} \subsection{Non Zero Curvature} In the presence of curvature, $r_{si}$ is finite and the Poisson equation can be defined in polar coordinates $(r,\theta)$ as, \begin{equation} \label{poisson_polar} \frac{d^{2}\varphi}{dr^{2}}+\frac{1}{r}\frac{d\varphi}{dr}=\frac{qn_{e0}}{\epsilon_{s}}e^{\varphi/\phi_{e}} \end{equation} From the derivation shown in the Supplementary Information, the radial variation of the potential is of the form \begin{equation} \varphi(r)=2\phi_{e}\mbox{ln}\left(\frac{\kappa l_{e}}{r}\mbox{sec}\left(\kappa\mbox{ln}\left(\frac{r}{l_{b}}\right)\right)\right) \label{phir_polar} \end{equation} Here $\kappa$ is a dimensionless coefficient and $l_{b}$ is a characteristic length. The radial component of the electric field can be shown to vary as \begin{equation} \label{xi_polar} \xi=\frac{2\phi_{e}}{l_{e}}\left(\pm\left(e^{\varphi/\phi_{e}}-\left(\frac{\kappa l_{e}}{r}\right)^{2}\right)^{1/2}+\frac{l_{e}}{r}\right) \end{equation} with the $+$ for the concave case and $-$ for the convex case. At $r=r_{si}$, $\varphi=\varphi_{s}$ with $\varphi_{s}$ being the surface potential. This sets the boundary condition $C_{i\pm}(V_{gs}-V_{fb}-\varphi_{s})=\pm\epsilon_{s}\xi(\varphi=\varphi_{s})$, with the $+$ for the concave case ($\varphi$ decreases as $r$ increases) and the $-$ for the convex case ($\varphi$ decreases as $r$ decreases). Again considering strong above threshold operation, $e^{\varphi_{s}/\phi_{e}}>>\kappa l_{e}/{r_{si}}$, the solution to (\ref{xi_polar}) can also be presented using the Lambert-W function as was done in the planar case as, \begin{eqnarray} \label{phis_polarW} \varphi_{s}&=&V_{gs}-V_{fb}-2\phi_{e}\textbf{W}_{0}\left(\frac{\epsilon_{s}/l_{e}}{C_{i\pm}}e^{(V_{gs}-V_{fb})/2\phi_{e}}\right) \nonumber \\ &\approx& 2\phi_{e}\ln\left({\frac{C_{i\pm}(V_{gs}-V_{fb})}{qn_{e0}l_{e}}}\right) \end{eqnarray} Therefore, for all practical purposes the impact of the geometry of curvature on TFT performance is dictated through the cylindrical capacitive component defined by $C_{i\pm}$. This model for $\varphi_{s}$ is validated by a good match with simulations. To obtain a good numerical estimate for complete variation of $\varphi(r)$ as well as the surface potential, $\varphi_{s}$, we impose another boundary condition permitting the bands to flatten at the back edge of the MIS capacitor. Therefore, $\xi(r=r_{si}\pm t_{s})=0$ and $\varphi(r=r_{si}\pm t_{s})=0$, with the $+$ for the concave case and the $-$ for the convex case. This condition helps identify the parameter $\kappa$ to be \begin{equation} \label{kappa} \kappa=(((r_{si}\pm t_{s})/l_{e})^2-1)^{1/2} \end{equation} Here the $+$ and $-$ signs are used for the concave and convex cases, respectively. Typically $l_{e}\sim 60$ nm and $t_{s}\sim 100$ nm and despite the high curvature under consideration, $r_{si}$ is expected to easily exceed these values with it taking a minimum value of about $200$ nm for this study. Using the parameter $\kappa$ in (\ref{phir_polar}) and setting $\varphi=\varphi_{s}$ at $r=r_{si}$, we can identify the parameter $l_{b}$. This permits a closed form expression for $\varphi(r)$ as, \begin{equation} \label{phi_polarfinal} \varphi(r)=2\phi_{e}\mbox{ln}\left(\frac{\kappa l_{e}}{r}\mbox{sec}\left(\pm\left |\mbox{sec}^{-1}\left(\frac{r_{si}}{\kappa l_{e}}e^{\varphi_{s}/2\phi_{e}}\right)\right |-\kappa\mbox{ln}\left(\frac{r}{r_{si}}\right)\right)\right) \end{equation} The function $\mbox{sec}^{-1}$ yields both negative and positive values for the same argument. The positive and negative values are appropriate for the concave and convex case, respectively. This is enforced as shown in (\ref{phi_polarfinal}). The models developed for the bending case $(r_{si}<\infty)$, must converge to the corresponding models for the planar case $(r_{si}=\infty)$, as $r_{si}$ is increased. This is verified in Appendix I. \section{TFT I-V Characteristics} \subsection{Zero Curvature (or Planar)} For a TFT with an applied drain to source bias voltage, $V_{ds}$, the model for $\varphi_{s}$ still retains its form (Eq. \ref{phis_planarW}) except for the incorporation of the threshold voltage term, $V_{T0}$, and a channel potential term, $V_{ch}$, instead of $V_{fb}$. Therefore, $\varphi_{s}=2\phi_{e}\ln{(C_{i(0,\pm)}(V_{gs}-V_{T0}-V_{ch})/(qn_{e0}l_{e}))}$. The free electron density per unit area, $N_{f}$ is computed by integrating the free electron concentration per unit volume, $n_{f}$, along the thickness of the semiconductor, so that $qN_{f}=\gamma(C_{i\pm}(V_{gs}-V_{T0}-V_{ch}))^{\alpha-1}$, where, $\alpha=2\phi_{e}/\phi_{th}$ and $\gamma=(n_{f0}(qn_{e0}l_{e})^{2-\alpha}/(n_{e0}(\alpha-1)))$ with $\phi_{th}$ being the thermal voltage. Therefore, the I-V characteristics in above threshold operation when the TFT has no curvature can be shown to be \begin{equation} \label{Idseff_planar} I_{ds}=\gamma\mu_{0} C_{i0}^{\alpha-1}(W/\alpha L)\left((V_{gs}-V_{T0})^{\alpha}-(V_{gs}-V_{T0}-V_{ds})^{\alpha}\right) \end{equation} with $\mu_0$ being the band mobility, $W$ the channel width and $L$ the channel length. \subsection{Non Zero Curvature} With curvature, the change in the effective insulator capacitance per unit area from $C_{i0}$ to $C_{i\pm}$ also changes the threshold voltage from $V_{T0}$ to $V_{T\pm}$ as threshold voltage is the ratio of the trapped charge to the insulator capacitance per unit area. Therefore, the I-V model for the case with the TFT experiencing curvature (details in Supplementary Information) is given by, \begin{equation} \label{Idseff} I_{ds}=\gamma\mu_{0} C_{i\pm}^{\alpha-1}(W/\alpha L)\left((V_{gs}-V_{T\pm})^{\alpha}-(V_{gs}-V_{T\pm}-V_{ds})^{\alpha}\right) \end{equation} with the $+$ for the concave case and the $-$ for the convex case. Therefore, the difference of the I-V characteristics in the zero and non-zero curvature case is primarily due to the difference in the effective capacitance per unit area. The IV model can be calibrated for TFTs with different materials by suitably changing the parameters $\gamma$, $\alpha$, $\mu_0$ and $V_T$. Free or trapped carriers which will dominate the electrostatics in the above-threshold region is dictated by the values of $\alpha$ and $\gamma$. \begin{figure*} \centering \includegraphics[width=6 in]{Fig2} \caption{Comparison of the electrostatics of the TFT as defined by the analytical model with TCAD simulation. Bold line indicate models and markers indicate simulated data. (a) Density of the states (Properties of a-IGZO) used for simulations (AL-Acceptor like, DL-Donor like). Band-gap=3.05 eV, Effective DoS at conduction-band edge = 5e18 cm$^{-3}$eV$^{-1}$, Density of acceptor-like tail states at conduction-band edge = 5e18 cm$^{-3}$eV$^{-1}$, Characteristic energy of acceptor-like tail states = 30 meV, Density of acceptor-like deep states at conduction-band edge = 2e17 cm$^{-3}$eV$^{-1}$, Characteristic energy of acceptor-like deep states = 120 meV \cite{chen2009density,deng2014anexplicit,bae2013analytical}. (b) Potential variation inside semiconductor from the semiconductor-insulator interface to the bulk using models given in (\ref{phi_planar_final}) and (\ref{phi_polarfinal}), with the inset showing the variation near the interface, (c) Comparison of the electric fields along mid-channel, source edge and drain edge (differentiated by symbols and dashed lines) for different geometries (differentiated by colours) at a channel length $L=4$ $\mu$m. For TFTs with curvature, $r_{si}/t_{si}=10$. All the TFTs were biased at $V_{gs}=10$ V and $V_{ds}=0.1$ V, (d) variation of surface potential with $V_{gs}$ at $r_{si}/t_{i}=2$, (e) variation of surface potential with $r_{si}/t_{i}$ using models (\ref{phis_planarW}) and (\ref{phis_polarW}), (f) variation of $n_{f}$ at interface (given by $n_{f0}e^{\varphi_{s}/\phi_{th}}$) as a function of $r_{si}/t_{i}$.} \label{fig2} \end{figure*} \begin{figure} \centering \includegraphics[width=3 in]{Fig3} \caption{Comparison of the current-voltage charactertistics of the TFT (planar, convex and concave IGZO TFTs) as defined by the analytical model ((\ref{Idseff_planar}) and (\ref{Idseff})) with TCAD simulation. Bold line indicate models and markers indicate simulated data.} \label{fig3} \end{figure} \section{TCAD Simulations} \subsection{Setup} To validate the models, ATLAS TCAD simulations on cylindrical metal-insulator-semiconductor TFTs were performed. Planar, concave and convex geometries were designed with 100 nm SiO$_2$ insulator, 100 nm a-IGZO semiconductor and Mo gate metal. The default material properties as defined in the simulator were used for the a-IGZO (electron affinity=4.16 eV, electron band mobility = 15 cm$^2$/Vs). The DoS used is as shown in Fig. 2a \cite{chen2009density,deng2014anexplicit,bae2013analytical}. Simulations for MIS with bending were performed for $r_{si}/t_{i}$ = 2, 4, 7, 10, 15, 25, 35, 50. For MIS simulations the source and drain were grounded and the arc length of the semiconductor-insulator interface was 1.2 $\mu$m for all structures. For TFT simulations, the arc length of the semiconductor-insulator interface was 4.2 $\mu$m, the channel length was 4 $\mu$m (large enough to reduce drain induced barrier lowering) and $r_{si}/t_{i}$ was 7 for all geometries. The measurement of $\varphi(r)$ was done using a precisely defined cut-line. A fine mesh was used in the semiconductor while keeping the number of mesh points constant for the different structures for the sake of accuracy. As the influence of the gate voltage at the back channel was negligible, $\varphi_s$ was measured by precisely probing and calculating the difference between the potentials at the interface and the back channel. \subsection{Results} The TCAD simulation results (markers) are compared with analytical models (bold lines) in Fig. 2 (electrostics) and Fig. 3 (current-voltage characteristics). The values for $n_{e0}\sim 8\pm 0.1 \times 10^{15}$ cm$^{-3}$ and $\phi_{e}\sim 25.8 \pm 0.7$ mV were estimated by best fit between the model of (\ref{phis_planarW}) and simulation for the case of zero curvature. In the case of IGZO TFTs, calculation of $n_{f}$ and $n_{t}$ using methods described in \cite{leroux1986static} shows that $n_{f}$ is slightly greater than $n_{t}$ in the above-threshold operation. Therefore $\phi_{e}$ is expected to be close to the thermal voltage as corroborated by a good match between analysis and simulation. These parameters were also used for the case of non-zero curvature to obtain good corroboration between model and simulation. Using the models described in (\ref{phis_planarW}) and (\ref{phis_polarW}), the surface potential of planar, concave and convex TFTs were compared against simulations. The spatial variation of the potential inside the semiconductor for the case of non zero curvature was calculated using (\ref{phi_polarfinal}). Fig. \ref{fig2}(b) and Fig. \ref{fig2}(c) show the spatial variation of $\varphi$ and the electric field (at $V_{gs}=10$V) while moving from the semiconductor-insulator interface to the bulk. The electric field was probed along three cutlines directed radially from the interface towards the bulk at the - mid-channel, edge of source terminal and the edge of drain terminal. Simulation results reveal that the influence of curvature on the electric-field along the three cutlines follow a similar trend for TFTs having $L>4$ $\mu$m (both markers and dashed lines indicate simulations). This justifies the modeling of the electrostatics of the TFT using the polar Poisson-Boltzmann equation as described and without requiring any consideration with regards to the location along the channel length as the source drain edge does not have any different influence with regards to the general trend. Fig. \ref{fig2}(d) and Fig. \ref{fig2}(e) show the plots of $\varphi_s$ vs $V_{gs}$ (for $r_{si}/t_{i}=2$) and $\varphi_s$ vs $r_{si}/t_{i}$ (at $V_{gs}=9$V), respectively. As predicted by the model, the convex TFTs are observed to have a higher $\varphi_{s}$ as compared to planar devices while the concave TFTs have a lower $\varphi_{s}$ as compared to planar TFTs for the same applied gate bias. As discussed, this is attributed to the variation in effective insulator capacitance per unit area. As $r_{si}$ increases, $\varphi_s$ of the TFTs with curvature approach the case of TFTs with zero curvature. Therefore, although geometry has an impact for any curvature, the influence becomes significant (\textgreater10\%) only when the $r_{si}/t_{i}<20$. This degree of curvature would appear when the substrate or MIS stack buckles, wrinkles or if the TFTs are deposited on fibers. Fig. \ref{fig2}(f) shows $n_{f}(\varphi=\varphi_{s})$ as a function of $r_{si}/t_{i}$ at $V_{gs}=9$V. Here, $n_{f0}\approx 6.2 \times 10^{15}$ cm$^{-3}$. The model and simulations once again show a reasonably good fit. At a given $V_{gs}$ free electron concentration is higher for the convex curvature case as compared to the zero curvature case. On the other hand, the free carrier concentration for the concave curvature case is lower as compared to the zero curvature case. As expected, this follows a trend similar to $\varphi_{s}$ and is strongly dictated by the variation in gate capacitance. Fig. \ref{fig3} compares the transfer and output characteristics for TFTs with zero curvature, convex curvature and concave curvature cases ($r_{si}/t_{i}$=7). At low channel lengths ($\leq 2$ $\mu$m), drain induced barrier lowering was observed. Hence the simulations were performed using a channel length of 4 $\mu$m to study the impact of curvature. The threshold voltage values used to fit the simulated data are $V_{T0}=0.04$V, $V_{T-}=0$V, $V_{T+}=0.15$V. The models based on \ref{Idseff} are compared with simulations and show a reasonably good fit. The best fit was achieved for $\gamma=1$ and $\alpha=2$, which indicates the domination of free carriers in the above threshold regime. \begin{figure*}[!t] \centering \includegraphics[width=6in]{Fig4} \caption{(a) Structure of the corrugated gate TFT. (b) SEM image of the cross-section of the corrugated TFT (c) Transfer characteristics along with error bars for planar and corrugated TFTs at $V_{ds}=2,5$V. Bold lines indicate models and error bars indicate experimental data from \cite{sambandan2012influence}. (d) Transfer characteristics at $V_{ds}=$ 1 to 5 V and (e) Output characteristics at $V_{gs}=$ 5 to 20 V for planar and corrugated gate TFTs. Bold lines indicate models and markers indicate experimental data (circles indicate planar and triangles indicate corrugated TFTs) from \cite{sambandan2012influence}.} \label{fig4} \end{figure*} \section{Application to Experiment and Generalizations} In this section we detail how the analytical models described above can be used against experiments performed with TFTs of different materials and different surface curvatures. As a test example, we consider previously reported experimental data for an artificially corrugated gate a-Si:H TFT, whose schematic is given in Fig. \ref{fig4}(a) \cite{sambandan2012influence}. \subsection{Generalizations Regarding Geometry} As seen in Fig. \ref{fig4}(a), the architecture of the MIS stack is more complicated than a simple curved surface. Such a corrugated architecture can be expected when developing TFTs on fabrics without full planarization. To apply the models described in this work, we would first need to break down the geometry into surfaces of convex, concave and zero curvature. The cross-section of the corrugated TFT of Fig. \ref{fig4}(a) can be considered to be composed of exactly such a combination of planar, concave and convex TFTs, with spatially varying radius of curvature. If we define $y$-direction to be along the channel length the $z$-direction be along the channel-width, the drain current per unit width is given by $qN_{f}(y,z)\mu_{0}(dV_{ch}/dy)$. Substituting for $N_{f}$ from the models developed earlier, $I_{ds}/dz=\gamma \mu_{0} [(C_{i(0,\pm)}(V_{gs}-V_{T0}-V_{ch}))]^{\alpha-1}(dV_{ch}/dy)$. The term $\gamma \mu_{0}$ can be considered to be the effective mobility. The term $C_{i(0,\pm)}$ takes on its appropriate values (with subscript 0, + or -) in the corresponding regions (of zero, concave or convex curvature, respectively). For simplicity, the threshold voltage is kept constant. Since the corrugations stretch from source to drain and are parallel to each other and to the direction of the channel lengt, the capacitance varies spatially as we traverse the direction of the channel width and remains constant as we traverse the channel length. The TFT is thus considered to be a parallel combination of TFTs with different gate capacitance and of width $dz$. Integrating the above expression along the length from $y=0$ to $y=L$ and then along the channel width from $z=0$ to $z=W$, $I_{ds}=((\gamma \mu_{0})/(\alpha L))(\int_{0}^{W}{C_{i(0,\pm)}^{\alpha-1}}dz)[(V_{gs}-V_{T0})^{\alpha}-(V_{gs}-V_{T0}-V_{ds})^{\alpha}]$. If the capacitance were to be a continuous function it could be directly integrated in the above expression. However for the case of Fig. \ref{fig4}(a), the geometry and the corresponding value of the capacitance needs to be handled piece wise based on the three periodically repeating regions – the concave, the convex and the planar. The geometrical parameters influencing capacitance, insulator thickness, height of the side wall, corrugation pitch, radius of convex (20 nm) and concave (120 nm) regions, were extracted (likely or approximate values) from the SEM image of the cross section shown in Fig. \ref{fig4}(b). The integral $\int_{0}^{W}{C_{i(0,\pm)}^{\alpha-1}}dz$ was estimated by the piece-wise summation of the separate capacitances. Although not used in the case of Fig. \ref{fig4}, the current voltage characteristics when the corrugations are parallel to the channel width can be shown to be $I_{ds}=(\gamma \mu_{0}W/\alpha)(\int_{0}^{L}{C_{i(0,\pm)}^{1-\alpha}}dy)^{-1}[(V_{gs}-V_{T0})^{\alpha}-(V_{gs}-V_{T0}-V_{ds})^{\alpha}]$. \subsection{Generalizations Regarding Materials} Before computing the current, it is also important to consider the material used for the TFT. While the simulations were performed using a-GIZO TFTs, the experiments of Fig. \ref{fig4} use a-Si:H as the semiconductor. The material properties would be reflected in the values of parameters $\alpha=2\phi_{e}/\phi_{th}$ and $\gamma=n_{f0}(qn_{e0}l_{e})^{2-\alpha}/(n_{e0}(\alpha-1))$ with $l_{e}=(2\epsilon_{s}\phi_{e}/qn_{e0})^{1/2}$. The value of $\phi_{e}$ depends on the region of operation and takes into account the cumulative effect of free carriers and trapped carriers (to aid a single exponential based Poisson equation). The dominant of the two will define $\phi_{e}$. If the free carriers dominate, $\phi_{e}=\phi_{th}\approx 25.8$ mV at 300 K. In a-Si:H, the acceptor like tail states have a characteristic temperature of 325 K and hence a characteristic voltage of about 28 mV \cite{shur1984physics}. Therefore, in above threshold operation in a-Si:H TFTs, $\phi_{e}$ can be expected to take on a value between 25.8 mV and 28 mV. For modeling the experimental data of Fig. \ref{fig4}, we define $\phi_{e} \approx \phi_{th}$. Therefore, $\alpha \approx 2$ and $\gamma \approx n_{f0}/n_{e0}$. The parameter $n_{e0}$ also takes into account the cumulative effect of free carriers, $n_{f0}$, and trapped carriers. In a-GIZO, the free carriers dominated the trap carriers and $n_{f0}=n_{e0}$ and $\gamma=1$. In a-Si:H \cite{shur1984physics}, the carriers in tail states are quite significant and define $n_{e0}$. In a-Si:H, with the band gap of 1.8 eV, effective density of conduction band states of 2.5e20 /cc, exponential acceptor like tail states with density at conduction band mobility edge and characteristic energy of 1e22 /cc and 0.028 eV respectively, acceptor like deep states with density of 1.5e15 /cc at energy 0.62 eV below conduction band mobility edge and with flat band defined at the point when the fermi level is 0.76 eV below the mobility edge, $\gamma=n_{f0}/n_{e0}\approx 0.02$. The parameter $\gamma$ can be used to compute the effective mobility. With a band mobility in a-Si:H being $\mu_{0}$=20 cm$^{2}$/Vs, the effective mobility is $\gamma \mu_{0}\approx$ 0.4 cm$^{2}$/Vs. \subsection{Model Parameters and Comparison with Experiment} Based on the above discussion, the values for model parameters used to fit the experimental data are $\mu_0=0.44 \pm 0.13$ cm$^2$/Vs, $\epsilon_{i}=7.5$, $\gamma=1$, $\alpha=2$, $V_{T0}=3.5 \pm 1$ V. The model was also corrected for leakage currents as reported in \cite{sambandan2012influence}. Fig. \ref{fig4}(c)-(e) show good fitting between the I-V models (bold line) and the experimental data (markers) given in \cite{sambandan2012influence}. For best fit $\mu_{0}$=0.31 cm$^{2}$/Vs was chosen for Fig. 4c and $\mu_{0}$=0.57 cm$^{2}$/Vs was chosen for Fig. 4d and Fig. 4e. \section{Conclusion} This work presented a closed form analytical model describing the geometrical impact of high curvature on the electrostatics of the MIS stack and the performance of the TFT. The models for TFTs experiencing curvature were obtained from the solution to the Poisson-Boltzmann equation in polar co-ordinates. These models were compared with the case of planar TFTs having no curvature and verified using detailed TCAD simulations. The methods to generalize the results was also discussed using the example of corrugated a-Si:H TFTs. This work forms an analytical basis to understand the behavior of substrate geometry on TFTs, for example with regards to TFTs deposited on rough or textured surfaces such as textiles or paper, surfaces with high curvatures such as fibers or wires and on substrates experiencing buckling, wrinkling or significant bending. \section*{Acknowledgement} The authors acknowledge the Department of Science and Technology for funding under the grant DST IMPRINT Program, Grant No. 7969. Sanjiv Sambandan also acknowledges the DBT-Cambridge Lectureship program for permitting a joint faculty appointment at the Indian Institute of Science, India and the University of Cambridge, UK. \section*{Appendix I} We perform a check on all models developed by subjecting them to a variation in $r_{si}$, i.e., the models for $r_{si}<\infty$ (non-zero curvature) must converge with the models for $r_{si}=\infty$ (zero curvature) as $r_{si}$ is increased. Firstly as $r_{si}$ increases, $t_{i}/r_{si}<<1$ and a Taylor expansion of the logarithm shows that $C_{i+}$ and $C_{i-}$ converge to $C_{i0}=\epsilon_{i}/t_{i}$. Therefore, models for the I-V characteristics and $\varphi_{s}$ for the non-zero curvature case approach the models for the zero curvature case as $r_{si}\rightarrow \infty$. Secondly we consider the parameter $\kappa$ (\ref{kappa}). If $r_{si}>>(t_{s},l_{e})$, $\kappa \approx r_{si}/l_{e}$. Using this, the electric field at the semiconductor-insulator interface (i.e. at $r=r_{si}$ and $\varphi=\varphi_{s}$) in the non-zero curvature case approaches the field at the interface in the zero curvature case. Next, considering the spatial variation of $\xi$ and $\varphi$ we note that the polar coordinate system $(r,\theta)$ maps to the Cartesian coordinate $x$ as $x=\pm(r- r_{si})\mbox{cos}(\theta)$ with the interface at $x=0$ and $r=r_{si}$. As all parameters in the non-zero curvature case are invariant with $\theta$, we set $\theta=0$ and use $r=r_{si}\pm x$ in (\ref{xi_polar}) and (\ref{phi_polarfinal}). As $r_{si}$ becomes very large, firstly $\kappa l_{e} \approx r_{si}$, secondly $l_{e}<<r_{si}$ and finally since $x$ spans from $0$ to $t_{s}$, $x/r_{si}<<1$. Therefore, $r_{si}/(r_{si}\pm x)\approx 1$ and $\kappa\mbox{ln}(1\pm(x/r_{si}))\approx \pm\kappa x/r_{si}=\pm x/l_{e}$. Using $r=r_{si}\pm x$ along with these approximations we find that (\ref{xi_polar}) and (\ref{phi_polarfinal}) converge to (\ref{xi_planar}) and (\ref{phi_planar_final}), respectively. \section*{References} \bibliographystyle{iopart-num}
\section{Quantum optimization on Maximum Independent Set} In this section, we provide details on the numerical analysis of the various quantum optimization algorithms presented in the main text. As discussed in the main text, we focus on the maximum independent set problem on random unit disk (UD) graphs. We parametrize random UD graphs by two parmeters, the number of vertices $N$ and the 2D vertex density $\rho$. The unit distance is taken to be $r = 1$, and the vertices are put into a box of $L \times L$, where $L = \sqrt{N/\rho}$ (see Fig.~\ref{Fig:rUDGraph} for an example). For a random UD graph with density $\rho$, the average vertex degree is approximately $\pi \rho$. To minimize the finite-size boundary effect, we use periodic boundary conditions for UD graphs in all our numerical simulations. \begin{figure}[b] \begin{center} \includegraphics[width=0.4\linewidth]{rUDGraph2.pdf} \caption{An example of a random unit disk graph with $N = 40, \rho =1.5, |\text{MIS}| = 14$, and $93$ edges. The unit distance is set to be $r = 1$, and the box length is $L = \sqrt{N/\rho}$.} \label{Fig:rUDGraph} \end{center} \end{figure} \subsection{Quantum annealing for random UD-MIS} As discussed in the main text, a quantum annealing algorithm (QAA) for MIS can be performed using the following Hamiltonian \begin{align} \label{Eq:QA} H_{\text{QA}} (t)=\sum_{v\in V} \bigg(-\Delta(t) \, n_v+\Omega(t) \sigma_v^x\bigg)+\sum_{(u,w)\in E} U n_u n_w. \end{align} The QAA can be designed by first initializing all qubits in $\ket{0}$ at time $t=0$, which is the ground state of $ H_{\text{QA}}(t=0)$ when $\Delta(t=0)<0$ and $\Omega(t=0)=0$ (with $U>0$). We then change the parameters, by first turning on $\Omega(t)$ to a non-zero value, sweeping $\Delta(t)$ to a positive value, and finally turning off $\Omega(t)$ again. The annealing protocol we consider throughout this work is specified by \begin{equation} \label{Eq:AdiabaticPath} \Delta(t) = (2s-1)\Delta_0, \quad \Omega(t) = \Omega_{0} \sin^{2}(\pi s) \quad \text{with} \quad s = t/T. \end{equation} If the time evolution is sufficiently slow, then by the adiabatic theorem, the system follows the instantaneous ground state, ending up in the solution to the MIS problem. We take $\Omega_{0} = 1$ to be the unit of energy, and fix $\Delta_{0}/\Omega_{0} = 6$, which empirically seems to be a good ratio to minimize nonadiabatic transitions. \begin{figure}[t] \begin{center} \includegraphics[width=0.5\linewidth]{LZfitting2.pdf} \caption{The Landau-Zener fitting to $1-P_{\text{MIS}} = e^{a-T/T_{\text{LZ}}}$ to extract the adiabatic time scale $T_{\text{LZ}}$. Here, four random unit disk graphs with $N = 10,20,30,40$ are shown. For each instance, we find the first $T$ iteratively such that $P_\text{MIS}(T) > 0.9$, denoted as $T^{*}$. The fitting is then performed on four points $T^{*}, 1.5T^{*},2T^{*},2.5T^{*}$ to extract the time scale $T_{\text{LZ}}$.} \label{Fig:LZfitting} \end{center} \end{figure} We study quantum annealing on random unit disk graphs, with $N$ vertices and density $\rho$. We take the limit of $\Delta_{0}, \Omega_{0} \ll U$, where the non-independent sets are pushed away by large energy penalties and can be neglected. In the experiment, this corresponds to the limit where the Rydberg interaction energy is much stronger than other energy scales. In this limit, we restrict our wavefunction to the subspace of all independent sets, i.e. \begin{equation} \mc{H}_{\rm IS} = \{\ket{\psi}: n_v n_w\ket{\psi} = 0 \text{ for any } (v,w)\in E\}, \end{equation} in our numerical simulation, which allows us to access a much bigger system size up to $N \sim 50$ since $\dim(\mc{H}_{\rm IS})\ll 2^N$. First, the subspace of all independent sets is found by a classical algorithm, the Bron-Kerbosch algorithm \cite{Bron:1973dm}, and the Hamiltonian in Eq.~\eqref{Eq:QA} is then projected into the subspace of all independent sets. The dynamics with the time-dependent Hamiltonian is simulated by dividing the total simulation time $t$ into sufficiently small discrete time $\tau$ and at each small time step, a scaling and squaring method with a truncated Taylor series approximation \cite{AlMohy:2011iw} is used to perform the time evolution without forming the full evolution operators. We first consider the time scale needed for adiabatic quantum annealing to work. Typically, this is governed by the minimum spectral gap, $\epsilon_\textrm{gap}$: the runtime required is $T = O(1/\epsilon_\textrm{gap}^2)$. However, the minimum spectral gap is ambiguous when the final ground state is highly degenerate, since it is perfectly legitimate for the state to couple to an instantaneous excited state as long as it comes down to the ground state in the end. For a generic graph, there can be many distinct maximum independent sets (the ground state of $H_{P}$ is highly degenerate). So instead of finding the minimum gap, we take a different approach to extract the adiabatic time scale. \begin{figure}[t] \begin{center} \includegraphics[width=\linewidth]{MIS_T_LZ_Scaling.pdf} \caption{The adiabatic time scale $T_{\text{LZ}}$ at some fixed densities. For each system size up to $N = 46$, 200 random unit disk graphs are simulated. (a) Median $T_{\text{LZ}}$. (b) and (c): $T_{\text{LZ}}$ for individual instances for $\rho = 0.8$ and $\rho = 3$. } \label{Fig:MIS_T_LZ_Scaling} \end{center} \end{figure} In the adiabatic limit, the final ground state population (including degeneracy) takes the form of the Landau-Zener formula $P_{\text{MIS}} \approx 1 - e^{a-T/T_{\text{LZ}}}$, where $a$ is a constant and $T_{\text{LZ}}$ is the adiabatic time scale. In the nondegenerate case, one typically has $T_{\text{LZ}} = O(1/\epsilon_\textrm{gap}^{2})$. In the more general case, we extract the time scale $T_{\text{LZ}}$ by fitting to this expression. However, the simple exponential form holds only in the adiabatic limit, where $T \gtrsim T_{\text{LZ}}$. Hence, for each graph instance, we search for the minimum $T$ such that the equation holds: we adaptively double $T$ iteratively (from $T_{\min} = 5$) until we find the minimum $T^{*}$ such that $P_{\text{MIS}} > 0.9$, at which we assume the time evolution lies in the Landau-Zener regime; we then simulate the dynamics for another three time points $1.5T^{*}$, $2T^{*}$, and $2.5T^{*}$, before finally fitting to the equation from $T^{*}$ to $2.5T^{*}$ to extract the time scale $T_{\text{LZ}}$. The fitting is remarkably good for most instances (see Fig.~\ref{Fig:LZfitting} for some examples), and we drop the few graphs where the goodness-of-fit $R^{2} < 0.99$. We perform this procedure to extract $T_\text{LZ}$ for up to 30 graph instances at each $N$ and $\rho$, and take their median; this produces the full phase diagram in terms of $T_{\text{LZ}}$ as plotted in Fig.~4(a) of the main text. Here, in Fig.~\ref{Fig:MIS_T_LZ_Scaling}, we also look at the scaling of $T_{\text{LZ}}$ with $N$ at some fixed densities $\rho = 0.8$ (below the percolation threshold) and $\rho = 3$ (above the percolation threshold). We simulated quantum annealing and extracted $T_{\text{LZ}}$ for 200 random UD graphs at each $N$ up to $N = 46$. As seen in Fig.~\ref{Fig:MIS_T_LZ_Scaling}(a), we can see a clear separation between $\rho = 0.8$ and $\rho = 3$, but the scaling of $N$ is unclear, due to finite-size effect: from the performance of the classical algorithm shown in the main text, one may need to go to $N \gtrsim 100$ to see the true scaling. Fig.~\ref{Fig:MIS_T_LZ_Scaling}(b) and (c) also show the spread of $T_{\text{LZ}}$ for each instance. Note that some hard instances require significantly longer $T_{\text{LZ}}$ than the typical instance, and even on average we can see $T_{\text{LZ}} > 10$ for $\rho =3, N \gtrsim 20$. \begin{figure}[h] \begin{center} \includegraphics[width=0.5\linewidth]{MIS_PhaseDiag_ratio_v2.pdf} \caption{Phase diagram of approximation ratio $r$ for non-adiabatic quantum annealing with $T=10/\Omega_0$, averaged over 30 graph instances per $N$ and $\rho$ (the same instances as in Fig.~4(b) in the main text). Red dashed line corresponds to percolation ratio at $\rho=\rho_c\approx1.436$\cite{Mertens:2012fr}. White dashed line correspond to optimal disk packing\cite{Musin:2015dz}.} \label{Fig:MIS_PhaseDiag_ratio} \end{center} \end{figure} In the main text, we focused mainly on the capacity of the algorithms to solve MIS exactly. It is also interesting to ask whether the algorithms can solve MIS approximately, in the sense of finding an independent set as large as possible. For quantum algorithms, we use the approximation ratio $r$ to gauge their performance in terms of approximation. For a quantum algorithm (such as a quantum annealer) that outputs a state $\ket{\psi_f}$, we define $r = \sum_i\braket{\psi_f}{n_i|\psi_f}/ |\text{MIS}|$, where $|\text{MIS}|$ is the size of the MIS. In other words, $r$ quantifies the ratio of the average independent-set size found by measuring the output quantum state to the maximum independent-set size. Fig.~\ref{Fig:MIS_PhaseDiag_ratio} shows an analogous phase diagram in terms of the approximation ratio $r$ by running quantum annealing at a fixed time $T=10$. It displays qualitatively the same features as the ground state population in the main text, but the finite-size effect is stronger due to the small discrete $|\text{MIS}|$ values at large densities. \subsection{QAOA for MIS} In this section, we explain how we simulate the Quantum Approximate Optimization Algorithm to solve Maximum Independent Set Problems. \subsubsection{Quantum approximate optimization algorithm} Suppose we are to find MIS on a given a graph $G=(V,E)$. The $p$-level QAOA for MIS, suggested first by \cite{Farhi:2014wk}, is a variational algorithm consisting of the following steps: \begin{itemize} \item[(i)] Initialization of the quantum state in $\ket{\psi_0}=\ket{0}^{\otimes N}$. \item[(ii)] Preparation of variational wavefunction \begin{equation}\label{QAOAv1} \ket{\psi_p(\vec{\gamma},\vec{\beta})}=\exp(-i\beta_p H_Q) \prod_{k=1}^{p-1} \exp(-i\gamma_k H_P)\exp(-i\beta_k H_{Q})\ket{\psi_0}, \end{equation} where $H_P = \sum_{v\in V} -\Delta n_v + \sum_{(v,w) \in E} U n_v n_w$, and $H_Q=\sum_{v\in V} \Omega \sigma_v^x + \sum_{(v,w) \in E} U n_v n_w$. The parameters $\vec{\gamma}\in\mathds{R}^{p-1}$ and $\vec{\beta}\in\mathds{R}^p$, specify the variational state. \item[(iii)] Measurement of $H_P$. \end{itemize} The three steps (i)-(iii) are iterated and combined with a classical optimization of the variational parameters in order to minimize $\mean{\psi_p(\vec{\gamma},\vec{\beta})|H_P|\psi_p(\vec{\gamma},\vec{\beta})}$. \subsubsection{Alternative formulation} We are interested in the $U\gg |\Omega|,|\Delta|$ limit, where the variational search is restricted to the subspace $\mc{H}_{\rm IS}$ spanned by independent sets, such that the algorithm does not need to explore states that can be directly excluded as MIS candidates. In this limit, we can write \begin{align} H_Q=\sum_v \mc{P}_{\rm IS}\Omega\sigma_x\mc{P}_{\rm IS}, \qquad H_P= \sum_{v\in V} -\Delta n_v, \end{align} where $\mc{P}_{\rm IS}$ is a projector onto the independent set subspace $\mc{H}_{\rm IS}$. Evolution with $H_P$ thus reduces to simple rotation of individual spins around the $z$ axis. Since \begin{align} \exp(-i\gamma H_P)\exp(-i\beta H_Q)=\exp\lr{-i\beta \Omega \sum_v \mc{P}_{\rm IS} \lr{\ket{0}_v\bra{1}e^{i\gamma}+\rm{h.c.}}\mc{P}_{\rm IS}}\exp(-i\gamma H_P), \end{align} we can commute all the unitaries generated by $H_P$ in \eqref{QAOAv1} to the rightmost side until they act (trivially) on the initial state. Thus, we can rewrite the state $\ket{\psi_p(\vec{\beta},\vec{\gamma})}$ as \begin{equation}\label{QAOAv2} \ket{\psi_p(\vec{\gamma},\vec{\beta})}=\prod_{k=1}^p\exp\lr{-it_k \Omega \sum_v \mc{P}_{\rm IS} \lr{\ket{0}_v\bra{1}e^{i\phi_k}+\rm{h.c.}}\mc{P}_{\rm IS}}\ket{\psi_0}, \end{equation} where we identify \begin{align} \phi_k=\sum_{j\ge k}\gamma_j, \qquad t_k=\beta_k \end{align} Thus we recover the formulation of QAOA given in the main text, which is equivalent to \eqref{QAOAv2} for $U\gg\Omega$. \subsubsection{Numerical simulations: preliminaries} In our numerical study, we work in the formulation of QAOA corresponding to \eqref{QAOAv1} and take $\Delta=\Omega=1$. Again, we work in the limit where $U\gg 1$ so that we can restrict our Hilbert space to the independent set subspace $\mc{H}_{\rm IS}$; this allows us to efficiently simulate system sizes up to $N \sim 50$. We prepare the state as in Eq.~\eqref{QAOAv1}, and then measure the expectation value of $H_P$, which is the objective function that we seek to minimize: \begin{equation} F_p(\vec{\gamma},\vec{\beta}) = \bra{\psi_p(\vec{\gamma},\vec{\beta})}H_P\ket{\psi_p(\vec{\gamma},\vec{\beta})}. \end{equation} This sequence of state-preparation and measurement of objective function is then fed as a subroutine to a classical optimization algorithm, which is used to find good parameters $(\vec\gamma,\vec\beta)$ with the lowest possible $F_p$. \vspace{5pt} \noindent \textbf{Classical Optimization Algorithms}--- Generally, classical optimization algorithms work by starting with some initial point in the QAOA parameter space $(\vec\gamma,\vec\beta)$, and iteratively find new points $(\vec{\gamma}', \vec\beta')$ using information from the current point $(\vec\gamma, \vec\beta)$, with the hope that a new point produces a lower value of the objective function $F_p(\vec\gamma',\vec\beta') \le F_p(\vec\gamma,\vec\beta)$. We first describe some free parameters and stopping criteria that apply to these classical optimization algorithms: \begin{itemize} \item $\delta$ -- step tolerance, If the optimization algorithm attempts to go to a new set of parameters $(\vec{\gamma}', \vec\beta')$ such that $|\vec\gamma'-\vec\gamma|^2 + |\vec\beta'-\vec\beta|^2 \le \delta^2$, then the algorithm terminates and outputs the smallest value of $F_p$ seen so far. When the algorithm calls for a numerical computation of the gradient using the finite-difference method, we also take $\delta$ as our increment size, e.g. $\partial F_p/\partial \gamma_i \simeq [F_p(\gamma_i+\delta)-F_p(\gamma_i)]/\delta$. \item $\epsilon$ -- objective function tolerance. If the optimization algorithm finds that the change in the value of objective function is smaller than $\epsilon$, $|F_p(\vec\gamma',\vec\beta')-F_p(\vec\gamma,\vec\beta)|\le \epsilon$, then the algorithm terminates and outputs the smallest value of $F_p$ seen so far. \item $\epsilon_M$ -- measurement precision. This is the target precision to which we compute the objective function $F_p$. When simulating QAOA with measurement projection noise, this parameter determines the number of measurements necessary to obtain a good averaged value of $\mean{H_P}$. \end{itemize} In our numerical study, we consider two classical optimization algorithms: the BFGS quasi-Newton algorithm\cite{BFGS1,*BFGS2,*BFGS3,*BFGS4} and the Nelder-Mead simplex algorithm \cite{Nelder:1965in}. Specifically, the BFGS algorithm computes the gradient of the objective function at the current point $(\vec\gamma, \vec\beta)$, and uses this information to build a quadratic model of objective function and determine the approximate location of a local minimum. This algorithm terminates the optimization routine if either step tolerance or objective function tolerance is reached. However, computing the gradient in high-dimensional parameter space can be inefficient, especially when the cost of measurement is being considered. Hence, we also consider the Nelder-Mead simplex algorithm that does not involve gradients; this algorithm terminates the optimization routine when \emph{both} step tolerance and objective function tolerance are reached. These algorithms are implemented in the standard library of MATLAB R2017b via \texttt{fminunc} and \texttt{fminsearch} functions, respectively. \vspace{5pt} \noindent \textbf{Heuristic ansatz for optimizing QAOA at deep depths}--- For high levels of QAOA with deep circuit depths, optimization can be difficult because of large dimension of QAOA parameter space. Due to the non-convex nature of the objective function $F_p$, one often need to optimize starting from many points to have a better chance of finding the global minimum in the QAOA parameter space. Typically, a brute-force approach starting from random points will require $2^{O(p)}$ initial points to find the global minimum. Nevertheless, as discussed in more detail in an upcoming study \cite{MaxCutpaper}, we discover patterns in the optimal QAOA parameters for most instances of the MIS problem. Based on these patterns, we develop a heuristic strategy for choosing good initial points when optimizing QAOA parameters at intermediate level $p$ \cite{MaxCutpaper}. We find that this strategy allows us to find quasi-optimal parameters that's often nearly as good as the true global minimum, but in time only $O(\poly(p))$. We now describe our heuristic strategy optimizing QAOA parameters when applied to MIS problems. We start with level $p=3$ and optimize from an educated guess of initial point $(\gamma_1,\gamma_2,\beta_1,\beta_2,\beta_3) \approx (1.73,-1.77,0.19,1.02,0.39)$ based on the averaged optimal QAOA parameters from 20 instances. When the optimization algorithm terminates with the optimized parameters $(\vec{\gamma}_{(p)}^L, \vec{\beta}_{(p)}^L)$ for level $p$, we move on to level $p+1$ with the initial point $(\vec{\gamma}_{(p+1)}^0, \vec{\beta}_{(p+1)}^0)$ obtained by linear interpolation: \begin{align} \left[\vec{\gamma}^{0}_{(p+1)}\right]_1 & = \left[\vec{\gamma}^{L}_{(p)}\right]_1, \quad \left[\vec{\gamma}^{0}_{(p+1)}\right]_{p} = \left[\vec{\gamma}^{L}_{(p)}\right]_{p-1} , \quad \left[\vec{\gamma}^{0}_{(p+1)}\right]_i = \tfrac{i-1}{p-1} \left[\vec{\gamma}^{L}_{(p)}\right]_{i-1}+ \tfrac{p-i}{p-1}\left[\vec{\gamma}^{L}_{(p)}\right]_i, \\ \left[\vec{\beta}^{0}_{(p+1)}\right]_1 & = \left[\vec{\beta}^{L}_{(p)}\right]_1, \quad \left[\vec{\beta}^{0}_{(p+1)}\right]_{p+1} = \left[\vec{\beta}^{L}_{(p)}\right]_{p} , \quad \left[\vec{\beta}^{0}_{(p+1)}\right]_j = \tfrac{j-1}{p} \left[\vec{\beta}^{L}_{(p)}\right]_{j-1}+ \tfrac{p-j+1}{p}\left[\vec{\beta}^{L}_{(p)}\right]_j, \\ & \text{when } \quad 2\le i \le p-1 \text{ and } 2\le j \le p.\nonumber \end{align} Here, we denote $[\vec{\gamma}]_i\equiv \gamma_i$ as the $i$-element of parameter vector $\vec{\gamma}$. This strategy takes advantage of the observation that there is often a set of optimal QAOA parameters that change smoothly from level $p$ to $p+1$. Using this strategy, we have been able find good parameters for QAOA at levels as large as $p=50$. \subsubsection{Simulation neglecting measurement cost} In order to understand the potential of QAOA by finding the best possible optimal parameters, our initial numerical study neglects the cost of measurements and lets the simulated quantum processor output the exact values of $F_p(\vec\gamma,\vec\beta)$. In other words, we effectively choose $\epsilon_M=0$. In addition, we calculate the gradient of the objective function $\nabla F_p = (\partial F_p/\partial\vec\gamma, \partial F_p/\partial\vec\beta)$ analytically instead of using the finite-difference method. The BFGS quasi-Newton algorithm is used in these simulations to find local minima in the QAOA parameter space, where we set the tolerances at $\epsilon=\delta=10^{-6}$. This approach of ignoring measurement cost allows us to find optimal QAOA parameters more efficiently. Using our heuristic ansatz mentioned above, we find optimal QAOA parameters up to $p=50$. Our results show that optimized QAOA can achieve better performance than simple quantum annealing schedules, as shown for the instance in Fig.~4(c) of the main text. Nevertheless, this approach does not represent a realistic simulation of actual QAOA implementations, where measurements are not free and $\epsilon_M$ is necessarily finite. \subsubsection{Simulated experiment with measurement projection noise} In actual experiments, the value of the objective function $F_p$ can only be determined approximately by averaging over many measurements, each projecting the wavefunction onto a possible outcome. In our numerical simulation, we account for this effect by performing full Monte Carlo simulation of actual measurements, where the quantum processor outputs only an approximate value of the objective function obtained by averaging over $M$ measurements: \begin{equation} \tilde{F}_p = \frac{1}{M}\sum_{i=1}^M f_{p,i}, \quad f_{p,i} \text{ is a random variable where } \Pr(f_{p,i} = -k) = \braket{\psi_p(\vec\gamma,\vec\beta)}{\Pi_k|\psi_p(\vec\gamma,\vec\beta)}, \end{equation} and $\Pi_k$ is the projector onto subspace where $H_P = -k$, spanned by independent sets of size $k$. Note that when $M\to \infty$, we obtain $\tilde{F}_p \to F_p=\braket{\psi_p(\vec\gamma,\vec\beta)}{H_P|\psi_p(\vec\gamma,\vec\beta)}$ with perfect precision. In order to achieve finite precision $|\tilde{F}_p - F_p | \sim \epsilon_M$, we accumulate measurements until the standard error of the mean falls below the precision level. In other words, for each evaluation of $F_p(\vec{\gamma},\vec{\beta})$, the number of measurements $M$ we perform is set by the following criterion: \begin{equation} \sqrt{\frac{1}{M(M-1)}\sum_{i=1}^M(f_{p,i}-\bar{F}_{p,M})^2} \le \epsilon_M, \quad\text{where}\quad \bar{F}_{p,M} = \frac{1}{M}\sum_{i=1}^M f_{p,i}. \end{equation} Roughly speaking, $M\approx \Var(\hat{F}_p)/\epsilon_M^2$. To mitigate finite-sample-size effects, we also require at least 10 measurements ($M\ge 10$) be performed for each evaluation of $F_p$. Using this approach, we simulate experiments of optimizing QAOA with measurement projection noise. The above-mentioned heuristic ansatz is utilized, as we start with an educated guess of initial QAOA parameters at $p=3$ and optimize until tolerance levels are reached. To illustrate the usefulness of our heuristic ansatz, we also simulate starting with random choices of initial parameters for optimization, and compare their performance. In these simulations, the approximate value of $\tilde{F}_p(\vec{\gamma},\vec{\beta})$ is returned whenever the classical optimization algorithm requests an evaluation of $F_p(\vec{\gamma},\vec{\beta})$ from the simulated quantum processor. This includes, for example, when the BFGS algorithm numerically computes gradients to find optimal parameters by the finite-difference method: $\partial F_p/\partial \gamma_i \approx [\tilde{F}_p(\gamma_i+\delta) - \tilde{F}_p(\gamma_i)]/\delta$. The history of measurements is stored throughout the entire simulated experiment, which allows us to keep track of the largest independent set $\text{IS}(m)$ found after $m$-th measurement. We repeat this numerically simulated experiment many times with different pseudo-random number generation seeds, and average over their histories. In Fig.~4(d) of the main text, we show an example instance where the simulated experiments are run with $\epsilon=\delta=0.2$, and $\epsilon_M = 0.05$, with and without our heuristic ansatz. \section{Generalization to arbitrary graph structure} \subsection{Stroboscopic evolution} As mentioned in the main text, one can generalize our implementation to address MIS problems on graphs, $G=(V,E)$ that are beyond the UD paradigm. To do so, let us first note that all quantum algorithms we discussed in the main text require evolution with a Hamiltonian $H(t)=\sum_{v}\Omega_v(t)\sigma_v^x-\Delta_v(t)n_v+\sum_{(u,v)\in E} U n_u n_v$. In particular, we are interested in the situation where $U\gg |\Omega|,|\Delta|$, such that the dynamics is effectively restricted to the independent set space $\mc{H}_{\rm IS}$. To generate such evolution with a Hamiltonian corresponding to a general graph structure, let us consider a Trotterized version of the time evolution operator \begin{align} \mc{T}\exp{ \lr{-i\int_0^T dt\,H(t)}}\simeq \prod_{j}\mc{U}(t_j)\equiv\prod_{j}\exp{ \lr{-i(t_{j+1}-t_{j})H(t_j)}}, \end{align} where we have sliced the time interval $[0,T]$ defining times $t_j$ such that $\sum_j t_j=T$ and $t_{j+1}-t_j\ll \sqrt{D_{\rm max}}\Omega(t_j),|\Delta(t_j)|$. Here $D_{\rm max}$ denotes the maximum degree of the graph. We further Trotterize each $\mc{U}(t_j)$ as follows \begin{align} \mc{U}(t_j)\simeq \prod_{v=1}^N\mc{U}_v(t_j)\equiv\prod_{v=1}^N \exp\lr{-i(t_{j+1}-t_j)\lr{\Omega_v(t_j)\sigma_v^x-\Delta_v(t_j)n_v+\frac{1}{2}\sum_{u\in \mc{N}(v)} U n_u n_v)}}, \end{align} that is we split it into a product of terms $\mc{U}_v$ that each are associated with the evolution of one spin, $v$. Here $\mc{N}(v)$ denotes the neighbors of $v$ on the graph. Note that in the $U\rightarrow\infty$ limit we are interested this can be written as \begin{align}\label{Trotterstep} \mc{U}_v(t_j)=\exp\lr{-i(t_{j+1}-t_j)\lr{\Omega_v(t_j)\sigma_v^x-\Delta_v(t_j)n_v}}\prod_{u\in \mc{N}(v)}\ket{0}_u\bra{0}. \end{align} This is a simple single qubit rotation of atom $v$, condition on the state of the atoms corresponding to neighbors of $v$ being $\ket{0}$. If at least one of the neighbors is in state $\ket{1}$, atom $v$ does not evolve. \subsection{Implementation using qubit hyperfine encoding} One approach to realize the corresponding dynamics with individually controlled neutral atoms can be designed as follows. We consider an implementation where qubits states $\ket{0}$ and $\ket{1}$ are encoded in two (non-interacting) hyperfine states, in the internal atomic ground state manifold. We position all atoms on the points of a 2D square lattice with distance $g$. To realize a single step, $\mc{U}_v(t_j)$, we first excite all atoms, $u$, that correspond to neighbors of $v$ on the graph ($u\in \mc{N}(v)$), selectively from the state $\ket{1}$ to a Rydberg $S$-state $\ket{1'}$. We choose a grid length $g\ll r_B$ such that none of the atoms $u\in \mc{N}(v)$ interact during this process. Then we drive atom $v$, to realize the single qubit rotation in the hyperfine manifold, i.e a unitary corresponding to an evolution with $\Omega_v(t_j)\sigma_v^x-\Delta_v(t_j)n_v$, where ${\sigma}_v^x$ couples the two hyperfine qubits states of atom $v$, and $n_v=\ket{1}_v\bra{1}$ counts if atom $v$ is in hyperfine state $\ket{1}$. To realize this rotation this we use an individually addressed two-step excitation that couples the two hyperfine states $\ket{0}$ and $\ket{1}$ of atom $v$ via a transition through a Rydberg $P$-state. If all atoms $u$ are in the state $\ket{0}$, then this process is not disturbed, but if at least one of the neighbors is the Rydberg $S$ state, the strong $S-P$ interaction gives rise to a blockade mechanism that prevents the rotation of the qubit $v$, thus realizing exactly \eqref{Trotterstep}. Note this requires a different scale of interaction length of the blockade radius for two atoms in the Rydberg $S$-states on one hand, and the $S$-$P$ blockade radius on the other hand. This can be readily realized by noting that these two interactions scale differently with separation of the atoms: the $S$-$P$ interactions decay as $1/x^3$, i.e. much slower than the $S$-$S$ interactions that scale like $1/x^6$ [refs, thompson, nature], which should allow one to implement collective gate with high fidelity.
\section{Introduction} Most of the Baryonic matter in our Universe is in the form of magnetized plasma. Hence, astronomers observe the signature of astrophysical magnetic fields from the solar system to the large scale structure. In galaxy clusters, radio telescopes detect the synchrotron radiation ($50 \,\mathrm{MHz} - 30 \,\mathrm{GHz}$) emitted by relativistic electrons ($\gamma > 1000$) gyrating in the magnetic field ($B \sim 1 \,\mu\mathrm{G}$) of the intra-cluster-medium (ICM), a hot and underdense plasma ($T\sim10^8\,\mathrm{K}, n_\mathrm{th} \sim 10^{-3}\,\mathrm{cm}^{-3}$). The next generation of radio interferometers will infer the three dimensional structure of the field through \emph{Faraday tomography} on kpc scales. This represents a first serious probe of the small scale properties of the whole intra-cluster-medium that demands detailed predictions to interpret the new data. As radio brightness is not strongly correlated with thermal density, upcoming studies will probe the whole virial volume of a cluster. \par The ICM itself is a weakly-collisional plasma, whose micro-physical properties are set by turbulence and electromagnetic interactions (plasma-waves), not particle Coulomb scattering \citep{2007mhet.book...85S}. Thus the magnetic field plays a crucial role in making the medium ''collisional'' on large scales, i.e. behave like a magnetised fluid \citep{2007MNRAS.378..245B}. In the currently favoured model of the ICM, the evolution of the magnetic field is governed by a turbulent small-scale dynamo that grows small seed fields at high redshift ($B \sim 10^{-13} \,\mathrm{G}$) into $\mu$G fields via an inverse cascade at the Alfv\'{e}n scale of the medium \citep{sch05,po15}. In merging galaxy clusters the Alfv\'{e}n scale\footnote{The scale where magnetic and turbulent pressure are comparable, i.e. where the Lorentz force becomes important \citep{1995ApJ...438..763G}} reaches a few kpc, thus it is now in range of next-generation radio interferometers for Faraday tomography studies. \par The strength and geometry of the magnetic field is set by the local seeding and turbulence history of the gas parcel under consideration, thus the new data demands numerical simulations to compare with expectations from dynamo theory. However, the nature of the small scale dynamo has made it very difficult to obtain accurate numerical models for the ICM magnetic field \citep{bm16}. The crucial time scale of magnetic field growth is set by the smallest length scale available in the turbulent system, where the eddy turnover time is smallest. In nature, this can be far below pc scale, in simulations this is at best the resolution scale. Current state-of-the-art Eulerian simulations start seeing numerical effects below scales of 10 kpc, Lagrangian simulations reach better resolution in the cluster center, but do not come close at the cluster outskirts due to density adaptivity (see Donnert et al., subm. to SSRv for a review). Thus resolving the Alfv\'{e}n scale at ~3 kpc in the whole cluster volume and faithfully evolving the magnetic field through structure formation is not possible with current community codes. \par In the preferred Eulerian approach, such simulations would require $\sim4096^3$ zones inside the virial radius, run with a highly accurate finite volume or finite difference scheme. This translates into 50--100 TBytes of memory and would generate 1--4 PByte of data. This is well in range of current Petascale and upcoming Exascale supercomputers, but requires near ideal weak scaling of the simulation code to 5--10 thousand compute nodes. Current state-of-the-art simulations typically run on a few thousand nodes, to maximize parallel efficiency \citep{2014ApJ...782...21M}. Hence, it stands to reason that in practice resolutions close the Alfv\'{e}n scale in the ICM will be challenging to achieve with current codes. \par Here we present a performance-aware implementation of the a fifth order constrained transport weighted essentially non-oscillatory (WENO) scheme in the scalable {\small WOMBAT } code\footnote{\url{wombatcode.org}}. This implementation represents a first step towards simulations of the small-scale dynamo in the ICM in a cosmological framework that resolve the Alfv\'{e}n scale. We will show that WENO doubles the effective resolution of the simulation, but is only a factor 10 more computationally expensive than commonly used 2nd order schemes at the same resolution. Hence it is a more efficent algorithm. {\small WOMBAT } itself is an on-going research effort of performance engineers at Cray Inc. to maximize computational efficiency on upcoming exascale systems \citep{2017ApJS..228...23M}. We will show that the new code indeed achieves excellent performance on large supercomputers. \section{WENO-Wombat} \subsection{WENO Algorithm} The Weighted Essentially Non Oscillatory schemes \citep{1994JCoPh.115..200L} are an improvement of ENO schemes presented in \citet{1987JCoPh..71..231H,1988JCoPh..77..439S}. ENO schemes chose one out of several stencils around a zone $i$ based on a mathematical smoothness criterion to avoid spurious oscillations close to flow discontinuities (shocks). WENO schemes combine a weighted average of the stencils, so that the scheme is high order away from shocks, but still avoids Gibbs phenoma adjacent to them \citep[see][ for a review]{doi:10.1137/070679065,2017LRCA....3....2B}. WENO-Wombat implements the classical scheme from \citet{Jiang_Shu__1996__WENO-scheme,1999JCoPh.150..561J}, which combines three stencils to achieve formal fifth order trunctation error in space. The algorithm uses a Roe-type Riemann solver to decouple the system of 8 partial differential equations into independent advection equations \citep{ROE1997250}. The WENO interpolated fluxes on the faces of zone $i$ in the decoupled system are given by \begin{align} {F}^s_{i+\frac{1}{2}} &= \frac{1}{12} \left( -{F}^s_{i-1}+7{F}^s_{i}+7{F}^s_{i+1}-{F}^s_{i+2} \right) -\varphi_N\left( \Delta{F}^{s+}_{i-\frac{3}{2}},\Delta{F}^{s+}_{i-\frac{1}{2}},\Delta{F}^{s+}_{i+\frac{1}{2}},\Delta{F}^{s+}_{i+\frac{3}{2}} \right) \nonumber\\ &+\varphi_N\left( \Delta{F}^{s-}_{i+\frac{5}{2}},\Delta{F}^{s-}_{i+\frac{3}{2}},\Delta{F}^{s-}_{i+\frac{1}{2}},\Delta{F}^{s-}_{i-\frac{1}{2}}\right), \label{eq.FWENO} \end{align} where $\Delta{F}^{s-}_i$ the flux on the cell boundaries obtained from a simple Lax-Friedrichs splitting. The WENO5 interpolant $\varphi_N(a,b,c,d)$ is defined as \begin{align} \varphi_N(a,b,c,d) &= \frac{1}{3} \omega_0 \left(a-2b+c\right) + \frac{1}{6} \left( \omega_2 - \frac{1}{2} \right) \left( b - 2c + d \right). \end{align} The non-linear weights are given by: \begin{align} \omega_0 &= \frac{\alpha_0}{\alpha_0 + \alpha_1 + \alpha_2}, & \omega_2 &= \frac{\alpha_2}{\alpha_0 + \alpha_1 + \alpha_2} \\ \alpha_0 &= \frac{1}{\left(\epsilon + IC_0\right)^2}, & \alpha_1 &= \frac{6}{\left(\epsilon + IC_1\right)^2}, & \alpha_2 &= \frac{3}{\left(\epsilon + IC_2\right)^2}, \end{align} with $\epsilon = 10^{-6}$ and \begin{align} IS_0 &= 13(a-b)^2 + 3 (a-3b)^2,\\ IS_1 &= 13(b-c)^2 + 3 (b+c)^2,\\ IS_2 &= 13(c-d)^2 + 3 (3c-d)^2. \end{align} Time integration is realized with a fourth order four-stage Runge Kutta integrator. \par It has been shown that the resulting scheme is only third order accurate close to critical points (extrema) of the flow. In real world applications this is actually beneficial, because the scheme becomes more robust than a full fifth order scheme like WENO-Z \citep{2008JCoPh.227.3191B} that would fall back to protection fluxes instead.\par Magnetic fields are treated in a constrained transport staggered mesh approach following \citet{1998ApJ...509..244R}, which is formally only second order accurate. However, using the high order fluxes the scheme conserves magnetic energy density to fifth order (Jang et al. in prep.), which is of crucial importance for the small dynamo. For the complete description of the algorithm including eigenvectors we refer the reader to the full method papers Jang et al. in prep. and Donnert et al. in prep. \subsection{Wombat Implementation} {\small WOMBAT } is a hybrid parallel MPI/OpenMP code written in object oriented Fortran 2008 \citep{2017ApJS..228...23M}. It is developed in collaboration with the programming environment group at Cray Inc., a major manufacturer of super computers. \par The code initially divides the computational domain $\Omega$ into rectangular sub-domains (\emph{domains}) residing each on a separate MPI rank. Each sub-domain is further divided into independent pieces of work, rectangular \emph{patches}, usually of size $18^D-32^D$ zones, where $D$ is the number of dimensions. Patches and domains are implemented using Fortran 2008 objects, which makes the code highly modular. Patches carry ghost zones, domains carry ghost domains, which overlap with neighbouring MPI ranks and facilitate communication. Their size is tunable. If a patch is exported into a ghost domain, it is communicated to the according MPI rank owning the domain. This facilitates load-balancing among ranks. Ghost/boundary zones of patches are overlapping zones between neighbouring patches that need to be communicated for the patch to be computed. Once a patch has received all its boundary zones, it can be computed (\emph{resolved}) independently for the rest of the world grid. Depending on the solver, this may happen many times per time step. \par {\small WOMBAT } implements communication of ghost zones and domains using fully one-sided thread-asynchronous MPI-RMA with \mbox{MPI\_THREAD\_MULTIPLE}. The scheme is continuously improved and an active research topic for the exa-scale by performance engineers are Cray Inc. To minimize OpenMP overhead the code uses a single OpenMP parallel region, in which all threads perform work and communication independently and asynchronously from each other. This requires the MPI library to support OpenMP lock-free communication. Patches internal to a rank are resolved in memory and can be immediately computed. Patches with boundary zones overlapping with another rank are communicated: The boundary zones are copied (''packed'') into mailboxes by the neighbouring rank, communicated with \mbox{MPI\_Get}, unpacked on the local rank and eventually the patch is resolved. The status of the mailbox (empty, packed) is communicated with 8 Byte signals (the ''heartbeat''). The heartbeat signals are always issued and facilitate a weak form of synchronization among ranks. Every step of the communication (packing, heartbeat signal, unpacking, resolution) can be done by any thread on the rank at any time. Thus the scheme achieves computation/communication overlap at the thread level and can react to imbalance from work decomposition or network contention on the machine. \par We have implemented the WENO scheme into the {\small WOMBAT } framework as a separate solver module. At the beginning, the state vector grid of the resolved patch is copied into thread local memory. In multiple dimensions, it is flattened into a one dimensional array to increase vector length. This introduces memory overhead of about 25 Megabytes per thread and rank for $18^3$ zone patches. The whole algorithm operates on single index arrays, thus all loops are SIMD vectorized by the compiler. This is necessary to achieve a significant fraction of peak double precision performance on modern CPUs and greatly simplifies future GPU ports of the algorithm. In multiple dimensions, the grid has to be swept along the y-direction and z-direction. We implement the sweeps by re-ordering the data arrays, which corresponds to rotations of the grid in three dimensions. The resulting fluxes are then rotated back into the original layout, so that final updates can be performed. At the end of a sub-step, the grid is saved into the multi-index arrays in global memory.\par Per time step, the boundaries of 3 zones are communicated 8 times, i.e. the patches is passed 8 times until it is resolved. The WENO and CT scheme require one pass each per sub-step. \section{Results} \subsection{Fidelity} \begin{figure} \centering \includegraphics[width=0.45\textwidth]{img/MHDWaves_full_1d.pdf} \includegraphics[width=0.45\textwidth]{img/BLoop_Energy_2d.pdf} \caption{Left: L1 error of the wave convergence test from in one dimension \citet{2008JCoPh.227.4123G}. Alfv\'{e}n mode in red, entropy mode in blue, fast mode in the green and slow mode in purple. Right: Evolution of magnetic energy in the advection of a field loop test.} \label{fig.1d} \end{figure} We demonstrate the fidelity of the WENO MHD algorithm with a number of test cases. In figure \ref{fig.1d}, we show the convergence test involving advecting small ($10^{-5}$) perturbations in the four MHD waves across a one dimensional domain, following \citet{2008JCoPh.227.4123G}. All waves converge at fifth order down to L1 errors below $10^{-11}$. For the compressive fast and slow modes, wave steepening prevents further convergence in this test. Entropy and Alf\'{e}n mode converge to $10^{-13}$, where the roundoff error from 8 byte floating point precision prevents further convergence. A comparison with results from \texttt{ATHENA} \citep{2008JCoPh.227.4123G} shows that the WENO5 scheme improves on the CTU+CT by more than a factor of two in effective resolution, i.e. \texttt{ATHENA} reaches L1 errors of $10^{-11}$ at 512 zones, WENO5 reaches theis L1 error at 64 zones. \par \begin{figure} \centering \includegraphics[width=0.9\textwidth]{img/OrszagTang_comp.pdf} \\ \caption{Density in the 2D Orszag-Tang Vortex test. Left: WENO5 solution with $128^2$ zones. Right: TVD solution with $256^2$ zones.} \label{fig.tests} \end{figure} \begin{figure} \centering \includegraphics[width=0.9\textwidth]{img/OrszagTang_Slice_Comp.pdf} \caption{Pressure slices in the 2D Orszag-Tang Vortex test at $y=-0.1875$ (left) and $y=-0.073$ (right). TVD solution with $256^2$ zones (red line), WENO5 solution with $128^2$ zones (black squares).} \label{fig.tests3} \end{figure} In figure \ref{fig.tests} we show the density of the 2 dimensional Orszang-Tang vortex test from \citet{Orzang,2000JCoPh.161..605T,2008ApJS..178..137S}. The left panel shows the result from a run with {\small WOMBAT }'s new WENO5 implementation with $128^2$ zones. On the right the result from the run with 2nd order TVD+CTU implementation at $256^2$ zones. No difference is visible by eye. In figure \ref{fig.tests3} we show pressure slices of the test at $t=0.5$. Again WENO5 with $128^2$ zones resolves the complex pressure topology equally or better than the TVD+CTU result with $256^2$ zones. In particular, the pressure blip at $y=-0.1875, x=-0.45$. This demonstrates that the higher fidelity of the WENO5 algorithm effectively doubles the resolution of a MHD simulation. At the same time, a WENO5 run in 3D uses only an 8th of the memory and 75\% of the runtime of a TVD+CTU run at double its resolution. Thus we argue that fifth order WENO5 represents an \emph{optimal compromise between algorithmic fidelity and computational expense}. This result is in line with previous work on WENO3, WENO5 and WENO9: \citet{2003PhRvE..68d6709Z} found that every increase in order effectively doubles the resolution of the scheme. \par \begin{figure} \centering \includegraphics[width=0.9\textwidth]{img/Kelvin_Helmholtz_Density_comp.pdf} \caption{Density in the 2D Kelvin Helmholtz test at time $t=2$. Left: WENO5 solution with $64\times128$ zones. Right: TVD solution with $128\times256$ zones. } \label{fig.tests2} \end{figure} In figure \ref{fig.tests2}, we show a 2D Kelvin Helmholtz instability test following the ICs of \citet{2016MNRAS.455.4274L} who use a sinusoidal perturbation ($A = 0.01, P=10,a=0.05, \sigma=0.2, z_1=0.5,z_2=1.5, u_\mathrm{flow}=1, \Delta\rho = 1$) at $t=2$. We note that the with these parameters the instability is not resolved in both runs. \par The left panel shows is the WENO5 solution with $64\times128$ zones. The right panel shows the TVD+CTU solution with twice the resolution. In the WENO5 simulation, the instability grows as expected and develops the famous vortices as well as fluctuations away from the shearing layer. In contrast, the second order run, does not show well developed vortices and substantially more diffusion. The growth of the instability is significantly slowed. This test shows that WENO5 resolves instabilities close to the resolution scale significantly better than a lower order code at twice the WENO5 resolution. \par In figure \ref{fig.1d} right, we show the time evolution of magnetic energy in the field loop advection test from \citet{2008ApJS..178..137S}. Runs at $32^2, 64^2, 128^2$ zones in red, blue, green respectively are shown with WENO5 (solid lines) and with TVD+CTU (dashed lines). Magnetic energy is conserved much better in the WENO5 case, due to the fifth order fluxes in the scheme. A comparison with the \texttt{ATHENA} results presented in \citet{2008JCoPh.227.4123G} again show that WENO5 roughly doubles the effective resolution, e.g. at $t=1$ \texttt{ATHENA} with 128 zones conserves 95\% of magnetic energy (their figure 1), just as WENO5 with 64 zones. We argued above that magnetic field growth close to the resolution scale is the crucial mechanism for magnetic field amplification in galaxy clusters. Thus this result demonstrates the advantages of using a highly accurate CT scheme in cluster MHD simulations. \par \subsection{Efficiency} \begin{figure} \centering \includegraphics[width=0.49\textwidth]{img/Patchtest_BW.pdf} \includegraphics[width=0.49\textwidth]{img/WeakScaling_HazelHen.pdf} \caption{Left: Performance in Millions of zones per second per node for different patch sizes on 27 nodes with Intel Broadwell CPUs for a problem of approximate $1024^3$ zones. Right: Weak scaling on the Cray XC40 ''Hazel Hen'' at HLRS Stuttgart, Germany. Shown is the mean time per update of 100 updates over the number of nodes/cores. Error bars indicate the largest and smallest timestep of 100, variations are due to node variablity of the shared system.} \label{fig.perf} \end{figure} On a single Broadwell core, the WENO5 implementation is found to perform at about 4.9 GFlops or 20\% of double precision peak, due to the high degree of SIMD vectorization of the code. On a single Broadwell node, the code performs at 7.2\% of peak, or 1.3 GFlops per core.\par We showcase the performance of the implementation on multiple nodes, by running a cache blocking study on a Cray Inc. development system. To this end, we vary the patch size of a problem at roughly $1024^3$ zones on 27 nodes with Aries interconnect and 2x18 core Intel Broadwell CPUs per node. We vary the patch size between $4^3$ and $72^3$ zones and the number of MPI ranks per node between 2 and 36, which corresponds to 18 and 1 OpenMP threads. The resulting throughput in Million zones per second per node is shown in figure \ref{fig.perf} left. The optimal patch size is found to be about $18^3$ zones, performing at 0.6 Million zones per second per node. At this patch size, most of the patch fits the level 3 cache of the Broadwell CPU,but not the level 2 cache. We note that {\small WOMBAT }'s TVD+CTU scheme has an optimal patch size of $32^3$ on the same system and a strong drop in throughput towards larger patch sizes. Here our implementation approaches optimal performance again. We speculate that because TVD+CTU does not implement array flattening in the algorithm, the hardware pre-fetching is not efficiently keeping data in the cache hierarchy, leading to the drop in performance. In contrast, the flattened array in the WENO5 implementation lead to stride 1 array accesses throughout the algorithm, which allows the pre-fetcher to keep data in the cache hierarchy efficiently for large patch sizes. Nonetheless, smaller patches are highly desirable for load balancing and thus $16^3-20^3$ is the optimal patch size for WENO5 applications.\par In weak scaling tests, the problem size is increased alongside the machine size to expose the degree of non-parallelizeable overhead in a program \citep{Amdahl:1967:VSP:1465482.1465560}. We chose a small problem size with a runtime of 2.4 sec per step to clearly expose communication overhead at scale. On the right of figure \ref{fig.perf}, we show the time per update / weak scaling of the WENO5 implementation on the Cray XC40 supercomputer ''Hazel Hen'' at the HLRS in Stuttgart. The system was \emph{not} dedicated to the test, thus the interconnect is subject to the usual contention seen on large shared systems in practice. From 4 nodes / 96 cores onwards, the step time is found relatively constant between 2.4 and 2.5 seconds per step with a 10\% scatter among time steps, represented by the error bars. This scatter is typical for Haswell system of this size. We note that smallest data point corresponds to workstation size machine with 48 cores. The largest run used 4096 nodes/ 96.000 cores, which is more than half of the machine. With a problem size of 4.5 Billion zones such a run would resolve the Alfv\'{e}n scale in a triple zoomed cosmological simulation of a galaxy cluster. \section{Conclusions} We have presented a new implementation of a fifth order WENO5 scheme for constrained transport magneto-hydrodynamics in the {\small WOMBAT } framework. Our code is aimed at the simulation of cosmic magnetic fields in galaxy clusters, in particular the turbulent small-scale dynamo in the ICM and its Faraday tomography signal. We have motivated the need for new community codes for this particular problem as supercomputers enter the exasflops regime. We have given a concise overview of the WENO5 algorithm and the implementation in {\small WOMBAT }. Finally we shown a few code tests with the new code and argued that the algorithm represents an efficiency optimum as it doubles the effective resolution compared to second order codes common in the field today. We have also shown that given the same resolution, WENO5 resolves instabilities better than second order TVD+CTU and improves on magnetic energy conservation. Finally we have shown cache optimization tests and demonstrated excellent weak scaling of the code up to realistic problem sizes of 4.5 billion zones on a current Cray XC40 supercomputer. Thus we are confident that accurate predictions of the magnetic field distribution in galaxy clusters from the small scale dynamo with resolved Alfv\'{e}n scale are within reach in the next 2 years. \acknowledgments{We would like to thank the two referees for constructive criticism that improved the paper significantly. This research has received funding from the People Programme (Marie Sklodowska Curie Actions) of the European Unions Eighth Framework Programme H2020 under REA grant agreement no 658912, ”Cosmo Plasmas”. Access to the ’Hazel Hen’ at HLRS has been granted through PRACE preparatory access project ”PRACE 4477”. All graphs in the work have been produced using PGF and using the Julia\footnote{\url{julialang.org}} programming language. TWJ acknowledges support from the US NSF through grant AST1714205 } \reftitle{References} \externalbibliography{yes}
\section{Introduction} In recent times, the research interests on externally irradiated two dimensional (2D) Dirac material have grown significantly in many aspects among the research community. One of the remarkable aspect of this study lies in the ability of irradiation to modulate the electronic band structure and most importantly to generate topologically protected conducting edge modes with insulating bulk in 2D electronic systems (Floquet topological insulator)~\cite{PhysRevB.79.081406,lindner2011floquet,PhysRevB.85.125425, PhysRevB.84.235108,PhysRevB.85.205428,PhysRevB.89.235416,PhysRevB.94.081103,ezawa2013photoinduced, PhysRevB.89.121401,cayssol2013floquet}. The experimental observations of light induced topological insulating phase have also been reported~\cite{peng2016experimental,zhang2014anomalous, wang2013observation}. The importance of irradiation effects on 2D Dirac materials are not only limited to engineering the Floquet topological insulator, in fact it has also been proposed to modulate spin and valley degree of freedom in graphene~\cite{PhysRevB.84.195408}, $\alpha$-$T_3$ lattice~\cite{tarun}, $\rm MoS_2$~\cite{PhysRevB.90.125438} and emergence of Floquet edge states in germenene~\cite{tahir2016floquet}. Among the other applications of periodic driving, tuning the thermoelectric performance in $\rm MoS_2$~\cite{tahir2014tunable} and thin topological insulator~\cite{PhysRevB.91.115311}, $0$-$\pi$ phase transition in Josephson junctions of silicene~\cite{PhysRevB.94.165436} and Weyl semi-metal~\cite{PhysRevB.95.201115} etc. are also worth to be mentioned. Along the same line, several attempts have also been made to look into the electronic properties of semi-Dirac material under the influence of either circularly or linearly polarized light, in the form of irradiation~\cite{PhysRevB.94.081103,PhysRevB.91.205445,PhysRevB.97.035422}. The Semi-Dirac materials exhibit quadratic as well as linear band dispersion along two orthogonal momentum directions~\cite{banerjee2009tight,dietl2008new,PhysRevB.97.035422}. The lattice structure of this material mimics the monolayer graphene with two different hopping parameters $t_1$ and $t_2$, as shown in Fig.~\ref{lattice}. \begin{figure}[!thpb] \centering \includegraphics[height=2.5cm,width=0.5 \linewidth]{Fig1.png} \caption{(Color online) The hexagonal lattice geometry of a semi-Dirac material with different hoping parameters $t_1$ and $t_2$ is illustrated. In our case, the hopping amplitude between two nearest zigzag chains is two times stronger than the other i.e., $t_2=2t_1$. Two different colors are used to denote different strength of hopping parameters. On the other hand, two different colored bubbles (light red and light green) represent two sublattices.} \label{lattice} \end{figure} This kind of lattice has been fabricated into the three unit cell slab of $\rm VO_2$ confined within insulating $\rm TiO_2$. A special interest has been shown to the case of $t_2=2t_1$ which manifests the semi-Dirac band dispersion in the vicinity of single Dirac cone. By using an effective low energy Hamiltonian, a series of theoretical studies have been performed like collective excitations (plasmon)~\cite{PhysRevB.93.085145}, irradiation effects on electronic bulk band structure~\cite{PhysRevB.94.081103,PhysRevB.91.205445}, optical properties~\cite{PhysRevB.97.035422,ales}, disorder effects~\cite{sriluckshmy2018interplay}, interaction effects\cite{interaction}, Landau-Zener oscillations\cite{PhysRevB.96.045424} and Landau level formation in some specific geometry~\cite{kush_arxiv} etc. Unlike the graphene case where external irradiation can open up a gap~\cite{PhysRevB.79.081406}, the Floquet band structure of the semi-Dirac material remains gapless within high frequency limit as reported in Ref.~[\onlinecite{PhysRevB.91.205445}]. On the other hand, a topological phase transition can take place under the consideration of a Haldane type mass term in such material, as predicted in Ref.~[\onlinecite{PhysRevB.94.081103}]. These are the two works which have recently addressed the issue of how irradiation affects the electronic band structure within the high frequency approximation. In this article, we study the quantum transport properties of a semi-Dirac material, exposed to a circularly polarized light. By using Floquet scattering matrix formalism~\cite{PhysRevB.60.15732}, we compute different scattering amplitudes and show that the transmission probabilities through different Floquet side bands are monotonically increasing with the strength of the irradiation instead of frequency. Although it was pointed out earlier that the irradiation cannot open a gap in semi-Dirac material~\cite{PhysRevB.91.205445} within the high frequency limit, we reveal in our work that beyond this limit a gap indeed opens up in the Floquet quasi-energy spectrum for non-zero values of momentum {\it i.e., }~away from the Dirac point. Moreover, unlike the graphene case where the gap parameter is a constant mass term~\cite{PhysRevB.79.081406}, it is not constant in semi-Dirac material. Rather, it depends on the angular orientation of the momentum. Furthermore, several dips appear in the angle averaged conductance spectrum which are in fact due to the effect of irradiation originating from the higher order correction to the Floquet spectrum. The earlier prediction that no gap appears under the influence of an irradiation within high frequency limit, is true only for particular angular orientation of momentum which is also confirmed through non-zero conductance dip at undoped situation. This is in contrast to the case of graphene where zero conductance sharp dip appears. This is due to the fact that external irradiation can induce a momentum independent constant mass term in graphene, which yields a sharp conductance dip~\cite{PhysRevB.96.245404}. We also show that the zigzag nanoribbon of this material, without any irradiation, exhibits a pair of decoupled edge modes which is unlikely to appear in monolayer graphene where edge modes merge into the bulk at two valleys. However, if the ribbon is exposed to the irradiation these edge modes no longer remain fully separated from the bulk. Finally, we also carry out the analysis of conductance behavior through the nanoribbon geometry of an irradiated semi-Dirac material. We observe similar conductance dips. However, the overall amplitude of the conductance remains less sensitive to the location of the chemical potential, except at the dips. This arises due to the very slow variation of the number of transverse edge modes crossing through the chemical potential. The remainder of the paper is organized as follows. In Sec.~\ref{sec2}, we introduce the low energy effective Hamiltonian and corresponding band structure with and without the presence of external irradiation. The Floquet scattering formalism and conductance calculation for the bulk semi-Dirac material are presented in Sec.~\ref{sec3}. On the other hand, the Sec.~\ref{sec4} is devoted to the discussion of band spectrum and conductance features of a nanoribbon geometry both in absence and presence of the periodic driving. Finally, we summarize and conclude in Sec.~\ref{sec5}. \section{Model Hamiltonian and band dispersion}\label{sec2} \subsection{Non-irradiated case} In this subsection, we discuss the basic features of the band structure when the system is not exposed to the external irradiation. We begin with the single particle low energy effective model Hamiltonian, based on the tight binding model description~\cite{PhysRevB.94.081103,banerjee2009tight,dietl2008new}, as \begin{equation} H_0=\frac{p_y^2}{2m^{*}}\sigma_x+v_{_F}p_x\sigma_y\ , \end{equation} where the effective mass term $m^{\ast}$ and the velocity $v_F$ can be expressed explicitly in terms of tight-binding model parameters as $v_F=3ta/\hbar$ and $m^{*}=2\hbar/(3ta^2)$. Here, $a$ and $t=t_{1}$ are the lattice constant and one of the hopping parameters, respectively. The Pauli matrices ${\bf\sigma}\equiv\{\sigma_x,\sigma_y\}$ denote pseudo sublattice spin index. The $2$D momentum operator is denoted by ${\bf p}\equiv\{p_x,p_y\}$. \begin{figure}[!thpb] \centering \includegraphics[height=5cm,width=0.8 \linewidth]{Fig2.pdf} \caption{(Color online) Anisotropic energy band dispersion of a semi-Dirac material is shown for the non-irradiated case. Here the momentum axes are normalized by $k_0=10^{10}m^{-1}$.} \label{band_dis} \end{figure} The energy band dispersion of this semi-Dirac material can be obtained as \begin{equation}\label{band} E_{k_x,k_y}=\lambda\sqrt{(\hbar v_{_F} k_x)^2+\left(\frac{\hbar^2 k_y^2}{2m^{\ast}}\right)^2}, \end{equation} where $\lambda=\pm$ is the band index and the $2$D momentum vector is given by ${\bf k}=\{k_x,k_y\}$. Note that, the energy dispersion is quadratic along $k_y$ direction and linear along $k_x$ direction, justifying the nomenclature of such materials as semi-Dirac material. A contour plot of the band dispersion is demonstrated in Fig.~\ref{band_dis} which indicates the anisotropic band structure of such material. \begin{figure*} {\includegraphics[width=.33\textwidth,height=5cm]{Fig3a.pdf}} \hspace{-2em} {\includegraphics[width=.33\textwidth,height=5cm]{Fig3b.pdf}} \hspace{-2em} {\includegraphics[width=.33\textwidth,height=5cm]{Fig3c.pdf}} \caption{Floquet quasi energy spectrum is illustrated as a function of $k~(=\sqrt{k_{x}^{2} + k_{y}^{2}})$ for three different angular orientation of momentum $\theta~(=\tan^{-1}(k_y/k_x)$): (a) $\theta=0$ (b) $\theta=\pi/5$ and (c) $\theta=\pi/3$. The quasi energy and wave vector are in units of $\hbar\omega$ and $l_\omega^{-1}=\omega/v_F$, respectively. Here, we consider the irradiation strength to be $\beta=0.3$.} \label{quasi_energy} \end{figure*} \subsection{Irradiated case} This subsection is devoted to address the effect of irradiation on the band structure of the semi-Dirac material via the low energy effective Hamiltonian. We consider a time dependent periodic perturbation as irradiation under which the dynamics of the charge carriers can be described by the Floquet theory~\cite{RevModPhys.89.011004}. This is analogous to the Bloch's theorem about the electronic motion in presence of a space dependent periodic potential. The irradiation is considered to be a circularly polarized light which can be expressed as a vector potential ${\bf A}=A_0[\cos(\omega t)\hat{x}+\sin(\omega t) \hat{y}]$. Here, $\omega$ and $A_0$ are the frequency and amplitude of the irradiation, respectively. To include this vector potential into the low energy effective Hamiltonian, we use the Peiere's substitution ${\bf p\rightarrow (p+eA)}$ and obtain the irradiated Hamiltonian as \begin{equation} H_{T}=H_{0}+\mathcal{H}_{1}\sigma_{x}+\mathcal{H}_{2}\sigma_y\ , \end{equation} where \begin{equation} \mathcal{H}_1=\left[Fk_y\cos(\omega t)+G\{1-\cos(2\omega t)\}\right]\ . \end{equation} and \begin{equation} \mathcal{H}_{2}=R\sin(\omega t)\ . \end{equation} with $F=eA_0/m^{*}$, $G=(eA_0/2m^{*})^2$ and $R=eA_0v_{_F}$. To solve the above Hamiltonian, we employ the Floquet formalism which infers that the system under the time dependent periodic perturbation exhibits a complete set of solutions of the form $\Psi({\bf r},t)=\phi({\bf r,t})\exp(-i{\epsilon } t/\hbar)$, where $\lvert\phi({\bf r},t+T){\rangle }=\lvert\phi(\bf r,t){\rangle }$ is the corresponding Floquet states and ${\epsilon }$ is the quasi energy~\cite{RevModPhys.89.011004}. Here, $T$ is the periodicity of the perturbation. Now, we can directly substitute the Floquet eigen states into the time dependent $\rm Schr\ddot{o}dinger$ equation and obtain a time independent $\rm Schr\ddot{o}dinger$ type equation $\hat{H}_{F}\phi({\bf r, t})={\epsilon }\phi({\bf r, t})$ with the Floquet Hamiltonian $\hat{H}_{F}=\hat{H}_0-i\hbar(\partial/\partial t)$. The Floquet eigen states can be further expressed in the Fourier expansion as~\cite{RevModPhys.89.011004} \begin{equation} \phi({\bf r, t})=\sum_{n}\phi_{n}({\bf r,t})e^{in\omega t}\ . \end{equation} where $n$ denotes the Floquet modes or side bands. Hereafter, we discuss the Floquet band structure of the irradiated semi-Dirac materials in two different regimes of frequency, $\omega$. \subsubsection{High frequency limit:} Here, we briefly review the band structure of the semi-Dirac material within the high frequency limit which has been previously considered in Ref.~[\onlinecite{PhysRevB.91.205445}]. In this limit, the irradiated Hamiltonian can be recast to an effective Hamiltonian as~\cite{PhysRevB.91.205445} \begin{equation}\label{eff} H_{eff}\simeq H_0+\frac{[H_{-1},H_{+1}]}{\hbar\omega}\ . \end{equation} where the second term arises due to the irradiation and \begin{equation} H_{m}=\frac{1}{T}\int_{0}^{T}dt e^{-im\omega t}H(t)\ . \end{equation} with $H_{+1}=H_{-1}^{\dagger}=(Fk_y\sigma_x-iR\sigma_y)/2$. Incorporating these terms in Eq.(\ref{eff}), the effective Hamiltonian can be found to acquire a direction dependent mass term as $-\eta[(eA_0)^2v_Fk_y/(m^{*}\hbar\omega)] \sigma_z$ with $\eta=+(-)$ denotes left (right) circularly polarized light. The corresponding energy eigen value can be subsequently written as \begin{equation} {\epsilon }=\pm\sqrt{\left(\frac{k_y^2}{2m^{*}}\right)^2+(\hbar v_F k_x)^2+\left(\eta\frac{e^2A_0^2v_Fk_y}{m^*\hbar\omega}\right)^2}. \end{equation} Note that, the mass term vanishes at $k_{y}=0$. {\it i.e., } irradiation cannot open up a gap in the Floquet band structure. This was in fact the main claim of Ref.~[\onlinecite{PhysRevB.91.205445}]. However, we emphasize here that a higher order term ($G=[eA_0/2m^{*}]^2$) in the total irradiated Hamiltonian has been ignored. Note that the high frequency results, discussed in Ref.~[\onlinecite{PhysRevB.94.081103}], is presented for a photoinduced vector field of the form $A=A_0[\sin(\omega t), \sin(\omega t+\phi)]$. To recover the result of circularly polarized light, one need to set $\phi=\pi/2$. \subsubsection{Beyond the high frequency limit:} In this subsection, we investigate the full band structure of the semi-Dirac material beyond the high frequency approximation. Using the Fourier expansion of Floquet modes, we can write the time-independent eigen value problem as \begin{equation}\label{eveq} \sum_{n'}H_{F,nn'}\phi_{n}=\sum_{n'}[H_{0F,nn'}+\mathcal{V}_{F,nn'}]\phi_{n}={\epsilon } \phi_{n}\ . \end{equation} where the diagonal part of the Floquet Hamiltonian can be defined as \begin{equation} H_{0F,nn'}=\left[\frac{p_y^2}{2m^{\star}}\sigma_x+v_{_F}p_x\sigma_y-\mu+n'\hbar\omega\right]\delta_{nn'}\ . \end{equation} and the irradiation induced coupling Hamiltonian between different Floquet side-bands can be written as \begin{eqnarray} \mathcal{V}_{F,nn'}&&=[H_{+1}\delta_{n,n'-1}+H_{-1}\delta_{n,n'+1}]\nonumber\\&& +[H_{+2}\delta_{n,n'-2}+H_{-2}\delta_{n,n'+2}] \ . \end{eqnarray} Here, $H_{+2}=H_{-2}^{\dagger}=(eA_0)^2/4m^{*}$. Note that, to diagonalize the Floquet eigen value problem, we need to set a cut-off to the dimension of the Floquet space. For example, if we impose the cut-off to the Floquet side band at $N$, then the size of the matrix becomes $2(2N+1)\times 2(2N+1)$ dimensional including the sublattice degree of freedom $2$. In our present case, we consider $n=2$ for the analysis of quasi-energy and transport properties. This is a valid approximation, as the higher side-bands cause vanishingly small contribution to the transport. We show the quasi energy band spectrum in Fig.~\ref{quasi_energy} as a function of momentum $k=\sqrt{k_{x}^{2} + k_{y}^{2}}$ ($k_{x}=k\cos\theta, k_{y}=k\sin\theta$) for three different angular orientation of momentum $\theta=\arctan(k_y/k_x)$, which is obtained by numerically diagonalizing the Floquet Hamiltonian $H_{F,nn'}$ (see Eq.(\ref{eveq})). Also note that, the eigen value equation [Eq.(\ref{eveq})] is normalized by $\hbar\omega$ in order to diagonalize the Hamiltonian. This introduces two new parameters: $\beta=ev_FA_0/\hbar\omega$ defining the strength of the irradiation and a length scale $l_{\omega}=v_{F}/\omega$. A finite value of $\beta$ is required for gap opening in the spectrum. The quasi energy spectrum is gapless for $\theta=0$, whereas a finite gap appears for $\theta\ne 0$. However, note that even for $\theta\ne 0$, gap opening does not occur at $\epsilon=0$ for $k=0$ (Dirac point). This was also predicted earlier via high frequency approximation~\cite{PhysRevB.91.205445}. Another noticeable point here is that unlike the case of irradiated monolayer graphene~\cite{PhysRevB.96.245404} where gap opening occurs at the momentum values $k=\pm j\omega/2v_{F}$ ($j=1,2,3..$), here in semi-Dirac materials it depends on the angular orientation of the momentum. We would like to emphasize that the numerical results for the Floquet band structure (in the intermediate frequency regime), presented in Fig.~\ref{quasi_energy}, manifest that no gap opens at $k=0$ which was also predicted via the high frequency approximation in Ref.~[\onlinecite{PhysRevB.91.205445}]. However, note that the gap opening away from the Dirac point and other dynamical gaps which appear at $\epsilon=\pm\hbar\omega/2$, cannot be captured via the high frequency approximation. \section{Methodology and numerical results for the bulk transport}\label{sec3} In this section, we discuss the quantum transport properties through the irradiated bulk region of the semi-Dirac material by using Floquet scattering matrix formalism~\cite{PhysRevB.60.15732}. The relevant geometry is schematically depicted in Fig.~\ref{device}. The set up is composed of three different regions in which left and right regions are protected from the exposure of irradiation by placing a cover on it (as shown by grey color) while the middle region is illuminated by circularly polarized light. \begin{figure}[!thpb] \centering \includegraphics[height=6cm,width=0.95 \linewidth]{Fig4.png} \caption{(Color online) A schematic sketch of the device, composed of a semi-Dirac material, is demonstrated in the upper panel and scattering mechanism is shown in the lower panel of the figure. The central region of the above device is illuminated by circularly polarized light. The central region is attached to two reservoirs ($x=0$ and $x=L$) which are also comprised of the semi-Dirac material. The left and right regions are protected from any kind of effects of irradiation by placing a wall (grey color) on it.} \label{device} \end{figure} \subsection{Solving scattering problem using Floquet method} In order to solve the scattering problem, we employ the approach prescribed in Ref.~[\onlinecite{PhysRevB.60.15732}] which is very recently employed in graphene~\cite{PhysRevB.96.245404}. The non-irradiated left region is doped in such way that the chemical potential matches with the zeroth ($n=0$) Floquet side band inside the central irradiated region~\cite{PhysRevB.96.245404}. In such case, the incoming electron from the left region will be scattered inelastically among different Floquet side-bands inside the irradiated region by absorption/emission of photon process (see the lower panel of Fig.~\ref{device}). Subsequently, the reflection and transmission processes will occur from all Floquet bands. To proceed further, we need to obtain the Floquet states and momenta ($k_x$) of electrons scattered from each side band, for a particular $k_y$. To obtain that, we multiply $\sigma_y$ from the left side in Eq.(\ref{eveq}) and rearranging it we get \begin{equation}\label{kxx} \sum_{n}(Q_{0F,nn'}+Q_{VF,nn'})\phi_{n}=\hbar v_{_F}k_x\phi_{n}\ . \end{equation} where \begin{equation} Q_{0F,nn'}=\sigma_y\left[(\mu-n'\hbar\omega)-\frac{p_y^2}{2m^{\ast}}\sigma_x\right]\delta_{nn'}\ , \end{equation} and \begin{equation} Q_{V,nn'}=-\frac{\sigma_y}{2}(Fk_y\sigma_x-iR\sigma_y)(\delta_{n,n'-1}+\delta_{n,n'+1}) \ . \end{equation} The numerical diagonalization of Eq.~(\ref{kxx}) yields $2(2N+1)$ values of $k_x^{\nu}$ and eigen vectors $\phi_{n}^{\nu}$ with $\nu$ being the index of different eigen modes. Here, we set the quasi energy at $\epsilon=0$ which corresponds to the incident electron at the chemical potential of the left normal lead. The wave function for a given $\nu$ can be expressed as \begin{equation} \phi^{\nu}(x,t)\sim e^{ik_{x}^{\nu}x}\sum_{n=-N}^{N}\phi_{n}^{\nu}e^{-in\omega t}\ . \end{equation} which is a two component vectors composed of two sub-lattices. \begin{figure}[h] \centering \includegraphics[height=6cm,width=\linewidth]{Fig5.pdf} \caption{(Color online) The behavior of transmission probabilities through different Floquet side bands are illustrated as a function of angle of incidence in the left normal region (non-irradiated).} \label{trans} \end{figure} Note that, the momentum ($k_x^{\nu}$) can be real or imaginary depending on the location of the chemical potential in the left region. The imaginary momentum corresponds to the situation when the chemical potential lies inside the gap. This leads to the emergence of evanescent mode. On the other hand, the spectrum in the left/right non-irradiated region can be obtained in similar fashion but with zero strength of the irradiation as those regions are assumed to be free from the external light. However, the electrons which are scattered from the irradiated central region to the normal regions via different fictitious Floquet side-bands of the normal regions, are governed by the following eigen value equation \begin{equation} \left[\frac{p_y^2}{2m^{\ast}}\sigma_x+v_{_F}p_x\sigma_y\right]\phi_{n}=[\epsilon(\theta)-n\hbar\omega]\phi_{n} \ . \end{equation} As the side bands are decoupled from each other in the normal regions due to the absence of irradiation, the momentum of the scattered electrons in each artificial side band remains identical. Furthermore, the wave function of the incident as well as the reflected/transmitted electrons are given by \begin{equation} \phi_{n,\lambda}(x)=\frac{1}{\sqrt{2}} \left[\begin{array}{c} \lambda\{\it i.e., }^{-i\tilde{\theta}}\end{array}\right]e^{ik_{x}x}\ , \end{equation} where $\tan\tilde{\theta}=[\hbar k/(2m^{\ast}v_{_F})]\tan\theta\sec\theta$ with $\theta=\tan^{-1}(k_y/k_x)$. After substituting the tight-binding model parameters~\cite{PhysRevB.94.081103} for mass and Fermi velocity as $m^{\ast}=2\hbar/(av_{_F})$ and $v_{_F}=3ta/\hbar$, we obtain $\tan\tilde{\theta}=\tilde{k}\tan\theta/(4\cos\theta)$ with $\tilde{k}=ka$. \subsection{Boundary conditions at the interfaces} To solve the scattering problem we match the wave functions at the two interfaces $x=0$ and $x=L$. Here, $L$ is the length of the irradiated region. We assume that the electron is incident only from the $n=0$ Floquet band of the left non-irradiated region and after encountering inelastic scattering processes inside the irradiated region, it is either reflected or transmitted through all possible virtual Floquet side bands. Thus, there will be $(2N+1)$ reflected channels in the left region in which the wave function is given by \begin{equation} \Psi_{L}(x,t)=\left[\phi_{i}e^{ik_{x}x}+\sum_{n=-N}^{N}r_{n0}\phi_{r}e^{-i(k_{x}x+n\omega t)}\right]e^{-i{\epsilon } t}\ , \end{equation} \begin{figure*} {\includegraphics[width=.49\textwidth,height=6cm]{Fig6a.pdf}} {\includegraphics[width=.49\textwidth,height=6cm]{Fig6b.pdf}} \caption{(Color online) Conductance of the periodically driven bulk semi-Dirac material is demonstrated as a function of chemical potential for (a) $L=50$ (b) $L=100$. Here, the length and the chemical potential of the irradiated region is normalized by $l_w=v/\omega$ and $\hbar\omega$, respectively.} \label{cond_plot} \end{figure*} where the Floquet coefficients of the incident and reflected waves are $\phi_{i}=\left[\begin{array}{c}\lambda\{\it i.e., }^{-i\tilde{\theta}}\end{array}\right]$ and $\phi_{r}=\left[\begin{array}{c}\lambda\{\it i.e., }^{-i\tilde{\theta}_r}\end{array}\right]$ respectively. Here, $\tan\tilde{\theta}_r=\tan\tilde{\theta}~(\theta\Rightarrow\pi-\theta)$. The reflection amplitude corresponding to the $n$-th Floquet band is denoted by $r_{n0}$. The Floquet eigen states inside the irradiated region can be written as \begin{eqnarray} \Psi_{I}(x,t)=&&\sum_{\nu}a_{\nu}\phi^{\nu}(x,t)e^{-i{\epsilon } t}\nonumber\\ &&=\left[\sum_{\nu}a_{\nu}e^{ik_{x}^{\nu}x}\sum_{n=-N}^{N}\phi_{n}^{\nu}e^{-in\omega t}\right]e^{-i{\epsilon } t}\ . \end{eqnarray} On the other hand, the wave function in the right non-irradiated region is composed of only transmitted waves and can be written as \begin{equation} \Psi_{R}(x,t)=\left\{\sum_{n=-N}^{N}t_{n0}\phi_{r}e^{i[k_{x}(x-L)+n\omega t]}\right\}e^{-i{\epsilon } t}\ . \end{equation} Here, $t_{n0}$ represents the transmission amplitude via $n$-th band into the right normal region. The reflection and transmission amplitudes can be evaluated by matching the wave functions at the two interfaces which yields a set of linear equations as \begin{equation} \phi_{i}\delta_{n0}+r_{n0}\phi_{r}=\sum_{\nu}a_{\nu}\phi_{n}^{\nu}\ , \end{equation} and \begin{equation} \sum_{\nu}a_{\nu}\phi_{n}^{\nu}e^{ik_{x}^{\nu}L}=t_{n0}\phi_{t}\ . \end{equation} where $\phi_{t}=\phi_{i}$. \subsection{Scattering amplitudes and Conductance} In this subsection, we present the numerical results for ballistic transport through the irradiated semi-Dirac material for different strengths of driving. As mentioned earlier, we assume that the chemical potential in the left lead is set at such a position that the electrons can only be incident from the virtual $n=0$ Floquet band of the left lead and subsequently after entering into the irradiated region it encounters scattering into different Floquet bands via the inelastic scattering processes (absorption and emission). The reflection and transmission probabilities for a particular angle of incidence and energy of the incident electron are the sum over all reflection and transmission amplitudes via different Floquet bands. This can be written as \begin{equation} T(\theta,\mu)=\sum_{n=-N}^{n=N}|t_{n0}(\theta,\mu)|^2\ , \end{equation} and \begin{equation} R(\theta,\mu)=\sum_{n=-N}^{n=N}|r_{n0}(\theta,\mu)|^2\ , \end{equation} which satisfies the unitarity condition as $R(\theta)+T(\theta)=1$. Once the transmission amplitudes are evaluated, one can readily employ the Landauer-Buttiker formula to obtain the conductance by averaging over all possible angle of incidence as \begin{equation}\label{cond} G=\frac{e^2}{h}\int_{-\pi/2}^{\pi/2}\sum_{n=-N}^{N}d\theta |t_{n}(\theta,\mu)|^2\ . \end{equation} We present the behavior of transmission probabilities via different Floquet side bands in Fig.~\ref{trans}. Here, the incident electron is considered to be from the zeroth Floquet band ($n=0$) of the non-irradiated left lead. We consider three Floquet side bands inside the central irradiated region which is sufficient to preserve the probability conservation. The transmission probability via $n=1$ side band is shown for different strengths of irradiation $\beta$ (see Fig.~\ref{trans}). Note that, $\beta$ couples the two nearest side bands for which the transmission probability increases via $n=1$ side band as we enhance $\beta$. This happens due to one photon absorption process. As a result, this reduces the same in $n=0$ side band. The incident electron from the left lead at $n=0$ band can be transmitted/reflected through the same band $n=0$ which we call intra-band scattering whereas transmission/reflection through $n=1$ side band is termed as inter-side band scattering. The intra-band transmission probability can be $100 \%$ at normal angle of incidence ($\theta=0$) for $\beta=0$ due to the Klein tunneling. However, with the increase of $\beta$ the Klein process becomes suppressed resulting in enhancement of inter-band transmission probability. The reason can be attributed to the fact that, as the amplitude of the irradiation increases, the coupling strength between the two nearest Floquet side bands increases resulting in enhancement of the inter-band transmission probability. The driven conductance of the bulk semi-Dirac material is demonstrated in Fig.~\ref{cond_plot}. Here we use Eq.(\ref{cond}) to compute the conductance for two different lengths of the irradiated region. In Fig.~\ref{cond_plot}(a), the conductance is shown for different strengths of the periodic driving around chemical potential $\mu=0$ and $\hbar\omega/2$. These correspond to the gaps opening of the band dispersion, as shown in Fig.~\ref{quasi_energy}. Note that, although the Floquet spectrum is gapless at $k=0$ which is even confirmed in Ref.~[\onlinecite{PhysRevB.91.205445}] within the high frequency approximation, the band gap indeed appears for other values of $k$ (away from the Dirac point) which yields a dip in the angle averaged conductance at $\mu=0$. We would like to emphasize here that in case of graphene~\cite{PhysRevB.96.245404}, the location of gap appears to be at $k=\pm v_{F}/\omega$. On the contrary, in semi-Dirac material it depends on the angular orientation of the momentum as shown in Fig.~\ref{quasi_energy}. Some other conductance dips also arise at $\mu=\hbar\omega/2$ which correspond to the dynamical gap between two Floquet side bands. The qualitative features of the driven angle averaged conductance remain similar as we choose a different length of the central irradiated region (see Fig.~\ref{cond_plot}(b)). However, the conductance dips become more deeper due to enhanced probability of Floquet sub-band scattering as the length of the central region increases. Note that, the irradiation (circularly polarized light) can open-up a gap in graphene~\cite{PhysRevB.96.245404} at $k=0$ (Dirac point) which does not depend on angular orientation of momentum. This can result in rectangular shaped sharp conductance dips with almost zero values under the suitable strength of irradiation. On the other hand, the driven semi-Dirac material may not acquire a gap at $k=0$, in the $n=0$ band. However, the conductance dips still appear due to the gap opening at other $k$ values away from zero. Although, the conductance cannot be exactly zero in this case at $\mu=0$ as the semi-Dirac material still is metallic at $k=0$. Neverthless, around the dynamical gap $\mu=\pm\hbar\omega/2,\pm\hbar\omega$, the dips appear due to the gap opening between two nearest side bands. \section{Band dispersion and Transport through a nanoribbon geometry of semi-Dirac material}\label{sec4} In this section, we address the electronic and transport properties of this material for the nanoribbon geometry in presence of periodic driving. However, our discussion for the nanoribbon is restricted to zigzag case only due to its unique features over armchair one, as demonstrated in case of graphene~\cite{PhysRevB.89.121401}. \subsection{Non-irradiated ribbon:} \begin{figure}[!thpb] \centering \includegraphics[height=6cm,width=\linewidth]{Fig7.pdf} \caption{(Color online) Energy band dispersion of a semi-Dirac material based ZNR is demonstrated. The width of the ribbon is considered as $N=20$.} \label{ribbo_con} \end{figure} In order to find the energy band dispersion of a zigzag nanoribbon of semi-Dirac material, an effective difference equation can be constructed by employing an analogy to the case of an infinite one-dimensional chain~\cite{dutta,PhysRevB.92.035413}. To implement this, the nanoribbon can be considered as the composition of an array of the vertical rectangular unit cells (supercells). The width of the zigzag nanoribbon (ZNR) is determined by the number of atoms $N$ per unit cell. The effective difference equation of the ZNR takes the form as \begin{eqnarray} (E \mathcal{I}-\mathcal{E}) \psi_l=\mathcal{T} \psi_{l+1}+\mathcal{T}^{\dagger} \psi_{l-1}\ , \end{eqnarray} where \begin{eqnarray} \mathcal{E}=\sum_{\alpha}\sum_{\langle i, j\rangle}t_{\alpha}c^{\dagger}_{i,\alpha}c_{j,\alpha}+h. c\ , \label{HNR} \end{eqnarray} is the on-site energy matrix with $\alpha=1,2,3$ and \begin{align} \psi_l &=\begin{bmatrix} \psi_{l,1}\\ \psi_{l,2} \\ \vdots \\ \psi_{l,N} \end{bmatrix}\ , \end{align} Here, $\mathcal{T}$ is the nearest-neighbor hopping matrices of the unit cells. The vertical supercell~\cite{PhysRevB.92.035413} is denoted by the $l$ index and $\mathcal{I}$ represents the unit matrix being of dimension $N \times N$. The zigzag chain of the ribbon is translationally invariant along the $x$-direction, which yields the momentum ($k_x$) along this direction to be conserved and acts as a good quantum number. Finally, following the Bloch's theorem the total Hamiltonian of the zigzag nanoribbon can be expressed as \begin{equation}\label{ribb} (E \mathcal{I}-\mathcal{E})=\mathcal{T} e^{i k_x a}+\mathcal{T}^{\dagger} e^{-i k_x a}\ . \end{equation} where $a$ is the unit cell separation. Here, $\mathcal{T}$ and $\mathcal{T}^{\dagger}$ describe the coupling of a unit cell with the right and left adjacent supercells, respectively. The above equation can be solved numerically to obtain the energy dispersion of the nanoribbon. \begin{figure}[!thpb] \centering \includegraphics[height=3.0cm,width=0.45\linewidth]{Fig8.png} \caption{Schematic of the three nearest neighbors, denoted by $2$, $3$ and $4$, are connected to $1$.} \label{atoms} \end{figure} \begin{figure*} {\includegraphics[width=.32\textwidth,height=6cm]{Fig9a.pdf}} {\includegraphics[width=.32\textwidth,height=6cm]{Fig9b.pdf}} {\includegraphics[width=.32\textwidth,height=6cm]{Fig9c.pdf}} \caption{(Color online) Band dispersion and conductance are illustrated for there cases (a) $t_2=2t_1$ (semi-Dirac) (b) $t_2=1.5t_1$ (c) $t_2=t_1$ (graphene).} \label{cond_plot} \end{figure*} The energy band dispersion of the ZNR, based on the semi-Dirac material, is shown in Fig.~\ref{ribbo_con}. This indicates that the band dispersion exhibits a pair of edge modes which are fully separated from the bulk. This is in contrast to the case of ZNR based on monolayer graphene~\cite{RevModPhys.81.109} or silicene~\cite{PhysRevB.92.035413} where the edge modes are coupled to the bulk at the two valleys. Moreover, unlike the graphene, ZNR of the semi-Dirac material possesses a sufficient gap ($>1.5t_1$) which can be attributed to the presence of unequal hopping parameters in the lattice structure. Note that, the appearance of edge modes in Fig.~\ref{ribbo_con} exhibit quite similar nature as in the case of graphene nanoribbon. In both the materials, semi-Dirac and graphene, the edge modes are strongly dependent on the edge geometry/commensurability of the lattice. Apart from this, in both the materials the bulk is always gapless and these edge modes are not protected against the presence of disorder etc. Hence, they don't have a topological character. Moreover, we would like to reveal how the band structure as well as the conductance regain the properties of graphene with the variation of $t_2$ from $2t_1$ to $t_1$ via $1.5t_1$. The corresponding conductances are evaluated numerically by using standard recursive Green's function formalism~\cite{dutta,PhysRevB.92.035413} which is given by \begin{equation} G=\frac{e^2}{h}{\rm Tr}[\Gamma_L(E)G_{D}^{\dagger}\Gamma_R(E)G_{D}(E)]\ , \end{equation} where $\Gamma_{L/R}(E)=i[\Sigma_{L/R}(E)-\Sigma^{\dagger}_{L/R}(E)]$ with $\Sigma_{L/R}(E)$ is the self energy of the left (right) lead. Hence, \begin{equation} G_{D}=1/[E-\mathcal{E}-\Sigma_{L}-\Sigma_{R}]\ . \end{equation} Here, $\mathcal{E}$ is the on-site Hamiltonian matrix (see Eq.(\ref{HNR})). The band dispersion and corresponding conductances are demonstrated in Fig.~\ref{cond_plot} for three different cases. This exhibits smooth transmutation from semi-Dirac to graphene via $t_2=1.5t_1$. It also highlights how two valleys evolve from single valley {\it i.e., }~from semi-Dirac to graphene and how conductance plateaus change from $t_{2}=2t_{1}$ to $t_{2}=t_{1}$ case. Note that the conductance (in units of $e^2/h$) corresponding to the edge modes in semi-Dirac material is clearly separated from the bulk conductance as shown in Fig.~\ref{cond_plot}(a). This feature confirms the complete isolation of the edge modes from the bulk. Another noticeable point here is that the conductane steps are not increasing in ascending order due to the peculier nature of the band structure. On the other hand, in graphene, it increases regular stepwise corresponding to each transverse mode (see Fig.~\ref{cond_plot}(c)). \subsection{Irradiated ribbon} In this subsection, we include the effect of irradiation in the band structure of the semi-Dirac material based ZNR. To obtain the band dispersion we diagonalize the following Floquet tight-binding Hamiltonian as \begin{equation}\label{floq_ribb} H_{F}=\left[\left(\mathcal{\tilde{E}}+\tilde{\mathcal{T}}_{F}e^{i k_x a}+ \tilde{\mathcal{T}}_{F}^{\dagger} e^{-i k_x a}\right)_{N\times N}-n\hbar\omega\mathcal{I} \delta_{n,n'}\right]_{N\times n}\ . \end{equation} in the Floquet extended space. The size of the Floquet Hamiltonian is $N\times n$ where $n$ denotes the Floque replicas (side bands), representing different number of photons. The above Hamiltonian is a block matrix where each block is of $N\times N$ dimension. The Floquet on-site energy is now denoted by $\mathcal{\tilde{E}}$. The effect of irradiation on the band structure can be included by modifying the hoping parameters between $i^{\rm th}$ and $j^{\rm th}$ sublattice as \begin{equation} t_{ij}=t_{ij}\exp\left[i\frac{2\pi}{\phi_0}\int_{r_i}^{r_j}A(t).dr\right]\ . \end{equation} After integrating out the time part, the three nearest neighbor hopping parameters that are left, can be written as \begin{equation} t_{12}=t_{1}e^{im\pi/6}\mathcal{J}_{-m}(-z)\ , \end{equation} \begin{equation} t_{13}=t_{1}e^{i5m\pi/6}\mathcal{J}_{-m}(z)\ , \end{equation} and \begin{equation} t_{14}=t_{2}e^{-im\pi/2}\mathcal{J}_{-m}(-z) \ . \end{equation} Here, $\mathcal{J}_{m}(z)$ represents the Bessel function of the first kind of order $m (=n-n')$. The schematic of the three nearest neighbor hopping parameters, between $i$ and $j$ with $i=1$ and $j=2,3,4$, is shown in Fig.~\ref{atoms}. The above mentioned emergent hopping parameters are taken into account in Eq.(\ref{floq_ribb}) in order to numerically diagonalize it in the extended Floquet space. The quasi energy band dispersion is obtained numerically and depicted in Fig.~\ref{floq_ribbo_band}. Here, the dimensionless parameter $z=2\pi A_0 a/\phi_0$ denotes the strength of periodic driving with $\phi_0$ being the magnetic flux quanta. In our analysis, the number of Floquet replicas (side bands) are considered to be $n=2$. This is sufficient to capture the relevant features of the band structure. Any further enhancement of the number of side bands only assembles more quasi energy modes without producing any new qualitative features to the band structure. Unlike the case of non-irradiated band structure of ZNR (see Fig~\ref{ribbo_con}), the edge modes (sky blue lines) in the irradiated case are not fully separated from the bulk. Also the dynamical band gap, at $\hbar\omega/2$, appears to be vanishingly small (see Fig.~\ref{floq_ribbo_band}(a)). Moreover, the band gap can be further reduced to be almost zero if we increase the amplitude of the irradiation, as shown in Fig.~\ref{floq_ribbo_band}(b). Hence, one can infer that by applying external periodic driving the decoupled edge modes can be enforced to couple the bulk in semi-Dirac material. Note that, in graphene nanoribbon, the irradiation (circularly polarized light) can give rise to topological chiral Floquet edge modes~\cite{PhysRevB.89.121401} around the dynamical gap at $\hbar\omega/2$. However, such feature is absent in case of semi-Dirac ZNR. The reason can be attributed to the fact that circularly polarized light can open up a gap into the bulk of graphene, but not in semi-Dirac material ($k=0$ point is always gapless). Hence, Floquet edge modes in semi-Dirac material do not seem to have a topological character. Nevertheless, we also check that by setting $t_2=t_1$, the chiral Floquet edge modes of graphene can be recovered similar to the non-irradiated case. \begin{figure*}[!thpb] {\includegraphics[width=.49\textwidth,height=6cm]{Fig10a.pdf}} {\includegraphics[width=.49\textwidth,height=6cm]{Fig10b.pdf}} \caption{Quasi energy band dispersion of the irradiated semi-Dirac ZNR geometry is illustrated for (a) $z=0.03$ (b) $z=0.05$. Here $z=2\pi a_{cc}A_0/\phi_0$ describes the strength of the external periodic driving. The width of each supercell is given by $N=600$ and $\hbar\omega=0.2t_1$.} \label{floq_ribbo_band} \end{figure*} \begin{figure}[!thpb] \centering \includegraphics[height=6cm,width=\linewidth]{Fig11.pdf} \caption{(Color online) The conductance spectrum of the ZNR geometry is demonstrated as a function of the chemical potential $\mu$ for various strengths of irradiation.} \label{floq_ribbon_con} \end{figure} We also explore the transport signature of the ZNR geometry. To obtain the conductance, we extend the formalism used for the bulk by taking into account the quantized transverse wave vector, determined by the width of the ribbon as $k_y=n\pi/W$ with $n=1,2,3..$ being the number of transverse edge modes. Note that, in this method the edge modes cannot be captured, rather mostly transverse modes reside inside the bulk. This approximate method is already implemented in case of graphene~\cite{PhysRevB.96.245404}. In our case, as the edge modes are not chiral in nature, we use the same formalism as used for the bulk instead of the formalism described in Refs.~[\onlinecite{kohler2005driven,PhysRevB.72.245339}]. The conductance for the ZNR is shown in Fig.~\ref{floq_ribbon_con}. The behavior of the conductance exhibits the dips at $\mu=0$ and $\pm \hbar\omega/2$. This is quite similar to the case of the bulk semi-Dirac material. However, the conductance varies very slowly with chemical potential except at the locations of the dips. In our numerical analysis, we consider the number of transverse edge modes to be $n=50$ for which conductance remains weakly oscillatory around $50 e^2/h$. A more careful analysis of the conductance for semi-Dirac ZNR geometry, based on Floquet-Landauer Green's function approach~\cite{kohler2005driven,PhysRevB.72.245339} is beyond the scope of the present work and will be presented elsewhere. \section{Summary and conclusions}\label{sec5} In our work, we investigate the electronic and transport properties of an irradiated semi-Dirac material. We consider the irradiation in the form of a circularly polarized light. We present our results for the semi-Dirac material in comparison to the irradiated monolayer graphene. The irradiation is unable to open up a gap in the Floquet spectrum of semi-Dirac material within the high frequency approximation~\cite{PhysRevB.91.205445}. However, beyond this approximation, a full band dispersion analysis reveals that the band gap indeed appears for higher values of the momentum and between two nearest Floquet side bands. Such appearance of the band gap in the quasi energy spectrum can also be probed via the signature of the conductance spectrum. The latter manifests several dips around the gaps. We also observe that the band gap opening is strongly dependent on the angular orientation of momentum due to the anisotropic band structure of the semi-Dirac material. We also explore the band structure of nanoribbon geometry comprised of such material and show some distinct features in comparison to the manolayer graphene nanoribbon. The ZNR of the semi-Dirac material hosts a pair of edge modes which are fully detached from the bulk. Also, they smoothly transmute to the graphene edge modes when the two hopping parameters $t_{1}$ and $t_{2}$ become equal. Furthermore, in presence of an external irradiation, ZNR of such material does not host topologically protected Floquet chiral edge modes like graphene. Moreover, the edge modes become coupled to the bulk and the dynamical band gap in the Floquet spectrum begins to disappear with the increase of the strength of the periodic drive. Finally, we also explore the possible features of the conductance of the irradiated ZNR based on semi-Dirac material. The conductance exhibits similar dips around the same locations of the chemical potential as in the bulk except the amplitude mismatch due to the presence of finite number of channels. Finally, we discuss the experimental feasibility of transport measurement in an externally irradiated semi-Dirac material. As the transport (current) measurement of an irradiated topological insulator thin film has been successfully performed~\cite{zhang2014anomalous}, we expect that the conductance dips may also be observed in semi-Dirac material via the two-terminal measurement. In practical situation, the chemical potential (carrier density) in Dirac/semi-Dirac material can be tuned by applying external gate voltage in the non-irradiated region. Then, if one is able to measure the two-terminal conductance of our set-up, then the dips that appear in our angle averaged conductance spectrum can be an indirect signature of the gapped region. However, in experiment, one may have to encounter the presence of disorder or a small deviation from the perfect circularly polarized light. Nevertheless, it has been recently reported in another hexagonal 2D lattice that disorder causes an overall suppression to the conductance~\cite{tahir2016floquet} and it cannot destroy the conductance dips. On the other hand, the elliptical polarized light does not cause significant changes in the results of circularly polarized light~\cite{zhang2014anomalous,tahir2016floquet}. \begin{acknowledgements} SFI acknowledges Jonathan Atteia, P. M. Perez-Piskunow and Paramita Dutta for useful and stimulating discussions. \end{acknowledgements}
\section{Introduction} The field of nonparametric statistics for stochastic processes has become an integral part of statistics. Due to their practical relevance as standard models in many areas of applied science such as genetics, meteorology or financial mathematics to name very few, the statistical analysis of diffusion processes receives special attention. The first contribution of the present paper is an investigation of adaptive $\sup$-norm convergence rates for a nonparametric Nadaraya--Watson-type drift estimator, based on a continuous record of observations $(X_s)_{0\leq s\leq t}$ of a diffusion process on the real line. The suggested data-driven bandwidth choice relies on Lepski's method for adaptive estimation. Characterising upper and lower bounds, we show that the proposed estimation procedure in the asymptotic regime $t\to \infty$ is minimax rate-optimal over nonparametric H\"older classes. Remarkably, we impose only very mild conditions on the drift coefficient, not going far beyond standard assumptions that ensure the existence of ergodic solutions of the underlying SDE over the real line. In particular, we allow for unbounded drift coefficients. Secondly, we prove a Donsker-type theorem for the classical kernel estimator of the invariant density in $\ell^\infty(\R)$ and establish its semiparametric efficiency. With regard to the direct relation between drift coefficient and the invariant density, it is clear that the corresponding estimation problems are closely connected. In a last step, we combine both tasks and suggest an adaptive bandwidth choice that simultaneously yields both an asymptotically efficient, asymptotically normal (in $\ell^\infty(\R)$) estimator of the invariant density and, at the same time, the corresponding minimax rate-optimal drift estimator. So far, results analysing the $\sup$-norm risk in the context of diffusion processes are rather scarce, even though quantifying expected maximal errors is of immense relevance, in particular for practical applications. We therefore start in the basic set-up of continuous observations of a scalar ergodic diffusion process. While the idealised framework of continuous observations of the process may be considered as being far from the reality, it is indisputably of substantial theoretical interest because the statistical results incorporate the very nature of the diffusion process, not being influenced by any discretisation errors. Consequently, they serve as relevant benchmarks for further investigations. Moreover, our approach is attractive in the sense that it provides a reasonable starting point for extending the statistical analysis to discrete observation schemes and even multivariate diffusion processes. A second, very concrete motivation for our framework is the idea of bringing together methods from stochastic control and nonparametric statistics. Diffusion processes serve as a prototype model in stochastic optimal control problems which are solved under the long-standing assumption of continuous observations of a process driven by known dynamics. Relaxing this assumption to the framework of continuous observations of a process driven by an \emph{unknown} drift coefficient, imposing merely mild regularity assumptions, raises interesting questions on how to learn the dynamics by means of nonparametric estimation procedures and to control in an optimal way at the same time. With respect to the statistical methods, these applications typically require optimal bounds on $\sup$-norm errors. The present paper provides these tools for a large class of scalar diffusion processes. Taking a look at the evolution of the area of statistical estimation for diffusions up to the mid 2000's, we refer to \cite{goetal04} for a very nice summary. The monograph \cite{kut04} provides a comprehensive overview on inference for one-dimensional ergodic diffusion processes on the basis of continuous observations considering pointwise and $L^2$-risk measures. \cite{ban78} is commonly mentioned as the first article addressing the question of nonparametric identification of diffusion processes from continuous data. In nonparametric models, asymptotically efficient estimators typically involve the optimal choice of a tuning parameter that depends on the smoothness of the nonparametric class of targets. From a practical perspective, this is not satisfying at all because the smoothness is usually not known. One thus aims at \emph{adaptive} estimation procedures which are based on purely data-driven estimators adapting to the unknown smoothness. \cite{spok00} and \cite{dal05} were the first to study adaptive drift estimation in the diffusion model based on continuous observations. \cite{spok00} considers pointwise estimation whereas \cite{dal05} investigates a weighted $L^2(\R)$-norm. \cite{hoff99} initiated adaptive estimation in a high-frequency setting, proposing a data driven estimator of the diffusion coefficient based on wavelet thresholding which is rate optimal wrt $L^\gamma(D)$-loss, for $\gamma\in [1,\infty)$ and a compact set $D$. With regard to low-frequency data, we refer to the seminal paper by \cite{goetal04}. Their objective is inference on the drift and diffusion coefficient of diffusion processes with boundary reflections. The quality of the proposed estimators is measured in the $L^2([a,b])$ distance for any $0<a<b<1$. Like restricting to estimation on arbitrary but fixed compact sets, looking at processes with boundary reflections constitutes a possibility to circumvent highly technical issues that we will face in our investigation of diffusions on the entire real line. \citeauthor{goetal04} postulate that allowing diffusions on the real line would require to introduce a weighting in the risk measure given by the invariant density. This phenomenon will become visible in our results, as well. The same weighting function can be found in \cite{dal05}. Intuitively, it seems natural that the estimation risk would explode without a weighting since the observations of the continuous process during a finite period of time do not contain information about the behaviour outside the compact set where the paths lives in. For a more detailed heuristic account on the choice of the weight function for $L^2(\R)$-risk, we refer to Remark 4.1 in \cite{dal05}. Sharp adaptive estimation of the drift vector for multidimensional diffusion processes from continuous observations for the $L^2$- and the pointwise risk has been addressed in \cite{str15} and \cite{str16}, respectively. As illustrated, the pointwise and $L^2$-risks are already well-understood in different frameworks. The present paper complements these developments by an investigation of the $\sup$-norm risk in the continuous observation scheme. In the low-frequency framework, this strong norm was studied in \cite{sotra16} who construct both an adaptive estimator of the drift and adaptive confidence bands. They prove a functional central limit theorem for wavelet estimators in a multi-scale space, i.e., considering a weaker norm that still allows to construct adaptive confidence bands for the invariant density and the drift with optimal $\ell^\infty([a,b])$-diameter. Still, there exist a lot of challenging open questions, and in view of the growing field of applications, there is a clear need for developing and adding techniques and tools for the statistical analysis of stochastic processes under $\sup$-norm risk. Ideally, these tools should include the probabilistic features of the processes and, at the same time, allow for an in-depth analysis of issues such as adaptive estimation in a possibly broad class of models. A common device for the derivation of adaptive estimation procedures in $\sup$-norm loss are uniform Talagrand-type concentration inequalities and moment bounds for empirical processes based on chaining methods. These tools are made available for a broad class of scalar ergodic diffusion processes in our recent paper \cite{cacs18}, in the sequel abbreviated as \cp. The concentration inequalities derived therein will serve as the central vehicle for our analysis, and we conjecture that they allow for generalizations on discrete observation schemes, multivariate state variables and even more general Markov processes. Therefore, the approach presented in this paper provides guidance for further statistical investigations of stochastic processes in $\sup$-norm risk. Besides the frequentist statistical research, the Bayesian approach found a lot of interest, more recently. In the framework of continuous observations, \cite{meuletal06} consider the asymptotic behaviour of posterior distributions in a general Brownian semimartingale model which, as a special case, includes the ergodic diffusion model. \cite{poketal13} investigate a Bayesian approach to nonparametric estimation of the periodic drift of a scalar diffusion from continuous observations and derive bounds on the rate at which the posterior contracts around the true drift in $L^2([0,1))$-norm. Improvements in terms of these convergence rates results and adaptivity are given in \cite{vwvz16}. Nonparametric Bayes procedures for estimating the drift of one-dimensional ergodic diffusion models from discrete-time low-frequency data are studied in \cite{vdmvz13}. The authors give conditions for posterior consistency and verify these conditions for concrete priors. Given discrete observations of a scalar reflected diffusion, \cite{niso17} derive (and verify) conditions in the low-frequency sampling regime for prior distributions on the diffusion coefficient and the drift function that ensure minimax optimal contraction rates of the posterior distribution over H\"older--Sobolev smoothness classes in $L^2([a,b])$-distance, for any $0<a<b<1.$ \subsection*{Basic framework and outline of the paper} Taking into view the $\sup$-norm risk, the aim of this paper is to suggest a rate-optimal nonparametric drift estimator, based on continuous observations of an ergodic diffusion process on the real line which is given as the solution of the SDE \begin{equation}\label{SDE} \d X_t\ =\ b(X_t)\d t+ \sigma(X_t)\d W_t, \quad X_0=\xi, \ t>0, \end{equation} with unknown drift function $b\colon\R\to\R$, dispersion $\sigma\colon\R\to (0,\infty)$ and some standard Brownian motion $W=(W_t)_{t\geq0}$. The initial value $\xi$ is a random variable independent of $W$. We restrict to the ergodic case where the Markov process $(X_t)_{t\geq 0}$ admits an invariant measure, and we denote by $\rho_b$ and $\mu_b$ the invariant density and the associated invariant measure, respectively. Furthermore, we will always consider stationary solutions of \eqref{SDE}, i.e., we assume $\xi\sim\mu_b$. In the set-up of continuous observations, there is no interest in estimating the volatility $\sigma^2$ since this quantity is identifiable using the quadratic variation of $X$. We thus focus on recovering the unknown drift. We develop our results in the following classical scalar diffusion model. \begin{definition}\label{def:B} Let $\sigma\in \operatorname{Lip}_{\operatorname{loc}}(\R)$ and assume that, for some constants $\nu\geq 0$, $\C\geq 1$, $\sigma$ satisfies $ |\sigma(x)| \leq\C(1+|x|) $ and $ |\sigma^{-1}(x)| \leq\C(1+|x|^\nu) $ for all $x\in\R$ . For fixed constants $A,\gamma>0$ and $\C\geq 1$, define the set $\Sigma=\Sigma(\C,A,\gamma,\sigma)$ as \begin{equation}\label{eq:sigma} \Sigma\ :=\ \Big\{b \in \operatorname{Lip}_{\operatorname{loc}}(\R)\colon|b(x)| \leq\C(1+|x|),\ \forall|x|>A\colon \frac{b(x)}{\sigma^2(x)}\operatorname{sgn}(x)\leq -\gamma\Big\}. \end{equation} \end{definition} Given any $b\in\Sigma$, there exists a unique strong solution of the SDE \eqref{SDE} with ergodic properties and invariant density \begin{equation}\label{eq:invdens} \rho(x)=\rho_b(x)\ :=\ \frac{1}{C_{b,\sigma}\sigma^2(x)}\ \exp\left(\int_0^x\frac{2b(y)}{\sigma^2(y)}\d y\right),\quad x\in\R, \end{equation} with $C_{b,\sigma}:=\int_\R\frac{1}{\sigma^2(u)}\ \exp\left(\int_0^u\frac{2b(y)}{\sigma^2(y)}\d y\right)\d u$ denoting the normalising constant. Throughout the sequel and for any $b\in\Sigma$, we will denote by $\E_b$ the expected value with respect to the law of $\X$ associated with the drift coefficient $b$. The distribution function corresponding to $\rho=\rho_b$ and the invariant measure of the distribution will be denoted by $F=F_b$ and $\mu=\mu_b$, respectively. Our statistical analysis relies heavily on uniform concentration inequalities for continuous-time analogues of empirical processes of the form $t^{-1}\int_0^t f(X_s)\d s - \E_b[f(X_0)]$, $f\in\mathcal F$, as well as stochastic integrals $t^{-1}\int_0^t f(X_s)\d X_s - \E_b[b(X_0)f(X_0)]$, $f\in\mathcal F$, indexed by some infinite-dimensional function class $\mathcal F$. These key devices are provided in our work on concentration inequalities for scalar ergodic diffusions. They are tailor-made for the investigation of $\sup$-norm risk criteria and can be considered as continuous-time substitutes for Talagrand-type concentration inequalities and moment bounds for empirical processes in the classical i.i.d.~framework. In \cp, upper bounds on the expected $\sup$-norm error for a kernel density estimator of the invariant density (that we will use in the present work) are derived as a first statistical application of the developed concentration inequalities. In Section \ref{sec:pre}, we will present the announced probabilistic tools and statistical results from \cp~that will be of crucial importance in our subsequent developments. The advantage of the methods proposed in \cp~is that the martingale approximation approach - which is at the heart of the derivations - yields very elementary simple proofs, working under minimal assumptions on the diffusion process. \paragraph{The estimators} Given continuous observations $X^{t}=(X_s)_{0\leq s\leq t}$ of a diffusion process as described in Definition \ref{def:B}, first basic statistical questions concern the estimation of the invariant density $\rho_b$ and the drift coefficient $b$ and the investigation of the respective convergence properties. Since $b=(\rho_b\sigma^2)'/(2\rho_b)$ (for differentiable $\sigma$), the question of drift estimation is obviously closely related to estimation of the invariant density $\rho_b$ and its derivative $\rho_b'$. For some smooth kernel function $K\colon \R\to\R^+$ with compact support, introduce the standard kernel invariant density estimator \begin{equation}\label{est:dens} \rho_{t,K}(h)(x)\ :=\ \frac{1}{th}\int_0^tK\left(\frac{x-X_u}{h}\right)\d u,\quad x\in\R. \end{equation} A natural estimator of the drift coefficient $b\in\Sigma(\C,A,\gamma,1)$, which relies on the analogy between the drift estimation problem and the model of regression with random design, is given by a Nadaraya--Watson-type estimator of the form \begin{align}\label{est:drift} b_{t,K}(h)(x)&:=\ \frac{\overline\rho_{t,K}(h)(x)}{\rho_{t,K}(t^{-1/2})(x) + \sqrt{\frac{\log t}{t}}\exp\left(\sqrt{\log t}\right)},\\\label{est:derivative} \text{where } \overline\rho_{t,K}(h)(x)&:=\ \frac{1}{th}\int_0^tK\left(\frac{x-X_s}{h}\right)\d X_s. \end{align} We recognize the kernel density estimator in the denominator, and we will see that $\overline\rho_{t,K}$ with the proposed (adaptive) bandwidth choice serves as a rate-optimal estimator of $b\rho_b$. The additive term in the denominator prevents it from becoming small too fast in the tails. Given a record of continuous observations of a scalar diffusion process $\X$ with coefficients as described in Definition \ref{def:B}, the local time estimator $\rho_0(\bullet):=t^{-1}L_t^\bullet (\X)$, for $(L_t^a(\X),t\geq 0, a\in\R)$ denoting the local time process of $\X$, is available. This is a natural density estimator since diffusion local time can be interpreted as the derivative of the empirical measure. In the past, the latter was exhaustively studied for pointwise estimation and in $L^2$-risk unlike the $\sup$-norm case. In \cite[Sec.~7]{kutoyants98}, weak convergence of the local time estimator to a Gaussian process in $\ell^\infty(\R)$ is shown. The same is done for more general diffusion processes in \cite{vdvvz05}. Having provided the required tools from empirical process theory, upper bounds on all moments of the $\sup$-norm error of $\rho_0$ are proven in \cp. Unfortunately, the local time estimator is viewed as not being very feasible in practical applications. In addition, it does not offer straightforward extensions to the case of discretely observed or multivariate diffusions, in sharp contrast to the classical kernel-based density estimator. We therefore advocate the usage of the kernel density estimator introduced in \eqref{est:dens} which can be viewed as a universal approach in nonparametric statistics, performing an optimal behaviour over a wide range of models. Furthermore, the kernel density estimator naturally appears in the denominator of our Nadaraya--Watson-type drift estimator defined according to \eqref{est:drift}. \paragraph{Asymptotically efficient density estimation} In the present work, we will complement the sup-norm analysis started in \cp~with an investigation of the asymptotic distribution of the kernel density estimator in a functional sense. We will prove a Donsker-type theorem for the kernel density estimator, thereby demonstrating that this estimator for an appropriate choice of bandwidth behaves asymptotically like the local time estimator. We then go one step further and establish optimality of the limiting distribution, optimality seen in the sense of the general convolution theorem 3.11.2 for the estimation of Banach space valued parameters presented in \cite{vdvw96}. Their theorem states that, for an asymptotically normal sequence of experiments and any regular estimator, the limiting distribution is the convolution of a specific Gaussian process and a noise factor. This Gaussian process is viewed as the optimal limit law, and we refer to it as the \emph{semiparametric lower bound}. We establish this lower bound and verify that it is achieved by the kernel density estimator. The Donsker-type theorem and the verification of semiparametric efficiency of the kernel-based estimator are the main results on density estimation in the present paper. They are presented in Section \ref{sec:3}. Donsker-type theorems can be regarded as frequentist versions of functional Bernstein--von Mises theorems to some extent. In particular, our methods and techniques are interesting for both the frequentist and Bayesian community. The optimal limiting distribution in the sense of the convolution theorem is relevant in the context of Bayesian Bernstein--von Mises theorems in the following sense: If this lower bound is attained, Bayesian credible sets are optimal asymptotic frequentist confidence sets as argued in \cite{castillo14}; see also \cite[p.~12]{nicklsoehl17} who address Bernstein--von Mises theorems in the context of compound Poisson processes. Our approach concerning the question of efficiency is based on some recent work by Nickl and Ray on a Bernstein--von Mises theorem for multidimensional diffusions. We thank Richard Nickl for the private communication that motivated the derivation of the semiparametric lower bound in this work. \paragraph{Minimax optimal adaptive drift estimation in $\sup$-norm} Subject of Section \ref{sec:adapt_einfach} is an adaptive scheme for the $\sup$-norm rate-optimal estimation of the drift coefficient. This is the main contribution and initial motivation of the present paper. Our approach for estimating the drift coefficient is based on Lepski's method for adaptive estimation and the exponential inequalities presented in Section \ref{sec:pre}. For proving upper bounds on the expected $\sup$-norm loss, we follow closely the ideas developed in \cite{gini09} for the estimation of the density and the distribution function in the classical i.i.d.~setting. We suggest a purely data-driven bandwidth choice $\tri h_T$ for the estimator $b_{T,K}$ defined in \eqref{est:drift} and derive upper bounds on the convergence rate of the expected $\sup$-norm risk uniformly over H\"older balls in Theorem \ref{theo:est}, imposing very mild conditions on the drift coefficient. To establish minimax optimality of the rate, we prove lower bounds presented in Theorem \ref{thm:lowerboundableitung}. \paragraph{Simultaneous adaptive density and drift estimation} Observing from \eqref{eq:invdens} that the invariant density is a transformation of the integrated drift coefficient, it is not surprising that we can carry over the aforementioned approach in \cite{gini09} (which aims at simultaneous estimation of the distribution function and density in the i.i.d.~framework) to the problems of invariant density and drift estimation. We suggest a simultaneous bandwidth selection procedure that allows to derive a result in the spirit of their Theorem 2. Adjusting the procedure from Section \ref{sec:adapt_einfach} for choosing the bandwidth $\tri h_t$ in a data-driven way, we can find a bandwidth $\hat h_t$ such that $\rho_{t,K}(\hat h_t)$ is an asymptotically efficient estimator in $\ell^\infty(\R)$ for the invariant density and, at the same time, $b_{t,K}(\hat h_t)$ estimates the drift coefficient with minimax optimal rate of convergence wrt $\sup$-norm risk. We formulate this result in Theorem \ref{theo:sim}. \section{Preliminaries}\label{sec:pre} We will investigate the question of adapting to unknown H\"older smoothness. For ease of presentation, we will suppose in the sequel that $\sigma\equiv1$. The subsequent results however can be extended to the case of a general diffusion coefficient fulfilling standard regularity and boundedness assumptions. Recall the definition of the class $\Sigma=\Sigma(\CC,A,\gamma,\sigma)$ of drift functions in \eqref{eq:sigma}. \begin{definition}\label{def:Sigma} Given $\beta,\mathcal{L}>0$, denote by $\mathcal{H}_{\R}(\beta,\mathcal{L})$ the \emph{H\"older class} (on $\R$) as the set of all functions $f\colon\R\to\R$ which are $l:=\lfloor \beta \rfloor$-times differentiable and for which \begin{align*} \|f^{(k)}\|_{\infty}&\leq\ \mathcal{L} \qquad\qquad\forall\, k=0,1,...,l,\\ \|f^{(l)}(\cdot+s)-f^{(l)}(\cdot)\|_{\infty}&\leq\ \mathcal{L}|s|^{\beta- l} \qquad \forall\, s\in\R. \end{align*} Set \begin{equation}\label{def:Sigmabeta} \Sigma(\beta,\mathcal{L})=\Sigma(\beta,\LL,\mathcal C,A,\gamma)\ :=\ \left\{b\in\Sigma(\CC,A,\gamma,1)\colon\ \rho_b\in\mathcal{H}_\R(\beta+1,\mathcal{L})\right\}. \end{equation} Here, $\lfloor \beta \rfloor$ denotes the greatest integer strictly smaller than $\beta$. \end{definition} Considering the class of drift coefficients $\Sigma(\beta,\mathcal{L})$, we use kernel functions satisfying the following assumptions, \begin{equation}\label{kernel} \begin{array}{r@{}l} &{}\bullet\quad K:\R\rightarrow \R^+ \text{ is Lipschitz continuous and symmetric};\\ [3pt] &{}\bullet\quad\supp(K)\subseteq [-1/2,1/2];\\[3pt] &{}\bullet\quad \text{for some } \alpha\geq \beta +1, K\text{ is of order }\lfloor\alpha \rfloor. \end{array} \end{equation} The subsequent deep results from \cp~are fundamental for the investigation of the $\sup$-norm risk. They rely on diffusion specific properties, in particular the existence of local time, on the one hand, and classical empirical process methods like the generic chaining device on the other hand. In the classical setting of statistical inference based on i.i.d.~observations $X_1,...,X_n$, the analysis of $\sup$-norm risks typically requires investigating empirical processes of the form $\left(n^{-1}\sum_{i=1}^n f(X_i)\right)_{f\in\mathcal F}$, indexed by a possibly infinite-dimensional class $\mathcal F$ of functions which, in many cases, are assumed to be uniformly bounded. Analogously, in the current continuous, non-i.i.d.~setting, our analysis raises questions about empirical processes of the form \[ \left(\frac{1}{t}\int_0^t f(X_s) \d s\right)_{f\in\mathcal F}\quad\text{ and, more generally, }\quad\left(\frac{1}{t}\int_0^t f(X_s) \d X_s\right)_{f\in\mathcal F}. \] Clearly, the finite variation part of the stochastic integral entails the need to look at unbounded function classes since we do not want to restrict to bounded drift coefficients. Answers are given in \cp~where we provide exponential tail inequalities both for \[ \sup_{f\in \mathcal F}\ \left[\frac{1}{t}\int_0^t f(X_s) \d s\ -\ \E_b\left[f(X_0)\right]\right]\quad\text{and}\quad\sup_{f\in \mathcal F}\ \left[\frac{1}{t}\int_0^t f(X_s) \d X_s\ -\ \E_b\left[b(X_0)f(X_0)\right]\right] , \] imposing merely standard entropy conditions on $\mathcal F$. As can be seen from the construction of the estimators, we have to exploit these results in order to deal with both empirical diffusion processes induced by the kernel density estimator $\rho_{t,K}(h)$ (see \eqref{est:dens}) and with stochastic integrals like the estimator $\overline\rho_{t,K}(h)$ of the derivative of the invariant density (see \eqref{est:derivative}). One first crucial auxiliary result for proving the convergence properties of the estimation schemes proposed in Sections \ref{sec:adapt_einfach} and \ref{sec:sim} is stated in the following \begin{proposition}[Concentration of the estimator $\overline{\rho}_{t,K}(h)$ of $\rho_b'/2$]\label{prop:csi} Given a continuous record of observations $X^t=(X_s)_{0\leq s\leq t}$ of a diffusion $\X$ with $b\in\Sigma=\Sigma(\C,\A,\gamma,1)$ as introduced in Definition \ref{def:B} and a kernel $K$ satisfying \eqref{kernel}, define the estimator $\overline\rho_{t,K}$ according to \eqref{est:derivative}. Then, there exist constants $\co, \tilde\co_0$ such that, for any $u,p\geq 1$, $h\in (0,1)$, $t\geq 1$, \begin{align} \begin{split}\label{con_stoch_int} \sup_{b\in \Sigma} \left(\E_b\left[\|\overline{\rho}_{t,K}(h)-\E_b\left[\overline{\rho}_{t,K}(h)\right]\|_\infty^p\right]\right)\p&\leq\ \phi_{t,h}(p),\\ \sup_{b\in \Sigma}\P_b\left(\sup_{x\in\R}\left|\overline\rho_{t,K}(h)(x)-\E_b\left[\overline \rho_{t,K}(h)(x)\right]\right|>\e\phi_{t,h}(u)\right)&\leq\ \e^{-u}, \end{split} \end{align} for \begin{align} \begin{split}\label{phith} \phi_{t,h}(u)&:=\ \co \Bigg\{ \frac{1}{\sqrt t}\Big\{\left(\log \left(\frac{ut}{h}\right)\right)^{3/2}+\left(\log\left(\frac{ut}{h}\right)\right)^{1/2}+u^{3/2}\Big\}+\frac{u}{th}+ \frac{1}{h} \exp\left(-\tilde\co_0 t \right)\\ &\qquad +\frac{1}{\sqrt{th}}\left(\log\left(\frac{ut}{h}\right)\right)^{1/2} + \frac{1}{t^{3/4}\sqrt h}\log\left(\frac{ut}{h}\right) + \frac{1}{\sqrt{th}} \left\{\sqrt u+ \frac{u}{t^{1/4}}\right\}\Bigg\}. \end{split} \end{align} \end{proposition} \begin{proof} We apply Theorem 18 in \cp~to the class \begin{equation}\label{functionclass} \mathcal F:= \left\{K\left(\frac{x-\cdot}{h}\right):\,x\in\mathbb Q\right\}. \end{equation} For doing so, note that $\sup_{f\in\mathcal F}\|f\|_\infty\leq \|K\|_\infty$, and, for $\lebesgue$ denoting the Lebesgue measure, \begin{eqnarray*} \left\|K\left(\frac{x-\cdot}{h}\right)\right\|^2_{L^2(\lebesgue)}&=& \int K^2\left(\frac{x-y}{h}\right)\d y\ =\ h \int K^2(z)\d z\ \leq\ h\|K \|^2_{L^2(\lebesgue)} \end{eqnarray*} and $\sup_{f\in\mathcal F}\lebesgue(\supp(f))\leq h$. Due to the Lipschitz continuity of $K$, Lemma 23 in \cp~yields constants $\mathbbm A>0$, $v\geq 2$ (only depending on $K$) such that, for any probability measure $\mathbb Q$ on $\R$ and any $0<\epsilon<1$, $N(\epsilon,\mathcal F,\|\cdot\|_{L^2(\mathbb Q)})\leq (\mathbbm A/\epsilon)^v$. Here and throughout the sequel, given some semi-metric $d$, $N(u,\FF,d)$, $u>0$, denotes the covering number of $\FF$ wrt $d$, i.e., the smallest number of balls of radius $u$ in $(\FF,d)$ needed to cover $\FF$. Since the assumption on the covering numbers of $\mathcal F$ in Theorem 18 in \cp~is fulfilled, Theorem 18 can be applied to $\FF$ with $\mathcal S := h\ \max\{\|K \|^2_{L^2(\lebesgue)},1\}$ and $\V:= \sqrt h\|K \|_{L^2(\lebesgue)}$. In particular, there exist positive constants $\tilde\co$, $\Lambda$, $\tilde\co_0$ and $\co$ such that \begin{align*} &\sup_{b\in \Sigma} \left(\E_b\left[\|\overline{\rho}_{t,K}(h)-\E_b\left[\overline{\rho}_{t,K}(h)\right]\|^p_\infty\right]\right)\p\\ &\qquad \leq\ \tilde\co\Bigg\{ \frac{1}{\sqrt t}\Big\{\left(\log\left(\sqrt{\frac{h + p\Lambda t}{h}}\right)\right)^{3/2} + \left(\log\left(\sqrt{\frac{h + p\Lambda t}{h}}\right)\right)^{1/2} + p^{3/2}\Big\}\\ &\hspace*{8em} +\frac{p}{th} + \frac{1}{h} \exp\left(-\tilde\co_0 t \right) + \frac{1}{\sqrt{th}} \left(\log\left(\sqrt{\frac{h + p\Lambda t}{h}}\right)\right)^{1/2}\\ &\hspace{8em} \, + \, \frac{1}{t^{3/4}\sqrt h}\left(1+\log\left(\sqrt{\frac{h + p\Lambda t}{h}}\right)\right) + \frac{1}{\sqrt{th}} \left\{\sqrt p+ \frac{p}{t^{1/4}}\right\}\Bigg\}\\ &\qquad\leq \phi_{t,h}(p), \end{align*} and \eqref{con_stoch_int} immediately follows. \end{proof} The uniform concentration results for stochastic integrals from \cp~further allow to prove the following result on the $\sup$-norm distance $\|t^{-1}L_t^\bullet(X)-\rho_{t,K}(h)\|_\infty$ between the local time and the kernel density estimator. The exponential inequality for this distance will be the key to transferring the Donsker theorem for the local time to the kernel density estimator. It can also be interpreted as a result on the uniform approximation error of the scaled local time by its smoothed version, noting that $\rho_{t,K}(h)$ can be seen as a convolution of a mollifier and a scaled version of diffusion local time. The next result actually parallels Theorem 1 in \cite{gini09} which states a subgaussian inequality for the distribution function in the classical i.i.d.~set-up. It serves as an important tool for the analysis of the proposed adaptive scheme for simultaneous estimation of the distribution function and the associated density in \cite{gini09}. The subsequent proposition plays an analogue role for the adaptive scheme for simultaneous estimation of the invariant density and the drift coefficient presented in Section \ref{sec:sim}. \begin{proposition}[Theorem 15 in \cp]\label{theo:cath1} Given a diffusion $\X$ with $b\in\Sigma(\beta,\mathcal L)$, for some $\beta,\mathcal L >0$, consider some kernel function $K$ fulfilling \eqref{kernel} and $h=h_t\in(0,1)$ such that $h_t\geq t^{-1}$. Then, there exist positive constants $\VV,\xi_1,\Lambda_0,\Lambda_1$ and $\co$ such that, for all $\lambda \geq \lambda_0(h)$, where \begin{align*} \lambda_0(h)& := 8\Lambda_0\bigg[ \sqrt h \VV\e\mathbb L\left\{1+ \log\left(\frac{1}{\sqrt h \VV}\right)+\log t\right\}+\e\co\sqrt t \exp(-\xi_1 t)\\ &\hspace*{14em}\ + \ \sqrt t h^{\beta +1}\frac{\mathcal L}{2\lfloor \beta + 1\rfloor!}\int |K(v)v^{\beta +1 }|\d v\bigg], \end{align*} and any $t>1$, \[ \sup_{b\in\Sigma(\beta,\mathcal L)}\P_b\left(\sqrt t\Big\|\rho_{t,K}(h)-\frac{L_t^\bullet(X)}{t}\Big\|_\infty>\lambda\right)\ \leq \ \exp\left(-\frac{\Lambda_1\lambda}{\sqrt h}\right). \] \end{proposition} The very first step of our approach to $\sup$-norm adaptive drift estimation consists in estimating the invariant density in $\sup$-norm loss. Corresponding upper bounds on the $\sup$-norm risk have been investigated in \cp. We next cite these bounds for the local time estimator and the kernel density estimator. Our estimation procedure does \emph{not} involve the local time density estimator. For the sake of presenting a complete statistical $\sup$-norm analysis of ergodic scalar diffusions based on continuous observations, we still include it here. \begin{lemma}[Moment bound on the supremum of centred diffusion local time, Corollary 16 of \cp]\label{lem:difflt} Let $\X$ be as in Definition \ref{def:B}. Then, there are positive constants $\zeta,\zeta_1$ such that, for any $p,t\geq 1$, \begin{align*} \sup_{b\in\Sigma(\C,A,\gamma,1)}\left(\E_b\left[\Big\|\frac{L_t^\bullet(\X)}{t}-\rho_b\Big\|_\infty^p\right]\right)\p\ \leq\ \zeta\left(\frac{p}{t}+\frac{1}{\sqrt t}\left(1+\sqrt p+\sqrt{\log t}\right)+t\e^{-\zeta_1 t}\right). \end{align*} \end{lemma} In \cp, we have also shown the analogue fundamental result for the $\sup$-norm risk of the kernel density estimator. The following upper bounds will be essential for deriving convergence rates of the Nadaraya--Watson-type drift estimator (see \eqref{est:drift}). \begin{proposition}[Concentration of the kernel invariant density estimator, Corollary 14 of \cp]\label{prop:con_kernel_density_estimator} Let $\X$ be a diffusion with $b\in\Sigma(\beta,\mathcal L)$, for some $\beta,\mathcal L>0$, and let $K$ be a kernel function fulfilling \eqref{kernel}. Given some positive bandwidth $h$, define the estimator $\rho_{t,K}(h)$ according to \eqref{est:dens}. Then, there exist positive constants $\nu_1,\nu_2,\nu_3$ such that, for any $p,u\geq 1$, $t>0$, \begin{align}\label{eq:prop6} \sup_{b\in\Sigma(\beta,\mathcal L)}\left(\E_b\left[\left\|\rho_{t,K}(h) - \rho_b\right\|^p_\infty\right]\right)\p &\leq\ \psi_{t,h}(p),\\\nonumber \sup_{b\in\Sigma(\beta,\mathcal L)}\P_b\left(\left\|\rho_{t,K}(h)-\rho_b\right\|_\infty\geq\e\psi_{t,h}(u)\right)&\leq\ \e^{-u}, \end{align} for \begin{align} \begin{split}\label{def:psi} \psi_{t,h}(u)&:=\ \frac{\nu_1}{\sqrt t}\left\{1+\sqrt{\log\left(\frac{1}{\sqrt h}\right)} + \sqrt{\log(ut)}+\sqrt u\right\}+\frac{\nu_2u}{t}+\frac{1}{h}\e^{-\nu_3 t} \\ &\hspace*{14em}+\frac{\mathcal Lh^{\beta +1}}{\lfloor \beta+1\rfloor!}\int |v^{\beta +1}K(v)|\d v. \end{split} \end{align} \end{proposition} Specifying to $h=h_t\sim t^{-1/2}$, an immediate consequence of \eqref{eq:prop6} is the convergence rate $\sqrt{\log t/t}$ for the risk $\sup_{b\in\Sigma(\beta,\mathcal L)}\E_b\left[\left\|\rho_{t,K}(h) - \rho_b\right\|_\infty\right]$ of the kernel density estimator $\rho_{t,K}(t^{-1/2})$. Note that we obtain the parametric convergence rate for the bandwidth choice $t^{-1/2}$ which in particular does not depend on the (typically unknown) order of smoothness of the drift coefficient. Thus, there is no extra effort needed for adaptive estimation of the invariant density. This phenomenon appears only in the scalar setting. \bigskip \section{Donsker-type theorems and asymptotic efficiency of kernel invariant density estimators}\label{sec:3} This section is devoted to the study of weak convergence properties of the kernel density estimator $\rho_{t,K}$. Using the exponential inequality for $\|t^{-1}L^\bullet_t(X)-\rho_{t,K}(h)\|_\infty$ (Proposition \ref{theo:cath1} from Section \ref{sec:pre}), we derive a uniform CLT for the kernel invariant density estimator. In particular, the result holds for the `universal' bandwidth choice $h\sim t^{-1/2}$. Furthermore, we use the general theory developed in \cite{vdvw96} for establishing asymptotic semiparametric efficiency of $\rho_{t,K}(t^{-1/2})$ in $\ell^\infty(\R)$. \subsection{Donsker-type theorems} The exponential inequality for the $\sup$-norm difference of the kernel and the local time density estimator stated in Proposition \ref{theo:cath1} allows to transfer an existing Donsker theorem for the local time density estimator presented in \cite{vdvvz05}. \begin{comment} \begin{proposition}\label{donskerdensity} Given a diffusion $\X$ with $b\in\Sigma(\beta,\LL)$, consider some kernel function $K$ fulfilling \eqref{kernel}. Define the estimator $\rho_{t,K}(t^{-1/2})$ according to \eqref{est:dens} with bandwidth $t^{-1/2}.$ Then, \[ \sqrt t\left(\rho_{t,K}(t^{-1/2})-\rho_b\right)\ \stackrel{\P_b}{\Longrightarrow}\ \H,\qquad \text{ as } t\to\infty, \] in $\ell^\infty(\R)$, where $\H$ is a centered, Gaussian random map with covariance structure\footnote{{\color{firebrick}scale function/speed measure sind noch nicht eingef\"uhrt}} \begin{equation}\label{cov:H} \E[\H(x)\H(y)]=4m(\R)\rho_b(x)\rho_b(y)\int_\R (\mathds{1}\{[x,\infty)\}-F_b)(\mathds{1}\{[y,\infty)\}-F_b)\d s. \end{equation} \end{proposition} \end{comment} \begin{proposition}\label{donskerdensity} Given a diffusion $\X$ with $b\in\Sigma(\beta,\LL)$, consider some kernel function $K$ fulfilling \eqref{kernel}. Define the estimator $\rho_{t,K}(h)$ according to \eqref{est:dens} with bandwidth $h=h_t\in [t^{-1},1)$ satisfying $\sqrt t h^{\beta+1}\rightarrow 0$, as $t\to \infty.$ Then, \[ \sqrt t\left(\rho_{t,K}(h)-\rho_b\right)\ \stackrel{\P_b}{\Longrightarrow}\ \H,\qquad \text{ as } t\to\infty, \] in $\ell^\infty(\R)$, where $\H$ is a centered, Gaussian random map with covariance structure \begin{equation}\label{cov:H} \E[\H(x)\H(y)]=4m(\R)\rho_b(x)\rho_b(y)\int_\R (\mathds{1}\{[x,\infty)\}-F_b)(\mathds{1}\{[y,\infty)\}-F_b)\d s, \end{equation} $m$ and $s$ denoting the speed measure and the scale function of $\X$, respectively. \end{proposition} \begin{comment} \begin{proof} We apply Proposition \ref{theo:cath1} to show that \begin{equation}\label{convinprop} \sqrt t\Big\|\rho_{t,K}(t^{-1/2})-\frac{L_t^\bullet(X)}{t}\Big\|_\infty\ =\ o_{\P_b}(1). \end{equation} There exists a constant $C>0$ such that $\lambda_t:=C\left(t^{-1/4}\left( 1+ \log t\right) + t^{-\beta/2}\right)$ fulfills the assumption $\lambda_t\geq \lambda_0(h)$ for $h=h_t=t^{-1/2}$. Since $\lambda_t=o(1)$, for any $\epsilon>0$ and $t$ sufficiently large, \begin{align*} \P_b\left(\sqrt t\|\rho_{t,K}(t^{-1/2})-t^{-1}L_t^\bullet(X)\|_\infty>\epsilon\right) &\leq \ \P_b\left(\sqrt t\|\rho_{t,K}(t^{-1/2})-t^{-1}L_t^\bullet(X)\|_\infty>\lambda_t\right)\\ &\leq \ \exp\left(-\Lambda_1\lambda_t t^{1/4}\right)\\ &=\ \exp\left(-\Lambda_1C\left(\left( 1+ \log t\right) + t^{\frac{1}{4}-\frac{\beta}{2}}\right)\right)\\ &\longrightarrow\ 0, \quad \text{as }t\to\infty. \end{align*} Consequently, \eqref{convinprop} holds, and Lemma \ref{lem:gaussexists} from Section \ref{appeff} gives the assertion. \end{proof} \end{comment} \begin{proof} We apply Proposition \ref{theo:cath1} to show that \begin{equation}\label{convinprop} \sqrt t\Big\|\rho_{t,K}(h)-\frac{L_t^\bullet(X)}{t}\Big\|_\infty\ =\ o_{\P_b}(1). \end{equation} There exists a constant $C>0$ such that $\lambda_t:=C\left(\sqrt h \left( 1+ \log t\right) + \sqrt t h^{\beta + 1}\right)$ fulfills the assumption $\lambda_t\geq \lambda_0(h)$, for any bandwidth $h=h_t$ satisfying the above conditions. Since $\lambda_t=o(1)$, for any $\epsilon>0$ and $t$ sufficiently large, \begin{align*} \P_b\left(\sqrt t\|\rho_{t,K}(h)-t^{-1}L_t^\bullet(X)\|_\infty>\epsilon\right) &\leq \ \P_b\left(\sqrt t\|\rho_{t,K}(h)-t^{-1}L_t^\bullet(X)\|_\infty>\lambda_t\right)\\ &\leq \ \exp\left(-\Lambda_1\frac{\lambda_t }{\sqrt h}\right)\\ &=\ \exp\left(-\Lambda_1C\left(\left( 1+ \log t\right) + \sqrt t h^{\beta + \frac{1}{2}}\right)\right)\\ &\longrightarrow\ 0, \quad \text{as }t\to\infty. \end{align*} Consequently, \eqref{convinprop} holds, and Lemma \ref{lem:gaussexists} from Section \ref{appeff} gives the assertion. \end{proof} \begin{remark} Donsker-type results turn out to be useful far beyond the question of the behaviour of the density estimator wrt the $\sup$-norm as a specific loss function. In particular, they provide immediate access to solutions of statistical problems concerned with functionals of the invariant density $\rho_b$. Clearly, this includes the estimation of bounded, linear functionals of $\rho_b$ such as integral functionals, to name just one common class. As an instance, \cite{kutoyants07} study the estimation of moments $\mu_b(G)$ for known functions $G$. The target $\mu_b(G)$ is estimated by the empirical moment estimator $t^{-1}\int_0^t G(X_s)\d s$, and it is shown that this estimator is asymptotically efficient in the sense of local asymptotic minimaxity (LAM) for polynomial loss functions. Parallel results can directly be deduced from the Donsker theorem. Defining the linear functional $\Phi_G\colon\ell^\infty(\R)\to \R$, $h\mapsto \int h(x)G(x)\d x$, the target can be written as $\Phi_G(\rho_b)$, and the empirical moment estimator equals the linear functional applied to the local time estimator, that is, \[\frac{1}{t}\int_0^t G(X_s)\d s\ =\ \Phi_G(t^{-1}L^\bullet_t(X)).\] Thus, if $\Phi_G$ is bounded, it follows from the results of \cite{vdvvz05} (see Lemma \ref{lem:gaussexists} in Section \ref{appeff}) and from Proposition \ref{donskerdensity}, respectively, that \[\sqrt t\left(\Phi_G(t^{-1}L_t^\bullet(X))-\Phi_G(\rho_b) \right)\text{ as well as }\sqrt t\left(\Phi_G(\rho_{t,K}(t^{-1/2}))-\Phi_G(\rho_b) \right)\] are asymptotically normal with the limiting distribution $\Phi_G(\H)$. Optimality of $\Phi_G(\H)$ in the sense of the convolution theorem 3.11.2 in \cite{vdvw96} will be shown in the next section. \end{remark} Not only linear, but also nonlinear functions that allow for suitable linearisations can be analysed, once the required CLTs and optimal rates of convergence are given. This is related to the so-called \emph{plug-in property} introduced in \cite{biri03}. The suggested connection is explained a bit more detailed in \cite{gini09}. \subsection{Semiparametric lower bounds for estimation of the invariant density}\label{subsec:crinv} We now want to analyse semiparametric optimality aspects of the limiting distribution in Proposition \ref{donskerdensity} as treated in Chapter 3.11 in \cite{vdvw96} or Chapter 25 of \cite{vdv00}. To this end, we first look at lower bounds. Denote by $\P_{t,h}$ the law of a diffusion process $Y^t:=(Y_s)_{0\leq s\leq t}$ with perturbed drift coefficient $b+t^{-1/2}h$, given as a solution of the SDE \[\d Y_s\ =\ \left(b(Y_s)+\frac{h(Y_s)}{\sqrt t}\right)\d s + \d W_s,\quad Y_0=X_0,\] and denote by $\rho_{b+t^{-1/2}h}$ the associated invariant density. Set $\P_b:=\P_{t,0}$, and define the set of experiments \begin{equation}\label{def:set} \left\{C(0,t),\mathcal B\left(C(0,t)\right),\P_{t,h}\colon h\in G\right\},\quad t>0, \end{equation} with $G=\ell^\infty(\R)\cap \text{Lip}_{\operatorname{loc}}(\R)$ viewed as a linear subspace of $\l^2(\mu_b)$. By construction and Girsanov's Theorem (cf.~\cite[Theorem 7.18]{lipshi01}), the log-likelihood is given as \begin{align*} \log\left(\frac{\d\P_{t,h}}{\d\P_b}\right)(X^t)&=\ \frac{1}{\sqrt t}\int_0^t h(X_s)\d W_s-\frac{1}{2t}\int_0^th^2(X_s)\d s\\ &=\ \Delta_{t,h}-\frac{1}{2}\|h\|_{L^2(\mu_b)}^2+o_{\P_b}(1), \end{align*} where $\Delta_{t,h}:=t^{-1/2}\int_0^Th(X_s)\d W_s$. Here, the last line follows from the law of large numbers for ergodic diffusions, and the CLT immediately gives $\Delta_{t,h}\stackrel{\P_b}{\Longrightarrow}\NN(0,\|h\|_{L^2(\mu_b)}^2)$. Thus, \eqref{def:set} is an asymptotically normal model. Lemma \ref{lemmadifferentiability} from Section \ref{appeff} now implies that the sequence $\Psi(\P_{t,h}):=\rho_{b+t^{-1/2}h}$, $t>0,$ is \emph{regular} (or \emph{differentiable}). In fact, it holds \begin{equation}\label{differentiability} \sqrt T(\Psi(\P_{t,h})-\Psi(\P_b))\ \longrightarrow_{t\to\infty}\ A'h\quad\text{ in }\ell^\infty(\R), \text{ for any }h\in G, \end{equation} for the continuous, linear operator \[A'\colon (G,\l^2({\mu_b})) \to \left(\ell^\infty(\R),\|\cdot\|_\infty\right),\ h \mapsto 2\rho_b(H-\mu_b(H)),\] with $H(\cdot):=\int_0^\cdot h(v)\d v$. We want to determine the optimal limiting distribution for estimating the invariant density $\rho_b=\Psi(\P_{t,0})$ in $\ell^\infty(\R)$ in the sense of the convolution theorem 3.11.2 in \cite{vdvw96}. Since the distribution of a Gaussian process $\mathfrak G$ in $\ell^\infty(\R)$ is determined by the covariance structure $\text{Cov}(\mathfrak G(x),\mathfrak G(y))$, $x,y\in \mathbb R$, we need to find the Riesz-representer for pointwise evaluations $b^*_x\circ A'\colon G\to\R$, where $b^*_x\colon \ell^\infty(\R)\to\R$, $f\mapsto f(x)$, for any $x\in \R$. Stated differently, we need to find the Cram\'er--Rao lower bound for pointwise estimation of $\rho_b(x)$, $x\in\R$. Speaking about these one-dimensional targets in $\R$ such as point evaluations $\rho_b(x)$ or linear functionals of the invariant density, we refer to \emph{semiparametric Cram\'er--Rao lower bounds} as the variance of the optimal limiting distribution from the convolution theorem. This last quantity is a lower bound for the variance of any limiting distribution of a regular estimator. Our first step towards this goal is to look at integral functionals which we will use to approximate the pointwise evaluations. For any continuous, linear functional $b^*\colon \ell^\infty(\R)\to \R$, we can infer from \eqref{differentiability} that \begin{equation*} \sqrt t(b^*(\Psi(\P_{t,h}))-b^*(\Psi(\P_b)))\ \longrightarrow_{t\to\infty}\ b^*(A'h)\quad\text{in }\R,\text{ for all }h\in G. \end{equation*} Considering $\Phi_g\colon\ell^\infty(\R)\to \R$, $f\mapsto \int g(x)f(x)\d x$, for a function $g\in C_c^\infty(\R)$, and letting $\Phi_g(\P_{t,h}):=\Phi_g(\rho_{b+t^{-1/2}h})$, this becomes \[ \sqrt t(\Phi_g(\P_{t,h})-\Phi_g(\P_b))\ \longrightarrow_{t\to\infty}\ \int g(x)(A'h)(x)\d x. \] The limit defines a continuous, linear map $\kappa\colon(G,\l^2(\mu_b))\to\R$ with representation \begin{align}\label{rieszrepresenterableitungintegralfunktional}\nonumber \kappa(h)&=\ \int g(x)(A'h)(x)\d x \ =\ \int 2g(x)(H(x)-\mu_b(H))\rho_b(x)\d x\\ &=\ 2\langle g_c,H_c\rangle_{\mu_b}\ =\ 2\langle \L_b\L_b^{-1}g_c,H_c\rangle_{\mu_b} \ =\ - \langle \partial \L_b^{-1}g_c , h\rangle_{\mu_b}. \end{align} Here and throughout the sequel, $\L_b$ denotes the generator of the diffusion process $\X$ with drift coefficient $b$, i.e., $\L_b f=b\partial f + \partial^2 f/2$, for any $f\in C_c^\infty(\R)$, and $f_c:=f-\mu_b(f)$ denotes the centered version of $f$, for any function $f\in \l^1(\mu_b)$. Note that $g_c\in\text{Rg}(\L_b)$ due to the following lemma whose proof is deferred to Section \ref{appeff}. \begin{lemma}\label{lemma2} Let $g\in C_c^\infty(\R)$, and set \[ h(z,x):=\frac{\mathds{1}\{z\geq x\}-F_b(z)}{\rho_b(z)},\quad z,x\in\R. \] Then, $g_c$ is contained in the image of the generator $\L_b$, and \[\L_b^{-1}(g_c)\ =\ \T(z)\ :=\ \int_{0}^z \int 2g(x)\rho_b(x)h(u,x)\d x\d u.\] In particular, \[ \iint g(x)H(x,y)g(y)\d y \d x\ =\ \|\partial \L_b^{-1}(g_c)\|_{\l^2(\mu_b)}^2, \] where $H(x,y):=\E[\H(x)\H(y)]$, $x,y\in\R,$ for the Gaussian process $\H$ fulfilling \eqref{cov:H}. \end{lemma} We conclude by means of Theorem 3.11.2 in \cite{vdvw96} that the \emph{Cram\'er--Rao lower bound for estimation of $\Phi_g(\P_b)$} is given by $\|\partial \L_b^{-1}g_c\|^2_{\l^2(\mu_b)}$. Using an approximation procedure, it then can be shown that the \emph{Cram\'er--Rao lower bound for pointwise estimation of $\rho_b(y)$} is defined via \begin{equation}\label{CRLBpointwise} \CR(y):=\| 2\rho_b(y)h(\cdot,y)\|^2_{\l^2(\mu_b)},\quad \text{for any }y\in\R. \end{equation} For details, see Proposition \ref{prop:crpoint} in Section \ref{appeff}. The same arguments apply to estimation of linear combinations $u\rho_b(x) + v\rho_b(y), u,v,x,y \in \R$, and the corresponding Cram\'er--Rao bound reads $\| 2u\rho_b(x)h(\cdot,x) + 2v\rho_b(y)h(\cdot,y)\|^2_{\l^2(\mu_b)}$. It follows that the covariance of the optimal Gaussian process in the convolution theorem is given as \begin{equation}\label{optimalcovariance} \CR(x,y):= 4\rho_b(x)\rho_b(y)\int h(z,x)h(z,y)\rho_b(z)\d z, \quad x,y\in\R. \end{equation} \subsection{Semiparametric efficiency of the kernel density estimator} Having characterised the optimal limit distribution in the previous section, it is natural to ask in a next step for an efficient estimator of linear functionals of the invariant density such as pointwise estimation, functionals of the form $\Phi_g(\P_b):=\mu_b(g)=\int g d\mu_b$ or, even more, for estimation of $\rho_b$ in $\ell^\infty(\R)$. \begin{definition}\label{def:eff} An estimator $\hat\rho_t$ of the invariant density is called \emph{asymptotically efficient} in $\ell^\infty(\R)$ if the estimator is regular, i.e., \[\sqrt t \left(\hat \rho_t - \Psi(\P_{t,h})\right)\ \stackrel{\P_{t,h}}{\Longrightarrow}\ \mathscr L,\quad \text{ as } t\to\infty, \text{ for any } h\in G,\] for a fixed, tight Borel probability measure $\mathscr L$ in $\ell^\infty(\R)$, and if $\mathscr L$ is the law of a centered Gaussian process $\mathfrak G$ with covariance structure $\E\left[\mathfrak G(x)\mathfrak G(y)\right]=\CR(x,y)$ as specified in \eqref{optimalcovariance}, i.e, $\hat\rho_t$ achieves the optimal limiting distribution. \end{definition} Given an asymptotically efficient estimator $\hat \rho_t$ in $\ell^\infty(\R)$ and any bounded, linear functional $b^{*}\colon\ell^\infty(\R)\to\R$, efficiency of the estimator $b^{*}(\hat \rho_t)$ for estimation of $b^{*}(\rho_b)$ then immediately follows. Our next result shows that estimation via $\rho_{t,K}(h)$ for the universal bandwidth choice $h\sim t^{-1/2}$ is suitable for the job. Its proof is given in Section \ref{appeff}. \begin{theorem}\label{theo:eff} The invariant density estimator $\rho_{t,K}(t^{-1/2})$ defined according to \eqref{est:dens} is an asymptotically efficient estimator in $\ell^\infty(\R)$. \end{theorem} \begin{remark} \begin{enumerate} \item[(a)] From the proof of Theorem \ref{theo:eff}, it can be inferred that the local time estimator $t^{-1}L^\bullet_t(X)$ is an asymptotically efficient estimator, as well. \item[(b)] In terms of earlier research on efficient estimation of the density as a function in $\ell^\infty(\R)$, we shall mention \cite{kutoyants98} and \cite{negri01}. The works deal with the efficiency of the local time estimator $t^{-1}L^\bullet_t(X)$ in the LAM sense for certain classes of loss functions. Subject of \cite[Section 8]{kutoyants98} are $L^2(\nu)$ risks for some finite measure $\nu$ on $\R$ of the form $t\E_b\int |\tilde \rho_t(x)-\rho_b(x)|^2 \nu(\d x)$, for estimators $\tilde\rho_t$ of $\rho_b$, whereas \citeauthor{negri01} complements this work for risks of the form $\E_b\left[g\left(\sqrt t \|\tilde\rho_t-\rho_b\|_\infty\right)\right]$ for a class of bounded, positive functions $g$. Of course, the distribution appearing in the lower bound corresponds to the optimal distribution in the sense of the convolution theorem that we derived. The derivation in \cite{kutoyants98} of the lower bound is based on the van Trees inequality as established in \cite{gilllevit95} as an alternative to the classical approach relying on H\'ajek--Le Cam theory. On the other hand, \citeauthor{negri01}'s method follows \cite{millar83} and makes use of the idea of convergence of experiments originally provided by Le Cam. The optimal distribution in the sense of a convolution theorem is not shown neither is any asymptotic efficiency result in $\ell^\infty(\R)$ for the kernel density estimator. \end{enumerate} \end{remark} \section{Minimax optimal adaptive drift estimation wrt $\sup$-norm risk}\label{sec:adapt_einfach} We now turn to the original question of estimating the drift coefficient in a completely data-driven way. The aim of this section is to suggest a scheme for rate-optimal choice of the bandwidth $h$, based on a continuous record of observations $X^t\equiv (X_s)_{0\leq s\leq t}$ of a diffusion as introduced in Definition \ref{def:B}, optimality considered in terms of the $\sup$-norm risk. Since we stick to the continuous framework, our previous concentration results are directly applicable, allowing, e.g., for the straightforward derivation of upper bounds on the variance of the estimator $\overline\rho_{t,K}(h)$ of the order \begin{equation}\label{def:ovsigma} \overline\sigma^2(h,t):=\frac{(\log(t/h))^3}{t}+\frac{\log(t/h)}{th}. \end{equation} Standard arguments provide for any $b\in\Sigma(\beta,\LL)$ bounds on the associated bias of order $B(h)\lesssim h^\beta$. In case of known smoothness $\beta$, one can then easily derive the optimal bandwidth choice $h^*_t$ by balancing the components of the bias-variance decomposition \[\sup_{b\in\Sigma(\beta,\LL)}\E_b\left[\Big\|\overline\rho_{t,K}(h)-\frac{\rho_b'}{2}\Big\|_\infty\right] \leq B(h) + \K\overline\sigma(h,t),\] resulting in $h_t^\ast\sim(\log t/t)^{\frac{1}{2\beta + 1}}$. In order to remove the (typically unknown) order of smoothness $\beta$ from the bandwidth choice, we need to find a data-driven substitute for the upper bound on the bias in the balancing process. Heuristically, this is the idea behind the Lepski-type selection procedure suggested in \eqref{est:band0} below. \paragraph{1.)} Specify the discrete grid of candidate bandwidths \begin{equation}\label{def:cand} \HH \equiv\HH_t\ :=\ \left\{h_k=\eta^{-k}\colon\ k\in \N,\ \eta^{-k}>\frac{(\log t)^{2}}{t}\right\},\quad \eta>1\text{ arbitrary}, \end{equation} and define $\overline\eta_1:=24 \tilde C_2\|K\|_{L^2(\lebesgue)}\bdg\e\sqrt v$, $\overline\eta_2:=12\bdg\|K\|_{L^2(\lebesgue)}$ and \begin{equation}\label{tilm} \tilde M = \tilde M_t\ :=\ C\|\rho_{t,K}(t^{-1/2})\|_\infty,\qquad \text{ for } C=C(K)\ :=\ 20\e^2\left(4\overline\eta_1+2\overline\eta_2\right)^2. \end{equation} \paragraph{2.)} Set \begin{equation}\label{est:band0} \tri h_t\ :=\ \max\Bigg\{h\in\HH\colon \|\overline\rho_{t,K}(h)-\overline\rho_{t,K}(g)\|_\infty\leq \sqrt{\tilde M}\overline\sigma(g,t \,\,\forall g<h,\ g\in\HH\Bigg\}. \end{equation} The constants involved in the definition of $\overline\eta_1$ and $\overline\eta_2$ are explained in Remark \ref{rem:const} in Section \ref{app:a1}. For the proposed data-driven scheme for bandwidth choice, we obtain the subsequent \begin{theorem}\label{theo:est} For $b\in\Sigma(\beta,\LL)$ as introduced in Definition \ref{def:Sigma}, consider the SDE \eqref{SDE}. Given some kernel $K$ satisfying \eqref{kernel}, define the estimators $b_{t,K}(\tri h_t)$ and $\overline\rho_{t,K}(\tri h_t)$ according to \eqref{est:drift}, \eqref{est:derivative} and \eqref{est:band0}. Then, for any $0<\beta+1\leq \alpha$, \begin{align}\nonumber \sup_{b\in\Sigma(\beta,\LL)}\E_b\left[\Big\|\overline\rho_{t,K}(\tri h_t)-\frac{\rho_b'}{2}\Big\|_\infty\right] &\lesssim\ \left(\frac{\log t}{t}\right)^{\frac{\beta}{2\beta+1}},\\\label{21} \sup_{b\in\Sigma(\beta,\LL)}\E_b\left[\left\|(b_{t,K}(\tri h_t)-b)\cdot \rho_b^2\right\|_\infty\right]&\lesssim\ \left(\frac{\log t}{t}\right)^{\frac{\beta}{2\beta+1}}. \end{align} \end{theorem} The suggested estimators for $\rho'_b$ and $b$, respectively, are rate optimal as the following lower bounds imply. \begin{theorem}\label{thm:lowerboundableitung} Let $\beta, \mathcal L,\CC, A, \gamma \in (0,\infty)$, and assume that $\Sigma(\beta,\mathcal L/2,\CC/2,A,\gamma)\neq\emptyset$. Then, \begin{align}\label{lowerboundableitung} \liminf_{t \to \infty} \inf_{\tilde{\partial\rho}_t}\sup_{b\in\Sigma(\beta,\mathcal L)}\E_b\left[\left(\frac{\log t}{t}\right)^{-\frac{\beta}{2\beta +1}}\|\tilde{\partial\rho}_t - \rho'_b\|_\infty\right]&>\ 0,\\\label{lowerbounddrift} \liminf_{t\to\infty}\inf_{\tilde b}\sup_{b\in\Sigma(\beta,\mathcal L)}\E_b\left[\left(\frac{\log t}{t}\right)^{-\frac{\beta}{2\beta + 1}}\left\|(\tilde b - b)\cdot \rho_b^2\right\|_\infty\right]&>\ 0, \end{align} where the infimum is taken over all possible estimators $\tilde{\partial \rho}_t$ of $\rho'_b$ and $\tilde b$ of the drift coefficient $b$, respectively. \end{theorem} The proof of the preceding theorem is based on classical tools from minimax theory as laid down in \cite{tsy09}. Precisely, it relies on the Kullback version of Theorem 2.7 in \cite{tsy09}, his main theorem on lower bounds. This result slightly reformulated in terms of our problem is stated in Lemma \ref{lem:tsybakov}. \section{Simultaneous estimation}\label{sec:sim} The result presented in the previous section is a classical specification of Lepski's procedure which complements the study of one-dimensional drift estimation in the continuous framework. However, as will be shown in the sequel, our techniques allow for results which go beyond classical issues such as minimax optimality. We will adjust the bandwidth selection procedure from Section \ref{sec:adapt_einfach} in such a way that the resulting data-driven bandwidth choice yields an asymptotically efficient estimator of the invariant density and, simultaneously, also gives a drift estimator which achieves the best possible convergence rate in $\sup$-norm loss. The approach is an adaptation of the method developed by \cite{gini09} to the scalar diffusion set-up. \paragraph{1.)} Define the set of candidate bandwidths $\HH=\HH_t$ according to \eqref{def:cand}, and introduce $h_{\min}:=\min\left\{h_k\in\HH\colon k\in\N\right\}$. Set \[ \wideparen M \ :=\ \wideparen M_t\ :=\ C\|\rho_{t,K}(h_{\min)}\|_\infty, \] for the constant $C$ defined in \eqref{tilm}. \paragraph{2.)} Set \begin{align} \begin{split}\label{est:band} \hat h_t&:= \max\Bigg\{h\in\HH\colon \|\overline\rho_{t,K}(h)-\overline\rho_{t,K}(g)\|_\infty\leq \sqrt{\wideparen M}\overline\sigma(g,t)\ \forall g<h,\ g\in\HH\\ &\hspace*{10em}\text{ \textbf{and} } \left\|\rho_{t,K}(h)-\rho_{t,K}(h_{\min})\right\|_\infty\leq\frac{\sqrt h(\log(1/h))^4}{\sqrt t\log t}\Bigg\}. \end{split} \end{align} Our goal is to estimate the invariant density $\rho_b$ and the drift coefficient $b$ via $\rho_{t,K}(\hat h_t)$ and \begin{equation}\label{def_sim_drift_est} \tilde b_{t,K}(\hat h_t)(x)\ :=\ \frac{\overline\rho_{t,K}(\hat h_t)(x)}{\rho_{t,K}(\hat h_{t})(x) + \sqrt{\frac{\log t}{t}}\exp\left(\sqrt{\log t}\right)}, \end{equation} respectively, by means of the simultaneous, adaptive bandwidth choice $\hat h_t$. \begin{theorem}\label{theo:sim} Grant the assumptions of Theorem \ref{theo:est}. Given some kernel $K$ satisfying \eqref{kernel}, define the estimators $\rho_{t,K}(\hat h_t)$, $\overline \rho_{t,K}(\hat h_t)$ and $\tilde b_{t,K}(\hat h_t)$ according to \eqref{est:dens}, \eqref{est:derivative}, \eqref{def_sim_drift_est} and \eqref{est:band}. Then, \begin{equation}\label{sim:1}\tag{$\operatorname{\mathbf{I}}$} \sqrt t\left(\rho_{t,K}(\hat h_t)-\rho_b\right)\ \stackrel{\P_b}{\Longrightarrow}\ \H,\qquad \text{ as } t\to\infty, \end{equation} in $\ell^\infty(\R)$. Furthermore, for any $0<\beta+1\leq \alpha$, \begin{align}\nonumber \sup_{b\in\Sigma(\beta,\LL)}\E_b\left[\Big\|\overline \rho_{t,K}(\hat h_t)-\frac{\rho_b'}{2}\Big\|_\infty\right]&\lesssim\ \left(\frac{\log t}{t}\right)^{\frac{\beta}{2\beta+1}},\\\label{sim:21}\tag{$\operatorname{\mathbf{II}}$} \sup_{b\in\Sigma(\beta,\LL)}\E_b\left[\left\|(\tilde b_{t,K}(\hat h_t)-b)\cdot\rho_b^2\right\|_\infty\right]&\lesssim\ \left(\frac{\log t}{t}\right)^{\frac{\beta}{2\beta+1}}. \end{align} \end{theorem} \begin{remark} It could be argued that this simultaneous procedure is of limited relevance because we have verified that the simple choice $h_t=t^{-1/2}$ is optimal for the kernel density estimator. In particular, an adaptive bandwidth selection procedure is not required, such that it suffices to apply the data-driven selection procedure stated in Section \ref{sec:adapt_einfach} to obtain an optimal bandwidth for the drift estimator. Besides being of theoretical interest, Theorem \ref{theo:sim} still creates added value in relevant aspects. The approach that we demonstrate actually could be extended, e.g., to the framework of multivariate diffusions processes. It is known that in higher dimensions, the kernel invariant density estimator is also rate-optimal, but the optimal bandwidth depends on the unknown smoothness such that it has to be chosen adaptively as it is certainly the case for the drift estimator. In this situation, it is very appealing to have one bandwidth selection procedure that works simultaneously both for invariant density and drift estimation. Our result thus is pioneering work in this direction. \end{remark} \bigskip \begin{appendix} \section{Proof of results on Donsker-type theorems and asymptotic efficiency}\label{appeff} The following result verifies the general conditions for the uniform CLT for diffusion local time given in \cite{vdvvz05} for the class of diffusion processes with $b\in\Sigma(\CC,A,\gamma,1)$. \begin{lemma}\label{lem:gaussexists} For any $b\in\Sigma(\CC,A,\gamma,1)$, it holds \begin{equation}\label{eq:2.7} \sqrt t\left(\frac{L_t^{\bullet}(X)}{t} -\rho_b\right)\ \stackrel{\P_b}{\Longrightarrow}\ \H,\qquad \text{ as } t\to\infty, \end{equation} in $\ell^\infty(\R)$, where $\H$ is a centred Gaussian random map with covariance structure specified in \eqref{cov:H}. \end{lemma} \begin{proof} We verify the conditions of Corollary 2.7 in \cite{vdvvz05} by showing that, for any $b\in\Sigma=\Sigma(\CC,A,\gamma,1)$, \begin{enumerate} \item[$\operatorname{(a)}$] $\int F_b^2(x)(1-F_b(x))^2\d s(x)<\infty$ and \item[$\operatorname{(b)}$] $\lim_{x\to-\infty}\rho^2_b(x)|s(x)|\log\log|s(x)|=0$. \end{enumerate} With regard to (a), note first that, for $y>A$, \[ \frac{1-F_b(y)}{\rho_b(y)}\ =\ \int_y^\infty \exp\left(2\int_y^vb(z)\d z\right)\d v\ \leq\ \int_y^\infty\e^{-2\gamma(v-y)}\d v\ =\ \frac{1}{2\gamma} \] and, for $y<-A$, \[ \frac{F_b(y)}{\rho_b(y)}\ =\ \int_{-\infty}^y \exp\left(-2\int_v^yb(z)\d z\right)\d v\ \leq\ \int_{-\infty}^y\e^{2\gamma(v-y)}\d v\ =\ \frac{1}{2\gamma}. \] Exploiting the relation $\rho_b(\d x) =(s'(x)m(\R))^{-1}\d x$ between the invariant measure and the scale function as well as the speed measure, respectively, we obtain $\d s(x) = (\rho_b(x)m(\R))^{-1}\d x$. Consequently, the above bounds imply that \begin{align*} &\int F_b^2(x)(1-F_b(x))^2\d s(x)\\ &\quad\leq\ \frac{1}{m(\R)}\int_\R \frac{F_b^2(x)(1-F_b(x))^2}{\rho_b(x)}\d x\\ &\quad\leq\ \frac{1}{m(\R)}\bigg[\int_{-\infty}^{-A}\frac{F_b^2(y)}{\rho^2_b(y)}\rho_b(y)\d y+ 2A\sup_{x\in[-A,A]}\rho_b^{-1}(x)+ \int_A^\infty \frac{(1-F_b(y))^2}{\rho^2_b(y)}\rho_b(y)\d y\bigg] < \infty. \end{align*} In order to verify (b), recall first that the scale function $s$ of $X$ is given by \[s(x)=\int_0^x \exp\left(-2\int_0^yb(z)\d z\right)\d y=C_b\int_0^x \frac{1}{\rho_b(y)}\d y,\quad x\in\R .\] Since, for any $b\in\Sigma$, $b(x)\operatorname{sgn}(x)\leq -\gamma$ whenever $|x|>A$, we obtain for $x<-A$ \begin{align*} \rho_b(x)|s(x)|&=\ C_b \rho_b(x)\int_{-A}^0 \frac{1}{\rho_b(y)}\d y\ +\ C_b \int_{x}^{-A} \frac{\rho_b(x)}{\rho_b(y)}\d y\\ &\lesssim\ o(1)+\int_x^{-A} \exp\left(-2\left(\int_x^0 b(z)\d z - \int_y^0 b(z)\d z\right)\right)\d y\\ &\lesssim\ o(1) + \int_x^{-A}\exp\left(-2\int_x^y b(z)\d z\right)\d y\\ &\lesssim\ o(1) + \int_x^{-A}\exp\left(-2\gamma(y-x)\right)\d y\\ &\sim\ o(1) + \frac{1}{2\gamma}\left(1-\exp\left(2\gamma(A+x)\right)\right)\ \sim \ o(1) + \frac{1}{2\gamma}\ =\ O(1), \end{align*} as $x\to-\infty$. Furthermore, for $x<-A$, \begin{align*} \rho_b(x)&=\ C_b^{-1}\exp\left(-2\int_x^0b(y)\d y\right)\ \lesssim \ \exp\left(-2\int_x^{-A}b(y)\d y\right)\\ &\lesssim\ \exp(2\gamma(A+x))\ \lesssim\ \e^{2\gamma x}, \end{align*} and, using the linear growth condition on $b$, \begin{align*} |s(x)|&=\ \int_x^0 \exp\left(2\int_y^0 b(z)\d z\right)\d y\ \lesssim\ \int_x^0\exp \left(2\int_y^{-A}b(z)\d z\right)\d y\\ &\lesssim\ \int_x^0 \exp\left(2C\int_y^{-A}(1-z)\d z\right)\d y\ \lesssim\ \int_x^0\exp(C(y^2-2y))\d y \end{align*} such that $|s(x)|=O\left(1+|x|\exp(4Cx^2)\right)$ and $\log\log|s(x)|=O(x^2)$ as $x\to-\infty$. Finally, \[\rho_b^2(x)\ |s(x)|\ \log\log|s(x)|\ \lesssim \e^{2\gamma x}\ O(1)\ x^2\ =\ o(1)\quad \text{as } x\to-\infty.\] Thus, condition (b) of Theorem 2.6 in \cite{vdvvz05} is satisfied. Consequently, there exists a tight version of the Gaussian process $\H$, and \eqref{eq:2.7} holds true. \end{proof} The remainder of this section is devoted to complementing our study of asymptotic efficiency by stating the remaining proofs. We start with verifying differentiability of the operator $G\ni h\mapsto \rho_{b+h}$. \begin{lemma}\label{lemmadifferentiability} For any $h\in G$, set $H(\cdot):=\int_0^\cdot h(v)\d v$. Then, the operator $h\mapsto \rho_{b+h}$ as a function from $(\ell^\infty(\R)\cap \Lip_{\operatorname{loc}}(\R),\|\cdot\|_\infty)$ to $(\ell^\infty(\R),\|\cdot\|_\infty)$ is Fr\'echet-differentiable at $h=0$ in the sense that \[\|\rho_{b+h}-\rho_b-2\rho_b(H-\mu_b(H))\|_\infty\ =\ o(\|h\|_\infty).\] \end{lemma} \begin{proof Let $h\in \ell^\infty(\R)\cap\Lip_{\operatorname{loc}}(\R)$, and denote by $\rho_{b+h}$ the invariant density corresponding to the diffusion process with drift $b+h$. Note that, for $\|h\|_\infty$ sufficiently small, $b+h\in \Sigma(\tilde\C, \tilde A, \tilde \gamma,1)$ for some positive constants $\tilde\C, \tilde A,\tilde \gamma$. Set \[C_g\ :=\ \int_\R \exp\left(2\int_0^x g(v)\d v\right)\d x,\quad g\in\{b,b+h\},\quad B(\cdot)\ :=\ \int_0^\cdot b(v)\d v. \] Then, for any $x\in\R$, \begin{align*} \rho_{b+h}(x)-\rho_b(x) &=\ C_b^{-1}\e^{2B(x)}\left(\frac{C_b}{C_{b+h}}\ \e^{2H(x)}-1\right)\\ & =\ \rho_b(x)\bigg\{2H(x)+\log\left(\frac{C_b}{C_{b+h}}\right)+\frac{1}{2}\left(2H(x)+\log\left(\frac{C_b}{C_{b+h}}\right)\right)^2\\ &\hspace*{18em}\times \e^{\theta_1(x)\left(\log\left(\frac{C_b}{C_{b+h}}\right)+2H(x)\right)}\bigg\}, \end{align*} for some $\theta_1(x)\in(0,1)$. Moreover, \[ \log\left(\frac{C_b}{C_{b+h}}-1+1\right) \ =\ \frac{C_b}{C_{b+h}}-1+\frac{1/2}{1+\theta_2\left(C_bC_{b+h}^{-1}-1\right)}\left(\frac{C_b}{C_{b+h}}-1\right)^2, \] for some $\theta_2\in(0,1)$. Next, we will show that \[ \frac{C_b-C_{b+h}}{C_{b+h}}\ =\ -2\int H(v)\rho_b(v)\d v+o(\|h\|_\infty). \] Note that \begin{align*} C_b-C_{b+h}&=\ \int\e^{2B(v)}\left(1-\e^{2H(v)}\right)\d v\\ &=\ -\int\e^{2B(v)}\left(2H(v)+\frac{1}{2}\e^{2\theta_3(v)H(v)}4H^2(v)\right)\d v, \quad \theta_3(v)\in(0,1),\\ &=\ -C_b\int 2H(v)\rho_b(v)\d v + o(\|h\|_\infty), \end{align*} where we have used $|H(v)|\leq |v|\|h\|_\infty$, $v\in\R$, as well as the fact $\int\e^{2\int_0^v b(x) + 2|h(x)|\d x}|v|^2\d v=O(1)$. We conclude \begin{align*} \frac{C_b-C_{b+h}}{C_{b+h}}&=\ \frac{-2C_b\mu_b(H)+o(\|h\|_\infty)}{(C_{b+h}-C_b)+C_b}\\ &=\ -2\mu_b(H)+\frac{2\mu_b(H)(C_{b+h}-C_b)}{(C_{b+h}-C_b)+C_b}+\frac{o(\|h\|_\infty)}{C_{b+h}}\\ &=\ -2\mu_b(H)+\frac{o(1)(C_{b+h}-C_b)}{o(1)+C_b}+\frac{o(\|h\|_\infty)}{C_{b+h}}\\ &=\ -2\mu_b(H)+\frac{o(1)O(\|h\|_\infty)+o(\|h\|_\infty)}{o(1)+C_b}+o(\|h\|_\infty)\\ &=\ -2\mu_b(H)+o(\|h\|_\infty). \end{align*} Consequently, $\left(\frac{C_b-C_{b+h}}{C_{b+h}}\right)^2=o(\|h\|_\infty)$, and it follows \[ \log\left(\frac{C_b}{C_{b+h}}\right)= -2\mu_b(H)+o(\|h\|_\infty)+\frac{1}{2}\ O(1)o(\|h\|_\infty)= -2\mu_b(H)+o(\|h\|_\infty). \] Taking everything into consideration, \begin{align*} \rho_{b+h}(x)-\rho_b(x)&=\ \rho_b(x)\bigg\{2(H(x)-\mu_b(H))+o(\|h\|_\infty)\\ &\qquad+\left(2(H(x)-\mu_b(H))+o(\|h\|_\infty)\right)^2\ \frac{1}{2}\e^{2\theta_1(x)H(x)}\e^{\theta_1(x)(-2\mu_b(H)+o(\|h\|_\infty))}\bigg\}, \end{align*} and thus \begin{align*} &\left\|\rho_{b+h}-\rho_b-2\rho_b(H-\mu_b(H))\right\|_\infty\\ &\quad\leq\ o(\|h\|_\infty)+\left\|x\,\mapsto \,\rho_b(x)\left\{16\|h\|_\infty^2x^2+o(\|h\|_\infty)\right\}\e^{2\|h\|_\infty|x|}O(1)\right\|_\infty= o(\|h\|_\infty), \end{align*} using that $\sup_{x\in\R}\rho_b(x)\e^{2\|h\|_\infty|x|}(1+x^2)\ =\ O(1)$. \end{proof} We proceed with verifying the result on the image of the generator $\L_b$ and the expression of $\|\partial \L_b^{-1}(g_c)\|_{\l^2(\mu_b)}$ in terms of $H(x,y)=\E[\H(x)\H(y)]$. Recall that $\H$ denotes the centred Gaussian process with covariance structure specified by \eqref{cov:H}. \begin{proof}[Proof of Lemma \ref{lemma2}] Rewriting $H(x,y)$ as \begin{equation}\label{eq:Hxy} H(x,y)= 4\rho_b(x)\rho_b(y)\int \Bigg[(\mathds{1}\{[x,\infty)\}(z)-F_b(z))\ (\mathds{1}\{[y,\infty)\}(z)-F_b(z))\Bigg]\rho_b^{-1}(z)\d z \end{equation} yields \begin{align*} \iint g(x)H(x,y)g(y)\d y \d x&=\ 4\iint g(x)g(y) \rho_b(x)\rho_b(y) \int h(z,x)h(z,y)\rho_b(z)\d z\d x\d y\\ &=\ \int \left[\int 2g(x)h(z,x)\rho_b(x)dx\right]^2\rho_b(z)\d z\\ &=\ \big\|\int 2g(x)\rho_b(x)h(\cdot,x)\d x\big\|_{\l^2(\mu_b)}^2\ =\ \big\|\frac{\d}{\d z}\ \T(z)\ \big\|_{\l^2(\mu_b)}^2, \end{align*} where \begin{align*} \T(z)&=\ \int_{0}^z \int 2g(x)\rho_b(x)h(u,x)\d x \d u\\ &=\ \int_{0}^z \int_{-\infty}^u 2g(x)\rho_b(x)\frac{1-F_b(u)}{\rho_b(u)}\d x\d u - \int_{0}^z \int_u^\infty 2g(x)\rho_b(x)\d x \frac{F_b(u)}{\rho_b(u)}\d u. \end{align*} Straightforward calculus gives \begin{align*} \T'(z)&=\ -\frac{F_b(z)}{\rho_b(z)}\int_z^\infty 2g(x)\rho_b(x)\d x + \frac{1-F_b(z)}{\rho_b(z)}\int_{-\infty}^z 2g(x)\rho_b(x)\d x,\\ \T''(z)&=\ 2 g(z) - \int2g(x)\rho_b(x)\d x- 2b(z)\T'(z). \end{align*} One can show that $\T$ and its derivatives satisfy an at most linear growth condition, and it is possible to approximate $\T$ by a sequence of functions $\T_n$ in $C_c^\infty$ such that $\lim_{n\to \infty} \|\partial^k\T_n-\partial^k\T\|_{\l^4(\mu_b)}=0,$ $k=0,1,2$. In particular, the at most linear growth condition on $b$ implies that $\T_n$ converges to $\T$ in $\l^2(\mu_b)$ and $\lim_{n\to\infty}\L_b(\T_n)=g-\mu_b(g)$ in $\l^2(\mu_b)$. Since $\L_b $ is a closed operator in $\l^2(\mu_b)$, we can conclude that $\T\in\mathcal D(\L_b )$ and $\L_b(\T)=g-\mu_b(g)$. \end{proof} In Section \ref{subsec:crinv}, the Cram\'er--Rao lower bound for estimating $\Phi_g(\P_b)=\int g(x)\rho_b(x)\d x=\int g\d\mu_b$ is identified as $\|\partial \L_b^{-1}g_c\|_{\l^2(\mu_b)}^2$. The following result establishes the corresponding result for pointwise estimation of the invariant density. \begin{proposition}\label{prop:crpoint} The Cram\'er--Rao lower bound for pointwise estimation of $\rho_b(y)$, $y\in\R$ fixed, is defined via \eqref{CRLBpointwise}. \end{proposition} \begin{proof} Let $v\colon \R\to \R_+$ be a smooth, symmetric function with support $\supp(v)\subseteq [-1,1$] and $\int v(z) \d z=1$, and define $g^y_{\epsilon}:=\epsilon^{-1}v\left((\cdot-y)\epsilon^{-1}\right)$, for any $y\in\R$. Denote by \[\CR(y,\epsilon)\ :=\ \Big\|\frac{\mathrm{d}}{\mathrm d z}L_b^{-1}(g^y_\epsilon-\mu_b(g^y_\epsilon))(z)\Big\|_{\l^2(\mu_b)}^2 \] the Cram\'er--Rao lower bound for estimation of $\int g^y_\epsilon d\mu_b.$ Further, note that \[\lim_{\epsilon\downarrow 0 } \int g^y_\epsilon d\mu_b=\rho_b(y)=b^*_y(\Psi(\P_b)), \text{ for any } y\in\R,\] where the pointwise evaluation $b^*_y:\ell^\infty(\R)\longrightarrow \R, f\mapsto f(y)$, is an element of the dual of $\ell^\infty(\R)$. We are interested in the Cram\'er--Rao lower bound for pointwise estimation of $\rho_b(y)=b^*_y(\Psi(\P_b))$, $y\in\R$. This bound is given by the squared $\l^2(\mu_b)$-norm of the Riesz representer of $b^*_yA'$. Since $A'h$ is a continuous function, we have, for any $y\in\R$, \begin{eqnarray*} b^*_yA'(h)\ =\ \lim_{\epsilon\downarrow 0}\int g^y_\epsilon (x)A'h(x)\d x\ =\ \lim_{\epsilon\downarrow0}-\langle\partial\L^{-1}_b(g^y_\epsilon-\mu_b(g^y_\epsilon)),\ h\rangle_{\mu_b} \end{eqnarray*} due to \eqref{rieszrepresenterableitungintegralfunktional}. We proceed with proving that the limit $\lim_{\epsilon\downarrow 0} \partial L^{-1}_b(g^y_\epsilon - \mu_b(g^y_\epsilon))$ exists in $\l^2(\mu_b)$. Fix $y\in\R$. For any $z\in\R$, $z\neq y$, we have for $\epsilon>0$ small enough \begin{eqnarray*} \partial\L_b^{-1}(g^y_\epsilon-\mu_b(g^y_\epsilon))(z) &=& 2\cdot\mathbbm{1}\{y\leq z\}\frac{1-F_b(z)}{\rho_b(z)}\int_{-\infty}^z g_\epsilon^y(x)\rho_b(x) \d x\\ &&\hspace*{3em} - 2\cdot\mathbbm 1 \{y> z\}\frac{F_b(z)}{\rho_b(z)}\int_z^\infty g_\epsilon^y(x) \rho_b(x)\d x, \end{eqnarray*} due to Lemma \ref{lemma2} and since $\supp( g_\epsilon^y)\subseteq [y-\epsilon,y+\epsilon]$. Moreover, as \[ \max\left\{\sup_{z\in\R}\mathbbm{1}\{y\leq z\}\frac{1-F_b(z)}{\rho_b(z)},\ \sup_{z\in\R}\mathbbm 1 \{y> z\}\frac{F_b(z)}{\rho_b(z)}\right\}<\infty,\] one obtains \[\lim_{\epsilon\downarrow 0 } \partial\L_b^{-1}(g^y_\epsilon-\mu_b(g^y_\epsilon))(z) \ =\ 2\cdot \frac{\mathbbm{1}\{z\geq y \}-F_b(z)}{\rho_b(z)}\rho_b(y)\ =\ 2\rho_b(y) h(z,y) \] a.e.~and in $\l^2(\mu_b)$. We conclude that $b^*_yA'(h)=-\langle2\rho_b(y)h(\cdot,y),h \rangle_{\mu_b}$ such that the assertion follows. \end{proof} We are now in a position to prove asymptotic efficiency as defined in Definition \ref{def:eff} for the kernel invariant density estimator with the `universal' bandwidth choice $t^{-1/2}$. \begin{proof}[Proof of Theorem \ref{theo:eff}] Rewriting the covariance $\E[\H(x),\H(y)]=H(x,y)$ as in \eqref{eq:Hxy}, one immediately sees that the law of $\H$ corresponds to the optimal distribution of the convolution theorem due to \eqref{optimalcovariance}. It remains to prove regularity of the estimator. \paragraph{Regularity of the estimator $\rho_{t,K}(t^{-1/2})(\cdot)$} Fix $y\in\R$. As we have already seen in the proof of Proposition \ref{donskerdensity}, \[\sqrt t\left(\rho_{t,K}(t^{-1/2}) - t^{-1} L^\bullet_t(\X)\right)(y)\ =\ o_{\P_b}(1),\] (see \eqref{convinprop}). We proceed by exploiting the martingale structure obtained from Proposition 1.11 in \cite{kut04}, \begin{align*} &\sqrt t\left(t^{-1}L^y_t(\X) -\rho_b(y)\right)\\ &\quad =\ \frac{2\rho_b(y)}{\sqrt t}\int_{X_0}^{X_t}\frac{\mathbbm 1\{v>y\}-F_b(v)}{\rho_b(v)}\d v - \frac{2\rho_b(y)}{\sqrt t}\int_0^t \frac{\mathbbm 1\{X_u>y\}-F_b(X_u)}{\rho_b(X_u)}\d W_u\\ &\quad =\ \frac{R(X_t,y)}{\sqrt t} - \frac{R(X_0,y)}{\sqrt t} - \frac{2\rho_b(y)}{\sqrt t}\int_0^t \frac{\mathbbm 1 \{X_u>y\}-F_b(X_u)}{\rho_b(X_u)}\d W_u, \end{align*} with $R(x,y):=2\rho_b(y)\int_0^x \frac{\mathbbm 1\{v>y\}-F_b(v)}{\rho_b(v)}\d v$. The process $(X_s)_{s\geq0}$ is stationary under $\P_b$, and therefor \begin{equation*} \frac{R(X_t,y)-R(X_0,y)}{\sqrt t}=o_{\P_b}(1). \end{equation*} Let $h\in G$, and fix $a,c\in\R$. Then, \begin{align*} &(a,c) \left(\sqrt t\left(\rho_{t,K}(t^{-1/2})(y)-\rho_b(y)\right),\log\left(\frac{\d \P_{t,h}}{\d \P_b}\right)\right)\tt\\ &\quad=\ o_{\P_b}(1) - a\cdot 2\frac{\rho_b(y)}{\sqrt t}\int_0^t \frac{\mathbbm 1\{X_u>y\}-F_b(X_u)}{\rho_b(X_u)}\d W_u\\ &\hspace*{10em} + \ c\cdot \left( \frac{1}{\sqrt t}\int_0^th(X_s)\d W_s - \frac{1}{2}\int h^2(y)\rho_b(y)\d y\right)\\ &\quad=\ o_{\P_b}(1) + \frac{1}{\sqrt t}\int_0^t \left(-2a\rho_b(y)k(X_u,y) + ch(X_u)\right)\d W_u - \frac{1}{2}c\int h^2(y)\rho_b(y)\d y\\ &\quad\overset{\P_b}{\Longrightarrow}\ \mathcal N \left(-\frac{c}{2}\int h^2(y)\rho_b(y)\d y, \delta^2\right), \end{align*} with $k(x,y):= \left(\mathbbm 1\{x>y\}-F_b(x)\right)\rho_b^{-1}(x)$ and \begin{align*} \delta^2&=\ \E_b\left[\left( ch(X_0) - 2a\rho_b(y)k(X_0,y)\right)^2\right]\\ &=\ \E_b\left[4a^2\rho^2_b(y)k^2(X_0,y) + c^2h^2(X_0) - 4ac\rho_b(y)k(X_0,y)h(X_0)\right]\\ &=\ (a,c) \begin{pmatrix}\E_b\left[4\rho_b^2(y)k^2(X_0,y)\right] & -\E_b\left[2\rho_b(y)k(X_0,y)h(X_0)\right]\\-\E_b\left[2\rho_b(y)k(X_0,y)h(X_0)\right] & \E_b\left[h^2(X_0)\right] \end{pmatrix} \begin{pmatrix}a\\ c\end{pmatrix}. \end{align*} The Cram\'er--Wold device then implies that \begin{align*} &\left(\sqrt t\left(\rho_{t,K}(t^{-1/2})(y)-\rho_b(y)\right),\log\left(\frac{\d \P_{t,h}}{\d \P_b}\right)\right)\\ &\hspace*{10em} \overset{\P_b}{\Longrightarrow} \mathcal N \left(\begin{pmatrix}0\\ -\frac{1}{2}\E_b(h^2(X_0))\end{pmatrix},\begin{pmatrix}\E_b(4\rho_b^2(y)k^2(X_0,y)) & -\tau\\ -\tau& \E_b(h^2(X_0)) \end{pmatrix}\right), \end{align*} where $\tau:=2\E_b\left[\rho_b(y)k(X_0,y)h(X_0)\right]$. In turn, Le Cam's Third Lemma yields \[\sqrt t\left(\rho_{t,K}(t^{-1/2})(y)-\rho_b(y)\right)\ \overset{\P_{t,h}}{\Longrightarrow}\ \mathcal N \left(-\tau, 4\E_b\left[\rho_b^2(y)k^2(X_0,y)\right]\right).\] Furthermore, \begin{align*} &\sqrt t\left(\rho_{t,K}(t^{-1/2})(y) - \rho_{b+t^{-1/2}h}(y)\right)\\ &\quad= \sqrt t\left(\rho_{t,K}(t^{-1/2})(y) - \rho_{b}(y)\right)- \sqrt t\left(b^*_y(\Psi(\P_{t,h}))-b^*_y(\Psi(\P_b))\right)\\ &\quad= \sqrt t\left(\rho_{t,K}(t^{-1/2})(y) - \rho_{b}(y)\right)+\langle 2 \rho_b(y)h(\cdot,y),h\rangle_{\mu_b}+o(1)\\ &\quad= \sqrt t\left(\rho_{t,K}(t^{-1/2})(y) - \rho_{b}(y)\right)+\tau+o(1)\\ &\quad\overset{\P_{t,h}}{\Longrightarrow}\ \mathcal N\left(0, \ 4\rho_b^2(y)\int \left(\mathbbm 1 \{z\geq y\}-F_b(z)\right)^2\rho_b^{-1}(z) \d z\right)\ =\ \mathcal N\left(0,\ \E\left[\H^2(y)\right]\right). \end{align*} We conclude that $\rho_{t,K}(t^{-1/2})(y)$ is a regular and consequently efficient estimator of $\rho_b(y)$ for any $y\in\R$. \paragraph{Regularity in $\ell^\infty(\R)$} In an analogous way, it can be shown that all finite-dimensional marginals of \begin{equation}\label{eq:regul} \sqrt t\left(\rho_{t,K}(t^{-1/2}) - \rho_{b+t^{-1/2}h}\right) \end{equation} weakly converge to those of $\H$ under $\P_{t,h}$, for any $h\in G$. Therefore, the estimator $\rho_{t,K}(t^{-1/2})$ is also regular in $\ell^\infty(\R)$ if we can show that the process in \eqref{eq:regul} is asymptotically tight. As we have already seen that the limiting distribution is optimal, this then gives efficiency of $\rho_{t,K}(t^{-1/2})$ in $\ell^\infty(\R)$. We proceed as in \cite[Theorem 11.14]{kosorok2008}. Fix $\epsilon >0$. Since $\P_{t,h}$ and $\P_b$ are contiguous, $\d\P_{t,h}/\d\P_b$ is stochastically bounded wrt to both $\P_b$ and $\P_{t,h}$. Hence, we find a constant $M$ such that \[\limsup_{t\to\infty}\P_{t,h}\left(\frac{\d \P_{t,h}}{\d\P_b}>M\right)\ \leq\ \frac{\epsilon}{2}.\] Furthermore, since $\sqrt t(\rho_{t,K}(t^{-1/2})-\rho_{b})$ is asymptotically tight wrt $\P_b$, there exists a compact set $K\subseteq\ell^\infty(\R)$ such that, for any $\delta>0$, \[\limsup_{t\to\infty}\P_b\left(\sqrt t\left(\rho_{t,K}(t^{-1/2}) - \rho_{b}\right)\in \left(\ell^\infty(\R)\setminus K^\delta\right)^*\right)\ \leq\ \frac{\epsilon}{2M},\] $K^\delta$ denoting the $\delta$-enlargement of $K$. The superscript $^*$ here stands for the minimal measurable cover wrt to both $\P_b$ and $\P_{t,h}$. From these choices, we deduce, for any $\delta > 0$, \begin{align*} &\limsup_{t\to\infty}\P_{t,h}\left(\sqrt t\left(\rho_{t,K}(t^{-1/2}) - \rho_b\right)\in \left(\ell^\infty(\R)\setminus K^\delta\right)^*\right)\\ &\quad=\ \limsup_{t\to\infty}\int\mathbbm{1}\left\{\sqrt t\left(\rho_{t,K}(t^{-1/2}) - \rho_b\right)\in \left(\ell^\infty(\R)\setminus K^\delta\right)^*\right\}\d\P_{t,h}\\ &\quad=\ \limsup_{t\to\infty}\int\mathbbm{1}\left\{\sqrt t\left(\rho_{t,K}(t^{-1/2}) - \rho_b\right)\in \left(\ell^\infty(\R)\setminus K^\delta\right)^*\right\} \frac{\d \P_{t,h}}{\d \P_b} \d \P_b\\ &\quad\leq\ \limsup_{t\to\infty} M \int \mathbbm{1}\left\{\sqrt t\left(\rho_{t,K}(t^{-1/2})-\rho_b\right)\in\left(\ell^\infty(\R)\setminus K^\delta\right)^*\right\} \d \P_b\\ &\hspace*{18em}+\limsup_{t\to\infty}\P_{t,h}\left(\frac{\d \P_{t,h}}{\d\P_b}>M\right)\ \leq\ \epsilon. \end{align*} Due to the differentiability property \eqref{differentiability}, we conclude that \eqref{eq:regul} is asymptotically tight wrt $\P_{t,h}$, as well. We have thus shown that $\rho_{t,K}(t^{-1/2})$ is an efficient estimator in $\ell^\infty(\R)$. \end{proof} \bigskip \section{Proofs for adaptive drift estimation} \subsection{Preliminaries}\label{app:a1} We start with stating and proving a number of auxiliary results required for the investigation of the proposed $\sup$-norm adaptive drift estimation procedure. Recall the definition of $\Sigma(\beta,\LL)$ in \eqref{def:Sigmabeta}. \medskip \begin{lemma}\label{biasandvariance} For $b\in\Sigma(\beta,\mathcal{L})$, $\beta,\mathcal{L}>0$, and for $\overline \rho_{t,K}$ defined according to \eqref{est:derivative} with some kernel function $K\colon\R\to\R$ satisfying \eqref{kernel}, it holds, for any $h\in \mathcal H$, \begin{align}\label{eqvar} \sup_{b\in\Sigma(\beta,\mathcal L)}\E_b\left[\|\overline\rho_{t,K}(h)-\E_b\left[\overline\rho_{t,K}(h)\right]\|^2_\infty\right] &\leq\ \K^2\overline{\sigma}^2(h,t),\\\label{eq:bias} \sup_{b\in\Sigma(\beta,\mathcal L)}\|\E_b\left[\overline\rho_{t,K}(h)\right]-\rho_b b\|_\infty &\leq\ B(h), \end{align} where $\K$ denotes some positive constant, $\overline\sigma^2(\cdot,\cdot)$ is defined according to \eqref{def:ovsigma} and \[ B(h):= h^\beta \ \frac{\LL}{2[\beta]!}\ \int|K(v)||v|^\beta\d v.\] \end{lemma} \begin{proof} Assertion \eqref{eqvar} follows immediately from Proposition \ref{prop:csi}. For the bias of $\overline\rho_{t,K}$, classical Taylor arguments imply that (see \cite{gini09}) \[ \sup_{b\in\Sigma(\beta,\mathcal L)}\|\E_b\left[\overline\rho_{t,K}(h)\right]-\rho_b b\|_\infty \ =\ \frac{1}{2}\sup_{x\in\R} \left|\int_\R K_h(x-y)(\rho_b'(y)-\rho_b'(x))\d y\right|\ \leq\ B(h). \] \end{proof} The next two auxiliary results give conditions which allow to translate upper and lower bounds on the $\sup$-norm risk of estimators of $\rho_b'$ into corresponding bounds on the weighted risk of drift estimators. \medskip \begin{lemma}[Weighted upper bounds for drift estimation]\label{lem:decomp} Given $b\in\Sigma(\beta,\mathcal L)$, consider estimators $\rho_t$ and $\overline \rho_t$ of the invariant density $\rho_b$ and $\rho_b'/2$, respectively, fulfilling the following conditions: \begin{itemize} \item[$\operatorname{(E1)}$] $\exists C_1>0$ such that, for any $p\geq1$, \[\sup_{b\in\Sigma(\beta,\mathcal L)}\E_b\left[\|\rho_t-\rho_b\|_\infty^{p}\right]\ \leq \ C_1^pt^{-\frac{p}{2}}\left(1+(\log t)\q + p\q +p^pt^{-\frac{p}{2}}\right);\] \item[$\operatorname{(E2)}$] $\exists C_2>0$ such that $\sup_{b\in\Sigma(\beta,\mathcal L)}\E_b\left[\|\overline\rho_t\|_\infty^2\right]\ \leq\ C_2t^2$; \item[$\operatorname{(E3)}$] $\exists C_3>0$ such that $\sup_{b\in\Sigma(\beta,\mathcal L)}\E_b\left[\|\overline\rho_t-\rho_b'/2\|_\infty\right]\ \leq \ C_3 (\log t/t)^{\beta/(2\beta+1)}$. \end{itemize} Then, the drift estimator \[\widehat b_t(x)\ :=\ \frac{\overline\rho_t(x)}{\rho_t^\ast(x)},\qquad\text{ with } \rho_t^\ast(x):=\rho_t(x)+\sqrt{\frac{\log t}{t}}\exp\left(\sqrt{\log t}\right),\] satisfies \[\sup_{b\in\Sigma(\beta,\mathcal L)}\E_b\left[\|(\hat b_t-b)\ \rho_b^2\|_\infty\right]\ =\ O\left((\log t/t)^{\beta/(2\beta+1)}\right).\] \end{lemma} \begin{proof} For ease of notation, we refrain in the sequel from carrying the $\sup_{b\in\Sigma(\beta,\mathcal L)}$ along. All arguments hold for the supremum because constants in the upper bounds do not depend on the specific choice of $b\in\Sigma(\beta,\mathcal L)$. Introduce the set \[ B_t\ :=\ \left\{\sqrt t\|\rho_t-\rho_b\|_\infty\leq \sqrt{\log t}\exp(\sqrt{\log t})\right\},\quad t>\e. \] For any $p\geq 1$, Markov's inequality and condition (E1) imply that \begin{align*} \P_b(B_t\c) &\leq\ \E_b\left[\|\rho_{t}-\rho_b\|_\infty^p\right]\cdot \left(\frac{t}{\log t}\right)\q\exp(-p\sqrt{\log t})~\\ &\leq\ C_1^pt^{-\frac{p}{2}}\left(1+(\log t)\q + p\q + \left(p/\sqrt t\right)^p\right)\left(\frac{t}{\log t}\right)\q\exp\left(-p\sqrt{\log t}\right)\\ &\leq\ C_1^p \left((\log t)^{-\frac{p}{2}}+1+\left(\frac{p}{\log t}\right)\q+\left(\frac{p}{\sqrt{t\log t}}\right)^p\right)\exp\left(-p\sqrt{\log t}\right). \end{align*} Specifying $p=8\sqrt{\log t}$, one obtains that, for some positive constant $C$, \[ \P_b(B_t\c)\ \leq\ C^{8\sqrt{\log t}}\exp(-8\log t). \] Thus, on the event $B_t\c$, \begin{align*} &\E_b\left[\|(\hat b_t-b)\ \rho_b^2\|_\infty\ \mathds{1}_{B_t\c}\right]\\ &\quad\leq\ \left(\E_b\left[\|\hat b_t\rho_b^2\|_\infty^2\right]\ \P_b(B_t\c)\right)^{1/2}+\E_b\left[\|b\rho_b^2\|_\infty\cdot \mathds{1}_{B_t\c}\right]\\ &\quad\leq\ \sup_{x\in\R}|\rho_b^2(x)|\left(\E_b\left[\|\overline\rho_t\|_\infty^2\right]\ \frac{t}{\log t}\exp(-2\sqrt{\log t})\ \P_b(B_t\c)\right)^{1/2}+\E_b\left[\|b\rho_b^2\|_\infty\cdot \mathds{1}_{B_t\c}\right]\\ &\quad\leq\ \LL^2\left(\E_b\left[\|\overline\rho_t\|_\infty^2\right]\ \frac{t}{\log t}\exp(-2\sqrt{\log t})C^{8\sqrt{\log t}}\exp(-8\log t)\right)^{1/2} +\ \frac{1}{2}\LL^2\P_b(B_t\c)\\ &\quad=\ O\left(\sqrt{C^{8\sqrt{\log t}}\frac{t^3}{\log t}\exp(-8\log t)}+C^{8\sqrt{\log t}}t^{-8}\right)~=~O(t^{-1}). \end{align*} On the other hand, $\E_b\left[\|(\hat b_t-b)\ \rho_b^2\|_\infty\ \mathds{1}_{B_t}\right]\leq A_1+A_2$, for \[ A_1\ :=\ \E_b\left[\Big\|\Big(\hat b_t-\frac{b\rho_b}{\rho_t^\ast}\Big)\ \rho_b^2\Big\|_\infty\cdot \mathds{1}_{B_t}\right],\qquad A_2\ :=\ \E_b\left[\Big\|\Big(\frac{b\rho_b}{\rho_t^\ast}-b\Big)\ \rho_b^2\Big\|_\infty\cdot\mathds{1}_{B_t}\right]. \] Since $\rho_b/\rho_t^\ast\leq 1$ on the event $B_t$, $\operatorname{(E1)}$ and $\operatorname{(E3)}$ imply that \begin{align*} A_1&\leq\ \sup_{x\in\R}|\rho_b(x)|\ \E_b\left[\|\overline\rho_t-\rho_b'/2\|_\infty\right]\ =\ O\left(\left(\frac{\log t}{t}\right)^{\beta/(2\beta+1)}\right),\\ A_2&=\ \E_b\left[\bigg\|\frac{\rho_b'\rho_b}{2\rho_t^\ast}(\rho_b-\rho_t^\ast)\cdot \mathds{1}_{B_t}\bigg\|_\infty\right]\ \leq\ \frac{\LL}{2}\left\{\E_b\left[\|\rho_b-\rho_{t}\|_\infty\right]+\left(\frac{\log t}{t}\right)^{1/2}\exp\left(\sqrt{\log t}\right)\right\}. \end{align*} Summing up, \[ \E_b\left[\|(\hat b_t-b)\ \rho_b^2\|_\infty\right]\ \leq\ O\left(\frac{1}{t}\right)+O\left(\left(\frac{\log t}{t}\right)^{\frac{\beta}{2\beta+1}}\right) +O\left(\sqrt{\frac{\log t}{ t}}\right)+O\left(\sqrt{\frac{\log t}{ t}}\e^{\sqrt{\log t}}\right), \] and the assertion follows. \end{proof} \medskip \begin{lemma}[Weighted lower bounds for drift estimation]\label{lemma:lowdrift} Assume that, for some $\psi_t$ fulfilling $\sqrt{\log t/t}=o(\psi_t)$, it holds \begin{equation}\label{condition:lowdrift} \liminf_{t \to \infty} \inf_{\tilde{\partial\rho^2_t}}\sup_{b\in\Sigma(\beta,\mathcal L)} \E_b\left[\psi_t^{-1}\|\tilde{\partial\rho_t^2} - (\rho_b^2)'\|_\infty\right]\ >\ 0. \end{equation} Then, \[\liminf_{t\to\infty}\inf_{\tilde b}\sup_{b\in\Sigma(\beta,\mathcal L)}\E_b\left[\psi_t^{-1}\left\|(\tilde b - b)\rho_b^2\right\|_\infty\right]\ >\ 0.\] The infimum in the preceding inequalities is taken over all estimators $\tilde{\partial \rho_t^2}$ and $\tilde b$ of $(\rho_b^2)'$ and $b$, respectively. \end{lemma} \begin{proof} Given any estimator $\tilde b$ of the drift coefficient $b$, define \begin{align*} \bar b(x)&:=\ \begin{cases} \tilde b(x), &\text{if } |\tilde b(x)|\leq \C(1+|x|)\\ \text{sgn}(b(x)) \C (1+|x|), &\text{otherwise} \end{cases}, \qquad x\in\R. \end{align*} For any $b\in\Sigma(\beta,\mathcal L)$, it holds $|b(x)|\leq \C (1+|x|)$ for all $x\in\R$. Consequently, \[ \E_b\left[\left\|(\bar b - b)\ \rho^2_b\right\|_\infty\right]\ \leq\ \E_b\left[\big\|(\tilde b - b)\ \rho^2_b\big\|_\infty\right].\] It thus suffices to consider the infimum over all estimators $\tilde b$ satisfying \begin{equation}\label{estimatoratmostlinear} |\tilde b(x)|\leq \C (1+|x|),\quad x\in\R. \end{equation} In view of the decomposition \[ \tilde b\rho_{t,K}(t^{-\frac{1}{2}})\rho_b - \frac{1}{2}\rho_b'\rho_b\ =\ \frac{1}{2}\rho_b\left(2\tilde b\rho_b-\rho_b'\right) + \tilde b\rho_b\left(\rho_{t,K}(t^{-\frac{1}{2}})-\rho_b\right), \] it holds \[ \E_b\left[\big\|(\tilde b - b)\ \rho_b^2\big\|_\infty\right]\ =\ \E_b\left[\big\|\frac{1}{2}\rho_b\left(2\tilde b\rho_b-\rho_b'\right)\big\|_\infty\right]\ \geq\ (\I) - (\II), \] with \[ (\I):=\frac{1}{4}\E_b\left[\big\|4\tilde b\rho_{t,K}(t^{-\frac{1}{2}})\rho_b - 2\rho_b'\rho_b\big\|_\infty\right],\qquad (\II):=\E_b\left[\big\|\tilde b\rho_b\left(\rho_{t,K}(t^{-\frac{1}{2}})-\rho_b\right)\big\|_\infty\right]. \] Due to \eqref{estimatoratmostlinear}, $\sup_{b\in\Sigma(\beta,\mathcal L)}|\tilde b\rho_b|$ is bounded. Moreover, we can infer from Proposition \ref{prop:con_kernel_density_estimator} that there exists a positive constant $C_1$ such that, for all $t$ sufficiently large, $(\II)\ \leq \ C_1 \sqrt{\log t/t}$. Consequently, noting that $4\tilde b\rho_{t,K}(t^{-\frac{1}{2}})\rho_b$ can be viewed as an estimator of $2\rho'_b\rho_b=(\rho^2_b)'$, \begin{align*} \liminf_{t\to\infty}\inf_{\tilde b}\sup_{b\in\Sigma(\beta,\mathcal L)}\E_b\left[\psi_t^{-1}\left\|(\tilde b - b)\ \rho_b^2\right\|_\infty\right] &\geq\ \liminf_{t\to\infty}\inf_{\tilde b}\sup_{b\in\Sigma(\beta,\mathcal L)} \psi_t^{-1}((\I)-(\II))\\ &\geq\ \liminf_{t\to\infty}\inf_{\tilde b}\sup_{b\in\Sigma(\beta,\mathcal L)} \left(\psi_t^{-1}(\I) - C_1 \psi_t^{-1}\sqrt{\frac{\log t}{ t}}\right)\\ &>\ 0. \end{align*} \end{proof} Proposition \ref{prop:csi} presented in Section \ref{sec:pre} gives one first result on the concentration behaviour of the estimator $\overline{\rho}_{t,K}(h)$ of $\rho_b'/2$. It follows from a straightforward application of the developments in \cp. Note that, for any bandwidth $h=h_t\in(t^{-1}(\log t)^2,\ (\log t)^{-3})$ and any $u=u_t\in[1,\alpha\log t]$, $\alpha>0$, the function $\phi_{t,h}(u)$ introduced in \eqref{phith} fulfills \[\phi_{t,h}(u)\ =\ \Upsilon_1\sqrt{\frac{\log(ut/h)}{th}}+ \Upsilon_2\sqrt{\frac{u}{th}}+o\left(\sqrt{\frac{\log(ut/h)}{th}}\right).\] For the construction of an adaptive estimation procedure which yields rate-optimal drift estimators, we need to specify the constants $\Upsilon_1$ and $\Upsilon_2$. The subsequent Lemma provides the corresponding result. Its proof relies on a modification of the proof of Theorem 18 in \cp. \medskip \begin{lemma}[Tail bounds with explicit constants]\label{lem:erg_prop:csi} Grant the assumptions of Proposition \ref{prop:csi}, and define the estimator $\overline\rho_{t,K}$ according to \eqref{est:derivative}. Then, for any $h=h_t\in \left(t^{-1}(\log t)^2, (\log t)^{-3}\right)$, $1\leq u=u_t\leq \alpha\log t$, for some $\alpha>0$, and $t$ sufficiently large, it holds \begin{equation}\label{con_stoch_int_special} \P_b\left(\sup_{x\in\R}|\overline\rho_{t,K}(h_t)(x)-\E_b\left[\overline \rho_{t,K}(h_t)(x)\right]|>\e\overline\psi_{t,h_t}(u_t)\right)\ \leq\ \e^{-u_t}, \end{equation} with \[ \overline\psi_{t,h}(u):=\sqrt{\|\rho_b\|_\infty}\left\{2\overline\eta_1 \sqrt{\frac{\log(ut/h)}{th}}+\overline\eta_2\sqrt{\frac{u}{th}}\right\}, \] for $\overline\eta_1=24 \tilde C_2\|K\|_{L^2(\lebesgue)}\bdg\e\sqrt v$ and $\overline\eta_2=12\bdg\|K\|_{L^2(\lebesgue)}$. \end{lemma} \begin{proof} Let us first prove that there exist constants $\co_1,\tilde\co_0$ such that, for any $u,p\geq 1$, $h\in (0,1)$, $t\geq 1$, \begin{align} \begin{split}\label{lem:con_stoch_int} \left(\E_b\left[\|\overline{\rho}_{t,K}(h)-\E_b\left[\overline{\rho}_{t,K}(h)\right]\|_\infty^p\right]\right)\p& \leq\ \tilde \phi_{t,h}(p),\\ \P_b\left(\sup_{x\in\R}|\overline\rho_{t,K}(h)(x)-\E_b\overline \rho_{t,K}(h)(x)|>\e\tilde\phi_{t,h}(u)\right)& \leq\ \e^{-u}, \end{split} \end{align} for \begin{align*} \tilde\phi_h(u)\ &:=\ \co_1 \Bigg\{ \frac{1}{\sqrt t}\Big\{\left(\log \left(\frac{ut}{h}\right)\right)^{3/2}+\left(\log\left(\frac{ut}{h}\right)\right)^{1/2}+u^{3/2}\Big\}+\frac{u}{th}+ \frac{1}{h} \exp\left(-\tilde\co_0 t \right)\\ &\qquad+ \frac{1}{t^{3/4}\sqrt h}\log\left(\frac{ut}{h}\right)+\frac{1}{\sqrt{th}} \left\{\left(\frac{\log t}{t}\right)^{1/4}\sqrt u + \frac{u}{t^{1/4}} \right\}\Bigg\}\\ &\qquad + \,\,\overline\eta_1\sqrt{\|\rho_b\|_\infty}\frac{1}{\sqrt{th}}\left(\log\left(\frac{ut}{h}\right)\right)^{1/2} + \overline\eta_2 \sqrt{\|\rho_b\|_\infty}\left(\frac{u}{th}\right)^{1/2}. \end{align*} This statement parallels assertion \eqref{con_stoch_int} from Proposition \ref{prop:csi}. It remains however to identify the constants preceding the terms $(th)^{-1/2}\left(\log(ut/h)\right)^{1/2}$ and $(u/th)^{1/2}$ as $\sqrt{\|\rho_b\|_\infty}\overline\eta_1$ and $\sqrt{\|\rho_b\|_\infty}\overline\eta_2$, respectively. This requires to look into the details of the proof of Theorem 5 in \cp. In our situation, $\mathcal F$ is definded as in \eqref{functionclass}. First, note that the term $\frac{1}{\sqrt{th}}\left(\log\left(\frac{ut}{h}\right)\right)^{1/2}$ comes from the analysis of the martingale $(th)^{-1}\int_0^t K\left(\frac{y-X_s}{h}\right)\d W_s$. We repeat the arguments from the proof of Theorem 5 in \cp, here, to discover the required constant. The Burkholder--Davis--Gundy inequality as stated in Proposition 4.2 in \cite{bayo82} and the occupation times formula yield, for any $p\geq2$, $f\in\FF$, \begin{align*} &\left(\E_b\left[\left|\frac{1}{\sqrt t}\int_0^tf(X_s)\d W_s\right|^p\right]\right)^{\frac{1}{p}}\\ &\quad\leq\ \bdg \sqrt p\left(\E_b\left[\left(\frac{1}{t}\int_0^tf^2(X_s)\d s\right)^{\frac{p}{2}}\right]\right)^{\frac{1}{p}}\\ &\quad\leq\ \bdg \sqrt p\|f\|_{L^2(\lebesgue)}\left(\E_b\left[\left(\|t^{-1} L_t^\bullet(X)\|_\infty\right)^{\frac{p}{2}}\right]\right)^{\frac{1}{p}}\\ &\quad\leq\ \bdg \sqrt p\|f\|_{L^2(\lebesgue)}\left\{\left(\E_b\left[\left(\|t^{-1}L_t^\bullet(X)-\rho_b\|_\infty\right)^{\frac{p}{2}}\right]\right)^{\frac{1}{p}} + \sqrt{\|\rho_b\|_\infty}\right\}, \end{align*} where $\bdg:=\sqrt 2\max\left\{1,\overline{\bdg}\right\}$, for $\overline{\bdg}$ denoting a universal constant from the BDG inequality. Exploiting the result on centred diffusion local time from Lemma \ref{lem:difflt}, one can deduce that there exists another constant $\co_2>0$ such that, for $\V=\sqrt h\|K\|_{L^2(\lebesgue)}$, \begin{align*} &2\sup_{f\in\FF}\left(\E_b\left[\Big|\frac{1}{\sqrt t}\int_0^t f(X_s)\d W_s\Big|^p\right]\right)\p\\ &\quad\leq\ 2\bdg\sqrt p\mathbb V\left(\sqrt{\|\rho_b\|_\infty} + \co_2\left(\left(\frac{\log t}{t}\right)^{1/4} + \left(\frac{p}{t}\right)^{1/4} + \sqrt{\frac{p}{t}}\right)\right)\\ &\quad\leq\ 2\bdg\mathbb V\left(\sqrt{\|\rho_b\|_\infty} + \co_2\left(\frac{\log t}{t}\right)^{1/4} \right) \sqrt p+4t^{-1/4}\bdg\mathbb V\co_2p. \end{align*} Using similar arguments, the latter is verified for $1\leq p<2$. Furthermore, for any $f,g\in\FF$, it can be shown analogously that \begin{align*} \left(\E_b\left[\Big|\frac{1}{\sqrt t}\int_0^t (f-g)(X_s)\d W_s\Big|^p\right]\right)\p &\leq\ 2\bdg\|f-g\|_{L^2(\lebesgue)}\\ &\quad\times\left\{\sqrt p \left(\sqrt{\|\rho_b\|_\infty} + \co_2\left(\frac{\log t}{t}\right)^{1/4}\right)+\frac{2\co_2p}{t^{1/4}}\right\}. \end{align*} Applying the generic chaining method and the localisation procedure as in \cp, one can then verify that \begin{align*} &\frac{1}{\sqrt t}\left(\E_b\left[\left\|\int_0^t K\left(\frac{\cdot-X_s}{h}\right)\d W_s\right\|_\infty^p\right]\right)\p\\ &\quad \leq\ \frac{\tilde C_1}{t^{1/4}}\sum_{k=0}^{\infty} \int_0^\infty \log N(u,\mathcal F_k, 4\bdg\co_2\e\|\cdot\|_{\L^2(\lebesgue)})\d u\,\,\e^{-\frac{k}{2}}\\ &\quad\quad+ \tilde C_2\sum_{k=0}^{\infty} \int_0^\infty \sqrt{\log N\left(u,\mathcal F_k, 2\bdg\Big(\sqrt{\|\rho_b\|_\infty}+\co_2\left(\frac{\log t}{t}\right)^{1/4}\Big) \e\|\cdot\|_{\L^2(\lebesgue)}\right)}\d u\,\,\e^{-\frac{k}{2}}\\ &\quad\quad+ 12\bdg\V\left(\sqrt{\|\rho_b\|_\infty} + \co_2\left(\frac{\log t}{t}\right)^{1/4}\right) \sqrt p + \frac{24\bdg\V\co_2p}{t^{1/4}}\\ &\quad\leq\ \frac{6\tilde C_1}{t^{1/4}}v\V\ 4\bdg\co_2\e\left(1+\log\left(\frac{\mathbbm A}{\V}\sqrt{\mathcal S + p\Lambda t}\right)\right)+ \mathbf{(A)}+\mathbf{(B)}+\frac{24\bdg\V\co_2p}{t^{1/4}}, \end{align*} with \begin{align*} \mathbf{(A)}&:=\ 12\tilde C_2\V \ 2\bdg\left(\sqrt{\|\rho_b\|_\infty}+\co_2\left(\frac{\log t}{t}\right)^{1/4}\right)\e\sqrt{v\log\left(\frac{\mathbbm A}{\V}\sqrt{\mathcal S+p\Lambda t}\right)},\\ \mathbf{(B)}&:=\ 12\bdg\V\left(\sqrt{\|\rho_b\|_\infty}+\co_2\left(\frac{\log t}{t}\right)^{1/4}\right)\sqrt p \end{align*} for $\mathbbm A$ and $\mathcal S$ defined as in the proof of Proposition \ref{prop:csi} and some positive constant $\Lambda$. For some further positive constants $\co_3,\co_4$, we can then upper bound \begin{align*} \frac{\mathbf{(A)}}{\sqrt t h} &\leq\ \co_3\left(\frac{1}{\sqrt{th}}+\frac{(\log(pt/h))^{3/4}}{t^{3/4}\sqrt h}\right)+\overline\eta_1\sqrt{\|\rho_b\|_\infty\ \frac{\log(pt/h)}{th}},\\ \frac{\mathbf{(B)}}{\sqrt t h} &\leq\ \co_4\frac{1}{\sqrt{th}}\left(\frac{\log t}{t}\right)^{1/4}\sqrt p+\overline \eta_2\sqrt{\|\rho_b\|_\infty}\sqrt{\frac{p}{th}}. \end{align*} Thus, with regard to the upper bound for $\left(\E_b\left[\|\overline{\rho}_{t,K}(h_t)-\E_b\left[\overline{\rho}_{t,K}(h_t)\right]\|_\infty^p\right]\right)\p$, the constants preceding the terms $(th)^{-1/2}\sqrt{\log(pt/h)}$ and $\sqrt{p/(th)}$ are identified as $\sqrt{\|\rho_b\|_\infty}\overline\eta_1$ and $\sqrt{\|\rho_b\|_\infty}\overline\eta_2$, respectively. Furthermore, we obtained the additional expression $(th)^{-1/2}(\log t/t)^{1/4} \sqrt p$, and assertion \eqref{lem:con_stoch_int} follows. In order to show \eqref{con_stoch_int_special}, note finally that in case of $h_t\in \left((\log t)^2t^{-1},(\log t)^{-3}\right)$ and $1\leq u_t\leq \alpha\log t$, $\alpha>0$, it holds \[ \tilde\phi_{t,h_t}(u_t)\ =\ o\left(\frac{1}{\sqrt{th_t}}\sqrt{\log\left(\frac{u_tt}{h_t}\right)}\right) + \overline\eta_1\sqrt{\|\rho_b\|_\infty}\frac{1}{\sqrt{th_t}}\sqrt{\log\left(\frac{u_t t}{h_t}\right)}+\overline\eta_2 \sqrt{\|\rho_b\|_\infty\cdot \frac{u_t}{th_t}}. \] Thus, $\tilde\phi_{t,h_t}(u_t)\leq \overline\psi_{t,h_t}(u_t)$ for $t$ sufficiently large. \end{proof} \begin{remark}\label{rem:const} We shortly comment on the constants appearing in the definition of $\overline\eta_1$ and $\overline\eta_2$ in Lemma \ref{lem:erg_prop:csi}. The constant $\bdg$ is defined as $\bdg=\sqrt 2\max\left\{1,\overline{\bdg}\right\}$, for $\overline{\bdg}$ denoting the universal constant from the Burkholder--Davis--Gundy inequality as stated in Proposition 4.2 in \cite{bayo82}. The constant $\tilde C_2$ originates from the application of Proposition \ref{thm:dirk} and can be specified looking into the details of the proof in \cite{dirk15}. The constant $v$ is associated with the entropy condition on $\mathcal F$ defined as in $\eqref{functionclass}$ (see Lemma 23 in \cp). \end{remark} \subsection{Proof of main results} This section contains the proof of the upper and lower bound results on minimax optimal drift estimation wrt $\sup$-norm risk presented in Section \ref{sec:adapt_einfach} and Section \ref{sec:sim}. \begin{proof}[Proof of Theorem \ref{theo:est}] In order to prove \eqref{21}, it suffices to investigate the estimator $\overline \rho_{t,K}(\tri h_t)$ since conditions (E1) and (E2) from Lemma \ref{lem:decomp} are satisfied. Indeed, the first condition refers to the rate of convergence of the invariant density estimator, and it is fulfilled by the kernel density estimator $\rho_{t,K}$ with bandwidth $t^{-1/2}$ due to Proposition \ref{prop:con_kernel_density_estimator}. Note that $b\in\Sigma(\beta,\mathcal L)$ in the current paper refers to H\"older continuity of $\rho_b$ with parameter $\beta + 1$ in contrast to the notation in \cp. With regard to (E2), Lemma \ref{biasandvariance} implies that \begin{align*} \sup_{b\in\Sigma(\beta,\LL)}\E_b\left[\|\overline{\rho}_{t,K}(\tri h_t)\|^2_\infty\right] &\leq \sup_{b\in\Sigma(\beta,\LL)}\Big(4\E_b\left[\|\overline{\rho}_{t,K}(\tri h_t)-\E_b\left[\overline{\rho}_{t,K}(\tri h_t)\right]\|^2_\infty\right]\\ &\hspace*{3em} + 4\|\E_b\left[\overline{\rho}_{t,K}(\tri h_t)\right]-b\rho_b\|^2_\infty + 4\|b\rho_b\|_\infty^2\Big)\\ &\lesssim\ \overline\sigma^2(h_{\min},t)+B(1) + 1\ =\ O(1)\quad \text{ as } t\to\infty, \end{align*} since $1>\tri h_t\geq h_{\min}=\min\left\{h_k\in\mathcal H\colon k\in \N\right\} > (\log t)^2/t$ and $\|\rho_bb\|_\infty = \|\rho'_b\|_\infty/2\leq \mathcal L$. Hence, (E2) is satisfied. Consequently, \eqref{21} will follow once we have verified condition (E3) from Lemma \ref{lem:decomp}, i.e., by showing that \[\sup_{b\in\Sigma(\beta,\LL)} \E_b\left[\|\overline \rho_{t,K}(\tri h_t)-\rho_b'/2\|_\infty\right] \ =\ O\left(\left(\frac{\log t}{t}\right)^{\frac{\beta}{2\beta+1}}\right).\] For $C=C(K)$ introduced in \eqref {tilm}, let $M:=C\|\rho_b\|_\infty$, and define $\overline h_{\rho}:=h(\rho_b')$ as \[ \overline h_{\rho}\ :=\ \max\left\{h\in\mathcal{H}\colon B(h)\ \leq\ \frac{\sqrt{0.8M}}{4}\ \overline\sigma(h,t)\right\}. \] For the given choice of $\overline h_{\rho}$, it holds $B(\overline h_{\rho})\ \simeq\ \sqrt{0.8M}\overline\sigma(\overline h_{\rho},t)/4$, and, since $\mathcal{H}\ni\overline h_{\rho}> (\log t)^2/t$, \begin{equation}\label{rate_h_rho} \overline h_{\rho}^{2\beta+1}\simeq(\log t/t)\quad\text{ and }\quad\overline\sigma(\overline h_{\rho},t)\simeq (\log t/t)^{\frac{\beta}{2\beta+1}}. \end{equation} To see this, first note that, for $h_0:=(\log t/t)^{\frac{1}{2\beta +1}}$, there exists some positive constant $L$ such that $B(h_0)\leq L\overline\sigma(h_0,t)$ and $\overline\sigma^2(h_0,t)\eqsim(\log t/t)^{\frac{2\beta}{2\beta +1}}$. In particular, we have $\overline h_\rho\gtrsim h_0$ which is clear by definition of $\overline h_\rho $ in case that $L\leq \sqrt{0.8M}/4$. Otherwise, this follows from the fact that, for any $0<\lambda<1$, \[B(\lambda h_0)=\lambda^\beta B(h_0)\leq \lambda^\beta L\overline\sigma(h_0,t)\leq \lambda^\beta L\overline\sigma(\lambda h_0,t).\] For the validity of \eqref{rate_h_rho}, it remains to show that $\overline h_\rho\lesssim h_0$. We prove that $\overline h_\rho^{2\beta +1 }h_0^{-(2\beta + 1)}= O(1)$. By definition, we have \begin{equation}\label{comment2} \overline h_\rho^{2\beta+1}\ \eqsim\ \frac{\overline h_\rho}{t}\ \left(\log\left(\frac{t}{\overline h_\rho}\right)\right)^3 + \frac{1}{t}\log\left(\frac{t}{\overline h_\rho}\right) \ \lesssim\ \frac{\overline h_\rho}{t}\left(\log t\right)^3 + \frac{\log t}{t}, \end{equation} since, for any $h\in\mathcal H$, $h\geq (\log t)^2/t$. This implies that $\overline h_\rho^{2\beta +1}h_0^{-(2\beta + 1)}\lesssim \overline h_\rho (\log t)^2 + 1$. Again exploiting \eqref{comment2}, we deduce that \begin{align*} \overline h_\rho (\log t)^2 &\lesssim\ (\log t)^2\left(\frac{\overline h_\rho}{t}(\log t)^3 + \frac{\log t}{t}\right)^{\frac{1}{2\beta + 1}}\\ &\lesssim\ (\log t)^2t^{-\frac{1}{2\beta+1}}\left(\overline h_\rho(\log t)^3 + \log t\right)^{\frac{1}{2\beta + 1}}\\ &\lesssim\ (\log t)^2t^{-\frac{1}{2\beta + 1}}\left((\log t)^3 + \log t \right)^{\frac{1}{2\beta + 1}}\ =\ o(1). \end{align*} Thus, $\overline h_\rho^{2\beta +1 }h_0^{-(2\beta + 1)}= O(1)$, and we have shown \eqref{rate_h_rho}. \medskip \textbf{Case 1:} We first consider the situation where $\{\tri h_t\geq \overline h_{\rho}\}$. The definition of $\tri h_t$ according to \eqref{est:band0} and the bias and variance estimates in \eqref{eq:bias} and \eqref{eqvar}, respectively, imply that \begin{align*} &\E_b\left[\|\overline\rho_{t,K}(\tri h_t)-\rho_b'/2\|_\infty\ \mathds{1}_{\{\tri h_t\geq \overline h_{\rho}\}\cap\{\tilde M\leq 1.2M\}}\right]\\ &\quad \leq\ \E_b\bigg[\Big(\|\overline\rho_{t,K}(\tri h_t)-\overline\rho_{t,K}(\overline h_{\rho})\|_\infty+ \|\overline\rho_{t,K}(\overline h_{\rho})-\E_b\left[\overline\rho_{t,K}(\overline h_{\rho})\right]\|_\infty\\ &\hspace*{10em} +\|\E_b\left[\overline\rho_{t,K}(\overline h_{\rho})\right]-\rho_b'/2\|_\infty\Big)\ \mathds{1}_{\{\tri h_t\geq \overline h_{\rho}\}\cap\{\tilde M\leq 1.2 M\}}\bigg]\\ &\quad \leq\ \sqrt{1.2 M}\ \overline \sigma(\overline h_{\rho},t)+\K\overline\sigma(\overline h_{\rho},t)+\frac{\sqrt{0.8M}}{4}\ \overline\sigma(\overline h_{\rho},t)\ = \ O(\overline \sigma(\overline h_{\rho},t)). \end{align*} Similarly, \begin{align*} &\E_b\left[\|\overline\rho_{t,K}(\tri h_t)-\rho_b'/2\|_\infty\ \mathds{1}_{\{\tri h_t\geq \overline h_{\rho}\}\cap\{\tilde M> 1.2M\}}\right]\\ &\quad\leq\ \sum_{h\in\mathcal{H}\colon h\geq \overline h_{\rho}}\E_b\Big[\left(\|\overline\rho_{t,K}(h)-\E_b\left[\overline\rho_{t,K}(h)\right]\|_\infty+B(h)\right)\ \mathds{1}_{\{\tri h_t=h\}\cap\{\tilde M>1.2M\}}\Big]\\ &\quad\lesssim\ \log t \left(\K\overline\sigma(\overline h_{\rho},t)+B(1)\right)\ \sqrt{\E_b\left[\mathds{1}\{\tilde M>1.2M\}\right]}. \end{align*} The function $\psi_{t,t^{-1/2}}$ introduced in \eqref{def:psi} obviously fulfills $\psi_{t,t^{-1/2}}(\log t) = o(1).$ Plugging in the definition of $\tilde M$ (see \eqref{tilm}), one thus obtains by means of Proposition \ref{prop:con_kernel_density_estimator}, for $t$ sufficiently large, \begin{align} \begin{split}\label{eq:m} \P_b\left(|\tilde M-C\|\rho_b\|_\infty|>0.2C\|\rho_b\|_\infty\right) &=\ \P_b\left(\left|\|\rho_{t,K}(t^{-1/2})\|_\infty-\|\rho_b\|_\infty\right| >0.2\|\rho_b\|_\infty\right)\\ &\leq\ \P_b\left(\|\rho_{t,K}(t^{-1/2})-\rho_b\|_\infty >\e\psi_{t,t^{-1/2}}(\log t)\right)\\ &\leq\ \ t^{-1}. \end{split} \end{align} Consequently, we have shown that \[ \E_b\left[\|\overline\rho_{t,K}(\tri h_t)-\rho_b'/2\|_\infty\ \mathds{1}_{\{\tri h_t\geq \overline h_{\rho}\}}\right]\ =\ O(\overline \sigma(\overline h_\rho,t)). \] \medskip \textbf{Case 2:} It remains to consider the case $\{\tri h_t< \overline h_{\rho}\}$. Decomposing again as in the proof of Theorem 2 in \cite{gini09}, we have \begin{align*} &\E_b\left[\|\overline\rho_{t,K}(\tri h_t)-\rho_b'/2\|_\infty\ \mathds{1}_{\{\tri h_t< \overline h_{\rho}\}\cap\{\tilde M< 0.8M\}}\right]\\ &\quad\leq\ \sum_{h\in\mathcal{H}\colon h< \overline h_{\rho}}\E_b\Big[\left(\|\overline\rho_{t,K}(h)-\E_b\left[\overline\rho_{t,K}(h)\right]\|_\infty+B(h)\right)\ \mathds{1}_{\{\tri h_t=h\}\cap\{\tilde M<0.8M\}}\Big]\\ &\quad\lesssim\ \log t \left(\K\overline\sigma(h_{\min},t)+B(\overline h_{\rho})\right)\ \sqrt{\E_b\left[\mathds{1}\{\tilde M<0.8M\}\right]}\ =\ O(\overline \sigma(\overline h_\rho,t)), \end{align*} where we used \eqref{eq:m} for deriving the last inequality. Furthermore, \begin{align*} &\E_b\left[\|\overline\rho_{t,K}(\tri h_t)-\rho_b'/2\|_\infty\ \mathds{1}_{\{\tri h_t< \overline h_{\rho}\}\cap\{\tilde M\geq 0.8M\}}\right]\\ &\quad \leq \sum_{h\in\mathcal{H}\colon h< \overline h_{\rho}} \E_b\Big[\left(\|\overline\rho_{t,K}(h)-\E_b\left[\overline\rho_{t,K}(h)\right]\|_\infty+\|\E_b\left[\overline\rho_{t,K}(h)\right]-\rho'_b/2\|_\infty\right)\ \mathds{1}_{\{\tri h_t=h\}\cap\{\tilde M\geq0.8M\}}\Big]\\ &\quad\leq \sum_{h\in\mathcal{H}\colon h<\overline h_{\rho}}\K\overline\sigma(h,t)\cdot\sqrt{\P_b\left(\{\tri h_t=h\}\cap\{0.8M\leq \tilde M\}\right)}+ B(\overline h_{\rho}). \end{align*} Since the latter summand is of order $O(\overline\sigma(\overline h_{\rho},T))$, we may focus on bounding the first term. Using again the arguments of \cite{gini09}, the proof boils down to verifying that the term \[ (\mathbf{I}):=\sum_{g\in\HH\colon g\leq h} \P_b\left(\|\overline\rho_{t,K}(h^+)-\overline\rho_{t,K}(g)\|_\infty>\sqrt{0.8 M}\overline\sigma(g,t)\right), \] with $h^+:=\min\{g\in\mathcal{H}:\, g>h\}$, satisfies \[ \sum_{h\in\HH\colon h<\overline h_{\rho}}\overline\sigma(h,t)\sqrt{(\mathbf{I})}\ =\ O(\overline\sigma(\overline h_{\rho},t)). \] Analogously to \cite{gini09}, we start by noting that, for $g<h^+\leq \overline h_\rho$, \begin{align*} &\|\overline \rho_{t,K}(h^+)-\overline\rho_{t,K}(g)\|_\infty\\ &\qquad\leq\ \|\overline \rho_{t,K}(h^+)-\E_b\left[\overline\rho_{t,K}(h^+)\right]\|_\infty + \|\overline \rho_{t,K}(g)-\E_b\left[\overline\rho_{t,K}(g)\right]\|_\infty +B(h^+)+B(g)\\ &\qquad\leq\ \|\overline \rho_{t,K}(h^+)-\E_b\left[\overline\rho_{t,K}(h^+)\right]\|_\infty + \|\overline \rho_{t,K}(g)-\E_b\left[\overline\rho_{t,K}(g)\right]\|_\infty +\frac{1}{2}\sqrt{0.8M}\overline\sigma(g,t). \end{align*} Thus, \begin{align*} &\P_b\left(\|\overline\rho_{t,K}(h^+)-\overline\rho_{t,K}(g)\|_\infty>\sqrt{0.8 M}\overline\sigma(g,t)\right)\\ &\qquad\leq\ \P_b\left(\|\overline\rho_{t,K}(h^+)-\E_b\left[\overline \rho_{t,K}(h^+)\right]\|_\infty>\frac{\sqrt{0.8 M}}{4}\overline\sigma(h^+,t)\right)\\ &\hspace*{8em}+ \P_b\left(\|\overline\rho_{t,K}(g)-\E_b\left[\overline\rho_{t,K}(g)\right]\|_\infty>\frac{\sqrt{0.8 M}}{4}\overline\sigma(g,t)\right). \end{align*} We want to apply Lemma \ref{lem:erg_prop:csi} for bounding the last two terms, and for doing so, we verify that \[\e\overline\psi_{t,g}(\log(1/g))\ \leq\ \frac{\sqrt{0.8 M}}{4}\overline\sigma(g,t).\] Indeed, \begin{align*} \e\overline\psi_{t,g}(\log(1/g)) &=\ \e\sqrt{\|\rho_b\|_\infty}\left\{2\overline\eta_1\frac{1}{\sqrt{tg}}\left(\log\left(\frac{\log(1/g)t}{g}\right)\right)^{1/2} + \overline\eta_2\left(\frac{\log(1/g)}{tg}\right)^{1/2}\right\} \\ &\leq\ \e (4\overline\eta_1 +2\overline\eta_2)\sqrt{\|\rho_b\|_\infty }\left(\frac{\log(t/g)}{tg}\right)^{1/2} \\ &\leq\ \e (4\overline\eta_1 +2\overline\eta_2)\sqrt{\|\rho_b\|_\infty } \left(\frac{1}{\sqrt t}\left(\log \left(\frac{t}{g}\right)\right)^{3/2} + \left(\frac{\log(t/g)}{tg}\right)^{1/2}\right) \\ &= \ \e (4\overline\eta_1 +2\overline\eta_2)\sqrt{\|\rho_b\|_\infty } \overline \sigma(g,t)\ \leq\ \frac{\sqrt{0.8 M}}{4}\overline\sigma(g,t), \end{align*} for $t$ sufficiently large and for $M=20\e^2 (4\overline\eta_1 +2\overline\eta_2)^2 \|\rho_b\|_\infty$ since $h_{\min}\leq g\leq \overline h_\rho$. Lemma \ref{lem:erg_prop:csi} then implies that, for every $g\leq \overline h_\rho$, $g\in\mathcal{H}$ and $t$ large enough, \begin{align*} &\P_b\left(\|\overline \rho_{t,K}(g)-\E_b\left[\overline \rho_{t,K}(g)\right]\|_\infty>\frac{\sqrt{0.8M}}{4}\overline \sigma(g,t)\right)\\ &\qquad\leq\ \P_b\left(\|\overline \rho_{t,K}(g)-\E_b\left[\overline \rho_{t,K}(g)\right]\|_\infty>\e\overline\psi_{t,g}\left(\log\left(\frac{1}{g}\right)\right)\right)\ \leq \ g. \end{align*} Consequently, \begin{align*} \sum_{g\in\HH\colon g\leq h} \P_b\left(\|\overline\rho_{t,K}(h^+)-\overline\rho_{t,K}(g)\|_\infty>\sqrt{0.8 M}\overline\sigma(g,t)\right) &\leq\ \sum_{g\in\HH\colon g\leq h}(h^+ + g)\\ &\lesssim\ h\log t \end{align*} and \begin{equation}\label{theo:einfachI} \sum_{h\in\HH\colon h<\overline h_{\rho}}\overline\sigma(h,t)\sqrt{(\mathbf{I})}\ =\ O\left(t^{-\frac{1}{2}}(\log t)^2\right)\ =\ o(\overline\sigma(\overline h_\rho,t)). \end{equation} \end{proof} We now turn to proving the result on lower bounds for drift estimation wrt $\sup$-norm risk. \begin{proof}[Proof of Theorem \ref{thm:lowerboundableitung}] We start with stating a crucial auxiliary result. \begin{lemma}[Theorem 2.7 in \cite{tsy09}] \label{lem:tsybakov} Fix $\CC,A,\gamma,\beta,\mathcal L\in (0,\infty)$, and assume that there exist a finite set $J_t=\{0,\ldots,M_t\}$, $M_t\in\N$, and hypotheses $\{b_j:\, j\in J_t\}\subseteq \Sigma(\beta, \mathcal L)$ satisfying \begin{itemize} \item[$\operatorname{(a)}$] $\quad \|\rho'_j - \rho_k'\|_\infty\geq 2\psi_t>0,\quad \text{ for any }j\neq k,\, j,k \in J_t,$ or \item[$\operatorname{(b)}$] $\quad \|(\rho_j^2)' - (\rho^2_k)'\|_\infty\geq 2\psi_t>0,\quad \text{ for any }j\neq k,\, j,k \in J_t,$ \end{itemize} together with the condition that, for any $j\in J_t$, $\P_{b_{j}}=:\P_j\ll \P_0$, and \[ \frac{1}{|J_t|}\sum_{j\in J_t}\KL(\P_j,\P_0) = \frac{1}{|J_t|}\sum_{j\in J_t} \E_j\left[\log\left(\frac{\d\P_j}{\d\P_0}\left(X^t\right)\right)\right]\ \leq\ \alpha \log(|J_t|), \] for some $0<\alpha<1/8$. Here, $\P_{b_j}$ is the measure of the ergodic diffusion process defined via the SDE \eqref{SDE} with drift coefficient $b_j$ and the corresponding invariant density $\rho_j$, $ j\in J_t$. Then, in case of $\operatorname{(a)}$ and $\operatorname{(b)}$, respectively, it follows \begin{align*} \inf_{\tilde {\partial\rho}_t}\sup_{b\in\Sigma(\beta, \mathcal L)} \E_b\left[\psi_t^{-1}\|\tilde{\partial\rho}_t - \rho'_b\|_\infty\right]&\geq\ c(\alpha)>0,\\ \inf_{\tilde {\partial\rho^2_t}}\sup_{b\in\Sigma(\beta, \mathcal L)} \E_b\left[\psi_t^{-1}\|\tilde{\partial\rho^2}_t - (\rho^2_b)'\|_\infty\right]&\geq\ c(\alpha)>0, \end{align*} where the constant $c(\alpha)$ depends only on $\alpha$ and the infimum is taken over all estimators $\tilde{\partial \rho}_t$ of $\rho'_b$ and estimators $\tilde{\partial\rho^2_t}$ of $(\rho^2_b)',$ respectively. \end{lemma} \paragraph{Proof of the lower bound for estimating $\rho_b'$} The lower bound \eqref{lowerboundableitung} follows by a straightforward application of Lemma \ref{lem:tsybakov}. \bigskip \textbf{\texttt{Step 1:} Construction of the hypotheses.} Fix $\beta,\mathcal L,\CC,\gamma,A \in (0,\infty)$, and let $b_0\in\Sigma(\beta,\mathcal L/2,\CC/2, A,\gamma)\subseteq \Sigma(\beta,\mathcal L,\CC, A,\gamma)$. In addition, set $J_t:= \{0, \pm 1, \ldots, \pm(\lfloor A (2h_t)^{-1} \rfloor - 1)\}$, $x_j:=2h_t j, j\in J_t$, and \[ h_t\ :=\ v\left(\frac{\log t}{t}\right)^{\frac{1}{2\beta + 1}}, \] $v<1$ some positive constant which will be specified later. Let $Q\colon\R\to\R$ be a function that satisfies $Q\in C_c^\infty(\R)$, $\supp(Q)\subseteq [-\frac{1}{2},\frac{1}{2}]$, $Q\in \mathcal H(\beta +1, \frac{1}{2})$, $\left|Q'(0)\right|>0$ and $\int Q(x)\d x =0$. The hypotheses will be constructed via additive perturbations of the invariant density $\rho_0:=\rho_{b_0}\in\mathcal H\left(\beta +1,\mathcal L/2\right)$ associated with the drift coefficient $b_0$. For this purpose, define \[ G_0 :\equiv 0,\qquad G_j(x):=\mathcal L h_t^{\beta +1}Q\left(\frac{x-x_j}{h_t}\right),\quad x\in\R,\, j\in J_t\setminus\{0\},\] and the hypotheses $\rho_j:=\rho_0 + G_j$, $j\in J_t$. Fix $j\in J_t\setminus\{0\}$, and note that \[\partial^k G_j(x)\ =\ \mathcal L h_t^{\beta + 1 - k}\partial^k Q\left(\frac{x-x_j}{h_t}\right),\quad x\in\R,\, k=0,...,\lfloor\beta + 1\rfloor.\] We immediately deduce that $\|\partial^k G_j\|_\infty \leq \mathcal L/2$ since $h_t\leq 1$ for $t$ sufficiently large and $Q\in\mathcal H\left(\beta+1, \frac{1}{2}\right)$. Furthermore, for any $x,y\in\R$, \begin{align*} \left|\partial^{\lfloor \beta +1 \rfloor}G_j(x)-\partial^{\lfloor \beta +1 \rfloor}G_j(y)\right| &=\ \mathcal L h_t^{\beta+1-\lfloor \beta +1 \rfloor}\left|\partial^{\lfloor \beta +1 \rfloor}Q\left(\frac{x-x_j}{h_t}\right)-\partial^{\lfloor \beta +1 \rfloor}Q\left(\frac{y-x_j}{h_t}\right)\right|\\ &\leq\ \mathcal L h_t^{\beta + 1-\lfloor \beta +1 \rfloor}\frac{1}{2}\left(\frac{|x-y|}{h_t}\right)^{\beta +1 - \lfloor\beta + 1\rfloor}\ =\ \frac{\mathcal L}{2}|x-y|^{\beta+1-\lfloor\beta+1\rfloor}. \end{align*} Thus, $G_j \in \mathcal H(\beta+1,\mathcal L/2)$, and, in particular, \begin{equation}\label{rhojHoelder} \rho_j\ =\ \rho_0 + G_j \in \mathcal H(\beta+1,\mathcal L),\quad \text{ for all }j\in J_t. \end{equation} Note that, since $\supp(G_j)\subset (-A,A)$ for all $j\in J_t$, we have $G_j(x)=0$ for all $|x|\geq A$. Thus, for verifying non-negativity, it suffices to show that $\rho_j(x)\geq 0$ for any $x\in (-A,A)$. Furthermore, $\inf_{-A\leq x \leq A}\rho_0(x)>0$, and, since \[\|G_j\|_\infty\ \leq\ \mathcal L h_t^{\beta + 1} \left\|Q\left(\frac{\cdot-x_j}{h_t}\right)\right\|_\infty\ \leq\ \frac{\mathcal L}{2}h_t^{\beta +1}\ =\ o(1),\] it holds $\liminf_{t\to\infty}\min_{j\in J_t}\inf_{-A\leq x \leq A}\rho_j (x)>0$. For $t$ sufficiently large, we therefore find a constant $c_*$ such that \begin{equation}\label{lowerboundrhoj} \min_{j\in J_t}\inf_{-A\leq x \leq A}\rho_j(x)\ \geq\ c_*\ >\ 0. \end{equation} Since, in addition, $\int G_j(x)\d x = 0$, $\rho_j$ is a probability density for each $j\in J_t$. Let \[b_j\ :=\ \frac{\rho_j'}{2\rho_j},\quad j\in J_t,\] and note that $b_j \in \text{Lip}_{\text{loc}}(\R)$. Furthermore, $b_j$ can be rewritten as \begin{equation}\label{bj} b_j = \frac{1}{2}\frac{\rho'_0 + G'_j}{\rho_0 + G_j} = b_0 + \frac{1}{2}\left(\frac{\rho'_0 + G'_j}{\rho_0 + G_j}-\frac{\rho'_0}{\rho_0}\right) = b_0 + \frac{1}{2}\left(\frac{G'_j\rho_0 - \rho'_0G_j}{\rho_0(\rho_0 + G_j)}\right). \end{equation} From this representation, we directly see that $b_0=b_j$ on $\R\setminus(-A,A)$. Since $\|G_j\|_\infty + \|G'_j\|_\infty = o(1)$ and due to \eqref{lowerboundrhoj}, we have that \[\sup_{-A<x<A}\frac{1}{2}\left|\frac{G'_j\rho_0 - \rho'_0G_j}{\rho_0(\rho_0 + G_j)}\right|\ \leq\ \frac{\CC}{2},\quad \text{for }t \text{ sufficiently large.}\] In particular, this implies \[|b_j(x)|\ \leq\ \frac{\CC}{2}(1+|x|) + \frac{\CC}{2}\ \leq\ \CC(1+|x|), \quad \forall x\in \R,\, t \text{ sufficiently large, } \] and we can deduce that, for any $j\in J_t$, $b_j\in \Sigma(\CC, A, \gamma,1)$. Therefore, each $b_j$ gives rise to an ergodic diffusion process via the SDE $\d X_t=b_j(X_t)\d t + \d W_t$ with invariant density $\rho_j$. Taking into consideration \eqref{rhojHoelder}, we have thus shown that \[b_j\in \Sigma(\beta,\mathcal L,\CC, A, \gamma),\quad \forall j\in J_t,\] for $t$ sufficiently large. \medskip \textbf{\texttt{Step 2:} Evaluation of the Kullback--Leibler divergence between the hypotheses.} From Girsanov's theorem, it can be deduced that \[ \KL(\P_j,\P_0)\ =\ \E_j\left[\log\left(\frac{\rho_j(X_0)}{\rho_0(X_0)}\right)\right] + \frac{1}{2}\E_j\left[\int_0^t \left(b_0(X_u)-b_j(X_u)\right)^2\d u\right]\ =:\ (\I_j) + (\II_j). \] We first prove boundedness of $(\I_j)$. Note that $\rho_j/\rho_0\equiv1$ on $\R\setminus(-A,A)$ and \[ \max_{j\in J_t}\sup_{-A\leq x \leq A}\frac{\rho_j(x)}{\rho_0(x)}\ \leq\ \frac{\mathcal L}{\inf_{-A\leq x \leq A }\rho_0(x)},\qquad \min_{j\in J_t}\inf_{-A\leq x \leq A}\frac{\rho_j(x)}{\rho_0(x)}\ \geq\ \frac{c_*}{\mathcal L}. \] Therefore, $\rho_j/\rho_0$ is bounded away from zero and infinity, uniformly for all $j\in J_t$ and $t$ sufficiently large. In particular, $\max_{j\in J_t}|(\I_j)|\ =\ O(1)$. We now turn to analysing $(\II_j)$. From \eqref{bj}, we can deduce, for any $j\in J_t$, \begin{equation}\label{Zerlegungb-bj} b_0-b_j\ =\ \frac{b_0G_j}{\rho_0 + G_j} - \frac{1}{2}\frac{G'_j}{\rho_0 + G_j}. \end{equation} Since $G_j\equiv 0$ on $\R\setminus (-A,A)$, \[ \max_{j\in J_t}\left\|\frac{b_0G_j}{\rho_0 + G_j}\right\|_\infty\ \leq\ \max_{j\in J_t} \sup_{-A\leq x \leq A}|b_0(x)| \frac{\|G_j\|_\infty}{c_*}\ =\ O\left(h_t^{\beta + 1}\right), \] and, consequently, \[ \max_{j\in J_t}\E_j\left[\int_0^t \left(\frac{b_0(X_u)G_j(X_u)}{\rho_0(X_u) + G_j(X_u)}\right)^2\d u\right]=O\left(t h_t^{2(\beta + 1)}\right) = O\left(v^{2\beta + 2}\log t\right). \] For the second term on the rhs of \eqref{Zerlegungb-bj}, we calculate \begin{align*} &\max_{j\in J_t} \E_j\left[\int_0^t \left(\frac{(G'_j)^{2}(X_u)}{4(\rho_0(X_u)+G_j(X_u))^2}\right) \d u\right] \\ &\quad =\ \max_{j\in J_t} \frac{t}{4} \int_{-A}^A \frac{\mathcal L^2 h_t^{2\beta}(Q')^2\left(\frac{x-x_j}{h_t}\right)}{(\rho_0(x) + G_j(x))^2}\left(\rho_0(x) + \mathcal L h_t^{\beta +1}Q\left(\frac{x-x_j}{h_t}\right)\right)\d x\\ &\quad \lesssim\ \max_{j\in J_t} c_*^{-2}\Bigg[t \int_{-A}^A h_t^{2\beta}(Q')^2\left(\frac{x-x_j}{h_t}\right)\rho_0(x)\d x\\ &\hspace*{5em}+ \int_{-A}^A(Q')^2\left(\frac{x-x_j}{h_t}\right)\left|Q\left(\frac{x-x_j}{h_t}\right)\right| \d x h_t^{3\beta + 1}\Bigg]\\ &\quad\lesssim\ th_t^{2\beta +1}\mathcal L \int (Q')^2(x)\d x + 2 t A\|Q'\|_\infty^2\|Q\|_\infty h_t^{3\beta +1}\\ &\quad\lesssim\ th_t^{2\beta +1}\ \eqsim\ v^{2\beta + 1} \log t. \end{align*} This implies that $\max_{j\in J_t} (\II_j)\ =\ O(v^{2\beta +1}\log t)$ such that \[\max_{j\in J_t} \KL(\P_j,\P_0)\ =\ O(v^{2\beta +1}\log t).\] \medskip \textbf{\texttt{Step 3:} Deducing the lower bound by application of Lemma \ref{lem:tsybakov}.} For any $j\neq k, j,k \in J_t$, we have \begin{align*} \|\rho'_j-\rho'_k\|_\infty &=\ \|G'_j - G'_k\|_\infty = \mathcal Lh_t^{\beta}\sup_{x\in\R}\left|Q'\left(\frac{x-x_j}{h_t}\right) - Q'\left(\frac{x-x_k}{h_t}\right)\right|\\ &\geq \ \mathcal L h_t^\beta |Q'(0)| =\mathcal L|Q'(0)| v^\beta\left(\frac{\log t}{t}\right)^{\frac{\beta}{2\beta + 1}}. \end{align*} Here we used that $|x_j-x_k|\geq 2 h_t$ implies that $x_j\notin \supp\left(Q'\left(\frac{\cdot-x_k}{h_t}\right)\right)$, noting that \[\supp\left(Q'\left(\frac{\cdot-x_k}{h_t}\right)\right)\subseteq (x_k-h_t,x_k + h_t).\] Furthermore, the number of hypotheses $|J_t|$ satisfies \[|J_t|\ =\ 2 \left\lfloor\frac{A}{2 h_t}\right\rfloor - 1\ \eqsim\ v^{-1} \left(\frac{ t}{\log t}\right)^{\frac{1}{2\beta + 1}}.\] Consequently, there is a positive constant $c_1$ such that $\log(|J_t|) \geq c_1 \log t$, for all $t$ sufficiently large. From the arguments in Step 2, it is clear that $v$ can be chosen small enough such that, for some positive constant $c_2$, \[\frac{1}{|J_t]}\sum_{j\in J_t} \KL(\P_j,\P_0)\ \leq\ c_2v^{2\beta + 1}\log t\ \leq\ \frac{1}{10}c_1\log t\ \leq\ \frac{1}{10}\log(|J_t|),\] for all $t$ sufficiently large. \eqref{lowerboundableitung} now follows immediately from Lemma \ref{lem:tsybakov}. \paragraph{Proof of the weighted lower bound for drift estimation} For proving \eqref{lowerbounddrift}, we use Lemma \ref{lemma:lowdrift} and the following \begin{proposition}\label{thm:lower_bound_rho'rho} Grant the assumptions of Theorem \ref{thm:lowerboundableitung}. Then, \[\liminf_{t \to \infty} \inf_{\tilde{\partial\rho^2_t}}\sup_{b\in\Sigma(\beta,\mathcal L)}\E_b\left[\left(\frac{\log t}{t}\right)^{-\frac{\beta}{2\beta +1}}\|\tilde{\partial\rho^2_t} - (\rho_b^2)'\|_\infty\right]>0\] where the infimum is taken over all possible estimators $\tilde{\partial \rho^2_t}$ of $(\rho_b^2)'$. \end{proposition} \begin{proof} The proof follows exactly the lines of the proof of lower bound for estimating $\rho_b'$, except from constructing the hypotheses in such a way that, for any $j\neq k$, \[ \|(\rho_j^2)'-(\rho_k^2)'\|_\infty\ \geq\ C \left(\frac{\log t}{t}\right)^{\frac{\beta}{2\beta + 1}}, \] $C$ some positive constant. This is achieved by choosing the kernel function $Q$ involved in the construction of the function $G_j$, $j\in J_t$, a little bit differently. Precisely, specify some function $Q\colon \R\to\R$ such that $Q\in C_c^\infty(\R)$, $\supp(Q) \subseteq [-\frac{1}{2},\frac{1}{2}]$, $Q\in\mathcal H(\beta+1,\frac{1}{2})$, $\int Q(x)\d x =0$, $Q(0)=0$ and $\left|Q'(0)\right|>0$. For any $j\neq k, j,k \in J_t$, one then has \begin{align*} \|(\rho_j^2)'-(\rho_k^2)'\|_\infty &=\ 2\|(\rho'_0+G'_j)(\rho_0 + G_j) - (\rho'_0+G'_k)(\rho_0 + G_k)\|_\infty \\ &=\ 2\|\rho'_0G_j + G'_j\rho_0 + G'_jG_j - \rho'_0G_k - G'_k\rho_0 - G'_kG_k\|_\infty\\ &\geq\ 2\left|\rho'_0(x_j)G_j(x_j) + G'_j(x_j)\rho_0(x_j) + G'_j(x_j)G_j(x_j)\right|\\ &\geq\ 2\mathcal L h_t^\beta \left|\rho'_0(x_j)h_tQ(0) + Q'(0)\rho_0(x_j) + \mathcal L h_t^{\beta + 1}Q(0)Q'(0)\right|\\ &=\ 2\mathcal L h_t^\beta \left|Q'(0)\right|\rho_0(x_j)\ \geq\ 2\mathcal L h_t^\beta \left|Q'(0)\right| \inf_{-A\leq x \leq A}\rho_0(x)\\ &=\ 2\mathcal L\left|Q'(0)\right| \inf_{-A\leq x \leq A}\rho_0(x) v^\beta\left(\frac{\log t}{t}\right)^{\frac{\beta}{2\beta + 1}}. \end{align*} Here we used the fact that $|x_j-x_k|\geq 2 h_t$ implies that \[x_j\notin \supp\left(Q'\left(\frac{\cdot-x_k}{h_t}\right)\right) \cup \supp\left(Q\left(\frac{\cdot-x_k}{h_t}\right)\right)\] because $\supp\left(Q'\left(\frac{\cdot-x_k}{h_t}\right)\right)\cup \supp\left(Q\left(\frac{\cdot-x_k}{h_t}\right)\right)\subseteq (x_k-h_t,x_k + h_t)$. The assertion then follows as in the previous proof (see Steps 1-3) from part (b) of Lemma \ref{lem:tsybakov}. \end{proof} In particular, Proposition \ref{thm:lower_bound_rho'rho} implies that condition \eqref{condition:lowdrift} from Lemma \ref{lemma:lowdrift} is fulfilled for $\psi_t=(\log t/t)^{\frac{\beta}{2\beta+1}}$, and \eqref{lowerbounddrift} follows. \end{proof} \medskip \begin{proof}[Proof of Theorem \ref{theo:sim}] The definition of $\hat h_t$ according to \eqref{est:band} implies that \begin{equation}\label{15.1} \|\rho_{t,K}(\hat h_t)-\rho_{t,K}(h_{\min})\|_\infty\ \lesssim\ \frac{1}{\sqrt t\log t}. \end{equation} Furthermore, $h_{\min}$ satisfies the assumption of Proposition \ref{donskerdensity} such that assertion \eqref{sim:1} of the Theorem immediately follows. It remains to verify \eqref{sim:21}. First, we remark that it always holds $\hat h_t\geq h_{\min}$ such that $\hat h_t$ is well-defined. For estimation of $\rho_b$ via $\rho_{t,K}(h_{\min})$, Proposition \ref{prop:con_kernel_density_estimator} yields \[ \sup_{b\in\Sigma(\beta,\mathcal L)} \left(\E_b\left[\left\|\rho_{t,K}(h_{\min})-\rho_b\right\|_\infty^p\right]\right)\p = O\left(t^{-1/2}(1+\sqrt{\log t} + \sqrt p + pt^{-1/2})\right). \] We can then deduce from \eqref{15.1} that \[ \sup_{b\in\Sigma(\beta,\mathcal L)} \left[\E_b\left(\left\|\rho_{t,K}(\hat h_t)-\rho_b\right\|_\infty\right)^p\right]\p =O\left(t^{-1/2}(1+\sqrt{\log t} + \sqrt p + pt^{-1/2})\right). \] Thus, $\rho_{t,K}(\hat h_t)$ satisfies assumption (E1) from Lemma \ref{lem:decomp}. We may now follow the proof of Theorem \ref{theo:est}. In particular, it again suffices to investigate the estimator $\overline \rho_{t,K}(\hat h_t)$ in order to prove \eqref{sim:21} since conditions (E1) and (E2) from Lemma \ref{lem:decomp} are satisfied. Note that \[ \P_b\left(|\wideparen M-C\|\rho_b\|_\infty|>0.2C\|\rho_b\|_\infty\right)=\P_b\left(|\|\rho_{t,K}(h_{\min})\|_\infty-\|\rho_b\|_\infty|>0.2\|\rho_b\|_\infty\right) \leq\ \ t^{-1}. \] follows exactly as in the proof of Theorem \ref{theo:est} since $\psi_{t,h_{\min}}(\log t)= o(1)$. Additional arguments are required only for the investigation of Case 2 ($\hat h_t< \overline h_{\rho}$). As in the proof of Theorem \ref{theo:est}, it is shown that \begin{align*} &\E_b\left[\|\overline\rho_{t,K}(\hat h_t)-\rho_b'/2\|_\infty\ \mathds{1}_{\{\hat h_t< \overline h_{\rho}\}\cap\{\wideparen M\geq 0.8M\}}\right]\\ &\qquad\leq\ \sum_{h\in\mathcal{H}\colon h<\overline h_{\rho}}\K\overline\sigma(h,t)\cdot\sqrt{\P_b\left(\{\hat h_t=h\}\cap\{0.8M\leq \wideparen M\}\right)} + B(\overline h_{\rho}). \end{align*} We bound the first term by $\sum_{h\in\HH\colon h<\overline h_{\rho}}\K\overline\sigma(h,t)\left(\sqrt{(\mathbf{I})}\ + \sqrt{(\mathbf{II})}\right)$, with \begin{align*} (\mathbf{I})&:=\ \sum_{g\in\HH\colon g\leq h} \P_b\left(\|\overline\rho_{t,K}(h^+)-\overline\rho_{t,K}(g)\|_\infty>\sqrt{0.8M}\overline\sigma(g,t)\right),\\ (\mathbf{II})&:=\ \P_b\left(\sqrt t\|\rho_{t,K}(h^+)-\rho_{t,K}(h_{\min})\|_\infty>\frac{\sqrt{h^+}(\log(1/h^+))^4}{\log t}\right), \end{align*} where $h^+:=\min\{g\in\mathcal{H}:\, g>h\}$. $(\mathbf{I})$ is dealt with as in Theorem \ref{theo:est} (see \eqref{theo:einfachI}). With regard to term $(\mathbf{II})$, we argue as before by means of Proposition \ref{theo:cath1}: Since $h_{\min}\leq h^+\leq \overline h_\rho$, it holds for any $\beta>0$ and an arbitrary positive constant $\co$, for some $t$ onwards, \begin{align*} \sqrt{h^+}\left( 1 + \log(1/\sqrt{h^+})+\log(t)\right)+\sqrt t\e^{-\co t}+\sqrt t(h^+)^{\beta+1}& =\ o(\lambda'),\\ \sqrt{h_{\min}}\left( 1 + \log(1/\sqrt{h_{\min}})+\log(t)\right)+\sqrt t\e^{-\co t}+\sqrt t(h_{\min})^{\beta+1}& =\ o(\lambda'), \end{align*} letting $\lambda':=\sqrt{h^+}(\log(1/h^+))^4/\log t$. Thus, for any $t>1$ sufficiently large, \begin{align*} &\P_b\left(\sqrt t\|\rho_{t,K}(h^+)-\rho_{t,K}(h_{\min})\|_\infty>\lambda'\right)\\ &\quad\leq\ \P_b\left(\sqrt t\|\rho_{t,K}(h^+)-L_t^\bullet(X) t^{-1}\|_\infty>\frac{\lambda'}{2}\right) + \P_b\left(\sqrt t\|\rho_{t,K}(h_{\min})-L_t^\bullet(X) t^{-1}\|_\infty>\frac{\lambda'}{2}\right)\\ &\quad \leq\ 2\exp\left(-\frac{\Lambda_1(\log(1/h^+))^4}{\log t}\right)\ \leq\ 2\exp\left(-\widetilde{\Lambda}_1(\log t)^2\right), \end{align*} for some positive constant $\widetilde{\Lambda}_1$. Consequently, \[ \sum_{h\in\HH\colon h<\overline h_{\rho}}\overline\sigma(h,t)\sqrt{(\mathbf{II})} \ \lesssim\ \log t\cdot \overline{\sigma}(h_{\min},t)\sqrt{\exp(-\widetilde{\Lambda}_1(\log t)^2)}\ =\ o(\overline\sigma(\overline h_{\rho},t)). \] We can then proceed as in the proof of Theorem \ref{theo:est} to finish the proof. \end{proof} \section{Sketch of the derivation of basic exponential inequalities}\label{app:C} In order to give some insight into the machinery of the proof of the basic concentration results, we sketch the main steps here in the situation of Proposition \ref{prop:csi}. Note that our previous paper \cp~deals with more general objects of the form \[ \sqrt t \left(\frac{1}{t}\int_0^t f(X_s)\d X_s-\int(fb)\d\mu_b\right),\quad f\in\FF,\] for some class $\FF$ of continuous functions, the supremum in the concentration results being taken over all functions $f\in\FF$. The proof of Proposition \ref{prop:csi} relies on martingale approximation, i.e., the decomposition of $\overline\rho_{t,K}(h)-\E_b[\overline\rho_{t,K}(h)]$ into a negligible remainder term and a martingale part which is then dealt with by the generic chaining method. Introduce the function \[g_y(u)\ :=\ \frac{1}{\rho_b(u)}\int_{\R}K\left(\frac{y-x}{h}\right)\rho_b'(x)\left(\mathds{1}\{u>x\}-F_b(u)\right)\d x,\quad u\in\R.\] It\^o's formula applied to the function $\int_0^\bullet g_y(u)\d u$ and to the diffusion $X$ yields \[ \int_{X_0}^{X_t}g_y(u)\d u\ =\ \int_0^tg_y(X_s)\d X_s+\frac{1}{2}\int_0^tg_y'(X_s)\d\langle X\rangle_s. \] Since \[g_y'(u)\ =\ -2b(u)g_y(u)+2b(u)K\left(\frac{y-u}{h}\right)- 2\E_b\left[K\left(\frac{y-X_0}{h}\right)b(X_0)\right], \] we obtain the representation \begin{align*} \overline \rho_{t,K}(h)(y)-\E_b\left[\overline\rho_{t,K}(h)(y)\right]&=\ \frac{1}{t}\int_0^t K\left(\frac{y-X_s}{h}\right)\d X_s-\E_b\left[K\left(\frac{y-X_0}{h}\right)b(X_0)\right]\\ &=\ \rd_t^y+\Ma_t^y, \end{align*} for \begin{align*} \rd_t^y&:=\ \int_{X_0}^{X_t}g_y(u)\d u,\\ \Ma_t^y&:=\ \int_0^tK\left(\frac{y-X_s}{h}\right)\d W_s-\int_0^tg_y(X_s)\d W_s\ =:\ \Ma_{1,t}^y+\Ma_{2,t}^y. \end{align*} It can be shown by direct calculations that $ \left(\E_b\left[\sup_{y\in \R} |\rd_t^y|^p\right]\right)\p\leq \gamma(p)$ for some function $\gamma:\R_+\to\R_+$ (see Proposition 8 in \cp). \paragraph{Step 2: Chaining applied to the martingale part} Most effort is required for the analysis of the martingale part by the generic chaining method. In \cp, a more general setting is considered. Instead of the $\sup$-norm, the supremum over general function classes satisfying some mild entropy conditions is investigated. It is straightforward to translate our situation into this setting by defining the class $\mathcal F$ as in \eqref{functionclass}. The central generic chaining tool goes back to \citeauthor{tala14}. We will use slightly modified versions of Theorems 3.2 and 3.5 in \cite{dirk15} which in particular yield upper bounds for \emph{all} moments. The latter turns out to be very useful for our statistical applications. \medskip \begin{proposition}[cf.~Theorem 3.2 \& 3.5 in \cite{dirk15}]\label{thm:dirk} Consider a real-valued process $(X_f)_{f\in\mathcal F}$, defined on a semi-metric space $(\FF,d)$. \begin{itemize} \item[$\operatorname{(a)}$] If there exists some $\alpha\in(0,\infty)$ such that \begin{equation}\label{ineq:a} \mathbb P\left(|X_f-X_g|\geq u d(f,g)\right)\ \leq\ 2\exp\left(-u^{\alpha}\right)\quad\forall f,g\in\mathcal F,\ u\geq 1, \end{equation} then there exists some constant $C_\alpha>0$ (depending only on $\alpha$) such that, for any $1\leq p<\infty$, \[ \left(\mathbb E\left[\sup_{f\in\mathcal F}|X_f|^p\right]\right)^{\frac{1}{p}}\ \leq\ C_\alpha \int_0^\infty \left(\log N(u,\mathcal F,d)\right)^{\frac{1}{\alpha}}\d u + 2\sup_{f\in\mathcal F}\left(\mathbb E\left[|X_f|^p\right]\right)^{\frac{1}{p}}. \] \item[$\operatorname{(b)}$] If there exist semi-metrics $d_1,d_2$ on $\FF$ such that \[ \P\left(|X_f-X_g|\geq ud_1(f,g)+\sqrt u d_2(f,g)\right)\ \leq\ 2\e^{-u}\quad \forall f,g\in\FF,\ u\geq 1, \] then there exist positive constants $\tilde C_1,\tilde C_2$ such that, for any $1\leq p<\infty$, \begin{align*} \left(\mathbb E\left[\sup_{f\in\mathcal F}|X_f|^p\right]\right)^{\frac{1}{p}} &\leq\ \tilde C_1 \int_0^\infty \log N(u,\FF,d_1)\d u \\ &\qquad\quad + \tilde C_2 \int_0^\infty \sqrt{\log N(u,\FF,d_2)}\d u+ 2\sup_{f\in\FF}\left(\mathbb E\left[|X_f|^p\right]\right)^{\frac{1}{p}}. \end{align*} \end{itemize} \end{proposition} Note that we upper bounded the so-called \emph{$\gamma$-functionals} appearing in Theorems 3.2 and 3.5 in \cite{dirk15} by entropy integrals. For the cases $\alpha=1,2$, part (a) of the Proposition deals with processes with subexponential or subgaussian increments, respectively. Part (b) covers the case of mixed-tail increments. With regard to the conditions of the preceding proposition, we are led to exploring the tail behaviour of the increments of the martingale part which is done by finding suitable upper bounds for the moments. Indeed, taking into account assumption \eqref{kernel} on the kernel as well as the conditions on $b$, it can be shown that, for any $p\geq 1$, $y,z\in\R$, \begin{eqnarray*} \left(\E_b\left[\left(t^{-1/2}\left|\M_{2,t}^y\right|\right)^p\right]\right)\p&\leq& \left\|K\left(\frac{y-\cdot}{h}\right)\right\|_{\l^2(\lebesgue)}\cdot V(t,h)p^{\frac{3}{2}},\\ \left(\E_b\left[\left(t^{-1/2}\left|\M_{2,t}^y-\M_{2,t}^z\right|\right)^p\right]\right)\p&\leq&\left\|K\left(\frac{y-\cdot}{h}\right)-K\left(\frac{z-\cdot}{h}\right)\right\|_{\l^2(\lebesgue)}\cdot V(t,h)p^{\frac{3}{2}}, \end{eqnarray*} for some function $V\colon\R^+\times\R^+\to\R^+$, so that we are led to part (a) of Proposition \ref{thm:dirk}. These moment bounds imply a corresponding exponential inequality of the form \eqref{ineq:a}. Of course, the dependence of $V$ on $h$ and $t$ is of immense importance for the result and the statistical application. Nevertheless, for ease of presentation, we skip details here and refer to Proposition 8 of \cp. The estimates therein are obtained by direct calculations, exploiting the conditions on the drift coefficient and the function class $\mathcal F$. The upper bound for $\Ma_{1,t}$ is based on another deep result on the $\sup$-norm of the centred local time which itself relies on the generic chaining. In order to motivate where this comes from, we sketch the main idea. The Burkholder-Davis-Gundy inequality and the occupation times formula yield, for any $y\in\R$, and $p\geq 1$, \begin{align*} \left(\E_b\left[\left(\frac{1}{\sqrt t}|\Ma_{1,t}^y|\right)^p\right]\right)^{\frac{1}{p}}&=\ \left(\E_b\left[\left|\frac{1}{\sqrt t}\int_0^t K\left(\frac{y-X_s}{h}\right)\d W_s\right|^p\right]\right)^{\frac{1}{p}}\\ &\leq\ C_p\left(\E_b\left[\left(\frac{1}{t}\int_0^tK^2\left(\frac{y-X_s}{h}\right)\d s\right)^{p/2}\right]\right)^{\frac{1}{p}}\\ &=\ C_p\left(\E_b\left[\left(\frac{1}{t}\int_\R K^2\left(\frac{y-v}{h}\right)L_t^v(X)\d v\right)^{p/2}\right]\right)^{\frac{1}{p}}\\ &\leq\ \frac{C_p}{\sqrt t}\left(\int_\R K^2\left(\frac{y-v}{h}\right)\d v\right)^{1/2}\left(\E_b\left[\left(\sup_{a\in\R}|L_t^a(X)|\right)^{p/2}\right]\right)^{\frac{1}{p}}\\ &\lesssim\ \frac{C_p}{\sqrt t}\left\|K\left(\frac{y-\cdot}{h}\right)\right\|_{L^2(\lebesgue)}\left\{\left(\E_b\left[\left(\sup_{a\in\R}|L_t^a(X)-\rho_b(a)|\right)^{p/2}\right]\right)^{\frac{1}{p}}+1\right\}, \end{align*} $C_p$ denoting some positive constant which depends only on $p$. Exploiting the precise knowledge of the dependence of $C_p$ on $p$ and the result on the centred local time (Corollary 2 in \cp), one obtains the desired moment bounds and the corresponding exponential inequality: \begin{align*} \left[\E_b\left(t^{-1/2}\left|\M_{1,t}^y\right|\right)^p\right]\p&\leq\ \left\|K\left(\frac{y-\cdot}{h}\right)\right\|_{L^2(\lebesgue)}\cdot V_1(t,h)\left(\sqrt p + \frac{p}{t^{1/4}}\right), \text{ as well as}\\ \left[\E_b\left(t^{-1/2}\left|\M_{1,t}^y-\M_{1,t}^z\right|\right)^p\right]\p&\leq \ \left\|K\left(\frac{y-\cdot}{h}\right)-K\left(\frac{z-\cdot}{h}\right)\right\|_{L^2(\lebesgue)} V_1(t,h)\left(\sqrt p + \frac{p}{t^{1/4}}\right), \end{align*} for any $y,z\in\R$, $p\geq 1,$ and for some function $V_1\colon\R^+\times\R^+\to\R^+$. Hence, we would like to proceed with the chaining procedure for mixed-tail increments dealt with in part (b) of Proposition \ref{thm:dirk}. \paragraph{Step 3: Localisation procedure} Unfortunately, the metrics (basically the $L^2$-distance wrt the Lebesgue measure) for which the conditions of Proposition \ref{thm:dirk} are satisfied do not induce finite covering numbers. Therefore, we have to resort to a localisation procedure. The idea is to apply the chaining method to suitable subsets $\mathcal F_k\subseteq \FF$, $k\in\N_0$, with a decreasing probability for $\mathcal F_k$ to be relevant for large $k$. For suitably chosen compact intervals $I_k$, $k\in\N_0$, define \[\mathcal F_k\ :=\ \left\{f\in\mathcal F:\, \supp(f)\subseteq I_k\right\}.\] The choice of $I_k$, $k\in\N_0$, implies that $\mathcal F=\bigcup_{k\in\N_0}\mathcal F_k$. One can then show that there exist sets $A^p_k$, $k\in\N_0$, for any $p\geq 1$ such that \[A_f:=\{\text{there is } s\in [0,t]\text{ such that }X_s\in\supp(f)\}\subseteq A^p_k\] and $\P_b(A^p_k)\leq \exp(-kp)$, for all $f\in\mathcal F_k$, $k\in\N_0$, $p\geq 1$. This inequality is deduced from Lemma 1 in \cp~which states a maximal inequality for the diffusion process of the form \[\P_b\left(\max_{0\leq s\leq t}|X_s|>kp\Lambda t\right)\ \leq\ \e^{-kp},\quad k\in\N,\] for some constant $\Lambda>0$. The localisation procedure hinges on the compact support of the functions in $\mathcal F$. In the given set-up, the support of $K((x-\cdot)/h))$ for any $x\in\R$ is contained in $[x-h,x+h]$. Taking account of the maximal inequality, it thus becomes apparent that, for large $|x|$, the probability of $A_{K\left(\frac{x-\cdot}{h}\right)}$ is shrinking. We can then deduce that \begin{eqnarray*} \left(\E_b\left[\sup_{y\in\R}\left|\M_t^y\right|^p\right]\right)\p &\leq &\sum_{k=0}^\infty \left(\E_b\left[\sup_{K\left(h^{-1}(y-\cdot)\right)\in\mathcal F_k}\left|\M_t^y\mathbbm{1}(A_f)\right|^p\right]\right)\p\\ &\leq& \sum_{k=0}^\infty \left(\E_b\left[\sup_{K\left(h^{-1}(y-\cdot)\right)\in\mathcal F_k}\left|\M_t^y\mathbbm{1}(A^p_k)\right|^{p}\right]\right)^{\frac{1}{p}}\\ &\leq& \sum_{k=0}^\infty \left(\E_b\left[\sup_{K\left(h^{-1}(y-\cdot)\right)\in\mathcal F_k}\left|\M_t^y\right|^{2p}\right]\right)^{\frac{1}{2p}}\e^{-\frac{k}{2}}. \end{eqnarray*} Proposition \ref{thm:dirk} can now be applied \emph{locally} to $\mathcal F_k$ and yields an upper bound on \[ \left(\E_b\left[\sup_{K\left(h^{-1}(y-\cdot)\right)\in\mathcal F_k}\left|\M_t^y\right|^{2p}\right]\right)^{\frac{1}{2p}}. \] Taking into account the uniform upper bound on the remainder term, the first part of \eqref{con_stoch_int} follows from standard entropy bounds as in Lemma 22 in \cp. Once these upper bounds for all $p$th moments are available, concentration inequalities as stated in the second part of \eqref{con_stoch_int} then immediately follow from the fact that, for any real valued random variable $Z$, satisfying, for any $p\geq 1$ and for some function $\phi\colon(0,\infty)\to(0,\infty)$, $\left(\E\left[|Z|^p\right]\right)\p\leq \phi(p)$, one has \[\P\left(|Z|\geq \e \phi(u)\right)\ \leq\ \exp(-u),\quad u\geq 1.\] \end{appendix}
\section{Introduction}\label{intro} Articular cartilage (AC) is an avascular and aneural connective tissue that covers articular joints such as the shoulder and knees to provide a viscoelastic surface that distributes and absorbs mechanical loads. The complex structure of the AC consists of cells called chondrocytes and a dense extracellular matrix (ECM) including fluid, a collagen network, and other proteins~\citep{Mak86,Mow92,Wong03}. Chondrocytes are responsible for the production of the building blocks of the ECM~\citep{Archer03,Akkiraju15,Muir95}, while nutrients and oxygen are provided via diffusion through the ECM. Erosion and damage of AC can be caused by injuries, mechanical wear, and pathologies such as osteoarthritis. Cartilage degeneration from osteoarthritis is often painful and can affect people of all ages (including the majority of the 65+ population). The absence of vasculature and the low density and metabolism of chondrocytes make cartilage a tissue with low capability for repair. Common invasive strategies to increase mobility include joint replacements, which include a long recovery time ~\citep{Goldring07,Kock12,Mollenhauer08}. Hence, tissue engineering represents a promising path towards the treatment of damaged cartilage that could be non-invasive with immediate relief. Tissue engineering is a multidisciplinary field in the area of tissue repair and regeneration. Cells can be seeded on a three dimensional porous scaffold, where nutrients and oxygen are provided, to produce new tissue that can be successfully used to repair damaged areas and aid in tissue regeneration. Experiments producing tissue engineered constructs are costly, time intensive and must produce viable and functional tissue to be considered successful. The tissue produced in experiments requires the correct mechanical and biological properties in order to survive when implanted at the level of the trauma and to withstand the stresses of the affected region. Thus, nutrients must be able to diffuse throughout the construct and cells must be able to synthesize the proteins that will bind to form functional ECM, providing mechanical support as the scaffold slowly degrades. Scientists have identified that the cell source, type of mechanical stimulation, interactions between the scaffold and cells, delivery of growth factors, and scaffold properties are all important parameters for tissue engineering experiments~\citep{Freyria04,Freyria12,Keeney11,Kock12,Kretlow08,Reddi11}. It is therefore imperative that scaffolds are able to mimic the properties of the ECM, providing an environment that allows cells to divide and move. In addition, it is necessary that the scaffold also degrades at the proper timescale in order to obtain a valid outcome from experiments~\citep{Fernandes09}. As a result, several recent studies have focused on the effect of scaffold pore size and micro architecture in different tissue engineering experiments~\citep{Erickson09,Matsiko15,Reddi11}. In particular, studies on tissue engineered articular cartilage have investigated the effect of variations in experimental parameters, such as: scaffold porosity~\citep{Erickson09,Freyria04,Matsiko15}, scaffold thickness~\citep{Freed94}, initial cellular seeding concentration~\citep{Cigan16,Freed94,Vunjak98}, mixed and static cultures~\citep{Freyria04,Vunjak98}, and the presence of nutrient channels~\citep{Cigan16}, on the biological and mechanical properties of the construct produced {\it in vitro}. Mathematical modeling can be used alongside experiments to help in the interpretation of laboratory results, to gain a deeper understanding of the mechanisms driving the dynamics of cartilage growth, and to quantify the effect of variations in the experimental parameters. Tissue growth has been studied from several mathematical modeling frameworks in the context of tissue engineering as well as cancer tumor growth \citep{AlHusari14,Galle07,Sengers07,Zhang09}. \cite{Cheng06} built a discrete on-lattice three-dimensional cellular automaton model describing cell dynamics assuming constant concentration of nutrient and growth factors. The model was later coupled to a time dependent partial differential equation for the diffusion and consumption of nutrient and to an equation regulating cell division time and migration speed in a hybrid model by \cite{Cheng09}. \cite{Jeon2010} developed a hybrid off-lattice two-dimensional model for tumor growth adopting a continuum approach for enzymes, nutrient and ECM concentration and a discrete approach for individual cellular behavior. We note that in \cite{Byrne09}, a comparison between a lattice-free, rule-based cellular automaton and a continuum model showed good agreement, showing that both modeling frameworks can be utilized for tissue growth where there is a growing cell population. Mathematical models specific to cartilage tissue engineering have been focusing on different elements of the biological phenomenon of cartilage growth, using a variety of modeling techniques. The two-dimensional hybrid model by \cite{Chung10} combines a partial differential equation for the concentration of nutrients in the scaffold with an on-lattice cellular automaton model for cell random movement, nutrient regulated cell reproduction and cell-to-cell interaction. To our knowledge, this was the first model to account for individual cell dynamics in the context of cartilage tissue engineering, although this model did not account for the evolving ECM and scaffold volume fractions in the construct. Other groups have developed continuous mixture model approaches to capture the evolving solid and fluid volume fractions \citep{Chung06,Haider11,Lemon06,ODea13}, where cells were either assumed constant or accounted for via a cellular volume fraction. There have also been a series of continuous models that have focused on accounting for spatiotemporal distribution of cells as well as the biosynthesis of ECM proteins and diffusion of nutrients \citep{Dimicco03,Nikolaev10,Obradovic00,Sengers04,Sengers05a,Sengers05b}. In this work, we present the first hybrid model to account for the effect of porosity in a cartilage tissue engineered construct. The model couples a cellular automaton description of the chondrocytes (cells) to a continuum phenomenological approach for ECM accumulation, scaffold degradation, and nutrient concentration. Chondrocytes are modeled as exhibiting biased random motion depending on local nutrient concentration (chemotaxis) and porosity, and their division is regulated by nutrients and porosity. The model is used to investigate how changes in biological parameters such as distance a cell moves, sensitivity to porosity, and cell maturity affect constructs with a different initial porosity, and to aid in the interpretations of the results of laboratory experiments on tissue engineered articular cartilage. We are able to match total cell counts of experiments by \cite{Freed94} and show that cell's sensitivity to porosity can lead to different cell counts and distribution of cells within the construct. This work provides a new framework to couple porosity with individual cellular dynamics for the growth of tissue in cell-seeded scaffolds. \section{Modeling Framework} \label{sec:methods} This model describes the phenomena of growth and development of tissue engineered articular cartilage where initially, chondrocytes are seeded in a cylindrically shaped scaffold or gel. As depicted in Fig.~\ref{fig:sc}(a)-(b), we focus on a thin slice of this construct and only model the lower right corner since we assume the entire construct is immersed in a well-mixed, nutrient-rich medium where all surfaces of the cylinder are fully exposed to allow for nutrient diffusion into the construct. We note that the average diameter $c_d$ of a chondrocyte is $c_d=0.001$ cm~\citep{Sanchez10} whereas average values for the height $h$ and diameter $d$ of cylindrical scaffolds in experiments are $h=0.2\ll c_d$ and $d=1\ll c_d$ cm \citep{Erickson09,Freed94}, respectively. The thin slice is assumed to have thickness $z=$2$c_d$ and we use dimensional analysis to arrive at a 2-dimensional domain $\Omega$, where values of continuous variables correspond to cross sectional averages of the regions depicted in Figure~\ref{fig:sc}(c). Since the thickness is 2$c_d$, we assume that cells can partially overlap and that there is room for scaffold and/or ECM at each point in $\Omega$. \begin{figure}[th!] \centering \resizebox{\textwidth}{!}{ \begin{tikzpicture} \node [above] (a) at (-1,0.5) {(a)}; \draw [dotted,fill=gray!20] (-1,-0.5) rectangle (1,0.5); \draw [thick] (-1,-0.5) -- (-1,0.5); \draw [thick] (1,-0.5) -- (1,0.5); \draw [thick] (0,0.5) ellipse (1cm and 0.25cm); \draw [thick] (-1,-0.5) arc (180:360:1cm and 0.25cm); \draw [thick,dashed] (1,-0.5) arc (0:180:1cm and 0.25cm); % \node [xshift=0.5cm] (AA) at (1,0) {\large$\Rightarrow$}; % \begin{scope}[xshift=3cm] \node [above] (b) at (-1,0.5) {(b)}; \draw [fill=gray!20] (-1,-0.5) rectangle (1,0.5); \draw [very thick,fill=gray] (0,0) rectangle (1,-0.5); \draw [thin,cm dotted] (-1,0.5) -- (-0.95,0.55) -- (1.05,0.55)-- (1.05,-0.45) -- (1,-0.5); \draw [thin,cm dotted] (-0.95,0.55) -- (-0.95,-0.45) -- (1.05,-0.45); \draw [thin,cm dotted] (1,0.5) -- (1.05,0.55); \draw [thin,cm dotted] (-1,-0.5) -- (-0.95,-0.45); \end{scope} % \node [xshift=3.5cm] (AA) at (1,0) {\large$\Rightarrow$}; % \begin{scope}[xshift=5.25cm] \node [above] (c) at (-0.125,0.5) {(c)}; \foreach \y in {-0.125cm,0.125cm,0.375cm}{ \foreach \x in {-0.125cm,0.125cm,...,0.875cm}{ \begin{scope}[xshift=\x,yshift=\y] \draw [thin] (-0.125,-0.125) rectangle (0.125,0.125); \draw [fill=black] (0,0) circle (0.02cm); \end{scope} }} % \end{scope} \end{tikzpicture} } \caption{Schematic of the computational domain. (a): Cylindrical scaffold with the middle slice highlighted in light gray. (b): The computational domain $\Omega$ is one-quarter of this thin slice, corresponding to the dark gray rectangle in the lower right corner. (c): Zoomed in schematic of the domain $\Omega$ where the node values correspond to averages on the particular volume element with depth $z=2c_d$ for chondrocyte diameter $c_d$.} \label{fig:sc} \end{figure} Experimental studies have shown that movement of cells and diffusion of nutrients will be heavily dependent on the porosity (fluid volume fraction) that is not obstructed by the proteins or fibers that make up the scaffold or extracellular matrix \citep{Erickson09,Freyria04,Masaro99,Matsiko15}. Thus, we will idealize the bio-construct as a continuum mixture where we will account for the evolving solid volume fractions and hence, the porosity. The model employs a hybrid approach that combines a discrete {\it cellular automaton} (CA) model for the cells with continuous descriptions of the nutrient concentration ($c$), the porosity ($p$) of the construct, the extracellular matrix solid volume fraction ($\Phi_{ECM}$), the scaffold solid volume fraction ($\Phi_{SC}$), and cellular solid volume fraction ($\Phi_{C}$). We assume a saturated mixture for the entire experiment, which corresponds to the assumption that at each point in the construct, the porosity is $p=1-\Phi$ for total solid volume fraction $\Phi=$(occupied volume)/(total volume). In this model, we assume that nutrients are dissolved in the fluid phase and do not contribute to the solid volume fraction. \begin{figure}[th!] \centering \includegraphics[width=0.95\textwidth]{flowchart_p_cropped.pdf} \caption{Algorithm for the hybrid model where cells are represented using a Cellular Automaton approach to account for growth and movement of cells. The nutrient concentration $c$ and porosity $p$ are represented in a continuous framework. } \label{fig:flux-big} \end{figure} The diagram in Fig.~\ref{fig:flux-big} describes the algorithm that is used to simulate the evolution of the bio-construct in time. At the system initialization, the cells are seeded on the domain; then the nutrient part of the {\it continuous block} is solved, updating the value of nutrient concentration inside the computational domain. Next, the first part of the {\it CA block} is solved and cells in the dying state are removed from the domain, while the dying cells for the next iteration are randomly selected. Then, the second part of the continuous block is solved to perform the update of the construct porosity due to changes induced by cell death and cell movement (for $t>0$). Next, the second part of the CA block is solved to perform cell division and the second part of the continuous block is solved again to update the construct porosity due to changes induced by cell division. Finally, the second part of the CA block is solved to perform cell movement. This algorithm is repeated until the simulation time $t$ reaches $T_{final}$. We note that the nutrient concentration $c$ is updated only at $t=0$, 7, 10, and 15 days (slow timescale) as detailed in Appendix B. In the following sections, the different components of the model will be discussed in detail. \subsection{Continuous model} The continuous components of the model describe the evolution of the nutrient concentration $c$ and porosity $p$. These quantities are calculated on a computational grid with a step size $\triangle x=\triangle y=c_d/12$, i.e. the grid is considerably smaller then the cellular diameter to guarantee an accurate solution. We assume that the nutrient profile will only change after a significant change in the distribution of cells within the construct (both in terms of the total number of cells and their respective locations in the domain). Thus, the two continuous quantities considered are computed on different timescales: $c$ is considered independent from the cellular dynamics, with a slow time evolution compared to the cells while $p$ directly depends on the cellular dynamics such as movement and growth, and is therefore computed on the fast ({\it cellular}) time scale. \subsubsection{Nutrient concentration} For the domain highlighted in Fig.~\ref{fig:sc}(b), nutrients (e.g. glucose) will diffuse in from the bottom and right since they are in contact with the nutrient-rich medium. We will utilize a qualitative approach to specify $c$, the concentration of nutrient solute per mixture volume (equivalent to $p\hat{c}$ for porosity $p$ and concentration of nutrient solute per solute volume $\hat{c}$). The spatial profile of $c$ is chosen in agreement with the results of \cite{Chung10} and \cite{Bandeiras15}. As the simulation time evolves, the nutrient concentration in the areas far from the physical boundary of the bio-construct decrease significantly, as shown in Fig.~\ref{fig:nutrient}. This represents cell agglomerates that form close to the boundary (bottom and right of $\Omega$ in Fig.~\ref{fig:sc}), where there is increased cellular utilization of nutrients and a decrease in nutrient diffusivity due to a reduction in porosity. Since we assume the timescale characteristic of this process is slow compared with the timescale governing the cellular processes, $c$ is updated on the {\it slow} timescale corresponding to new profiles on day $0$, $7$, $10$ and $15$. Additional details about the specific profiles used in this work are reported in Appendix B. We note that we utilize a non-dimensional nutrient concentration with $c\in$[0,1] since we want all variables that bias the cellular components to be on the same scale. \begin{table}[t!] \begin{center} \begin{tabular}{llcl} \toprule \bf Parameter (units) & \bf Description & \bf Sim. Value & \bf Source \\ \midrule $c_d$ (cm) & Diameter of chondrocyte & $0.001$ & \cite{Sanchez10} \\ $\Omega$ (cm) & Domain & $0.5\times 0.1$ & \cite{Erickson09} \\ & & & \cite{Freed94}\\ $z$ (cm) & Thickness of thin slice & 2$c_d$ & see Appendix A\\ $\triangle x$, $\triangle y$ & Grid spacing on domain $\Omega$ & $c_d/12$ & this work \\ $\triangle t$ (hrs)& Time step & 0.5 & this work\\ $\widehat{\Phi}$ & Cellular vol. frac. at a node & 0.3 & see Appendix A\\ $\Phi_{SC}^0$ & Initial SC vol. frac. & [0.01, 0.05] & \cite{Erickson09} \\ & & & \cite{Freed94}\\ $k_{SC}$ (1/days) & Degradation rate of SC & 0.038 & \cite{Wilson02}\\ $\tau$ (days) & Delay for SC degradation & 14 & \cite{Freed94}\\ $\Phi_{ECM}^{SS}$ & ECM steady state vol. frac. & 0.15 &\cite{Podrazky66}\\ $k_{ECM}$ (1/days) & ECM growth rate & 0.05 & \cite{Wilson02}\\ $t_{div}$ (days) & Minimum cell age to div. & 2.5 & \cite{Bandeiras15} \\ & & &\cite{Freed94} \\ & & & \cite{Chung10}\\ $t_{idle}$ (hrs) & Cell idle time after collision & 4 & \cite{Chung10}\\ $d_{cell}$ (cm) & Dist. a cell moves in $\triangle t$ & 0.0005 & \cite{Morales07} \\ $p_{sens}$ & Min. porosity for div. or mov. & 0.6 & see Appendix A\\ $a_{d,mov}$ (cm) & Diam. of annulus for cell mov. & 3$c_d$ & see Appendix A \\ $d_{div}$ (cm) & Min. dist. for div. cells & 3.5$c_d$ & this work\\ $c_{div}$ & Min. mean $c$ for div. & 0.7 & this work \\ $a_{d,div}$ (cm) & Diam. of annulus for cell div. & 3.5$c_d$ & see Appendix A\\ $p_{death}$& Probability of dying per $\triangle t$ & 0.0006 & \cite{Bandeiras15} \\ \bottomrule \end{tabular} \caption{Parameters used in the model to describe time scales and rates for cell growth and movement, as well as extracellular matrix accumulation and scaffold degradation. Notation - ECM=extracellular matrix, SC=scaffold, Sim.=simulation, dist.=distance, mov.=movement, div.=dividing, min.=minimum, vol. frac.=volume fraction, diam.=diameter, $c$=non dimensional nutrient concentration.} \label{tab:par} \end{center} \end{table} \subsubsection{Porosity} The porosity $p$ in the bio-construct is defined as $1-\Phi$ for solid volume fraction $\Phi$. At each node of the computational grid, $\Phi$ is computed as the sum of all the solid volume fractions: the cellular volume fraction $\Phi_{cell}$, the scaffold volume fraction $\Phi_{SC}$ and the extracellular matrix volume fraction $\Phi_{ECM}$, (ie $\Phi=\Phi_{cell}+\Phi_{SC}+\Phi_{ECM}$). This is illustrated in Fig.~\ref{fig:por}(b) for $\Phi_{SC}+\Phi_{ECM}=0.1$. Since the porosity directly depends on cell locations, we therefore update $p$ on the {\it fast} timescale (and hence $\Phi_{cell}$, $\Phi_{SC}$ and $\Phi_{ECM}$ are also updated on the same time scale). The cellular contribution to porosity, $\Phi_{cell}$, depends directly on the cell positions on the computational domain. Since the volume at a grid node corresponds to a region that allows for the overlap of cells and the presence of scaffold and extracellular matrix around the cell, we use $\widehat{\Phi}=0.3$ to define the contribution of the cell to the solid volume fraction. This is further depicted in Fig.~\ref{fig:por}(a) where $\Phi_{cell}=0$ outside of the cellular regions, $\Phi_{cell}=0.3$ where there is a non-overlapping cellular region, and $\Phi_{cell}=0.6$ in the regions where there are two cells overlapping. Additional details on cellular geometry and the grid are in Appendix A. In the growth process of tissue engineered cartilage, the scaffold degrades over time as the cells produce extracellular matrix \citep{Kock12,Matsiko15,Sengers07}. As in \cite{Wilson02}, the time course of the scaffold volume fraction $\Phi_{SC}$ is \begin{equation} \Phi_{SC}(t)=\left\{ \begin{array}{ll} \Phi_{SC}^0, & t<\tau\\ \\ \Phi_{SC}^0e^{-k_{SC}(t-\tau)}, \quad & t\geq \tau \end{array} \right. \label{eq:sc_sol} \end{equation} where $\Phi_{SC}^0$ is the initial scaffold volume fraction, $k_{SC}$ is the rate of scaffold degradation and $\tau$ is the time delay for scaffold degradation, see Table~\ref{tab:par}. The model assumes a uniform distribution of $\Phi_{SC}$ over the computational domain $\Omega$. The accumulating ECM solid volume fraction $\Phi_{ECM}$ is described by a logistic growth model \citep{Wilson02}, \begin{equation} \Phi_{ECM}(t)=\Phi_{ECM}^{SS}\ \left(1-e^{-k_{ECM} \cdot t}\right), \label{eq:ecm_sol} \end{equation} where $\Phi_{ECM}^{SS}$ is the steady state value of $\Phi_{ECM}$, and $k_{ECM}$ is the rate of growth, see Table~\ref{tab:par}. The model assumes uniform growth of $\Phi_{ECM}$ (not related to cell position).\\ \begin{figure}[ht!] \centering \begin{tikzpicture} \node[above] (A) at (-2,2) {(a)}; \draw [thick] (-2,-2) rectangle (2,2); \draw [draw=gray!50,fill=gray!50] (-0.85,-0.5) circle (0.5cm); \draw [draw=gray!50,fill=gray!50] (-0.425,-0.25) circle (0.5cm); \draw [draw=gray,fill=gray] (-0.42,-0.755) arc (-30:90:0.5cm) -- (-0.85,0) arc (150:270:0.5cm); \draw [draw=gray!50,fill=gray!50] (1,0.5) circle (0.5cm); \node[below right] (A) at (-2,2) {\footnotesize $\Phi_{cell}$}; \node (A) at (-0.25,-0.1) {\footnotesize $0.3$}; \node (A) at (-0.68,-0.32) {\footnotesize $0.6$}; \node (A) at (-1,-0.7) {\footnotesize $0.3$}; \node (A) at (1,0.5) {\footnotesize $0.3$}; \node[above right] (A) at (-2,-2) {\footnotesize $0$}; \begin{scope}[xshift=5.5cm] \node[above] (A) at (-2,2) {(b)}; \draw [thick,fill=gray!20] (-2,-2) rectangle (2,2); \draw [draw=gray!60,fill=gray!60] (-0.85,-0.5) circle (0.5cm); \draw [draw=gray!60,fill=gray!60] (-0.425,-0.25) circle (0.5cm); \draw [draw=gray,fill=gray] (-0.42,-0.755) arc (-30:90:0.5cm) -- (-0.85,0) arc (150:270:0.5cm); \node[below right] (A) at (-2,2) {\footnotesize $\Phi=\Phi_{cell}+\Phi_{SC}+\Phi_{ECM}$}; \draw [draw=gray!50,fill=gray!50] (1,0.5) circle (0.5cm); \node[above right] (A) at (-2,-2) {\footnotesize $0.1$}; \node (A) at (-0.25,-0.1) {\footnotesize $0.4$}; \node (A) at (-0.68,-0.32) {\footnotesize $0.7$}; \node (A) at (-1,-0.7) {\footnotesize $0.4$}; \node (A) at (1,0.5) {\footnotesize $0.4$}; \end{scope} \end{tikzpicture} \caption{Examples of solid volume fractions for different components in the model. (a): The cellular solid volume fraction $\Phi_{cell}$ is shown for the case where we assume each cell contributes $\widehat{\Phi}=0.3$ to the solid volume fraction. (b): Total solid volume fraction ${\Phi=\Phi_{cell}+\Phi_{SC}+\Phi_{ECM}}$ for the same cellular locations with $\Phi_{SC}+\Phi_{ECM}=0.1$. The domain $\Omega$ assumes a thickness that allows for partial overlap of cells and for scaffold and/or extracellular matrix around the cells.} \label{fig:por} \end{figure} \subsection{CA model} The cellular component is described with an off-lattice {\it cellular automaton} model. Cells are discrete entities described as circles with constant diameter $c_d$ with a surface covering 113 grid points spread around the cell center. At time zero, cells are randomly positioned on the domain $\Omega$ to avoid overlap, and cells are initialized with a random age in the interval $[0,3]$ days. Note that we use the same cell initialization for all simulations and we track the center of the cells ($x$ and $y$ coordinates) in the variable \texttt{loc} (of dimension $n_t\times 2$ where $n_t$ represents the number of cells at time $t$). At each time step of the simulation, a cell's potential movement and capability to divide (reproduce) are determined by a set of rules. The present model includes the phenomena of cellular division, random biased off-grid cellular movement (depending on nutrient concentration and porosity), cell-to-cell contact inhibition, and cell death. In the model, the current status of the cell is monitored with the variable {\texttt{cell\_status}}, see Table~\ref{tab:cell_status}. The value of this variable determines the possible actions for each cell during the numerical simulation. Note that a quiescent cell corresponds to a cell that is not moving and can not go through cell division due to a recent collision with another cell. A cell status of 3 denotes a cell that will soon die and be removed from the simulation. \begin{table}[t] \centering \begin{tabular}{cl} \toprule {\bf Numerical value} & {\bf Cell status} (\texttt{cell\_status})\\ \midrule $0$ & moving \\ $1$ & dividing \\ $2$ & quiescent \\ $3$ & dying\\ \bottomrule \end{tabular} \caption{Each cell is assigned a status with an associated numerical value, which determines the rules that are applied to that particular cell at a given time step in the \textit{CA} model. } \label{tab:cell_status} \end{table} \subsubsection{Cellular movement} Cellular movement is random and it is biased by nutrient concentration (chemotaxis) and porosity \citep{Erickson09,Matsiko15,Morales07,Freyria04}. For each cell that is in the moving state (\texttt{cell\_status=0}), as shown in Fig.~\ref{fig:cell-nbhd}, the cell will move in nine possible directions denoted by: $\mathbf{\varnothing}$, $E$, $NE$, $N$, $NW$, $W$, $SW$, $S$, $SE$. The first direction corresponds to the small probability of staying in the same exact position if the cell is in the moving state whereas the other directions correspond to the cardinal and intercardinal directions. \begin{figure}[t!] \centering \begin{tikzpicture} \foreach \x in {0,1,...,7}{ \draw[domain=0:2,smooth,variable=\y] plot ({1*\y*cos(22.5*(2*\x+1))},{1*\y*sin(22.5*(2*\x+1))}); } % \draw[very thick,fill=gray!50] (0,0) circle (0.5cm); % \foreach \x in {-3,-2.75,...,3}{ \foreach \y in {-3,-2.75,...,3}{ \draw[very thick] (\x+0.2,\y+0.1) circle (0.005cm); }} \foreach \x in {-2.875,-2.625,...,2.875}{ \draw[thin] (\x+0.2,-3+0.1) -- (\x+0.2,3+0.1);} \foreach \y in {-2.875,-2.625,...,2.875}{ \draw[thin] (-3+0.2,\y+0.1) -- (3+0.2,\y+0.1);} \draw [very thick] (0,0) circle (2cm); % \node[right,blue](E) at (2,0) {\bf E}; \node[above right,blue](NE) at (1.414,1.414) {\bf NE}; \node[above,blue](N) at (0,2) {\bf N}; \node[above left,blue](NW) at (-1.414,1.414) {\bf NW}; \node[left,blue](W) at (-2,0) {\bf W}; \node[below left,blue](SW) at (-1.414,-1.414) {SW}; \node[below,blue](S) at (0,-2) {\bf S}; \node[below right,blue](SE) at (1.414,-1.414) {SE}; % \end{tikzpicture} \caption{Schematic of a cell (shaded gray circle in center) on the computational domain where the eight cardinal and intercardinal directions ($E$, $NE$, $N$, $NW$, $W$, $SW$, $S$, $SE$) are shown. The circle on each grid box corresponds to the node value tracking the average porosity and nutrient concentration on that particular volume element. The nutrient and porosity values are assessed in the direction of no movement $\mathbf{\varnothing}$, on the nodes included in the shaded gray area, and in the eight cardinal and intercardinal directions, on the nodes contained in the annulus surrounding the cell. The inner diameter of the annulus corresponds to $c_d$ while the outer diameter of the annulus $a_{d,mov}$ is reported in Table~\ref{tab:par}.} \label{fig:cell-nbhd} \end{figure} In order to determine the cell's movement direction, the average nutrient concentration $c_{avg,j}$ is calculated on the nodes of the computational grid covered by the cell (direction $j=\mathbf{\varnothing}$) and in the eight neighborhoods exterior to the cell, as depicted in Fig.~\ref{fig:cell-nbhd}. The average values of nutrient concentration are then normalized in a probability direction vector where higher nutrient concentration will correspond to a higher probability in the {\it nutrient direction vector}, \texttt{dir\_n}, shown in Fig.~\ref{fig:dir}. The width of each bin $\omega_{n,j}$, in Fig.~\ref{fig:dir}, corresponds to the probability of moving in each of the directions and is computed as \begin{equation} \omega_{n,j}=\displaystyle \dfrac{c_{avg,j}}{\sum_{i=\mathbf{\varnothing}}^{SE} c_{avg,i}} \qquad j=\mathbf{\varnothing},E,\ldots,SE. \label{eq:omegan} \end{equation} The nutrient direction vector \texttt{dir\_n} is obtained by sequentially combining rescaled $\widehat{\omega}_{n,j}$ bins in a probability vector that is in the range $[0,1]$. Similarly, a second direction vector is obtained for the average porosity where higher porosity will correspond to a higher probability in the {\it porosity direction vector}, \texttt{dir\_p}. The width of the bins $\omega_{p,j}$ of \texttt{dir\_p} are computed as follows \begin{equation} \omega_{p,j}=\displaystyle \dfrac{p_{avg,j}}{\sum_{i=\mathbf{\varnothing}}^{SE} p_{avg,i}} \qquad j=\mathbf{\varnothing},E,\ldots,SE \label{eq:omegap} \end{equation} where the quantity $p_{avg,j}$ represents the average porosity on the grid points in the region $j$ (i.e. fluid region or $1-\Phi$ for solid volume fraction $\Phi$). The width of a bin is set to zero if the corresponding region contains a grid point with porosity less than $p_{sens}$, which corresponds to an unfavorable region since there is not enough room for the cell. The bin widths are rescaled as $\widehat{\omega}_{p,j}$ to again ensure a range of $[0,1]$. Finally, the two direction vectors are combined to obtain a comprehensive direction vector, \texttt{dir}, for each cell. The width of the bins, $\omega_j$, of the vector \texttt{dir} are obtained as \begin{equation} \omega_j=\widehat{\omega}_{n,j} \cdot\widehat{\omega}_{p,j} \qquad j=\mathbf{\varnothing},\ldots,SE \label{eq:omega} \end{equation} In order for the bins to be in the range of $[0,1]$, the bins $\omega_j$ are rescaled as $\widehat{\omega}_j$ and are then sequentially combined in the direction vector \texttt{dir} as in Fig.~\ref{fig:dir}. The movement direction of each cell is determined by choosing a distinct random variable \texttt{X} from a uniform distribution $U[0,1]$ and determining which direction bin contains $\texttt{X}$. We note that wide bins $\widehat{\omega}_j$ have a higher probability of containing \texttt{X} and have larger width due to a more favorable nutrient concentration (larger $c_{avg,j}$) and/or a more favorable porosity (larger $p_{avg,j}$). As an example of how the direction is chosen, if \texttt{X}=$0.35$ and the rescaled bin sizes are $\widehat{\omega}_{\mathbf{\varnothing}}=0.1$, $\widehat{\omega}_E=0.1$, and $\widehat{\omega}_{NE}=0.2$, \texttt{X} will fall in the $NE$ bin (since $0.1+0.1+0.2=0.4$), therefore the corresponding cell will move in the $NE$ direction. We use the convention that the chosen cell direction $k$ is the first direction to satisfy the following inequality: \texttt{X}$<\left(\sum_{j=\varnothing}^{k}\widehat{\omega}_j\right)$ for $k={\mathbf{\varnothing}},E,\ldots,SE$. We note that if \texttt{X}$=1$, this will correspond to $k=SE$. At a given time step, all cells will simultaneously move in the chosen direction $k$ a fixed distance $d_{cell}$ (reported in Table~\ref{tab:par}). The movement is applied to the cell center coordinates stored in the matrix \texttt{loc}. Again, if $NE$ is chosen for cell $i$, then we update the x and y coordinates of the $i^{th}$ cell by adding $d_{cell}\cos(\pi/4)$ and $d_{cell}\sin(\pi/4)$ to the old locations, respectively. Note that if cell movement results in a local porosity with $p>1$, which may occur on occasion when multiple cells have moved into the same location, this issue is resolved by randomly choosing to undo the movement of half of these cells, until the situation is resolved. \begin{figure}[th] \centering \begin{tikzpicture} \draw node[below]{0}(0,0) -- (5.5,0) node[below]{1} -- (5.5,1) -- (0,1) --node[right,pos=0.5]{$\mathbf{\varnothing}$} (0,0); \draw (0.5,0) -- node[right,pos=0.5,xshift=-0.05cm]{$E$} (0.5,1); \draw (0.9,0) -- node[right,pos=0.5]{$NE$} (0.9,1); \draw (1.7,0) -- node[right,pos=0.5,xshift=0.1cm]{$N$} (1.7,1); \draw (2.4,0) -- node[right,pos=0.5]{$NW$} (2.4,1); \draw (3.2,0) -- node[right,pos=0.5,xshift=-0.05cm]{$W$} (3.2,1); \draw (3.7,0) -- node[right,pos=0.5]{$SW$} (3.7,1); \draw (4.5,0) -- node[right,pos=0.5,xshift=-0.05cm]{$S$} (4.5,1); \draw (4.8,0) -- node[right,pos=0.5]{$SE$} (4.8,1); \end{tikzpicture} \caption{Example of direction vector for cell movement. The width of each bin is computed following \eqref{eq:omegan}, \eqref{eq:omegap}, and \eqref{eq:omega} for the direction vector \texttt{dir\_n}, \texttt{dir\_p}, and \texttt{dir}, respectively.} \label{fig:dir} \end{figure} Movement of cells may result in collisions among cells, which will cause a cell to enter the quiescent state (\texttt{cell\_status}=2). The quiescent state is due to the cell-to-cell contact inhibition and cells will stay idle in this state (no movement or division) for a fixed time $t_{idle}$, reported in Table~\ref{tab:par}. At the end of each iteration, we check for new cell collisions by determining which cells in the moving state (\texttt{cell\_status}=0) are now a distance less than $c_d$ apart from any other cell (distance between cell centers). The cells that are less than $c_d$ apart will enter the quiescent state (\texttt{cell\_status}=2); the collision counter is initially set to $t_{idle}$ and is then decreased by $\triangle t$ at each iteration. When the counter reaches 0, the cell is then put back into the moving state (\texttt{cell\_status}=0). \subsubsection{Cellular division and death} As shown in the algorithm diagram in Fig.~\ref{fig:flux-big}, at each time step, we first check whether a cell will be tagged to die in this time step and whether a cell has the potential to divide. These decisions will be based on the rules outlined below. The rule that governs the capability of a cell to undergo cellular division is related to four different conditions that must be simultaneously satisfied at a given time point. In order for cell division to occur, a cell must: \begin{enumerate} \item Not be in the quiescent or dying mode (\texttt{cell\_status}$\neq$2,3). \item Have reached cellular maturity (\texttt{cell\_age}$\geq t_{div}$, see Table~\ref{tab:par}). \item Be in a region with enough nutrient ($c_{avg} > c_{div}$, see Table~\ref{tab:par}, where $c_{avg}$ is the average nutrient concentration on the grid points covered by the cell surface). \item Be nearby a region with high enough porosity to host a new cell ($p>p_{sens}$, see Table~\ref{tab:par}). \end{enumerate} The cells that have the potential to divide (passing all necessary conditions listed above) undergo an overcrowding check to ensure that there is room for the new daughter cell. The center-to-center distance between all dividing cells is computed. Of all the cells that are less than $d_{div}$ apart, half are chosen at random and are allowed to undergo cell division (and moved to the dividing status, \texttt{cell\_status}=1) where the two daughter cells are each the same size as the mother cell. This check prevents too many cells that are close to each other from dividing during the same iteration. The new cell is placed adjacent to the mother cell along a direction that is randomly chosen depending on the local value of porosity. The procedure used to determine the division direction vector, \texttt{dir\_d}, is similar to the one followed to generate \texttt{dir\_p}. The number of possible directions is reduced from 8 to 6 ($E$, $NE$, $NW$, $W$, $SW$, $SE$, each with an arc of $\pi/3$), so that each of the six regions are able to contain the full surface of the new cell (additional details in Appendix A). The width of the six bins, $\omega_{d,j}$, in the vector \texttt{dir\_d} are \begin{equation} \omega_{d,j}=\displaystyle \dfrac{\exp(100p_{avg,j})-1}{\sum_{i=E}^{SE} \exp(100p_{avg,i})-1} \qquad j=E,NE,\ldots,SE, \label{eq:omegad} \end{equation} and the width of a bin is set to zero if the corresponding region contains a grid point with porosity such that $p<p_{sens}$. Similarly, we follow the same procedure used for cell movement where we determine a rescaled $\widehat{\omega}_{d,j}$ such that we remain on $[0,1]$ and we then choose a uniform variable \texttt{X} for each mother cell and find the bin and direction that will determine the position of the new (daughter) cell. The region used to determine the vector \texttt{dir\_d}, similar to the one depicted in Fig.~\ref{fig:cell-nbhd}, has outer diameter $a_{d,div}$, reported in Table~\ref{tab:par}. The new daughter cell will be located at a radial distance of $7c_d/6$ in the chosen direction where the 7/6 ensures that these cells are close but will not automatically go into the quiescent state. To avoid consecutive divisions of the same cells, after a cell divides, the variable \texttt{cell\_age} of the two daughter cells is reset to zero. The variable \texttt{cell\_age} is then incremented by $\triangle t$ after each time step to track the aging process of the cell. At the end of a time step, all cells in the dividing state (\texttt{cell\_status=1}) are then placed into the moving state (\texttt{cell\_status=0}) and then re-evaluated at the next time step. We emphasize that Equation~\eqref{eq:omegad} provides a stronger bias than~\eqref{eq:omegap} resulting in a high probability that the new cell will be placed in a region of high porosity. Cell death is known to be a random process and we assume there is a small probability of a cell switching on the apoptotic pathway to initiate cell death at each time step. In particular, staining for dead mesenchymal stem cells (precursors to chondrocytes) seeded in gels of different macromer concentrations showed a uniform distribution of dead cells throughout the construct at day 21 \citep{Erickson09}. We convert cellular death rates from continuous models \citep{Bandeiras15} and obtain a death probability per iteration as $p_{death}=0.0006$, reported in Table~\ref{tab:par}. In simulations, at the beginning of the time step, we randomly choose cells to be moved to the dying state (\texttt{cell\_status}=3), where no movement will occur during the current time step, and they will be removed from the domain at the beginning of the next iteration before the dying cells for the next iteration are chosen. \subsubsection{Boundary Conditions} In Fig.~\ref{fig:sc}(b), the computational domain $\Omega$ is highlighted in dark gray. Since cells tend to stay within the bio-construct, we assume a no-flux boundary condition on the right and bottom that are exposed to the nutrient bath. The left and top are connected to the rest of the domain and we also assume a no-flux boundary condition since it is assumed that on average, if one cell was leaving this region, another would be entering. If the chosen direction would place a cell outside of the domain, its trajectory is corrected before the cell moves to keep the cell inside the domain. The correction is performed on the coordinate that would exceed the computational domain by reversing the chosen movement direction and reducing its magnitude by a factor of ten. The boundary of the computational domain is padded with several layers of ghost grid points initialized with a value of $c=0$ for concentration and $p=0$ for porosity. Therefore, when a cell is close to the boundary, if part of the region depicted in Fig.~\ref{fig:cell-nbhd} covers any ghost node, that specific direction will be automatically penalized by the direction rules \eqref{eq:omegan}, \eqref{eq:omegap} and \eqref{eq:omegad} to minimize the chances that a cell will exit the domain or will divide outside the domain. \section{Results and Discussion} A primary aim of this study was to incorporate the influence of scaffold porosity, and hence initial scaffold solid volume fraction, to then investigate cellular movement and reproduction in a cell-seeded scaffold with applications to articular cartilage regeneration. To validate our model and identify parameter values that led to tissue growth, we first started with data from \cite{Freed94} where the chondrocyte density was reported for polyglycolic acid (PGA) scaffolds with initial scaffold porosities of 0.92-0.96 ($\Phi_{SC}^0\in$[0.04,0.08]) with different cell seedings. We extracted their cell density data, which was reported as an average over three samples for seven different experiments, where scaffold dimension and initial cell density was varied. To obtain the number of cells to seed in our simulation domain $\Omega$, we found the product of our domain volume and the mean cell seeding density (cells/cm$^{3}$) of the seven different experiments, which is equal to $2000$ cells. We then reduced this since experiments of \cite{Freed94} reported an elevated death rate in the first $2$ days (~$50\%$) and we use a constant death probability over the course of the simulation. \begin{figure}[ht] \begin{center} \includegraphics[width=0.95\textwidth]{comp_freed} \end{center} \caption{Total cell counts in the bio-construct with respect to time for the baseline parameters given in Table \ref{tab:par} and using different values of initial scaffold macromer concentrations of 1\%, 2\%, and 5\%, which correspond to initial scaffold volume fractions of $\Phi^0_{SC}=0.01$, 0.02, and 0.05, respectively. The model predictions are compared with chondrocytes seeded in a polygycolic acid (PGA) scaffold from~\cite{Freed94}, shown as data points representing the mean and one standard deviation over three samples. } \label{fig:comp-freed} \end{figure} Using the parameters reported in Table \ref{tab:par}, we start with 1000 cells in our domain $\Omega$ and track the total number of cells through 30 days. These results are shown in Fig.~\ref{fig:comp-freed} for three different initial scaffold volume fractions ($\Phi^0_{SC}=0.01$, $0.02$, and $0.05$). For comparison, we also plot on this graph the data of \cite{Freed94} at day 0, 8, 14, 21, and 28 with circles denoting the mean and bars showing one standard deviation across three samples of scaffold thickness $h=0.168$ cm and diameter $d=1$ cm, with initial seeding in the total construct of $2\cdot 10^6$ cells. Note that the Freed data is actually for days 2, 10, 16, 23, and 30 of their experiment but since we start with the cell numbers reported at day 2, we have shifted their data to compare with the simulations. The slope of the cell count curves from day 0 to 8 are all in good agreement with the slope of the experimental data points. Overall, we find relatively good agreement between this data and our simulations; the cell densities of our simulations are slightly smaller than the experiment at later time points for this set of baseline parameters. For the first 8 days, all three simulation cases result in similar cell growth and after day 8, the scaffold with 5\% initial scaffold concentration (i.e. $\Phi^0_{SC}=0.05$ ) starts to significantly increase in cell number, leveling off at around 5800 cells. The 5\% case has the highest cell density, closer to the cell counts of \cite{Freed94} where initial scaffold concentrations were 4-8\%. For the case of $\Phi_{SC}^0=0.08$ with baseline parameters, this bio-construct achieves a maximum cell count of 8000 cells and a final cell count of 6900 cells, showing good agreement with the data from~\cite{Freed94} (results not shown). \begin{figure}[ht] \begin{center} \begin{tikzpicture} \node (fig) at (0,0) {\includegraphics[width=0.95\textwidth]{nutrient}}; \node (a) at (-4.65,2.5) {(a)}; \node (b) at (0.5,2.5) {(b)}; \node (c) at (-4.65,-0.05) {(c)}; \node (d) at (0.5,-0.05) {(d)}; \end{tikzpicture} \end{center} \caption{Cell distribution for the baseline scenario using parameters in Table \ref{tab:par} with an initial scaffold volume fraction of 1\% ($\Phi_{SC}^0=0.01$) at day 1 in (a), day 7 in (b), day 15 in (c), and day 30 in (d). The non-dimensional nutrient profile is shown in the background with the colorbars on the right. Cell locations are denoted with black dots on the domain. Note that the minimum value of the nutrient profile in the upper left corner of panel (d) is $0.1$.} \label{fig:nutrient} \end{figure} To highlight the cellular dynamics in the evolving bio-construct, in Fig.~\ref{fig:nutrient}, the cell locations in the construct are plotted at four time points for the case of a scaffold with $\Phi_{SC}^0=0.01$. For all simulations, we assume the same nutrient profile as detailed in Appendix B where at day 1, Fig.~\ref{fig:nutrient}(a), there is a constant and high nutrient concentration throughout the construct. Thus, at this time point, cells will primarily move in directions corresponding to higher porosity (more free space due to less cells in the region). At later time points such as day 7, Fig.~\ref{fig:nutrient}(b), due to cell division in the interior of the construct, the nutrient concentration is decreasing in these regions. Cell motility will be biased now based on nutrient concentration and porosity. The bias of cells to migrate to regions of higher nutrient concentration is clearly seen at time points of day 15, Fig.~\ref{fig:nutrient}(c), and day 30, Fig.~\ref{fig:nutrient}(d), where the nutrient profile continues to decrease on the interior portions of the construct and only remains high in the regions closest to the nutrient bath. At day 30, a band of cells at a higher density is clearly seen and we still observe cells in the upper left corner since due to porosity constraints, there is not enough room for all cells to migrate to the boundaries. We note that similar profiles of cellular distributions are observed for other cases of initial scaffold solid volume fractions. The simulation results also match up well with previous experiments of \cite{Vunjak98} and models of \cite{Chung10} in terms of increased cellular distributions near edges with higher nutrient concentration. However, in comparison to the model of \cite{Chung10}, the dynamics of aggregation are a bit different since we are also accounting for a porosity bias in movement and cellular division. The local porosity is changing in time due to the local cell volume fraction as well as the decreasing scaffold volume fraction and increasing ECM volume fraction. The results shown in Fig.~\ref{fig:comp-freed} and \ref{fig:nutrient} are for a single run of the model. However, the hybrid modeling framework we utilize involves several terms that are stochastic and hence there is aleatory uncertainty~\citep{Alden13,Cosgrove15,Read12} in model results for a single simulation. Since we want to ensure that the simulation results account for the full amount of variation in the system, we utilize an \textit{A-test}~\citep{Vargha00} as described in Appendix C. The \textit{A-test} determines the number of simulations to run to ensure that the results we report are a true representation of the entire model. For all simulation results in the remaining figures, the reported means and standard deviations correspond to 300 simulations with the same cell initial location and age. \begin{figure}[ht] \begin{center} \begin{tikzpicture} \node (fig) at (0,0) {\includegraphics[width=0.95\textwidth]{fig1}}; \node (a) at (-4.5,2.5) {(a)}; \node (b) at (-1.35,2.5) {(b)}; \node (c) at (1.85,2.5) {(c)}; \end{tikzpicture} \end{center} \caption{Model predictions of cells in different states for the baseline parameters given in Table \ref{tab:par} with different values of scaffold volume fractions of $\Phi^0_{SC}=0.01$, 0.02, and 0.05, respectively. The graph displays the total number of cells (dotted magenta), the cells in the moving state (solid magenta), cells in the dividing state (solid black), and cells in the quiescent state (dotted black). Curves and bars correspond to the mean and standard deviation over 300 simulations.} \label{fig:baseline} \end{figure} To illustrate the dynamics of cells for the baseline case, we track cell counts for each of the different cell states in Fig.~\ref{fig:baseline}. We emphasize again that the nutrient profile and ECM accumulation is assumed to be the same in each case. The only parameter that is changed is the initial scaffold volume fraction $\Phi_{SC}^0$, which will then degrade with similar dynamics after a time delay of $\tau$ days. Similar behavior in terms of the total cell counts in the different states are observed for $\Phi_{SC}^0=0.01$ and 0.02. One notable difference is that the number of moving cells increases significantly around day 20 for the 0.01 case, Fig.~\ref{fig:baseline}(a), and increases around day 14 for the 0.02 case, Fig.~\ref{fig:baseline}(b). This trend results in a similar decrease in quiescent cells at the same time points. This can be partially explained as follows. Cells initially in the highest porosity (lower volume fraction of scaffold) are more free to move within the domain at earlier time points. As the nutrient profile changes, this then biases cells to move towards nutrient rich regions and will often result in cells colliding with each other. Once cells adjust their movement again, they are able to bias their motion in directions balancing higher nutrient and higher porosity (and hence, less cells nearby). In the case of lower initial porosity (higher initial scaffold volume fraction), cells are more biased by porosity initially and are able to move throughout the domain with less collisions. Hence, they are able to distribute themselves in a way that allows space for new daughter cells. Note that we are accounting for cell death in these simulations; this is on the order of 25-100 cells per day, which is why these curves are observed as very small oscillations. \begin{figure}[ht] \begin{center} \begin{tikzpicture} \node (z1q) at (0,0) {\includegraphics[width=0.49\textwidth]{zone1q}}; \node (z3q) at (5.5,0) {\includegraphics[width=0.49\textwidth]{zone3q}}; \node (z1m) at (0,-3) {\includegraphics[width=0.49\textwidth]{zone1m}}; \node (z3m) at (5.5,-3) {\includegraphics[width=0.49\textwidth]{zone3m}}; \node (a) at (-2.5,1.3) {(a)}; \node (b) at (3,1.3) {(b)}; \node (c) at (-2.5,-1.7) {(c)}; \node (d) at (3,-1.7) {(d)}; \end{tikzpicture} \end{center} \caption{Cell counts by cellular status in Zone 1 and Zone 3, the upper left and lower right corners of the domain $\Omega$ shown in Fig.~\ref{fig:sc}(b), for $\Phi_{SC}^0=0.01$ (1\%), $\Phi_{SC}^0=0.02$ (2\%), and $\Phi_{SC}^0=0.05$ (5\%) at day 1, 15, and 30. Quiescent cell counts are shown in the top row with (a) Zone 1 and (b) Zone 3. Moving cell counts are shown in the bottom row with (c) Zone 1 and (d) Zone 3. Simulation parameters are reported in Table~\ref{tab:par}.} \label{fig:barbaseline} \end{figure} As observed in Fig.~\ref{fig:nutrient}, we observe clusters of cells closer to the nutrient rich regions at day 14 and later time points. To further characterize these spatial differences, we analyze the cell status of cells in two regions of the domain $\Omega$ shown in Fig.~\ref{fig:sc}(b). We refer to the upper left corner of the domain, $[0,0.17]\times[0,0.03]$, as Zone 1 and the lower right corner of the domain $[0.33,0.5]\times[0.07,0.1]$, as Zone 3. In Fig.~\ref{fig:barbaseline}, we highlight the differences in quiescent and moving cells at day 1, 15, and 30. For the quiescent cells, we observe different trends in Zone 1 and Zone 3, shown in Fig.~\ref{fig:barbaseline}(a)-(b). In Zone 3, we observe a similar monotonic increasing behavior as days increase for all three initial scaffold macromer concentrations. This is most likely due to higher nutrients in Zone 3, causing increased collisions due to increased cells in this Zone. In contrast, there is an increase and then decrease in quiescent cells for the 1 and 2\% cases whereas the 5\% decreases with time. For the 5\% case, this is due to the fact that in this model, a lower initial porosity with the same porosity sensitivity means that on average, these cells will be moving smarter in the direction of higher nutrient, hence moving out of Zone 1. The counts for moving cells are shown in Fig.~\ref{fig:barbaseline}(c)-(d), where Zone 1 in (c) has a similar monotonic increasing trend for the 1 and 2\% cases. However, the 5\% case increases and then decreases, due to cells moving out of Zone 1 and towards the nutrient rich regions. The number of moving cells in Zone 3 is shown in (d), where we observe a monotonic increasing trend with for all three cases. We note that for the total cell counts (results not shown) in Zone 1 we observe, for all three cases, an increase from day 1 to 15 whereas there is a decrease from day 15 to 30 due to the decreased nutrient concentration at later time points. All three cases also have approximately the same number of total cells in Zone 1; the low nutrient concentration is dominating over porosity in this region at later time points. In Zone 3, close to the nutrient-rich bath, all three cases exhibit an increase in total cell number from day 1 to 15 to 30. The 1 and 2\% scaffold concentrations have less total cells in Zone 3 relative to the 5\% case, similar to results shown for the entire construct in Fig.~\ref{fig:baseline}. \begin{figure}[ht] \begin{center} \begin{tikzpicture} \node (fig) at (0,0) { \includegraphics[width=0.95\textwidth]{aggregates}}; \node (a) at (-4.5,2.3) {(a)}; \node (b) at (-1.35,2.3) {(b)}; \node (c) at (1.85,2.3) {(c)}; \node (d) at (-4.5,-0.2) {(d)}; \node (e) at (-1.35,-0.2) {(e)}; \node (f) at (1.85,-0.2) {(f)}; \end{tikzpicture} \end{center} \caption{Model predictions of average diameter of cell aggregates, $d_{ag}$, on: (a) the entire domain $\Omega$, (b) Zone 1, and (c) Zone 3. The percentage of cells in aggregates, $f_{ag}$, on: (d) the entire domain $\Omega$, (e) Zone 1, and (f) Zone 3. All simulations reported here used the baseline parameters reported in Table~\ref{tab:par} and are for three different values of scaffold volume fractions: $\Phi^0_{SC}=0.01$ (solid line), 0.02 (dashed line), and 0.05 (dotted line). The average quantities and standard deviations are reported at $t=\{1,3,7,10,15,20,25,30\}$ days.} \label{fig:aggr} \end{figure} The presence of cell aggregates has been shown to influence several processes in the development of tissue engineered articular cartilage, thus we investigate cell clustering in our simulations. To further quantify the nature of cell aggregates obtained in the numerical simulations we compute the average cell aggregate diameter $d_{ag}$ and the average fraction of cells in aggregates, $f_{ag}$. Two cells are considered part of the same aggreagate if their center-to-center distance is less than $c_d$. The aggregate dimeter, $d_{ag}$, is computed as the maximum distance between the cell centers in the same aggregate plus $c_d$. The value is then averaged between all aggregates at a corresponding time step. The values depicted in Fig.~\ref{fig:aggr}(a)-(c) at each time point is the mean aggregate diameter $d_{ag}$ over 300 simulations and the standard deviation is shown at 8 time points. Isolated cells (aggregates of one cell) are not considered in the computation of the average $d_{ag}$. For different initial scaffold solid volume fraction $\Phi_{SC}^0$, Fig.~\ref{fig:aggr} captures the average dynamics of cell agreggates on the entire domain in (a), Zone 1 in (b), and Zone 3 in (c). The model predicts an average value of $d_{ag}$ of 1.7-2 $\times 10^{-3}$cm, which is in agreement with the value of 20$\mu$m (2$\times 10^{-3}$cm) reported by \cite{Vunjak98}. As expected, cell aggregate diameter $d_{ag}$ is growing in time in (a)-(c), consistent with increased cells in the construct. In addition, $\Phi_{SC}^0=0.05$ has aggregates that are larger than the other cases for days 10-30. Since Fig.~\ref{fig:aggr}(a)-(c) only captures the average diameter of cell clusters, we also wanted to investigate the fraction of cells in aggregates. The fraction of cells in aggregates, $f_{ag}$, is computed as the ratio between the number of cell in aggregates and the total number of cells at a given time. The dynamics of the value of $f_{ag}$ are shown in Fig.~\ref{fig:aggr} for the entire domain in (d), Zone 1 in (e), and Zone 3 in (f). In (d)-(f), the fraction of cells in aggregates are characterized by an increase followed by a rapid decrease in all of the zones considered. There is a location specific behavior in Zone 1 and Zone 3. After the rapid decrease of $f_{ag}$ in Zone 1 shown in (e), it then remains almost constant whereas it increases rapidly in Zone 3 in (f). The behavior in the whole domain $\Omega$, Fig.~\ref{fig:aggr}(d), seems to be intermediate between Zone 1 and Zone 3. The dynamics for both the aggregate size and fraction of cells in aggregates in Zone 1 and 3 are consistent with the data reported in Fig.~\ref{fig:barbaseline}. The uniform nutrient distribution applied at the beginning of the simulation promotes uniform cell growth in the whole domain, independent from location, and therefore more collisions and the increase in $f_{ag}$ reported in Fig.~\ref{fig:aggr}(d). When the cells reach a critical value of porosity, their movement is limited and they have to move smarter causing a decrease in collisions and thus a decrease in $f_{ag}$. Then, the lower nutrient concentration in Zone 1 will result in a lower number of cells and therefore a lower value of $f_{ag}$ as shown in (e), whereas the high nutrient concentration in Zone 3, shown in (f), will promote cell division and the increase of $f_{ag}$. We note that the temporal dynamics of the variations in $f_{ag}$ are faster for the simulations with a higher initial scaffold volume fraction ($\Phi_{SC}^0$). This is consistent with the dynamics depicted in Fig.~\ref{fig:baseline}, since a higher initial scaffold volume fraction corresponds to achieving the critical value of porosity at an earlier time point, triggering the qualitative change in behavior \begin{figure}[ht] \begin{center} \begin{tikzpicture} \node (fig) at (0,0) { \includegraphics[width=0.95\textwidth]{fig1_mat}}; \node (a) at (-4.5,2.4) {(a)}; \node (b) at (0.5,2.4) {(b)}; \node (c) at (-4.5,-0.1) {(c)}; \node (d) at (0.5,-0.1) {(d)}; \end{tikzpicture} \end{center} \caption{Total number of cells and cell counts for the different cell statuses as $t_{div}$, the time for a cell to mature and be able to divide, is varied. All other parameters are from Table \ref{tab:par} and initial scaffold volume fraction is $\Phi_{SC}^0=0.01$. The graph displays the total number of cells in (a) and cells in the following states: (b) moving, (c) dividing, and (d) quiescent. The standard deviation is shown at days 1, 7, 15, and 30. } \label{fig:maturity} \end{figure} We note that cell characteristics such as movement, reproduction, and synthesis of extracellular matrix will depend heavily on the initial cell type as well as the type of scaffold that the cells are seeded in. Hence, parameters in this model can be tuned for different experimental setups and we can explore how variations in these parameter values affect the cellular distribution within the construct. In the literature, the average time for a chondrocyte to mature and be able to divide in different experimental conditions is estimated as 1.5-3 days and our baseline value was $t_{div}=2.5$ \citep{Bandeiras15,Chung10,Freed94}. We investigate increasing ($t_{div}=3.5$ days) and decreasing ($t_{div}=1.5$ days) the cell maturity time in Fig.~\ref{fig:maturity}. As expected, when $t_{div}$ is decreased and cells mature at a faster rate, the total cell number increases (Fig.~\ref{fig:maturity}(a)) and we observe that more cells are undergoing division in the first 10 days (Fig.~\ref{fig:maturity}(c)). Correspondingly, there are more cells, which results in an increase in cell collisions and cells in the quiescent state as shown in (d). As cells can no longer undergo division since they do not meet the criteria in terms of porosity and nutrient concentration, cells divide less frequently after 10 days as shown in Fig.~\ref{fig:maturity}(c). We observe in Fig.~\ref{fig:maturity}(b) that cells move at a higher rate after day 20, since they are able to move throughout the domain and rearrange themselves in a way that collisions are greatly reduced as shown in (d). The proposed decrease in cell maturity age $t_{div}$ (faster maturity) resulted in a significant increase in total cells whereas the increase in $t_{div}$ (slower maturity) led to a decrease in cell number relative to the baseline case. This is due to the fact that with the decrease in cells, there are fewer cells that can divide through the course of the simulation. We note that the spikes in the number of dividing cells shown in Fig.~\ref{fig:maturity}(c) occurs at different time points, which is consistent with the different maturity time scales. We note that results in Fig.~\ref{fig:maturity} are shown for an initial scaffold solid volume fraction $\Phi_{SC}^0=0.01$ and that similar trends are observed for 0.02 and 0.05 (results not shown). The rapid change observed in Fig.~\ref{fig:maturity}(b) and (d) around day 18 happens at an earlier time point for higher initial scaffold volume fractions, consistent with the temporal dynamics in Fig.~\ref{fig:baseline}. \begin{figure}[ht] \begin{center} \begin{tikzpicture} \node (fig) at (0,0) { \includegraphics[width=0.95\textwidth]{fig_phi_rel5p}}; \node (a) at (-4.5,2.4) {(a)}; \node (b) at (0.5,2.4) {(b)}; \node (c) at (-4.5,-0.1) {(c)}; \node (d) at (0.5,-0.1) {(d)}; \end{tikzpicture} \end{center} \caption{Cell counts and cell states as $p_{sens}$, the sensitivity to porosity, is varied for initial scaffold volume fraction $\Phi_{SC}^0=0.05$. All other parameters are from Table \ref{tab:par}. The graphs display the total number of cells in (a), the percentage of cells in the moving state in (b), the percentage of cells in the dividing state in (c), and the percentage of cells in the quiescent state in (d). The standard deviation is shown at days 1, 7, 15, and 30.} \label{fig:phi} \end{figure} In this model, we have biased cellular movement based on both the local nutrient concentration as well as the porosity. In the baseline parameters, we set the sensitivity to porosity to $p_{sens}=0.6$ such that a cell is not likely to move in the direction with porosity less than this value, and it won't divide in a region with porosity less than $p_{sens}=0.6$. Since we do not have an experimentally measured value for this parameter, we vary it higher and lower to understand how this changes the cellular dynamics in the construct. Results are shown in Fig.~\ref{fig:phi} for the case of initial scaffold volume fraction $\Phi_{SC}^0=0.05$ and a high and low sensitivity, corresponding to $p_{sens}=0.75$ and $p_{sens}=0.45$, respectively. Higher sensitivity actually leads to an increase in total cell count over the baseline case as shown in (a), which is counter intuitive at first glance since one would think that higher sensitivity might prevent movement and cell division. However, the higher sensitivity to porosity leads to increased cellular movement as shown in (b) and a decrease in quiescent cells as shown in (d), which results in decreased cell clustering and collisions. This then allows for more cells to divide, shown in (c), since they are more spread out. Lower sensitivity has total cell counts similar to the baseline for the first 8 days. After that time point, lower sensitivity to porosity has higher probability of movement leading to cell clustering and as a result, there is a much larger percentage of cells that collide and end up in the quiescent state. We note that there is a non symmetric behavior in that the same magnitude of increase and decrease in sensitivity to porosity gives changes in total cell number that are very different in magnitude. Similar trends are observed for $\Phi_{SC}^0=$0.02 and 0.01 (results not shown), and the rapid change observed in the magenta line ($p_{sens}=0.6$) in Fig.~\ref{fig:phi}(b) and (d) around day 8 happens at later time points for lower initial scaffold volume fractions, consistent with the temporal dynamics in Fig.~\ref{fig:baseline}. \begin{figure}[ht] \begin{center} \begin{tikzpicture} \node (fig) at (0,0) { \includegraphics[width=0.95\textwidth]{fig_phi_mat1p5p_fixed}}; \node (a) at (-4.5,2.7) {(a)}; \node (b) at (0.5,2.7) {(b)}; \end{tikzpicture} \end{center} \caption{Total cell number for initial scaffold volume fraction $\Phi_{SC}^0=0.01$ in (a) and $\Phi_{SC}^0=0.05$ in (b) when varying sensitivity to porosity $p_{sens}$ and cell maturity time $t_{div}$. All other parameters are specified in Table \ref{tab:par}. } \label{fig:phi-mat1p5p} \end{figure} To further understand the dynamics of cell counts in the bio-construct, we explore varying the cell maturity time $t_{div}$ and the sensitivity to porosity $p_{sens}$ in Fig.~\ref{fig:phi-mat1p5p}. In the case of 1\% initial scaffold macromer concentration ($\Phi_{SC}^0=0.01$) in Fig.~\ref{fig:phi-mat1p5p}(a), when cell maturity time is increased, black lines, there is a consistent decrease in cell total for each porosity sensitivity, and the magnitude of the decrease is more pronounced for higher values of $p_{sens}$, dashed lines. The simulations with higher sensitivity are characterized by a higher growth rate which is greatly affected by an increase in $t_{div}$. However when there is a high sensitivity to porosity \textit{and} a longer cell maturity time ($t_{div}=3.5$ days), dashed black line, the system is still able to achieve a cell count close, and even higher at some time points, to simulations with lower $p_{sens}$ and shorter cell maturity time $t_{div}$, solid and dotted magenta lines. Cells with $p_{sens}$=0.75 are moving smarter than the cases with lower values of $p_{sens}$, and are therefore able to divide when they reach maturity, thus being able to fill the gap with the simulations with lower cell maturity time and obtain a similar total cell count. The effects of variations of $p_{sens}$ for the higher value of $t_{div}=$3.5 days is qualitatively similar to the variations obtained for $t_{div}=$2.5 days suggesting the importance of the parameter $p_{sens}$. In comparison, we can look at results for a higher initial scaffold volume fraction of 0.05 in Fig.~\ref{fig:phi-mat1p5p}(b). Similar to the 0.01 case, a higher sensitivity to porosity results in an increased cell count when the cellular maturity time is decreased. However, in the 0.05 case, we observe that cell counts are more dependent on the sensitivity to porosity in combination with cellular maturity time. \begin{figure}[ht] \begin{center} \begin{tikzpicture} \node (fig) at (0,0) { \includegraphics[width=0.95\textwidth]{speed}}; \node (a) at (-4.5,2.5) {(a)}; \node (b) at (-1.35,2.5) {(b)}; \node (c) at (1.85,2.5) {(c)}; \end{tikzpicture} \end{center} \caption{(a) Average cell speed for different values of initial scaffold volume fraction $\Phi_{SC}^0=0.01$ (solid black), $\Phi_{SC}^0=0.02$ (dashed black), and $\Phi_{SC}^0=0.05$ (dotted black). (b) Average cell speed for different values of $d_{cell}$ of 0.0005 cm (solid black), 0.00025 cm (dashed black), and 0.001 cm (dotted black) for $\Phi_{SC}^0=0.05$. (c) Average cell speed for different values of $p_{sens}=$ 0.6 (solid black), 0.45 (dashed black), and 0.75 (dotted black) for $\Phi_{SC}^0=0.05$. The magenta lines in (a)-(c) correspond to the average speed over 30 days for the corresponding black linestyles. The remaining parameters for each case are reported in Table~\ref{tab:par}.} \label{fig:speed} \end{figure} In our simulations, we fix the maximum distance that a cell may move at a given time iteration to $d_{cell}$. If the rules allow for a cell to move, its velocity is then $v_c=d_{cell}/\triangle t=0.1\times 10^{-3}$cm per hour. However, not all cells move at each time step, so we can determine the emergent mean cell speeds, which we report in Fig.~\ref{fig:speed}(a). For all three initial scaffold solid volume fractions, there is a decrease in the emergent cell speed for the first 7 days. Around day 8, the $\Phi_{SC}^0=0.05$ case first starts to increase due to a decrease in quiescent cells where the 0.02 case follows around day 14 and the 0.01 case at day 18. The mean emergent cell speed over the course of the 30 day simulation is also shown (horizontal lines) for each of the different scaffold cases in Fig.~\ref{fig:speed}(a); we observe that the there is a monotonic trend of increasing mean cell speeds as initial scaffold solid volume fractions increases. \cite{Morales07} reviewed many experiments that studied chondrocyte movement under different experimental conditions. In general, there were two classes of cells, motile and nonmotile. The motile cells were reported as moving 5-10 $\mu$m per hour on average, with a maximum observation of 50 $\mu$m per hour. These cell speeds were recorded for movement on planar substrates, but fully three-dimensional movement in a scaffold could differ considerably. In addition, these experiments were carried out over shorter time periods whereas our simulation is for 30 days. Our emergent cell speeds are on the range of 6-7.5 $\mu$m per hour (0.6-0.75$\times 10^{-3}$cm per hour), so this is on the right order of magnitude. In Fig.~\ref{fig:speed}(b), we explore varying the maximum distance $d_{cell}$ that a cell can move for $\Phi_{SC}^0=0.05$. Here, a larger maximum distance a cell can move corresponds to a larger mean cell speed on the range of 0.1-1$\times 10^{-3}$cm per hour, which is similar to previous results of a cellular automaton model where porosity was not accounted for \citep{Chung10}. For the baseline distance $d_{cell}$ we explore varying sensitivity to porosity $p_{sens}$ in Fig.~\ref{fig:speed}(c), again for the case of $\Phi_{SC}^0=0.05$. With a higher sensitivity to porosity ($p_{sens}=0.75$), cells move faster since there are more moving cells and less cells in the quiescent state. As aggregates of cells are forming, cell speed decreases and reaches the same value as the baseline porosity sensitivity, $p_{sens}=0.6$. Since the lower sensitivity to porosity ($p_{sens}=0.45$) allows cells to move less optimally, this causes an increased number of cells in the quiescent state, and results in an emergent cell speed that is approximately half that of the other cases. Again, we note that all of these cell speeds are in the experimentally observed range. \section{Conclusion} In this model, we have developed a framework to capture individual cellular interactions within a porous scaffold where cellular solid volume fraction is captured. Cell movement and proliferation is biased based on the continuously defined nutrient and porosity. Through a phenomonological model of ECM synthesis and scaffold degradation, we are able to account for these evolving solid volume fractions to update the local porosity. The model is parameterized and matched to experimental trends of total cell counts in cell-seeded scaffolds \citep{Freed94}. We are able to illustrate complex dynamics of cells in different states (moving, dying, proliferating, and quiescent) in both the total construct and in particular regions of the domain. Due to the fixed and high nutrient concentration at boundaries exposed to the nutrient bath, we observe aggregates of cells in these regions at later time points, which we characterize and match with reported aggregates in experiments \citep{Vunjak98}. In addition, we observe emergent cell speeds in the range reported for chondrocytes \citep{Morales07}. In this study, we have explored in detail, the emergent behavior of cells and total cells in the construct as the initial scaffold volume fraction, sensitivity to porosity, movement distance, and cell maturity time is varied. Model results show that cells with a higher sensitivity to porosity are able to move in a more optimal manner, decreasing cellular collisions and being able to proliferate more often, on average. As the cellular maturity time is decreased, this leads to a significant increase in cells in the construct. Each of these results can have a significant impact on understanding whether a growth factor or additional nutrients need to be supplied to the system, as well as determining the optimal scaffold volume fraction for a particular cell type. In \cite{Erickson09}, experiments were completed where mesenchymal stem cells were seeded in either agarose or methacrylated hyaluronic acid (MeHA) scaffolds. The DNA per construct (measure of cell count in the construct) was measured as an average of 4 samples at day 1, 21, and 42. In this data, similar cell counts are observed at day 1 whereas the 1\% case had less DNA (and hence cells) at day 21 and 42 in comparison to the 2 and 5\% cases. Our simulations are consistent with this trend of the 1\% MeHA case ($\Phi_{SC}^0=0.01$) having less cells than the 5\% case ($\Phi_{SC}^0=0.05$) throughout the 30 day simulation. In comparison to the experiments of \cite{Erickson09}, we also observe a large amount of growth from day 1 to 21 but in contrast, we do not observe significant growth in days 21 to 30. We are not able to capture the larger difference between the 1 and 2\% cases, but this might be due to the use of different cell and scaffold type (stem cells and MeHA or agarose) in comparison to what we have parameterized our model to (chondrocytes and PGA) from the data of \cite{Freed94}. With additional data of how different cell types move in different three-dimensional scaffolds, we will be able to parameterize this model to make predictions for different experiments. In this model, there were several assumptions made that need to be considered when interpreting these results. We have accounted for ECM accumulation and scaffold degradation as being constant throughout the domain at each time point. However, from experiments of \cite{Erickson09}, there is evidence that matrix constituents are localized around cells, especially in the case of scaffolds with higher initial solid volume fraction. Additionally, since an outcome of interest is the mechanical properties of the tissue engineered construct, we would want to have a better representation of ECM accumulation, since this is been found to correlate with compressive moduli \citep{Bandeiras15,Cigan16}. The process of ECM formation, deposition, and transport has been previously analyzed by several continuum models \citep{Dimicco03,Nikolaev10,Obradovic00,Saha04,Sengers04} using a system of differential equations, but this presents challenges to couple to the cellular automaton approach where we are modeling individual cells. In the future, it will be interesting to extend the work of \cite{Trewenack09}, which captured the distribution of ECM and scaffold around a single chondrocyte, to a discrete framework. The nutrient bath surrounding the construct was assumed to be well mixed, but we did not account for the effect of nutrient profusion on cell growth as in previous models \citep{Chung07,Hossain15,Nava13,Sacco11}. The nutrient concentration profile detailed in Appendix B is also independent of cell location. We account for increased cells in an ad hoc manner where exterior boundaries exposed to the fluid bath have a high nutrient concentration and the inner part of the construct has a decreasing concentration in time. Qualitatively, this provides enough input into the system to bias cell movement towards the edges of the construct. A more exact nutrient profile could be obtained by coupling a partial differential equation for the nutrient profile to the exact cell locations as in \cite{Chung10}. However, since we account for the evolving porosity, we would also need to include a diffusion constant that varies with porosities in extensions of this model. These model limitations will be the focus of future studies where we will also couple variable movement based on porosity, extend cell based rules to change behavior of individual cells in aggregates, and investigate cellular dynamics when nutrient channels or pores are included to deliver nutrients as in \cite{Chung10} and \cite{Cigan16}. \medskip \noindent{\bf Acknowledgements:} We would like to acknowledge Mansoor Haider for useful discussions.\\ \textbf{Funding:} This study was not funded. \\ \textbf{Conflict of Interest:} The authors declare that they have no conflict of interest. \section*{Appendix A: Numerical details}\label{app:numerics} In the following section we provide additional details on some of the modeling choices made in this paper and for some of the parameters reported in Table~\ref{tab:par}. The value of the cellular volume fraction at a node $\hat{\Phi}=0.3$ is determined based on a cell packing problem. Experiments have shown that chondrocytes are spherical in shape and may alter their shape based on the environment \citep{Hauselman92,Kino05}. We consider the cell as a sphere of diameter $c_d$ cm immersed in the thin three-dimensional domain with thickness $z=2c_d$ cm depicted in Fig~\ref{fig:sc}(b). The volume of the cell is $$V_c=\dfrac{4}{3}\pi \left(\dfrac{c_d}{2}\right)^3=\dfrac{c_d^3}{6}\pi \text{ cm}^3$$ and the cell is completely confined in a rectangular prism with dimensions ${c_d\times c_d\times 2c_d}$ and volume $V_r=2c_d^3$ cm$^3$. The ratio $$\dfrac{V_c}{V_r}=\dfrac{\pi}{12}\simeq 0.26$$ determines the volume fraction of the prism occupied by the sphere. Assuming the packing is not optimal, because of deformation limits of the cells, the value of $\hat{\Phi}$ is rounded up to $0.3$. The value is applied to every grid point covered by the cell surface represented by the gray shaded area in Fig.~\ref{fig:cell-nbhd}. Consequently, the value of the sensitivity to porosity is chosen as $p_{sens}=2\hat{\Phi}=0.6$ so that a cell will not move or divide in a region that could not accommodate two full cells. This choice is made to provide some extra room for cells in case of a simultaneous movement of two nearby cells into the same region or cell division happening on the same target neighborhood. This is also done to have a maximum number of cells that could fit on the whole domain, which is comparible with biological experiments. The outer diameter of the annulus $a_{d,mov}$ represents how far the chondrocyte cell is able to detect gradients in nutrient concentration and porosity, and it is chosen in this work to be six times the baseline cell movement ($6d_{cell}=3c_d$) in one iteration. The outer diameter of the annulus $a_{d,div}$ is chosen equal to $3.5c_d$ since a gap of one grid point between the mother cell and the new cell is needed to avoid overlaps during cell division. \section*{Appendix B: Nutrient profiles}\label{app:nutrient} Here we detail the explicit formulation for the nutrient profiles used in the numerical simulations. The profiles are chosen to qualitatively agree with the ones reported in~\cite{Chung10} and~\cite{Bandeiras15}. In this work the nutrient profiles are updated at day 0, 7, 10, and 15 on the simulation domain ${\Omega=[0,0.5]\times[0,0.1]}$, with the points (0,0) and (0.5,0.1) corresponding to the top left and bottom right corners of the domain, respectively. At day 0 the scaffold is well perfused, due to the high porosity, and the nutrient concentration is assumed uniform for several days where \begin{equation*} c_0(x,y,\hat{t}) = 1, \end{equation*} for $(x,y)\in\Omega$ and for $\hat{t}\in[0,7)$ where $\hat{t}$ corresponds to days. At day 7, the concentration in the inner portion of the domain starts to decrease due to cellular consumption of nutrients and the profile is updated as follows \begin{equation*} c_7(x,y,\hat{t}) = \left\{ \begin{array}{ll} 0.75, \qquad & \left(\frac{x-0.3}{0.06}\right)^2 + \left(\frac{y}{0.012}\right)^2\leq 1, \\ \\ 0.83, & \left(\frac{x-0.3}{0.06}\right)^2 + \left(\frac{y}{0.012}\right)^2>1, \text{ and } \left(\frac{x}{0.47}\right)^2 + \left(\frac{y}{0.064}\right)^2<1,\\ \\ 1, & \left(\frac{x}{0.47}\right)^2 + \left(\frac{y}{0.064}\right)^2\geq 1. \end{array} \right. \end{equation*} for $(x,y)\in\Omega$ and $\hat{t}\in[7,10)$. At day 10, the concentration in the inner domain keeps decreasing due to increased cellular consumption of nutrients and decreases in porosity on the outer part of the construct (the bottom and right hand sides). The nutrient concentration profile is updated using the following equation \begin{equation*} c_{10}(x,y,\hat{t}) = \left\{ \begin{array}{ll} 0.1, & \left(\frac{x-0.29}{0.14}\right)^2 + \left(\frac{y}{0.065}\right)^2\leq 1, \\ \\ 0.2, & \left(\frac{x-0.29}{0.14}\right)^2 + \left(\frac{y}{0.065}\right)^2>1, \text{ and } \left(\frac{x-0.1}{0.35}\right)^4 + \left(\frac{y+0.02}{0.095}\right)^4\geq 1,\\ \\ \max\left\{ \min\left[ g_1(x,y) ,1\right],0.2\right\}, \quad & \left(\frac{x-0.1}{0.35}\right)^4 + \left(\frac{y+0.02}{0.095}\right)^4>1, \end{array} \right. \end{equation*} for $(x,y)\in\Omega$ and $\hat{t}\in[10,15)$ days. The rescaled gradient function $g_1$ is obtained as follows $$ g_1(x,y)= 0.8 \, \dfrac{\left(\frac{x-0.15}{0.35}\right)^4 + \left(\frac{y}{0.095}\right)^4 - 0.54}{1-0.54} + 0.2. $$ The decreased nutrient concentration in the upper left portion of the domain $\Omega$ is more pronounced at day 15 due to the dense layer of cells near the right and bottom boundary reducing nutrient diffusion to the center of the construct. Hence, the region with low nutrient in the inner portion of the domain increases and the region with a nutrient gradient (function $g_2$) gets thinner. The nutrient concentration is updated using the following equation \begin{equation*} c_{15}(x,y,\hat{t}) = \left\{ \begin{array}{ll} 0.1, & \left(\frac{x+0.05}{0.0.5}\right)^5 + \left(\frac{y+0.01}{0.1}\right)^5\leq 1, \\ \\ \max\left\{ \min\left[ g_2(x,y) ,1\right],0.1\right\}, \quad & \left(\frac{x+0.05}{0.0.5}\right)^5 + \left(\frac{y+0.01}{0.1}\right)^5 >1, \end{array} \right. \end{equation*} for $(x,y)\in\Omega$ and $\hat{t}\in[15,30)$ where the rescaled gradient function $g_2$ is obtained as follows $$ g_2(x,y)= 0.9 \, \dfrac{\left(\frac{x}{0.5}\right)^5 + \left(\frac{y}{0.1}\right)^{5} - 0.59}{1-0.59} + 0.1. $$ \begin{figure}[b!] \begin{center} \includegraphics[width=0.9\textwidth]{A-score} \end{center} \caption{A-score $A_{1,j}$ for comparison of set 1 with set $j=1,\ldots,20$ on the variable {\it final number of cells} in simulations with $\Phi_{SC}^0=0.01$ and parameters from Table~\ref{tab:par}.} \label{fig:ascore} \end{figure} \section*{Appendix C: Aleatory uncertainty analysis}\label{app:aleatory} The model contains several stochastic elements that introduce aleatory uncertainty in each single simulation. It is therefore necessary to perform an uncertainty quantification procedure to determine the minimum number of simulations to account for the full variation of the system~\citep{Alden13,Cosgrove15,Read12}. First, 20 sets of $k$ simulations each with the same parameters are gathered. Then, sets 2-20 are compared with set 1 using the A-Test developed by~\cite{Vargha00}. The A-Test returns an A-score for each comparison which represents the probability that a randomly selected sample from the first population is larger than a random sample from the second population. The A-score for the comparison between set $a$ and $b$, $A_{a,b}$ is computed following the approximation proposed in~\cite{Vargha00} as: \begin{equation*} A_{a,b}=\dfrac{\#(X_i>Y_j)}{k_a k_b} \, + \, 0.5\, \dfrac{\#(X_i=Y_j)}{k_a k_b}, \qquad i=1,\ldots,k_a; \, j=1,\ldots,k_b \label{eq:ascore} \end{equation*} where $\#(X_i>Y_j)$ counts the number of times the event $(X_i>Y_j)$ happens for all the $X_i$ in set $a$ and $Y_j$ in set $b$ and similarly $\#(X_i=Y_j)$ counts the number of times the event $(X_i=Y_j)$ happens, and $k_a$ and $k_b$ are the dimension of set $a$ and $b$, respectively. The A-score is used to determine statistical significance as follows: a score below 0.29 or above 0.71 indicates a large effect of sample size $k$ on the model results; a score of 0.36 or 0.64 indicates a medium effect of $k$ on model results; a score within 0.44 and 0.56 indicates a small effect of $k$ on model results, and a score of 0.5 indicates no effect of $k$ on model results. Fig.~\ref{fig:ascore} shows the results obtained for sample size $k=300$ considering the final number of cells as the variable of interest, for simulations with the baseline parameters in Table \ref{tab:par} with $\Phi_{SC}^0=0.01$. 20 groups with $k=$300 distinct simulations are obtained and then the A-score $A_{1,j}$ is computed for $j=1,\ldots,20$ and reported in Fig.~\ref{fig:ascore}. The results obtained, with all of the A-scores within the $[0.44,0.56]$ interval, show that a value of 300 simulations is sufficient to mitigate the uncertainty introduced by the stochasticity of the model. The correct application of the A-Test is validated by the first point in Fig.~\ref{fig:ascore}, where the comparison of sample 1 with itself results in an A-score $A_{1,1}=0.5$ as expected from the literature.
\section{Introduction} Entanglement has been traditionally considered to be a fragile quantum phenomenon which only happens in the microscopic world. As the state of the art improves, it has become increasingly realizable in the macroscopic world, and thereby accessible to future quantum technologies. One of the first demonstrations of entanglement between remote macroscopic objects was achieved between atomic ensembles containing $10^{12}$ atoms, eventually realizing quantum teleportation \cite{julsgaard2001,krauter2011,krauter2013}. The weak nonlinearity and quantum correlations between fields of light have also been investigated to generate macroscopic entanglement\cite{jeong2005,paternostro2007}. Such entanglement has been considered for being used in various quantum technologies such as metrology and quantum computing \cite{pezze2016,byrnes12,byrnes15}. In terms of long distance entanglement, the current records for entanglement are using space-based distribution methods, between photons \cite{yin2017,ren2017ground}. Entanglement in the mesoscopic regime has been experimentally realized by superconductors, which is now considered to be one of the leading candidates for quantum computing \cite{nelson1988,lesovik2001,berkley2003,dicarlo2010}. Micromechanical resonators also exhibit entanglment in the mesoscopic regime, where micrometer-size structures display quantum mechanical behavior \cite{armour2002,genes2008,palomaki2013entangling,groblacher2009observation}. For Bose-Einstein condensates (BECs), most studies until recently have been focused on creating entanglement within a single atomic cloud. Spin squeezing, as a means to reduce quantum noise and improve measurement precision beyond the standard quantum limit \cite{wineland1994,appel2009}, can be also applied for the generation of entanglement in BECs \cite{sorensen2001many,riedel2010,gross2012,toth2009}. The creation of many-particle entanglement in one BEC ensemble has been investigated thoroughly \cite{gross2010,gross2012,sorensen2001many,sorensen2001,strobel2014}, which is localized in a single spatial location. However, it is now considered that entanglement can be furthermore subdivided into various categories, including steerable and non-local entanglement \cite{adesso2016measures}. These categories are in order of increasing quantum correlation, such that non-local entanglement implies both steerability and entanglement, but it is possible to have entangled states that are neither steerable or non-local. Bell correlations within a single BEC have been observed, showing that the strength of the quantum correlations are of the strongest variety \cite{schmied2016bell}. Recently, several experiments showing entanglement between spatially separated parts of a single BEC were reported \cite{fadel2017,kunkel2017,lange2017}. To date, there has not been an experimental realization of entanglement between two completely spatially distinct BECs. Several theoretical studies have analyzed the entanglement created by a $ S^z S^z $ type interaction, pointing to a complex entanglement structure with fractal characteristics \cite{byrnes13,kurkjian2013spin}. Numerous proposal have been made for generating such entanglement, based on cold atomic collisions \cite{PhysRevA.74.022312}, atom-light interactions \cite{pyrkov2013,olov,ilo2014theory,rosseau2014,hussain2014}, and Rydberg excitations \cite{idlas2016}. Several proposals for quantum information applications have been made based on such entanglement \cite{byrnes14,ilo2014theory,pyrkov2014quantum}. \begin{figure}[t] \includegraphics[width=\columnwidth]{conceptual} \caption{\label{conceptual} Schematic procedure for realizing split spin-squeezed Bose-Einstein condensates (BECs). (a) An initial spin coherent state in a single trap is spin-squeezed, producing correlations (dashed lines) between the bosons. (b) The bosons are then spatially separated into two ensembles via a beam splitter interaction. The atoms in the cloud remain correlated, both within and between the two ensembles. } \end{figure} In this paper, we analyze another approach for creating entanglement between spatially distinct BECs. The situation that we consider is shown in Fig. \ref{conceptual}. First a maximally $S^x$-polarized spin coherent state is squeezed by one-axis twisting, and then it is spatially split into two ensembles. The splitting procedure does not alter the internal state of the atoms, which stay entangled even if they become separated by physical distance. In this work we study the quantum correlations between the two BECs obtained from this protocol, and discuss methods for detecting entanglement using correlations of observables. Recently, Oudot, Sangouard, and co-workers examined entanglement witnesses for such entangled BECs in the presence of local white noise \cite{oudot2017}. Our physical model differs from this work as we consider the spatial separations to be large enough such that the quantum number fluctuations between split BECs collapses to a fixed number. This is reasonable from the perspective that quantum tunneling should be highly suppressed for large splitting separations. We also analyze the non-classicality and non-Gaussianity of the quantum states that are generated in this system by reconstructing the Wigner functions for the states at various squeezing times. This helps to visualize the nature of the states to a better degree. Furthermore, we compare several correlations based methods for detecting entanglement, and find that the Giovannetti {\it et al.} \cite{Giovannetti} and covariance matrix \cite{vinay2017} methods provide a powerful and efficient method for achieving this. We also show that our system allows for correlations stronger than entanglement as detected by a Einstein-Podolsky-Rosen (EPR) steering criterion. This paper is structured as follows: In Sec. \ref{ii}, we give a detailed derivation how the process of squeezing and splitting is equivalent to an entangling interaction between two clouds. In Sec. \ref{iii}, we discuss the basic properties of the split spin-squeezed BEC, including the degree of entanglement and its non-Gaussian characteristics represented by the Wigner function. In Sec. \ref{iv} we consider how to detect the entanglement in practice by using several different approaches: the widely used Duan-Giedke-Cirac-Zoller criterion \cite{duan} which is based on the variance of a pair of EPR-type operators, the covariance matrix formalism \cite{simon,guhne,vinay2017}, and the crtierion of Giovannetti {\it et al.} \cite{Giovannetti}. We also show that EPR steering can be observed in the same system in Sec. \ref{sec:steering}. The conclusions are given in Sec. \ref{v}. \section{Split spin-squeezed Bose-Einstein condensates} \label{ii} \subsection{The Model} We now construct a model for the splitting of a spin-squeezed BEC illustrated in Fig. \ref{conceptual}. Our model has general similarities to that considered in Ref. \cite{oudot2017}, but with differing treatments of the splitting procedure. The basic assumptions are that each trap in Fig. \ref{conceptual} can be approximated by two bosonic modes. Thus before the BEC is split, there are two bosonic modes, consisting of the spatial ground state for the two populated hyperfine states. After the BEC is split, there are four modes, corresponding to two from each trap. Further details of this treatment can be found in Refs. \cite{gross2010,byrnes15,byrnes12}. First let us introduce some notation. We denote a general spin coherent state as \begin{align} |\alpha ,\beta \rangle\rangle =\frac{1}{\sqrt{N!}}(\alpha a^{\dagger}+\beta b^{\dagger})^N |0\rangle, \end{align} where $a^{\dagger}$, $b^{\dagger}$ are bosonic creation operators of the two hyperfine spin states respectively, and $\alpha$, $\beta$ are arbitrary complex coefficients satisfying $|\alpha|^2 + |\beta|^2 = 1$. The Schwinger boson (total spin) operators are defined as \begin{align} S^x &=a^{\dagger}b+b^{\dagger}a, \nonumber\\ S^y &=-ia^{\dagger}b+ib^{\dagger}a, \nonumber\\ S^z &=a^{\dagger}a-b^{\dagger}b, \end{align} which obey the commutation relations $[S^l, S^m]=2i\epsilon_{lmn}S^n$, where $\epsilon_{lmn}$ is the Levi-Civita symbol. Initially the BEC is prepared in a spin coherent state, where all $N$ atoms occupy the same spin state $ a $. A $ \pi/2 $ pulse is then applied on the Bloch sphere, such that the state \begin{align} | \frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}} \rangle\rangle = e^{-i S^y \pi/4 } | 1,0 \rangle\rangle \;, \end{align} which is maximally $S^x$-polarized, is prepared. This is then squeezed using the one-axis twisting evolution, corresponding to \begin{align} e^{i(S^z)^2t}| \frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}} \rangle\rangle = \frac{1}{\sqrt{2^N}} \sum_{k=0}^N \sqrt{N \choose k} e^{i(2k-N)^2 t } | k \rangle \end{align} where \begin{align} | k \rangle = \frac{(a^{\dagger}) ^{k} (b^{\dagger})^{N-k}}{\sqrt{k ! (N-k) !}} |0\rangle \end{align} are the Fock states. Here $ t $ is a dimensionless time of application of the squeezing operation. The atoms are then spatially separated into two parts. This is described by a beam splitter operation \begin{align} a=\frac{1}{\sqrt{2}}(a_L+a_R) \nonumber\\ b=\frac{1}{\sqrt{2}}(b_L+b_R) \label{bs} \end{align} where $ a_{L,R} $ and $ b_{L,R} $ are the left and right well modes for the two hyperfine states respectively. We then obtain the state \begin{align} |\Psi (t) \rangle = \frac{1}{2^N} & \sum_{N_L=0}^{N} \sum_{k_L=0}^{N_L} \sum_{k_R=0}^{N - N_L} \sqrt{ \left( \begin{array}{c} N \\ N_L \end{array} \right) \left( \begin{array}{c} N_L \\ k_L \end{array} \right) \left( \begin{array}{c} N - N_L \\ k_L \end{array} \right)} \nonumber\\ & \times e^{i(2 k_R + 2 k_L -N)^2 t} |k_L\rangle_{N_L} |k_R\rangle_{N - N_L} , \label{final} \end{align} where $N_L$ is the number of atoms in left ensemble. Here, the eigenstates of $S^z_i$ are \begin{align} |k_i\rangle_{N_i} = \frac{(a_i^{\dagger}) ^{k_i} (b_i^{\dagger})^{N_i-k_i}}{\sqrt{k_i ! (N_i-k_i) !}} |0\rangle \label{kstatesdef} \end{align} where the subscripts take the values $i \in \{L,R \}$ and $N_i $ labels the number of atoms in the BEC. The wavefunction (\ref{final}) has a sum over $ N_L $, the number of particles in the left well. This means that the particle number per well is not fixed, and exist in a superposition across both wells. However, for completely spatially separated BECs, it may be challenging to realize atoms delocalized over large distances. For example, there might be some inadvertent leakage of the particle number information which will collapse the superposition to a particular $ N_L $ and $ N_R $ on the left and right wells respectively. At the very least, there will always be a collapse during the measurement process, which will simultaneously measure particle number as well as spin. We thus assume that there is additionally some decoherence which can be taken into account by a projection (number fixing measurement) onto a left-well particle number $ N_L $ performed by the operator \begin{align} P_{N_L}= \left( \sum_{k_L=0}^{N_L} | k_L \rangle_{N_L} \langle k_L |_{N_L} \right) \left( \sum_{k_R=0}^{N_R} | k_R \rangle_{N_R} \langle k_R |_{N_R} \right) , \end{align} where the number of atoms in the right well is \begin{align} N_R = N - N_L . \end{align} Here the terms in the brackets give the identity operation in a fixed subspace of particle number for the left and right wells. After being projected, the normalized state can be expressed as \begin{align} |\Psi^{N_L} (t) \rangle &= \frac{P_{N_L} | \Psi (t) \rangle }{\sqrt{p(N_L)}} \nonumber \\ & = \frac{1}{\sqrt{2^N}} \sum_{k_L=0}^{N_L} \sum_{k_R=0}^{N_R} \sqrt{ \left( \begin{array}{c} N_L \\ k_L \end{array} \right) \left( \begin{array}{c} N_R \\ k_R \end{array} \right)} \nonumber\\ & \times e^{i(2 k_R + 2 k_L -N)^2 t} |k_L\rangle_{N_L} |k_R\rangle_{N_R} \label{measuredstate} \end{align} where the probability of obtaining the state with $ N_L $ atoms in the left well is given by \begin{align} p(N_L) & = \langle \Psi (t) | P_{N_L}^2 | \Psi (t) \rangle \nonumber \\ & = \frac{1}{2^N} \left( \begin{array}{c} N \\N_L \end{array} \right) . \label{leftwellprob} \end{align} It is illuminating to write (\ref{measuredstate}) in the form \begin{align} |\Psi^{N_L} (t) \rangle &=e^{i(S_L^z+S_R^z)^2t} | \frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}}\rangle\rangle_{N_L} | \frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}} \rangle\rangle_{N_R} \label{sub} \\ & = \frac{e^{i[ (S_L^z)^2 +(S_R^z)^2] t} }{\sqrt{2^{N_R}}} \sum_{k_R=0}^{N_R} \sqrt{N_R \choose k_R} \nonumber \\ & \times | \frac{e^{2i(2k_R-N_R)t}}{\sqrt{2}}, \frac{e^{-2i(2k_R-N_R)t}}{\sqrt{2}} \rangle \rangle_{N_L} | k_R \rangle_{N_R} . \label{illuminating} \end{align} which shows that the final state can be viewed to have a fixed particle number in each well acted on by the Hamiltonian \begin{align} H_{\text{eff}} =(S_L^z+S_R^z)^2 = (S_L^z)^2 + (S_R^z)^2 + 2 S_L^z S_R^z . \label{effectiveham} \end{align} This makes it clear that the split squeezing operation is equivalent to a combination of squeezing each of the split BECs individually, as well as applying the $ S_L^z S_R^z $ operation, which creates entanglement between the two BECs \cite{byrnes13,kurkjian2013spin}. The state (\ref{measuredstate}) corresponds to the conditional state for a particular collapse of the atom number, to $ N_L $ atoms in the left well. Experimentally, this would correspond to post-selecting the measurement outcome with $ N_L $ atoms in the left well. After many runs of the experiment, the state that is measured is a probabilistic mixture of various outcomes. The mixed state that is obtained is \begin{align} \rho & = \sum_{N_L=0}^N p(N_L) |\Psi^{N_L} (t) \rangle \langle \Psi^{N_L} (t) | \label{fixfinal} \end{align} We will examine both the conditional state (\ref{measuredstate}) and the average ensemble state (\ref{fixfinal}) to examine their properties in Sec. \ref{iii}. \subsection{Equivalence of split-squeezing with squeeze-splitting} \label{sec:equiv} In (\ref{illuminating}) we found that the procedure of splitting a squeezed BEC was equivalent to splitting a condensate and then applying a squeezing on the total spin of the system (\ref{effectiveham}). On first glance this is puzzling because the spin operators $ S_{L,R}^z $ do not commute with the splitting operation (\ref{bs}). To show that in fact the order of these operations do not matter, let us first define the splitting operators \begin{align} \Sigma_a^x & = a_L^\dagger a_R + a_R^\dagger a_L \nonumber \\ \Sigma_a^y & = -i a_L^\dagger a_R + i a_R^\dagger a_L \nonumber \\ \Sigma_b^x & = b_L^\dagger b_R + b_R^\dagger b_L \nonumber \\ \Sigma_b^y & = -i b_L^\dagger b_R + i b_R^\dagger b_L . \end{align} The operation of (\ref{bs}) then amounts to the transformation \begin{align} e^{i \Sigma_a^y \pi/4} a_R e^{-i \Sigma_a^y \pi/4} & = \frac{1}{\sqrt{2}} ( a_L + a_R) \nonumber \\ e^{i \Sigma_b^y \pi/4} b_R e^{-i \Sigma_b^y \pi/4} & = \frac{1}{\sqrt{2}} ( b_L + b_R) . \end{align} Thus in this formulation we identify the original modes as left-well operators $ a \equiv a_L $, $ b \equiv b_L $, and these are split by the beam-splitter operation. The state (\ref{measuredstate}) can be thus written equivalently as \begin{align} | \Psi^{N_L} (t) \rangle = \frac{P_{N_L} e^{i \Sigma_a^y \pi/4} e^{i \Sigma_b^y \pi/4} e^{i(S^z_R)^2 t}| \frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}} \rangle\rangle_R}{\sqrt{p(N_L)}} , \label{rewrittenpsi} \end{align} where the initial state state is written in terms of the left-well operators $ a_L, b_L $. The question here is whether the squeezing operation can be put after the splitting operation. Simply inverting the $ S^z_R $ and $ \Sigma_{a,b}^y $ operations is clearly not allowed since they do not commute: \begin{align} [S^z_R, \Sigma^y_a] & = i \Sigma^x_a \nonumber \\ [S^z_R, \Sigma^y_b] & = -i \Sigma^x_b . \end{align} The key point to notice is that since \begin{align} [S^z_L, \Sigma^y_a] & = -i \Sigma^x_a \nonumber \\ [S^z_L, \Sigma^y_b] & = i \Sigma^x_b , \end{align} the combination of $ S^z_L + S^z_R $ does commute with the splitting operators \begin{align} [ S^z_L + S^z_R, \Sigma^y_a] = [ S^z_L + S^z_R, \Sigma^y_b] =0 . \label{commutingtotalspin} \end{align} Using this we can directly show the desired relation. Since there are no right-well operators in the state (\ref{rewrittenpsi}), we can introduce a additional factor of $ e^{i[ (S^z_L)^2 + 2 S^z_L S^z_R ]t} $ just before the state, giving \begin{align} | \Psi^{N_L}\rangle =\frac{ P_{N_L} e^{i \Sigma_a^y \pi/4} e^{i \Sigma_b^y \pi/4} e^{i(S^z_L+ S^z_R)^2 t}| \frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}} \rangle\rangle_R}{\sqrt{p(N_L)}} , \label{rewrittenpsi2} \end{align} Now using (\ref{commutingtotalspin}), we can commute the squeezing operation to the end, giving \begin{align} | \Psi^{N_L} \rangle = \frac{e^{i(S^z_L+ S^z_R)^2 t} P_{N_L} e^{i \Sigma_a^y \pi/4} e^{i \Sigma_b^y \pi/4} | \frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}} \rangle\rangle_R}{\sqrt{p(N_L)}} , \label{rewrittenpsi3} \end{align} where we used the fact that \begin{align} [ P_{N_L}, S^z_L] =[ P_{N_L}, S^z_R] = 0 \end{align} to commute the squeezing operation to the end. This shows the desired relation. \section{Basic properties of the state} \label{iii} We now examine the basic properties of the conditional state (\ref{measuredstate}) and the averaged state (\ref{fixfinal}). These can be efficiently characterized by entanglement between the left and right wells, and the Wigner functions representing the states. These are examined in the following sections. \subsection{Entanglement} \begin{figure} \includegraphics[width=\columnwidth]{devil} \caption{Entanglement in split squeezed Bose-Einstein condensates, as quantified by the logarithmic negativity. Solid line corresponds to the state (\ref{fixfinal}), the dashed line and dotted lines represent the conditional state (\ref{sub}) with $N_L=5$ and $N_L=3$ respectively. The total number of atoms is $N=10$. \label{devil} } \end{figure} As a measure of the entanglement between the left and right wells, we use the logarithmic negativity\cite{vidal2002,plenio2005} defined as \begin{align} E (\rho) = \log_2 || \rho^{T_L}|| \end{align} where $\rho^{T_L}$ is the partial transpose of (\ref{fixfinal}) with respect to left well and $||X|| = \text{Tr} |X| = \text{Tr} \sqrt{X^{\dagger}X}$ is the trace norm of an operator $X$. For two BECs each with two components with particle numbers $ N_L $ and $ N_R $, a maximally entangled state is \begin{align} |\Psi_{\text{max}} \rangle = \sum_{k = 0 }^{\min(N_L, N_R)} | k \rangle_{N_L} | k \rangle_{N_R} . \label{maxentangled} \end{align} This has an logarithmic negativity of \begin{align} E (|\Psi_{\text{max}} \rangle \langle \Psi_{\text{max}} |) = \log_2 [ \min( N_L,N_R) +1 ] . \label{maxent} \end{align} We note that (\ref{maxentangled}) is only one out of $(N+1)^2 $ maximally entangled states. For example, there are 4 orthogonal Bell states in the case of two qubits which are all maximally entangled. The remaining states can be generated by local unitary transformations. Figure \ref{devil} shows the entanglement as a function of the dimensionless squeezing time for both the conditional state (\ref{measuredstate}) and the averaged state (\ref{fixfinal}). The first thing that is evident is that all the curves have a similar form to the ``devil's crevasse'' entanglement as seen for a $ S^z_L S^z_R $ interaction \cite{byrnes13,kurkjian2013spin}. The entanglement increases monotonically until the characteristic time $t=1/2\sqrt{N}$, with a overall periodicity of $T = \pi/4$ and dips occurring at time that are a fractional multiple of the this time, in agreement to a pure $ S^z_L S^z_R $ interaction. This is the expected behavior considering that the final interaction can be written in the form (\ref{sub}) which is a combination of this interaction and local squeezing on each well. Since entanglement is invariant under local transformations, the effect of the local squeezing is not visible in the curves shown in Fig. \ref{devil}. The dominant effect of the different partitions of the particle number between the wells is to change the amplitude of the entanglement. This can be understood from the relation (\ref{maxent}) which shows that the amount of entanglement is related to the dimensionality of the minimum of the particle number between the left and right well. The curves in Fig. \ref{devil} never reach the maximal value of entanglement ($\log_2(N/2+1)\approx 2.6$ here), as the type of entangled states that are generated from a $ S^z_L S^z_R $ interaction do not given the maximum value (\ref{maxent}) \cite{byrnes13}. As expected, the amplitude of the entanglement for the case $ N_L = N_R = 5 $ is the largest with respect to all other $N$ partitions, and is symmetric around this midpoint. The entanglement is well-preserved despite the mixing between all possible partition of $N$ in the state (\ref{fixfinal}). This agrees with the general arguments of Sec. \ref{sec:equiv}, where the entangling operation commutes with the splitting and localization operations. \subsection{Wigner functions} The results of the previous section show that the split squeezed states are entangled, but do not clearly show the nature of the states, including what kind of quantum correlations are present between the two BECs. To visualize the state it is beneficial to calculate the Wigner functions \cite{wigner,dowling94,schmied2011}, defined for a two mode BEC. The Wigner function gives a representation of the quantum state as a quasiprobability distribution on the Bloch sphere. The Wigner function is defined as \begin{align} W(\theta, \varphi) = \sum_{k=0}^{2j} \sum_{q=-k}^{k} \rho_{kq} Y_{kq} (\theta, \varphi) \label{wigner} \end{align} where $ Y_{kq} (\theta, \varphi)$ are the spherical harmonics. Here, $\rho_{kq}$ is defined as \begin{align} \rho_{kq}= \sum_{m=-j}^{j} \sum_{m'=-j}^{j} & (-1)^{j-m} \sqrt{2k+1} \left( \begin{array}{ccc} j & k & j \\ -m & q & m' \end{array} \right) \nonumber \\ & \times \langle jm |\rho | jm' \rangle \end{align} where $\left( \begin{array}{ccc} j & k & j \\ -m & q & m' \end{array} \right)$ is the Wigner $3j$ symbol. In the above, we have used notation conventional to the Dicke representation in terms of angular momentum eigenstates. This can be related to our previous notation according to the correspondence \begin{align} | j m \rangle = | k =j+m \rangle_{N = 2j} , \end{align} where the left hand side are the Dicke state and the right hand side is defined according to (\ref{kstatesdef}). The above representation allows us to represent any state of a two component BEC with fixed particle number as a Wigner distribution. In our case, we have two BECs, each with two components. This would result in general as a higher dimensional Wigner distribution which is difficult to visualize. For this reason we consider the marginal and conditional Wigner function respectively \cite{olov}. For the marginal Wigner function, the density matrix for one of the BECs is traced over, and the Wigner function is computed from the remaining density matrix. For the conditional Wigner function, a projection onto a specific Fock state $|k \rangle$ is made on one of the BECs, and normalized accordingly. In either case, the resulting Wigner functions only have two variables which can be visualized in a two-dimensional phase space corresponding to the Bloch sphere. A rough intuition for the difference between the two types distribution is that the marginal Wigner function gives an average state of one of the BECs disregarding the state of the other BEC. The conditional Wigner function gives the correlations that are present given a particular measurement $|k \rangle$ (i.e. post-selection) on the other BEC. A similar argument was used to construct a visualization for the states in Ref. \cite{byrnes13}. \subsubsection{Marginal Wigner function} The reduced density matrix on the left well is \begin{align} \rho_L = \text{Tr}_R ( |\Psi^{N_L} (t) \rangle \langle \Psi^{N_L} (t) | ) \label{pt} , \end{align} Inserting this state into (\ref{wigner}), we obtain the marginal Wigner function \begin{align} & W (\theta, \varphi) = \frac{1}{2^N} \sum_{k=0}^{N_L} \sum_{q=-k}^{k} Y_{kq}(\theta, \varphi) \sum_{m_L, m_L^{'}=-N_L/2}^{N_L/2} \sqrt{2k+1} \nonumber\\ & \times \sqrt{\left( \begin{array}{c} N_L \\ N_L/2+m_L^{'} \end{array} \right) \left( \begin{array}{c} N_L \\ N_L/2+m_L \end{array} \right) } \left( \begin{array}{ccc} N_L/2 & k & N_L/2 \\ -m_L & q & m_L^{'} \end{array} \right)\nonumber\\ &\times e^{i4(m_L-m_L^{'})(m_L+m_L^{'}-N_R)t} (1+e^{i8(m_L-m_L^{'})t})^{N_R} (-1)^{j_L-m_L} \end{align} where the total spin on the left well was taken to be a fixed value $j_L=\frac{N_L}{2}$. \begin{figure}[t] \includegraphics[width=\columnwidth]{marginal} \caption{\label{marginal} Marginal Wigner function for the split spin-squeezed state at various interaction times. (a) $t=0$, (b) $t=1/N$, (c) $t=1/2\sqrt{N}$, (d) $t=\pi/8$. In all plots, the total number of atoms is $N=20$, and the numbers of atoms in each ensemble are $N_L=N_R=10$.} \end{figure} In Fig. \ref{marginal}, we see the behavior of marginal Wigner function for different times. Initially, at $t=0$, the state is a spin coherent state located at $\theta=\pi/2, \varphi=0$. At short evolution times $0< t \lesssim 1/2\sqrt{N}$, the distribution elongates in a diagonal direction reminiscent of a one-axis squeezing interaction $ (S^z)^2 $. The width along the squeezing direction is however broader than what would be obtained from a genuine one-axis twisting dynamics, due to the averaging obtained by tracing over the BEC in the right well. After the characteristic time $t\sim 1/2\sqrt{N}$, the state transforms into a non-Gaussian state, where the elongation starts to wrap around the whole Bloch sphere. At $t=\pi/8$, the state becomes a Bell state consisting of a Schrodinger cat state which is located at $\varphi=0$ and $\varphi=\pi$ respectively. At this point the state can be written \begin{align} & | \Psi^{N_L}(t=\pi/8)\rangle = \frac{e^{i\pi/4}}{\sqrt{2}} \Big( | \frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}} \rangle \rangle_L | \frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}} \rangle \rangle_R \nonumber \\ & - i (-1)^{(N_L+N_R)/2} | \frac{-1}{\sqrt{2}}, \frac{1}{\sqrt{2}} \rangle \rangle_L | \frac{-1}{\sqrt{2}}, \frac{1}{\sqrt{2}} \rangle \rangle_R \Big), \end{align} which is only valid for even $N_L, N_R$. Tracing out the BEC in the right well thus gives the state \begin{align} \rho_L(t=\pi/8)= & \frac{1}{2} \Big( | \frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}} \rangle \rangle_L \langle \langle \frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}} |_L \nonumber \\ & + | \frac{-1}{\sqrt{2}}, \frac{1}{\sqrt{2}} \rangle \rangle_L \langle \langle \frac{-1}{\sqrt{2}}, \frac{1}{\sqrt{2}} |_L \Big) , \end{align} which is a mixture of the states at opposite ends of the Bloch sphere, matching with the distribution in Fig. \ref{marginal}(d). \subsubsection{Conditional Wigner function} The conditional Wigner function is obtained by projecting the final state (\ref{measuredstate}) onto different $|k_R\rangle$ states, and is written \begin{align} P_{k_R} &|\Psi^{N_L} (t) \rangle = \frac{1}{\sqrt{2^{N_R}}} \sqrt{N_R \choose k_R} e^{i [(S_L^z)^2+(S_R^z)^2] t} \nonumber \\ & \times | \frac{e^{2i(2k_R-N_R)t}}{\sqrt{2}}, \frac{e^{-2i(2k_R-N_R)t}}{\sqrt{2}} \rangle \rangle_{N_L} | k_R \rangle_{N_R} \label{rhoj} \end{align} where $P_{k_R} = |k_{r}\rangle_{N-N_L} \langle k_{r}|_{N-N_L} $ is the projector onto Fock states of the right well and we used (\ref{illuminating}). Together with (\ref{rhoj}) and (\ref{wigner}), we thus obtain \begin{align} & W_{k_R} (\theta, \varphi) = \frac{1}{\mathscr{N}} \sum_{k=0}^{N_L} \sum_{q=-k}^{k} Y_{kq}(\theta, \varphi) \sum_{m_L, m_L^{'}=-N_L/2}^{N_L/2} \sqrt{2k+1} \nonumber \\ & \times \sqrt{ \left( \begin{array}{c} N_L \\ N_L/2+m_L \end{array} \right) \left( \begin{array}{c} N_L \\ N_L/2 +m_L^{'} \end{array} \right)} \left( \begin{array}{ccc} N_L/2 & k & N_L/2 \\ -m_L & q & m_L^{'} \end{array} \right) \nonumber \\ & \times \left( \begin{array}{c} N_R \\ k_R \end{array} \right) e^{i4(m_L-m_L^{'})(2k_R-N_R+m_L+m_L^{'})t} (-1)^{N_L/2-m_L} \end{align} where $\mathscr{N}$ is the normalization factor and again we took $j_L=\frac{N_L}{2}$. \begin{figure}[t] \includegraphics[width=\columnwidth]{joint_kr} \caption{\label{joint_kr} Conditional Wigner function for the split spin-squeezed state after being projected onto various $|k_R\rangle$ states at $t=1/N$ for (a) $k_R=3$ and (b) $k_R=7$. The $ k_R = 5 $ case is plotted in Fig. \ref{joint_time}(a). In all plots, the total number of atoms is $N=20$, and the numbers of atoms in each ensemble are $N_L=N_R=10$.} \end{figure} Figure \ref{joint_kr} and Fig. \ref{joint_time}(a) shows the conditional Wigner functions for various projected states $| k_R \rangle $ for the right well. We see that for all the projected values the Wigner functions take the form of one-axis squeezing $ (S^z)^2 $, with the characteristic diagonal distribution. Unlike the marginal Wigner function, the width of the distributions are narrowed, displaying genuine squeezing. This can be attributed to the $ (S_L^z)^2 $ term in (\ref{rhoj}) which produces the squeezing effect. For various projected values of $ k_R $, the distributions are offset by various positions around the Bloch sphere, as can be seen by the arguments of the spin coherent state in (\ref{rhoj}). This arises because of the $ S_L^z S_R^z $ interaction which produces an entangled state in the Fock states of the right well and rotated spin coherent states, as shown in (\ref{illuminating}). This is exactly the type of correlations that are expected with this type of interaction and have been discussed in detail in Ref. \cite{byrnes13}. Thus the integrated density corresponds to the probability of a particular measurement result $ k_R $ is obtained. The probability distribution is \begin{align} P(k_R)=\text{Tr} (\rho_{N_l} P_{k_R}) = \frac{1}{2^N} \left( \begin{array} {c} N_L \\k_R \end{array} \right) \left( \begin{array} {c} N_R \\k_R \end{array} \right) . \label{probabilitydistkp} \end{align} In Fig. \ref{joint_time}, we show the conditional Wigner distributions for the state (\ref{rhoj}) for various evolution times projected at $k_R=N_R/2$ with time evolution. The $k_R=N_R/2$ projection is chosen because it is the most probable result according to (\ref{probabilitydistkp}). The behavior of the conditional Wigner function is consistent with that of marginal Wigner function. The initial spin coherent state evolves into a squeezed state at short times followed by a non-Gaussian state for longer time evolution. As the squeezing time $t$ increases, the volume of the negative part of Wigner function is increased, which indicates the emergence of non-classical behavior \cite{kenfack2004}. This is in contrast with the marginal Wigner function, which is always positive as was seen in Fig. \ref{marginal}. According to Hudson's theorem, only pure quantum states with non-negative Wigner functions shows Gaussianity \cite{gross2006,mandilara2009}. Therefore the positivity of Wigner function in this case does not necessarily mean the quantum state is always Gaussian. The conditional Wigner function, corresponding to postselecting certain measurement outcomes, exhibits more non-Gaussianity and higher degree of quantumness. \begin{figure}[t] \includegraphics[width=\columnwidth]{joint_time} \caption{\label{joint_time} Conditional Wigner function for the split spin-squeezed state at various interaction times with $k_R=5$. (a) $t=1/N$, (b) $t=1/\sqrt{2N}$, (c) $t=1/\sqrt{N}$, (d) $t=\pi/8$. In all plots, the total number of atoms is $N=20$, and the numbers in each ensemble are $N_L=N_R=10$.} \end{figure} \section{Detection of entanglement} \label{iv} As we have already seen in Fig. \ref{devil}, entanglement between the two wells of the split squeezed BEC is always present except for times $ t = 0 $ modulo $ T = \pi/4 $. This was shown using the logarithmic negativity, which in general requires the full density matrix for the calculation. Experimentally, this is not convenient as full tomography of the density matrix is required to evaluate the expression. For example, in Ref. \cite{fadel2017} the total number of atoms was $ N \approx 500 $. Typically in an experiment, only low order expectation values of the total spins are observable. Thus the use of correlation-based entanglement criteria \cite{duan, hz2006,Giovannetti,simon,guhne,vinay2017}, where a small number of observables are measured is desirable. In this section, we compare several types to see which gives the most sensitive detection of entanglement. \subsubsection{DGCZ entanglement criterion} We first calculate a DGCZ criterion for the split squeezed BEC. Since the spins are initially polarized in the $ S^x $-direction, we may use a Holstein-Primakoff transformation to treat the other spins as approximate position and momentum operators \begin{align} X_i \approx \frac{S^y_i}{\sqrt{2N_i}} \nonumber \\ P_i \approx \frac{S^z_i}{\sqrt{2N_i}} \end{align} where $ i \in \{ L, R \} $ and $ S^x_i \approx N_i $ is treated classically. As derived in Ref. \cite{byrnes13}, these variables can be used to create EPR-like variances which we expect to have suppressed noise fluctuations. Any separable state then obeys the inequality \begin{align} \mathcal{E}_{\text{D}} \equiv \frac{\langle \Delta^2 [ S_L^y - S_R^z ] \rangle + \langle \Delta^2 [ S_R^y - S_L^z] \rangle}{2\langle S_L^x \rangle + 2\langle S_R^x \rangle} \ge 1 \label{duan} \end{align} where the variance of an operator $ A $ is $ \langle \Delta^2 A \rangle = \langle A^2 \rangle - \langle A \rangle^2 $. A violation of (\ref{duan}) signals the presence of entanglement. The criterion (\ref{duan}) only detects entanglement in a limited time range. The range can be estimated by evaluating the Heisenberg equations of motion \begin{align} S_L^y(t) & \approx S_L^y(0) + 4 N_L t ( S_L^z(0) + S_R^z(0) ) \nonumber \\ S_R^y(t) & \approx S_R^y(0) + 4 N_R t ( S_L^z(0) + S_R^z(0) ) \nonumber \\ S_L^z(t) & = S_L^z(0) \nonumber \\ S_R^z(t) & = S_R^z(0) \label{heisen} \end{align} Substituting this into (\ref{duan}) for the initial state of completely polarized spins in the $ S^x_i $-direction, we obtain \begin{align} \langle \Delta^2 [ S_L^y - S_R^z ] + \langle \Delta^2 [ S_R^y - S_L^z] \rangle \approx 2N ( 4 N^2 t^2 - 2N t + 1) \label{lhsestimate} \end{align} Here, we have approximated that $ N_L = N_R = N/2 $, which is the most likely outcome of (\ref{leftwellprob}). Similarly, we have for the denominator of (\ref{duan}): \begin{align} 2\langle S_L^x \rangle + 2\langle S_R^x \rangle = 2N . \label{rhsestimate} \end{align} Thus we expect the entangled states to be detected in the region $ 0 < t < 1/2N $. Evaluation of the criterion (\ref{duan}) is shown in Fig. \ref{criteriaDvsG}. We see that entanglement can be detected up to times $ t \approx 1/2N $ as expected. We note that the plot for Fig. \ref{criteriaDvsG} is calculated using the exact expressions for the quantities in (\ref{lhsestimate}) and (\ref{rhsestimate}), rather than the Holstein-Primakoff approximation as above. We attribute the failure of the criterion (\ref{duan}) beyond times $ t > 1/2N $ to the break down of the Holstein-Primakoff approximation, since the total spin is no longer polarized in the $ S^x $ direction after this time, as also can be observed from Fig. \ref{marginal}. \subsubsection{Covariance matrix entanglement criterion} Another correlation-based approach that can be used to detect entanglement is the covariance matrix formalism \cite{simon2000peres}. Using Holstein-Primakoff approximated variables, one can construct a $ 4 \times 4 $ covariance matrix in operators $ (X_L, P_L, X_R, P_R) $ which can be used to construct a entanglement criterion. In order to detect entanglement in a wider time range it is however desirable to not explicitly rely upon the Holstein-Primakoff approximation which we expect to break down for times $ t > 1/N $. Recently, the covariance matrix procedure was generalized such that an arbitrary set of operators $ \xi_n $ could be used to construct a covariance matrix \cite{vinay2017}. In the procedure given in Ref. \cite{vinay2017}, the covariance matrix is constructed for a particular state \begin{align} V_{nm} \equiv \frac{1}{2} \langle \{ \Delta \xi_n, \Delta \xi_m \} \rangle, \end{align} where $ \Delta \xi_n = \xi_n - \langle \xi_n \rangle $. Then combining this with the commutation matrix \begin{align} \Omega_{nm} \equiv -i \langle [ \xi_n, \xi_m ] \rangle, \end{align} for any separable state we have \begin{align} \text{PT}(V) + \frac{i}{2} \text{PT} (\Omega) \geq 0, \label{covariance} \end{align} where $ \text{PT} $ denotes a partial transposition operation. As (\ref{covariance}) is a matrix equation, the meaning of the inequality is in the semi-positive definite nature of the matrix on the left hand side. This means that any negative eigenvalue of $ \text{PT}(V) + \frac{i}{2} \text{PT} (\Omega) $ signals the violation of the separability condition. In our case, the set of observables that we will use are \begin{align} \xi = (S_L^x, S_L^y, S_L^z, S_R^x, S_R^y, S_R^z) \label{xiset} \end{align} In Fig. \ref{criteriaDvsG} we plot the quantity \begin{align} \mathcal{E}_{\text{CM}} = \frac{\min_i \lambda_i}{N} , \label{covariancemat} \end{align} where $ \lambda_i $ are the eigenvalues of the left hand side of (\ref{covariance}). We see that this criterion also detects entanglement in the split squeezed BEC state, but for a wider range of times than using the DGCZ criterion. The region of applicability of the covariance matrix is found to be up to times $ t \approx 1/\sqrt{12 N} $ which we find empirically using several values of $ N $. In this sense, we find that the covariance matrix formalism is more powerful than the DGCZ criterion as it can detect entanglement in a wider range. This is natural since more information is contained in the covariance matrix, since (\ref{xiset}) giving all the $ 6 \times 6 $ correlators, rather than the two types in (\ref{duan}). \subsubsection{Giovannetti \textit{et al.} entanglement criterion} Another entanglement criterion we consider is the one proposed in Ref. \cite{Giovannetti} by Giovannetti \textit{et al.}. This is given by \begin{align} \mathcal{E}_{\text{G}} & \equiv \dfrac{ \sqrt{ \langle \Delta^2 [ g^{z} S_L^{z^\prime} - S_R^{z^\prime} )] \rangle \langle \Delta^2 [ g^{y} S_L^{y^\prime} - S_R^{y^\prime} )] \rangle } }{ \vert g^{z} g^{y^\prime} \vert \langle S_L^x \rangle + \langle S_R^x \rangle } & \geq 1 \;, \label{giovannetti} \end{align} where \begin{align} S_i^{z^\prime} & = S_i^y \sin \theta + S_i^z \cos \theta \nonumber \\ S_i^{y^\prime} & = S_i^y \cos \theta - S_i^z \sin \theta \end{align} are spin operators that are chosen to minimize the variance of $ S_i^{z^\prime} $ and $S_i^{y^\prime} $ for $ i \in \{L, R \} $. The squeezing angle is given by \begin{align} \tan 2 \theta = \frac{4 \sin(4t) \cos^{N-2} (4t)}{1- \cos^{N-2} (8 t)} . \end{align} The parameters $ g^{y,z} $ are free real parameters that are chosen to minimize $\mathcal{E}_{\text{G}}$. As for the case with (\ref{duan}), the inequality (\ref{giovannetti}) is valid for separable states. A violation of (\ref{giovannetti}) signals the presence of entanglement. The criterion (\ref{giovannetti}) was successfully adopted in Ref. \cite{fadel2017} to detect entanglement between two regions of an expanded spin-squeezed BEC with $N\approx 600$. In Fig. \ref{criteriaDvsG} we plot the criteria (\ref{giovannetti}). It is evident that the criterion (\ref{giovannetti}) allows to detect entanglement for a wider range of $t$ than the DGCZ criterion and the same range as the covariance matrix approach. We have verified that the covariance matrix and Giovannetti criterion give the same range of entanglement detection for any value of $ N $ chosen, hence can be considered equivalent methods of detection for split squeezed BECs. We observe that the range of entanglement that can be detected by the Giovannetti and covariance matrix methods is equivalently given by the total squeezing in the combined system. The entanglement in a single BEC can be witnessed from the Wineland squeezing parameter \cite{wineland1994} \begin{equation} \xi = \dfrac{N \Delta^2 [ S^{z^\prime}_{\text{tot}} ]}{|S^{x}_{\text{tot}}|^2 } , \label{Wineland} \end{equation} where \begin{align} S^{z^\prime}_{\text{tot}} & = S^{z^\prime}_L + S^{z^\prime}_R \nonumber \\ S^{x}_{\text{tot}} & = S^{x}_L + S^{x}_R \end{align} which quantifies the metrological usefulness of a state for Ramsey interferometry. For a single BEC, $\xi \ge 1$ for all separable states, $\xi<1$ reveals that the state is entangled. We find that the region that the Giovannetti and covariance matrix criteria detect entanglement coincides with all states with $\xi<1$, as can be seen in Fig. \ref{criteriaDvsG}. This is natural in view of the fact that the entanglement between the BECs originates from converting entanglement that is present originally in a single BEC to two BECs by splitting them. \begin{figure} \includegraphics[width=\columnwidth]{plotEnt.eps} \caption{Comparison of the DGCZ (\ref{duan}), covariance matrix (\ref{covariancemat}), and Giovannetti (\ref{giovannetti}) entanglement criteria for a split squeezed Bose-Einstein condensate for $N=500$. The horizontal dashed line is the separability bound, below which entanglement is detected. The top scale shows the Wineland squeezing parameter (\ref{Wineland}), which initially decreases with $ t $, but then increases again. The vertical gray line indicates the point where $\xi=1$. \label{criteriaDvsG} } \end{figure} \section{EPR steering} \label{sec:steering} We show that our system allows for correlations stronger than entanglement, namely correlations allowing EPR steering \cite{EPR1935,ReidCOLLOQUIUM} The criterion we consider is the one proposed in \cite{ReidCOLLOQUIUM}, and experimentally adopted in \cite{fadel2017}, according which the left BEC steers the right BEC if there is a violation of the inequality \begin{equation} \mathcal{E}^{L\rightarrow R} \equiv \dfrac{ \sqrt{ \langle \Delta^2 [ g^{z} S_L^{z^\prime} - S_R^{z^\prime} )] \rangle \langle \Delta^2 [ g^{y} S_L^{y^\prime} - S_R^{y^\prime} )] \rangle } }{ \langle S_R^x \rangle } \geq 1 \;, \label{epr} \end{equation} where $g^{z}$ and $g^{y}$ are free real parameters that are chosen to minimize $ \mathcal{E}^{L\rightarrow R} $. In Fig. \ref{criteriaEPR} we plot the criterion (\ref{epr}). It is evident that the criterion can be violated for a wide range of $t$, and it is therefore suited to detect EPR steering between the two parts of a split spin-squeezed BEC. The range is smaller than for entanglement since steering is a type of correlation that is stronger than entanglement, and for large times the type of correlation between the BECs cannot be described in terms of the steering variables that (\ref{epr}) is designed to be a witness of. The criterion (\ref{epr}) was successfully adopted in Ref. \cite{fadel2017} to detect steering between two regions of an expanded spin-squeezed BEC with $N\approx 600$. We mention here that unlike entanglement or Bell correlations, steering is an intrinsically asymmetric concept: while one system can steer the other and vice-versa (two-way steering), there exists the possibility of having only one of the two systems able to steer the other (one-way steering) \cite{HePRL2015directional}. While in this theoretical study the state is symmetric, and therefore one-way steering always implies two-way steering, experimental implementation of our protocol might result in one-way steering only, because of asymmetric noise \cite{fadel2017}. \begin{figure} \includegraphics[width=0.93\columnwidth]{plotEPR.eps} \caption{EPR steering criterion (\ref{epr}) in a split squeezed Bose-Einstein condensate for $N=500$. The horizontal dashed line is the steerability bound, below which EPR steering is detected. The top scale shows the Wineland squeezing parameter (\ref{Wineland}). \label{criteriaEPR} } \end{figure} \section{Summary and conclusions} \label{v} We have modeled and analyzed the behavior of split squeezed BECs. In our model, one spin polarized BEC is squeezed and split into two spatially separated parts. After the BECs are split, the particle number in each well collapses to a particular number state. The combination of the squeezing, splitting, and collapse is found to have the same effect as applying a Hamiltonian of the form $ H_{\text{eff}} = (S_L^z)^2 + 2 S_L^z S_R^z+(S_R^z)^2$, to two $ S^x $-polarized BECs with a total particle number of $ N $. This corresponds to a non-local entangling Hamiltonian combined with local squeezing on each well. The situation found here is analogous to the generation of a two-mode squeezed state in optical systems. Such a state is well-known to be equivalent to applying a beam splitter operation on single mode squeezed states \cite{schleich2011quantum}. In the same way that photonic entanglement can be prepared by a beam splitter operation, here the entanglement between BECs is produced by splitting a single squeezed BEC into two spatially separated BECs. The entanglement between the BECs was found to have the characteristic ``devil's crevasse'' form of entanglement which arises from a $ S_L^z S_R^z $ interaction, giving a non-zero entanglement for all time except the states equivalent to the initial product state. The marginal Wigner function, corresponding to the averaged quantum state over one BEC, evolves to a non-Gaussian state for evolution times exceeding $ t > 1/\sqrt{N} $. The conditional Wigner function, corresponding to a (post-selected) particle number collapse across the wells, shows a high degree of non-classicality, as illustrated by negativities appearing in the Wigner function. We also provided several approaches for the detection of entanglement using correlations of spin variables: the DGCZ, Giovannetti, and a generalized covariance matrix criteria. The Giovannetti and covariance matrix approaches were found to give the largest range of entanglement detection and appear to be best suited to detecting entanglement. Using a small modification of the Giovannetti entanglement criterion, we showed that one may also detect EPR steering in the system. An interesting question is whether Bell correlations between the two BECs could be detected by measuring low-order correlators, in a similar way. While there are known Bell inequalities that can be violated, these require always parity measurements which are experimentally challenging. Therefore, it is an intriguing theoretical task to find new Bell correlation witnesses that are more experimentally accessible for mesoscopic and macroscopic systems. \begin{acknowledgments} The authors thank Philipp Treutlein and Vinay Tripathi for discussions. This work is supported by the Shanghai Research Challenge Fund; New York University Global Seed Grants for Collaborative Research; National Natural Science Foundation of China (61571301); the Thousand Talents Program for Distinguished Young Scholars (D1210036A); and the NSFC Research Fund for International Young Scientists (11650110425); NYU-ECNU Institute of Physics at NYU Shanghai; the Science and Technology Commission of Shanghai Municipality (17ZR1443600); and the China Science and Technology Exchange Center (NGA-16-001). \end{acknowledgments}
\chapter*{Annexes} \addcontentsline{toc}{chapter}{Annexes} \renewcommand{\thesection}{\Alph{section}} \section{Liste des publications} \label{listPublis} \begin{itemize} \item \bibentry{ecml16} \item \bibentry{icwsm16} \item \bibentry{coria16} \item \bibentry{dn16} \item \bibentry{ictai15} \item \bibentry{icwsm15} \item \bibentry{coria15} \item \bibentry{dn15} \end{itemize} \section{Preuve borne supérieure du regret pour l’algorithme \texttt{CUCBV}} \label{PreuveRegCUCBV} Nous rappelons les notations suivantes: \begin{itemize} \item $\mathcal{K}$ l'ensemble complet des $K$ actions possibles; \item $\mu_{i}$ l'espérance de la récompense associée à l'action $i$; \item $\sigma_{i}$ l'écart type de la récompense associée à l'action $i$; \item On ordonne les actions de la façon suivante: $\forall i, \mu_{i} > \mu_{i+1}$; \item $\mathcal{K}^{\star}$ est l'ensemble des $k$ actions ayant la plus forte espérance: $\mathcal{K}^{\star}=\left\{1,..,k\right\}$; \item $\overline{\mu}^{\star}$ est la moyenne des espérances des actions dans $\mathcal{K}^{\star}$, $\overline{\mu}^{\star}=\dfrac{1}{k}\sum\limits_{i=1}^{k}\mu_{i}$ \item $\Delta_i$ est défini comme la différence entre $\overline{\mu}^{\star}$, la moyenne des espérances des actions dans $\mathcal{K}^{\star}$, et $\mu_{i}$: $\Delta_i = \overline{\mu}^{\star}-\mu_{i}$; \item $\underline{\mu}^{\star}$ est la plus faible espérance dans $\mathcal{K}^{\star}$: $\underline{\mu}^{\star}=\min\limits_{i\in\mathcal{K}^{\star} }\mu_{i}=\mu_{k}$ \item $\delta_{i}$ correspond à la différence entre $\underline{\mu}^{\star}$, la plus faible espérance dans $\mathcal{K}^{\star}$, et $\mu_i$: $\delta_{i}=\underline{\mu}^{\star} - \mu_i$; \item $N_{i,t}$ est le nombre de fois qu'une action $i$ a été choisie dans les $t$ premiers pas de temps. \item $\hat{\mu}_{i,t}$ est la moyenne empirique associée à l'action $i$ après dans les $t$ premiers pas de temps; \item $V_{i,t}$ est la variance empirique associée à l'action $i$ après dans les $t$ premiers pas de temps; \end{itemize} \subsection{Expression du regret} \label{PreuveRegCUCBVFirstPart} En utilisant l'ordonnancement des actions selon leur espérance on a: \begin{equation*} \hat{R}_{T} = \mathbb{E}\left[\sum\limits_{t=1}^{T} \left(\sum\limits_{j=1}^k \mu_{j}-\sum\limits_{i \in \mathcal{K}_t} \mu_i \right)\right] =\mathbb{E}\left[T\sum\limits_{j=1}^k\mu_{j} -\sum\limits_{i=1}^{K} N_{i,T} \mu_{i}\right] \end{equation*} De plus, indépendamment de l'action choisie: \begin{equation*} \sum_{i=1}^{K} N_{i,T} =kT \end{equation*} Car on sélectionne exactement $k$ actions distinctes à chaque itération. Donc: \begin{align*} \hat{R}_{T}&=\mathbb{E}\left[T\sum\limits_{j=1}^k\mu_{j} -\sum\limits_{i=1}^{K} N_{i,T} \mu_{i}\right]\\ &=\mathbb{E}\left[\sum_{i=1}^{K} \dfrac{N_{i,T}}{k}\sum\limits_{j=1}^k\mu_{j} -\sum\limits_{i=1}^{K} N_{i,T} \mu_{i}\right]\\ &=\mathbb{E}\left[\sum_{i=1}^{K} N_{i,T}\left( \sum_{j=1}^k \frac{\mu_{j}}{k} -\mu_{i}\right)\right]\\ &=\sum\limits_{i=1}^{K} \mathbb{E}[N_{i,T}] \Delta_i \end{align*} \subsection{Borne du regret} \label{PreuveRegCUCBVSecondPart} L'étude de la borne supérieure du regret cumulé moyen commence par la séparation des contributions des actions optimales et des actions non optimales: \begin{align*} \hat{R}_{T}=\sum\limits_{i=1}^{K} \mathbb{E}[N_{i,T}] \Delta_i=\sum\limits_{i=1}^{k} \mathbb{E}[N_{i,T}] \Delta_i + \sum\limits_{i=k+1}^{K} \mathbb{E}[N_{i,T}] \Delta_i \end{align*} Etant donné que l'on ne peut pas choisir une action plusieurs fois dans un même pas de temps, nous savons que $\mathbb{E}[N_{i,T}]\leq T$ d'où: \begin{align*} \hat{R}_{T} \leq T \sum\limits_{i=1}^{k} \Delta_i + \sum\limits_{i=k+1}^{K} \mathbb{E}[N_{i,T}] \Delta_i \end{align*} En remarquant aussi que $\sum_{i=1}^{k}\Delta_i = 0$, nous obtenons une première borne supérieure du regret ne dépendant que des actions sous-optimales: \begin{align*} \hat{R}_{T} \leq \sum\limits_{i=k+1}^{K} \mathbb{E}[N_{i,t}] \Delta_i \end{align*} Considérant l'algorithme \texttt{CUCBV}, avec l'hypothèse que toutes les actions sont connues on sait qu'après $t_{0}=\lceil K/k \rceil$, chaque action est choisie au moins une fois (ceci est dû à cause de l'initialisation des scores à $+ \infty$). Dans la suite, on note le score du bras $i$ à l'intant $t$ de la façon suivante: \begin{align*} G_{i,N_{i,t-1},t}=\widehat{\mu}_{i,t-1}+\sqrt{\frac{2a\log(t) V_{i,t-1}}{N_{i,t-1}}}+3bc\frac{\log(t)}{N_{i,t-1}} \end{align*} Afin de limiter les difficultés de notations, on se limite au cas où $a=c=1$. En pratique, on pourrait effectuer la démonstration dans un cadre plus générique avec d'autres constantes (c.f \cite{banditUCBV}). Donc à chaque pas de temps $t\geq t_{0} $, pour les actions sélectionnées on obtient: \begin{align*} \forall i \in \mathcal{K}_{t}:N_{i,t-1}>0, \exists j \in \mathcal{K}^{\star} ~\text{tel que}~ N_{j,t-1}>0 ~\text{et}~ G_{i,N_{i,t-1},t} \geq G_{j,N_{j,t-1},t} \end{align*} Etudions maintenant le terme $N_{i,T}$. Soit $u>1$: \begin{align*} N_{i,T}&=\sum\limits_{t=1}^{T} \mathbf{1}_{\left\{i \in \mathcal{K}_t\right\}} \\ &\leq 1 + \sum\limits_{t=1+t_{0}}^{T} \mathbf{1}_{\left\{i \in \mathcal{K}_t\right\}} \\ &\leq 1+u+\sum\limits_{t=1+u+t_{0}}^{T} \mathbf{1}_{\left\{N_{i,t-1}\geq u ; \ i \in \mathcal{K}_t\right\}}\\ &\leq 1+u+\sum\limits_{t=1+u+t_{0}}^{T} \mathbf{1}_{\left\{ N_{i,t-1}\geq u ; \exists j \in \mathcal{K}^{\star} ~\text{tel que}~ N_{j,t-1}>0 ~\text{et}~ G_{i,N_{i,t-1},t} \geq G_{j,N_{j,t-1},t} \right\}} \end{align*} Par ailleurs, pour tout $\gamma \in \mathbb{R}$, on a: \begin{align*} &\mathbf{1}_{\left\{ N_{i,t-1}\geq u ; \exists j \in \mathcal{K}^{\star} ~\text{tel que}~ N_{j,t-1}>0 ~\text{et}~ G_{i,N_{i,t-1},t} \geq G_{j,N_{j,t-1},t} \right\}}\\ &\leq \mathbf{1}_{\left\{ \exists s: u\leq s\leq t-1 ~\text{tel que}~ G_{i,s,t} > \gamma \right\}} + \mathbf{1}_{\left\{ \exists j \in \mathcal{K}^{\star}, \exists s_{j}: 1\leq s_{j}\leq t-1 ~\text{tel que}~ G_{j,s_{j},t} \leq \gamma \right\}} \end{align*} En choisissant $\gamma=\underline{\mu}^{\star}$ on obtient: \begin{align*} \mathbb{E}[N_{i,T}] &\leq 1+u+\sum\limits_{t=u+1+t_{0}}^{T} \mathbb{P}(\exists s: u\leq s\leq t-1 ~\text{tel que}~ G_{i,s,t} > \underline{\mu}^{\star}) \\ &\qquad \qquad\qquad+\sum\limits_{t=u+1+t_{0}}^{T}\mathbb{P}(\exists j \in \mathcal{K}^{\star}, \exists s_{j}: 1\leq s_{j}\leq t-1 ~\text{tel que}~ G_{j,s_{j},t} \leq \underline{\mu}^{\star})\\ & \leq 1+u+\sum\limits_{t=u+1+t_{0}}^{T} \sum\limits_{s=u}^{t-1} \mathbb{P}(G_{i,s,t} > \underline{\mu}^{\star}) + \sum\limits_{t=u+1+t_{0}}^{T}\sum\limits_{j=1}^{k} \mathbb{P}(\exists s_{j}: 1\leq s_{j}\leq t-1 ~\text{tel que}~ G_{j,s_{j},t} \leq \underline{\mu}^{\star}) \end{align*} Dans la suite, nous allons majorer chacun de ces deux termes. Nous utiliserons les notations suivantes: \begin{itemize} \item $\mathbb{P}_{j,t}^{1} = \mathbb{P}(\exists s_{j}: 1\leq s_{j}\leq t-1 ~\text{tel que}~ G_{j,s_{j},t} \leq \underline{\mu}^{\star})$ avec $j \in \mathcal{K}^{\star}$ \item $\mathbb{P}_{i,s,t}^{2}=\mathbb{P}(G_{i,s,t} > \underline{\mu}^{\star})$ \end{itemize} \subsubsection{Contribution du premier terme} Etant donné que $\forall j \in \mathcal{K}^{\star}$ on a $\underline{\mu}^{\star}=\mu_{k} \leq \mu_{j}$, on obtient directement: \begin{align*} \mathbb{P}_{j,t}^{1} \leq \mathbb{P}(\exists s_{j}: 1\leq s_{j}\leq t-1 ~\text{tel que}~ G_{j,s_{j},t} \leq \mu_{j}) \end{align*} En utilisant les résultats du \textbf{Théorème 1} dans \cite{banditUCBV}, on obtient: \begin{align*} \mathbb{P}(G_{j,s_{j},t} \leq \mu_{j}) \leq \beta(\log(t),t) \end{align*} Simultanément $\forall s_{j} \in \left\{1,2, ...,t\right\}$, où $\beta(\log(t),t)$ est de l'ordre de $e^{-\log(t)}=1/t$. Donc on peut majorer $\mathbb{P}_{j,t}^{1}$ par: \begin{align*} \mathbb{P}_{j,t}^{1} \leq \leq \beta(\log(t),t) \end{align*} Finalement: \begin{align*} \sum\limits_{t=u+1+t_{0}}^{T}\sum\limits_{j=1}^{k} \mathbb{P}(\exists s_{j}: 1\leq s_{j}\leq t-1 ~st~ G_{j,s_{j},t} \leq \underline{\mu}^{\star})\leq k \sum\limits_{t=u}^{\top} \beta(\log(t),t) \end{align*} \subsubsection{Contribution du second terme} D'après la preuve du \textbf{Théorème 3} dans \cite{banditUCBV} on peut conclure qu'en prenant $u$ le plus petit entier inférieur à $\lceil 8\left(\dfrac{\sigma_{i}^{2}}{\delta_{i}^{2}} + \dfrac{2}{\delta_{i}}\right)\log(T) \rceil$, pour tout $s\leq u \leq t-1$ et $t \geq 2$: \begin{align} \sqrt{\frac{2\ln(t) (\sigma_{i}^2+\delta_{i}/2)}{s}} +3\frac{\log(t)}{s} \leq \dfrac{\delta_{i}}{2} \end{align} Par ailleurs, pour tout $s\geq u$ et $t\geq 2,$ en utilisant l'équation précédente: \begin{align*} \mathbb{P}(G_{i,s,t} > \underline{\mu}^{\star}) &=\mathbb{P}\left( \widehat{\mu}_{i,s}+\sqrt{\frac{2\ln(t) \widehat{\sigma}_{i,s}^{2}}{s}}+3\frac{\ln(t)}{s} > \underline{\mu}^{\star}\right)\\ &=\mathbb{P}\left( \widehat{\mu}_{i,s}+\sqrt{\frac{2\ln(t) \widehat{\sigma}_{i,s}^{2}}{s}}+3\frac{\ln(t)}{s} > \delta_{i}+\mu_{i}\right)\\ &\leq \mathbb{P}\left( \widehat{\mu}_{i,s}+\sqrt{\frac{2\ln(t) (\sigma_{i}^2+\delta_{i}/2)}{s}}+3\frac{\ln(t)}{s} > \delta_{i}+\mu_{i}\right) + \mathbb{P}\left(\widehat{\sigma}_{i,s}^{2} \geq \sigma_{i}^2+\delta_{i}/2\right)\\ &\leq \mathbb{P}\left( \widehat{\mu}_{i,s}-\mu_{i} >\delta_{i}/{2}\right) + \mathbb{P}\left(\widehat{\sigma}_{i,s}^{2} - \sigma_{i}^2 \geq \delta_{i}/2\right) \leq 2e^{-s\delta_{i}^{2}/(8\sigma_{i}^{2}+4\delta_{i}/3)} \\ \end{align*} Comme précisé dans \cite{banditUCBV}, à la dernière étape, l'inégalité de Bernstein est appliquée deux fois. En sommant ces probabilités, on arrive à: \begin{align*} \sum\limits_{s=u}^{t-1} \mathbb{P}(G_{i,s,t} > \underline{\mu}^{\star}) \leq 2 \sum\limits_{s=u}^{t-1} e^{-s\delta_{i}^{2}/(8\sigma_{i}^{2}+4\delta_{i}/3)} \leq \left(\dfrac{24\sigma_{i}^{2}}{\delta_{i}^{2}} + \dfrac{4}{\delta_{i}}\right)\dfrac{1}{T} \end{align*} Donc: \begin{align*} \sum\limits_{t=u+1+t_{0}}^{T}\sum\limits_{s=u}^{t-1} \mathbb{P}(G_{i,s,t} > \underline{\mu}^{\star}) \leq \sum\limits_{t=1}^{T} \left(\dfrac{24\sigma_{i}^{2}}{\delta_{i}^{2}} + \dfrac{4}{\delta_{i}}\right)\dfrac{1}{T} \leq \left(\dfrac{24\sigma_{i}^{2}}{\delta_{i}^{2}} + \dfrac{4}{\delta_{i}}\right) \end{align*} \subsubsection{Conclusion} \begin{align*} \mathbb{E}[N_{i,T}] \leq 1 + \left(1+8\left(\dfrac{\sigma_{i}^{2}}{\delta_{i}^{2}} + \dfrac{2}{\delta_{i}}\right)\right)\log(T) +\left(\dfrac{24\sigma_{i}^{2}}{\delta_{i}^{2}} + \dfrac{4}{\delta_{i}}\right) +k\sum\limits_{t=u}^{T} \beta(\log(t),t) \end{align*} Et étant donné que $\dfrac{\sigma_{i}^{2}}{\delta_{i}^{2}} + \dfrac{2}{\delta_{i}}\geq 2 $: \begin{align*} \mathbb{E}[N_{i,T}] \leq 1 + \left(1+8\left(\dfrac{\sigma_{i}^{2}}{\delta_{i}^{2}} + \dfrac{2}{\delta_{i}}\right)\right)\log(T) +\left(\dfrac{24\sigma_{i}^{2}}{\delta_{i}^{2}} + \dfrac{4}{\delta_{i}}\right) +k\sum\limits_{t=16\log(T)}^{T} \beta(\log(t),t) \end{align*} On arrive à: $\hat{R}_{T} \leq \sum\limits_{i \notin \mathcal{K}^{\star}} \Big( 1 + \left(1+8\left(\dfrac{\sigma_{i}^{2}}{\delta_{i}^{2}} + \dfrac{2}{\delta_{i}}\right)\right)\log(T) +\left(\dfrac{24\sigma_{i}^{2}}{\delta_{i}^{2}} + \dfrac{4}{\delta_{i}}\right) +k\sum\limits_{t=16\log(T)}^{T} \beta(\log(t),t) \Big)\Delta_i$ En utilisant le fait que $\beta(\log(t),t)=\alpha \frac{1}{t}$ et $\sum\limits_{t=1}^{n}\frac{1}{T}\leq \log(T)+\gamma+\frac{1}{2T} \leq \log(T)+\gamma+\frac{1}{2}$, où $\alpha$ est un réel, et $\gamma$ est la constante d'Euler, on obtient finalement: \begin{align*} \hat{R}_{T} \leq \log(T)\sum\limits_{i \notin \mathcal{K}^{\star}} \left(C+8\left(\dfrac{\sigma_{i}^{2}}{\delta_{i}^{2}} + \dfrac{2}{\delta_{i}}\right)\right)\Delta_i + D \end{align*} Avec $C=1+k\alpha$ et $D=\sum\limits_{i \notin \mathcal{K}^{\star}}\left(1+\dfrac{24\sigma_{i}^{2}}{\delta_{i}^{2}} + \dfrac{4}{\delta_{i}}+k\alpha\left(\gamma+\frac{1}{2}\right)\right)\Delta_i$ \section{Borne supérieure du regret pour l’algorithme \texttt{SampLinUCB}} \subsection{Preuve de la proposition \ref{SubGaussianProp}} \label{PreuveSubGauss} Les deux lemmes suivants viennent de la définition des variables aléatoires sous-gaussiennes. \begin{lem} \label{lem1} Soit $X$ une variable aléatoire sous-gaussienne centrée, alors les points suivants sont équivalents: \begin{itemize} \item Condition de Laplace : $\exists R>0, \forall \lambda \in \mathbb{R}, \mathbb{E}[e^{\lambda X}]\leq e^{R^{2}\lambda^{2}/2}$ \item Queue sous-gaussienne: $\exists R>0, \forall \gamma>0, P(|X|\geq \gamma)\leq 2e^{-\gamma^{2}/(2R^{2})} $ \end{itemize} \end{lem} \begin{lem} \label{lem2} Soient $X_{1}$ et $X_{2}$ deux variables aléatoires sous-gaussiennes de constante respective $R_{1}$ et $R_{2}$. Soient $\alpha_{1}$ et $\alpha_{2}$ deux réels. Alors la VA $\alpha_{1}X_{1}+\alpha_{2}X_{2}$ est aussi sous-gaussienne de constante $\sqrt{\alpha_{1}^{2}R_{1}^{2}+\alpha_{2}^{2}R_{2}^{2}}$. \end{lem} \begin{lem} \label{lem3} Supposons que pour tout $i$, et à chaque temps $t$, les échantillons $x_{i,t} \in \mathbb{R}^{d}$ sont iid de moyenne $\mu_{i} \in \mathbb{R}^{d}$, et que $||x_{i,t}||\leq L$ et $||\beta||\leq S$ . Alors pour tout $i$, et à chaque temps $t$, $\epsilon_{i,t}^{\top}\beta$ est sous-gaussien, de constante $\dfrac{LS}{\sqrt{n_{i,t}}}$. On rappelle que $\epsilon_{i,t}=\mu_{i}-\hat{x}_{i,t}$. \end{lem} \begin{preuve} En utilisant l'inégalité de Cauchy-Schwarz, pour tout $i$, et à chaque temps $t$ on a: $|x_{i,t}^{\top}\beta|\leq ||\beta||||\hat{x}_{i,t}||\leq LS$. Donc, étant donné que pour tout $i$, les $x_{i,t}$ sont iid et $\mathbb{E}[x_{i,t}]=\mu_{i}$, on peut appliquer l'inégalité de Hoeffding à la variable aléatoire $x_{i,t}^{\top}\beta$ de moyenne $\mu_{i}^{\top}\beta$. \begin{align*} \forall \gamma>0,\mathbb{P}\left( |\beta^{\top}\hat{x}_{i,t}-\beta^{\top}\mu_{i}| > \gamma \right) = \mathbb{P}\left( |\beta^{\top}\epsilon_{i,t}| > \gamma \right) \leq 2e^{-\frac {n_{i,t}\gamma^{2}}{2S^{2}L^{2}}} \end{align*} En appliquant le lemme \ref{lem1} on obtient le résultat souhaité avec $T_{i,t}\gamma^{2}/(2S^{2}L^{2}) = 1 /(2R^{2})$ \end{preuve} On utilise finalement le lemme \ref{lem2} avec la somme des $\beta^{\top}\epsilon_{i,t}$ et $\eta_{i,s}$ pour prouver la proposition \ref{SubGaussianProp}, qui établit que la variable aléatoire $\epsilon_{i,t}^{\top}\beta+\eta_{i,s}$ est conditionnellement sous-gaussien de constante $R_{i,t}=\sqrt{R^{2}+\dfrac{L^{2}S^{2}}{n_{i,t}}}$. \subsection{Preuve du théorème \ref{ConfInt}} \label{PreuveConfInt} Pour alléger les notations, on enlève la dépendance en $t$ dans $A$ et $X$. On a: \begin{align*} \hat{\beta}_{t-1} &= \arg\min_{\beta} \sum\limits_{s=1}^{t-1} \dfrac{1}{R_{i_{s},t}}(\beta^{\top}\hat{x}_{i_{s},t}- r_{i_{s},s})^{2} + \lambda ||\beta||^{2} \\ &= (X^{\top}AX+\lambda I)^{-1}X^{\top}AY \\ &= (X^{\top}AX+\lambda I)^{-1}X^{\top}A(X\beta+\eta^{'}) \\ &= (X^{\top}AX+\lambda I)^{-1}X^{\top}A\eta^{'} + (X^{\top}AX+\lambda I)^{-1} (X^{\top}AX+\lambda I)\beta \\ & \ \ \ - (X^{\top}AX+\lambda I)^{-1}\lambda I \beta\\ &= (X^{\top}AX+\lambda I)^{-1}X^{\top}A\eta^{'} + \beta - \lambda (X^{\top}AX+\lambda I)^{-1} \beta \end{align*} En utilisant une méthode identique à celle de \cite{OFUL} on arrive a: \begin{align*} ||\hat{\beta}_{t-1}-\beta||_{V_{t-1}} &\leq ||X^{\top}A\eta^{'}||_{V_{t-1}^{-1}}+\lambda||\beta||_{V_{t-1}^{-1}} \end{align*} Avec $V_{t-1}=\lambda I+ X^{\top}AX$, qui est bien définie positive puisque $\lambda >0$. Etant donné que $||\beta||\leq S$ et $||\beta||_{V_{t-1}^{-1}}^{2}\leq ||\beta||^{2}/\lambda_{min}(V_{t-1}) \leq ||\beta||^{2}/\lambda$ on arrive a: \begin{align*} ||\hat{\beta}_{t-1}-\beta||_{V_{t-1}} &\leq ||X^{\top}A\eta^{'}||_{V_{t-1}^{-1}}+ \sqrt{\lambda}S \end{align*} En utilisant le théorème 1 de \cite{OFUL} et le fait que $\dfrac{\eta^{'}_{s}}{R_{i_{s},t}}$ est sous-gaussien de constante 1 (grâce à la proposition \ref{SubGaussianProp}), pour tout $\delta>0$, avec une probabilité au moins égale à $1-\delta$, pour tout $t \geq 0$: \begin{align*} ||X^{\top}A\eta^{'}||_{V_{t-1}^{-1}} &= ||\sum\limits_{s=1}^{t-1} \dfrac{\eta^{'}_{s}}{R_{i_{s},t}}\hat{x}_{i_{s},t}||_{V_{t-1}^{-1}} \\ &\leq \sqrt{2\log\left(\dfrac{det(V_{t-1})^{1/2}det(\lambda I)^{-1/2}}{\delta}\right)}\\ &\leq \sqrt{d\log\left(\dfrac{1+tL^{2}/\lambda}{\delta}\right)} \end{align*} Les principaux arguments de cette preuve viennent de la théorie des processus auto normalisés décrite dans \cite{PenaLaiShao2009}. \subsection{Preuve du théorème \ref{ConfIntProfils}} \label{PreuveConfIntProfils} Etant donné l'hypothèse selon laquelle $||x_{i,t}||\leq L$, on peut appliquer Hoeffding à chaque dimension $j\in \left[1..d\right]$, de telle sorte que $|x_{i,t}^{j}|\leq L$: \begin{equation*} \forall \gamma>0: ~\mathbb{P}\left( |\hat{x}_{i,t}^{j}-\mu_{i}^{j}| > \gamma/d \right) \leq 2e^{-\frac {n_{i,t}\gamma^{2}}{2L^{2}d^{2}}} \end{equation*} En utilisant le fait que $||\hat{x}_{i,t}-\mu_{i}|| \leq \sum\limits_{i=1}^{d}|\hat{x}_{i,t}^{i}-\mu_{i}^{i}|$ la propriété de la borne uniforme: \begin{equation*} \mathbb{P}\left( ||\hat{x}_{i,t}-\mu_{i}|| \leq \gamma \right)\geq 1-2de^{-\frac {n_{i,t}\gamma^{2}}{2L^{2}d^{2}}} \end{equation*} Finalement en choisissant un $\gamma$ approprié, pour tout $i$ et tout temps $t>0$ avec une probabilité au moins égale à $1-\delta/t^{2}$: \begin{equation*} ||\hat{x}_{i,t}-\mu_{i}|| \leq Ld\sqrt{\dfrac{2}{n_{i,t}}\log\left( \dfrac{2dt^{2}}{\delta}\right)} = \rho_{i,t,\delta} \end{equation*} \subsection{Preuve du théorème \ref{RegretSamplLinUCBGeneric}} \label{preuveRegSampLinUCBGeneric} \begin{lem} \label{lem} Pour tout $i$ et $t>0$ avec une probabilité au moins égale $1-\delta/t^{2}-\delta$: \begin{align*} 0\leq \hat{\beta}_{t-1}^{\top}(\hat{x}_{i,t}+\overline{\epsilon}_{i,t}) + \alpha_{t-1} ||\hat{x}_{i,t}+\tilde{\epsilon}_{i,t}||_{V_{t-1}^{-1}}-\beta^{\top}\mu_{i} & \leq 2\alpha_{t}||\hat{x}_{i,t}||_{V_{t-1}^{-1}} + 4\sqrt{d}(\alpha_{t-1}/\sqrt{\lambda}+S)\rho_{i,t,\delta} \end{align*} \end{lem} \begin{preuve} Supposons que l'inégalité du théorème \ref{ConfIntProfils} est valide, alors: \begin{itemize} \item $||\hat{x}_{i,t}-\mu_{i}||_{V_{t-1}^{-1}} \leq ||\hat{x}_{i,t}-\mu_{i}||/\sqrt{\lambda} \leq \rho_{i,t,\delta}/\sqrt{\lambda}$ donc $||\mu_{i}||_{V_{t-1}^{-1}} \leq || \hat{x}_{i,t}||_{V_{t-1}^{-1}} + \rho_{i,t,\delta}/\sqrt{\lambda} = || \hat{x}_{i,t} + \tilde{\epsilon}_{i,t} ||_{V_{t-1}^{-1}}$, avec $\tilde{\epsilon}_{i,t}= \rho_{i,t,\delta} \hat{x}_{i,t}/(\sqrt{\lambda}|| \hat{x}_{i,t}||_{V_{t-1}^{-1}})$. \item $|\hat{\beta}_{t-1}^{\top}(\hat{x}_{i,t}-\mu_{i})|\leq \hat{\beta}_{t-1}^{\top}\overline{\epsilon}_{i,t}$, avec $\overline{\epsilon}_{i,t}=\rho_{i,t,\delta}\hat{\beta}_{t-1}/||\hat{\beta}_{t-1}||$. \end{itemize} En utilisant ces deux résultats et la propriété de la borne uniforme, on peut montrer le lemme annoncé: Première partie: \begin{align*} & \hat{\beta}_{t-1}^{\top}(\hat{x}_{i,t}+\overline{\epsilon}_{i,t}) + \alpha_{t-1} ||\hat{x}_{i,t}+\tilde{\epsilon}_{i,t}||_{V_{t-1}^{-1}}-\beta^{\top}\mu_{i} \\ =& (\hat{\beta}_{t-1}-\beta)^{\top}\mu_{i} + \alpha_{t-1} ||\hat{x}_{i,t}+\tilde{\epsilon}_{i,t}||_{V_{t-1}^{-1}} - \hat{\beta}_{t-1}^{\top}(\mu_{i}-\hat{x}_{i,t})+\hat{\beta}_{t-1}^{\top}\overline{\epsilon}_{i,t}\\ \geq &-||\hat{\beta}_{t-1}-\beta||_{V_{t-1}}||\mu_{i}||_{V_{t-1}^{-1}}+ \alpha_{t-1} ||\hat{x}_{i,t}+\tilde{\epsilon}_{i,t}||_{V_{t-1}^{-1}} + \hat{\beta}_{t-1}^{\top}(\hat{x}_{i,t}-\mu_{i}+\overline{\epsilon}_{i,t})\\ \geq &-\alpha_{t-1}||\mu_{i}||_{V_{t-1}^{-1}}+ \alpha_{t-1} ||\hat{x}_{i,t}+\tilde{\epsilon}_{i,t}||_{V_{t-1}^{-1}} + \hat{\beta}_{t-1}^{\top}(\hat{x}_{i,t}-\mu_{i}+\overline{\epsilon}_{i,t})\\ \geq &-\alpha_{t-1} ||\hat{x}_{i,t}+\tilde{\epsilon}_{i,t}||_{V_{t-1}^{-1}}+ \alpha_{t-1} ||\hat{x}_{i,t}+\tilde{\epsilon}_{i,t}||_{V_{t-1}^{-1}} + \hat{\beta}_{t-1}^{\top}(\hat{x}_{i,t}-\mu_{i}+\overline{\epsilon}_{i,t})\\ \geq & 0 \end{align*} Seconde partie: en remarquant que $||\overline{\epsilon}_{i,t}||_{V_{t-1}^{-1}} \leq ||\overline{\epsilon}_{i,t}||/\sqrt{\lambda} = \rho_{i,t,\delta}/\sqrt{\lambda} $ et $||\tilde{\epsilon}_{i,t}||_{V_{t-1}^{-1}} = \rho_{i,t,\delta}/\sqrt{\lambda}$: \begin{align*} & \hat{\beta}_{t-1}^{\top}(\hat{x}_{i,t}+\overline{\epsilon}_{i,t}) + \alpha_{t-1} ||\hat{x}_{i,t}+\tilde{\epsilon}_{i,t}||_{V_{t-1}^{-1}}-\beta^{\top}\mu_{i} \\ =& (\hat{\beta}_{t-1}-\beta)^{\top}\mu_{i} + \alpha_{t-1} ||\hat{x}_{i,t}+\tilde{\epsilon}_{i,t}||_{V_{t-1}^{-1}} - \hat{\beta}_{t-1}^{\top}(\mu_{i}-\hat{x}_{i,t})+\hat{\beta}_{t-1}^{\top}\overline{\epsilon}_{i,t}\\ \leq & ||\hat{\beta}_{t-1}-\beta||_{V_{t-1}}||\mu_{i}||_{V_{t-1}^{-1}}+ \alpha_{t-1} ||\hat{x}_{i,t}+\tilde{\epsilon}_{i,t}||_{V_{t-1}^{-1}} + \hat{\beta}_{t-1}^{\top}(\hat{x}_{i,t}-\mu_{i}+\overline{\epsilon}_{i,t})\\ \leq & 2\alpha_{t-1}||\hat{x}_{i,t}+\tilde{\epsilon}_{i,t}||_{V_{t-1}^{-1}} + 2 ||\hat{\beta}_{t-1}||_{V_{t-1}}||\overline{\epsilon}_{i,t}||_{V_{t-1}^{-1}}\\ \leq & 2\alpha_{t-1}||\hat{x}_{i,t}||_{V_{t-1}^{-1}} + 2\alpha_{t-1}||\tilde{\epsilon}_{i,t}||_{V_{t-1}^{-1}} + 2(\alpha_{t-1}+S\sqrt{\lambda}) ||\overline{\epsilon}_{i,t}||_{V_{t-1}^{-1}}\\ \leq &2\alpha_{t-1}||\hat{x}_{i,t}||_{V_{t-1}^{-1}} + 4(\alpha_{t-1}/\sqrt{\lambda}+S)\rho_{i,t,\delta} \end{align*} \end{preuve} \begin{prop} \label{lemApp} Pour tout $t$, avec une probabilité au moins égale $1-\delta/t^{2}-\delta$, le regret instantané de l'algorithme \texttt{SampLinUCB}, noté $reg_{t}=\beta^{\top}\mu_{i^{\star}}-\beta^{\top}\mu_{i_{t}}$ est majoré par: \begin{align*} reg_{t} \leq 2\alpha_{t-1}||\hat{x}_{i_{t},t}||_{V_{t-1}^{-1}} + 4(\alpha_{t-1}/\sqrt{\lambda}+S)\rho_{i_{t},t,\delta} = reg_{t}^{(1)}+reg_{t}^{(2)} \end{align*} \end{prop} \begin{preuve} Etant donné la politique de sélection de \texttt{SampLinUCB} et la première inégalité de lemme précédent, on a pour tout $t$: $s_{i_{t},t}\geq s_{i^{\star},t} \geq \beta^{\top}\mu_{i^{\star}}$. D'autre part, la seconde inégalité du lemme précédent prouve que pour tout $t$ $s_{i_{t},t} \leq \beta^{\top}\mu_{i_{t}} + 2\alpha_{t-1}||\hat{x}_{i,t}||_{V_{t-1}^{-1}} + 4(\alpha_{t-1}/\sqrt{\lambda}+S)\rho_{i,t,\delta}$ Ce qui conclut la preuve. \end{preuve} \textbf{Preuve du théorème} On utilise d'une part le fait que $\sum\limits_{t=2}^{\infty}\delta_{t} = \delta(\pi^{2}/6-1)\leq \delta$ et la propriété de la borne uniforme, et d'autres parts le fait que dans le théorème \ref{ConfInt} la borne est uniforme. Ainsi, avec une probabilité au moins égale à $1-2\delta$: \begin{align*} \sum\limits_{t=1}^{T} reg_{t}^{(2)} &\leq C +\sum\limits_{t=2}^{T} 4(\alpha_{t-1}/\sqrt{\lambda}+S)\rho_{i_{t},t,\delta}\\ &\leq C + \sum\limits_{t=2}^{T} 4(\alpha_{t-1}/\sqrt{\lambda}+S)Ld\sqrt{\dfrac{2}{n_{i,t}}\log\left( \dfrac{2dt^{2}}{\delta}\right)} \\ & \leq C + 4Ld(\alpha_{T}/\sqrt{\lambda}+S)\sqrt{\log\left( \dfrac{2dT^{2}}{\delta}\right)} \sum\limits_{t=2}^{T} \dfrac{2}{\sqrt{n_{i_{t},t}}} \end{align*} D'autre part: \begin{align*} \sum\limits_{t=1}^{T} reg_{t}^{(1)} &\leq \sum\limits_{t=1}^{T} 2\alpha_{t-1}||\hat{x}_{i_{t},t}||_{V_{t-1}^{-1}}^{2} \\ &\leq \sqrt{T\sum\limits_{t=1}^{T}4\alpha_{t-1}^{2}||\hat{x}_{i_{t},t}||_{V_{t-1}^{-1}}^{2}}\\ &\leq 2\alpha_{T} \sqrt{T\sum\limits_{t=1}^{T}||\hat{x}_{i_{t},t}||_{V_{t-1}^{-1}}^{2}} \end{align*} Il faut maintenant majorer le terme $\sum\limits_{t=1}^{T}||\hat{x}_{i_{t},t}||_{V_{t-1}^{-1}}^{2}$. Pour cela, on introduit la grandeur suivante: \begin{equation*} \nu_{i,t,\delta}=Ld\sqrt{2/(n_{i,t})\log\left( 2dT/\delta\right)} \end{equation*} En utilisant à nouveau Hoeffding, avec une probabilité au moins égale à $1-\delta/T$ on a pour $s \leq t-1$: \begin{equation*} ||\hat{x}_{i_{s},t}|| \leq ||\mu_{i_{s}}||+\nu_{i_{s},t,\delta} \end{equation*} En définissant: \begin{equation*} \check{\epsilon}_{i,t}=\nu_{i,t,\delta} \mu_{i}/||\mu_{i}|| \end{equation*} on a, pour $s\leq t-1$: \begin{equation*} 1/\sqrt{R_{i_{s},s}}||\mu_{i_{s}}-\check{\epsilon}_{i_{s},s}|| \leq 1/\sqrt{R_{i_{s},t}}||\hat{x}_{i_{s},t}|| \end{equation*} On arrive ainsi à: \begin{equation*} V_{t-1}=\lambda I+\sum\limits_{s=1}^{t-1} \dfrac{1}{R_{i_{s},t}} \hat{x}_{i_{s},t}\hat{x}_{i_{s},t}^{\top} \geq \lambda I + \sum\limits_{s=1}^{t-1}\dfrac{1}{R_{i_{s},s}} (\mu_{i_{s}}-\check{\epsilon}_{i_{s},s})(\mu_{i_{s}}-\check{\epsilon}_{i_{s},s})^{\top} = W_{t-1} \end{equation*} Ce qui signifie que pour tout vecteur $x$: $||x||_{V_{t-1}^{-1}} \leq ||x||_{W_{t-1}^{-1}}$. On définit maintenant: \begin{equation*} \hat{\epsilon}_{i,t}=\nu_{i,t,\delta} \mu_{i}/(\sqrt{\lambda}||\mu_{i}||_{W_{t-1}^{-1}}) \end{equation*} de telle sorte que pour $s\leq t-1$: \begin{equation*} ||\hat{x}_{i_{s},t}||_{W_{t-1}^{-1}} \leq ||\mu_{i_{s}}+\hat{\epsilon}_{i_{s},s}||_{W_{t-1}^{-1}} \end{equation*} et \begin{equation*} ||\hat{\epsilon}_{i_{s},s}||_{W_{t-1}^{-1}}=\nu_{i_{s},s,\delta}/\sqrt{\lambda} \end{equation*} Finalement, en utilisant la propriété de la borne uniforme et le fait que $\sum\limits_{t=1}^{T} \dfrac{\delta}{T}=\delta$, avec une probabilité au moins égale à $1-\delta$: \begin{align*} \sum\limits_{t=1}^{T} ||\hat{x}_{i_{t},t}||_{V_{t-1}^{-1}}^{2} &\leq \sum\limits_{t=1}^{T} ||\hat{x}_{i_{t},t}||_{W_{t-1}^{-1}}^{2}\\ &\leq\sum\limits_{t=1}^{T} || \mu_{i_{t}} +\hat{\epsilon}_{i_{t},t}||_{W_{t-1}^{-1}}^{2} \leq \sum\limits_{t=1}^{T} || \mu_{i_{t}} +\hat{\epsilon}_{i_{t},t} -\check{\epsilon}_{i_{t},t} +\check{\epsilon}_{i_{t},t} ||_{W_{t-1}^{-1}}^{2}\\ &\leq \sum\limits_{t=1}^{T} ||\mu_{i_{t}}-\check{\epsilon}_{i_{t},t}||_{W_{t-1}^{-1}}^{2} +\sum\limits_{t=1}^{T} ||\hat{\epsilon}_{i_{t},t}||_{W_{t-1}^{-1}}^{2}+\sum\limits_{t=1}^{T} ||\check{\epsilon}_{i_{t},t}||_{W_{t-1}^{-1}}^{2}\\ &\leq \sum\limits_{t=1}^{T} ||\mu_{i_{t}}-\check{\epsilon}_{i_{t},t}||_{W_{t-1}^{-1}}^{2} + \dfrac{2}{\lambda}\sum\limits_{t=1}^{T} \nu_{i_{t},t,\delta}^{2} \\ &\leq \sum\limits_{t=1}^{T} ||\mu_{i_{t}}-\check{\epsilon}_{i_{t},t}||_{W_{t-1}^{-1}}^{2} +\dfrac{4L^{2}d^{2}}{\lambda}\log\left( \dfrac{2dT}{\delta}\right) \sum\limits_{t=1}^{T} \dfrac{1}{n_{i_{t},t}} \end{align*} D'autre part: \begin{align*} det(W_{T}) &=det(W_{T-1}+\dfrac{1}{R_{i_{T},T}} (\mu_{i_{T}}-\check{\epsilon}_{i_{T},T})(\mu_{a_{T}}-\check{\epsilon}_{i_{T},T})^{\top})\\ &=det(W_{T-1})det(I+\dfrac{1}{R_{i_{T},T}}W_{T-1}^{-1/2}(\mu_{i_{T}}-\check{\epsilon}_{i_{T},T})(W_{T-1}^{-1/2}(\mu_{i_{T}}-\check{\epsilon}_{i_{T},T}))^{\top})\\ &=det(W_{T-1})(1+\dfrac{1}{R_{i_{T},T}}||\mu_{i_{T}}-\check{\epsilon}_{i_{T},T}||_{W_{T-1}^{-1}}^{2}) \\ &=det(\lambda I) \prod\limits_{t=1}^{T} (1+\dfrac{1}{R_{i_{t},t}}||\mu_{i_{t}}-\check{\epsilon}_{i_{t},t}||_{W_{t-1}^{-1}}^{2}) \end{align*} Où l'on a utilisé le fait que les valeurs propres de $I + xx^{\top}$ valent 1 sauf une qui vaut $1+||x||^{2}$ et correspond au vecteur propre $x$. Etant donné que par hypothèse $\lambda > \max(1,2L^{2})$, on a: \begin{equation*} ||\mu_{i_{t}}-\check{\epsilon}_{i_{t},t}||_{W_{t}^{-1}}^{2} \leq ||x||^{2}/\lambda \leq 2L^{2}/ \lambda \leq 1 \end{equation*} Donc en utilisant le fait que $x\leq 2\log(1+x)$ lorsque $1 \leq x \leq 1$, on obtient: \begin{align*} 2\log\left(\dfrac{det(W_{T})}{det(\lambda I)}\right) &\geq \sum\limits_{t=1}^{T} \dfrac{1}{R_{i_{t},t}}||\mu_{i_{t}}-\check{\epsilon}_{i_{t},t}||_{W_{t-1}^{-1}}^{2} \\ &\geq \min\limits_{t=1..T}\left(\dfrac{1}{R_{i_{t},t}}\right) \sum\limits_{t=1}^{T} ||\mu_{i_{t}}-\check{\epsilon}_{i_{t},t}||_{W_{t-1}^{-1}}^{2}\\ &\geq 1/\sqrt{R^{2}+L^{2}S^{2}} \sum\limits_{t=1}^{T} ||\mu_{i_{t}}-\check{\epsilon}_{i_{t},t}||_{W_{t-1}^{-1}}^{2} \end{align*} Comme dans le lemme 11 de \cite{OFUL} on a également: \begin{align*} \log\left(\dfrac{det(W_{T})}{det(\lambda I)}\right) \leq d \log\left( 1 + \dfrac{TL^{2}}{\lambda d} \right) \end{align*} Ce qui nous donne: \begin{align*} \sum\limits_{t=1}^{T} ||\mu_{i_{t}}-\check{\epsilon}_{i_{t},t}||_{W_{t-1}^{-1}}^{2} \leq \sqrt{R^{2}+L^{2}S^{2}} d \log\left( 1 + \dfrac{TL^{2}}{\lambda d} \right) \end{align*} Finalement comme dans le lemme 10 de \cite{OFUL}, l'inégalité trace-téterminant donne: \begin{align*} \alpha_{T}\leq \sqrt{d\log\left(\dfrac{1+TL^{2}/\lambda}{\delta}\right)} + \sqrt{\lambda}S \end{align*} En rassemblant ces résultats, on arrive à la borne générique proposée dans le théorème. \subsection{Preuve du théorème \ref{RegretSamplLinUCBDiffCases}} \subsubsection{Cas 1:} \label{preuveRegSampLinUCBCas1} D'une part, on a: \begin{align*} \sum\limits_{t=1}^{T} \dfrac{1}{n_{i_{t},t}} = \sum\limits_{t=1}^{T} \dfrac{1}{t} \leq 1+ \log(T) \end{align*} Et d'autre part: \begin{align*} \sum\limits_{t=1}^{T} \dfrac{1}{\sqrt{n_{i_{t},t}}} = \sum\limits_{t=1}^{T} \dfrac{1}{\sqrt{t}} \leq \int_0^T \dfrac{1}{\sqrt{t}} \, \mathrm dt \leq 2\sqrt{T} \end{align*} En introduisant ces deux résultats dans la borne du théorème \ref{RegretSamplLinUCBDiffCases} et en remarquant que le terme dominant vient de $\sqrt{T}$, on arrive au résultat annoncé. \subsubsection{Cas 2:} \label{preuveRegSampLinUCBCas2} \begin{lem} \label{lem6} $ \forall i, \forall t \geq \ceil{2\log(1/\delta)/p^{2}}$,avec une probabilité au moins égale à $1-\delta$: \begin{equation*} n_{i,t} \geq \dfrac{tp}{2} \end{equation*} \end{lem} \begin{preuve} En Hoeffding, pour tout $\epsilon>0$: \begin{equation*} \mathbb{P}(n_{i,t} \geq tp -\epsilon) \geq 1- e^{-2\epsilon^{2}/t} \end{equation*} En prenant $\epsilon = tp/2$ on arrive à \begin{equation*} \mathbb{P}(n_{i,t} \geq tp/2) \geq 1- e^{-tp^{2}/2} \end{equation*} Si $t \geq 2\log(1/\delta)/p^{2}$, alors $1- e^{-tp^{2}/2} \geq 1-\delta$, ce qui prouve le lemme. Dans la suite on note $u=ceil(2\log(1/\delta)/p^{2})$. \end{preuve} \textbf{Preuve principale:} D'une part grâce au lemme \ref{lem6}, avec une probabilité au moins égale à $1-\delta$: \begin{align*} \sum\limits_{t=1}^{T} \dfrac{1}{n_{i_{t},t}}& = \sum\limits_{t=1}^{u}\dfrac{1}{n_{i_{t},t}} +\sum\limits_{t=u+1}^{T}\dfrac{1}{n_{i_{t},t}} \\ &\leq u + \dfrac{2}{p}\sum\limits_{t=u+1}^{T} \dfrac{1}{t}\\ &\leq u + \dfrac{2}{p} \int_u^T \dfrac{1}{t} \, \mathrm dt\\ &\leq u + \dfrac{2\log(T)}{p} \end{align*} D'autre part, toujours grâce au lemme \ref{lem6}, avec une probabilité au moins égale à $1-\delta$: \begin{align*} \sum\limits_{t=1}^{T} \dfrac{1}{\sqrt{n_{i_{t},t}}} &=\sum\limits_{t=1}^{u}\dfrac{1}{\sqrt{n_{i_{t},t}}} +\sum\limits_{t=u+1}^{T}\dfrac{1}{\sqrt{n_{i_{t},t}}}\\ & \leq u + \sqrt{\dfrac{2}{p}}\sum\limits_{t=u+1}^{T} \dfrac{1}{\sqrt{t}}\\ &\leq u + \sqrt{\dfrac{2}{p}} \int_u^T \dfrac{1}{\sqrt{t}} \, \mathrm dt \\ &\leq u + 2\sqrt{\dfrac{2T}{p}} \end{align*} En utilisant la borne générique du théorème \ref{RegretSamplLinUCBDiffCases} on arrive au résultat annoncé. \subsubsection{Cas 3:} \label{preuveRegSampLinUCBCas3} On décompose $T=\floor{n/K}K+r$ avec $r<K$. La somme $\sum\limits_{t=1}^{T} \dfrac{1}{n_{i_{t},t}}$ est maximale quand chaque bras est observé exactement $\floor{T/K}$ fois pendant les $\floor{T/K}K$ premières itérations. Donc: \begin{align*} \sum\limits_{t=1}^{T} \dfrac{1}{n_{i_{t},t}} &\leq \sum\limits_{i=1}^{K}\sum\limits_{t=1}^{\floor{T/K}+1} \dfrac{1}{t}\\ & \leq K\sum\limits_{t=1}^{\ceil{T/K}}\dfrac{1}{t}\\ &\leq 1+ \log(\ceil{T/K}) \end{align*} Avec le même argument on arrive à: \begin{align*} \sum\limits_{t=1}^{T} \dfrac{1}{\sqrt{n_{i_{t},t}}} &\leq K\sum\limits_{t=1}^{\ceil{T/K}}\dfrac{1}{\sqrt{t}}\\ &\leq 2K\sqrt{\ceil{T/K}} \end{align*} Finalement, en remarquant que $K\log(\ceil{T/K}) \sim K\log(n/K)$ et $K\sqrt{\ceil{T/K}} \sim \sqrt{Kn}$ et en utilisant la borne générique du théorème \ref{RegretSamplLinUCBDiffCases} on prouve le résultat annoncé. \subsection{Preuve du théorème \ref{RegretSamplLinUCBGenericMult}} \label{preuveRegSampLinUCBCasMP} On suit une démarche similaire à celle présentée dans \cite{banditCtxtCombLinUCB} pour le cas particulier de la somme: étant donné que l'on considère que la récompense d'un ensemble de bras est égale à la somme des récompenses individuelles qui le compose, on a: \begin{equation*} reg_{t}=\sum\limits_{i\in\mathcal{K}^{\star}}\mu_{i}^{\top}\beta-\sum\limits_{i\in\mathcal{K}_{t}}\mu_{i}^{\top}\beta \end{equation*} Avec $\mathcal{K}^{\star}$ l'ensemble des $k$ actions optimales, c.-à-d. ayant les plus grandes valeurs $\mu_{i}^{\top}\beta$. On utilise ensuite le fait que pour tout $t$: \begin{equation*} \sum\limits_{i \in \mathcal{K}_{t}} s_{i,t} \geq \sum\limits_{i \in \mathcal{K}_{\star}} s_{i^{\star},t} \end{equation*} Ce qui conduit à: \begin{equation*} reg_{t} \leq \sum\limits_{i \in \mathcal{K}_{t}} 2\alpha_{t-1}||\hat{x}_{i,t}||_{V_{t-1}^{-1}} + 4\sqrt{d}(\alpha_{t-1}/\sqrt{\lambda}+S)\rho_{i,t,\delta} \end{equation*} Où la matrice $V_{t-1}$ est définie en considérant les $k$ exemples d'apprentissage disponibles à chaque itération: $V_{t-1}=\lambda I+ \sum\limits_{s=1}^{t-1}\sum\limits_{i \in \mathcal{K}_{s}} \dfrac{1}{R_{i,t}}\hat{x}_{i,t}\hat{x}_{i,t}^{\top}$. Le fait que l'on ajoute $k$ terme à la matrice $V$ à chaque itération, se traduit deux façon distinctes: \begin{itemize} \item D'une part sur l'ellipsoide de confiance associée au paramètre $\beta$. Dans ce cas, on a: $\alpha_{T}\leq \sqrt{d\log\left(\dfrac{1+kTL^{2}/\lambda}{\delta}\right)} + \sqrt{\lambda}S$; \item D'autre part dans la majoration de $\sum\limits_{t=1}^{T}\sum\limits_{i_{t} \in \mathcal{K}_{t} } ||\mu_{i_{t}}-\check{\epsilon}_{i_{t},t}||_{W_{t-1}^{-1}}^{2}$. On a: $\sum\limits_{t=1}^{T} \sum\limits_{i_{t} \in \mathcal{K}_{t} } ||\mu_{i_{t}}-\check{\epsilon}_{i_{t},t}||_{W_{t-1}^{-1}}^{2} \leq \sqrt{R^{2}+L^{2}S^{2}} d \log\left( 1 + \dfrac{TkL^{2}}{\lambda d}\right)$ \end{itemize} En utilisant ensuite les mêmes méthodes que précédemment, le regret cumulé prend une forme similaire, oùles $k$ actions sélectionnées à chaque itération apparaissent de façon explicite dans les deux termes: $\sum\limits_{t=1}^{T} \sum\limits_{i \in \mathcal{K}_{t}}\dfrac{1}{n_{i,t}}$ et $\sum\limits_{t=1}^{T} \sum\limits_{i \in \mathcal{K}_{t}}\dfrac{1}{\sqrt{n_{i,t}}}$. \section{Distributions variationnelles pour le modèle contextuel et l'algorithme \texttt{HiddenLinUCB}} \label{PreuveVarContextual} On rappelle dans un premier temps les notations utilisées: \begin{itemize} \item Pour tout $i$, l'ensemble des itérations jusqu'au temps $t-1$ telles que $i$ a été sélectionné en ayant eu un contexte observé est noté $\mathcal{A}_{i,t-1}=\left\{s \text{ tel que } 1\leq s\leq t-1 \text{ et } i\in \mathcal{K}_{s}\cap\mathcal{O}_{s} \right\}$; \item Pour tout $i$, l'ensemble des itérations jusqu'au temps $t-1$ telles que $i$ a été sélectionné sans avoir eu un contexte observé est noté $\mathcal{B}_{i,t-1}=\left\{s \text{ tel que } 1\leq s\leq t-1 \text{ et } i\in \mathcal{K}_{s}\cap\bar{\mathcal{O}_{s}} \right\}$; \item Pour tout $i$, l'ensemble des itérations jusqu'au temps $t-1$ telles que le contexte de $i$ a été observé est noté $\mathcal{C}_{i,t-1}=\left\{s \text{ tel que } 1\leq s\leq t-1 \text{ et } i\in \mathcal{O}_{s} \right\}$; \end{itemize} Dans cette section, nous fournissons les preuves des ditributions variationnelles des différentes varibales aléatoires du modèle. Commençons par écrire la probabilité jointe du modèle complet, qui nous sevira ensuite dans chacun des cas. Celle ci s'écrit de la façon suivante: \begin{align*} p\left(\underbrace{\beta, (\mu_{i})_{i=1..K}, (\tau_{i})_{i=1..K}, (x_{i,s})_{i=1..K,s\in \mathcal{B}_{i,t-1}}}_{Z} \underbrace{(r_{i,s})_{i=1..K, s\in \mathcal{A}_{i,t-1}\cup\mathcal{B}_{i,t-1}},(x_{i,s})_{i=1..K,s \in \mathcal{C}_{i,t-1}}}_{X}\right) \end{align*} $Z$ représente les variables cachées tandis que $X$ représente les variables observées. On rappelle de plus que l'on utilise la factorisation suivante pour les distributions des variables cachées: \begin{align*} q(\beta, (\mu_{i})_{i=1..K}, (\tau_{i})_{i=1..K}, (x_{i,s})_{i=1..K,s\in \mathcal{B}_{i,t-1}}=q_{\beta}(\beta)\prod\limits_{i=1}^{K}\left(q_{\mu_{i}}(\mu_{i})q_{\tau_{i}}(\tau_{i})\prod\limits_{s\in \mathcal{B}_{i,t-1}}q_{x_{i,s}}(x_{i,s})\right) \end{align*} \subsection{Preuve de la proposition \ref{distribVarBeta}} \label{PreuveVarContextualBeta} Dans cette preuve, on désigne par $C$ les termes qui ne dépendent pas de $\beta$. La distribution variationnelle $q_{\beta}^{\star}(\beta)$ de $\beta$ est déterminée en utilisant: \begin{align*} \log q_{\beta}^{\star}(\beta)=\mathbb{E}_{\beta^{\backslash}}[\log p(Z,X)] \end{align*} où $\mathbb{E}_{\beta^{\backslash}}$ désigne l'espérance prise selon toutes les variables sauf $\beta$. \begin{align*} \log q_{\beta}^{\star}(\beta)&=\mathbb{E}_{\beta^{\backslash}}[\log p((r_{i,s})_{i=1..K, s\in \mathcal{A}_{i,t-1}\cup\mathcal{B}_{i,t-1}} | \beta, (x_{i,s})_{i=1..K,s\in \mathcal{A}_{i,t-1}}, (x_{i,s})_{i=1..K,s\in \mathcal{B}_{i,t-1}} )+\log p(\beta)]+C\\ &=-\dfrac{1}{2}\mathbb{E}_{\beta^{\backslash}}\left[\sum\limits_{i=1}^{K} \left[\sum\limits_{s\in \mathcal{A}_{i,t-1}} (r_{i,s}-x_{i,s}^{\top}\beta)^{2} + \sum\limits_{s\in \mathcal{B}_{i,t-1}} (r_{i,s}-x_{i,s}^{\top}\beta)^{2}\right] +\beta^{\top}\beta\right] +C\\ &=-\dfrac{1}{2} \mathbb{E}_{\beta^{\backslash}}\left[\beta^{\top}\left(I+\sum\limits_{i=1}^{K} \left[ \sum\limits_{s\in \mathcal{A}_{i,t-1}}x_{i,s}x_{i,s}^{\top} +\sum\limits_{s\in \mathcal{B}_{i,t-1}} x_{i,s}x_{i,s}^{\top} \right]\right)\beta -2\beta^{\top}\left(\sum\limits_{i=1}^{K}\left[ \sum\limits_{s\in \mathcal{A}_{i,t-1}}x_{i,s}r_{i,s} +\sum\limits_{s\in \mathcal{B}_{i,t-1}}x_{i,s}r_{i,s} \right]\right) \right] +C \end{align*} En prenant l'espérance selon les $x_{i,s}$ lorsque $s\in \mathcal{B}_{i,t-1}$ (qui sont les seules VA autres que $\beta$ présentes dans cette expression), et en posant: $V_{t-1}=I+\sum\limits_{i=1}^{K} \left[ \sum\limits_{s\in \mathcal{A}_{i,t-1}}x_{i,s}x_{i,s}^{\top} +\sum\limits_{s\in \mathcal{B}_{i,t-1}} \mathbb{E}[x_{i,s}x_{i,s}^{\top}] \right]$ $\hat{\beta}_{t-1}=V_{t-1}^{-1}\left(\sum\limits_{i=1}^{K}\left[ \sum\limits_{s\in \mathcal{A}_{i,t-1}}x_{i,s}r_{i,s} +\sum\limits_{s\in \mathcal{B}_{i,t-1}} \mathbb{E}[x_{i,s}]r_{i,s} \right]\right)$ On obtient: \begin{align*} \log q_{\beta}^{\star}(\beta)&= -\dfrac{1}{2}(\beta-\hat{\beta}_{t-1})^{\top}V_{t-1}(\beta-\hat{\beta}_{t-1}) +C \end{align*} Ceci correspond à une distribution gaussienne multidimensionnelle de moyenne $\hat{\beta}_{t-1}$ et de matrice de covariance $V_{t-1}^{-1}$. \subsection{Preuve de la proposition \ref{distribVarXit}} \label{PreuveVarContextualXit} Soit une action $i$ et $s\in \mathcal{B}_{i,t-1}$. Dans cette preuve, on désigne par $C$ les termes qui ne dépendent pas de $x_{i,s}$. La distribution variationnelle $q_{x_{i,s}}^{\star}(x_{i,s})$ de $x_{i,s}$ est déterminée en utilisant: \begin{align*} \log q_{x_{i,s}}^{\star}=\mathbb{E}_{x_{i,s}^{\backslash}}[\log p(Z,X)] \end{align*} où $\mathbb{E}_{x_{i,s}^{\backslash}}$ désigne l'espérance prise selon toutes les variables sauf $x_{i,s}$. \begin{align*} \log q_{x_{i,s}}^{\star}(x_{i,s})&=\mathbb{E}_{x_{i,s}^{\backslash}}[\log p(r_{i,s} | \beta,x_{i,s})+\log p(x_{i,s}|\mu_{i},\tau_{i})]+C\\ &=-\dfrac{1}{2}\mathbb{E}_{x_{i,s}^{\backslash}}\left[(r_{i,s}-x_{i,s}^{\top}\beta)^{2} +\tau_{i}(x_{i,s}-\mu_{i})^{\top}(x_{i,s}-\mu_{i})\right] +C\\ &=-\dfrac{1}{2}\mathbb{E}_{x_{i,s}^{\backslash}}\left[x_{i,s}^{\top}(\beta\beta^{\top}+\tau_{i}I)x_{i,s}-2x_{i,s}^{\top}(\beta r_{i,s}+\mu_{i}\tau_{i})\right] +C\\ \end{align*} En prenant l'espérance selon les $\beta$, $\mu_{i}$ et $\tau_{i}$ lorsque $s\in \mathcal{B}_{i,t-1}$ (qui sont les seules VA autres que $x_{i,s}$ présentes dans cette expression), et en posant: $W_{i,s}= \mathbb{E}[\beta\beta^{\top}]+\mathbb{E}[\tau_{i}]I$ $\hat{x}_{i,s}=W_{i,s}^{-1}(\mathbb{E}[\beta]r_{i,s}+\mathbb{E}[\tau_{i}]\mathbb{E}[\mu_{i}])$ On obtient: \begin{align*} \log q_{x_{i,s}}^{\star}(x_{i,s})&=-\dfrac{1}{2}(x_{i,s}-\hat{x}_{i,s})^{\top}W_{i,s}(x_{i,s}-\hat{x}_{i,s}) +C \end{align*} Ceci correspond à une distribution gaussienne multidimensionnelle de moyenne $\hat{x}_{i,s}$ et de matrice de covariance $W_{i,s}^{-1}$. \subsection{Preuve de la proposition \ref{distribVarMui}} \label{PreuveVarContextualMui} Soit $i$ une action. Dans cette preuve, on désigne par $C$ les termes qui ne dépendent pas de $\mu_{i}$. La distribution variationnelle $q_{\mu_{i}}^{\star}(\mu_{i})$ de $\mu_{i}$ est déterminée en utilisant: \begin{align*} \log q_{\mu_{i}}^{\star}(\mu_{i})=\mathbb{E}_{\mu_{i}^{\backslash}}[\log p(Z,X)] \end{align*} où $\mathbb{E}_{\mu_{i}^{\backslash}}$ désigne l'espérance prise selon toutes les variables sauf $\mu_{i}$. \begin{align*} \log q_{\mu_{i}}^{\star}(\mu_{i})&=\mathbb{E}_{\mu_{i}^{\backslash}}[\log p((x_{i,s})_{s\in \mathcal{C}_{i,t-1}},(x_{i,s})_{s\in \mathcal{B}_{i,t-1}}|\mu_{i},\tau_{i})+\log p(\mu_{i}|\tau_{i})]+C\\ &=-\dfrac{1}{2}\mathbb{E}_{\mu_{i}^{\backslash}}\left [\sum\limits_{s\in \mathcal{C}_{i,t-1}}\tau_{i}(x_{i,s}-\mu_{i})^{\top}(x_{i,s}-\mu_{i})+\sum\limits_{s\in \mathcal{B}_{i,t-1}}\tau_{i}(x_{i,s}-\mu_{i})^{\top}(x_{i,s}-\mu_{i}) +\tau_{i}\mu_{i}^{\top}\mu_{i} \right]+C\\ &=-\dfrac{1}{2}\mathbb{E}_{\mu_{i}^{\backslash}}\left [\tau_{i}\left(\mu_{i}^{\top}\mu_{i} +\sum\limits_{s\in \mathcal{C}_{i,t-1}} \mu_{i}^{\top}\mu_{i} +\sum\limits_{s\in \mathcal{B}_{i,t-1}} \mu_{i}^{\top}\mu_{i} -2\mu_{i}^{\top}\left(\sum\limits_{s\in \mathcal{C}_{i,t-1}}x_{i,s}+\sum\limits_{s\in \mathcal{B}_{i,t-1}}x_{i,s}\right) \right) \right]+C\\ &=-\dfrac{1}{2}\mathbb{E}_{\mu_{i}^{\backslash}}\left [\tau_{i}\left(\mu_{i}^{\top}\mu_{i}(1+n_{i,t-1})-2\mu_{i}^{\top}\left(\sum\limits_{s\in \mathcal{C}_{i,t-1}}x_{i,s}+\sum\limits_{s\in \mathcal{B}_{i,t-1}}x_{i,s}\right) \right) \right]+C\\ \end{align*} Avec $n_{i,t-1}=|\mathcal{B}_{i,t-1}|+|\mathcal{C}_{i,t-1}|$. On a donc: \begin{align*} \log q_{\mu_{i}}^{\star}(\mu_{i})&=-\dfrac{1}{2}\mathbb{E}_{\mu_{i}^{\backslash}}\left [\tau_{i}(1+n_{i,t-1})\left(\mu_{i}^{\top}\mu_{i}-2\mu_{i}^{\top}\left(\dfrac{\sum\limits_{s\in \mathcal{C}_{i,t-1}}x_{i,s}+\sum\limits_{s\in \mathcal{B}_{i,t-1}}x_{i,s}}{1+n_{i,t-1}}\right) \right) \right]+C\\ \end{align*} En prenant l'espérance selon les $x_{i,s}$ lorsque $s\in \mathcal{B}_{i,t-1}$ et $\tau_{i}$ (qui sont les seules VA autres que $\mu_{i}$ présentes dans cette expression), et en posant: $\Sigma_{i,t-1}= (1+n_{i,t-1})E[\tau_{i}]I$ $\hat{\mu}_{i,t-1}=\dfrac{\sum\limits_{s\in \mathcal{C}_{i,t-1}}x_{i,s} +\sum\limits_{s\in \mathcal{B}_{i,t-1}} \mathbb{E}[x_{i,s}]}{1+n_{i,t-1}}$ On obtient: \begin{align*} \log q_{\mu_{i}}^{\star}(\mu_{i})&= -\dfrac{1}{2}(\mu_{i}-\hat{\mu}_{i,t-1})^{\top}\Sigma_{i,t-1}(\mu_{i}-\hat{\mu}_{i,t-1}) +C \end{align*} Ceci correspond à une distribution gaussienne multidimensionnelle de moyenne $\hat{\mu}_{i,t-1}$ et de matrice de covariance $\Sigma_{i,t-1}^{-1}$. \subsection{Preuve de la proposition \ref{distribVarTaui}} \label{PreuveVarContextualTaui} Soit $i$ une action. Dans cette preuve, on désigne par $C$ les termes qui ne dépendent pas de $\tau_{i}$. La distribution variationnelle $q_{\tau_{i}}^{\star}(\tau_{i})$ de $\tau_{i}$ est déterminée en utilisant: \begin{align*} \log q_{\tau_{i}}^{\star}(\tau_{i})=\mathbb{E}_{\tau_{i}^{\backslash}}[\log p(Z,X)] \end{align*} où $\mathbb{E}_{\tau_{i}^{\backslash}}$ désigne l'espérance prise selon toutes les variables sauf $\tau_{i}$. \begin{align*} \log q_{\tau_{i}}^{\star}(\tau_{i})&=\mathbb{E}_{\tau_{i}^{\backslash}}[\log p((x_{i,s})_{s\in \mathcal{C}_{i,t-1}},(x_{i,s})_{s\in \mathcal{B}_{i,t-1}}|\mu_{i},\tau_{i})+\log p(\mu_{i}|\tau_{i})+\log p(\tau_{i})]+C\\ \end{align*} On rappelle que $p(\tau_{i})$ correspond à la loi gamma de paramètres $b_{0}$ et $b_{0}$, qui a pour densité: $p(\tau_{i})=\dfrac{b_{0}^{b_{0}}\tau_{i}^{a_{0}-1}e^{-\tau_{i}b_{0}}}{\Gamma(a_{0})}$, où $\Gamma(a_{0})$ est la constante de normalisation. Par ailleurs, $\tau_{i}$ apparaît dans la densité des loi gaussiennes en dehors de l'exponentielle. En effet pour une loi gaussienne de dimension $d$, de moyenne $m$ et de matrice de covariance $\tau_{i} I$, la densité en $x$ vaut: $f(x;m,\alpha)=\dfrac{\tau_{i}^{d/2}}{(2\pi)^{d/2}}e^{-\tau_{i}/2(x-m)^{\top}(x-m)}$. On a donc: \begin{multline*} \log q_{\tau_{i}}^{\star}(\tau_{i}) = \mathbb{E}_{\tau_{i}^{\backslash}}\left [-\dfrac{1}{2}\left(\sum\limits_{s\in \mathcal{C}_{i,t-1}}\tau_{i}(x_{i,s}-\mu_{i})^{\top}(x_{i,s}-\mu_{i})+\sum\limits_{s\in \mathcal{B}_{i,t-1}}\tau_{i}(x_{i,s}-\mu_{i})^{\top}(x_{i,s}-\mu_{i}) +\tau_{i}\mu_{i}^{\top}\mu_{i} \right) \right.\\ \left. +\sum\limits_{s\in \mathcal{C}_{i,t-1}} \dfrac{d}{2}\log \tau_{i} +\sum\limits_{s\in \mathcal{B}_{i,t-1}} \dfrac{d}{2}\log \tau_{i} + \dfrac{d}{2}\log \tau_{i} +(a_{0}-1)\log \tau_{i} -b_{0}\tau_{i} \right] +C \end{multline*} \begin{multline*} \log q_{\tau_{i}}^{\star}(\tau_{i}) = \mathbb{E}_{\tau_{i}^{\backslash}}\left [ -\dfrac{\tau_{i}}{2}\left((n_{i,t-1}+1) \mu_{i}^{\top}\mu_{i}-2\mu_{i}^{\top}(\sum\limits_{s\in \mathcal{C}_{i,t-1}}x_{i,s}+\sum\limits_{s\in \mathcal{B}_{i,t-1}}x_{i,s})+\sum\limits_{s\in \mathcal{C}_{i,t-1}}x_{i,s}^{\top}x_{i,s}+\sum\limits_{s\in \mathcal{B}_{i,t-1}}x_{i,s}^{\top}x_{i,s}\right) \right. \\ \left. +(a_{0}-1)\log \tau_{i} -b_{0}\tau_{i}+\dfrac{d(n_{i,t-1}+1)}{2} \log \tau_{i} \right] +C \end{multline*} En prenant l'espérance selon les $x_{i,s}$ lorsque $s\in \mathcal{B}_{i,t-1}$ et $\mu_{i}$ (qui sont les seules VA autres que $\tau_{i}$ présentes dans cette expression), et en posant: $a_{i,t-1}= a_{0}+\dfrac{d(1+n_{i,t-1})}{2}$ $b_{i,t-1}=b_{0}+\dfrac{1}{2} \left[ (1+n_{i,t-1})\mathbb{E}[\mu_{i}^{\top}\mu_{i}]-2\mathbb{E}[\mu_{i}]^{\top}\left( \sum\limits_{s\in \mathcal{C}_{i,t-1}}x_{i,s} + \sum\limits_{s\in \mathcal{B}_{i,t-1}}\mathbb{E}[x_{i,s}] \right) + \sum\limits_{s\in \mathcal{C}_{i,t-1}}x_{i,s}^{\top}x_{i,s} + \sum\limits_{s\in \mathcal{B}_{i,t-1}}\mathbb{E}[x_{i,s}^{\top}x_{i,s}] \right] $ \begin{align*} \log q_{\tau_{i}}^{\star}(\tau_{i})&= (a_{i,t-1}-1 )\log \tau_{i}-b_{i,t-1}\tau_{i}+C \end{align*} Ceci correspond à une distribution gamma de paramètres $a_{i,t-1}$ et $b_{i,t-1}$. \section{Distributions variationnelles pour les modèles récurrents et l'algorithme \texttt{Recurrent TS}} \label{PreuveRelational} \subsection{Modèle relationnel} \label{relationnalLinearProof} \textbf{Note importante} pour simplifier les notations on n'incorpore pas le terme de biais dans cette démonstration. Cependant les résultats sont directement transposables en ajoutant un terme constant égal à 1 à la fin de chaque vecteur de récompense. Etant donné un ensemble de $K$ bras, on rappelle les hypothèses: \begin{itemize} \item \textbf{Vraisemblance : } $\forall i \in \left\{1,...,K\right\}, \exists \theta_{i} \in \mathbb{R}^{K} ~\text{tel que}~ \forall t \in \left\{2,...,T\right\}$: $r_{i,t}=\theta_{i}^{\top}R_{t-1} + \epsilon_{i,t}$, où $\epsilon_{i,t} \sim \mathcal{N}(0,\sigma^{2})$ (bruit gaussien de moyenne $0$ et de variance $\sigma^{2}$). \item \textbf{Prior sur les paramètres: } $\forall i \in \left\{1,...,K\right\}$: $\theta_{i} \sim \mathcal{N}(0,\alpha^{2}I)$ (bruit gaussien de dimension $K$, de moyenne $0$ et de matrice de covariance $\alpha^{2}I$). \item \textbf{Prior sur $R_{1}$ : } $R_{1} \sim \mathcal{N}(\mu,\sigma^{2}I)$ où $\mu \in \mathbb{R}^{K}$ ($\forall i \in \left\{1,...,K\right\}$: $r_{i,1} \sim \mathcal{N}(\mu_{i},\sigma^{2})$). \end{itemize} La distribution jointe des différentes variables du modèle est la suivante: \begin{align*} p\left(\underbrace{(\theta_{i})_{i=1..K}, (r_{i,s})_{i=1..K,i\notin \mathcal{K}_{s},s=1..t-1}}_{Z}, \underbrace{(r_{i,s})_{i=1..K,i\in \mathcal{K}_{s},s=1..t-1}}_{X}\right) \end{align*} où $Z$ représente les variables cachées et $X$ les variables observées. Notre but est de déterminer les distributions variationnelles des différentes variables cachées selon la factorisation suivante: \begin{align*} q\left((\theta_{i})_{i=1..K}, (r_{i,s})_{i=1..K,i\notin \mathcal{K}_{s},s=1..t-1}\right)=\prod_{i=1}^{K}q(\theta_{i})\prod_{s=1}^{t-1}\prod_{i=1, i\notin \mathcal{K}_{s}}^{K} q(r_{i,s}) \end{align*} \subsubsection{Paramètres} \label{proofLin1Params} Pour $t\geq 3$ , on note $D_{t-1}=(R_{s}^{\top})_{s=1..t-1}$ la matrice de taille $(t-1)\times (K+1)$ où la ligne $s$ correspond au vecteur de récompense au temps $s$, $D_{1..t-2}$ la matrice de taille $(t-2)\times K$ composée des $t-2$ premières lignes de $D_{t-1}$ et $D_{i:2..t-1}$ le vecteur de taille $t-2$ correspondant à la colonne $i$ et les $t-2$ dernières lignes de $D_{t-1}$ (c.-à-d. le vecteur de récompenses du bras $i$ du temps $1$ au temps $t-2$). La distribution variationnelle $q_{\theta_{i}}^{\star}(\theta_{i})$ de $\theta_{i}$ est déterminée de la façon suivante: \begin{align*} \log q_{\theta_{i}}^{\star}(\theta_{i})&=\mathbb{E}_{\theta_{i}^{\backslash}}[\log p(Z,X)]\\ &=\mathbb{E}_{\theta_{i}^{\backslash}}\left[-\dfrac{1}{2\sigma^{2}}\sum\limits_{v=1}^{t-2} ( r_{i,v+1} - \theta_{i}^{\top}R_{v} )^{2} -\dfrac{1}{2\alpha^{2}}\theta_{i}^{\top} \theta_{i}\right] +C\\ &=\mathbb{E}_{\theta_{i}^{\backslash}}\left[-\dfrac{1}{2\sigma^{2}} (D_{i:2..t-1} - D_{1..t-2} \theta_{i} )^{\top} (D_{i:2..t-1} - D_{1..t-2} \theta_{i}) -\dfrac{1}{2\alpha^{2}} \theta_{i}^{\top} \theta_{i} \right] +C\\ &=\mathbb{E}_{\theta_{i}^{\backslash}}\left[ -\dfrac{1}{2}\left( \theta_{i}^{\top}( \dfrac{D_{1..t-2}^{\top}D_{1..t-2}}{\sigma^{2}} + \dfrac{I}{\alpha^{2}})\theta_{i} -2 \theta_{i}^{\top} \dfrac{D_{1..t-2}^{\top} D_{i:2..t-1} }{\sigma^{2}} \right)\right] +C\\ \end{align*} En prenant l'espérance selon les paramètres les récompenses n'ayant pas été observées, et en posant: $A_{i,t-1}=\dfrac{\mathbb{E}[D_{1..t-2}^{\top}D_{1..t-2}]}{\sigma^{2}}+\dfrac{I}{\alpha^{2}}$ $b_{i,t-1}=\dfrac{\mathbb{E}[D_{1..t-2}^{\top}]}{\sigma^{2}}\mathbb{E}[D_{i:2..t-1}]$ On obtient: $\log q_{\theta_{i}}^{\star}(\theta_{i})=-\dfrac{1}{2}( \theta_{i} - A_{i,t-1}^{-1}b_{i,t-1})^{\top}A_{i,t-1}(\theta_{i} - A_{i,t-1}^{-1}b_{i,t-1})+C$ Ce qui correspond à une distribution gaussienne de moyenne $A_{i,t-1}^{-1}b_{i,t-1}$ et de matrice de covariance $A_{i,t-1}^{-1}$. \subsubsection{Récompenses} \label{proofLin1Rwds} On note $\Theta=(\theta_{i}^{\top})_{i=1..K}$ la matrice de taille $K \times K$ dont la ligne $i$ vaut $\theta_{i}$ et on note $\beta_{i}$ la colonne $i$ de $\Theta$. On fixe $i \in \left\{1,...,K\right\}$ et $s \in \left\{1,...,t-1\right\}$ pour $t\geq 2$. Le cas $t=1$ ne nécessite pas de traitement particulier puisque il s'agit de la distribution du prior. On étudie les trois distributions suivante pour $r_{i,s}$ en fonction cas suivants selon la valeur de $s$. \begin{itemize} \item \textbf{Cas 1: $1<s<t-1$} La distribution variationnelle $q_{r_{i,s}}^{\star}(r_{i,s})$ de $r_{i,s}$ est déterminée de la façon suivante: \begin{align*} \log q_{r_{i,s}}^{\star}(r_{i,s})&=\mathbb{E}_{r_{i,s}^{\backslash}}[\log p(Z,X)]\\ &=\mathbb{E}_{r_{i,s}^{\backslash}}\left[\log p( (r_{j,s+1})_{j=1..K} | (r_{j,s})_{j=1..K} , (\theta_{j})_{j=1..K})+ \log p(r_{i,s} | (r_{j,s-1})_{j=1..K}, (\theta_{j})_{j=1..K} )\right] +C\\ &=\mathbb{E}_{r_{i,s}^{\backslash}}\left[\sum\limits_{j=1}^{K} \log p( r_{j,s+1} | (r_{l,s})_{l=1..K} , \theta_{j}) +\log p(r_{i,s} | (r_{l,s-1})_{l=1..K}, \theta_{i})\right] +C\\ &=-\dfrac{1}{2\sigma^{2}}\mathbb{E}_{r_{i,s}^{\backslash}}\left[\sum\limits_{j=1}^{K} \left( r_{j,s+1} - \sum\limits_{l=1}^{K}\theta_{j,l}r_{l,s} \right)^{2} + \left( r_{i,s} - \sum\limits_{l=1}^{K}\theta_{i,l}r_{l,s-1} \right)^{2} \right] +C\\ \end{align*} où $C$ désigne tout terme qui ne dépend pas de $r_{i,s}$. On note $A=\sum \limits_{j=1}^{K} \left( r_{j,s+1} - \sum\limits_{l=1}^{K}\theta_{j,l}r_{l,s} \right)^{2}+ \left( r_{i,s} - \sum\limits_{l=1}^{K}\theta_{i,l}r_{l,s-1} \right)^{2}$ En développant le carré, on obtient: \begin{align*} A& =\sum \limits_{j=1}^{K} \theta_{j,i}^{2}r_{i,s}^{2} - 2r_{i,s}\left(\sum \limits_{j=1}^{K}\theta_{j,i} r_{j,s+1} - \sum \limits_{j=1}^{K}\theta_{j,i} \sum\limits_{l=1,l\neq i}^{K} \theta_{j,l}r_{l,s} \right) + r_{i,s}^{2} - 2r_{i,s}\left( \sum\limits_{l=1}^{K} \theta_{i,l}r_{l,s-1} \right) + C\\ &=r_{i,s}^{2}\left(1+ \sum \limits_{j=1}^{K} \theta_{j,i}^{2} \right ) - 2r_{i,s}\left( \sum \limits_{j=1}^{K} \theta_{j,i} r_{j,s+1} - \sum \limits_{j=1}^{K} \theta_{j,i} \sum\limits_{l=1,l\neq i}^{K} \theta_{j,l}r_{l,s} +\sum\limits_{l=1}^{K} \theta_{i,l}r_{l,s-1} \right) + C\\ &=r_{i,s}^{2}\left(1+ \sum \limits_{j=1}^{K} \theta_{j,i}^{2} \right ) - 2r_{i,s}\left( \sum \limits_{j=1}^{K} \theta_{j,i} r_{j,s+1} - \sum\limits_{l=1,l\neq i}^{K} r_{l,s}\sum \limits_{j=1}^{K} \theta_{j,i}\theta_{j,l} +\sum\limits_{l=1}^{K} \theta_{i,l}r_{l,s-1} \right) + C \end{align*} On note $R_{s}=(r_{1,s},...,r_{K,s})^{\top}$, ce qui nous donne: \begin{align*} A&=r_{i,s}^{2}(1+\beta_{i}^{\top}\beta_{i})-2r_{i,s} (\beta_{i}^{\top}R_{s+1} - \sum\limits_{l=1,l\neq i}^{K}r_{l,s} \beta_{i}^{\top}\beta_{l} + \theta_{i}^{\top}R_{s-1})+C\\ & =r_{i,s}^{2}(1+\beta_{i}^{\top}\beta_{i})-2r_{i,s} (\beta_{i}^{\top}R_{s+1} - \beta_{i}^{\top} \sum\limits_{l=1,l\neq i}^{K} \beta_{l}r_{l,s} + \theta_{i}^{\top}R_{s-1})+C\\ \end{align*} En prenant l'espérance selon les paramètres $\theta_{i}$ et les récompenses n'ayant pas été observées sauf $r_{i,s}$, et en posant: $\mu_{i,s}=\dfrac{\mathbb{E}[\beta_{i}]^{\top}\mathbb{E}[R_{s+1}] + \mathbb{E}[\theta_{i}]^{\top}\mathbb{E}[R_{s-1}] - \sum\limits_{l=1,l \neq i}^{K} \mathbb{E}[\beta_{i}^{\top}\beta_{l}]\mathbb{E}[r_{l,s}] }{1+\mathbb{E}[\beta_{i}^{\top}\beta_{i}]}$ $\sigma_{i,s}^{2}=\dfrac{\sigma^{2}}{1+\mathbb{E}[\beta_{i}^{\top}\beta_{i}]}$ On obtient: \begin{align*} \log q_{r_{i,s}}^{\star}(r_{i,s})&=-\dfrac{1}{2\sigma_{i,s}^{2}} \left( r_{i,s} - \mu_{i,s} \right)^{2}+C\\ \end{align*} Ceci correspond à une distribution gaussienne de moyenne $\mu_{i,s}$ et de variance $\sigma_{i,s}^{2}$. \item \textbf{Cas 2: $s=1$} \begin{align*} \log q_{r_{i,s}}^{\star}(r_{i,s})&=\mathbb{E}_{r_{i,s}^{\backslash}}[\log p(Z,X)]\\ &=\mathbb{E}_{r_{i,s}^{\backslash}}\left[\log p((r_{j,s+1})_{j=1..K} | (r_{j,s})_{j=1..K},(\theta_{j})_{j=1..K} ) + \log p(r_{i,s} | \mu_{i}) \right] +C\\ &=-\dfrac{1}{2\sigma^{2}}\mathbb{E}_{r_{i,s}^{\backslash}}\left[\sum\limits_{j=1}^{K} \left( r_{j,s+1} - \sum\limits_{l=1}^{K}\theta_{j,l}r_{l,s} \right)^{2} + \left( r_{i,s} - \mu_{i} \right)^{2} \right] +C\\ \end{align*} On retrouve une forme similaire au cas 1 ci-dessus. En prenant l'espérance selon les paramètres $\theta_{i}$ et les récompenses n'ayant pas été observées sauf $r_{i,s}$, et en posant: $\mu_{i,s}=\dfrac{\mathbb{E}[\beta_{i}]^{\top}\mathbb{E}[R_{s+1}] + \mu_{i} - \sum\limits_{l=1,l \neq i}^{K} \mathbb{E}[\beta_{i}^{\top}\beta_{l}]\mathbb{E}[r_{l,s}] }{1+\mathbb{E}[\beta_{i}^{\top}\beta_{i}]}$ $\sigma_{i,s}^{2}=\dfrac{\sigma^{2}}{1+\mathbb{E}[\beta_{i}^{\top}\beta_{i}]}$ On obtient: \begin{align*} \log q_{r_{i,s}}^{\star}(r_{i,s})&=-\dfrac{1}{2\sigma_{i,s}^{2}} \left( r_{i,s} - \mu_{i,s} \right)^{2}+C\\ \end{align*} Ce qui correspond à une distribution gaussienne de moyenne $\mu_{i,s}$ et de variance $\sigma_{i,s}^{2}$. \item \textbf{Cas 3: $s=t-1$} \begin{align*} \log q_{r_{i,s}}^{\star}(r_{i,s})=\mathbb{E}_{r_{i,s}^{\backslash}}[\log p(Z,X)] =\mathbb{E}_{r_{i,s}^{\backslash}}\left[\log p(r_{i,t} | (r_{j,s-1})_{j=1..K} ,\theta_{i} )\right] +C=-\dfrac{1}{2\sigma^{2}}\mathbb{E}_{r_{i,s}^{\backslash}}\left[ \left( r_{i,s}-\theta_{i}^{\top}R_{s-1}\right)^{2}\right] +C \end{align*} En prenant l'espérance selon les paramètres $\theta_{i}$ et les récompenses n'ayant pas été observées sauf $r_{i,s}$, et en posant: $\mu_{i,s}=\mathbb{E}[\theta_{i}]^{\top}\mathbb{E}[R_{s-1}] $ $\sigma_{i,s}^{2}=\sigma^{2}$ On obtient: $\log q_{r_{i,s}}^{\star}(r_{i,s})=-\dfrac{1}{2\sigma_{i,s}^{2}} \left( r_{i,s} - \mu_{i,s} \right)^{2}+C$ Ce qui correspond à une distribution gaussienne de moyenne $\mu_{i,s}$ et de variance $\sigma_{i,s}^{2}$. \end{itemize} \subsection{Modèle à états cachés} \label{relationnalLinearHiddenProofVar} \begin{itemize} \item \textbf{Vraisemblance 1: } $\exists \Theta \in \mathbb{R}^{d\times d}, \forall t \in \left\{2,...,T\right\}: h_{t}=\Theta h_{t-1} +\epsilon_{t}$, où $\epsilon_{t} \sim \mathcal{N}(0,\delta^{2}I)$. \item \textbf{Vraisemblance 2: } $\forall i \in \left\{1,...,K\right\}, \exists W_{i} \in \mathbb{R}^{d}, \exists b_{i} \in \mathbb{R}$ \text{ tels que }: $\forall t \in \left\{1,...,T\right\}$ : $r_{i,t}=W_{i}^{\top}h_{t}+b_{i}$ $\epsilon_{i,t} \sim \mathcal{N}(0,\sigma^{2})$. \item \textbf{Prior au temps 1: } $h_{1} \sim \mathcal{N}(0,\delta^{2}I)$, où $I$ désigne la matrice identité de taille $d$. \item \textbf{Prior sur les paramètres 1: } $\forall i \in \left\{1,...,d\right\}$: $\theta_{i} \sim \mathcal{N}(0,\alpha^{2}I)$, où $\theta_{i}$ désigne la ligne $i$ de $\Theta$. \item \textbf{Prior sur les paramètres 2: } $\forall i \in \left\{1,...,K\right\}$: $(W_{i}, b_{i}) \sim \mathcal{N}(0,\gamma^{2}I)$, avec $(W_{i}, b_{i})$ le vecteur aléatoire de taille $d+1$ issu de la concaténation de $W_{i}$ et $b_{i}$, et $I$ la matrice identité de taille $d+1$. \end{itemize} Notre but est de déterminer les distributions variationnelles des différentes variables cachées selon la factorisation suivante: \begin{align*} q(h_{1},...,h_{t-1},\Theta,W,b)=\prod\limits_{s=1}^{t-1}q_{h_{s}}(h_{s})\prod\limits_{i=1}^{K}q_{W_{i},b_{i}}(W_{i},b_{i})\prod\limits_{j=1}^{d}q_{\theta_{j}}(\theta_{j}) \end{align*} \subsubsection{Couches cachées} \label{proofLin1HiddenLayerVar} On note $W$ la matrice de taille $K \times d$ dont la ligne $i$ vaut $W_{i}$ et $b$ le vecteur des biais de taille $K$. De plus au temps $s$, la sous-matrice (resp. le sous-vecteur) composée des lignes d'index $i\in \mathcal{K}_{s}$ de $W$ (resp. de $b$) est notée $W_{s}$ (resp. $b_{s}$). Finalement le vecteur de taille $k$ des récompenses observées au temps $s$ est noté $R_{s}$. Soit $1 \leq s \leq t-1$. On s'intéresse au trois cas suivant: \begin{itemize} \item \textbf{Cas 1: $1 < s< t-1$} \begin{align*} \log q_{h_{s}}^{\star} (h_{s})&= \mathbb{E}_{h_{s}^{\backslash}}[ \log p(h_{s+1}|h_{s},\Theta) +\log p(h_{s}|h_{s-1},\Theta)+ \log p(R_{s} |h_{s},W_{s},b_{s})] + C \\ &= \mathbb{E}_{h_{s}^{\backslash}}\left[-\dfrac{1}{2} \left( \dfrac{\left( h_{s+1} - \Theta h_{s} \right)^{\top}\left( h_{s+1} - \Theta h_{s} \right)}{\delta^{2}} + \dfrac{\left( h_{s} - \Theta h_{s-1} \right)^{\top}\left( h_{s} - \Theta h_{s-1} \right)}{\delta^{2}} \right. \right.\\ &\left. \left. \qquad+\dfrac{ \left( R_{s} - (W_{s}h_{s}+b_{s}) \right)^{\top}\left( R_{s} - (W_{s}h_{s}+b_{s} )\right)}{\sigma^{2}} \right) \right] + C\\ &=\mathbb{E}_{h_{s}^{\backslash}}\left[-\dfrac{1}{2} \left( h_{s}^{\top}\left( \dfrac{I}{\delta^{2}} + \dfrac{\Theta ^{\top}\Theta}{\delta^{2}} + \dfrac{W_{s}^{\top}W_{s}}{\sigma^{2}} \right) h_{s} -2h_{s}^{\top}\left( \dfrac{\Theta h_{s-1}}{\delta^{2}} + \dfrac{\Theta^{\top} h_{s+1}}{\delta^{2}} + \dfrac{W_{s}^{\top}(R_{s}-b_{s})}{\sigma^{2}} \right) \right) \right] + C\\ \end{align*} En utilisant l'indépendance des variables aléatoire selon la partition choisie, on peut exprimer l'expression ci-dessus sous la forme: \begin{align*} \log q_{h_{s}}^{\star} (h_{s})&= -\dfrac{1}{2} \left( h_{s}^{\top}F_{s} h_{s} - 2h_{s}^{\top}g_{s}\right) +C\\ &= -\dfrac{1}{2} (h_{s}-F_{s}^{-1}g_{s})^{\top}F_{s}(h_{s}-F_{s}^{-1}g_{s})+C \end{align*} Avec: $F_{s}=\dfrac{I}{\delta^{2}} + \dfrac{\mathbb{E}[\Theta ^{\top}\Theta]}{\delta^{2}} + \dfrac{\mathbb{E}[W_{s}^{\top}W_{s}]}{\sigma^{2}}$ $g_{s}= \dfrac{\mathbb{E}[\Theta] \mathbb{E}[h_{s-1}]}{\delta^{2}} + \dfrac{\mathbb{E}[W_{s}]^{\top}\mathbb{E}[R_{s}]-\mathbb{E}[W_{s}^{\top}b_{s}]}{\sigma^{2}} +\dfrac{\mathbb{E}[\Theta]^{\top} \mathbb{E}[h_{s+1}]}{\delta^{2}}$ On reconnaît bien une loi gaussienne de moyenne $F_{s}^{-1}g_{s}$ et de matrice de covariance $F_{s}^{-1}$. On remarque de plus que $\Theta ^{\top}\Theta=\sum\limits_{i=1}^{d}\theta_{i} \theta_{i}^{\top}$ d'où $\mathbb{E}[\Theta^{\top}\Theta]=\sum\limits_{i=1}^{d}\mathbb{E}[\theta_{i}\theta_{i}^{\top}]=\sum\limits_{i=1}^{d}\mathbb{E}[\theta_{i}]\mathbb{E}[\theta_{i}]^{\top}+Var(\theta_{i})$. Le même raisonnement est appliqué pour $\mathbb{E}[W_{s}^{\top}W_{s}]$. \item \textbf{Cas 2: $s=1$} On effectue un calcul similaire excepté qu'on ne considère pas d'état caché au temps $s-1$. On trouve ainsi: \begin{align*} \log q_{h_{s}}^{\star} (h_{s})&= -\dfrac{1}{2} \left( h_{s}^{\top}F_{s} h_{s} - 2h_{s}^{\top}g_{s}\right) +C\\ &= -\dfrac{1}{2} (h_{s}-F_{s}^{-1}g_{s})^{\top}F_{s}(h_{s}-F_{s}^{-1}g_{s})+C \end{align*} Avec: $F_{s}=\dfrac{I}{\delta^{2}} + \dfrac{\mathbb{E}[\Theta ^{\top}\Theta]}{\delta^{2}} + \dfrac{\mathbb{E}[W_{s}^{\top}W_{s}]}{\sigma^{2}}$ $g_{s}= \dfrac{\mathbb{E}[\Theta]^{\top} \mathbb{E}[h_{s+1}]}{\delta^{2}} + \dfrac{\mathbb{E}[W_{s}]^{\top}\mathbb{E}[R_{s}]-\mathbb{E}[W_{s}^{\top}b_{s}]}{\sigma^{2}}$ \item \textbf{Cas 3: $s=t-1$} On effectue un calcul simialaire excepté qu'on ne considère pas d'état caché au temps $s+1$. On trouve ainsi: \begin{align*} \log q_{h_{s}}^{\star} (h_{s})&= -\dfrac{1}{2} \left( h_{s}^{\top}F_{s} h_{s} - 2h_{s}^{\top}g_{s}\right) +C\\ &= -\dfrac{1}{2} (h_{s}-F_{s}^{-1}g_{s})^{\top}F_{s}(h_{s}-F_{s}^{-1}g_{s})+C \end{align*} Avec: $F_{s}=\dfrac{I}{\delta^{2}} + \dfrac{\mathbb{E}[W_{s}^{\top}W_{s}]}{\sigma^{2}}$ $g_{s}= \dfrac{\mathbb{E}[\Theta] \mathbb{E}[h_{s-1}]}{\delta^{2}} + \dfrac{\mathbb{E}[W_{s}]^{\top}\mathbb{E}[R_{s}]-\mathbb{E}[W_{s}^{\top}b_{s}]}{\sigma^{2}}$ \end{itemize} \subsubsection{Paramètres $\theta_{i}$} \label{proofLin1HiddenParamsThetaVar} Pour $t\geq 3$, on note $D_{t-1}=(h_{s}^{\top})_{s=1..t-1}$ la matrice de taille $(t-1)\times d$ des états cachés jusqu'au temps $t-1$. On a: \begin{align*} \log q_{\theta_{i}}^{\star} (\theta_{i})&= -\dfrac{1}{2} \left(\theta_{i}-A_{i,t-1}^{-1}b_{i,t-1}\right)^{\top}A_{i,t-1}\left(\theta_{i}-A_{i,t-1}^{-1}b_{i,t-1}\right) +cte\\ \end{align*} Avec: $A_{i,t-1}=\dfrac{\mathbb{E}[D_{1..t-2}^{\top}D_{1..t-2}]}{\sigma^{2}}+\frac{I}{\alpha^{2}}$ $b_{i,t-1}=\dfrac{\mathbb{E}[D_{1..t-2}]^{\top}}{\sigma^{2}}\mathbb{E}[D_{i:2..t-1} ]$ On reconnaît bien une loi gaussienne de moyenne $A_{i,t-1}^{-1}b_{i,t-1}$ et de matrice de covariance $A_{i,t-1}^{-1}$. On remarque de plus que $D_{0..t-2}^{\top}D_{0..t-2}=\sum\limits_{s=0}^{t-2} h_{s}h_{s}^{\top}$ et donc $\mathbb{E}[D_{0..t-2}^{\top}D_{0..t-2}]=\sum\limits_{s=0}^{t-2} \mathbb{E}[h_{s}]\mathbb{E}[h_{s}]^{\top}+Var(h_{s})$. \subsubsection{Paramètres $W$ et $b$} \label{proofLin1HiddenParamsVar} Pour chaque action $i$ on note $\mathcal{T}_{i,t-1}$ l'ensemble des itérations où elle a été choisie jusqu'au temps $t-1$, c'est-à-dire $\mathcal{T}_{i,t-1}=\left\{s \text{ tel que } i\in \mathcal{K}_{s} \text{ pour } 1\leq s\leq t-1\right\}$. On note également $M_{i,t-1}=((h_{s},1)^{\top})_{s\in \mathcal{T}_{i,t-1}}$ et $c_{i,t-1}=(r_{i,s})_{s\in \mathcal{T}_{i,t-1}}$. On a : \begin{align*} \log q_{(W_{i},b_{i})}^{\star} ((W_{i},b_{i}))&= -\dfrac{1}{2} \left((W_{i},b_{i})-V_{i,t-1}^{-1}v_{i,t-1}\right)^{\top}V_{i,t-1}\left((W_{i},b_{i})-V_{i,t-1}^{-1}v_{i,t-1}\right) +cte\\ \end{align*} Avec: $V_{i,t-1}=\dfrac{I}{\gamma^{2}}+\dfrac{\mathbb{E}[M_{i,t-1}^{\top}M_{i,t-1}]}{\sigma^{2}}$ $v_{i,t-1}=\dfrac{\mathbb{E}[M_{i,t-1}]^{\top}c_{i,t-1}}{\sigma^{2}}$ On reconnaît bien une loi gaussienne de moyenne $V_{i,t-1}^{-1}v_{i,t-1}$ et de matrice de covariance $V_{i,t-1}^{-1}$. On remarque de plus que $M_{i,t-1}^{\top}M_{i,t-1}=\sum\limits_{s \in\mathcal{T}_{i,t-1}}(h_{s},1)(h_{s},1)^{\top}$ donc $ \mathbb{E}[M_{i,t-1}^{\top}M_{i,t-1}]=\sum\limits_{s \in\mathcal{T}_{i,t-1}}\mathbb{E}[(h_{s},1)]\mathbb{E}[(h_{s},1)]^{\top}+Var((h_{s},1))$. \part{Contributions} \label{partContributions} \chapter{La collecte vue comme un problème de bandit} \minitoc \newpage \label{FormalisationTache} Ce premier chapitre constitue le scocle commun à toutes les approches que nous proposons tout au long de ce manuscrit. Nous définissons dans un premier temps le processus de collecte d'information dynamique, puis nous le formalisons comme un instance particulière d'un problème de bandit. Nous présentons ensuite les différents jeux de données et modèles de récompense qui permettront d'évaluer les performances du processus de collecte. \section{Processus de collecte dynamique} Dans cette thèse, nous nous intéressons donc au problème de collecte de données en temps réel sur les réseaux sociaux, dans un cadre générique, tel que les approches définies puissent être valides pour divers types de collectes plus ou moins complexes. Comme mentionné précédemment, la plupart des grands médias sociaux mettent à disposition des APIs dites de {\it streaming}, fournissant une portion plus ou moins restreinte de l'activité de leurs utilisateurs en temps réel. Dans cette thèse, les expérimentations sont menées dans le cadre du réseau Twitter, qui propose les APIs de {\it streaming} suivantes\footnote{Documentation Twitter disponible à l'URL: \url{https://dev.twitter.com/streaming/public}}: \begin{itemize} \item API \textit{Sample Streaming}: renvoie aléatoirement 1\% des contenus en temps réel. \item API \textit{Follow Streaming}: permet de suivre en temps réel les contenus produits par 5000 utilisateurs, dans la limite de 1\% du volume total des contenus produits; \item API \textit{Track Streaming}: permet de suivre en temps réel les publications contenant au moins un mot parmi une liste de 400 mots-clés, dans la limite de 1\% du volume total des contenus produits; \item API \textit{Geo Streaming}: permet de suivre en temps réel les publications géolocalisées dans 25 zones, dans la limite de 1\% du volume total des contenus produits; \end{itemize} Ainsi, l'API {\it Sample Streaming} est très limitée et son utilisation seule pour une recherche de données particulière peut nous amener à être noyé sous les messages collectés, tout en passant complètement à côté des messages potentiellement pertinents (puisque l'on ne collecte que 1\% de l'activité globale, rien ne garantit que ne serait-ce qu'un seul message collecté soit pertinent, malgré la publication de multiples messages répondant à nos besoins sur le réseau). Aucun suivi d'activité ciblé n'est possible avec cette API. Pour des recherches simples que l'on peut exprimer sous la forme d'une liste de mots-clés, l'API {\it Track Streaming} pourrait paraître le meilleur choix de prime abord, mais son utilisation se heurte à diverses limitations. Premièrement, en raison de son mode de filtrage disjonctif (modèle booléen : tous les messages contenant au moins un terme de la liste de filtrage peuvent être retournés), la présence d'un seul terme trop générique dans la liste amène à n'obtenir quasiment que des messages contenant ce terme uniquement, et donc risque de nous faire passer à côté de tous les messages réellement intéressants. Les messages contenant tous les termes de la liste ne sont en effet pas prioritaires par rapport aux autres, comme cela serait le cas dans des modèles d'ordonnancement définis dans le cadre de la recherche d'information classique. Rien ne garantit alors d'avoir des messages pertinents dans l'ensemble retourné, car il est très probable que la taille de l'ensemble des messages candidats dépasse largement les 1\% de l'activité globale si la liste de filtrage comporte un mot fréquent. Une méthode automatique qui sélectionnerait les mots à suivre selon cette API risquerait de se heurter très rapidement à ce problème, en choisissant probablement des mots génériques trop fréquemment. D'autre part, l'ensemble des recherches considérées dans cette thèse ne concerne pas uniquement des besoins pouvant s'exprimer sous la forme de listes de termes, et pour des recherches plus complexes cette API de filtrage par mots-clés peut paraître peu pertinente. Est-il possible de définir une liste de mots-clés présents dans la majorité de messages pertinents? Alors qu'une recherche dynamique selon l'API {\it Follow Streaming} peut permettre d'identifier les utilisateurs du réseau les plus susceptibles de produire du contenu pertinent, une recherche par mots-clés se contenterait d'identifier les termes les plus souvent présents dans les messages pertinents, ce qui paraît bien plus limité. En outre, dans le cadre de problèmes de collecte où l'on souhaite obtenir des données relationnelles relativement denses, centrées sur une communauté d'utilisateurs retreinte afin d'en extraire diverses statistiques, ce genre d'API par filtrage sur mots-clés n'est pas du tout adapté. Il s'agit alors de s'intéresser aux producteurs de contenu, plutôt qu'à des marqueurs particuliers de pertinence. L'API {\it Follow Streaming} paraît alors bien plus adaptée, c'est l'approche étudiée dans cette thèse pour la collecte de données dynamique (bien que l'ensemble des approches définies dans cette thèse pourrait être également appliquées dans le cadre de recherches par mots-clés). Notons enfin que chercher le contenu pertinent par sélection d'utilisateurs à suivre permet par ailleurs d'être plus générique par rapport au réseau social considéré, puisque, alors que des APIs de {\it streaming} filtrées selon des mots-clé ne sont pas toujours disponibles, les médias sociaux se voient dans l'obligation, en vue d'être promus par des acteurs externes et utilisés dans divers contextes à travers le Web, de proposer des mécanismes permettant à des applications tierces de récupérer l'activité en temps réel d'utilisateurs ciblés. Par exemple, Facebook ne propose pas d'API de {\it streaming} filtrant les informations selon les mots employés, mais met à disposition un système d'abonnement à des pages d'utilisateurs, fournissant des rapports temps-réel de leur activité similaires à ce que produit l'API {\it Follow Streaming} de Twitter. Le problème de la collecte dynamique de données sur les réseaux sociaux peut alors se voir comme un problème de sélection de sources à écouter: n'ayant pas la capacité de considérer la totalité de l'activité du réseau à chaque instant de la collecte (pour des raisons techniques liées aux ressources à disposition ou bien en raison des limitations), l'objectif est de définir un sous-ensemble d'utilisateurs susceptibles de produire du contenu pertinent pour le besoin spécifié. On se focalise ici sur la sélection de sources pertinentes dans un réseau social lorsque le nombre de comptes d'utilisateurs pouvant être écoutés simultanément est limité. Nous proposons de considérer ce problème dans le contexte des réseaux sociaux de grande taille, où le choix des sources ne peut être effectué manuellement en raison du trop grand volume de données produites et du trop grand nombre de sources à envisager. Bien que notre approche puisse être appliquée à bien d'autres réseaux sociaux (tous ceux qui offrent un accès temps réel à un sous-ensemble de leurs données), nous nous intéressons à la collecte de données sur Twitter, où le nombre d'utilisateurs total est supérieur à $313$ millions, pour une limite de 5000 utilisateurs pouvant être écoutés simultanément. Dans ce contexte, choisir quel sous-ensemble d'utilisateurs suivre à chaque instant est une question complexe, qui requiert la mise en œuvre de techniques d'apprentissage permettant une exploration intelligente de l'ensemble des utilisateurs du réseau pour déterminer de manière efficace les meilleurs candidats à écouter pour la tâche considérée. Étant donné un processus qui, à chaque instant de la collecte, permet de récupérer les contenus produits par un sous-ensemble d'utilisateurs d'un réseau social, et une fonction de qualité permettant de mesurer la pertinence d'un contenu publié par un utilisateur écouté dans un intervalle de temps, il s'agit de définir une stratégie de décision permettant au processus de se concentrer sur les utilisateurs les plus intéressants à mesure que le temps s'écoule. Cette stratégie, apprise de façon incrémentale, est définie de façon à maximiser le gain cumulé - évalué via la fonction de qualité - par les utilisateurs écoutés au cours du temps. Dans ce qui suit, cette stratégie de décision sera appelée de façon équivalente \textit{politique de sélection}. Sur Twitter par exemple, l'information capturée pourrait correspondre à l'ensemble des \textit{tweets} publiés par les utilisateurs écoutés durant la période de temps considérée, et la fonction de qualité pourrait correspondre à un score évaluant le contenu par rapport à une thématique donnée ou bien sa popularité. Nous reviendrons sur les différentes fonctions de qualité que nous utilisons par la suite. Dans notre contexte, une difficulté majeure provient du fait que l'on ne connaît rien \textit{a priori} des utilisateurs du réseau ni des relations qui peuvent les relier: récupérer des profils utilisateurs ou la liste des utilisateurs amis d'un utilisateur donné n'est bien souvent pas envisageable, car cela requiert le questionnement d'une API coûteuse ou restreinte (fréquence des requêtes possibles souvent très limitée) et se heurte parfois à des problèmes de confidentialité des données. Cela implique entre autres que nous ne pouvons pas nous baser sur le graphe du média social pour explorer les utilisateurs (ce qui interdit l'emploi de techniques utilisées pour des problèmes connexes de \textit{Crawling}) et que nous ne connaissons pas \textit{a priori} l'ensemble complet des utilisateurs du réseau. Ainsi, en plus de sélectionner les utilisateurs les plus pertinents, à chaque itération, le processus doit alimenter l'ensemble des utilisateurs potentiellement écoutables. Par exemple, un nouvel utilisateur peut être référencé dans un message si l'utilisateur à l'origine du message le mentionne dans son contenu. Typiquement, sur Twitter, les utilisateurs peuvent se répondre entre eux ou republier des messages d'autres utilisateurs, ce qui nous offre la possibilité de découvrir de nouvelles sources. Le processus général de collecte, présenté dans la figure \ref{fig:process}, opère de la façon suivante à chaque itération: \begin{enumerate} \item Sélection d'un sous-ensemble d'utilisateurs relativement à la politique de sélection considérée ; \item Ecoute de ces utilisateurs pendant une fenêtre de temps donné ; \item Alimentation de l'ensemble des utilisateurs potentiellement écoutable (par exemple en fonction des nouveaux utilisateurs référencés dans les messages enregistrés) ; \item Evaluation des données collectées en fonction de leur pertinence pour la tâche à résoudre; \item Mise à jour de la politique de sélection en fonction des scores obtenus. \end{enumerate} \begin{figureth} \includegraphics[width=0.9\linewidth]{dataStream.pdf} \caption[Processus général de la capture de données]{Processus général de la capture de données.} \label{fig:process} \end{figureth} \begin{comment} Ainsi l'API \textit{Follow Streaming} est particulièrement adaptée à notre tâche de collecte centrée sur des utilisateurs. \begin{note} Dans ce manuscrit, on s'intéresse à un processus de collecte de donnes centré sur des utilisateurs, bien qu'il soit également possible d'étudier des systèmes centrés sur des mots-clés (notamment grâce à l'API \textit{Track Streaming}). La collecte à partir de mots-clés possède le désavantage qu'elle peut s'avérer particulièrement bruitée, selon qu'on utilise des mots plus ou moins courants comme filtre. Par exemple, suivre des mots spécifiques pour collecter des données relatives à un sujet prédéfini peut conduire à récolter un nombre beaucoup trop important de messages, nécessitant des traitements \textit{a posteriori}. De plus, le fait de considérer une collecte centrée sur les utilisateurs permet d'utiliser des modèles de récompense plus complexes qu'une collecte basique à partir d'un filtre sur les mots employés \end{note} \end{comment} \section{Un problème de bandit} Formellement, en notant $\mathcal{K}$ l'ensemble des $K$ utilisateurs du réseau, la tâche de collecte présentée ci-dessus revient à sélectionner à chaque itération $t \in\left\{1,...,T\right\}$ un sous-ensemble noté ${\cal K}_t$ de $k$ profils à suivre parmi l'ensemble des utilisateurs (${\cal K}_t \subset {\cal K}$), selon leur propension à poster des tweets pertinents par rapport au besoin exprimé. En notant $\omega_{i,t}$ le contenu produit par l'utilisateur $i$ pendant la fenêtre de temps $t$ et $r_{i,t}$ la note associée, le but est de sélectionner le sous-ensemble d’utilisateurs maximisant la somme des scores de pertinence tout au long du processus de collecte. Évidemment, les scores de pertinence $r_{i,t}$ sont seulement observés pour les utilisateurs suivis à l'itération $t$ (c.-à-d. pour les $i \in {{\cal K}_t}$). On peut donc voir la tâche de collecte comme un problème d'optimisation en ligne: \begin{equation} \max\limits_{({\cal K}_t)_{t=1..T}} \quad \sum\limits_{t=1}^{T} \sum\limits_{i \in {\cal K}_t} r_{i,t} \label{sum} \end{equation} Les scores de pertinence considérés dépendent d'un besoin d'information, défini par l’utilisateur du système, pouvant prendre des formes variées. Par exemple, l'utilisateur pourrait souhaiter suivre des profils actifs sur des thématiques précises, ou bien des profils influents (au sens où leurs messages sont souvent repris par d'autres utilisateurs). Ces scores peuvent soit être assignés manuellement, relativement à une évaluation humaine des contenus, ou bien automatiquement, par exemple à l'aide d'un classifieur, comme nous le verrons dans la section suivante. Ainsi, en considérant l'écoute de l'utilisateur $i$ dans la fenêtre de temps $t$ comme une action, il apparaît que notre tâche entre dans le formalisme du bandit avec sélection multiple présenté dans le chapitre \ref{EtatArt}, dans laquelle on cherche à maximiser la somme des récompenses récoltées. D'un point de vue pratique, la maximisation de la fonction définie dans la formule \ref{sum} est contrainte par différents facteurs liés aux API de \textit{streaming} que nous utilisons pour la collecte des données, en particulier celle de l'API \textit{Follow} \textit{streaming}, qui permet d'obtenir en temps réel les contenus produits par 5000 utilisateurs définis. Nous utilisons cette API pour capturer les données produites par les utilisateurs sélectionnés par notre système. Plusieurs possibilités s'offrent à nous pour alimenter l'ensemble des utilisateurs potentiellement écoutable au fur et à mesure. La première option consiste à utiliser les comptes mentionnés par un utilisateur étant écouté. En effet lorsqu'un utilisateur interagit avec un autre (\textit{Retweet} ou \textit{Reply} par exemple), il est possible de récolter les noms des personnes en interactions et ainsi d'alimenter notre liste. Par exemple si l'utilisateur est écouté, et que ce dernier répond à un autre utilisateur non connu, alors ce dernier sera ajouté à l'ensemble des profils potentiellement écoutables à la prochaine itération. Notons que ceci nécessite la définition d'un ensemble d'utilisateurs initial afin que le processus puisse démarrer. La seconde possibilité consiste à utiliser l'API \textit{Random streaming} permettant de récolter 1$\%$ des contenus produits sur le réseau social, et par conséquent les profils associés. Suivant les hypothèses faites quant aux distributions de récompenses, on se situera tantôt dans un modèle de bandit stochastique tantôt dans un modèle de bandit contextuel. Dans la suite du manuscrit, on étudie différentes modélisations de ce problème. Dans un premier temps, au chapitre \ref{ModeleStationnaire}, on s'intéresse à un modèle de récompense stationnaire. Nous utiliserons des modèles contextuels, où les contextes seront considérés comme constants dans le chapitre \ref{ModeleContextuelFixe} et variables dans le chapitre \ref{ModeleContextuelVariable}. Nous verrons que dans ces deux derniers cas, nous ne pourrons pas utiliser des algorithmes existants à cause des contraintes présentes sur l'observation des contextes dues aux restrictions des API. Finalement dans le chapitre \ref{ModeleRelationnel} nous modéliserons les relations pouvant exister entre les utilisateurs d'un pas de temps à l'autre. \begin{note} Contrairement à la majorité des tâches classiques en recherche information, nous ne nous préoccupons pas ici de la précision des informations collectées. L'objectif est de maximiser le volume de messages pertinents collectés, un filtrage pouvant être éventuellement appliqué \textit{a posteriori}. Cet aspect diffère des tâches habituelles en recherche d'information où l'on s'intéresse à un compromis précision-rappel. \end{note} \section{Modèles de récompenses utilisés} \label{chap0ModelesRec} Sur Twitter, il existe différentes façons pour un utilisateur d'apparaître sur le réseau. D'une part de façon active, lorsqu'un utilisateur poste un \textit{Tweet}, c'est-à-dire publie un nouveau message directement depuis son compte. Un utilisateur peut aussi effectuer des reprises de contenu produit par d'autres comptes, appelé \textit{Retweet}. Il est également possible de répondre à des contenus publiés par d'autres profils, appelés \textit{Reply}. D'autre part, un utilisateur peut apparaître de façon passive, lorsque d'autres utilisateurs effectuent des \textit{Retweet} ou des \textit{Reply} sur des messages qu'il a publiés. Lorsqu'un utilisateur est écouté pendant une période donnée, toutes ses apparitions sur le réseau - actives ou passives - sont captées. Ceci est résumé dans le tableau \ref{tab:interactions}, dans lequel on introduit les notations pour les événements associés à un utilisateur $i$ pendant l'itération $t$. Dans les cinq cas, $k\in \left\{0,1,2,3,4\right\}$, $\omega_{i,t}^{k}$ désigne le contenu associé à l'événement $k$ pendant la période $t$ pour l'utilisateur $i$. \begin{tableth} \setlength\extrarowheight{5pt} \begin{tabular}{|c|c|c||c|c|} \hline \multicolumn{3}{|c||}{\textbf{Actif}} & \multicolumn{2}{c|}{\textbf{Passif}} \\ \hline Tweet & Retweet & Reply &Retweet & Reply \\ \hline $\omega_{i,t}^{0}$ & $\omega_{i,t}^{1}$ & $\omega_{i,t}^{2}$ &$\omega_{i,t}^{3}$ & $\omega_{i,t}^{4}$ \\ \hline \end{tabular} \caption[Différents types d'interactions d'un utilisateur avec Twitter.]{Différents types d'interactions d'un utilisateur avec Twitter.} \label{tab:interactions} \end{tableth} Bien que d'autres types de fonction récompense auraient pu être envisagés, nous décidons dans nos expérimentations de nous intéresser à des modèles de collecte visant à récompenser les messages ayant un fort impact sur une thématique donnée . Trois thématiques sont considérées (correspondant à trois différents modèles de récompense) : \textit{politique}, \textit{religion} et \textit{science}. L'appartenance à chacune de ces trois thématiques se fait par l'application d'un classifieur entraîné sur le corpus \textit{20 Newsgroups}\footnote{\url{http://qwone.com/jason/20Newsgroups/}}, constitué de 18846 documents et d'un vocabulaire de 61188 termes. Le classifieur utilisé est un SVM à noyau linéaire\footnote{Avec un coefficient de pénalité fixé à 1.}, dont les bonnes performances pour la classification de textes ont, entre autres, été évaluées dans \cite{SVMtextClassif}. Les caractéristiques utilisées pour chaque document correspondent au poids TF-IDF de chaque terme le composant. On rappelle qu'étant donnée un document $d_j$, la fréquence d'un terme $t_i$ (notée $TF_{t_i,d_j}$) est égale au nombre d'occurrences de $t_i$ dans le document $d_j$, et permet de mesurer l'importance d'un terme au sein d'un document. De plus, étant donné un corpus $\mathcal{D}={d_{1},...,d_{D}}$ de $D$ documents, la fréquence inverse de document d'un terme $t_{i}$ (notée $IDF_{t_i}$) est une mesure de l'importance du terme dans l'ensemble du corpus: $IDF_{t_i}=\log\left(D/|\left\{d_{j} \text{ tel que } t_{i}\in d_{j}\right\}|\right)$, avec $|\left\{d_{j} \text{ tel que } t_{i}\in d_{j}\right\}|$ le nombre de documents où le terme $t_{i}$ est présent. Dans le schéma TF-IDF, cette mesure vise à donner un poids plus important aux termes les moins fréquents, considérés comme plus discriminants. Finalement, le score TF-IDF d'un terme $t_{i}$ dans un document $d_{j}$ est égal au produit des deux score: $TF_{t_{i},d_{j}}IDF_{t_{i}}$. Le classifieur utilisé a été entraîné pour chaque classe "contre les autres" (\textit{one-vs.rest}) en considérant l'ensemble des labels présents dans le corpus (au nombre de 20). Ainsi, certains \textit{tweets} peuvent n'appartenir à aucune des classes \textit{politique}, \textit{religion} ou \textit{science}. En revanche, un \textit{tweet} ne peut appartenir qu'à une seule classe, celle associée à la valeur de la fonction de décision la plus élevée. Pour un contenu $\omega_{i,t}^{k}$, avec $k \in \left\{0,1,2,3,4\right\}$ suivant le type de message considéré, (voir tableau \ref{tab:interactions}), on note $g(\omega_{i,t}^{k})$ la valeur associée au résultat de ce classifieur pour une thématique donnée: \begin{equation*} g(\omega_{i,t}^{k}) = \begin{cases} 1 \text{ si le contenu appartient à la thématique}\\ 0 \text{ sinon} \end{cases} \end{equation*} Conscient du fait que les \textit{tweets} bruts peuvent être bruités par la présence d'URL, ou de mention d'autres utilisateurs, nous prenons le soin de nettoyer chaque message avant de lui appliquer le classifieur. De plus, pour un utilisateur, on peut collecter plusieurs contenus d'un même type durant une fenêtre d'écoute. Ainsi pour un utilisateur $i$ à l'instant $t$, on note $p_{i,t}^{k}$ le nombre de contenus collectés de type $k$. Ainsi d'une façon générique, la récompense d'un utilisateur $i$ au temps $t$, pour une thématique donnée, est calculée comme une fonction de la somme pondérée des valeurs de la fonction $g$ sur les contenus collectés: \begin{equation} \label{defiRwd} r_{i,t}=\tanh\left(\sum\limits_{k=0}^{4} \alpha_{k}\sum\limits_{p=0}^{p_{i,t}^{k}} g(\omega_{i,t}^{k,p})\right) \end{equation} Où $\alpha_{k}$ correspond au poids que l'on souhaite donner au type de contenu $k$ et $\omega_{i,t}^{k,p}$ représente le $p^{\text{ième}}$ contenu de type $k$ de l'utilisateur $i$ à l'itération $t$, et $\tanh$ désigne la fonction tangente hyperbolique. La fonction tangente hyperbolique permet de ramener les récompenses entre 0 et 1 (car son argument est ici toujours positif), et les différents coefficients permettent de jouer sur la pente plus ou moins abrupte de cette fonction. Par exemple, une valeur de $\alpha_{0}$ élevée aura tendance à privilégier les utilisateurs étant à la source de nombreux messages originaux tandis qu'un $\alpha_{3}$ élevé favorisera les utilisateurs étant beaucoup repris par les autres. Dans la pratique, nous avons décidé de nous concentrer sur la recherche d'utilisateur étant soit à l'origine de contenu, soit faisant l'objet de nombreuses réactions vis-à-vis des autres utilisateurs, c'est à dire étant "Retweeté" ou suscitant des "Replies": $\alpha_{0}=\alpha_{3}=\alpha_{4}=0.1$ et $\alpha_{1}=\alpha_{2}=0$. Dans la suite du manuscrit, nous désignons ce modèle de récompense par \textit{Topic+Influence}. Encore une fois, ce type de schéma de récompense a uniquement été imaginé à des fins expérimentales, pour démontrer les performances des approches proposées. Bien d'autres schémas peuvent être employés dans le même cadre applicatif, en utilisant les modèles présentés dans les chapitres suivants. \section{Représentations des messages} \label{repMessage} Certains modèles proposés dans cette thèse nécessitent l'utilisation d'une représentation vectorielle des différents messages (voir chapitres \ref{ModeleContextuelFixe} et \ref{ModeleContextuelVariable}). Pour cela, une première possibilité consiste à utiliser une représentation de type sac de mots. Dans ce cas, étant donné un dictionnaire de taille $m$, un message correspond à un vecteur dans $\mathbb{R}^{m}$, dont chaque composante est égale au poid TF-IDF des termes qui le composent. Dans l'application que nous proposons, nous appliquons préalablement un algorithme de racinisation (\textit{Porter stemmer}) aux différents messages. Notons qu'en linguistique, la racine d’un mot correspond à la partie du mot restante une fois que l’on a supprimé ses préfixes et ses suffixes. Ceci permet d'unifier les variantes d'un terme sous une même forme syntaxique. Nous construisons le dictionnaire final en sélectionnant les 2000 ($m=2000$) termes ayant les scores TF-IDF les plus élevés. Comme nous le verrons dans le manuscrit, certains algorithmes nécessiteront de manipuler (et en particulier d'inverser) des matrices de taille égale à la dimension des vecteurs représentant les documents, soit $2000 \times 2000$. En pratique cela peut s'avérer très complexe, et ralentir fortement l'exécution des différents algorithmes. En vue de réduire la dimension de l'espace des représentations des messages et d'obtenir des descripteurs plus concis, nous proposons d'utiliser une transformation LDA (Latent Dirichlet Allocation) \cite{LDA}. Il s'agit d'un modèle génératif, souvent utilisé en recherche d'information, qui modélise chaque message comme un mélange probabiliste de $d$ sujets (ou concepts), où chaque sujet est caractérisé par une distribution sur les termes du dictionnaire. Cependant, le format des messages sur Twitter étant très court, il s'avère que l'apprentissage direct du modèle LDA sur des messages individuels n'est pas pertinent. Nous privilégions ainsi l'approche spécifiquement créée par \cite{LDATwitter2}, dans laquelle les messages d'un même utilisateur sont agrégés en un seul document lors de l'apprentissage du modèle. Le nombre $d$ de sujets est un paramètre du modèle que nous fixons à 30 dans les expérimentations à venir. Ce modèle est entraîné sur un ensemble de \textit{tweets} collectés via l'API \textit{Random Streaming} pendant une durée de trois jours. La méthode employée, qui consiste à entraîner un modèle de projection fixe sur un corpus hors-ligne rentre dans le cadre du \textit{data-oblivious sketching} présenté au chapitre \ref{EtatArtRI}. \section{Jeux de données} \label{datasets} Tout au long de ce manuscrit, en plus des expérimentations en ligne pour tester les approches en conditions réelles, nous effectuerons des expérimentations sur trois ensembles de données enregistrées, ce qui permet de simuler les processus de collecte plusieurs fois et de comparer divers algorithmes. Concrètement, chaque jeu de données est constitué de l'activité de 5000 utilisateurs, enregistrée pendant un période définie. Ceci permet ensuite de jouer divers scénarios de collecte dans un mini réseau social de $K=5000$ personnes. Les jeux de données collectés sont les suivants: \begin{itemize} \item Le premier jeu de données, appelé \textit{USElections}, correspond à un ensemble de messages récoltés grâce à l'API Twitter en suivant 5000 comptes d'utilisateurs sur une période de 10 jours précédant les élections américaines de 2012. Nous avons choisi ces comptes en prenant les 5000 premiers à avoir employé les mots-clés "Obama", "Romney" ou le \textit{hashtag} "\#USElections". Il contient un total de 3 587 961 messages. \item Le second jeu de données, appelé \textit{OlympicGames}, fut collecté en août 2016 pendant une période de trois semaines sur la thématique des Jeux olympiques d'été de Rio. Les 5000 comptes écoutés furent sélectionnés en prenant les 5000 comptes à avoir le plus utilisé les \textit{hashtags} "\#Rio2016", "\#Olympics", "\#Olympics2016" ou "\#Olympicgames" dans une période antérieure de trois jours avant le début des JO. Il contient un total de 15 010 322 messages. \item Le troisième jeu de données, appelé \textit{Brexit}, fut collecté en octobre 2016 sur la thématique du Brexit pendant une période d'une semaine. Les 5000 comptes écoutés furent sélectionnés en prenant les 5000 premiers à avoir employé le \textit{hashtag} "\#Brexit". Il contient un total de 2 118 235 messages. \end{itemize} D'autres caractéristiques de ces jeux de données sont présentées dans le tableau \ref{tab:dataset}. Les différentes valeurs exposées dans ce tableau sont définies de la façon suivante: \begin{itemize} \item \textbf{Tweet} ($k=0$): nombre de \textit{Tweets} dont l'origine vient de l'un des 5000 comptes écoutés lors de la collecte. Il s'agit de messages originaux postés directement par des utilisateurs écoutés; \item \textbf{Retweet} ($k=1$): nombre de \textit{Retweets} dont l'origine vient de l'un des 5000 comptes écoutés lors de la collecte. Il s'agit de reprises par les utilisateurs écoutés de messages d'autres utilisateurs (écoutés ou non); \item \textbf{Reply} ($k=2$): nombre de \textit{Replies} dont l'origine vient de l'un des 5000 comptes écoutés lors de la collecte. Il s'agit de réponses par les utilisateurs écoutés à des messages d'autres utilisateurs (écoutés ou non); \item \textbf{Retweet} ($k=3$): nombre de \textit{Retweets} dont l'origine ne vient pas de l'un des 5000 comptes écoutés lors de la collecte. Il s'agit de reprises par des utilisateurs non écoutés de messages postés par des utilisateurs écoutés; \item \textbf{Reply} ($k=4$): nombre de \textit{Replies} dont l'origine ne vient pas de l'un des 5000 comptes écoutés lors de la collecte. Il s'agit de réponses d'utilisateurs non écoutés à des utilisateurs écoutés; \end{itemize} \begin{tableth} \begin{tabular}{|c|c|c|c|c|c|} \hline \textbf{Jeu de données} & \textbf{Tweet} ($k=0$) & \textbf{Retweet} ($k=1$) & \textbf{Reply} ($k=2$) & \textbf{Retweet}: ($k=3$) & \textbf{Reply} ($k=4$) \\ \hline \textit{USElections} & 1 057 622 & 770 062 & 295 128 & 1 100 255 & 364 894\\ \hline \textit{OlympicGames} & 3 241 413 & 3 756 089 & 341 734 & 6 807 064 & 864 022 \\ \hline \textit{Brexit} & 406 776 & 1 068 578 & 178 234 & 324 150 & 140 497 \\ \hline \end{tabular} \caption[Caractéristiques des jeux de données.]{Caractéristiques des jeux de données.} \label{tab:dataset} \end{tableth} Ainsi, chaque jeu de données possède des caractéristiques qui lui sont propres, avec une part plus ou moins importante des différents contenus. On note que d'une façon générale, les réponses constituent un événement plus rare que les reprises. Enfin, dans toutes les expérimentations hors-ligne sur ces jeux de données que nous effectuerons au cours de la thèse, le processus d'alimentation de l'ensemble d'utilisateurs doit être défini. Etant donné que nous utilisons un ensemble d'utilisateurs prédéfini il n'est pas possible d'utiliser la méthode évoquée plus haut qui consiste à partir d'un petit ensemble de source, puis à alimenter l'ensemble des utilisateurs grâce aux divers interactions (réponses ou reprise de messages) entre ces sources et des utilisateurs non connus. En effet, les chances pour que les 5000 utilisateurs écoutés pendant la collecte des divers jeux de données aient interagit sont faibles. Nous choisissons donc, pour les expérimentations hors-ligne, d'ajouter un utilisateur dès lors qu'il apparaît actif pour la première fois. Bien sûr, un système permettant cela n'est pas envisageable dans une expérimentation en ligne en conditions réelles, ce qui nous conduira à choisir un autre processus d'alimentation de la base de comptes lors des expérimentations à venir. \section{Conclusion} Le problème de la collecte de données en temps réel est désormais formalisé comme un problème de bandit. Les corpus d'étude et les modèles de récompenses sont eux aussi définis. Les éléments donnés dans ce chapitre serviront de base à l'ensemble des approches considérées dans la suite du manuscrit. \chapter{Modèle stationnaire stochastique} \minitoc \newpage \label{ModeleStationnaire} Dans ce chapitre, nous proposons de modéliser la récompense de chaque utilisateur par une distribution stationnaire afin de se placer dans le cadre du bandit stochastique. L'objectif de cette première approche est de montrer l'intérêt des algorithmes de bandits pour traiter notre tâche de collecte d'information en temps réel dans un média social. Dans cette optique, nous verrons que les algorithmes existants peuvent être adaptés à notre cas, et nous proposerons également un nouvel algorithme, dont nous testerons les performances dans une partie expérimentale. \section{Modèle et algorithmes} \label{chap1Modele} Rappelons que l'on considère un ensemble de $K$ utilisateurs noté $\mathcal{K}$. A chaque itération $t$ du processus de collecte, l'agent décisionnel, autrement dit la politique de sélection, doit choisir un sous-ensemble noté $\mathcal{K}_{t} \subset \mathcal{K}$ de $k$ utilisateurs à écouter. La récompense $r_{i,t}$ associée à un utilisateur $i$ suivi pendant la fenêtre d'écoute $t$ est immédiatement évaluée selon l'un des modèles proposés dans la partie \ref{chap0ModelesRec}. Notre but est de collecter un maximum d'information pertinente - relativement à notre modèle de récompense - tout au long du processus composé de $T$ itérations, ce qui correspond à la maximisation de la somme des récompenses récoltées au cours du temps. Nous supposons que chaque utilisateur $i$ est associé à une distribution de récompense stationnaire $\nu_{i}$ de moyenne $\mu_{i}$. Ainsi, à chaque temps $t$, la récompense émise par un profil $i$ correspond à un échantillon de la loi $\nu_{i}$, c'est à dire $r_{i,t} \sim \nu_{i}$. Afin de rester dans le cadre des bandits stationnaires, on suppose également que tous les échantillons sont indépendants entre eux. Les hypothèses de stationnarité utilisées dans ce chapitre nous positionnent dans le cadre du bandit avec sélections multiples décrit dans l'état de l'art (voir section \ref{banditMultSel}), pour lequel l'algorithme \texttt{CUCB} a été proposé dans \cite{banditCombinatoire}. Dans le cas qui nous intéresse, c'est-à-dire lorsque la récompense d'un ensemble de bras est égale à la somme des récompenses individuelles des bras qui le composent, l'algorithme \texttt{CUCB} correspond à une extension de l'algorithme \texttt{UCB} \cite{banditUCB}. Pour effectuer la sélection de $k$ actions à chaque itération, cet algorithme associe à chaque action $i$ et à chaque instant $t$ un score noté $s_{i,t}$ correspondant à une borne supérieure de l'intervalle de confiance de la récompense associée. Cette politique est dite optimiste, car elle suppose que pour chaque utilisateur, la récompense associée est la meilleure de ce qu'elle pourrait être selon l'intervalle de confiance considéré. Selon l'algorithme \texttt{CUCB}, et pour le cas qui nous intéresse où toutes les actions ne sont pas connues \textit{a priori}, le score de chaque action connue $i$ à l'instant $t$ s'écrit: \begin{equation} \label{scoreUCBGenerique} s_{i,t}=\begin{cases} \hat{\mu}_{i,t-1} +B_{i,t} \text{ si } N_{i,t-1}>0\\ +\infty \text{ si } N_{i,t-1}=0 \end{cases} \end{equation} Où $N_{i,t-1}=\sum\limits_{s=1}^{t-1}\mathbb{1}_{\left\{i\in \mathcal{K}_{s}\right\}}$ est égal au nombre de de fois où l'action $i$ a été sélectionnée jusqu'au temps $t-1$, $\hat{\mu}_{i,t-t}=\dfrac{1}{N_{i,t-1}}\sum\limits_{s=1}^{t-1}\mathbb{1}_{\left\{i\in \mathcal{K}_{s}\right\}}r_{i,s}$ correspond à la moyenne empirique de l'action $i$ et $B_{i,t}=\sqrt{\dfrac{2\log(t)}{N_{i,t-1}}}$ est un terme exploratoire. Le score $s_{i,t}$ représente bien un compromis entre exploitation et exploration puisqu’il s’agit de la somme d’un premier terme estimant la qualité d’une action $i$ et d’un second terme décroissant avec le nombre de fois où l’action i est choisie. De plus, étant donné que l'on ne connaît pas tous les utilisateurs à l'instant initial, le score des utilisateurs non écoutés au moins une fois (c.-à-d. $N_{i,t-1}=0$) est initialisé à $+\infty$ afin de forcer le système à les sélectionner. Avec ceci, nous pouvons donc directement appliquer l'algorithme \texttt{CUCB} à notre cas. Le processus de collecte générique associé est détaillé dans l'algorithme \ref{AlgoCollecteStat}, dans lequel on associe un score $s_{i,t}$ à chaque utilisateur pour effectuer la sélection. \begin{algorithm}[h!] \KwIn{$\mathcal{K}_{init}$} \For{$t=1..T$}{ \For{$i \in \mathcal{K} $}{ Calculer $s_{i,t}$ selon l'équation \ref{scoreUCBGenerique} } Ordonner les utilisateurs par ordre décroissant selon $s_{i,t}$\; Sélectionner les $k$ premiers pour fixer $\mathcal{K}_{t}$\; Ecouter en parallèle tous les utilisateurs $i\in \mathcal{K}_{t}$ et observer $\omega_{i,t}$ \; \For{$i \in \mathcal{K}_{t} $}{ Recevoir la récompense associée $r_{i,t}$ \; Alimenter $\mathcal{K}$ avec les nouveaux utilisateurs $j$, $j\notin\mathcal{K} $ } } \caption{Algorithme de collecte - hypothèse stationnaire} \label{AlgoCollecteStat} \end{algorithm} \begin{note} Etant donné que tous les utilisateurs ne sont pas connus à l'initialisation, ce problème problème entre dans le cadre du \textit{sleeping} bandit \cite{sleepingBandit}, dans lequel l'ensemble des actions disponibles à chaque itération change d'une itération à l'autre. Il est alors possible d'appliquer les algorithmes de bandit stationnaire classiques à la différence près qu'au lieu de sélectionner une fois chaque action en début de processus pour initialiser les moyennes empiriques, chaque action est jouée une fois lorsqu'elle apparaît pour la première fois dans l'ensemble des actions disponibles. \end{note} Pour la tâche de collecte d'information définie, la récompense de chaque utilisateur est basée sur la pertinence du contenu produit pendant une période finie. Cependant, de fortes variations peuvent être observées sur la fréquence de publication des utilisateurs écoutés. Typiquement, la plupart du temps, les utilisateurs ne produisent aucun contenu. Avec la politique \texttt{CUCB} présentée précédemment (c.-à-d., avec $B_{i,t}=\sqrt{\frac{2\ln(t)}{N_{i,t-1}}}$), le score $s_{i,t}$ peut tendre à pénaliser les utilisateurs produisant peu de contenus les premières fois qu'ils sont écoutés. De plus, aucune différence ne peut être faite entre un utilisateur produisant beaucoup de contenus de qualité moyenne et un utilisateur produisant peu de contenus, mais d'une grande qualité. En vue de prendre en compte cette forte variabilité dans le comportement des utilisateurs, nous proposons un nouvel algorithme de bandit à sélections multiples, que nous appelons \texttt{CUCBV}, et qui considère la variance des récompenses récoltées. L'algorithme \texttt{CUCBV} est une extension de l'algorithme \texttt{UCBV} proposé dans \cite{banditUCBV}. Cet algorithme associe un score $s_{i,t}$ à chaque action $i$ à l'instant $t$ de la forme proposée dans l'équation \ref{scoreUCBGenerique}, mais utilise la variance dans le terme d'exploration, ce qui semble mieux adapté à notre tâche. Le terme d'exploration $B_{i,t}$ de l'algorithme \texttt{CUCBV} est défini par: \begin{equation} \label{scoreCUCBV} B_{i,t}= \sqrt{\dfrac{2aV_{i,t-1}\log(t)}{N_{i,t-1}}}+3c\dfrac{\log(t)}{N_{i,t-1}} \end{equation} Où $c$ et $a$ sont des paramètres de l'algorithme permettant de contrôler l'exploration, et $V_{i,t-1}=\dfrac{1}{N_{i,t-1}}\sum\limits_{s=1}^{t-1}(\mathbb{1}_{\left\{i_{t}=i\right\}}r_{i,s}-\hat{\mu}_{i,t-1})^{2}$ est la variance empirique de l'utilisateur $i$. Avec un tel facteur d’exploration, la politique tend à plus explorer les utilisateurs ayant une grande variance, puisque plus d’informations sont nécessaires pour avoir une bonne estimation de leur qualité. Dans la section suivante, on discute des garanties de convergence théoriques de l'algorithme \texttt{CUCBV} que nous proposons. \section{Etude du regret} Dans ce qui suit nous supposons, sans perte de généralité que les actions sont ordonnées de la façon suivante: $\forall i, \mu_{i} > \mu_{i+1}$. De plus, on utilise les notations supplémentaires suivantes: \begin{itemize} \item $\sigma_{i}$ l'écart type de la récompense associée à l'action $i$; \item $\mathcal{K}^{\star}$ est l'ensemble des $k$ actions ayant la plus forte espérance: $\mathcal{K}^{\star}=\left\{1,..,k\right\}$; \item $\overline{\mu}^{\star}$ est la moyenne des espérances des actions dans $\mathcal{K}^{\star}$, $\overline{\mu}^{\star}=\dfrac{1}{k}\sum\limits_{i=1}^{k}\mu_{i}$ \item $\Delta_i$ est défini comme la différence entre $\overline{\mu}^{\star}$, la moyenne des espérances des actions dans $\mathcal{K}^{\star}$, et $\mu_{i}$: $\Delta_i = \overline{\mu}^{\star}-\mu_{i}$; \item $\underline{\mu}^{\star}$ est la plus faible espérance dans $\mathcal{K}^{\star}$: $\underline{\mu}^{\star}=\min\limits_{i\in\mathcal{K}^{\star} }\mu_{i}=\mu_{k}$ \item $\delta_{i}$ correspond à la différence entre $\underline{\mu}^{\star}$, la plus faible espérance dans $\mathcal{K}^{\star}$, et $\mu_i$: $\delta_{i}=\underline{\mu}^{\star} - \mu_i$; \end{itemize} La performance d'un algorithme de bandit est habituellement mesurée par la notion de regret, qui correspond à la perte de récompense qu’un agent est susceptible de subir en choisissant une action $i$ au lieu d’une action optimale (au sens de la moyenne). De plus, il est usuel d'étudier théoriquement des garanties sur le pseudo-regret, qui correspond, conformément à la définition \ref{regretCumultoPseudoMP} (voir section \ref{banditMultSel}), à: \begin{equation} \hat{R}_{T}= \mathbb{E}\left[\sum\limits_{t=1}^{T} \left( \sum\limits_{i\in \mathcal{K}^{\star}} \mu_{i} - \sum\limits_{i\in \mathcal{K}_{t}} \mu_{i}\right) \right] \end{equation} \begin{prop} \label{defAlternativeRegComb} Pour un algorithme de bandit stationnaire avec sélection multiple, le pseudo-regret peut se réécrire de la façon suivante: \begin{equation} \hat{R}_{T}=\sum\limits_{i=1}^{K} \mathbb{E}[N_{i,T}]\Delta_{i} \end{equation} \end{prop} \begin{preuve} Disponible en annexe \ref{PreuveRegCUCBVFirstPart}. \end{preuve} Lorsque $k=1$, cette écriture revient à la définition du regret du bandit stochastique, car $\Delta_i=\mu^{\star}-\mu_{i}$. Ainsi seuls les bras sous-optimaux ont une contribution non nulle (et forcément positive) dans le regret. Dans le cas où $k>1$, la présence de plusieurs bras optimaux complexifie la façon dont le regret se comporte, car toutes les actions, qu'elles soient optimales ou non, jouent un rôle dans le regret. Nous remarquons que, bien que par définition le regret total ne puisse pas être négatif, certaines contributions peuvent ponctuellement être négatives. En effet, pour certains bras optimaux $i\in \mathcal{K}^{\star}$, on aura $\Delta_i <0$ selon qu'on est au-dessus ou en dessous de la moyenne. Afin de nous affranchir de cette difficulté combinatoire, nous proposons ci-dessous une première majoration du regret, ne faisant intervenir que les contributions des actions sous-optimales. \begin{prop} \label{defAlternativeRegCombBis} Pour un algorithme de bandit stationnaire avec sélection multiple, le pseudo-regret est majoré par: \begin{equation} \hat{R}_{T}\leq \sum\limits_{i \notin \mathcal{K}^{\star}}^{K} \mathbb{E}[N_{i,T}]\Delta_{i} \end{equation} \end{prop} \begin{preuve} En remarquant que le regret peut s'écrire \\ $\hat{R}_{T}=\sum\limits_{i=1}^{k} \mathbb{E}[N_{i,T}] \Delta_i + \sum\limits_{i=k+1}^{K} \mathbb{E}[N_{i,T}] \Delta_i$, que pour toute action $\mathbb{E}[N_{i,T}]\leq T$ et que $\sum_{i=1}^{k}\Delta_i = 0$ on obtient le résultat proposé. \end{preuve} \begin{theo} \label{theoRegCUCBV} En considérant l'ensemble complet des actions $\mathcal{K}$ connu \textit{a priori}, en choisissant $a=c=1$ (paramètres de réglages de l'algorithme), le pseudo-regret de l'algorithme \texttt{CUCBV} est majoré par: \begin{equation} \hat{R}_{T}\leq \ln(T)\sum\limits_{i \notin \mathcal{K}^{\star}} \left( C+8\left(\dfrac{\sigma_{i}^{2}}{\delta_{i}^{2}} + \dfrac{2}{\delta_{i}}\right)\right)\Delta_i + D \end{equation} Où $C$ et $D$ sont des constantes, $\Delta_i$ est la différence entre $\overline{\mu}^{\star}$, la moyenne des moyennes des récompenses dans $\mathcal{K}^{\star}$, et $\mu_{i}$, la moyenne de $i$: $\Delta_i = \overline{\mu}^{\star}-\mu_{i}$, $\delta_{i}$ est la différence entre $\underline{\mu}^{\star}$, la moyenne associée à la moins bonne action de $\mathcal{K}^{\star}$, et $\mu_i$: $\delta_i = \underline{\mu}^{\star}-\mu_{i}$, $\sigma_{i}^{2}$ est la variance de l'action $i$. \end{theo} \begin{preuve} Disponible en annexe \ref{PreuveRegCUCBVSecondPart}. \end{preuve} A une constante additive près, ce résultat nous permet de garantir une convergence logarithmique. Bien que ce résultat ne soit valide que pour le cas où l’ensemble complet des utilisateurs est connu \textit{a priori}, il nous permet d’affirmer que lorsqu’un utilisateur optimal (avec une moyenne parmi les $k$ meilleures) entre dans l’ensemble $K$, le processus converge de façon logarithmique vers une politique le reconnaissant comme tel. En revanche, cette borne n'est pas optimale au sens ou le facteur multiplicatif devant le logarithme n'est pas égal à celui de la borne inférieure du regret de tout algorithme de bandit à sélections multiples (la formule de cette borne inférieure est détaillée dans le théorème \ref{infRegStoMP} de l'état de l'art). Ceci est dû au fait, d'une part que l'algorithme \texttt{UCBV} avec une seule action sélectionnée à chaque pas de temps n'est déjà pas optimal, et d'autre part à la majoration effectuée dans la proposition \ref{defAlternativeRegCombBis}. Rappelons finalement que nous considérons ici le cas des distributions de récompenses stationnaires. Bien que cette hypothèse ne soit pas toujours vérifiée dans notre contexte de réseaux sociaux, cette preuve de convergence nous indique que si des sources sont bonnes pendant une période de temps suffisamment longue, notre algorithme est en mesure de les détecter. Dans la section suivante, nous proposons diverses expérimentations de cet algorithme pour notre tâche de collecte de données. \section{Expérimentations} Nous expérimentons les algorithmes de bandits étudiés précédemment dans le cadre de la collecte orientée, d'une part sur des données hors ligne et d'autre part dans une expérimentation en ligne. \subsection{Hors ligne} \subsubsection{Protocole} \label{protocole} Dans le but de tester différents algorithmes, nous réalisons dans un premier temps des expérimentations sur les bases de données collectées \textit{USElections}, \textit{OlympicGames} et \textit{Brexit}, dont les caractéristiques ont été détaillées dans la section \ref{datasets}. On rappelle que ces bases contiennent chacune l'activité de $K=5000$ utilisateurs sur une certaine période, ce qui nous permet de simuler un réseau social. Afin de se placer dans le cadre de notre tâche, chaque période est divisée artificiellement en $T$ itérations. Dans les trois cas nous avons fixé la taille d'une itération à 100 secondes. Ainsi la base \textit{USElections} comporte $T=8070$ itérations, la base \textit{OlympicGames} en comporte $T=16970$ et la base \textit{Brexit} en comporte $T=4334$. La valeur de $k$, le nombre d'utilisateurs que l'on est autorisé à écouter à chaque itération est fixé à $k=100$ \footnote{Nous testerons d'autres valeurs par la suite.}. Finalement, on utilise le modèle de récompense \textit{Topic+Influence} présenté dans le chapitre \ref{FormalisationTache} (section \ref{chap0ModelesRec}). Le but de ces expérimentations est double. Premièrement, il s'agit de vérifier que les algorithmes de bandit permettent effectivement de collecter la donnée de façon intelligente en s'orientant vers des utilisateurs pertinents. Dans cette optique, nous nous comparerons à une politique aléatoire, nommée \texttt{Random}, sélectionnant les utilisateurs uniformément à chaque instant. De plus, il s'agit de montrer que l'algorithme \texttt{CUCBV} que nous avons proposé dans la partie précédente est plus adapté que ses concurrents dans le cas spécifique de la collecte de données. Dans cette optique, on se comparera également à l'algorithme \texttt{CUCB}, mais aussi aux algorithmes \texttt{UCB}-$\delta$ et \texttt{MOSS} décrits dans le chapitre \ref{EtatArtBandit} et proposés respectivement dans \cite{OFUL} et \cite{banditMOSS}. On adapte ces derniers à notre cas (sélection multiple) en considérant les scores des politiques respectives (voir algorithme \ref{MOSS} pour \texttt{MOSS} et algorithme \ref{UCBDelta} pour \texttt{UCB}-$\delta$) et en sélectionnant à chaque itération les $k$ utilisateurs ayant les scores les plus élevés. Notons que \texttt{UCB}-$\delta$ possède un paramètre $\delta$ permettant de régler l'exploration. Nous fixons ce paramètre à 0.05, qui est une valeur souvent utilisée dans la littérature. De plus, la politique \texttt{MOSS} nécessite la connaissance de l'horizon $T$ et du nombre total d'utilisateurs $K$ en paramètres. Dans la pratique, nous pouvons seulement fixer une borne supérieure pour $K$, le nombre total d'utilisateurs étant inconnu à l'avance. En outre, la présence de $T$ peut également poser des difficultés dans le cas où l'horizon n'est pas connu au préalable. Cependant, dans les expérimentations hors ligne que nous effectuons ici, il est possible de fixer des valeurs optimales pour \texttt{MOSS}, ce qui n'est pas possible en pratique et favorise cet algorithme pour ces expérimentations. \subsubsection{Résultats} Les figures \ref{fig:XPStatUSRT}, \ref{fig:XPStatOGRT} et \ref{fig:XPStatBrexitRT} contiennent l'évolution du gain cumulé en fonction du temps respectivement pour les bases \textit{USElections}, \textit{OlympicGames} et \textit{Brexit} avec le modèle de récompense \textit{Topic+Influence} pour les trois thématiques. On remarque que les trois stratégies proposées offrent de meilleurs résultats que la stratégie \texttt{Random}, ce qui confirme que l'application d'algorithmes de bandits pour la capture de données sur un réseau social est pertinente. On remarque dans un premier temps que d'une façon générale, les politiques \texttt{CUCB} et \texttt{UCB}-$\delta$ offrent des performances similaires. Selon les cas, l'algorithme \texttt{MOSS} est plus performant que ces deux derniers. Comme nous pouvons le voir, cela dépend de la récompense et du jeu de données utilisé. Remarquons qu'étant donné les valeurs de $K$ et $T$ associées à nos trois bases de données, l'algorithme \texttt{MOSS} possède un terme d'exploration très faible, ce qui le conduit à favoriser l'exploitation au détriment de l'exploration. En effet pour chaque action $i$ à l'instant $t$ ce dernier vaut $\sqrt{\max(\log(T/(KN_{i,t-1})),0)/N_{i,t-1}}$ qui devient nul dès que $N_{i,t-1}\geq T/K$. Dans toutes les configurations, l'algorithme \texttt{CUCBV} offre de meilleurs résultats que \texttt{CUCB}, \texttt{UCB}-$\delta$ et \texttt{MOSS}. Le fait de considérer la variance empirique des utilisateurs dans le terme d'exploration conduit à une meilleure estimation des comptes ayant une forte variabilité, en autorisant l'algorithme à les sélectionner plus souvent. Dans ce scénario de capture de données, ceci semble particulièrement pertinent puisque la récompense obtenue dépend grandement de la fréquence de publication des utilisateurs. Par exemple, il est possible d'observer des récompenses nulles pendant plusieurs itérations pour certains utilisateurs uniquement par malchance (ils n'ont pas parlé à cet instant précis), sans pour autant qu'ils soient intrinsèquement non pertinents. Le fait d'augmenter le terme d'exploration pour ces profils à haute variabilité autorise le processus à les reconsidérer plus souvent s'il leur est déjà arrivé d'apporter de bonnes récompenses par le passé. De plus, certains profils, peut-être moins actifs que d'autres, mais possédant une forte utilité relativement au modèle de récompense en question - par exemple parce qu'ils sont actifs uniquement sur la thématique recherchée - auront plus de chances d'être réécoutés. \begin{comment} \begin{figureth} \begin{subfigureth}{0.4\textwidth} \includegraphics[width=\linewidth]{DBUS_PoliticNoRTCumRwdvsTimeStatic.pdf} \caption{Politique} \label{subFig:logoUPMC} \end{subfigureth} \begin{subfigureth}{0.4\textwidth} \includegraphics[width=\linewidth]{DBUS_ReligionNoRTCumRwdvsTimeStatic.pdf} \caption{Religion} \label{subFig:logoIRT} \end{subfigureth} \begin{subfigureth}{0.4\textwidth} \includegraphics[width=\linewidth]{DBUS_ScienceNoRTCumRwdvsTimeStatic.pdf} \caption{Science} \label{subFig:logoIRT} \end{subfigureth} \caption[Titre court]{Evolution de la récompense cumulée en fonction du temps sur la base \textit{USElections} pour différentes politiques et le modèle \textit{Topic} avec différentes thématiques.} \label{fig:XPStatUS} \end{figureth} \end{comment} \begin{figureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBUS_PoliticCumRwdvsTimeStatic.pdf} \caption{Politique} \end{subfigureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBUS_ReligionCumRwdvsTimeStatic.pdf} \caption{Religion} \end{subfigureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBUS_ScienceCumRwdvsTimeStatic.pdf} \caption{Science} \end{subfigureth} \caption[Gain vs temps base \textit{USElections} modèle statique]{Evolution de la récompense cumulée en fonction du temps sur la base \textit{USElections} pour différentes politiques et le modèle \textit{Topic+Influence} avec différentes thématiques.} \label{fig:XPStatUSRT} \end{figureth} \begin{comment} \begin{figureth} \begin{subfigureth}{0.4\textwidth} \includegraphics[width=\linewidth]{DBOG_PoliticNoRTCumRwdvsTimeStatic.pdf} \caption{Politique} \label{subFig:logoUPMC} \end{subfigureth} \begin{subfigureth}{0.4\textwidth} \includegraphics[width=\linewidth]{DBOG_ReligionNoRTCumRwdvsTimeStatic.pdf} \caption{Religion} \label{subFig:logoIRT} \end{subfigureth} \begin{subfigureth}{0.4\textwidth} \includegraphics[width=\linewidth]{DBOG_ScienceNoRTCumRwdvsTimeStatic.pdf} \caption{Science} \label{subFig:logoIRT} \end{subfigureth} \caption[Titre court]{Evolution de la récompense cumulée en fonction du temps sur la base \textit{OlympicGames} pour différentes politiques et le modèle \textit{Topic} avec différentes thématiques.} \label{fig:XPStatOG} \end{figureth} \end{comment} \begin{figureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBOG_PoliticCumRwdvsTimeStatic.pdf} \caption{Politique} \end{subfigureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBOG_ReligionCumRwdvsTimeStatic.pdf} \caption{Religion} \end{subfigureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBOG_ScienceCumRwdvsTimeStatic.pdf} \caption{Science} \end{subfigureth} \caption[Gain vs temps base \textit{OlympicGames} modèle statique]{Evolution de la récompense cumulée en fonction du temps sur la base \textit{OlympicGames} pour différentes politiques et le modèle \textit{Topic+Influence} avec différentes thématiques.} \label{fig:XPStatOGRT} \end{figureth} \begin{figureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBBrexit_PoliticCumRwdvsTimeStatic.pdf} \caption{Politique} \end{subfigureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBBrexit_ReligionCumRwdvsTimeStatic.pdf} \caption{Religion} \end{subfigureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBBrexit_ScienceCumRwdvsTimeStatic.pdf} \caption{Science} \end{subfigureth} \caption[Gain vs temps base \textit{Brexit} modèle statique]{Evolution de la récompense cumulée en fonction du temps sur la base \textit{Brexit} pour différentes politiques et le modèle \textit{Topic+Influence} avec différentes thématiques.} \label{fig:XPStatBrexitRT} \end{figureth} Finalement, la figure \ref{fig:XPStat3D} représente le gain cumulé pour les politiques \texttt{Random}, \texttt{CUCB} et \texttt{CUCBV} en fonction du temps et du nombre d'utilisateurs $k$ sélectionnés à chaque itération, sur le jeu de données \textit{USElections} et pour le modèle \textit{Topic+Influence} avec la thématique \textit{Science}. Nous remarquons que les trois surfaces ne se coupent jamais et que celle représentant \texttt{CUCBV} est toujours au-dessus de celle de \texttt{CUCB}, elle-même au-dessus de \texttt{Random}. Cela montre que peu importe le nombre d'utilisateurs écoutés simultanément, la politique \texttt{CUCBV} semble être la meilleure option. \begin{figureth} \includegraphics[width=0.7\linewidth]{3DStatRwd.pdf} \caption[Gain vs temps vs $k$ base \textit{USElections} modèle statique]{Evolution de la récompense cumulée en fonction du temps sur la base \textit{USElections} pour différentes politiques et le modèle \textit{Topic+Influence} avec la thématique \textit{Science} pour différentes valeurs de $k$. La courbe du dessus représente la politique \texttt{CUCBV}, celle du milieu \texttt{CUCB} et celle du dessous \texttt{Random}.} \label{fig:XPStat3D} \end{figureth} \subsection{En ligne} \subsubsection{Protocole} Nous proposons maintenant de tester nos modèles sur une expérience grandeur nature, en utilisant l'API de \textit{Follow Streaming} de Twitter, afin d'en confirmer l'efficacité lorsqu'il s'agit d'un réseau social entier avec la contrainte de l'API limitant le nombre d'utilisateurs pouvant être écoutés en même temps. On rappelle que la limite maximale d'utilisateurs pouvant être écoutés en même temps est de 5000. Étant donné que le nombre de connexions simultanées à l'API \textit{Streaming} de Twitter est limité, nous nous concentrons sur l'algorithme \texttt{CUCBV}, qui est apparu comme le plus performant dans les expériences hors ligne. Nous le comparons à une politique \texttt{Random}. Il est nécessaire de définir un processus d'alimentation de la base d'utilisateurs prenant en compte les contraintes réelles des API. Nous choisissons ici d'utiliser les utilisateurs référencés dans les messages des comptes écoutés à chaque instant. Concrètement, il est nécessaire de sélectionner un ensemble de comptes initiaux, puis l'ensemble des comptes $\mathcal{K}$ est alimenté à chaque itération $t$ par les utilisateurs ayant \textit{retweeté} ou répondu aux utilisateurs de $\mathcal{K}_t$. Notons que d'autres possibilités existent et seront présentées dans le prochain chapitre. Nous considérons le modèle \textit{Topic+Influence} avec la thématique \textit{Politique}. Pour cette expérience, le nombre d'utilisateurs écoutés simultanément est fixé à $k=5000$ (maximum autorisé par l'API) et la durée de chaque itération est de 5 minutes. Notre collecte s'est déroulée sur une période de 75 heures soit un total de $T=900$ itérations, en utilisant les comptes initiaux suivants:\textit{BBC}, \textit{CNN} et \textit{FoxNews}. Etant donné que le nombre de nouveaux utilisateurs rencontrés à chaque itération peut être très élevé, nous avons limité le nombre maximal de nouveaux comptes à 1000 utilisateurs à chaque itération. Cela permet d'éviter le cas où ce nombre atteindrait $k$, ce qui aurait pour conséquence de ne permettre aucune exploitation. \subsubsection{Résultats} A nouveau, la figure \ref{fig:XPStatLive} représente la récompense cumulée en fonction du temps pour les deux algorithmes testés. Elle met en valeur les bonnes performances de la méthode proposée, car la courbe \texttt{CUCBV} augmente significativement plus rapidement que la courbe \texttt{Random}. A la fin du processus, \texttt{CUCBV} obtient un gain cumulé 3 fois plus élevé que \textit{Random}. Finalement, notons que nous avons terminé avec un nombre total d'utilisateurs beaucoup plus large pour \texttt{CUCBV} que pour \texttt{Random}, ce qui est cohérent avec le fait que l'on s'oriente mieux vers des utilisateurs populaires, plus souvent \textit{retweetés}, étant donné le processus d'alimentation de la base d'utilisateurs et le modèle de récompense choisi, qui favorise les utilisateurs dont les messages sont repris \begin{figureth} \includegraphics[width=0.7\linewidth]{liveHybridk4000T300RwdNoRT.pdf} \caption[Gain vs temps XP en ligne modèle statique]{Evolution de la récompense cumulée en fonction du temps pour l'expérience en ligne pour différentes politiques.} \label{fig:XPStatLive} \end{figureth} \begin{comment} Pour finir, la figure \ref{fig:meanVsNbListen} représente la moyenne empirique en fin de processus de 50000 utilisateurs choisis aléatoirement, en fonction du nombre de fois où ils ont été sélectionnés pour la politique \texttt{CUCBV}. Elle permet d'illustrer le fonctionnement de l'algorithme. En considérant un seuil arbitraire permettant de différencier les "bons" utilisateurs des "mauvais", on remarque que la portion de bons (ensembles 1 et 2) représente $1.73\%$ de l'ensemble complet. Par ailleurs, les mauvais profils (ensemble 3) qui représentent la grande majorité ($98.25\%$) sont écoutés un petit nombre de fois. De plus, la politique de sélection parvient à écouter $75\%$ des bons profils au moins 500 fois (ensemble 1). Les $25\%$ restants (ensemble 2) sont des utilisateurs de bonne qualité, mais avec moins de certitude, qui auront de grandes chances d'être reconsidérés par l'algorithme. \begin{figureth} \includegraphics[width=0.7\linewidth]{liveHybridk4000T300Means.pdf} \caption[Moyenne vs nombre d'écoutes XP en ligne modèle statique]{Moyenne des utilisateurs en fonction du nombre fois où ils ont été sélectionnés pour l'expérience en ligne et la politique \texttt{CUCBV}.} \label{fig:meanVsNbListen} \end{figureth} \end{comment} \section{Conclusion} Dans ce chapitre, nous avons proposé une première approche de bandit à sélection multiple pour résoudre notre tâche de collecte d'information ciblée dans un réseau social. En modélisant chaque distribution de récompense par une distribution stationnaire de moyenne et de variance inconnues, nous avons été en mesure d'appliquer des algorithmes de bandits classiques, adaptés à ce cas. En outre, face à la forte variabilité des récompenses obtenues dans notre contexte, nous avons défini l’algorithme \texttt{CUCBV}, prenant en compte la variance dans sa stratégie d’exploration des récompenses. Après avoir prouvé certaines garanties de convergence, nous l’avons expérimenté dans le contexte des médias sociaux. Les expériences sur données réelles, aussi bien hors ligne qu’en ligne, ont montré la capacité de l’algorithme à s’orienter automatiquement vers des sources pertinentes relativement à une fonction de récompense donnée. Ce premier travail, basé sur des hypothèses de stationnarité, et ne faisant usage d'aucune information relative aux différents utilisateurs autres que les récompenses qu'ils ont produites, ouvre diverses perspectives quant à l'application des algorithmes de bandit à la collecte d'information en temps réel dans les médias sociaux. En particulier, l'utilisation de modèles plus complexes, modélisant plus finement le comportement des utilisateurs du réseau, semble être une voie prometteuse, que nous proposons d'explorer dans les chapitres suivants. \chapter{Modèle stationnaire avec profils constants} \minitoc \newpage \label{ModeleContextuelFixe} Dans ce chapitre, nous faisons l'hypothèse qu'un profil associé à chaque utilisateur sous-tend son utilité espérée. Une hypothèse de linéarité mettant en relation les profils et un paramètre inconnu, commun à tous les utilisateurs, nous permet de définir une stratégie d'exploration de l'espace des actions plus efficace que dans le chapitre précédent. Nous verrons que ce modèle peut se traduire par un problème de bandit contextuel avec des contextes (que nous appelons ici profils) constants. Cependant, pour notre tâche de collecte d'informations sous-contrainte, deux principaux facteurs nous empêchent d'utiliser des algorithmes existants: premièrement, les vecteurs de profil ne sont pas visibles directement. En effet seulement des échantillons de vecteurs, centrés sur les profils, sont accessibles à l'agent décisionnel. Deuxièmement, ces échantillons ne sont accessibles que pour un sous-ensemble d'utilisateurs à chaque itération. Dans cette optique, nous proposons à la fois un nouveau problème de bandit contextuel et un algorithme associé, dont nous proposons une borne supérieure du regret. Enfin, nous terminons par des expérimentations sur données artificielles et réelles, dont les résultats seront comparés aux méthodes du chapitre précédent. \section{Modèle} \label{chap2Model} Dans cette section, nous formalisons le modèle de bandits avec profils d'action. Nous nous focalisons sur le cas où une seule action est sélectionnée à chaque pas de temps ($k=1$), que nous étendrons en fin de chapitre au cas de la sélection multiple, adapté à notre besoin pour la collecte d'informations provenant de plusieurs sources simultanément. Considérons qu'à chaque utilisateur $i$ du réseau social, on associe un vecteur $\mu_{i} \in \mathbb{R}^{d}$. Ce vecteur, que l'on appellera profil, modélise certains attributs d'un utilisateur et peut contenir toute sorte de valeurs, selon le modèle et les informations disponibles sur chaque compte. Nous verrons dans la partie expérimentation un exemple de profil pouvant être utilisé. Afin de tirer profit de ces informations contextuelles, il est nécessaire de définir le modèle de récompense associé. Dans la section suivante, nous présentons un modèle de bandit contextuel linéaire existant, dont nous nous démarquerons ensuite pour notre problème de collecte basée sur des profils constants, mais cachés. \subsection{Bandits avec profils d'actions connus} Le cadre du bandit contextuel linéaire, que nous avons présenté dans la partie \ref{SectionBanditContextuel}, définit la récompense de chaque action comme une relation linéaire entre les profils et un vecteur de paramètre. Ce vecteur, inconnu à l'origine, doit être appris au fur et à mesure des itérations du processus. Concrètement, à chaque itération $t\in \left\{1,..,T\right\}$, l'agent dispose d'un ensemble $\left\{ \mu_{1},..,\mu_{K} \right\} \subset \mathbb{R}^{d} $ de $K$ vecteurs. Il choisit ensuite une action $i_{t} \in \left\{1,...,K \right\}$ et reçoit la récompense associée $r_{i_{t},t} \in \left[ 0..1 \right]$. L'hypothèse de linéarité se traduit par l'existence d'un vecteur $\beta \in \mathbb{R}^{d}$ tel que $\forall t \in \left\{1,..,T\right\}, \forall i \in \left\{1,...,K \right\}: r_{i,t}=\mu_{i}^{\top}\beta+\eta_{i,t}$, où comme dans \cite{OFUL}, $\eta_{i,t}$ est un bruit $R$-sous-gaussien de moyenne nulle, c'est-à-dire $\forall \lambda \in \mathbb{R}: \mathbb{E}[e^{\lambda\eta_{i,t}}|\mathcal{H}_{t-1}] \leq e^{\lambda^{2}R^{2}/2}$ avec $\mathcal{H}_{t-1}=\left\{(i_{s},x_{i_{s},s},r_{i_{s},s})\right\}_{s=1..t-1}$ l'historique des choix passés. Soulignons qu'un bruit gaussien $\mathcal{N}(0,\sigma^{2})$ est sous-gaussien de constante $\sigma$ et qu'une variable uniforme dans l'intervalle $[-a,a]$ est aussi sous-gaussienne de constante $a$ (voir \cite{subGaussian} pour plus de résultats sur les variables aléatoires sous-gaussiennes). Comme nous l'avons précédemment expliqué, la performance d'un algorithme de bandit peut se mesurer via la notion de pseudo-regret, dont nous rappelons les définitions ci-dessous. \begin{defi} Le pseudo-regret instantané d'un algorithme de bandit contextuel à un instant $t$, noté $reg_{t}$ est défini par: \begin{equation} reg_{t}=\mu_{i^{\star}}^{\top}\beta-\mu_{i_{t}}^{\top}\beta \end{equation} Avec $\mu_{i^{\star}}=\argmax\limits_{\mu_{i},i=1..K}\mu_{i}^{\top}\beta$ représentant le profil de l'action optimale $i^{\star}$. \end{defi} Le but d'un algorithme de bandit est de minimiser le pseudo-regret cumulé au cours du temps, défini par $\hat{R}_{T}=\sum\limits_{t=1}^{\top}reg_{t}$, avec une certaine probabilité, pour une séquence d'actions choisie $\left\{i_{1},...,i_{T}\right\}$. Le problème formulé ci-dessus est bien connu dans la littérature et peut être directement résolu via des algorithmes existants tels que \texttt{OFUL} \cite{OFUL} ou \texttt{LinUCB} \cite{banditCtxtLinUCB}, dont le regret cumulé peut être majoré. Le principe de ces algorithmes est d'utiliser un estimateur du paramètre de régression et de maintenir un ellipsoïde de confiance associé. Ce dernier permet d'obtenir un intervalle de confiance pour chaque récompense et offre ainsi la possibilité de définir des stratégies de type optimiste. De plus, il est important de noter que les profils et le paramètre de régression sont constants. Ce problème est donc aussi un problème de bandit stationnaire. En effet en notant $\mu_{i}^{\top}\beta=m_{i}$ on peut se ramener au modèle de la partie précédente. Cependant, la présence d'une structure sous-jacente entre les différentes actions, lorsqu'elle est exploitée, permet de définir des stratégies beaucoup plus performantes. Afin d'illustrer cela, prenons par exemple l'algorithme \texttt{OFUL} qui à chaque instant $t$ et pour chaque action $i$ calcule le score $s_{i,t}=\mu_{i}^{\top}\hat{\beta}_{t-1}+\alpha_{t-1}||\mu_{i}||_{V_{t-1}^{-1}}$ où $\alpha_{t-1}$, $\hat{\beta}_{t-1}$ et $V_{t-1}$ sont des paramètres communs à tous les bras, définis dans la section \ref{sectionOFUL}. L'algorithme sélectionne ensuite l'action maximisant ce score. En se plaçant dans un cadre simple où $K=4$ et $d=2$, il est possible de représenter les scores à un instant $t$ (en fixant donc $\alpha_{t-1}$, $\hat{\beta}_{t-1}$ et $V_{t-1}$) dans un espace continu à deux dimensions, comme l'illustre la figure \ref{fig:scoreOFUL2D}. Dans cette figure, les zones de couleur verte correspondent à des valeurs de scores élevées tandis que les zones de couleur rouge correspondent à des scores faibles. Ainsi, les variations de couleurs reflètent la structure sous-jacente induite par le modèle. Dans ce cas précis, l'algorithme \texttt{OFUL} sélectionnerait l'action 1, son profil étant situé dans une zone de l'espace plus prometteuse. En revanche, l'action 3 semble se situer dans une zone beaucoup moins avantageuse. Le fait d'utiliser un paramètre commun à toutes les actions permet de se projeter dans un espace où les récompenses sont structurées entre elles. De cette façon, les éléments appris sur une action nous renseignent également sur toutes les autres. L'apprentissage n'est donc plus individuel comme c'était le cas dans le chapitre précédent, mais mutualisé, ce qui permet d'explorer l'espace beaucoup plus efficacement. Imaginons qu'un grand nombre d'actions se situe dans la zone rouge de la figure. Dans ce cas, un algorithme de bandit classique devrait considérer ces dernières plusieurs fois avant de se rendre compte de leur mauvaise qualité. En revanche, un algorithme de bandit contextuel serait en mesure d'écarter ces actions beaucoup plus rapidement en les considérant comme appartenant à une zone de l'espace peu prometteuse. \begin{figureth} \includegraphics[width=0.9\linewidth]{ConfSet1.pdf} \caption[Score \texttt{OFUL} en deux dimensions]{Illustration des scores de l'algorithme \texttt{OFUL} à un instant donné dans un espace à deux dimensions.} \label{fig:scoreOFUL2D} \end{figureth} Dans la section suivante, nous introduisons un nouveau problème de bandit, basé sur la même hypothèse de linéarité, mais avec des contraintes sur l'observation des profils. \subsection{Bandits avec profils d'actions inconnus} Nous proposons un nouveau cadre, dans lequel l'ensemble des vecteurs de profils $\left\{ \mu_{1},..,\mu_{K} \right\}$ n'est pas observé directement. A la place, à chaque itération $t$, l'agent dispose d'un sous-ensemble d'actions notées $\mathcal{O}_{t}$ tel que pour toutes actions $i \in \mathcal{O}_{t}$, un échantillon $x_{i,t}$ d'une variable aléatoire centrée sur $\mu_{i}$ est révélé. En considérant les mêmes hypothèses que précédemment, le problème peut être réécrit de la façon suivante: \begin{align} \label{chap2RewritePb} \forall s\leq t :r_{i,s} &=\mu_{i}^{\top}\beta+\eta_{i,s} \nonumber \\ &=\hat{x}_{i,t}^{\top}\beta+(\mu_{i}- \hat{x}_{i,t})^{\top}\beta+\eta_{i,s} \nonumber\\ &=\hat{x}_{i,t}^{\top}\beta+\epsilon_{i,t}^{\top}\beta+\eta_{i,s} \end{align} Où $\epsilon_{i,t}=\mu_{i}-\hat{x}_{i,t}$, $\hat{x}_{i,t}=\dfrac{1}{n_{i,t}}\sum\limits_{s \in{T_{i,t}^{obs}} } x_{i,s}$, avec $T_{i,t}^{obs}=\left\{ s\leq t, i\in \mathcal{O}_{s}\right\}$ et $n_{i,t}=|T_{i,t}^{obs}|$. Concrètement, $n_{i,t}$ correspond au nombre de fois où un échantillon associé à l'action $i$ a été délivré jusqu'au temps $t$ et $\hat{x}_{i,t}$ correspond à la moyenne empirique des échantillons observés pour $i$ au temps $t$. Ainsi ce problème diverge des instances existantes du bandit contextuel traditionnel par les deux aspects principaux suivants: \begin{enumerate} \item Les profils ne sont pas visibles directement, on ne dispose que d'échantillons centrés sur ces derniers; \item A chaque itération, on ne dispose pas d'échantillon pour tous les bras, seulement pour un sous-ensemble. \end{enumerate} Contrairement au bandit contextuel traditionnel de la section précédente, ici l'incertitude est double. Elle provient d'une part de l'estimateur du paramètre de régression $\beta$, mais aussi des échantillons observés. Ainsi un algorithme devra à la fois estimer $\beta$, mais aussi les vecteurs $\left\{ \mu_{1},..,\mu_{K} \right\}$. Pour ces derniers nous utiliserons la moyenne empirique comme estimateur, comme le suggère l'équation \ref{chap2RewritePb}. Il est important de noter que dans l'écriture précédente, où l'on écrit la récompense à un instant $s\leq t$, le bruit dépend bien de $s$ et la moyenne empirique de $t$. D'après la loi des grands nombres, plus le nombre d'observations augmente, plus la moyenne empirique se rapproche de la vraie valeur du profil. Nous laissons les détails mathématiques nécessaires à la dérivation de notre algorithme à la section suivante. Nous illustrons la différence par rapport au cas précédent dans la figure \ref{fig:scoreOFUL2DBis}\footnote{Nous insistons sur le fait qu'il s'agit uniquement d'une illustration permettant d'appréhender la différence avec le cas traditionnel sans incertitude sur les profils.}, qui représente par des cercles l'incertitude liée à l'approximation des profils par les moyennes empiriques des échantillons associés. Contrairement à la figure \ref{fig:scoreOFUL2D}, où les profils sont connus, on ne dispose ici que d'intervalles de confiance de différentes tailles, centrés sur les moyennes empiriques (représentées par des croix bleues verticales), dans lequel on sait que le profil se situe, avec une certaine probabilité. L'action la plus prometteuse est toujours l'action 1, dont le véritable profil (représenté par une croix noire) se situe dans la zone la plus verte de l'espace. Or, ce profil est inconnu, autrement dit, le véritable positionnement de cette croix n'est pas disponible. Une solution naïve consisterait alors à utiliser directement la moyenne empirique de chaque action pour déterminer son score. D'après la figure, ceci conduirait à sélectionner l'action 2, dont la moyenne empirique (croix bleue) se situe dans la zone la plus verte, ce qui constitue un choix sous-optimal par rapport à un algorithme qui connaîtrait les profils. Ceci est dû au fait que la moyenne empirique peut être plus ou moins éloignée du véritable profil. Nous proposons de prendre en compte cette incertitude supplémentaire dans le choix de l'action à sélectionner. Ainsi, en utilisant le principe d'optimisme devant l'incertain, un algorithme prenant en compte l'incertitude sur les profils sélectionnerait l'action 1, dont le cercle représentant l'incertitude du profil touche la zone la plus verte de l'espace. \begin{figureth} \includegraphics[width=0.9\linewidth]{ConfSet2.pdf} \caption[Score \texttt{OFUL} en deux dimensions avec incertitude sur les profils]{Illustration de l'incertitude supplémentaire apportée par la non-connaissance des profils.} \label{fig:scoreOFUL2DBis} \end{figureth} Dans la suite, nous proposons de définir un algorithme adapté à ce cas étape par étape, dans un contexte de processus de révélation des profils générique, que l'on déclinera pour les trois cas suivants: \begin{itemize} \item \textbf{Cas 1}: A chaque pas de temps $t$, toutes les actions livrent un échantillon c.-à-d.: $\forall t$, $\mathcal{O}_{t}=\left\{1,...,K \right\}$; \item \textbf{Cas 2}: A chaque pas de temps $t$, chaque action possède une probabilité $p$ de livrer un échantillon. Dans ce cas, le contenu, mais aussi la taille de $\mathcal{O}_{t}$ varie au cours du temps; \item \textbf{Cas 3}: A chaque pas de temps $t$, seule l'action sélectionnée à l'itération précédente livre un échantillon c.-à-d.: $\forall t$, $\mathcal{O}_{t}=i_{t-1}$. \end{itemize} Le premier cas correspond au cas le plus simple, où la seule différence avec un problème de bandit contextuel traditionnel provient du fait que les observations de contexte sont bruitées. Le second cas introduit une difficulté supplémentaire au sens où, à chaque instant, toutes les actions n'ont pas le même nombre d'observations, entraînant ainsi une différence d'incertitude entre ces dernières. Finalement, le dernier point, à notre sens le plus utile, s'intéresse au cas où un échantillon est observé uniquement pour l'action sélectionnée au temps précédent. Il apparaît que ce cas se rapproche le plus des conditions classiques du bandit stochastique, pour lequel aucune information n'est disponible à chaque instant, si ce n'est pour l'action qui a été sélectionnée. Dans cette configuration, l'utilisation de l'incertitude sur les profils dans la stratégie de sélection est indispensable pour obtenir une estimation relativement optimiste des utilités espérées pour les différentes actions, et ainsi être à même de garantir une convergence de l'algorithme vers les meilleures actions. Nous proposons dans la section suivante d'élaborer une politique permettant de prendre en compte l'incertitude sur les profils dans sa stratégie de sélection, afin de reconsidérer les actions dont les profils sont les moins bien connus. \section{Algorithme} Dans cette partie, nous dérivons une suite de propositions qui nous permettra de définir une politique de sélection adaptée à notre problème. Il s'agit dans un premier temps de définir un estimateur du paramètre de régression ainsi qu'un intervalle de confiance associé. Pour ce faire, nous utiliserons des résultats provenant de la théorie des processus auto normalisés étudiée dans \cite{PenaLaiShao2009}. Il s'agit ensuite de définir des estimateurs des profils d'actions, avec leurs propres intervalles de confiance. L'utilisation de ces derniers nous permettra de définir une borne supérieure de l'intervalle de confiance associé à chaque récompense et par conséquent de définir une politique optimiste. \textbf{Notations:} Etant donnée une matrice définie positive $A\in \mathbb{R}^{d\times d}$ on note dans la suite $\lambda_{min}(A)$ sa plus petite valeur propre. \subsection{Régression et intervalle de confiance} \begin{prop} \label{SubGaussianProp} Supposons que pour tout $i$, à chaque temps $t$, les échantillons $x_{i,t} \in \mathbb{R}^{d}$ sont iid d'une loi de moyenne $\mu_{i}\in \mathbb{R}^{d}$ , et qu'il existe un réel $L>0$ tel que $||x_{i,t}||\leq L$ et un réel $S>0$ tel que $||\beta||\leq S$. Alors pour tout $i$ et tout $s\leq t$, la variable aléatoire $\epsilon_{i,t}^{\top}\beta+\eta_{i,s}$ est conditionnellement sous-gaussienne de constante $R_{i,t}=\sqrt{R^{2}+\dfrac{L^{2}S^{2}}{n_{i,t}}}$. \end{prop} \begin{preuve} Disponible en annexe \ref{PreuveSubGauss}. \end{preuve} Cette proposition nous permettra dans la suite de construire un estimateur du paramètre $\beta$ et d'un intervalle de confiance associé. On se place à un instant $t$, après avoir observer les échantillons de profil $x_{i,t}$ des actions $i$ appartenant à $\mathcal{O}_{t}$, mais avant d'effectuer la sélection de l'action $i_{t}$. On dispose donc de l'ensemble d'observations suivantes: $\left\{r_{i_{s},s},\hat{x}_{i_{s},t}\right\}_{s=1..t-1}$. Les notations vectorielles et matricielles suivantes sont utilisées: \begin{itemize} \item $\eta^{'}_{t-1}=(\eta_{i_s,s}+\epsilon_{i_{s},t}^{\top}\beta)_{s=1..t-1}^{\top}$ le vecteur des bruits de taille $t-1$. Par convention on prend $\eta^{'}_{0}=0$. \item $X_{t-1}=(\hat{x}_{i_{s},t}^{\top})_{s=1..t-1}$ la matrice de taille $(t-1)\times d$ des moyennes empiriques des actions choisies, où la $s^{ieme}$ ligne correspond à la moyenne empirique au temps $t$ de l'action choisie au temps $s$. Il est important de noter que, contrairement au cas du bandit linéaire classique dans lequel à chaque instant on ajoute une ligne à cette matrice sans modifier les autres, ici dès qu'un bras révèle un échantillon de profil, sa moyenne empirique est modifiée et par conséquent toutes les lignes de $X_{t}$ associées le sont aussi. Nous verrons par la suite qu'il est possible de faire ces mises à jour de façon efficace. Par convention on prend $X_{0}=0_{d}$. \item $Y_{t-1}=(r_{i_{s},s})_{s=1..t-1}^{\top}$ le vecteur des récompenses de taille $t-1$. Par convention on prend $Y_{0}=0$. \item $A_{t-1}=diag(1/R_{i_{s},t})_{s=1..t-1}$ la matrice diagonale de taille $(t-1)\times (t-1)$ dont le $s^{ieme}$ élément diagonal vaut $1/R_{i_{s},t}$. Notons que, pour un bras spécifique, la valeur de ce coefficient augmente à mesure que son nombre d'observations augmente. Par convention on prend $A_{0}=1$. \end{itemize} Avec les notations précédentes, le problème de régression au temps $t$ peut s'écrire sous forme matricielle de la façon suivante: \begin{equation} \label{probReg} Y_{t-1}=X_{t-1}\beta+\eta^{'}_{t-1} \end{equation} \begin{prop} On note $\hat{\beta}_{t-1}$ l'estimateur des moindres carrés $l^{2}$-régularisé de $\beta$ associé au problème défini dans l'équation \ref{probReg}, où chaque exemple est pondéré par le coefficient associé $1/R_{i_{s},t}$. On a: \begin{align} \label{regressor} \hat{\beta}_{t-1} &= \arg\min_{\beta} \sum\limits_{s=1}^{t-1} \dfrac{1}{R_{i_{s},t}}(\beta^{\top}\hat{x}_{i_{s},t}- r_{i_{s},s})^{2} + \lambda ||\beta||^{2}\\ &=(X_{t-1}^{\top}A_{t-1}X_{t-1}+\lambda I)^{-1}X_{t-1}^{\top}A_{t-1}Y_{t-1} \end{align} Où $\lambda>0$ est la constante de régularisation. \end{prop} \begin{preuve} En écrivant le problème de minimisation sous la forme matricielle suivante: $\hat{\beta}_{t-1} = \argmin\limits_{\beta}(Y_{t-1}-X_{t-1}\beta)^{\top}A_{t-1}(Y_{t-1}-X_{t-1}\beta)+\lambda \beta^{\top}\beta$ et en annulant le gradient, on obtient directement le résultat souhaité. \end{preuve} Cet estimateur utilise les moyennes empiriques comme exemples d'apprentissages, cependant afin de prendre en compte l'incertitude associée à cette approximation, nous pondérons chaque exemple par un coefficient traduisant la confiance que l'on a en ce dernier. Ce coefficient, par définition, tendra vers une constante à mesure que le nombre d'observations augmente. Il nous permet également, conformément au théorème suivant, de définir un intervalle de confiance sur l'estimateur proposé. \begin{theo} \label{ConfInt} Soit $V_{t-1}=\lambda I+ X_{t-1}^{\top}A_{t-1}X_{t-1}=\lambda I +\sum\limits_{s=1}^{t-1}\dfrac{\hat{x}_{i_{s},t}\hat{x}_{i_{s},t}^{\top}}{R_{i_{s},t}}$, alors avec les mêmes hypothèses que dans la proposition \ref{SubGaussianProp}, pour tout $0<\delta<1$, avec une probabilité au moins égale à $1-\delta$, pour tout $t \geq 0$: \begin{equation} \label{confIntTheta} ||\hat{\beta}_{t-1}-\beta||_{V_{t-1}} \leq \sqrt{2\log\left(\dfrac{det(V_{t-1})^{1/2}det(\lambda I)^{-1/2}}{\delta}\right)} +\sqrt{\lambda}S=\alpha_{t-1} \end{equation} \end{theo} \begin{preuve} Disponible en annexe \ref{PreuveConfInt} \end{preuve} Cet intervalle de confiance ressemble à celui utilisé dans l'algorithme \texttt{OFUL} \cite{OFUL}, cependant une différence notable vient de la définition de la matrice $V_{t}$ qui prend ici en compte une pondération. Un point important du résultat du théorème précédent concerne le fait que l'inégalité est vraie uniformément pour tout $t$ avec une probabilité commune. Nous utiliserons ce résultat lorsque nous bornerons le pseudo-regret cumulé de notre algorithme. Le théorème suivant établit un intervalle pour les estimateurs des profils d'action. \begin{theo} \label{ConfIntProfils} Pour tout $i$ et tout $t>0$ avec une probabilité au moins égale à $1-\delta/t^{2}$, on a: \begin{equation} \label{EqConfIntProfils} ||\hat{x}_{i,t}-\mu_{i}|| \leq Ld\sqrt{\dfrac{2}{n_{i,t}}\log\left( \dfrac{2dt^{2}}{\delta}\right)} = \rho_{i,t,\delta} \end{equation} \end{theo} \begin{preuve} Cette inégalité provient de l'application de l'inégalité de Hoeffding à chaque dimension séparément. Disponible en annexe \ref{PreuveConfIntProfils}. \end{preuve} Contrairement à l'intervalle de confiance associé au paramètre de régression, celui sur les profils n'est pas vrai de façon uniforme. En effet, pour le paramètre $\beta$, on dispose d'un intervalle de confiance pour $\hat{\beta}_{t}$ valable avec une certaine probabilité pour tous les temps $t$ simultanément. En revanche, pour les paramètres $\mu_{i}$ on dispose d'un intervalle de confiance pour $\hat{x}_{i,t}$ valable pour chaque temps séparément. Pour obtenir une probabilité uniforme (c.-à-d. tous les temps $t$ simultanément), nous utilisons le principe de la borne uniforme. Pour un $i$ donné, on a: $\mathbb{P}(\forall t, ||\hat{x}_{i,t}-\mu_{i}||\leq \rho_{i,t,\delta} )=1-\mathbb{P}(\exists t, ||\hat{x}_{i,t}-\mu_{i}|| \geq \rho_{i,t,\delta} ) \geq 1-\sum\limits_{t}\mathbb{P}(||\hat{x}_{i,t}-\mu_{i}|| \geq \rho_{i,t,\delta} ) \geq 1-\sum\limits_{t}\delta/t^{2}$. Ceci nous permet de justifier la forme en $\delta/t^{2}$ permettant, une fois sommée sur tous les pas de temps, d'obtenir une probabilité uniforme. En effet, on a $\sum\limits_{t=2}^{\infty}\delta/t^{2} = \delta(\pi^{2}/6-1)\leq \delta$. \begin{note}[Précision de l'inégalité de Hoeffding en plusieurs dimensions] La figure \ref{fig:illustHoeffding} illustre l'effet provoqué par notre application de l'inégalité de Hoeffding à chaque dimension de façon individuelle. Le cercle représente l'hypothèse de travail de base, à savoir $||x_{i,t}||\leq L$. Cependant, en appliquant l'inégalité de Hoeffding à chaque dimension, il s'avère que nous majorons en quelque sorte cette hypothèse. Ainsi le carré illustre la nouvelle hypothèse, moins restrictive que la précédente. En effet, la zone à l'intérieur du carré et à l'extérieur du cercle représente une zone dans laquelle par hypothèse, on ne peut pas se trouver. Par conséquent, en pratique, on pourra prendre $\rho_{i,t,\delta} = \min\left( Ld\sqrt{\dfrac{2}{n_{i,t}}\log\left( \dfrac{2dt^{2}}{\delta}\right)},2L\right)$. \end{note} \begin{figureth} \includegraphics[width=0.8\linewidth]{Hoeffding.pdf} \caption[Illustration inégalité Hoeffding en plusieurs dimensions]{Illustration de l'application de l'inégalité de Hoeffding sur chaque dimension dans le cas $d=2$.} \label{fig:illustHoeffding} \end{figureth} Nous sommes maintenant prêts à proposer un algorithme adapté à notre problème, ce qui est l'objet de la section suivante. \subsection{Présentation de l'algorithme} Le principe derrière les algorithmes de type UCB est de maintenir un intervalle de confiance sur la récompense associée à chaque action et d'en sélectionner une de façon optimiste à chaque instant, c'est-à-dire celle avec la borne supérieure de l'intervalle de confiance de son utilité la plus élevée. D'une façon générale, plus serrés seront les intervalles de confiance que nous sommes capables de construire, meilleure sera la borne sur le regret. Dans le cas du bandit linéaire classique, cela revient directement à construire un bon estimateur du paramètre de régression $\beta$, comme nous l'avons fait dans la section précédente. Cependant dans notre cas, une source additionnelle d'incertitude est présente à cause de la variabilité des échantillons observés. Ainsi, à chaque instant $t$ il est nécessaire de définir une nouvelle borne supérieure de l'intervalle de confiance pour chaque récompense. Dans cette optique, nous proposons la politique \texttt{SampLinUCB}, que nous détaillons dans l'algorithme \ref{algoSampLinUCB}. Il procède de la façon suivante: \begin{enumerate} \item Les paramètres communs $V$ et $b$ sont dans un premier temps initialisés (lignes 1 et 2). \item On initialise chaque action en la sélectionnant un fois: une récompense et un échantillon de contexte sont observés, ce qui permet d'initialiser les paramètres propres à chaque action (lignes 3 à 9). Notons que si cette initialisation est indispensable pour le cas 3, dans le cas 2 (et \textit{a fortiori} dans le cas 1) il n'est pas nécessaire de sélectionner une fois chaque action. En revanche, dans le cas 2, une action dont un échantillon de profil n'a jamais été observé ne peut pourra pas être sélecionnée. \item Ensuite, à chaque itération $t$, pour chaque action $i$ appartenant à $\mathcal{O}_{t}$ (selon les cas 1, 2 ou 3 définis précédemment), on observe l'échantillon $x_{i,t}$ associé et on met à jour le nombre d'observation $n_{i}$, la moyenne empirique $\hat{x}_{i}$ ainsi que le paramètre d'incertitude $R_{i}$ (ligne 15). Les paramètres commun $V$ et $b$ sont également mis à jour en fonction de ces nouvelles valeurs en retranchant les anciennes (ligne 13) et en ajoutant les nouvelles (ligne 16). Notons que cette mise à jour a une emprunte mémoire faible. \item L'algorithme calcule ensuite le score $s_{i,t}$ (ligne 20) de chaque action en fonction de ses paramètres (voir l'équation \ref{scoreSampLinUCB} et la description des éléments du score ci-après), puis sélectionne l'action ayant le score le plus élevé (ligne 22), reçoit la récompense associée (ligne 23) et met à jour ses paramètres (lignes 24 à 26). \end{enumerate} \begin{comment} \begin{algorithm}[h!] $V_{0} =\lambda I_{d\times d}$ (matrice identité de taille $d$)\; $b_{0} = 0_{d}$ (vecteur nul de taille $d$)\; \For{$i \in \mathcal{K}$} { $N_{i,0}=0$\; $S_{i,O}=0$\; } \For{$i \in \mathcal{K}$} { Observer un échantillon $x_{i,0}$ et initialiser $\hat{x}_{i,0}$ et $R_{i,0}$\; } \For{$t=1..T$} { Recevoir $\mathcal{O}_{t}$\; \label{getnewObservationsSamplin} \For{$i \in \mathcal{O}_{t}$} { $V_{t-1}=V_{t-1}-N_{i,t}\dfrac{\hat{x}_{i,t-1}\hat{x}_{i,t-1}^{\top}}{R_{i,t-1}}$ \; $b_{t-1} = b_{t-1}-S_{i,t}\dfrac{\hat{x}_{i,t-1}}{R_{i,t-1}}$\; Observer $x_{i,t}$, mettre à jour $\hat{x}_{i,t}$ et $R_{i,t}$\; \label{observeAndUpdateSamplin} $V_{t-1}=V_{t-1}+N_{i,t}\dfrac{\hat{x}_{i,t}\hat{x}_{i,t}^{\top}}{R_{i,t}}$ \; $b_{t-1} = b_{t-1}+S_{i,t}\dfrac{\hat{x}_{i,t}}{R_{i,t}}$\; } $\hat{\beta}_{t-1} = V_{t-1}^{-1}b_{t-1}$\;\label{updateThetaSamplin} \For{$i \in \mathcal{K}$} { Calculer $s_{i,t}$ avec la formule \ref{scoreSampLinUCB} \; } $i_{t} = \argmax\limits_{i \in \mathcal{K}} \quad s_{i,t}$ \; Recevoir $r_{i_{t},t}$\; $V_{t} = V_{t-1}+\dfrac{\hat{x}_{i_{t},t}\hat{x}_{i_{t},t}^{\top}}{R_{i_{t},t}}$ \; $b_{t} = b_{t-1}+\dfrac{\hat{x}_{i_{t},t} r_{i_{t},t}}{R_{i_{t},t}}$\; } \caption{\texttt{SampLinUCB}} \label{algoSampLinUCB} \end{algorithm} \end{comment} \begin{algorithm}[h!] $V =\lambda I_{d\times d}$ (matrice identité de taille $d$)\; $b = 0_{d}$ (vecteur nul de taille $d$)\; \For{$t=1..K$} { Sélectionner $i_{t}=t$ et recevoir $r_{i_{t},t}$\; $N_{i_{t}}=1$; $S_{i_{t}}=r_{i_{t},t}$\; Observer un échantillon de contexte $x_{i,t}$\; $n_{i_{t}}=1$; $\hat{x}_{i_{t}}=x_{i,t}$; $R_{i_{t}}=\sqrt{1+\dfrac{L^{2}S^{2}}{n_{i_{t}}}}$\; $V=V+N_{i}\dfrac{\hat{x}_{i}\hat{x}_{i}^{\top}}{R_{i}}$; $b= b+S_{i}\dfrac{\hat{x}_{i}}{R_{i}}$\; } \For{$t=K+1..T$} { Recevoir $\mathcal{O}_{t}$\; \label{getnewObservationsSamplin} \For{$i \in \mathcal{O}_{t}$} { $V=V-N_{i}\dfrac{\hat{x}_{i}\hat{x}_{i}^{\top}}{R_{i}}$; $b = b-S_{i}\dfrac{\hat{x}_{i}}{R_{i}}$\; Observer $x_{i,t}$\; $n_{i}=n_{i}+1$; $\hat{x}_{i}=\dfrac{(n_{i}-1)\hat{x}_{i}+x_{i,t}}{n_{i}}$; $R_{i}=\sqrt{1+\dfrac{L^{2}S^{2}}{n_{i}}}$\; $V=V+N_{i}\dfrac{\hat{x}_{i}\hat{x}_{i}^{\top}}{R_{i}}$; $b= b+S_{i}\dfrac{\hat{x}_{i}}{R_{i}}$\; } $\hat{\beta} = V^{-1}b$\;\label{updateThetaSamplin} \For{$i \in \mathcal{K}$} { Calculer $s_{i,t}$ avec la formule \ref{scoreSampLinUCB} \; } Sélectionner $i_{t} = \argmax\limits_{i \in \mathcal{K}} \quad s_{i,t}$ \; Recevoir $r_{i_{t},t}$\; $N_{i_{t}}=N_{i_{t}}+1$\; $S_{i_{t}}=S_{i_{t}}+r_{i_{t},t}$\; $V= V+\dfrac{\hat{x}_{i_{t}}\hat{x}_{i_{t}}^{\top}}{R_{i_{t}}}$; $b = b+r_{i_{t},t}\dfrac{\hat{x}_{i_{t}}}{R_{i_{t}}}$\; } \caption{\texttt{SampLinUCB}} \label{algoSampLinUCB} \end{algorithm} Le score de sélection $s_{i,t}$ pour chaque action $i$ et à chaque instant $t$ est le suivant: \begin{align} \label{scoreSampLinUCB} s_{i,t} =(\hat{x}_{i,t}+\overline{\epsilon}_{i,t})^{\top}\hat{\beta}_{t-1} + \alpha_{t-1} ||\hat{x}_{i,t}+\tilde{\epsilon}_{i,t}||_{V_{t-1}^{-1}} \end{align} avec: \begin{itemize} \item $\overline{\epsilon}_{i,t} =\dfrac{\rho_{i,t,\delta} \hat{\beta}_{t-1}}{||\hat{\beta}_{t-1}||}$; \item $\tilde{\epsilon}_{i,t} = \dfrac{\rho_{i,t,\delta} \hat{x}_{i,t}}{\sqrt{\lambda}||\hat{x}_{i,t}||_{V_{t-1}^{-1}}}$; \end{itemize} Les vecteurs $\overline{\epsilon}_{i,t}$ et $\tilde{\epsilon}_{i,t}$ ont pour rôle de gérer l'incertitude sur les profils estimés. Intuitivement, ils autorisent l'algorithme à sélectionner des actions dont, soit le profil est dans une zone intéressante, soit l'incertitude sur le profil est grande, le but étant d'éliminer les actions étant les moins bonnes avec une forte probabilité (celles dont l'incertitude sur le profil ne permet pas d'atteindre une zone potentiellement intéressante, relativement à l'estimation courante du paramètre $\beta$). Nous proposons ci-dessous d'illustrer les différents paramètres de l'algorithme pour mieux en comprendre le fonctionnement. \textbf{Illustration du fonctionnement de l'algorithme:} La figure \ref{fig:illustSamplLinUCB} représente une illustration des différentes grandeurs intervenant dans l'algorithme \texttt{SampLinUCB} pour une action donnée dans un espace à deux dimensions. Pour ne pas surcharger la figure, nous avons enlevé les indices de temps $t$ et d'action $i$. On représente les différents vecteurs par des flèches, ainsi la rouge représente $\hat{x}$, la violette $\hat{x}+\tilde{\epsilon}$ et la verte $\hat{x}+\overline{\epsilon}$. Conformément à la définition de $\tilde{\epsilon}$, $\hat{x}$ et $\hat{x}+\tilde{\epsilon}$ sont colinéaires. En revanche, ce n'est pas le cas de $\hat{x}$ et $\hat{x}+\overline{\epsilon}$, car $\overline{\epsilon}$ (qui correspond au vecteur joignant le bout de la flèche rouge à celui de la flèche verte) est colinéaire à $\hat{\beta}$. La projection de $\hat{x}+\overline{\epsilon}$ sur $\hat{\beta}$ (correspondant à $(\hat{x}+\overline{\epsilon})^{\top}\hat{\beta}$) a une valeur plus élevée que la projection de $\hat{x}$ sur $\hat{\beta}$ (correspondant à $\hat{x}^{\top}\hat{\beta}$). Par ailleurs, la valeur de $||\hat{x}+\tilde{\epsilon}||$ est toujours plus élevée que la valeur de $||\hat{x}||$. Ces deux phénomènes sont directement dus au fait que, d'une part, $\overline{\epsilon}$ est colinéaire à $\hat{\beta}$ et de même sens, et d'autre part, $\tilde{\epsilon}$ est colinéaire à $\hat{x}$ et de même sens. Ainsi, les vecteurs $\overline{\epsilon}$ et $\tilde{\epsilon}$ prenant en compte les incertitudes sur les profils ont toujours une contribution positive par rapport à un score ne les prenant pas en compte, ce qui traduit le fait que l'algorithme est optimiste sur le profils. \begin{figureth} \includegraphics[width=0.6\linewidth]{IllustCompSampLinUCBNew.pdf} \caption[Illustration \texttt{SampLinUCB}]{Illustration du fonctionnement de l'algorithme \texttt{SampLinUCB} dans un espace à deux dimensions.} \label{fig:illustSamplLinUCB} \end{figureth} \begin{prop} Le score $s_{i,t}$ de l'équation \ref{scoreSampLinUCB} peut se réécrire de la façon suivante: \begin{align} \label{scoreSampLinUCBBis} s_{i,t} =\hat{x}_{i,t}^{\top}\hat{\beta}_{t-1} + \alpha_{t-1} ||\hat{x}_{i,t}||_{V_{t-1}^{-1}}+\rho_{i,t,\delta}\left(||\hat{\beta}_{t-1}||+\dfrac{\alpha_{t-1}}{\sqrt{\lambda}}\right) \end{align} \end{prop} \begin{preuve} \begin{align*} s_{i,t} & =(\hat{x}_{i,t}+\overline{\epsilon}_{i,t})^{\top}\hat{\beta}_{t-1} + \alpha_{t-1} ||\hat{x}_{i,t}+\tilde{\epsilon}_{i,t}||_{V_{t-1}^{-1}}\\ &= \hat{x}_{i,t}^{\top}\hat{\beta}_{t-1} + \dfrac{\rho_{i,t,\delta} \hat{\beta}_{t-1}^{\top}}{||\hat{\beta}_{t-1}||}\hat{\beta}_{t-1} + \alpha_{t-1}||\hat{x}_{i,t}+\dfrac{\rho_{i,t,\delta} \hat{x}_{i,t}}{\sqrt{\lambda}||\hat{x}_{i,t}||_{V_{t-1}^{-1}}}||_{V_{t-1}^{-1}} \\ &=\hat{x}_{i,t}^{\top}\hat{\beta}_{t-1} +\rho_{i,t,\delta} ||\hat{\beta}_{t-1}|| +\alpha_{t-1}\left(1+\dfrac{\rho_{i,t,\delta}}{\sqrt{\lambda}||\hat{x}_{i,t}||_{V_{t-1}^{-1}}}\right) ||\hat{x}_{i,t}||_{V_{t-1}^{-1}} \\ &=\hat{x}_{i,t}^{\top}\hat{\beta}_{t-1} + \alpha_{t-1} ||\hat{x}_{i,t}||_{V_{t-1}^{-1}}+\rho_{i,t,\delta}\left(||\hat{\beta}_{t-1}||+\dfrac{\alpha_{t-1}}{\sqrt{\lambda}}\right) \end{align*} \end{preuve} Cette nouvelle forme du score associé à chaque action nous permet d'avoir un œil différent sur le comportement de l'algorithme à chaque instant. La première partie du score $\hat{x}_{i,t}^{\top}\hat{\beta}_{t-1} + \alpha_{t-1} ||\hat{x}_{i,t}||_{V_{t-1}^{-1}}$ ressemble fortement au score de l'algorithme \texttt{OFUL} classique ne prenant pas en compte d'incertitude sur les vecteurs de contexte. D'autre part, le second terme $\rho_{i,t,\delta}\left(||\hat{\beta}_{t-1}||+\dfrac{\alpha_{t-1}}{\sqrt{\lambda}}\right)$ est directement proportionnel au coefficient $\rho_{i,t,\delta}$ de chaque action, puisque les autres termes sont communs à tous les bras. On voit bien apparaître une "prime" donnée aux bras ayant été les moins observés. Notons que si l'on considère le cas 1, c'est à dire celui où on tous les bras délivrent un échantillon à chaque itération, alors le second terme est le même pour tous et peut donc être retiré du score de sélection. Ainsi dans ce cas, l'algorithme proposé revient à un algorithme \texttt{OFUL} qui utiliserait des moyennes empiriques en guise de vecteur de contexte, outre le mode de mise à jour des paramètres de régression, qui contiennent l'incertitude sur les profils dans notre cas. Cependant, cette reformulation du score de sélection devient particulièrement intéressante lorsque l'on se penche sur le cas 3, c'est-à-dire celui où seule l'action choisie au temps précédent délivre un échantillon. Dans cette situation, la prime donnée aux bras peu observés traduit directement le fait que l'algorithme cherche à la fois à diminuer l'incertitude sur les paramètres de régression, et celle sur les profils des différentes actions. Sans ce terme supplémentaire, l'algorithme pourrait aisément se bloquer sur des actions sous-optimales (voir l'exemple proposé précédemment). Pour s'en convaincre, nous proposons d'analyser un scénario simple ci-dessous. \textbf{Exemple pour le cas 3: } Considérons un scénario à deux actions $A$ et $B$ avec $\mu_{A}^{\top}\beta>\mu_{B}^{\top}\beta$, un espace des profils de dimension 2, des contextes dont toutes les composantes sont bornées (entre 0 et 1) et des récompenses bornées (entre 0 et 1). Le processus est initialisé de la façon suivante: à l'instant $t=1$, l'action $A$ est sélectionnée et la récompense $r_{A}$ est reçue (les indices de temps ont été enlevés pour alléger les notations). A l'instant $t=2$, conformément au cas étudié, on commence par observé un échantillon de contexte $x_{A}$ pour la dernière action sélectionnée puis l'action $B$ est sélectionnée et la récompense $r_{B}$ est reçue. La stratégie de sélection débute à l'instant $t=3$, pour lequel, on commence par observé un échantillon de contexte $x_{B}$ pour la dernière action sélectionnée. Considérons de plus que $x_{A}=(0,0)$ et $x_{B}=(1,1)$ (ce qui est une possibilité en raison du caractère aléatoire des échantillons). Si l'on considère un algorithme naïf n'utilisant que les moyennes empiriques (et pas les $\epsilon$), alors, on a pour chaque action un score de la forme $s_{i}=\hat{x}_{i}^{\top}\hat{\beta}+\alpha||\hat{x}_{i}||_{V^{-1}}$. On a donc $s_{A}=0$ car $\hat{x}_{A}=(0,0)$ d'après l'échantillon observé. On peut par ailleurs montrer que toutes les composante de $\hat{\beta}$ sont positives dans ce cas, ce qui entraîne $s_{B}>0$ car $\hat{x}_{B}=(1,1)$ d'après l'échantillon observé. Ainsi, à l'instant 3, c'est l'action $B$ qui serait sélectionnée. En répétant ce processus aux itérations suivantes, il apparaît que l'algorithme reserait bloquée sur l'action $B$, qui d'après l'hypothèse de départ est sous-optimale. Nous venons donc de trouver un cas dans lequel une application naïve de l'algorithme \texttt{OFUL} conduirait à un regret linéaire en raison d'une "mauvaise" initialisation due à l'aspect aléatoire des échantillons de profils observés. Dans la section suivante, nous dérivons une borne du regret générique pour notre algorithme, puis, pour chacun des trois cas, nous proposons une borne spécifique. Nous finissons par étendre l'algorithme - ainsi que sa borne - au cas de la sélection multiple. \subsection{Regret} \label{chap1RegSection} Le théorème ci-dessous établit une borne supérieure du regret cumulé de l'algorithme proposé dans la section précédente. La borne concerne le cas générique, où aucune hypothèse spécifique n'est faite sur le processus générant $\mathcal{O}_{t}$ à chaque itération $t$. \begin{theo}[Borne générique] \label{RegretSamplLinUCBGeneric} En choisissant $\lambda \geq \max(1,2L^{2})$, avec une probabilité au moins égale à $1-3\delta$, le pseudo-regret cumulé de l'algorithme \texttt{SampLinUCB} est majoré par: \begin{multline} \label{cumulRegSamplLin} \hat{R}_{T} \leq C + 4Ld\left(\sqrt{\dfrac{d}{\lambda}\log\left(\dfrac{1+TL^{2}/\lambda}{\delta}\right)}+2S\right)\sqrt{\log\left( \dfrac{2dT^{2}}{\delta}\right)} \sum\limits_{t=1}^{T} \dfrac{2}{\sqrt{n_{i_{t},t}}} \\ + 2\left(\sqrt{d\log\left(\dfrac{1+TL^{2}/\lambda}{\delta}\right)} + \sqrt{\lambda}S\right) \\ \times \sqrt{Td\left(\sqrt{R^{2}+L^{2}S^{2}} \log\left( 1 + \dfrac{TL^{2}}{\lambda d} \right) + \dfrac{4L^{2}d^{2}}{\lambda}\log\left( \dfrac{2dT}{\delta}\right) \sum\limits_{t=1}^{T} \dfrac{1}{n_{i_{t},t}} \right)} \end{multline} \end{theo} \begin{preuve} La preuve complète de ce théorème est disponible en annexe \ref{preuveRegSampLinUCBGeneric}. \end{preuve} L'étude des facteurs dominants dans la borne précédente, associée aux trois cas d'études, permet d'établir le théorème suivant, où l'on a enlevé les dépendances en $L$, $\lambda$, $R$ et $S$ volontairement. \begin{theo}[Borne pour les trois cas d'études] \label{RegretSamplLinUCBDiffCases} Pour les trois cas d'études proposés, la borne supérieure du pseudo-regret cumulé prend la forme suivante: \begin{itemize} \item Pour le cas 1, avec une probabilité au moins égale $1-3\delta$: \begin{equation} \label{regCas1} \hat{R}_{T} =\mathcal{O}\left( d \sqrt{dT\log\left(\dfrac{T}{\delta}\right) \log\left(\dfrac{dT^{2}}{\delta}\right)} \right) \end{equation} \item Pour le cas 2, avec une probabilité au moins égale $(1-3\delta)(1-\delta)$, et pour $T \geq 2\log(1/\delta)/p^{2}$: \begin{equation} \label{regCas2} \hat{R}_{T} =\mathcal{O}\left( d \sqrt{\dfrac{dT}{p}\log\left(\dfrac{T}{\delta}\right) \log\left(d\dfrac{T^{2}}{\delta}\right)} \right) \end{equation} Où $p$ est la probabilité pour chaque bras de délivrer un échantillon de profil à chaque itération. \item Pour le cas 3, avec une probabilité au moins égale $1-3\delta$: \begin{equation} \label{regCas3} \hat{R}_{T} =\mathcal{O}\left( d \sqrt{dTK\log\left(\dfrac{T}{\delta}\right) \log\left(d\dfrac{T^{2}}{\delta}\right)} \right) \end{equation} \end{itemize} On rappelle que le symbole $\mathcal{O}$ traduit la relation "dominé par", autrement dit $f=\mathcal{O}(g)$ signifie qu'il existe une constante strictement positive $C$ telle qu' asymptotiquement on a: $|f|\leq C|g|$. \end{theo} \begin{preuve} Les trois preuves sont disponibles en annexe \ref{preuveRegSampLinUCBCas1}, \ref{preuveRegSampLinUCBCas2} et \ref{preuveRegSampLinUCBCas3} respectivement pour les cas 1, 2 et 3. \end{preuve} On remarque que dans les trois cas, la borne est bien sous-linéaire. On propose maintenant de faire une analyse qualitative des différents termes intervenant dans ces trois bornes. \begin{itemize} \item \textbf{Cas 1}: Le facteur dominant de la borne du regret possède une forte dépendance en $d$, le nombre de dimensions de l'espace des profils. Une partie faible, d'un facteur $\sqrt{d}$, provient de l'incertitude liée à l'estimateur du paramètre de régression $\beta$. La plus grande part de la dépendance en $d$ vient cependant de l'incertitude liée à l'estimation des profils. En effet, cette dernière entraîne la présence d'un terme en $d\sqrt{\log(d)}$. Ceci est également valide pour les cas 2 et 3, qui possèdent des dépendances supplémentaires étudiées ci-après. \item \textbf{Cas 2}: La borne décrite dans l'équation \ref{regCas2} possède une dépendance en $p$. Plus la probabilité d'observer des échantillons est élevée, plus l'incertitude sera faible et plus l'algorithme sera performant. De plus, on note que cette borne n'est valide que pour un horizon $T$ supérieur à une valeur inversement proportionnelle à $p^{2}$. Intuitivement, ceci est dû au fait que plus $p$ est petit, plus un nombre élevé d'itérations est nécessaire pour s'assurer qu'un minimum d'observations a été effectué. \item \textbf{Cas 3}: La borne décrite dans l'équation \ref{regCas3} possède une dépendance en $\sqrt{K}$, le nombre total d'actions disponibles. Plus le nombre de bras augmente, plus la borne sera large. Ce facteur provient du fait que dans ce scénario, seule l'action sélectionnée à une itération révèle un échantillon de profil à l'étape suivante \end{itemize} \begin{note} Ces trois bornes ne sont pas optimales, au sens où elles sont plus larges que la borne inférieure du théorème \ref{infRegStoMP} valide pour tous les algorithmes de bandit stationnaire. En effet, il est important de rappeler que notre problème peut aussi être vu comme un problème stationnaire en remarquant que dans le modèle on a $\mu_{i}^{\top}\beta$ constant pour chaque action. En revanche, dans certains cas, en particulier lorsque le nombre d'actions devient grand, il peut être utile d'utiliser les informations de profils pour mieux explorer l'espace des récompenses. En effet, là où les algorithmes de bandit stationnaire classiques devront reconsidérer plusieurs fois les actions de mauvaise qualité, nous pensons que notre méthode peut tirer parti de la mutualisation effectuée dans l'apprentissage. Ceci fait l'objet d'expérimentations dans la section \ref{XPSampLinUCB}. \end{note} Dans la section suivante, nous proposons d'étendre le travail précédent au cas qui nous intéresse le plus, à savoir celui où plusieurs actions ($k>1$) sont sélectionnées simultanément à chaque tour. \section{Extension au cas de la sélection multiple} Cette courte section nous permet de faire le lien entre l'étude proposée ci-dessus et notre tâche de collecte d'information dans laquelle on a $k>1$. L'algorithme \texttt{SampLinUCB} (voir algorithme \ref{algoSampLinUCB}) peut s'étendre aisément à ce scénario en spécifiant qu'à chaque instant $t$, plutôt que de sélectionner l'action $i$ ayant le meilleur score $s_{i,t}$ (voir équation \ref{scoreSampLinUCB}), la version étendue sélectionne les $k$ meilleures actions ordonnées selon leur score $s_{i,t}$. On rappelle que l'ensemble des actions choisies à est notée $\mathcal{K}_{t}$ au temps $t$. \begin{defi} Le pseudo-regret instantané d'un algorithme de bandit contextuel avec $k$ sélections à un instant $t$, noté $reg_{t}$; est défini par: \begin{equation} reg_{t}=\sum\limits_{i\in\mathcal{K}^{\star}}\mu_{i}^{\top}\beta-\sum\limits_{i\in\mathcal{K}_{t}}\mu_{i}^{\top}\beta \end{equation} Avec $\mathcal{K}^{\star}$ l'ensemble des $k$ actions optimales, c.-à-d. ayant les plus grandes valeurs $\mu_{i}^{\top}\beta$. \end{defi} \begin{defi} Le pseudo-regret associé, noté $\hat{R}_{T}$ est défini par: \begin{equation} \hat{R}_{T}=\sum\limits_{t=1}^{\top}reg_{t} \end{equation} \end{defi} \begin{theo}[Borne générique avec sélection multiple] \label{RegretSamplLinUCBGenericMult} En choisissant $\lambda \geq \max(1,2L^{2})$, avec une probabilité au moins égale à $1-3\delta$, le pseudo-regret cumulé de l'algorithme \texttt{SampLinUCB} avec sélections multiples est majoré par: \begin{multline} \label{cumulRegSamplLinMult} \hat{R}_{T} \leq C + 4Ld\left(\sqrt{\dfrac{d}{\lambda}\log\left(\dfrac{1+TkL^{2}/\lambda}{\delta}\right)}+2S\right)\sqrt{\log\left( \dfrac{2dT^{2}}{\delta}\right)} \sum\limits_{t=1}^{T} \sum\limits_{i\in \mathcal{K}_{t}}\dfrac{2}{n_{i,t}} \\ + 2\left(\sqrt{d\log\left(\dfrac{1+TkL^{2}/\lambda}{\delta}\right)} + \sqrt{\lambda}S\right) \\ \times \sqrt{Td\left(\sqrt{R^{2}+L^{2}S^{2}} \log\left( 1 + \dfrac{TkL^{2}}{\lambda d} \right) + \dfrac{4L^{2}d^{2}}{\lambda}\log\left( \dfrac{2dT}{\delta}\right) \sum\limits_{t=1}^{T} \sum\limits_{i \in \mathcal{K}_{t}}\dfrac{1}{\sqrt{n_{i,t}}} \right)} \end{multline} \end{theo} \begin{preuve} La preuve complète de ce théorème, dont les arguments sont très proches de la preuve pour le cas de la sélection unique, est disponible en annexe \ref{preuveRegSampLinUCBCasMP}. \end{preuve} Des bornes équivalentes pour les trois cas peuvent être démontrées, à partir de la formulation ci-dessous et de la preuve du théorème \ref{RegretSamplLinUCBDiffCases}. Dans la section suivante, nous proposons d'expérimenter notre algorithme d'une part sur des données simulées, mais aussi sur des données réelles de réseau social, afin d'évaluer les performances empiriques de l'algorithme \texttt{SampLinUCB}. Pour le scénario de collecte de données, nous présenterons le modèle de contexte utilisé. \section{Expérimentations} \label{XPSampLinUCB} Cette partie est divisée en deux sections. D'une part les expérimentations sur des données simulées, et d'autre part sur des données réelles. \subsection{Données artificielles} \subsubsection{Protocole} \textbf{Génération des données:} Afin d'évaluer les performances de notre algorithme, nous l'expérimentation dans un premier temps dans un contexte de sélection simple ($k=1$) sur des données simulées. Pour cela, on fixe un horizon de $T=1000$ pas de temps, un ensemble de $K=50$ actions et $d=5$ dimensions. On tire ensuite un vecteur de régression $\beta$ aléatoirement dans $\left[-S/\sqrt{d}..S/\sqrt{d}\right]^{d}$, de façon à respecter la condition $||\beta||\leq S =1$. Pour chaque bras $i$ on tire un vecteur aléatoire $\mu_{i}$ de façon uniforme dans $\left[-L/\sqrt{d}..L/\sqrt{d}\right]^{d}$ avec $L=1$, de façon à être certain que $||\mu_{i}|| \leq L$. Ensuite, pour chaque itération $t \in \left\{1,...,T \right\}$ du processus, on procède de la façon suivante pour simuler les données: \begin{enumerate} \item Pour chaque $i \in \left\{1,...,K \right\}$, on tire un échantillon $x_{i,t}$ suivant une loi normale centrée sur $\mu_{i}$, et de matrice de covariance $\sigma^{2}I$. Afin d'analyser l'influence du bruit sur les performances de \texttt{SampLinUCB}, nous testons différentes valeurs pour $\sigma \in \left\{0.1,0.5,1.0\right\}$. De plus, pour respecter la condition $||x_{i,t}||\leq L=1$, tout en conservant le fait que les échantillons sont centrés sur $\mu_{i}$, la distribution normale est tronquée de façon symétrique autour de $\mu_{i}$. Ce procédé est illustré dans la figure \ref{fig:truncGauss} lorsque $d=1$, où les zones hachurées correspondent aux valeurs qui sont exclues. On représente à gauche un cas où $\mu_{i}>0$ et à droite un cas où $\mu_{i}<0$; \item Pour chaque $i \in \left\{1,...,K \right\}$, on tire une récompense $r_{i,t}$ selon une loi normale de moyenne $\mu_{i}^{\top}\beta$ et de variance $R^{2}=0.1$; \end{enumerate} \begin{figureth} \begin{subfigureth}{0.45\textwidth} \includegraphics[width=\linewidth]{truncGaussian1.pdf} \caption{Cas où $\mu>0$} \end{subfigureth} \begin{subfigureth}{0.45\textwidth} \includegraphics[width=\linewidth]{truncGaussian2.pdf} \caption{Cas où $\mu<0$} \end{subfigureth} \caption[Génération des échantillons de profils]{Processus de troncage des lois gaussiennes pour la génération des échantillons de profils bornés.} \label{fig:truncGauss} \end{figureth} Nous avons généré 1000 jeux de données de cette façon et les résultats donnés plus loin correspondent à des moyennes. \textbf{Politiques testées:} Dans ce contexte de bandit stationnaire avec profil bruité, nous proposons de comparer \texttt{SampLinUCB} à \texttt{UCB}, \texttt{UCBV} et \texttt{MOSS}. Soulignons que ces trois politiques n'utilisent aucune information extérieure autre que les récompenses observées. Par conséquent le seul bruit sur les données pour ces algorithmes provient de la loi normale de variance $R^{2}$. En revanche, une source de bruit supplémentaire pour notre algorithme \texttt{SampLinUCB} provient de la génération des échantillons de profils. Tout l'enjeu est de savoir si, bien qu'exploitée selon des échantillons bruités, la structure entre les actions peut être utilisée de façon à améliorer les performances des algorithmes de bandits stationnaires classiques. Nous implémentons les trois scénarios présentés, en utilisant différentes valeurs de $p\in \left\{0, 0.05,0.5, 1 \right\}$. A noter que pour $p=0$ les actions sélectionnées au temps $t$ délivrent un échantillon de profil, ce qui correspond au cas 3 présenté précédemment. \subsubsection{Résultats} Les figures \ref{fig:regretVsTimeSimSampLinUCB}(a), \ref{fig:regretVsTimeSimSampLinUCB}(b) et \ref{fig:regretVsTimeSimSampLinUCB}(c) représentent l'évolution du regret des différentes politiques testées au cours du temps, pour des valeurs de $\sigma$ (bruit sur les profils) valant respectivement $\sigma=1.0$, $\sigma=0.5$ et $\sigma=0.1$. Notons que dans les trois représentations, les courbes de \texttt{UCB}, \texttt{UCBV} et \texttt{MOSS} sont identiques étant donné que leurs résultats ne sont pas influencés par le bruit sur les profils. On remarque premièrement que les politiques \texttt{UCB} et \texttt{UCBV} n'offrent pas de bons résultats. Il apparaît que ces deux politiques ont tendance à sur-explorer, du moins pendant la fenêtre de temps de 1000 itérations de l'expérimentation. De plus, dans ce cas précis, les moyennes des actions sont relativement bien réparties dans l'intervalle $\left[-1..1 \right]$ du fait du processus de simulation aléatoire des espérances, et ont toutes la même variance ($R^{2}=0.1$) . Ainsi, l'algorithme \texttt{UCBV} ne parvient pas à utiliser la variance pour identifier les meilleures actions de façon efficace. En revanche, les performances de la politique \texttt{MOSS} semblent bien plus élevées. Nous expliquons cela par le fait qu'il explore l'espace des récompenses de façon plus restreinte que ses deux concurrents, ce qui, dans ce cas précis, lui permet de s'orienter vers des bonnes actions plus rapidement. Cependant, \texttt{MOSS} nécessite de connaître l'horizon $T$, qui intervient directement dans la stratégie de sélection, e qui est relativement limitant en pratique dans le cadre d'utilisation en contexte réel. Par ailleurs, il est difficile d'extrapoler son comportement au-delà de l'horizon de l'expérience. Penchons-nous maintenant sur les résultats offerts par l'algorithme \texttt{SampLinUCB} dans les divers scénarios. Afin d'isoler les différents effets, nous proposons d'étudier les deux aspects suivants: \begin{itemize} \item Influence de la probabilité d'observation des contextes (régi par $p$): La première chose que l'on remarque est que pour toutes les valeurs de bruit sur les profils, \texttt{SampLinUCB} offre de meilleures performances que ses compétiteurs, et ce pour toutes les valeurs de $p$, ce qui confirme la pertinence de notre approche. De plus, le cas où $p=1$, c'est-à-dire où tous les bras délivrent un échantillon de profil à chaque pas de temps, est le plus performant de tous, ce qui paraît cohérent puisque l'algorithme dispose de plus d'information que lorsque $p$ est plus faible. Vient ensuite le cas où $p=0.5$ qui, comme on aurait pu le penser intuitivement, est plus performant que lorsque $p=0.05$ et $p=0$. Ces deux derniers cas, dans lesquels le nombre d'échantillons de profil est beaucoup plus faible (en moyenne 2.5 lorsque $p=0.05$ et exactement 1 lorsque $p=0$) sont les plus intéressants. Nous remarquons que les performances de \texttt{SampLinUCB} sont plus élevées (sur l'horizon étudié) lorsque $p=0$ que lorsque $p=0.05$, ce qui s'explique par le fait que quand $p=0$, l'algorithme est actif non seulement dans l'exploration des récompenses, mais aussi dans l'exploration des profils. Ceci lui permet donc de mieux s'orienter vers les actions optimales, même si la quantité d'information disponible (en terme de nombre d'échantillons) est moins importante. \item Influence de bruit sur les profils (régi par $\sigma$): D'une façon générale, le fait d'augmenter le bruit sur les échantillons de profils visibles par \texttt{SampLinUCB} a pour effet de dégrader ses performances. Ceci semble logique, puisque la convergence des moyenes empirique des différents échantillons (vers les véritables profils) est d'autant plus lente que le bruit est élevé. Lorsque $\sigma=0.1$, c'est à dire lorsque le bruit est le plus faible, les performances de \texttt{SampLinUCB} sont quasiment identiques pour toutes les valeurs de $p$, et toujours très largement supérieures à celles de \texttt{UCB}, \texttt{UCBV} et \texttt{MOSS}. Dans ce cas, les valeurs des échantillons sont très proches des vrais profils, et l'algorithme trouve très rapidement de bons estimateurs. Losque $\sigma$ augmente, les écarts de performances sont plus visibles et on voit très nettement que la probabilité $p$ impacte fortement les résultats. Lorsque $\sigma=0.5$, \texttt{SampLinUCB} est toujours bien meilleur que les autres, en revanche, lorsque $\sigma=1.0$, il apparaît que ses performances ne sont que légèrement supérieures à celles de la politique \texttt{MOSS} pour $p=0.05$ et $p=0$. Nous expliquons cela par le fait que l'incertitude élevée due au bruit rend l'exploitation des échantillons de profils plus difficiles. \end{itemize} \begin{figureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{SampLinUCB_sigma1_0regret.pdf} \caption{$\sigma=1.0$} \end{subfigureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{SampLinUCB_sigma0_5regret.pdf} \caption{$\sigma=0.5$} \end{subfigureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{SampLinUCB_sigma0_1regret.pdf} \caption{$\sigma=0.1$} \end{subfigureth} \caption[Regret simulation \texttt{SampLinUCB}]{Regret cumulé en fonction du temps pour l'expérience sur données artificielles et pour différents niveaux de bruit sur les échantillons de profils. Dans les trois représentations, les courbes de \texttt{UCB}, \texttt{UCBV} et \texttt{MOSS} sont identiques étant donné que leurs résultats ne sont pas influencés par le bruit sur les profils.} \label{fig:regretVsTimeSimSampLinUCB} \end{figureth} \begin{comment} Nous proposons maintenant d'étudier la variance des divers algorithmes relativement aux différentes simulations. Nous représentons pour cela le diagramme en boîte du regret final des différents algorithmes dans la figure \ref{fig:boxPlotSampLinUCB}. Comme nous aurions pu l'imaginer, il apparaît que l'augmentation du bruit sur les profils augmente la variance de l'algorithme \texttt{SampLinUCB}, pour une valeur de $p$ donnée. De plus, pour une valeur de $\sigma$ fixée, la variance augmente à mesure que $p$ diminue, ce qui est cohérent, puisque plus la probabilité d'observation est faible, plus il y aura de variabilité d'une simulation à l'autre. Finalement, les algorithmes \texttt{UCB}, \texttt{UCBV} et \texttt{MOSS}, n'étant sujet qu'au bruit sur les récompenses, possèdent une variance faible. \begin{figureth} \includegraphics[width=0.8\linewidth]{boxPlotSampLinUCB.pdf} \caption[Diagramme en boîte simulation \texttt{SampLinUCB}]{Diagramme en boîte du regret final obtenu par les différents algorithmes pour l'expérience sur données artificielles.} \label{fig:boxPlotSampLinUCB} \end{figureth} \end{comment} En conclusion de cette analyse, il semble que l'algorithme \texttt{SampLinUCB}, bien que jouant avec une double incertitude - récompenses et profils - soit en mesure d'exploiter la structure sous-jacente de l'espace pour maximiser les récompenses récoltées au cours du temps. \subsection{Données réelles} \subsubsection{Modèle de profils} \label{modelProfilStat} Nous supposons que chaque utilisateur $i$ du réseau social est associé à un vecteur inconnu $\mu_{i}$ correspondant à son profil. Nous faisons l'hypothèse que ce dernier est une représentation de la moyenne des messages que chaque utilisateur a tendance à poster (ici, on entend poster au sens large, c'est à dire en incluant les interactions avec d'autres utilisateurs, à savoir les réponses et les reprises de messages). Pour notre application, le cas le plus réaliste est le cas 3, pour lequel on observe un échantillon de contexte au temps $t$ uniquement pour les utilisateurs écoutés au pas de temps $t-1$ c'est-à-dire $\mathcal{O}_{t}=\mathcal{K}_{t-1}$ . Par conséquent, si un compte $i$ appartient à $\mathcal{O}_{t}$, une façon de modéliser un échantillon de son profil $x_{i,t}$ est d'utiliser les messages $\omega_{i,t-1}$ récoltés au temps $t-1$. Afin d'avoir une représentation vectorielle des messages et nous permettre d'appliquer la méthode proposée dans ce chapitre, nous proposons d'utiliser la transformation LDA présentée au chapitre \ref{FormalisationTache} (section \ref{repMessage}), qui consiste à transformer chaque message $\omega_{i,t}$ en un vecteur $x_ {i,t}$ de l'espace des concepts. Nous rappelons que nous avons entraîné ce modèle avec $d=30 $. Pour résumer, en notant $F$ la fonction qui à un message associe sa représentation dans l'espace des concepts, l'échantillon de profil de l'utilisateur $i$ à l'instant $t$ est $x_{i,t}=F(\omega_{i,t-1})$. \subsubsection{Protocole} Nous utilisons le même protocole que celui présenté dans la partie \ref{protocole} du chapitre précédent, à savoir le modèle \textit{Topic+Influence} avec les trois thématiques \textit{Politique}, \textit{Religion} et \textit{Science}, et ce pour les trois bases de données collectées. On rappelle que l'on fixe $k$, le nombre d'utilisateurs écoutés à chaque période à 100. Nous nous comparons aux algorithmes \texttt{CUCBV}, \texttt{CUCB}, \texttt{UCB}-$\delta$ et \texttt{MOSS}. Finalement, on s'intéresse aux trois scénarios en simulant un processus délivrant des échantillons de profils de façon aléatoire pour différents $p\in \left\{0, 0.01,0.05, 0.1, 0.5,1 \right\}$. Comme dans les expérimentations précédentes, pour $p=0$, on ajoute les individus écoutés au temps $t$ à l'ensemble $\mathcal{O}_{t+1}$, ce qui correspond au cas 3 présenté précédemment. \subsubsection{Résultats} Les figures \ref{fig:XPStatCtxtUSRT}, \ref{fig:XPStatCtxtOGRT} et \ref{fig:XPStatCtxtBrexitRT} contiennent l'évolution du gain cumulé en fonction du temps respectivement pour les bases \textit{USElections}, \textit{OlympicGames} et \textit{Brexit} avec le modèle de récompense \textit{Topic+Influence} pour les trois thématiques. Afin de ne pas surcharger les graphiques, nous n'avons pas représenté les résultats pour l'algorithme \texttt{SampLinUCB} dans les cas $p=0.01,0.05,0.5$. Une première observation importante est que dans pratiquement tous les cas, notre algorithme \texttt{SampLinUCB} est plus performant que tous les autres, y compris \texttt{CUCBV}, qui était le plus performant d'une façon générale dans les expérimentations du chapitre précédent. Ceci permet d'affirmer que l'utilisation des profils sur les membres du réseau pour notre tâche de collecte d'information ciblée est pertinente. En effet, cette approche prenant en compte un modèle des messages postés par chaque utilisateur permet de mieux s'orienter vers les "bons" profils. D'une façon générale, comme dans les expériences sur données simulées, les performances de notre approche augmentent avec $p$, pour atteindre un maximum lorsque $p=1$. Le point le plus important réside dans le fait que pour $p=0$, qui correspond au cas 3 décrit en début de chapitre, notre algorithme parvient à être plus performant que \texttt{CUCBV}. Ceci est très intéressant puisque, comme nous l'avons déjà mentionné, il s'agit du cas le plus réaliste, où l’on n’utilise rien d'autre que les informations données par les comptes écoutés. \begin{figureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBUS_PoliticCumRwdvsTimeStaticCtxt.pdf} \caption{Politique} \end{subfigureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBUS_ReligionCumRwdvsTimeStaticCtxt.pdf} \caption{Religion} \end{subfigureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBUS_ScienceCumRwdvsTimeStaticCtxt.pdf} \caption{Science} \end{subfigureth} \caption[Gain vs temps base \textit{USElections} modèle statique.]{Evolution de la récompense cumulée en fonction du temps sur la base \textit{USElections} pour différentes politiques et le modèle \textit{Topic+Influence} avec différentes thématiques.} \label{fig:XPStatCtxtUSRT} \end{figureth} \begin{figureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBOG_PoliticCumRwdvsTimeStaticCtxt.pdf} \caption{Politique} \end{subfigureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBOG_ReligionCumRwdvsTimeStaticCtxt.pdf} \caption{Religion} \end{subfigureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBOG_ScienceCumRwdvsTimeStaticCtxt.pdf} \caption{Science} \end{subfigureth} \caption[Gain vs temps base \textit{OlympicGames} modèle statique.]{Evolution de la récompense cumulée en fonction du temps sur la base \textit{OlympicGames} pour différentes politiques et le modèle \textit{Topic+Influence} avec différentes thématiques.} \label{fig:XPStatCtxtOGRT} \end{figureth} \begin{figureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBBrexit_PoliticCumRwdvsTimeStaticCtxt.pdf} \caption{Politique} \end{subfigureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBBrexit_ReligionCumRwdvsTimeStaticCtxt.pdf} \caption{Religion} \end{subfigureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBBrexit_ScienceCumRwdvsTimeStaticCtxt.pdf} \caption{Science} \end{subfigureth} \caption[Gain vs temps base \textit{Brexit} modèle statique.]{Evolution de la récompense cumulée en fonction du temps sur la base \textit{Brexit} pour différentes politiques et le modèle \textit{Topic+Influence} avec différentes thématiques.} \label{fig:XPStatCtxtBrexitRT} \end{figureth} On s'intéresse maintenant de plus près aux résultats propres à l'algorithme \texttt{SampLinUCB}. Les figures \ref{fig:XPStatCtxtUSRTFinal}, \ref{fig:XPStatCtxtOGRTFinal} et \ref{fig:XPStatCtxtBrexitRTFinal} représentent la récompense finale pour l'algorithme \texttt{SampLinUCB} sur les jeux de données \textit{USElections}, \textit{OlympicGames} et \textit{Brexit} avec le modèle de récompense \textit{Topic+Influence} pour les trois thématiques et pour différentes valeurs de $p$. Pour plus de clarté, les valeurs ont été normalisées par la plus grande, c'est-à-dire le gain final avec $p=1$. L'intuition générale se confirme bien puisque dans tous les cas, on observe que les performances se dégradent à mesure que $p$ diminue lorsque $p>0$. On remarque finalement que lorsque $p=0$, c'est-à-dire quand $\mathcal{O}_{t}=\mathcal{K}_{t-1}$ l'algorithme arrive la plupart du temps à battre le cas où $p=0.01$ et parfois le cas où $p=0.05$. Cela souligne la capacité de l'algorithme à être actif dans l'apprentissage des profils dans le cas 3: avec moins d'échantillons observés (100 sur 5000, ce qui correspondrait à $p=0.02$), il parvient à capturer plus de contenus utiles au cours du temps. \begin{figureth} \begin{subfigureth}{0.3\textwidth} \includegraphics[width=\linewidth]{DBUS_PoliticFinalRwdStaticCtxt.pdf} \caption{Politique} \end{subfigureth} \begin{subfigureth}{0.3\textwidth} \includegraphics[width=\linewidth]{DBUS_ReligionFinalRwdStaticCtxt.pdf} \caption{Religion} \end{subfigureth} \begin{subfigureth}{0.3\textwidth} \includegraphics[width=\linewidth]{DBUS_ScienceFinalRwdStaticCtxt.pdf} \caption{Science} \end{subfigureth} \caption[Gain final base \textit{USElections} algorithme \texttt{SampLinUCB}.]{Gain final pour l'algorithme \texttt{SampLinUCB} sur le jeu de données \textit{USElections} pour différentes valeurs de $p$.} \label{fig:XPStatCtxtUSRTFinal} \end{figureth} \begin{figureth} \begin{subfigureth}{0.3\textwidth} \includegraphics[width=\linewidth]{DBOG_PoliticFinalRwdStaticCtxt.pdf} \caption{Politique} \end{subfigureth} \begin{subfigureth}{0.3\textwidth} \includegraphics[width=\linewidth]{DBOG_ReligionFinalRwdStaticCtxt.pdf} \caption{Religion} \end{subfigureth} \begin{subfigureth}{0.3\textwidth} \includegraphics[width=\linewidth]{DBOG_ScienceFinalRwdStaticCtxt.pdf} \caption{Science} \end{subfigureth} \caption[Gain final base \textit{OlympicGames} algorithme \texttt{SampLinUCB}.]{Gain final pour l'algorithme \texttt{SampLinUCB} sur le jeu de données \textit{OlympicGames} pour différentes valeurs de $p$.} \label{fig:XPStatCtxtOGRTFinal} \end{figureth} \begin{figureth} \begin{subfigureth}{0.3\textwidth} \includegraphics[width=\linewidth]{DBBrexit_PoliticFinalRwdStaticCtxt.pdf} \caption{Politique} \end{subfigureth} \begin{subfigureth}{0.3\textwidth} \includegraphics[width=\linewidth]{DBBrexit_ReligionFinalRwdStaticCtxt.pdf} \caption{Religion} \end{subfigureth} \begin{subfigureth}{0.3\textwidth} \includegraphics[width=\linewidth]{DBBrexit_ScienceFinalRwdStaticCtxt.pdf} \caption{Science} \end{subfigureth} \caption[Gain final base \textit{Brexit} algorithme \texttt{SampLinUCB}.]{Gain final pour l'algorithme \texttt{SampLinUCB} sur le jeu de données \textit{Brexit} pour différentes valeurs de $p$.} \label{fig:XPStatCtxtBrexitRTFinal} \end{figureth} \section{Conclusion} Dans ce chapitre, nous avons formalisé un nouveau problème de bandit dans lequel chaque action est associée à un profil inconnu \textit{a priori}, dans le but de mieux modéliser les utilisateurs d'un réseau social et d'améliorer les performances de notre processus de collecte d'information. Contrairement aux problèmes existants, dans notre cas l'agent décisionnel peut seulement observer des versions bruitées des profils, et ce, uniquement pour un nombre limité de comptes à chaque instant. Cette contrainte modélise le fait que dans un réseau social, seule une partie limitée de l'activité est observable via les API mises à notre disposition. Une fois le problème formalisé, nous avons dérivé un nouvel algorithme de type optimiste capable de tirer profit du modèle linéaire liant les vrais profils - non observables - aux récompenses des utilisateurs. D'une façon générale, cet algorithme maintient un intervalle de confiance à la fois sur l'estimateur du paramètre de régression, mais aussi sur les estimateurs des profils dans le but de construire un intervalle de confiance pour la récompense à proprement parler. Nous avons prouvé l'existence d'une borne supérieure sous-linéaire du regret associé pour trois scénarios distincts du processus déterminant le sous-ensemble de comptes délivrant des échantillons de profils à chaque itération, en particulier pour le cas le plus réaliste ou les seuls échantillons observables au temps $t$ sont ceux des comptes sélectionnés au temps $t-1$. Finalement, des expérimentations à la fois sur données simulées et réelles nous ont permis de confirmer la pertinence du modèle à la fois dans un cadre générique et pour notre tâche de collecte d'information sur un média social. En perspective, il aurait été intéressant d'étudier des cas où les échantillons de contextes suivent des lois moins régulières que celles utilisées dans les expérimentaions artificielles (par exemple des lois de type mélange), afin d'évaluer la robustesse de \texttt{SampLinUCB}. \chapter{Modèle contextuel} \minitoc \newpage \label{ModeleContextuelVariable} La modélisation d'un profil pour chaque utilisateur associé à une hypothèse linéarité nous a permis d'améliorer considérablement les performances de notre processus de collecte dans le chapitre précédent. En effet grâce à la présence d'un paramètre de régression commun à tous les utilisateurs, nous avons montré qu'il est possible de mutualiser l'apprentissage, permettant ainsi une exploration plus intelligente de l'espace des utilisateurs. Cependant, l’hypothèse majeure nous ayant permis de dériver l'algorithme associé était la stationnarité des profils. Concrètement, étant donné que nous avons choisi d'utiliser le "message moyen" - à une transformation LDA près - comme profil, cela signifie que les utilisateurs n'ont tendance à poster qu'un seul type de message. Cette hypothèse peut être discutée, car il est possible que certains utilisateurs soient actifs sur plusieurs sujets complètement différents selon par exemple le moment de la journée. Dans ce cas, le modèle précédent n'est plus valide, car ne prenant pas en compte cette éventualité, qui pour être clair correspondrait à un changement de profil. Pour pallier cette faiblesse, nous proposons dans ce chapitre de modéliser des profils d'utilisateurs variables au cours du temps. Nous traitons ce problème comme un bandit contextuel prenant en comptes les contraintes associées à notre tâche, à savoir l'impossibilité d'observer tous les contextes. Dans cette optique nous dérivons deux algorithmes que nous expérimenterons sur des données réelles et artificielles. \section{Modèle} Dans cette section, nous formalisons le modèle mathématique de bandit contextuel ainsi que les hypothèses correspondantes. On suppose qu'il existe un vecteur inconnu permettant d'estimer l'espérance de la récompense que l'on peut observer pour chaque action en fonction de son vecteur de contexte. On se place ici dans le cas où le nombre d'actions $K$ est fini. Ainsi, à chaque pas de temps $t\in \left\{1,..,T\right\}$, chaque action $i\in \left\{1,..,K\right\} =\mathcal{K}$ révèle un vecteur de contexte noté $x_{i,t} \in \mathbb{R}^{d}$ et l'agent sélectionne un ensemble $\mathcal{K}_{t}$ de $k<K$ actions pour lesquels il reçoit les récompenses associées, son but étant toujours de maximiser la somme des récompenses cumulées au cours du temps. L'hypothèse classique \cite{banditThompsonCtxtPreuve} permettant de lier contexte et récompense est la suivante : \begin{equation} \exists \beta \in \mathbb{R}^{d} \text{ tel que } \forall t \in \left\{1,..,T\right\}, \forall i \in \left\{1,..,K\right\}: \mathbb{E}[r_{i,t}|x_{i,t}]=x_{i,t}^{\top}\beta \end{equation} Dans notre cas, le contexte $x_{i,t}$ de chaque utilisateur $i$ à chaque instant $t$ correspond au contenu publié dans la fenêtre de temps $t-1$. Contrairement au chapitre précédent, on utilise directement l'échantillon révélé par un utilisateur et non pas une moyenne. On remarque que dans ce cas, si un utilisateur est inactif au temps $t-1$, c'est à dire possède un vecteur de contexte nul, son espérance sera forcément égale à zéro. Or nous souhaitons éviter cette situation, car un utilisateur peut être actif de façon ponctuelle à un instant donné sans l'avoir été au temps précédent. Ainsi, afin de modéliser la qualité intrinsèque de chaque utilisateur, nous introduisons également un terme de biais $\theta_{i} \in \mathbb{R}$ pour chaque compte $i$. L'hypothèse de travail devient la suivante : \begin{equation} \exists \beta \in \mathbb{R}^{d}, \exists \left(\theta_{1},...,\theta_{K}\right) \in \mathbb{R}^{K} \text{ tels que }\forall t \in \left\{1,..,T\right\}, \forall i \in \left\{1,..,K\right\}: \mathbb{E}[r_{i,t}|x_{i,t}]=x_{i,t}^{\top}\beta+\theta_{i} \label{hypEq} \end{equation} Cette formulation correspond à un cas particulier du cas hybride proposé dans \cite{banditCtxtLinUCB}, en considérant une valeur de 1 pour la valeur du contexte propre à chaque action. Il est important de noter que plusieurs paramètres individuels auraient pu être considérés dans notre étude, cependant cette approche ne nous semble pas adaptée étant donné le nombre très élevé d'actions disponibles (qui mènerait à un apprentissage d'autant plus complexe). Ainsi, nous restreignons la modélisation individuelle à un terme unique de biais. L'utilisation d'un vecteur de paramètres commun permet une exploration facilitée, comme précédemment, grâce à la généralisation des corrélations observées pour des utilisateurs à l'ensemble des utilisateurs. Comme nous l'avons déjà vu, dans notre cas, une difficulté majeure provient du fait que tous les contextes ne sont pas observables, contrairement aux problèmes de bandits contextuels traditionnels. En effet les contraintes des différentes API ne nous autorisent pas à voir un contexte pour chaque action et on ne peut donc pas utiliser des algorithmes de bandits contextuels existants tels que \texttt{LinUCB} \cite{banditCtxtLinUCB} ou encore \texttt{OFUL} \cite{OFUL} par exemple. À l'instar du chapitre précédent, plusieurs cas sont envisageables concernant le processus choisissant les actions pour lesquelles un contexte est observable. On note par la suite $\mathcal{O}_{t} \subset \mathcal{K}$ l'ensemble des comptes pour lesquels un vecteur de contexte est disponible à l'itération $t$. Ainsi, le cas où $\mathcal{O}_{t}=\mathcal{K}$ correspond au bandit contextuel traditionnel. \begin{note} Dans ce chapitre, les contextes sont par nature variables et sont directement observés par l'agent, contrairement au chapitre \ref{ModeleContextuelFixe} où seule une version bruitée était disponible. \end{note} Dans la section suivante, nous étudions dans un premier temps le cas le plus simple où tous les contextes sont observables. Ceci nous permettra de mettre en place les bases nécessaires à l'étude du cas plus complexe où une partie des contextes n'est pas accessible. \section{Algorithmes} Nous nous concentrons ici sur les algorithmes de types optimistes. Rappelons que le principe général, derrière toutes les politiques de ce type, consiste à construire un intervalle de confiance sur les récompenses de chaque action. Pour ce faire, une des possibilités est de maintenir à jour des distributions a posteriori sur les différents paramètres du modèle. Certaines hypothèses doivent être faites à la fois sur la vraisemblance des observations, mais aussi sur les distributions a priori des paramètres. En particulier, l'utilisation des priors conjugués permet d'obtenir des solutions exactes. Dans notre étude, nous utiliserons des distributions gaussiennes. \subsection{Intervalles de confiance lorsque les contextes sont visibles} Construisons dans un premier temps un estimateur des paramètres dans le cas où tous les contextes seraient observables, avec les hypothèses suivantes : \begin{itemize} \item \textbf{Vraisemblance :} Les récompenses sont indépendamment et identiquement distribuées selon les contextes observés: $r_{i,t} \sim \mathcal{N}(r_{i,t};x_{i,t}^{\top}\beta+\theta_{i},\sigma_{i}^2)$, avec $\sigma_{i}^2$ correspondant à la variance de l’écart entre la récompense $r_{i,t}$ et l'application linéaire de prédiction $x_{i,t}^{\top}\beta+\theta_{i}$; \item \textbf{Prior :} Les paramètres inconnus sont normalement distribués autour de l'origine: $\beta \sim \mathcal{N}(0,b^{2} \mathbb{I}_{d})$ et $\theta_{i} \sim \mathcal{N}(0,\rho_{i}^{2})$, où $b$ et $\rho_{i}$ permettent de contrôler la variance des paramètres et $\mathbb{I}_{d}$ est la matrice identité de taille $d$ (taille des vecteurs de contexte). \end{itemize} \begin{note} L'hypothèse de vraisemblance gaussienne est plus restrictive que celle du chapitre \ref{ModeleContextuelFixe} dans lequel un bruit sous-gaussien était suffisant. \end{note} Le but est de construire la distribution a posteriori des paramètres $\beta$ et $\theta_{i}$ à un instant $t$ connaissant les récompenses collectées, et les contextes associés, jusqu'à l'itération $t-1$. Pour alléger les notations, nous fixons $b$, $\rho_{i}$ et $\sigma_{i}$ à $1$ pour tout $i$. Cependant, tous les résultats peuvent être étendus à des cas plus complexes. Nous introduisons les notations matricielles condensées suivantes pour la suite du chapitre : \begin{itemize} \item $\mathcal{T}_{i,t-1}$ l'ensemble des itérations où $i$ a été choisi durant les $t-1$ premières étapes: $\mathcal{T}_{i,t-1}=\left\{s \leq t-1 , i \in \mathcal{K}_{s}\right\}$. On a donc $|\mathcal{T}_{i,t-1}|=N_{i,t-1}$; \item $c_{i,t-1}$ le vecteur de récompenses obtenues par l'action $i$ lorsqu'elle a été choisie jusqu'au temps $t-1$: $c_{i,t-1}=(r_{i,s})_{s\in \mathcal{T}_{i,t-1}}$ ; \item $D_{i,t-1}$ la matrice de taille $N_{i,t-1}\times d$ des contextes associée à $i$ lorsqu'elle a été choisie jusqu'au temps $t-1$: $D_{i,t-1}=(x_{i,s}^{\top})_{s\in \mathcal{T}_{i,t-1}}$. \end{itemize} Les deux propositions suivantes expriment les distributions a posteriori des paramètres du modèle à un instant $t$, avant que la sélection des actions n'ait été effectuée. \begin{prop} \label{propDistBetaChap3} Les distributions a posteriori des paramètres $\beta$ et $\theta_{i}$ à l'étape $t$, lorsque tous les contextes sont visibles respectent: \begin{equation} \label{eqBetaChap3} \beta \sim \mathcal{N}\left(\bar{\beta}_{t-1},V_{t-1}^{-1}\right) \end{equation} \begin{equation} \label{eqThetaChap3} \theta_{i}+\bar{x}_{i,t-1}^{\top}\beta \sim \mathcal{N}\left(\bar{\mu}_{i,t-1},\frac{1}{N_{i,t-1}+1}\right) \end{equation} Où: \begin{align} V_{t-1}=\mathbb{I}_{d}+\sum\limits_{i=1}^{K} (N_{i,t-1}+1)\bar{\Sigma}_{i,t-1}& & b_{t-1}^{\top}=\sum\limits_{i=1}^{K}(N_{i,t-1}+1)\bar{\xi}_{i,t-1} & & \bar{\Sigma}_{i,t-1}=\dfrac{D_{i,t-1}^{\top}D_{i,t-1}}{N_{i,t-1}+1}-\bar{x}_{i,t-1}\bar{x}_{i,t-1}^{\top}\nonumber \end{align} \begin{align} \bar{\xi}_{i,t-1}=\dfrac{c_{i,t-1}^{\top}D_{i,t-1}}{N_{i,t-1}+1}-\bar{\mu}_{i,t-1}\bar{x}_{i,t-1}^{\top} & & \bar{\beta}_{t-1}=V_{t-1}^{-1}b_{t-1}^{\top} & & \bar{\mu}_{i,t-1} = \dfrac{\sum\limits_{s\in \mathcal{T}_{i,t-1}} r_{i,s}}{N_{i,t-1}+1} & & \bar{x}_{i,t-1} = \dfrac{\sum\limits_{s\in \mathcal{T}_{i,t-1}} x_{i,s}}{N_{i,t-1}+1} \nonumber \end{align} De plus, les variables aléatoires $\beta $ et $\bar{x}_{i,t-1}^{\top}\beta$ sont indépendantes. \end{prop} \begin{preuve} Disponible en annexe \ref{PreuvePosteriorICWSM}. \end{preuve} \begin{note} Tous ces paramètres peuvent être mis à jour de façon peu coûteuse à mesure que de nouveaux exemples d'apprentissage arrivent (la complexité de la mise à jour des paramètres est constante sur l'ensemble du processus). Nous détaillerons cette mise à jour plus tard lors de l'étude de l'algorithme. \end{note} On remarque que dans la proposition précédente, la distribution a posteriori des paramètres $\theta_{i}$ seuls n'est pas explicite. Le corollaire suivant permet d'obtenir cette distribution. \begin{corol} A l'étape $t$, la distribution des paramètres $\theta_{i}$ est telle que: \begin{equation} \label{eqThetaBisChap3} \theta_{i} \sim \mathcal{N}\left(\bar{\mu}_{i,t-1}-\bar{x}_{i,t-1}^{\top}\beta_{t-1} ,\frac{1}{N_{i,t-1}+1} + \bar{x}_{i,t-1}^{\top}V_{t-1}^{-1}\bar{x}_{i,t-1}\right) \end{equation} \end{corol} \begin{preuve} En utilisant le fait que les variables aléatoires $\beta $ et $\bar{x}_{i,t-1}^{\top}\beta$ sont \textbf{indépendantes} et que $\theta_{i}=\theta_{i}+\bar{x}_{i,t-1}^{\top}\beta - \bar{x}_{i,t-1}^{\top}\beta =$\ref{eqThetaChap3}-$\bar{x}_{i,t-1}^{\top}$\ref{eqBetaChap3}, qui correspond à une combinaison linéaire de variables aléatoires indépendantes, on obtient le résultat souhaité. \end{preuve} \begin{prop} La valeur espérée $\mathbb{E}[r_{i,t}|x_{i,t}]$, de la récompense de l’utilisateur $i$ à l’itération $t$ sachant son contexte $x_{i,t}$, suit la distribution: \begin{equation} \label{distAllSeen} \mathbb{E}[r_{i,t}|x_{i,t}] \sim \mathcal{N}\left(\bar{\mu}_{i,t-1}+(x_{i,t}-\bar{x}_{i,t-1})^{\top}\bar{\beta}_{t-1}, \frac{1}{N_{i,t-1}+1}+(x_{i,t}-\bar{x}_{i,t-1})^{\top}V_{t-1}^{-1}(x_{i,t}-\bar{x}_{i,t-1})\right) \end{equation} \end{prop} \begin{preuve} En remarquant que $\mathbb{E}[r_{i,t}|x_{i,t}]=x_{i,t}^{\top}\beta+\theta_{i}=(x_{i,t}-\bar{x}_{i,t-1})^{\top}\beta+\theta_{i}+\bar{x}_{i,t-1}^{\top}\beta$ et qu'il s'agit d'une combinaison linéaire des variables aléatoires \textbf{indépendantes} définies dans les équations \ref{eqThetaChap3} et \ref{eqBetaChap3}, on obtient le résultat souhaité. \end{preuve} \begin{theo} \label{theoUCBICWSM} Pour tout $0<\delta <1$ et $x_{i,t} \in \mathbb{R}^{d}$, en notant $\alpha = \Phi^{-1}(1-\delta/2)$ \footnote{$\Phi^{-1}$ est la fonction de répartition inverse d'une loi normale.}, pour chaque action $i$, après $t$ itérations: \begin{multline} P\Big( | \mathbb{E}[r_{i,t}|x_{i,t}] - \bar{\mu}_{i,t-1}-(x_{i,t}-\bar{x}_{i,t-1})^{\top}\bar{\beta}_{t-1}| \ \leq \ \alpha \ \sigma_{i,t-1} \Big) \geq 1-\delta \\ \text{avec} \ \sigma_{i,t-1} = \sqrt{\dfrac{1}{N_{i,t-1}+1}+(x_{i,t}-\bar{x}_{i,t-1})^{\top}V_{t-1}^{-1}(x_{i,t}-\bar{x}_{i,t-1})} \label{probObs} \end{multline} \end{theo} \begin{preuve} En utilisant l'équation \ref{distAllSeen}, on voit que la variable aléatoire $\dfrac{\mathbb{E}[r_{i,t}|x_{i,t}] - \bar{\mu}_{i,t-1}-(x_{i,t}-\bar{x}_{i,t-1})^{\top}\bar{\beta}_{t-1}}{\sigma_{i,t-1}}$ suit une loi normale de moyenne 0 et de variance 1, d'où le résultat proposé. \end{preuve} Cette formule peut directement être utilisée pour définir une borne supérieure de l'intervalle de confiance (\textit{UCB - Upper Confidence Bound}) de la récompense espérée pour chaque utilisateur dont le contexte a été observé pour l’itération $t$: \begin{equation} s_{i,t} = \bar{\mu}_{i,t-1}+(x_{i,t}-\bar{x}_{i,t-1})^{\top}\bar{\beta}_{t-1} + \alpha\sqrt{\dfrac{1}{N_{i,t-1}+1}+(x_{i,t}-\bar{x}_{i,t-1})^{\top}V_{t-1}^{-1}(x_{i,t}-\bar{x}_{i,t-1})} \label{obsScoreChap3} \end{equation} Ainsi les approches de type \textit{UCB} étant des approches optimistes, l'idée est alors de sélectionner à chaque instant $t$ les $k$ utilisateurs ayant les $k$ bornes $s_{i,t}$ les plus élevées. Le score précédent pourrait directement être utilisé pour notre tâche de collecte d'information si tous les contextes de tous les utilisateurs étaient disponibles, ce qui n'est pas le cas, hormis lorsque $\mathcal{O}_{t}=\mathcal{K}$. Dans la section qui suit, nous étudions cette configuration spécifique qui nécessite un traitement particulier. \subsection{Prise en compte des utilisateurs dont le contexte n'est pas visible} Les scores permettant de sélectionner les utilisateurs à écouter définis précédemment ne peuvent pas être calculés lorsque les contextes $x_{i,t}$ ne sont pas observés (c.-à-d. lorsque les utilisateurs ne sont pas dans $\mathcal{O}_{t}$). Cela nécessite donc une méthode permettant de qualifier les personnes dont le contexte est inconnu. De plus, cela implique des problématiques de mise à jour des paramètres appris lorsqu'un utilisateur a été écouté, mais dont le contexte n'a pas été révélé. Bien qu'il soit tentant de penser que le paramètre $\beta$ commun à tous et les paramètres individuels $\theta_{i}$ peuvent être appris séparément, ces derniers sont en réalité corrélés, comme le montrent les formules \ref{eqBetaChap3} et \ref{eqThetaChap3}. Il est important de remarquer que pour conserver les garanties probabilistes, les paramètres du problème ne devraient être mis à jour que lorsqu'un profil appartient à $\mathcal{K}_{t} \cap \mathcal{O}_{t}$. Si l'on remplace $\mathcal{T}_{i,t}$ par $\mathcal{T}_{i,t}^{both}=\left\{s \leq t , i \in \mathcal{K}_{t} \cap \mathcal{O}_{t} \right\}$ et $N_{i,t}$ par $N_{i,t}^{both}$, on peut alors réutiliser les formules de mise à jour des paramètres de la proposition \ref{propDistBetaChap3}. Ainsi le score de sélection de l'équation \ref{obsScoreChap3} est toujours valable. Toutefois, pour un utilisateur dont le contexte est caché, cela n'est plus possible. Pour pallier ce problème, nous proposons deux approches distinctes. La première, la plus intuitive consiste à effectuer un échantillonnage des contextes pour les utilisateurs dont ce dernier n'est pas visible. Cet échantillonnage sera effectué à partir d'une loi apprise sur chaque utilisateur. Dans la seconde approche, nous utiliserons la moyenne empirique des contextes lorsque ce dernier n'est pas directement observable. Nous verrons que cela fera intervenir un nouveau terme d'exploration visant à compenser l'incertitude induite par cette approximation. \textbf{Notations supplémentaires:} Nous introduisons les notations suivantes que nous utiliserons dans le reste du chapitre: \begin{itemize} \item L'ensemble des itérations où le contexte de $i$ a été observé au bout de $t$ étapes est noté $\mathcal{T}_{i,t-1}^{obs}=\left\{s \leq t-1 , i \in \mathcal{O}_{s} \right\}$ avec $|\mathcal{T}_{i,t-1}^{obs}| = n_{i,t-1}$. A nouveau à l'instant $t$, on utilisera les informations disponibles jusqu'au temps précédent, d'où la présence des indices $t-1$; \item L'ensemble des observations du contexte de $i$ jusqu'à l'instant $t$ est noté $\mathcal{D}_{i,t-1}^{obs}=\left\{x_{i,s}\right\}_{s \in \mathcal{T}_{i,t-1}^{obs}}$; \item La moyenne empirique des vecteurs de contexte de l’utilisateur $i$ à l'instant $t$ est notée $\hat{x}_{i,t-1}$, avec $\hat{x}_{i,t-1}=\dfrac{1}{n_{i,t-1}}\sum\limits_{s\in \mathcal{T}_{i,t-1}^{obs}} x_{i,s}$. Remarquons que $\hat{x}_{i,t-1}$ est différent de $\bar{x}_{i,t-1}$, car le premier est mis à jour à chaque fois que le contexte est observé tandis que le second l'est uniquement lorsque l'utilisateur a été observé et sélectionné lors d'une même itération. \end{itemize} \subsubsection{Modèle 1: échantillonnage des contextes} \textbf{Idée générale: } Comme nous l'avons évoqué précédemment, l'idée est d'effectuer un apprentissage sur les utilisateurs afin d'être en mesure d'échantillonner leur contexte lorsque ce dernier n'est pas disponible. A l'instant $t$, lorsque l'on ne connaît pas $x_{i,t}$ pour un utilisateur $i$, il faudra effectuer un échantillonnage en se servant de toutes les observations précédentes, c'est-à-dire $\mathcal{D}_{i,t-1}^{obs}$. A mesure que le contexte d'un utilisateur sera observé, le modèle sous-jacent sera de plus en plus fin et l'échantillonnage sera de plus en plus proche de la réalité. Pour ce faire, nous proposons d'utiliser un modèle probabiliste pour les distributions de contextes pour chaque compte $i$. On note $p(x_{i,t}|\gamma_{i})$ la distribution de contexte associée à un utilisateur $i$ paramétrée par $\gamma_{i}$. Selon les lois de probabilité utilisées $\gamma_{i}$ peut être un vecteur. Par exemple pour une loi normale en une dimension ce dernier représente la moyenne et la variance. Dans tous les cas, ce paramètre n'est pas connu par l'agent. Afin d'être en mesure de maintenir des distributions de probabilité sur les contextes en fonction des observations, on utilise également un modèle probabiliste pour les paramètres $\gamma_{i}$. On note $q(\gamma_{i})$ cette distribution. Finalement, en utilisant pour $q$ le prior conjugué de $p$ il est possible de maintenir une distribution a posteriori analytique sur les paramètres, notée $q(\gamma_{i}|\mathcal{D}_{i,t-1}^{obs})$ et sur les contextes, notée $p(x_{i,t}|\mathcal{D}_{i,t-1}^{obs})$. Dans la littérature cette dernière distribution est appelée la distribubution posterior prédictive. Toutes les distributions ne possèdent pas de prior conjugué, cependant c'est le cas pour la majorité des distributions usuelles. Selon les cas d'application, certaines distributions seront plus pertinentes que d'autres, comme nous le verrons dans la partie expérimentale \ref{XPChap3}. \textbf{Approximation du score de sélection: } En considérant les contextes $x_{i,t}$ de chaque action $i$ à chaque instant $t$ comme des variables aléatoires lorsque ces derniers ne sont pas disponibles, le score $s_{i,t}$ de l'équation \label{obsScore} peut aussi être vu comme une variable aléatoire. En effet il s'agit d'une fonction de $x_{i,t}$ et d'autres valeurs fixées à un instant donné. Afin d'être en mesure d'attribuer un score aux actions dont le contexte n'est pas visible, nous proposons d'utiliser la valeur espérée de $s_{i,t}$ sachant les observations que nous avons effectuées dans le passé. Formellement, en notant $\tilde{s}_{i,t}$ ce nouveau score on a: \begin{align*} \forall i\notin \mathcal{O}_{t}: \tilde{s}_{i,t}&=\mathbb{E}[s_{i,t}|\mathcal{D}_{i,t-1}^{obs}]\\ &= \int_{x_{i,t}} s_{i,t}(x_{i,t} p(x_{i,t}|\mathcal{D}_{i,t-1}^{obs}) \, \mathrm dx_{i,t} \end{align*} Où nous avons explicitement fait apparaître la dépendance de $s_{i,t}$ en $x_{i,t}$ pour plus de clarté. On voit également apparaître $p(x_{i,t}|\mathcal{D}_{i,t-1}^{obs})$, la densité de probabilité apprise sur la distribution de contexte de l'action considérée. Malheureusement, l'expression ci-dessus n'est pas directement exploitable, car elle ne peut être calculée explicitement d'une façon générale et nécessite donc d'être approximée. On propose donc d'utiliser la méthode de Monte-Carlo suivante pour approximer l’intégrale : \begin{align} \label{scoreNotObsSampleChap3} \tilde{s}_{i,t} &\approx \dfrac{1}{L}\sum\limits_{x\in \mathcal{S}} s_{i,t}(x)\nonumber \\ &= \dfrac{1}{L}\sum\limits_{x\in \mathcal{S}} \bar{\mu}_{i,t-1}+(x-\bar{x}_{i,t-1})^{\top}\bar{\beta}_{t-1} + \alpha \ \sqrt{\dfrac{1}{N_{i,t-1}^{both}+1}+(x-\bar{x}_{i,t-1})^{\top}V_{t-1}^{-1}(x-\bar{x}_{i,t-1})} \end{align} Avec $\mathcal{S}=\left\{x \text{ échantilloné selon } p(x_{i,t}|\mathcal{D}_{i,t-1}^{obs}) \right\}$ un ensemble de $L$ échantillons provenant de la loi posterior prédictive $p(x_{i,t}|\mathcal{D}_{i,t-1}^{obs})$. Concrètement, ce score correspond à la moyenne empirique des scores calculés avec les échantillons présents dans $\mathcal{S}$. \textbf{Prise en compte de l'activité des utilisateurs :} Pour notre tâche en particulier, il s'avère que le contexte $x_{i,t}$ d'un utilisateur $i$ à un instant $t$ correspond au message qu'il a posté - à une transformation près - au temps $t-1$. Ainsi l'absence de message correspond à un contexte nul. Si l'on considère les itérations dans lesquelles le contexte d'un utilisateur $i$ a été vu avec le modèle précédent, il s'avère que les fois où ce dernier n'était pas actif seront tout de même considérées dans l'apprentissage de la loi $p(x_{i,t}|\mathcal{D}_{i,t-1}^{obs})$. D'un côté, ceci est positif puisque cela prend directement en compte l'activité des différents utilisateurs. En effet, les comptes peu actifs auront des distributions proches de 0. D'un autre côté, on perd en qualité la modélisation des messages postés en incorporant des exemples nuls de façon artificielle. Pour minimiser cet effet négatif tout en modélisant l'activité, nous allons dissocier l'activité d'un utilisateur et son contexte. D'une part, nous proposons de n'incorporer que les exemples où l'utilisateur a été actif, c'est-à-dire où $x_{i,t}\neq 0$, dans l'apprentissage de la loi $p(x_{i,t}|\mathcal{D}_{i,t-1}^{obs})$. D'autre part, nous introduisons une nouvelle variable aléatoire régissant la probabilité qu'a un utilisateur d'être actif à un instant $t$. Etant donné que l'on ne peut pas apprendre une probabilité pour chaque instant, nous subdivisons le processus de collecte en plusieurs périodes. Intuitivement, cela semble pertinent puisque dans le cadre des réseaux sociaux certains comptes seront forcément plus actifs selon le moment de la journée. Formellement, on définit une période comme un ensemble consécutif de $M$ itérations et l'on choisit un total de $nbPeriods$ périodes. A titre illustratif, si on considère qu'une itération dure une heure et que l'on choisit $nbPeriods=2$ et $M=12$, alors cela revient à diviser un jour complet en deux périodes dans lesquelles chaque utilisateur a une probabilité particulière d'être actif. Nous verrons dans la partie expérimentale différents choix possibles. On associe à chaque utilisateur $i$ un vecteur $p_{i}\in \left[0..1\right]^{M}$ régissant sa probabilité d'être actif. On a donc $\mathbb{P}(i\text{ est actif au temps }t)=p_{i,j}$ lorsque $t$ est dans la période $j\in \left\{1,...,M \right\}$. Ainsi, la probabilité qu'un compte $i$ soit actif à un instant $t$ suit une loi de Bernoulli de probabilité $p_{i,j}$ lorsque $t$ est dans la période $j$. Ces probabilités n'étant pas connues a priori, elles doivent également être apprises à mesure que le temps avance. Pour ce faire, nous utilisons un prior sur chaque $p_{i,j}$ et on souhaite en déduire la distribution posterior prédictive $p_{i,j}$ sachant les observations passées, c'est-à-dire $\mathcal{D}_{i,t-1}^{obs}$. Le prior conjugué d'une loi de Bernoulli est une loi Beta de paramètre $a$ et $b$. Dans notre cas, aucune information n'étant disponible a priori, on choisit pour tous les comptes $a=b=1$, ce qui correspond à une loi uniforme. On introduit les deux notations qui nous seront utiles pour exprimer les probabilités qui nous intéressent : \begin{itemize} \item On note $S_{i,j,t-1}$ le nombre de fois où l'utilisateur $i$ a été \textbf{actif} lorsque son contexte a été observé jusqu'au temps $t$ dans la période $j$, c'est-à-dire: $S_{i,j,t-1}=|\left\{s \leq t-1 , i \in \mathcal{O}_{s},\text{$s$ est dans la période $j$}, x_{i,s}\neq 0 \right\}|$; \item On note $F_{i,j,t-1}$ le nombre de fois où l'utilisateur $i$ a été \textbf{inactif} lorsque son contexte a été observé jusqu'au temps $t$ dans la période $j$, c'est-à-dire: $F_{i,j,t-1}=|\left\{s \leq t-1 , i \in \mathcal{O}_{s},\text{$s$ est dans la période $j$},x_{i,s}= 0 \right\}|$. et $F_{i,j,t-1}$. \end{itemize} \begin{prop} A l'instant $t$, la probabilité qu'a un utilisateur $i$ d'être actif suit une loi de Bernoulli telle que: \begin{equation} \mathbb{P}(i\text{ est actif au temps }t|\mathcal{D}_{i,t-1}^{obs})=\dfrac{S_{i,j,t-1}+1}{S_{i,j,t-1}+F_{i,j,t-1}+2} \end{equation} Où $j\in \left\{1,...,M \right\}$ correspond à la période dans laquelle se trouve $t$. \end{prop} \begin{preuve} Etant donné une loi de Bernoulli de paramètre $p$ et en utilisant un prior Beta$(a,b)$ sur $p$, on montre en utilisant la règle de Bayes que le posterior sur $p$ au bout de $n$ observations est une loi Beta$(a+nbSucc,b+nbFail)$ où $nbSucc$ représente le nombre d'issues positif et $nbFail$ le nombre d'issues négatif parmi les $n$ observations. Par ailleurs, la distribution posterior prédictive et une loi de Bernoulli de paramètre $(a+nbSucc)/(a+nbSucc+b+nbFail)$. En utilisant les notations proposées plus haut on obtient directement le résultat annoncé. \end{preuve} Nous sommes maintenant en mesure de dériver un nouvel algorithme de bandit contextuel prenant en compte des contextes cachés, que nous appellerons \texttt{HiddenLinUCB-Sample} dans la suite. Nous le détaillerons à la fin de cette section dans l'algorithme \ref{HiddenLinUCB-Sample}. Ce dernier nécessite la définition d'un loi pour $p(x_{i,t}|\gamma_{i})$ et d'une d'un prior $q(\gamma_{i})$ pour chaque action. On supposera qu'il s'agit d'un prior conjugué de sorte qu'il est possible d'échantillonner selon la loi $p(x_{i,t}|\mathcal{D}_{i,t-1}^{obs})$ lorsque cela est nécessaire. De plus dans cette version générique, on ne fait pas de supposition précise sur le processus délivrant les contextes c'est-à-dire sur la façon dont $\mathcal{O}_{t}$ est généré à chaque instant $t$. En revanche, pour faire partie de $\mathcal{K}$, une action doit être observée au moins une fois (au sens du contexte). Dans la partie expérimentale, nous proposerons diverses possibilités pour $\mathcal{O}_{t}$, à l'instar de ce qui a été fait dans le chapitre \ref{ModeleContextuelFixe}. Finalement, afin d'alléger les notations, nous avons enlevé les dépendances en temps des différents paramètres. Cependant, le système de mise à jour de ces derniers respecte la logique du processus. \begin{algorithm}[p] \scriptsize \KwIn{$k$, $T$, $\alpha$, $L$, $M$} $V \leftarrow I_{d\times d}$ (matrice identité de taille $d$)\; $b \leftarrow 0_{d}$ (vecteur de 0 de dimension $d$)\; $\mathcal{K} \leftarrow \emptyset$\; \For{$t=1..T$} { $j$=période correspondant à l'itération $t$\; Recevoir $\mathcal{O}_{t}$\; \label{getnewObservations} $\mathcal{K} = \mathcal{O}_{t} \cup \mathcal{K}$\; \label{feedArmSet} $\bar{\beta}=V^{-1}b$\; \For{$i \in \mathcal{K}$} { \eIf {$i \in \mathcal{O}_{t}$}{ \If {$i$ est nouveau}{ $N_{i}= 0$, $s_{i}= 0$, $\bar{\mu}_{i} =0$, $b_{i}= 0_{d}$, $\bar{x}_{i}=0_{d}$\; $\mathcal{D}_{i}^{obs}=\emptyset$, $p(x_{i}|\mathcal{D}_{i}^{obs})=q(\gamma_{i})$, $S_{i,k}=1$ pour tout $k\in \left\{1,...,M \right\}$, $F_{i,k}=1$ pour tout $k\in \left\{1,...,M \right\}$;\ } Observer $x_{i,t}$\; \label{beginObserveAndUpdate} $\mathcal{D}_{i}^{obs}= \mathcal{D}_{i}^{obs} \cup \left\{x_{i,t}\right\}$\; Mettre à jour $p(x_{i}|\mathcal{D}_{i}^{obs})$ \; \eIf {$x_{i,t}$ est nul}{ $F_{i,j}=F_{i,j}+1$ } { $S_{i,j}=S_{i,j}+1$ } \label{endObserveAndUpdate} $s_{i,t}=\bar{\mu}_{i}+(x_{i,t}-\bar{x}_{i})^{\top}\bar{\beta} + \alpha\sqrt{\dfrac{1}{N_{i}+1}+(x_{i,t}-\bar{x}_{i})^{\top}V^{-1}(x_{i,t}-\bar{x}_{i})}$ \; } { \For{$j=1..L$} { $s_{i,t}=0$\; $p_{i,t}=\dfrac{S_{i,j}+1}{S_{i,j}+F_{i,j}+2}$\; Echantillonner $isActive$ selon une loi de Bernouilli de paramètre $p_{i,t}$\; \eIf {$isActive=1$}{ Echantillonner $x$ selon $p(x_{i}|\mathcal{D}_{i}^{obs})$ \; $s_{i,t}=s_{i,t}+\left(\bar{\mu}_{i}+(x-\bar{x}_{i})^{\top}\bar{\beta} + \alpha\sqrt{\dfrac{1}{N_{i}+1}+(x-\bar{x}_{i})^{\top}V^{-1}(x-\bar{x}_{i})}\right)/L$\; } { $s_{i,t}=s_{i,t}+\left(\bar{\mu}_{i}-\bar{x}_{i}^{\top}\bar{\beta} + \alpha\sqrt{\dfrac{1}{N_{i}+1}+\bar{x}_{i}^{\top}V^{-1}\bar{x}_{i}}\right)/L$\; } } } } Sélectionner les $k$ actions ayant les scores les plus élevés:\\ $\qquad\mathcal{K}_{t} \leftarrow \argmax\limits_{\hat{\mathcal{K}} \subseteq \mathcal{K}, |\hat{\mathcal{K}}|=k} \quad \sum\limits_{i \in \hat{\mathcal{K}}} s_{i,t}$ \; \label{userSelection} \For{$i \in \mathcal{K}_{t}$} { \label{updateCountsBegin} Recevoir $r_{i,t}$\; \If{$i\in \mathcal{O}_{t}$}{ $V= V+b_{i}b_{i}^{\top}/(N_{i}+1)$\; $b= b+b_{i}s_{i}/(N_{i}+1)$\; $N_{i}= N_{i}+1$\; $s_{i}= s_{i}+r_{i,t}$\; $\bar{\mu}_{i} = s_{i}/(N_{i}+1)$\; $b_{i}= b_{i}+x_{i,t}$\; $\bar{x}_{i}= b_{i}/(N_{i}+1)$\; $V= V+x_{i,t}x_{i,t}^{\top}-b_{i}b_{i}^{\top}/(N_{i}+1)$\; $V= b+r_{i,t}x_{i,t}-b_{i}s_{i}/(N_{i}+1)$ } } \label{updateCountsEnd} } \caption{\texttt{HiddenLinUCB-Sample}} \label{HiddenLinUCB-Sample} \end{algorithm} Dans la section suivante, nous proposons une autre approche basée sur l'estimation de la moyenne empirique du contexte de chaque action. \subsubsection{Modèle 2: utilisation de la moyenne empirique} \textbf{Hypothèses supplémentaires:} Afin de prendre en compte les contextes non visibles, nous effectuons les hypothèses suivantes: \begin{itemize} \item Sans perte de généralité, nous supposons que $\beta$ est borné par $S \in \mathbb{R}^{+*}$, c.-à-d. $||\beta|| \leq s $, où $||$ $||$ désigne la norme $l^{2}$ sur $\mathbb{R}^{d}$. \item Pour tout $i$ et à chaque $t$, les contextes $x_{i,t} \in \mathbb{R}^{d}$ sont indépendants et identiquement distribués depuis une distribution inconnue de moyenne $x_{i}$ et variance $\Sigma_{i}$ finie. Dans la suite on suppose que l'on a $\Sigma_{i}=\gamma_{i}^{2}Id$ afin d'alléger les notations. A nouveau des cas plus complexes peuvent être pris en compte. \end{itemize} \begin{note} La dernière hypothèse n'est pas restrictive dans le sens où la forme des distributions n'est pas imposée par le modèle. L'hypothèse de variance finie - qui implique l'existence d'une espérance - est respectée pour la plupart des distributions usuelles. \end{note} \begin{theo} \label{theoUCBICWSMBis} Soit $0<\delta_1<1$ et $0<\delta_2<1$. En notant $M=\max\limits_{i\in\mathcal{K}}\gamma_{i}^{2}$ et $\mathbb{E}[r_{i,t}]$ l'espérance des récompenses de l'action $i$ prise sur les contexte, alors pour tout $t$ on a: \begin{multline} P\left(|\mathbb{E}[r_{i,t}] -\bar{\mu}_{i,t-1} - (\hat{x}_{i,t-1}-\bar{x}_{i,t-1})^{\top}\bar{\beta}_{t-1}| \leq \alpha_{1} \ \hat{\sigma}_{i,t-1} + \alpha_{2}\sqrt{\dfrac{1}{n_{i,t-1}}} \right) \geq 1-\delta_{1}-\delta_{2} \\ \text{avec} \ \hat{\sigma}_{i,t-1} = \sqrt{\dfrac{1}{N_{i,t-1}^{both}+1} + (\hat{x}_{i,t-1}-\bar{x}_{i,t-1})^{\top}V_{t-1}^{-1}(\hat{x}_{i,t-1}-\bar{x}_{i,t-1})} \label{probNonObs} \end{multline} où $\alpha_{1}=\Phi^{-1}(1-\delta_{1}/2)$ et $\alpha_{2}=S\sqrt{\dfrac{Md}{\delta_{2}}}$ \end{theo} \begin{preuve} La preuve complète est disponible en annexe \ref{PreuveUCBICWSMBis}. \end{preuve} Ainsi, l'inégalité ci-dessus nous donne une borne relativement serrée de l'intervalle de confiance associé à la récompense espérée de l’utilisateur $i$, d'où nous pouvons dériver un nouveau score de sélection. À chaque itération $t$, si le contexte de $i$ n'est pas observé, son score noté $\tilde{s}_{i,t}$ est tel que: \begin{equation} \tilde{s}_{i,t}=\bar{\mu}_{i,t-1}+(\hat{x}_{i,t-1}-\bar{x}_{i,t-1})^{\top}\bar{\beta}_{t-1} + \alpha_{1} \sqrt{\dfrac{1}{N_{i,t}^{both}+1} + (\hat{x}_{i,t}-\bar{x}_{i,t})^{\top}V_{t}^{-1}(\hat{x}_{i,t}-\bar{x}_{i,t})} + \alpha_{2}\sqrt{\dfrac{1}{n_{i,t-1}}} \label{scoreNotObsMeanChap3} \end{equation} Notons que le terme d'exploration supplémentaire $\sqrt{\dfrac{1}{n_{i,t-1}}}$ tend vers 0 à mesure que le nombre d’observations de $i$ augmente, et le score tend donc vers un score \texttt{LinUCB} \cite{banditCtxtLinUCB} classique (comme dans l'équation \ref{obsScoreChap3}) dans lequel le contexte est remplacé par sa moyenne empirique $\hat{x}_{i,t-1}$. Notons que si la probabilité qu'un contexte soit visible et $0<p<1$ on peut affirmer que $\sqrt{\dfrac{1}{n_{i,t-1}}}$ tend bien vers 0 lorsque $t$ est suffisamment grand. \begin{note} Si l'on souhaite avoir une probabilité égale pour les cas (contexte observé et non observé), il suffira de prendre $\delta_{1}=\delta_{2}=\delta/2$. \end{note} A nouveau, nous sommes en mesure de dériver un nouvel algorithme de bandit contextuel avec contextes cachés. Nous appellerons ce dernier \texttt{HiddenLinUCB-Mean} dans la suite. Ce dernier est détaillé ci-après dans l'algorithme \ref{HiddenLinUCB-Mean}. Comme précédemment, nous avons enlevé les dépendances en temps des différents paramètres. \begin{algorithm}[p] \scriptsize \KwIn{$k$, $T$, $\alpha$,$\alpha_1$,$\alpha_2$} $V \leftarrow I_{d\times d}$ (matrice identité de taille $d$)\; $b \leftarrow 0_{d}$ (vecteur de 0 de dimension $d$)\; $\mathcal{K} \leftarrow \emptyset$\; $\bar{\beta}=V^{-1}b$\; \For{$t=1..T$} { Recevoir $\mathcal{O}_{t}$\; \label{getnewObservationsBis} $\mathcal{K} = \mathcal{O}_{t} \cup \mathcal{K}$\; \label{feedArmSetBis} \For{$i \in \mathcal{K}$} { \eIf {$i \in \mathcal{O}_{t}$}{ \If {$i$ est nouveau}{ $N_{i}= 0$, $s_{i}= 0$, $\bar{\mu}_{i} =0$, $b_{i}= 0_{d}$, $\bar{x}_{i}=0_{d}$\; $n_{i}=0$, $\hat{x}_{i}=0_{d}$\; } Observer $x_{i,t}$\; \label{beginObserveAndUpdateBis} $\hat{x}_{i}=(n_{i}\hat{x}_{i}+x_{i,t})/(n_{i}+1)$\; $n_{i}=n_{i}+1$ \; \label{endObserveAndUpdateBis} $s_{i,t}=\bar{\mu}_{i}+(x_{i,t}-\bar{x}_{i})^{\top}\bar{\beta} + \alpha\sqrt{\dfrac{1}{N_{i}+1}+(x_{i,t}-\bar{x}_{i})^{\top}V^{-1}(x_{i,t}-\bar{x}_{i})}$ \; } { $s_{i,t}=\bar{\mu}_{i}+(\hat{x}_{i}-\bar{x}_{i})^{\top}\bar{\beta} +\alpha_{1}\sqrt{\dfrac{1}{N_{i}+1}+(\hat{x}_{i}-\bar{x}_{i})^{\top}V^{-1}(\hat{x}_{i}-\bar{x}_{i})} + \alpha_{2}\sqrt{\dfrac{1}{n_{i}}}$\; } } Sélectionner les $k$ actions ayant les scores les plus élevés:\\ $\qquad\mathcal{K}_{t} \leftarrow \argmax\limits_{\hat{\mathcal{K}} \subseteq \mathcal{K}, |\hat{\mathcal{K}}|=k} \quad \sum\limits_{i \in \hat{\mathcal{K}}} s_{i,t}$ \; \label{userSelectionBis} \For{$i \in \mathcal{K}_{t}$} { \label{updateCountsBeginBis} Recevoir $r_{i,t}$\; \If{$i\in \mathcal{O}_{t}$}{ $V= V+b_{i}b_{i}^{\top}/(N_{i}+1)$\; $b= b+b_{i}s_{i}/(N_{i}+1)$\; $N_{i}= N_{i}+1$\; $s_{i}= s_{i}+r_{i,t}$\; $\bar{\mu}_{i} = s_{i}/(N_{i}+1)$\; $b_{i}= b_{i}+x_{i,t}$\; $\bar{x}_{i}= b_{i}/(N_{i}+1)$\; $V= V+x_{i,t}x_{i,t}^{\top}-b_{i}b_{i}^{\top}/(N_{i}+1)$\; $V= b+r_{i,t}x_{i,t}-b_{i}s_{i}/(N_{i}+1)$ } } \label{updateCountsEndBis} } \caption{\texttt{HiddenLinUCB-Mean}} \label{HiddenLinUCB-Mean} \end{algorithm} \subsubsection{Un mot sur le regret} Bien que l'algorithme \texttt{LinUCB} classique soit extrêmement performant et rapide d'un point de vue expérimental \cite{banditCtxtLinUCB}, son analyse théorique pose des difficultés techniques. En effet, comme le font remarquer les auteurs dans \cite{banditCtxtLinUCBpreuve}, pour pouvoir utiliser l'inégalité de Azuma-Hoeffding, il faut que les estimateurs de récompenses à chaque itération proviennent d'une combinaison linéaire de récompenses passées indépendantes. Or l'algorithme \texttt{LinUCB} calcule un estimateur de $\beta$ qui dépend des choix précédents. Pour outrepasser cette difficulté, les auteurs modifient ce dernier en \texttt{BaseLinUCB}, qui est basé sur des échantillons indépendants, et surplombé d’un algorithme nommé \texttt{SupLinUCB} qui permet de s'assurer que cette hypothèse est vérifiée en pratique. Notons que l’algorithme \texttt{OFUL}, permettant également de résoudre le problème du bandit contextuel, peut être étudié directement grâce au processus auto normalisé (voir chapitre précédent). Ainsi, l'étude du regret des deux algorithmes proposés nécessiterait d'une part les outils utilisés dans \cite{banditCtxtLinUCBpreuve}, mais aussi la quantification de l'impact de l'approximation effectuée en utilisant soit des échantillons (comme dans \texttt{HiddenLinUCB-Sample}) soit la moyenne empirique (comme dans \texttt{HiddenLinUCB-Mean}) à la place de la véritable valeur du contexte. En effet bien que les estimateurs soient de plus en plus précis à mesure que le nombre d'observations augmente, l'erreur potentiellement faite, sommée sur tous les pas de temps peut dans certains cas ne pas être sous-linéaire. Pour illustrer ce propos, prenons un cas très simple avec $K=2$, $k=1$, $d=1$, $\beta=1$, $\theta_{1}=\theta_{2}=0$. Dans ce cas, d'après la définition \ref{defPseudoRegCtxt}, le pseudo-regret cumulé vaut: $\hat{R}_{T}=\sum\limits_{t=1}^{T} x_{i^{\star}_{t},t}-x_{i_{t},t}$, où à l'instant $t$ on a $i^{\star}_{t}=\argmax\limits_{i=1,2} x_{i,t}$. En l'absence de supposition sur les distributions de $x_{1,t}$ et $x_{2,t}$, il est clair que l'algorithme \texttt{HiddenLinUCB-Sample} ne peut être appliqué. En revanche, l'algorithme \texttt{HiddenLinUCB-Mean} ne se servant que de la moyenne empirique est utilisable. Supposons que le processus de génération de $\mathcal{O}_{t}$ est le suivant : pendant les $T_{0}<T$ premiers pas de temps $\mathcal{O}_{t}=\mathcal{K}$ et pendant les $T-T_{0}$ derniers pas de temps $\mathcal{O}_{t}=\emptyset$. On suppose de plus que $x_{i,t}$ vaut 1 pour le bras optimal et 0 pour l'autre, c'est à dire $x_{i,t}=\mathbb{1}_{\left\{i=i^{\star}_{t}\right\}}$. Supposons de plus que le bras optimal est généré de façon aléatoire, uniformément à chaque étape. Ainsi, les hypothèses de moyennes et variances finies sont bien respectées. Cependant, dans ce cas l'estimateur $\hat{x}_{i,t}$, utilisé dans le score de sélection dès lors que $t>T_{0}$ sera le même en moyenne pour tous les bras et donc notre politique \texttt{HiddenLinUCB-Mean} ne serait pas en mesure de distinguer l'action optimale. En effet, en considérant des termes de biais nuls dans le modèle, dans ce cas précis, le score de sélection de l'algorithme s'écrit: $s_{i,t}=\hat{x}_{i,t-1}^{\top}\bar{\beta}_{t-1}+\alpha_{1} \sqrt{ \hat{x}_{i,t}^{\top}V_{t}^{-1}\hat{x}_{i,t}}$. Finalement, il apparaît que le regret, qui peut s'écrire $\hat{R}_{T}=\sum\limits_{t=1}^{T} \mathbb{1}_{\left\{i_{t}\neq i^{\star}_{t}\right\}}$ grandira de façon linéaire. Nous venons donc d'extraire une situation dans laquelle les hypothèses énumérées plus haut sont respectées et où notre algorithme ne peut atteindre un regret sous-linéaire. \subsubsection{Conclusion} Dans le cadre de notre tâche de collecte d'information en temps réel, nous avons dans cette partie étudié un nouveau problème de bandit contextuel dans lequel à chaque itération, le contexte d'un certain nombre d'actions n'est pas accessible. Nous avons proposé deux méthodes distinctes permettant de prendre en compte les actions dont le profil est caché dans le processus de sélection à chaque itération. La première se base sur un échantillonnage des contextes manquants dans lequel on modélise directement la probabilité d'un utilisateur d'être actif à un certain instant, tandis que la seconde utilise un estimateur de leur moyenne comme approximation. Dans la partie suivante, nous proposons d'effectuer des expérimentations sur des données artificielles et sur des données de médias sociaux. \section{Expérimentations} \label{XPChap3} \subsection{Données artificielles} \subsubsection{Protocole} \textbf{Génération des données:} Afin d'évaluer les performances de notre algorithme nous l'expérimentation dans un premier temps sur des données simulées. Pour cela, on fixe un horizon de $T=5000$ pas de temps, un ensemble de $K=500$ actions et $d=10$ dimensions. On fixe le nombre de périodes à $M=8$ et le nombre de pas de temps par période à $nbStepsPerPeriod=10$. On tire ensuite un vecteur de régression $\beta$ aléatoirement dans $\left[-S/\sqrt{d}..S/\sqrt{d}\right]^{d}$, de façon à respecter la condition $||\beta||\leq S =1$. Pour chaque bras $i$ on tire un vecteur aléatoire $x_{i}$ depuis une loi normale $\mathcal{N}(0,Id)$ de dimension $d$ et un paramètre $\theta_{i}$ depuis une loi normale $\mathcal{N}(0,1)$. Pour finir, on tire uniformément dans $\left[0..1\right]^{M}$ un vecteur $p_{i}$ pour chaque action $i$. Ensuite, pour chaque itération $t \in \left\{1,...,T \right\}$ du processus, on procède de la façon suivante pour simuler les données: \begin{enumerate} \item On calcule $j$, la période dans laquelle se trouve $t$; \item Pour chaque $i \in \left\{1,...,K \right\}$ \begin{enumerate} \item on tire un variable $isActive$ selon une loi de Bernoulli de paramètre $p_{i,j}$; \item \textbf{si} $isActive$ est vraie alors n tire un échantillon $x_{i,t}$ suivant une loi uniforme normale $\mathcal{N}(x_{i},Id)$; \item \textbf{sinon} $x_{i,t}=0$. \end{enumerate} \item Pour chaque $i \in \left\{1,...,K \right\}$, on tire une récompense $r_{i,t}$ selon une normale $\mathcal{N}(x_{i,t}^{\top}\beta+\theta_{i},1)$; \item Pour chacune des politiques étudiées, on sélectionne un ensemble $\mathcal{K}_{t}$ de $k=10$ actions pour lesquelles on récolte la récompense correspondante. \end{enumerate} Ce processus est répété 1000 fois puis moyenné. \textbf{Politiques testées:} Les algorithmes de bandits contextuels existants ne semblent pas bien adaptés pour traiter notre problème de bandit avec contextes cachés. En effet, ces derniers ne peuvent pas prendre les actions dont le contexte n'est pas disponible à un instant donné dans le processus de sélection. Contrairement au cas du chapitre précédent, ici, notre problème ne peut pas se voir directement comme un problème de bandit stationnaire. Cependant, en prenant l'espérance des récompenses de chaque action $i$ selon les profils, nous avons montré que l'on a $\mathbb{E}[r_{i,t}]=x_{i}^{\top}\beta + \theta_{i}$. Ainsi les algorithmes de bandits stationnaires peuvent être en mesure de détecter cette valeur de biais. Cependant, ces derniers ne peuvent pas exploiter les valeurs réelles des contextes observés. Nous choisissons de nous comparer aux algorithmes suivants : \texttt{CUCB}, \texttt{CUCBV}, \texttt{MOSS} et un algorithme \texttt{Thompson Sampling} avec récompense gaussienne décrite dans l'état de l'art, et initialement proposé par \cite{banditSimpleThompsonAnalysis2}. Soulignons que ces trois politiques n'utilisent aucune information extérieure autre que les récompenses observées. D'autre part, nous implémentons les deux politiques que nous avons proposées, à savoir \texttt{HiddenLinUCB-Sample} et \texttt{HiddenLinUCB-Mean} respectivement décrits dans les algorithmes \ref{HiddenLinUCB-Sample} et \ref{HiddenLinUCB-Mean}. Pour \texttt{HiddenLinUCB-Sample} nous fixons le nombre d'échantillons à une valeur de $L=50$ et le nombre de périodes à $M=8$. On fixe de plus $\delta=0.05$, ce qui correspond à une valeur de $\alpha=1.96$. Pour \texttt{HiddenLinUCB-Mean}, on utilise également $\alpha=\alpha_{1}=\alpha_{2}=1.96$. Finalement, pour chacune de ces deux politiques, nous implémentons les trois scénarios présentés au chapitre précédent pour le processus générant l'ensemble $\mathcal{O}_{t}$ à chaque itération. On rappelle que dans le cas 1 on a $\mathcal{O}_{t}=\mathcal{K}$, dans le cas 2, chaque action a une probabilité $p$ d'être dans $\mathcal{O}_{t}$ à chaque pas de temps et dans le cas 3, $\mathcal{O}_{t}=\mathcal{K}_{t-1}$. Ainsi, dans le cas 3, chaque action doit être sélectionnée au moins une fois afin de lui permettre d'entrer dans l'ensemble $\mathcal{K}$. On forcera donc l'algorithme à agir de la sorte. On compare différentes valeurs de $p\in \left\{0,0.1,0.2, 0.5,0.7, 1 \right\}$ où l'on rappelle que par convention $p=0$ correspondant au cas 3 et $p=1$ au cas 1. Lorsque $p=1$, les deux algorithmes sont identiques et on les notera \texttt{LinUCB}, ce qui correspond à la version traditionnelle. \textbf{Echantillonnage des contextes non disponibles: } L'algorithme \texttt{HiddenLinUCB-Sample} effectue à chaque itération, et pour les actions dont le profil n'est pas visible, un certain nombre d'échantillonnages. En effet d'une part une variable aléatoire décide si oui ou non un contexte est émis, puis, dans le cas positif, le contexte lui-même doit être échantillonné selon la loi posterior prédictive $p(x_{i}|\mathcal{D}_{i,t-1}^{obs})$. Afin d'être en mesure de maintenir une distribution analytique et échantillonnable, il est nécessaire de faire des hypothèses, selon les cas d'usages, sur les contextes. Dans ce cas, conformément à la loi utilisée pour la génération des données, on fait l'hypothèse que les contextes $x_{i,t}$ sont gaussiens, de variance $\Sigma =Id$ et de moyenne $\mu_{i}$. Afin de rester dans un cadre probabiliste on place un prior, également gaussien sur chaque $\mu_{i}$ de moyenne nulle et de variance $\Sigma_{0} =Id$. Ainsi, l'application du théorème Bayes permet d'affirmer que la distribution a posteriori des $\mu_{i}$ est telle que\footnote{Il s'agit d'un résultat classique en inférence bayésienne}: \begin{equation*} p(\mu_{i}|\mathcal{D}_{i,t-1}^{obs}) \sim \mathcal{N}\left(\mu_{i};(\Sigma_{0}^{-1} + n_{i,t-1}\Sigma^{-1})n_{i,t-1}\Sigma^{-1}\hat{x}_{i,t-1}, (\Sigma_{0}^{-1} + n_{i,t-1}\Sigma^{-1})^{-1}\right) \end{equation*} D'où l'on obtient la distribution posterior prédictive qui nous intéresse pour effectuer l’échantillonnage : \begin{equation*} p(x_{i,t}|\mathcal{D}_{i,t-1}^{obs}) \sim \mathcal{N}\left(x_{i,t};(\Sigma_{0}^{-1} + n_{i,t-1}\Sigma^{-1})n_{i,t-1}\Sigma^{-1}\hat{x}_{i,t-1}, (\Sigma_{0}^{-1} + n_{i,t-1}\Sigma^{-1})^{-1}+\Sigma\right) \end{equation*} On remarque qu'à un instant $t$ cette distribution ne dépend que des itérations précédentes. Dans les expérimentations sur données réelles on utilisera une autre hypothèse sur les distributions de contextes, plus réaliste, ce qui nous conduira à une tout autre forme de loi posterior prédictive. \subsubsection{Résultats} Nous proposons de mesurer les performances de nos algorithmes en termes de regret cumulé $R_{t}$ dont nous rappelons la définition: \begin{equation*} \sum\limits_{s=1}^{t} \sum\limits_{i\in \mathcal{K}_{s}^{\star}} r_{i,s} - \sum\limits_{i\in \mathcal{K}_{s}} r_{i,s} \end{equation*} où $\mathcal{K}_{s}^{\star}$ est l'ensemble des $k$ actions ayant la plus grande valeur de $x_{i,s}^{\top}\beta+\theta_{i}$. La figure \ref{fig:regretVsTimeSimHiddenLinUCB} représente l'évolution du regret cumulé au cours du temps pour les différents algorithmes testés. Afin d'améliorer la lisibilité, on ne représente que les cas $p=0.5$, $p=0.1$ et $p=0.0$ pour les algorithmes \texttt{HiddenLinUCB-Sample} et \texttt{HiddenLinUCB-Mean}. Nous ferons une analyse des autres cas ultérieurement. La première chose à noter est que la politique \texttt{Random} offre de moins bonnes performances que tous les algorithmes de bandit stationnaires, à savoir \texttt{CUCB}, \texttt{CUCBV}, \texttt{MOSS} et \texttt{Thompson Sampling}. Ceci confirme que ces derniers sont en mesure d'apprendre les composantes de biais sur les différents bras. On remarque que les trois politiques \texttt{CUCB}, \texttt{MOSS} et \texttt{Thompson Sampling} offrent des performances quasi égales tandis que \texttt{CUCBV} est légèrement moins bon. La variance de toutes les actions étant la même ce dernier ne peut pas en tirer parti. Plus intéressant est le fait que dans toutes les configurations (c.-à-d. pour n'importe quelle valeur de $p$) les algorithmes \texttt{HiddenLinUCB-Sample} et \texttt{HiddenLinUCB-Mean} offrent de meilleurs résultats que les politiques de bandits stationnaires, toutes confondues. On note d'une façon générale que pour un algorithme donné (\texttt{HiddenLinUCB-Sample} ou \texttt{HiddenLinUCB-Mean}) les performances se dégradent à mesure que $p$ diminue, et a fortiori sont maximums pour $p=1$, c'est-à-dire pour la politique \texttt{LinUCB}. Ceci semble cohérent, étant donné que plus $p$ est grand, plus la qualité des estimateurs est élevée et le nombre de fois où l'on a à s'en servir est faible. En revanche lorsque $p$ est petit, on dispose de moins d'exemples pour maintenir les estimateurs de contexte, et l'on doit souvent s'en servir pour calculer les scores de sélection des actions dont le contexte n'est pas disponible à un instant donné. On remarque finalement que pour une valeur de $p$ fixée, l'algorithme \texttt{HiddenLinUCB-Sample} est toujours meilleur que l'algorithme \texttt{HiddenLinUCB-Mean}. De plus, cet effet est accentué lorsque les valeurs de $p$ diminuent. Le paragraphe ci-dessous fait une étude plus précise de ce comportement. \begin{figureth} \includegraphics[width=0.7\linewidth]{HiddenLinUCBSimulationK500T5000Regret.pdf} \caption[Regret simulation \texttt{HiddenLinUCB}]{Regret cumulé en fonction du temps pour l'expérience sur données artificielles.} \label{fig:regretVsTimeSimHiddenLinUCB} \end{figureth} La figure \ref{fig:regretFinalBowplotHiddenLinUCB} représente le diagramme en boîte de la valeur finale du regret sur les 1000 tests effectués pour les algorithmes \texttt{HiddenLinUCB-Mean} et \texttt{HiddenLinUCB-Sample} pour toutes les valeurs de $p$ proposées. L'idée selon laquelle pour une probabilité donnée, l'algorithme \texttt{HiddenLinUCB-Sample} offre de meilleures performances que \texttt{HiddenLinUCB-Mean} se confirme bien ici. De plus cet effet s'estompe bien lorsque $p$ augmente. Ce résultat est principalement dû au fait que nous avons généré des données selon un modèle prenant l'inactivité des certaines actions (au sens contexte nul) selon les périodes, et que l'algorithme \texttt{HiddenLinUCB-Sample} parvient donc à mieux modéliser l’environnement que son concurrent. Cependant, il est beaucoup plus coûteux, car il nécessite à la fois plus de mémoire, mais aussi des temps de calcul plus importants du fait qu'il doive échantillonner un grand nombre de variables aléatoires. Nous remarquons aussi que la variabilité des résultats est d'autant plus grande que $p$ diminue. Ceci peut s'expliquer d'un côté par le fait que le processus générant $\mathcal{O}_{t}$ est plus variable, mais également par le fait que les estimateurs utilisés sont moins précis (et donc plus variables). D'ailleurs, l'algorithme \texttt{HiddenLinUCB-Sample}, qui possède lui-même une source d'incertitude due à l'échantillonnage a globalement plus de variabilité. \begin{figureth} \includegraphics[width=0.7\linewidth]{HiddenLinUCBSimulationK500T5000BoxplotFinalRegret.pdf} \caption[Diagramme en boîte du regret final \texttt{HiddenLinUCB}]{Diagramme en boîte du regret final obtenu avec les algorithmes \texttt{HiddenLinUCB-Mean} et \texttt{HiddenLinUCB-Sample} pour différentes valeurs de $p\in \left\{0,0.1,0.2, 0.5,0.7, 1 \right\}$.} \label{fig:regretFinalBowplotHiddenLinUCB} \end{figureth} Dans la section qui suit, nous expérimentons nos algorithmes sur des données réelles. \subsection{Données réelles} Nous venons de voir que les algorithmes proposés dans le chapitre offrent de bonnes performances sur des données simulées respectant bien les hypothèses. Nous proposons maintenant d'expérimenter ces mêmes algorithmes dans le cadre de notre tâche de collecte d'information sur Twitter. Nous nous évaluerons à la fois sur des jeux de données, mais aussi dans une expérimentation en conditions réelles. \subsubsection{Hors ligne} \paragraph{Modèle de contexte} On se place dans le même cadre que dans le chapitre précédent (c.f. \ref{modelProfilStat}) dans lequel, à un instant $t$, nous utilisions les messages postés au temps $t-1$ comme échantillons de profils à l'instant $t$ (pour les utilisateurs appartenant à $\mathcal{O}_{t}$. Formellement nous avions $x_{i,t}=F(\omega_{i,t-1})$ où $\omega_{i,t-1}$ représente les messages du compte $i$ à l'instant $t-1$ et $F$ est une transformation nous permettant de réduire la dimension de l'espace des profils. Nous proposons d'utiliser cette même représentation pour modéliser le contexte d'un utilisateur à un instant donné. Cependant, ces derniers ne seront pas utilisés de la même façon que dans le chapitre précédent dans l'algorithme de collecte de données. On remarquera que ce modèle a l'avantage de modéliser indirectement l'activité des utilisateurs. En effet, un contexte nul est équivalent à une absence d'activité d'un utilisateur sur le réseau social à un instant donné. En revanche, il est évidemment possible qu'un compte publie à un instant $t$ sans pour autant avoir été actif au temps $t-1$, d'où la présence du terme de biais dans notre modèle. Nous pouvons désormais appliquer l'algorithme \texttt{HiddenLinUCB-Mean} directement, par contre l'algorithme \texttt{HiddenLinUCB-Sample} nécessite quant à lui un modèle probabiliste de la distribution des contextes pour qu'il soit en mesure de les échantillonner lorsque ces derniers ne sont pas disponibles (c.-à-d. pour tous les utilisateurs n'étant pas dans $\mathcal{O}_{t}$ à un instant $t$). Comme nous l'avons déjà précisé dans le chapitre précédent, la fonction $F$ appliquée au message correspond dans notre cas à une transformation LDA. En regardant de plus près ce modèle, il apparaît que les composantes du vecteur de sortie suivent une loi de Dirichlet. Ainsi, un choix judicieux pour modéliser les contextes de façon probabiliste serait d'utiliser une loi de Dirichlet. Or cette dernière ne possède pas de prior conjugué, rendant ainsi complexe un apprentissage des lois a posteriori. Afin s'affranchir de cette difficulté tout en restant réalistes, nous choisissons de modéliser directement les messages publiés par les utilisateurs. Dans cette optique, on utilise un modèle sac de mot pour la représentation des messages. Etant donné un dictionnaire de taille $m$, un message $\omega_{i,t-1}$ est représenté comme un vecteur de $\mathbb{N}^{m}$, où la composante $k$ est égale au nombre d'occurrences du mot $k$ dans le message. Afin de rester dans un cadre probabiliste, on fait l'hypothèse que ces derniers proviennent de lois multinomiales à $m$ issues, où le nombre de tirages correspond au nombre de mots dans un message. Pour restreindre la taille des vecteurs de probabilités, nous limitons le nombre de mots du dictionnaire. Dans cette optique, nous avons appliqué un \textit{Stemmer} à l'ensemble des messages des bases de données puis nous avons calculé les scores TF-IDF de chaque terme. Nous ne conservons que les $m=2000$ mots les plus importants dans notre dictionnaire final. Pour chaque compte $i$, on note $p_{i}$ le vecteur de probabilité de chaque mot. Le prior conjugué de la loi multinomiale est la distribution de Dirichlet de dimension $m$. Cette dernière possède un paramètre noté $a=a_{1},..,a_{m}$. Ainsi la distribution a posteriori de $p_{i}$ étant donné les observations $\mathcal{D}_{i,t-1}^{obs}$ est une loi de Dirichlet telle que: \begin{equation*} p(p_{i}|\mathcal{D}_{i,t-1}^{obs}) = Dir(a+\sum\limits_{s\in \mathcal{T}^{obs}_{i,t-1}}\omega_{i,s}) \end{equation*} Par ailleurs, la distribution posterior prédictive est une loi de Dirichlet-Multinomiale de paramètre $a^{post}=a+\sum\limits_{s\in \mathcal{T}^{obs}_{i,t-1}}\omega_{i,s}$. L'échantillonnage d'un message selon cette loi s'effectue de la façon suivante : premièrement, on fait un tirage de $m$ valeurs selon $m$ distributions Gamma de paramètre $a^{'}_{k}$ pour $k\in \left\{1,m\right\}$. On normalise ensuite chaque valeur par la somme de toutes les composantes pour avoir un vecteur de probabilités. On effectue ensuite $l$ tirages selon cette probabilité, ou $l$ est la taille du message que l'on souhaite générer. Nous avons fixé à $l=50$ mots pour tous les utilisateurs. Notons qu'il serait également possible d'effectuer un apprentissage sur la taille des messages de chaque utilisateur. Finalement, une fois un message échantillonné, la fonction $F$ lui est appliquée pour créer un contexte. \paragraph{Protocole} Nous utilisons le même protocole que celui présenté dans la partie \ref{protocole} du chapitre précédent, à savoir le modèle \textit{Topic+Influence} avec les trois thématiques \textit{Politique}, \textit{Religion} et \textit{Science}, et ce pour les trois bases de données collectées. Nous verrons que dans ce cas les résultats ne sont pas aussi tranchés que pour les données simulées. Nous comparons les politiques \texttt{HiddenLinUCB-Mean} et \texttt{HiddenLinUCB-Sample} à tous les algorithmes testés jusqu'ici, à savoir \texttt{CUCB}, \texttt{CUCBV}, \texttt{UCB}-$\delta$, \texttt{MOSS} et \texttt{SampLinUCB}. On fixe $L=50$ et $\alpha=\alpha_{1}=\alpha_{2}=1.96$. Nous choisissons de diviser un jour en $M \in \left\{1,2,4,8 \right\}$ périodes afin de prendre en compte l'activité des comptes selon les moments de la journée. Etant donné qu'une itération du processus d'écoute dure ici 100 secondes on a $nbStepsPerPeriod=60*60*24/M/100=108$. Finalement, pour les algorithmes nécessitant un processus de génération de l'ensemble $\mathcal{O}_{t}$, c'est-à-dire \texttt{SampLinUCB}, \texttt{HiddenLinUCB-Mean} et \texttt{HiddenLinUCB-Sample} on simule le processus pour différents $p\in \left\{0, 0.01,0.05, 0.1, 0.5,1 \right\}$, $p=0$ correspondant au cas 3 et $p=1$ au cas 1. Notons que lorsqu’ un utilisateur $i$ est dans $\mathcal{O}_{t}$, la même valeur de $x_{i,t}$ est délivrée à ces trois algorithmes, la différence se situe dans la manière dont ils s'en servent dans leur politique de sélection. \paragraph{Résultats} Le nombre d'algorithmes et de configurations étant élevé, la représentation graphique de l'évolution de la récompense cumulée en fonction du temps sur une même courbe n'est pas envisageable. Nous proposons plutôt une représentation condensée dans laquelle, pour chaque algorithme on illustre la valeur finale de la récompense cumulée. Ainsi les figures \ref{fig:finalRewardDBUS}, \ref{fig:finalRewardDBOG} et \ref{fig:finalRewardDBBrexit} représentent cette grandeur respectivement pour les bases \textit{USElections}, \textit{OlympicGames} et \textit{Brexit} et pour les trois thématiques. Pour plus de lisibilité, nous utilisons une même couleur pour représenter les algorithmes dans lesquels la probabilité $p$ est la même. Premièrement, lorsque chaque contexte est observable ($p=1$), notre approche contextuelle (que ce soit \texttt{HiddenLinUCB-Sample} ou \texttt{HiddenLinUCB-Mean}) correspond à un algorithme \texttt{LinUCB} classique et fonctionne mieux que les approches \texttt{CUCB}, \texttt{CUCBV}, \texttt{MOSSS} et \texttt{UCB}-$\delta$. Ce résultat montre que nous sommes en mesure de mieux anticiper les utilisateurs qui vont être les plus pertinents à l'étape suivante, compte tenu de leur activité juste avant. Cela confirme aussi le comportement non stationnaire des utilisateurs. Par exemple, les utilisateurs peuvent parler de science au cours de la journée tout en étant plus axés sur le sport quand ils reviennent à la maison. Considérer les contextes permet également de converger plus rapidement vers les utilisateurs intéressants puisque tous les comptes partagent le même paramètre $\beta$. En outre, les résultats montrent que, même pour de faibles probabilités d'observation des contextes $p$, notre politique contextuelle se comporte beaucoup mieux que les approches non contextuelles, ce qui valide empiriquement notre approche : il est possible de tirer parti de l'information contextuelle, même si une grande partie de cette information est cachée. En donnant la possibilité de sélectionner des utilisateurs même si leur contexte est inconnu, nous permettons à l'algorithme de compléter sa sélection en choisissant les utilisateurs dont le contexte moyen correspond à un profil appris. Si aucun utilisateur dans $\mathcal{O}_{t} $ ne semble actuellement pertinent, l'algorithme peut alors compter sur les utilisateurs avec une bonne qualité intrinsèque moyenne. A titre d'exemple, pour la base \textit{USElections} et la thématique science, le nombre moyen d'utilisateurs sélectionnés pour lesquels le contexte a été observé à chaque pas de temps est de 43 pour $p=0.1$ et 58 pour $p=0.5$, ce qui confirme que l'utilisation de contextes intéressants lorsque ceux-ci sont disponibles, tout en conservant une probabilité de sélection non négligeable pour les utilisateurs de qualité dont le contexte n'est pas connu. On remarque aussi que pour une même valeur de $p$, l'algorithme \texttt{HiddenLinUCB-Sample} est très souvent plus performant quand le nombre de périodes $M$ est élevé (surtout sur les bases \textit{USElections} et \textit{Brexit}). Ainsi, découper une journée en différentes périodes, dans lesquelles les utilisateurs peuvent avoir une activité plus ou moins forte, semble pertinent. En revanche, contrairement au cas des données simulées, l'approche \texttt{HiddenLinUCB-Sample} ne parvient pas à surpasser \texttt{HiddenLinUCB-Mean}. Au mieux, lorsque $M=8$, les performances sont équivalentes pour la base de données \textit{USElections}. Nous expliquons cela par le fait que dans un scénario réel, les récompenses ne suivent pas assez bien les hypothèses du modèle pour que l'échantillonnage des contextes soit suffisamment proche de la réalité, tandis que l'utilisation directe de la moyenne empirique (comme dans \texttt{HiddenLinUCB-Mean}), permet de discriminer plus efficacement les comptes les moins actifs. Un autre point important est que lorqsue $p=0$, l'algorithme \texttt{HiddenLinUCB-Sample} peut être bon que des approches de bandit stochastique de base, ce qui est dû à une mauvaise exploration de l'espace. En effet, si dans \texttt{HiddenLinUCB-Mean}, un bonus est donné aux utilisateurs peu observés (terme en $1/\sqrt{n_{i,t-1}}$), dans \texttt{HiddenLinUCB-Mean} rien ne favorise ces derniers, ce qui peut conduire à des situations ou certains comptes sont oubliés. Continuons cette analyse par une comparaison plus précise avec la méthode \texttt{SampLinUCB} du chapitre précédent, basée sur l'estimation des profils des utilisateurs. Nous insistons au passage sur le fait que cette approche utilise les mêmes vecteurs $x_{i,t}$ dans son processus de sélection mais s'en sert différemment. Il apparaît que pour une même valeur de $p$, les méthodes proposées dans ce chapitre - que ce soit \texttt{HiddenLinUCB-Mean} ou \texttt{HiddenLinUCB-Sample} - permet d'obtenir de meilleurs résultats, du moins pour les bases de données \textit{USElections} et \textit{Brexit} (pour la base \textit{OlympicGames}, les résultats sont plus mitigés). Ceci peut s'expliquer par le fait que l'approche de ce chapitre, bien que modélisant un terme stationnaire de biais, est essentiellement non stationnaire, à la différence de l'approche du chapitre précédent. Il semble que ceci soit particulièrement pertinent dans un réseau social puisque les utilisateurs y ont une attitude très variable de façon générale, pouvant être mieux captée par le modèle contextuel utilisé. A nouveau, lorsque $p=0$, on remarque que \texttt{HiddenLinUCB-Sample} est moins performant que \texttt{SampLinUCB}. \begin{figureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBUS_PoliticFinalRwd.pdf} \caption{Politique} \end{subfigureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBUS_ReligionFinalRwd.pdf} \caption{Religion} \end{subfigureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBUS_ScienceFinalRwd.pdf} \caption{Science} \end{subfigureth} \caption[Récompense finale pour tous les algorithmes testés sur la base \textit{USElections}.]{Récompense finale pour tous les algorithmes testés sur la base \textit{USElections} et le modèle \textit{Topic+Influence} avec différentes thématiques.} \label{fig:finalRewardDBUS} \end{figureth} \begin{figureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBOG_PoliticFinalRwd.pdf} \caption{Politique} \end{subfigureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBOG_ReligionFinalRwd.pdf} \caption{Religion} \end{subfigureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBOG_ScienceFinalRwd.pdf} \caption{Science} \end{subfigureth} \caption[Récompense finale pour tous les algorithmes testés sur la base \textit{OlympicGames}.]{Récompense finale pour tous les algorithmes testés sur la base \textit{OlympicGames} et le modèle \textit{Topic+Influence} avec différentes thématiques.} \label{fig:finalRewardDBOG} \end{figureth} \begin{figureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBBrexit_PoliticFinalRwd.pdf} \caption{Politique} \end{subfigureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBBrexit_ReligionFinalRwd.pdf} \caption{Religion} \end{subfigureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBBrexit_ScienceFinalRwd.pdf} \caption{Science} \end{subfigureth} \caption[Récompense finale pour tous les algorithmes testés sur la base \textit{Brexit}.]{Récompense finale pour tous les algorithmes testés sur la base \textit{Brexit} et le modèle \textit{Topic+Influence} avec différentes thématiques.} \label{fig:finalRewardDBBrexit} \end{figureth} \textbf{Note sur l'activité des profils: }Pour chaque jeu de données, nous calculons la probabilité (a posteriori) d'être actif de chaque utilisateur, indépendamment de la récompense, pour chacune des huit périodes considérées. Concrètement, cela correspond à la valeur $p_{i,j,T}$ calculée par \texttt{HiddenLinUCB-Sample} lorsque $p=1$ pour chaque utilisateur $i\in \mathcal{K}$ et chaque période $j\in \left\{1,...,8\right\}$. Ensuite pour chaque compte $i$, nous calculons la période $p_{i}^{\star}$ pour laquelle il a la plus forte probabilité de parler, c'est à dire $p_{i}^{\star}=\max\limits_{j\in \left\{1,...,8\right\}} p_{i,j,T}$ (on note la période correspondante $j_{i}^{\star}=\argmax\limits_{j\in \left\{1,...,8\right\}} p_{i,j,T}$). Finalement pour chaque période $j$, nous notons $q_{j}$ le nombre d'utilisateurs pour lesquels $j_{i}^{\star}=j$. La figure \ref{fig:probaTalk} représente $q_{j}$ pour chaque période $j$ et pour les trois jeux de données, où l'on a normalisé chaque valeur par le nombre total de comptes. Ces figures permettent d'illustrer de façon synthétique le fait tous les utilisateurs ne sont pas actifs au même moment d'une part, et d'autre part que leur activité n'est pas répartie de façon uniforme. En effet si c'était le cas, on n'observerait qu'une barre différente de zéro dans le premier cas et huit barres de tailles égales dans le second. Remarquons également que pour chaque base de données, la répartition est différente. \begin{figureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBUS_ProbaTalk.pdf} \caption{Base de données \textit{USElections}} \end{subfigureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBOG_ProbaTalk.pdf} \caption{Base de données \textit{OlympicGames}} \end{subfigureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBBrexit_ProbaTalk.pdf} \caption{Base de données \textit{Brexit}} \end{subfigureth} \caption[Activité des utilisateurs selon la période considérée]{Activité des utilisateurs en fonction de la période.} \label{fig:probaTalk} \end{figureth} \subsubsection{En ligne} \paragraph{Protocole} Nous considérons notre tâche de collecte dans une expérimentation en ligne sur Twitter prenant en compte l'ensemble du réseau social ainsi que les contraintes des différentes API. Comme nous l'avons déjà présenté, l'API \textit{Follow} \textit{Streaming} de Twitter nous offre la possibilité d'écouter un total de 5000 utilisateurs du réseau social simultanément. À l'instar de l'expérimentation en ligne du chapitre \ref{FormalisationTache}, nous utiliserons cette dernière pour récupérer les contenus produits par les comptes dans $\mathcal{K}_{t}$. Dans le cas où l'on ne dispose d'aucune autre source d'information, cette API sert également à récupérer les contextes de certains utilisateurs, ce qui correspond au scénario où $\mathcal{O}_{t}=\mathcal{K}_{t-1}$. Comme nous l'avons vu dans les expérimentations hors-ligne, de façon générale, l'augmentation du nombre de contextes visibles à chaque itération permet d'améliorer les résultats. Dans cette optique, rendre disponible plus de contextes semble être pertinent. En plus des 5000 comptes que l'on peut écouter en même temps, Twitter propose également une API \textit{Sample} \textit{streaming}, qui renvoie en temps réel 1\% de tous les tweets publics. Les éléments renvoyés par cette API sont les mêmes, peu importe la connexion utilisée. Ainsi, multiplier les comptes pour récupérer plus de données via cette API est inutile. Nous utilisons cette dernière pour découvrir de nouveaux utilisateurs, mais aussi pour récolter les contextes (activités) d'un grand nombre d'utilisateurs actifs à un moment donné. Concrètement, l'utilisation de cette seconde source d'information nous permet d'avoir plus d'utilisateurs dans $\mathcal{O}_{t}$ à chaque itération. Afin d'expliciter le fonctionnement du processus de collecte en temps réel dans ce cas, nous proposons une illustration dans la figure \ref{fig:processLiveCtxt}, où trois itérations sont représentées. Au début de chaque étape, la politique de sélection des sources choisit un ensemble d’utilisateurs à suivre ($\mathcal{K}_{t}$) parmi tous les utilisateurs connus du système (${\cal K}$), selon des observations et des connaissances fournies par un module d'apprentissage correspondant à la politique en question. Ensuite, les messages postés par les $k=5000$ profils sélectionnés sont collectés via l'API \textit{Follow streaming}. Comme nous pouvons le voir dans la partie centrale du schéma, après avoir suivi les utilisateurs de $\mathcal{K}_t$ pendant l'itération courante $t$, les messages collectés sont analysés (soit par un humain, soit automatiquement) et le résultat - traduisant la pertinence - est renvoyé au module d'apprentissage. En parallèle, à chaque itération, l'activité courante de certains utilisateurs est capturée par l'API \textit{Sample streaming}. Cela nous offre la possibilité d'enrichir la base des utilisateurs potentiels ${\cal K}$, mais aussi de construire l'ensemble des utilisateurs dont on connaît le contexte. Chaque profil ayant publié au moins un message parmi ceux qui ont été collectés avec l'API \textit{Sample streaming} à l'étape $t$ sont inclus dans $\mathcal{O}_{t+1}$, les messages d'un même auteur $i$ étant concaténés pour former $x_{i,t+1}$. À cet ensemble sont ajoutés les utilisateurs de $\mathcal{K}_{t}$, puisque leur activité complète a été suivie pendant l'étape $t$. \begin{figureth} \includegraphics[width=0.8\linewidth]{taskLast.pdf} \caption[Illustration du système]{Illustration du système.} \label{fig:processLiveCtxt} \end{figureth} Dans cette expérience, on fixe la durée d'une période d'écoute, notée $\mathcal{L}$, à $\mathcal{L}=15 minutes$ et l'horizon à deux semaines, ce qui correspond à $T=1344$. Nous choisissons la fonction de récompense \textit{Topic+Influence} avec la thématique politique. Comme précédemment, compte tenu des restrictions de Twitter, chaque expérience nécessite un compte développeur, ce qui limite le nombre de politiques que nous pouvons tester en parallèle. Nous avons choisi de tester les quatre stratégies suivantes : notre approche contextuelle \texttt{HiddenLinUCB-Mean}, l'algorithme \texttt{CUCBV}, une politique \texttt{Random} et une autre appelée \texttt{Static}, qui suit les mêmes 5000 comptes, sélectionnés a priori, à chaque étape du processus. Les 5000 comptes suivis par l'approche \texttt{Static} ont été choisis en sélectionnant les 5000 utilisateurs ayant cumulé le plus fort volume de récompenses selon les messages collectés par l'API \textit{Sample} sur une période de 24 heures. Pour information, certains comptes célèbres tels que \textit{@dailytelegraph}, \textit{@Independent} ou \textit{@CNBC} en faisaient partie. Remarquons enfin que $p$, la probabilité pour chaque utilisateur de révéler son activité n'est pas un paramètre, mais est contraint par la tâche. Précisons finalement que nous n'avons pas implémenté la politique \texttt{HiddenLinUCB-Sample} à cause de sa trop forte consommation en ressource (mémoire et calculatoire), en particulier dans un cadre où le nombre total de comptes peut être très grand. \paragraph{Algorithme détaillé} L'implémentation de l'algorithme \texttt{HiddenLinUCB-Mean} dans ce cadre nécessite quelques adaptations par rapport au cadre générique dans lequel nous l'avons décrit. En particulier, la manipulation des différents ensembles d'utilisateurs en jeu peut s'avérer délicate. On propose ainsi de détailler le processus de collecte dans l'algorithme \ref{algoCollectLiveContext}, dont le fonctionnement général est le suivant : Les ensembles et paramètres manipulés sont tout d'abord initialisés de la manière suivante: \begin{itemize} \item $V$ par une matrice identité de taille $d\times d$ et $b$ par un vecteur nul de taille $d$, avec $d$ la taille des vecteurs de contexte; \item $\mathcal{K}$ par l'ensemble vide; \item $\mathcal{O}_{1}$ par les utilisateurs auteurs de messages collectés au cours d'une première utilisation de l'API \textit{Sample} pendant une période de temps d'une durée ${\cal L}$. La représentation des messages de ces utilisateurs $i \in \mathcal{O}_{1}$ correspond à leur contexte $x_{i,1}$. \end{itemize} L'algorithme procède ensuite, pour chaque itération $t$ de la collecte selon: \begin{enumerate} \item Insertion dans $\mathcal{K}$ de chaque utilisateur de $\mathcal{O}_{t}$ n'en faisant pas encore partie (en limitant le nombre de nouveaux entrants à $newMax$ utilisateurs par itération afin d'éviter une sur exploration pour le cas des très grands réseaux tel que Twitter); \item Mise à jour des moyennes empiriques des contextes $\hat{x}_{i}$ pour les profils de $\mathcal{O}_{t}$; \item Calcul de l'estimateur du paramètre $\bar{\beta}$ ; \item Calcul des scores de sélection $s_{i,t}$ de tous les utilisateurs dans $\mathcal{K}$ selon que leur contexte est disponible ou non. Le score des nouveaux utilisateurs est fixé à $+\infty$ pour forcer le système à les choisir une première fois. Bien que cette initialisation ne soit pas obligatoire, cela nous permet en pratique d'avoir un premier estimateur de la qualité intrinsèque de chaque utilisateur; \item Sélection des $k$ profils ayant les meilleurs scores $s_{i,t}$; \item Capture simultanée via les APIs \textit{Sample} et \textit{Follow} pendant une période de durée ${\cal L}$. L'API \textit{Follow} écoute les $k$ utilisateurs sélectionnés $\mathcal{K}_{t}$; \item Calcul des récompenses des messages collectés pour les utilisateurs de $\mathcal{K}_t$ à partir de l'API \textit{Follow}, puis mise à jour des paramètres du modèle; \item Mise à jour de l'ensemble des utilisateurs observés $\mathcal{O}_{t+1}$, et des contextes associés, en considérant tous les utilisateurs pour lesquels au moins un message a été collecté pendant l'itération $t$ (provenant soit de l'API \textit{Sample} soit de l'API \textit{Follow}); \end{enumerate} \begin{algorithm}[p] \scriptsize \KwIn{$k$, $T$, $\alpha$,$\alpha_{1}$,$\alpha_{2}$, ${\cal L}$, $maxNew$} $V = I_{d\times d}$ (matrice identité de taille $d$)\; $b = 0_{d}$ (vecteur de 0 de dimension $d$)\; $\mathcal{K} = \emptyset$\; $\Omega_1 = $ Données collectées depuis l'API \textit{Sample} pendant une période de ${\cal L}$\; $\mathcal{O}_{1} = $ Auteurs ayant au moins un message dans $\Omega_1$\; \For{$t \gets 1$ \KwTo $T$} { $nbNew=0$\; \For{$i \in \mathcal{O}_{t}$}{ \If{$i \notin \mathcal{K}$ \textbf{et} $nbNew < maxNew$} { \label{addPoolBeginLive} $nbNew = nbNew +1$\; $\mathcal{K} = \mathcal{K} \cup \{i\}$\; $T_{i}= 0$; $n_{i}= 0$; $s_{i}= 0$; $b_{i}= 0_d$\; $\bar{\mu}_{i}= 0$; $\bar{x}_{i}= 0_d$; $\hat{x}_{i}= 0_d$\; } \label{addPoolEnd} \If{$a \in \mathcal{K}$}{ \label{observeContextBeginLive} Observer le contexte $x_{i,t}$ dans $\Omega_t \cup \Psi_t$\; Mettre à jour $\hat{x}_{i}$; $n_{i}= n_{i}+1$\; } \label{observeContextEnd} } $\bar{\beta} = V^{-1}b$\; \label{updateBetaLive} \For{$i \in \mathcal{K}$} { \label{ComputeScoresBeginLive} \If{$T_{i}>0$}{ \If{$i \in \mathcal{O}_{t}$} { $s_{i,t}=\bar{\mu}_{i}+(x_{i,t}-\bar{x}_{i})^{\top}\bar{\beta} + \alpha\sqrt{\dfrac{1}{N_{i}+1}+(x_{i,t}-\bar{x}_{i})^{\top}V^{-1}(x_{i,t}-\bar{x}_{i})}$\; } \Else{ $s_{i,t}=\bar{\mu}_{i}+(\hat{x}_{i}-\bar{x}_{i})^{\top}\bar{\beta} +\alpha_{1}\sqrt{\dfrac{1}{N_{i}+1}+(\hat{x}_{i}-\bar{x}_{i})^{\top}V^{-1}(\hat{x}_{i}-\bar{x}_{i})} + \alpha_{2}\sqrt{\dfrac{1}{n_{i}}}$\; } } \Else{ $s_{i,t}=\infty$; } } \label{ComputeScoresEndLive} $\mathcal{K}_{t} = \argmax\limits_{\hat{\mathcal{K}} \subseteq \mathcal{K}, |\hat{\mathcal{K}}|=k} \quad \sum\limits_{i \in \hat{\mathcal{K}}} s_{i,t}$ \; \label{userSelectionLive} \textbf{pendant} une période de ${\cal L}$ : \\ \label{collectionBeginLive} $\quad \quad \Omega_{t} = $ Collecter les données via l'API \textit{Sample} \; $\quad \quad \Psi_{t} = $ Collecter les données via l'API \textit{Follow} centrées sur les utilsaiteurs de $\mathcal{K}_{t}$ \; \For{$i \in \mathcal{K}_t$} { \label{updateCountsBeginLive} Calculer $r_{i,t}$ pour $\Psi_t$\; \If{$i\in \mathcal{O}_{t}$}{ $V= V+b_{i}b_{i}^{\top}/(N_{i}+1)$\; $b= b+b_{i}s_{i}/(N_{i}+1)$\; $N_{i}= N_{i}+1$\; $s_{i}= s_{i}+r_{i,t}$\; $\bar{\mu}_{i} = s_{i}/(N_{i}+1)$\; $b_{i}= b_{i}+x_{i,t}$\; $\bar{x}_{i}= b_{i}/(N_{i}+1)$\; $V= V+x_{i,t}x_{i,t}^{\top}-b_{i}b_{i}^{\top}/(N_{i}+1)$\; $V= b+r_{i,t}x_{i,t}-b_{i}s_{i}/(N_{i}+1)$ } } \label{updateCountsEndLive} $\Omega_{t+1} = \Omega_t$; $\Psi_{t+1} = \Psi_t$ \; $\mathcal{O}_{t+1} = $ Auteurs ayant au moins un message dans $\Omega_{t+1} \cup \Psi_{t+1}$\; \label{updateObservedUsersSetLive} } \caption{Algorithme de collecte de données \texttt{HiddenLinUCB-Mean} adapté pour l'expérience en ligne.} \label{algoCollectLiveContext} \end{algorithm} \paragraph{Résultats} La partie gauche de la figure \ref{fig:liveContextPolitic} représente l'évolution du gain cumulé en fonction du temps (représenté en termes de nombre d'itérations). On remarque le très bon comportement de notre algorithme dans un scénario réel, car la somme des récompenses qu'il accumule croît beaucoup plus rapidement que celle des autres politiques, surtout après les 500 premières itérations. Après ces premières itérations, notre algorithme semble avoir acquis une bonne connaissance sur les distributions de récompenses en fonction des contextes observés sur les différents utilisateurs du réseau. Afin d'analyser le comportement des politiques expérimentées pendant les premières itérations de la capture, nous représentons aussi à droite de la figure \ref{fig:liveContextPolitic} un zoom des mêmes courbes sur les 150 premiers pas de temps. Au début, la politique \texttt{Static} est plus performante que toutes les autres, ce qui peut s'expliquer par deux raisons: premièrement les algorithmes de bandits utilisés ont besoin de sélectionner tous les utilisateurs au moins une fois pour initialiser les scores et deuxièmement les utilisateurs faisant partie de l'ensemble \texttt{Static} sont supposés être des sources relativement pertinentes étant donné la façon dont ils ont été choisis. Vers l'itération 80, aussi bien l'algorithme \texttt{CUCBV} que l'algorithme contextuel deviennent meilleurs que \texttt{Static}, ce qui correspond au moment où ils commencent à pouvoir exploiter de ``bons'' comptes identifiés. Ensuite, une période d'environ 60 itérations est observée (approximativement entre les itérations 80 et 140), au cours de laquelle l'algorithme \texttt{CUCBV} et notre approche contextuelle ont des performances comparables. Cette période s'explique par le fait que notre approche nécessite un certain nombre d'itérations pour apprendre des corrélations efficaces entre contextes et récompenses afin d'en tirer avantage. Enfin, après cette période d'initialisation, on peut remarquer un changement significatif de pente pour la courbe correspondant à notre algorithme, ce qui souligne sa faculté à être bien plus réactif dans un environnement dynamique. De plus, le volume de récompenses collectées avec notre approche sur la période d'expérimentation représente plus du double de ce qui a été collecté avec l'approche état de l'art \texttt{CUCBV}. Enfin, il est à noter que le nombre de fois que chaque utilisateur a été sélectionné par notre algorithme est mieux réparti qu'avec un algorithme stationnaire comme \texttt{CUCBV}, ce qui confirme la pertinence d'adopter une approche dynamique. En conclusion, que ce soit en ligne ou hors ligne, notre approche se révèle très efficace pour la sélection dynamique d'utilisateurs pour la collecte de données ciblée. \begin{figureth} \begin{subfigureth}{0.45\textwidth} \includegraphics[width=\linewidth]{liveHybridk5000T900RwdRT.pdf} \caption{Récompense cumulée sur toute la durée de la collecte.} \end{subfigureth} \begin{subfigureth}{0.45\textwidth} \includegraphics[width=\linewidth]{liveHybridk5000T900RwdRTZoom.pdf} \caption{Agrandissement sur les 150 premiers pas de temps.} \end{subfigureth} \caption[Récompense cumulée en fonction du temps dans l'expérience en ligne]{Récompense cumulée en fonction du temps dans l'expérience en ligne pour différentes politiques. A gauche se trouve une version agrandie des 150 premiers pas de temps.} \label{fig:liveContextPolitic} \end{figureth} \section{Conclusion} Dans ce chapitre, nous avons formalisé notre tâche de collecte de données sur les réseaux sociaux comme une instance spécifique du problème de bandit contextuel, dans laquelle, à cause des restrictions imposées par les médias sociaux, seule une partie des contextes est observable à chaque itération. Pour résoudre cette tâche, nous avons proposé une adaptation de l'algorithme de bandit contextuel \texttt{LinUCB} pour le cas où certains contextes sont cachés. Dans le chapitre qui suit, nous introduisons un modèle dans lequel nous modélisons des relations temporelles entre les différents utilisateurs. \chapter{Modèle contextuel} \minitoc \newpage \label{ModeleContextuelVariable} La modélisation d'un profil pour chaque utilisateur, associée à une hypothèse de linéarité, nous a permis d'améliorer considérablement les performances de notre processus de collecte dans le chapitre précédent. Grâce à la présence d'un paramètre de régression commun à tous les utilisateurs, nous avons montré qu'il est possible de mutualiser l'apprentissage, permettant ainsi une exploration plus intelligente de l'espace des utilisateurs. L'idée était d'utiliser le "message moyen" - à une transformation LDA près - de chaque utilisateur pour exploiter des corrélations entre vocabulaire employé et récompenses espérées. Cependant, l'hypothèse de stationnarité sous-jacente peut être discutée, car il est possible que certains utilisateurs soient actifs sur plusieurs sujets complètement différents selon par exemple le moment de la journée. En supposant que les messages postés par un utilisateur pendant une période donnée puisse permettre de prévoir son utilité à venir, nous proposons dans ce chapitre un nouveau modèle pour tenir compte de ces variations et mieux exploiter les flux de données sous les contraintes associées à notre tâche. \section{Modèle} Dans cette section, nous formalisons le modèle mathématique du bandit contextuel ainsi que les hypothèses correspondantes. On suppose qu'il existe un vecteur inconnu permettant d'estimer l'espérance de la récompense que l'on peut observer pour chaque action en fonction de son vecteur de contexte. On se place ici dans le cas où l'ensemble $\mathcal{K}$ des actions est fini et de taille $K$. Ainsi, à chaque pas de temps $t$, chaque action $i$ révèle un vecteur de contexte noté $x_{i,t} \in \mathbb{R}^{d}$ et l'agent sélectionne un sous-ensemble $\mathcal{K}_{t}$ de $k<K$ actions pour lesquelles il reçoit les récompenses associées, son but étant toujours de maximiser la somme des récompenses cumulées au cours du temps. L'hypothèse permettant de lier contexte et récompense que nous considérons suppose l'existence d'un vecteur de poids $\beta \in \mathbb{R}^{d}$ inconnu tel que l'espérance de la récompense associée à $i$ selon le contexte $x_{i,t}$ est égale au produit scalaire des deux vecteurs à un instant $t$. Formellement, cela se traduit par: \begin{equation} \exists \beta \in \mathbb{R}^{d} \text{ tel que } \forall t \in \left\{1,..,T\right\}, \forall i \in \left\{1,..,K\right\}: \mathbb{E}[r_{i,t}|x_{i,t}]=x_{i,t}^{\top}\beta \end{equation} Dans notre cas, le contexte $x_{i,t}$ de chaque utilisateur $i$ à chaque instant $t$ correspond au contenu publié dans la fenêtre de temps $t-1$. Contrairement au chapitre précédent, on utilise directement l'échantillon révélé par un utilisateur et non pas à une version bruitée d'un profil constant et inconnu. Dans la suite, nous supposons que $\beta$ est borné par une constante $S \in \mathbb{R}^{+*}$, c.-à-d. $||\beta|| \leq S $. \begin{comment} On remarque que dans ce cas, si un utilisateur est inactif au temps $t-1$, c'est à dire possède un vecteur de contexte nul, son espérance sera forcément égale à zéro. Or nous souhaitons éviter cette situation, car un utilisateur peut être actif de façon ponctuelle à un instant donné sans l'avoir été au temps précédent. Ainsi, afin de modéliser la qualité intrinsèque de chaque utilisateur, nous introduisons également un terme de biais $\theta_{i} \in \mathbb{R}$ pour chaque compte $i$. L'hypothèse de travail devient la suivante : \begin{equation} \exists \beta \in \mathbb{R}^{d}, \exists \left(\theta_{1},...,\theta_{K}\right) \in \mathbb{R}^{K} \text{ tels que }\forall t \in \left\{1,..,T\right\}, \forall i \in \left\{1,..,K\right\}: \mathbb{E}[r_{i,t}|x_{i,t}]=x_{i,t}^{\top}\beta+\theta_{i} \label{hypEq} \end{equation} Cette formulation correspond à un cas particulier du cas hybride proposé dans \cite{banditCtxtLinUCB}, en considérant une valeur de 1 pour la valeur du contexte propre à chaque action. Il est important de noter que plusieurs paramètres individuels auraient pu être considérés dans notre étude, cependant cette approche ne nous semble pas adaptée étant donné le nombre très élevé d'actions disponibles (qui mènerait à un apprentissage d'autant plus complexe). Ainsi, nous restreignons la modélisation individuelle à un terme unique de biais. \end{comment} L'utilisation d'un vecteur de paramètres commun permet une exploration facilitée, comme précédemment, grâce à la généralisation des corrélations observées pour des utilisateurs à l'ensemble des utilisateurs. Comme nous l'avons déjà vu, dans notre cas, une difficulté majeure provient du fait que tous les contextes ne sont pas observables, contrairement aux problèmes de bandits contextuels traditionnels. En effet les contraintes des différentes API ne nous autorisent pas à voir un contexte pour chaque action et on ne peut donc pas utiliser des algorithmes de bandits contextuels existants tels que \texttt{LinUCB} \cite{banditCtxtLinUCB} ou encore \texttt{OFUL} \cite{OFUL} par exemple. À l'instar du chapitre précédent, plusieurs cas sont envisageables concernant le processus choisissant les actions pour lesquelles un contexte est observable. On note par la suite $\mathcal{O}_{t} \subset \mathcal{K}$ l'ensemble des utilisateurs pour lesquels un vecteur de contexte est disponible à l'itération $t$. Ainsi, le cas où $\mathcal{O}_{t}=\mathcal{K}$ correspond au bandit contextuel traditionnel. Dans la section suivante, nous étudions dans un premier temps le cas le plus simple où tous les contextes sont observables. Ceci nous permettra de mettre en place les bases nécessaires à l'étude du cas plus complexe où une partie des contextes n'est pas accessible. \section{Algorithmes} Nous nous concentrons ici sur les algorithmes de types optimistes. Rappelons que le principe général, derrière toutes les politiques de ce type, consiste à construire un intervalle de confiance sur les récompenses de chaque action. Pour ce faire, une des possibilités est de maintenir à jour des distributions \textit{a posteriori} sur les différents paramètres du modèle. Certaines hypothèses doivent être faites à la fois sur la vraisemblance des observations, mais aussi sur les distributions \textit{a priori} des paramètres. En particulier, l'utilisation des \textit{priors conjugués} permet d'obtenir des solutions exactes. Dans notre étude, nous utiliserons des distributions gaussiennes. Notons cependant que la dérivation d'un intervalle de confiance peut se faire à l'aide d'autres approches, comme ce fut le cas dans le chapitre précédent. \subsection{Intervalles de confiance lorsque les contextes sont visibles} \label{subseqcontextvixibles} Construisons dans un premier temps un estimateur des paramètres dans le cas où tous les contextes seraient observables, avec les hypothèses suivantes : \begin{itemize} \item \textbf{Vraisemblance :} Les récompenses sont indépendamment et identiquement distribuées selon les contextes observés: $r_{i,t} \sim \mathcal{N}(x_{i,t}^{\top}\beta,\sigma_{i}^2)$, avec $\sigma_{i}^2$ correspondant à la variance de la récompense $r_{i,t}$; \item \textbf{Prior :} Les paramètres inconnus sont normalement distribués: $\beta \sim \mathcal{N}(m_{0},v_{0}^{2} I)$, avec $m_{0}$ un vecteur de taille $d$, $I$ la matrice identité de taille $d$, et $v_{0}$ un paramètre permettant de contrôler la variance. \end{itemize} \begin{note} L'hypothèse de vraisemblance gaussienne est plus restrictive que celle du chapitre \ref{ModeleContextuelFixe} dans lequel un bruit sous-gaussien était suffisant. L'intérêt d'utiliser des gaussiennes est de conserver des formes analytiques sur les distributions des paramètres du problème. \end{note} Le but est de construire la distribution \textit{a posteriori} du paramètre $\beta$ à un instant $t$ connaissant les récompenses collectées, et les contextes associés, jusqu'à l'itération $t-1$. Pour alléger les notations, nous fixons $m_{0}=0$ (vecteur nul de taille $d$), $v_{0}=1$ et $\sigma_{i}=1$ pour tout $i$. Cependant, tous les résultats peuvent être étendus à des cas plus complexes. Dans la pratique, lorsque nous n'avons pas d'information particulière sur les bras, toutes la valeurs des $\sigma_{i}$ sont prises égales à la même valeur. Nous introduisons les notations matricielles condensées suivantes pour la suite de cette section : \begin{itemize} \item $\mathcal{T}_{i,t-1}$ l'ensemble des itérations où $i$ a été choisi durant les $t-1$ premières étapes: $\mathcal{T}_{i,t-1}=\left\{s \leq t-1 , i \in \mathcal{K}_{s}\right\}$. On a $|\mathcal{T}_{i,t-1}|=N_{i,t-1}$; \item $c_{i,t-1}$ le vecteur de récompenses obtenues par le bras $i$ avant l'itération $t$: $c_{i,t-1}=(r_{i,s})_{s\in \mathcal{T}_{i,t-1}}$ ; \item $D_{i,t-1}$ la matrice de taille $N_{i,t-1}\times d$, composée des contextes observés pour le bras $i$, aux itérations antérieures à $t$ où il a été choisi: $D_{i,t-1}=(x_{i,s}^{\top})_{s\in \mathcal{T}_{i,t-1}}$. \end{itemize} Les deux propositions suivantes expriment les distributions \textit{a posteriori} des paramètres du modèle à un instant $t$, avant que la sélection des actions n'ait été effectuée, c'est-à-dire en utilisant l'historique des choix effectués jusqu'au temps $t-1$. \begin{prop} \label{propDistBetaChap3} La distribution \textit{a posteriori} du paramètre $\beta$ à l'étape $t$, lorsque tous les contextes sont visibles, respecte: \begin{equation} \label{eqBetaChap3} \beta \sim \mathcal{N}\left(\hat{\beta}_{t-1},V_{t-1}^{-1}\right) \end{equation} Où: \begin{align} \hat{\beta}_{t-1}= V_{t-1}^{-1}b_{t-1}& &b_{t-1}= \sum\limits_{i=1}^{K}D_{i,t-1}^{\top}c_{i,t-1}& & V_{t-1}=I+\sum\limits_{i=1}^{K}D_{i,t-1}^{\top}D_{i,t-1} \end{align} \end{prop} \begin{preuve} Il s'agit d'un résultat classique de regression que nous avons démontré dans la section \ref{TSLinBanditEtatArt} de l'état de l'art. \end{preuve} Tous ces paramètres peuvent être mis à jour de façon peu coûteuse à mesure que de nouveaux exemples d'apprentissage arrivent (la complexité de la mise à jour des paramètres est constante sur l'ensemble du processus). \begin{prop} La valeur espérée $\mathbb{E}[r_{i,t}|x_{i,t}]$, de la récompense de l’utilisateur $i$ à l’itération $t$ sachant son contexte $x_{i,t}$, suit la distribution: \begin{equation} \label{distAllSeen} \mathbb{E}[r_{i,t}|x_{i,t}] \sim \mathcal{N}\left(x_{i,t}^{\top}\hat{\beta}_{t-1}, x_{i,t}^{\top}V_{t-1}^{-1}x_{i,t}\right) \end{equation} \end{prop} \begin{preuve} D'après le modèle, on sait que $\mathbb{E}[r_{i,t}|x_{i,t}]=x_{i,t}^{\top}\beta$. Or $\beta$ est une variable aléatoire gaussienne de moyenne $\hat{\beta}_{t-1}$ et matrice de covariance $V_{t-1}^{-1}$ d'après la proposition précédente, d'où le résultat annoncé. \end{preuve} \begin{theo} \label{theoUCBICWSM} Pour tout $0<\delta <1$ et $x_{i,t} \in \mathbb{R}^{d}$, en notant $\alpha = \Phi^{-1}(1-\delta/2)$ \footnote{$\Phi^{-1}$ est la fonction de répartition inverse d'une loi normale.}, pour chaque action $i$, après $t$ itérations: \begin{equation} P\left( | \mathbb{E}[r_{i,t}|x_{i,t}] - x_{i,t}^{\top}\hat{\beta}_{t-1}| \leq \alpha \sqrt{x_{i,t}^{\top}V_{t-1}^{-1}x_{i,t}} \right) \geq 1-\delta \label{probObs} \end{equation} \end{theo} \begin{preuve} En utilisant l'équation \ref{distAllSeen}, la variable aléatoire $\dfrac{\mathbb{E}[r_{i,t}|x_{i,t}] - x_{i,t}^{\top}\hat{\beta}_{t-1}}{\sqrt{x_{i,t}^{\top}V_{t-1}^{-1}x_{i,t}}}$ suit une loi normale de moyenne 0 et de variance 1, d'où le résultat proposé. \end{preuve} Cette formule peut directement être utilisée pour définir une borne supérieure de l'intervalle de confiance (\textit{UCB - Upper Confidence Bound}) de la récompense espérée pour chaque utilisateur dont le contexte a été observé à l’itération $t$: \begin{equation} s_{i,t} = x_{i,t}^{\top}\hat{\beta}_{t-1} + \alpha\sqrt{x_{i,t}^{\top}V_{t-1}^{-1}x_{i,t}} \label{obsScoreChap3} \end{equation} Ainsi les approches de type UCB étant des approches optimistes, l'idée est alors de sélectionner à chaque instant $t$ les $k$ utilisateurs ayant les $k$ bornes $s_{i,t}$ les plus élevées. Le score précédent pourrait directement être utilisé pour notre tâche de collecte d'information si les contextes de tous les utilisateurs étaient disponibles, ce qui n'est pas le cas, hormis lorsque $\mathcal{O}_{t}=\mathcal{K}$. Dans la section qui suit, nous étudions le cas des contextes manquants, qui nécessite un traitement particulier. \subsection{Prise en compte des utilisateurs dont le contexte n'est pas visible} Dans le cas qui nous intéresse, c'est-à-dire lorsque tous les contextes ne peuvent pas être observés, l'application directe du modèle précédent pose deux difficultés majeures: \begin{enumerate} \item Les scores $s_{i,t}$, permettant de sélectionner les utilisateurs que l'on souhaite écouter, ne peuvent pas être calculés directement selon l'équation \ref{obsScoreChap3} lorsque les contextes $x_{i,t}$ ne sont pas observés (c.-à-d. pour les utilisateurs qui ne sont pas dans $\mathcal{O}_{t}$). Une approche naïve pourrait consister à éliminer les utilisateurs sans contexte observé des choix possibles. Néanmoins, cela peut conduire à écarter de nombreux comptes potentiellement intéressants, et selon le processus d'alimentation des contexte considéré, il est alors possible de s'enfermer dans des stratégies de sélection peu efficaces (par exemple, si $\mathcal{O}_{t}=i_{t-1}$, aucun changement d'utilisateur écouté ne peut être effectué). Il est donc primordial de définir une méthode permettant de donner un score aux utilisateurs dont le contexte est inconnu. \item Pour effectuer l'apprentissage des paramètres du modèle de la section précédente, nous devons disposer à un instant $t$ d'un ensemble de couple $(x_{i,s},r_{i,s})_{i\in \mathcal{K}_{s},s=1..t-1}$. Les paramètres du problèmes ne peuvent alors être mis à jour que pour les utilisateurs appartenant à $\mathcal{K}_{t} \cap \mathcal{O}_{t}$. Or rien ne garantit des intersections non vides entre ces deux ensembles. Afin d'assurer un apprentissage efficace, il est nécessaire de définir une méthode permettant d'apprendre à chaque itération, pour toutes les récompenses récoltées, même si aucun contexte n'y est associé. \end{enumerate} \begin{comment} \begin{enumerate} \item Les scores $s_{i,t}$ (équation \ref{obsScoreChap3}) de chaque utilisateur, permettant de sélectionner ceux que l'on souhaite écouter, ne peuvent pas être calculés lorsque les contextes $x_{i,t}$ ne sont pas observés (c.-à-d. lorsque les utilisateurs ne sont pas dans $\mathcal{O}_{t}$). En effet l'équation \ref{obsScoreChap3} fait directement intervenir $x_{i,t}$. Ainsi, les utilisateurs non observés ne peuvent être qualifés par l'application directe de cette méthode. Une approche naïve pourrait consister à éliminer ces derniers des choix possibles, or si l'ensemble des utilisateurs non observés devient trop important, le manque à gagner peut s'avérer considérable puisque l'on pourrait potentiellement passer à côté de récompenses élevées. Il est donc primordial de trouver une méthode permettant de donner un score aux personnes dont le contexte est inconnu. Nous verrons par la suite que, moyennant certaines hypothèse probabilistes, il est possible de dériver un tel score. \item Pour effectuer l'apprentissage des paramètres du modèle de la section précédente, nous devons disposer à un instant $t$ d'un ensemble de couple $(x_{i,s},r_{i,s})_{i\in \mathcal{K}_{s},s=1..t-1}$. Si l'on suppose que l'on peut associer à chaque utilisateur un score de sélection à tout instant, il alors est possible d'observer une récompense sans que le contexte associé n'ait été observé. Si l'on souhaite appliquer directement les formules précédentes et conserver les mêmes garanties probabailistes, les paramètres du problème ne devraient être mis à jour que lorsqu'un utilisateur appartient à $\mathcal{K}_{t} \cap \mathcal{O}_{t}$. Cette approche ne pose pas de difficulté théorique, cependant dans la pratique, rien ne garantit que l'ensemble $\mathcal{K}_{t} \cap \mathcal{O}_{t}$ ne sera pas vide. Dans un cas moins extrême, si l'ensemble $\mathcal{K}_{t} \cap \mathcal{O}_{t}$ est constitué de trop peu d'éléments, l'apprentissage peut s'avérer trop long. Afin d'assurer un apprentissage plus efficace, il est nécessaire de définir une méthode permettant d'apprendre à chaque itération, pour toutes les récompenses récoltées, même si aucun contexte n'y est associé. \end{enumerate} \end{comment} Pour pallier ces deux problèmes, l'idée générale que nous proposons est d'effectuer des hypothèses probabilistes sur les distributions des contextes. Dans la section suivante, nous définissons le nouveau modèle probabiliste adopté. Nous verrons que l'apprentissage de ce dernier, contrairement au cas précédent ne peut pas être fait de façon analytique. Pour cette raison, nous utiliserons une approche variationnelle \cite{Bishopvar}, permettant d'approximer la véritable distribution des paramètres. Finalement, nous proposerons une borne supérieure de l'intervalle de confiance de la récompense espérée de chaque utilisateur, qui nous permettra de définir un algorithme de type UCB, spécifiquement adapté à notre cas d'étude. \subsubsection{Modèle probabiliste et apprentissage} Considérons le contexte $x_{i,t}$ d'un utilisateur $i$ au temps $t$ comme une variable aléatoire. Lorsque ce contexte n'est pas observé, nous supposons qu'il suit une certaine distribution. Il s'agit d'un modèle gaussien défini pour chaque utilisateur, dans lequel les contextes sont normalement distribués (vraisemblance), selon une moyenne et une variance qui leur est propre. Considérons les hypothèses suivantes: \begin{itemize} \item \textbf{Vraisemblance :} Pour chaque utilisateur $i$, les contextes sont supposés provenir d'une loi gaussienne multivariée: $x_{i,t} \sim \mathcal{N}(\mu_{i},\tau_{i}^{-1}I)$, de moyenne $\mu_{i}$ et de précision $\tau_{i}^{-1}I$. Nous utilisons ici la précision, qui sera plus simple à traiter d'un point de vue calculatoire; \item \textbf{Priors :} Pour chaque utilisateur $i$, on suppose que l'espérance de ses contextes est également une variable aléatoire gaussienne de moyenne nulle et de précision $\tau_{i}^{-1}I$: $\mu_{i}\sim \mathcal{N}(0,\tau_{i}^{-1}I)$. La précision $\tau_{i}$ est supposée suivre une loi Gamma de paramètres $a_{0}$ et $b_{0}$: $\tau_{i}\sim Gamma(a_{0},b_{0})$. \end{itemize} La figure \ref{fig:genProcessPlate} représente le modèle probabiliste considéré sous forme graphique. Les carrés à bords droits représentent des valeurs fixées, les cercles représentent des variables aléatoires et les carrés à bords ronds signifient la répétition des variables aléatoires qu'ils contiennent. On rappelle que nous avons fixé $\sigma_{i}=1$ pour tout $i$, $v_{0}=1$ et $m_{0}=0$ (vecteur nul de taille $d$). \begin{figureth} \includegraphics[width=0.65\linewidth]{genModelPlate.pdf} \caption[Modèle contextuel génératif]{Représentation graphique du modèle contextuel génératif.} \label{fig:genProcessPlate} \end{figureth} \begin{note} Nous avons choisi d'utiliser des matrices de précision sphériques (c.-à-d. diagonales avec des composantes identiques), cependant, d'autres possibilités sont envisageables. Nous aurions également pu considéré des matrices diagonales, avec des valeurs de variances différentes pour chaque composante des contextes (et nécessitant une distribution Gamma a priori sur chaque composante), ou encore des matrices non diagonales (et nécessitant une distribution normal-Wishart a priori sur la matrice de précision des contextes), mais au prix d'un coût calculatoire plus important. \end{note} Nous disposons désormais d'un modèle décrivant la dynamique des récompenses, mais aussi des contextes au cours du temps. Rappelons que dans la section précédente, seuls $\beta$ et les $r_{i,t}$ étaient considérés comme des variables aléatoires. Dans le cas présent, tous les $x_{i,t}$, $\mu_{i}$ et $\tau_{i}$ sont également des variables aléatoires. Si certaines sont directement observées, d'autres ne sont pas visibles et, comme précédemment, notre but est de dériver leurs distributions à un instant $t$, en fonction des observations faites jusqu'au temps $t-1$. Les observations sont constituées des récompenses et contextes, à savoir $(r_{i,s})_{i\in \mathcal{K}_{s},s=1..t-1}$ et $(x_{i,s})_{i\in \mathcal{O}_{s},s=1..t-1}$. D'autre part, les variables cachées dont la distribution doit être calculée sont $\beta$, $(\mu_{i})_{i=1..K}$, $(\tau_{i})_{i=1..K}$ et les contextes non observés ayant générés des récompenses $(x_{i,s})_{i\in \mathcal{K}_{s}\cap\bar{\mathcal{O}_{s}},s=1..t-1}$. Notons que les récompenses non observées liées à des contextes observés ne sont pas prises en considérations ici car elles n'influencent pas les variables qui nous intéressent. Formellement, il s'agit de calculer la distribution conditionnelle suivante: \begin{align} \label{distAtrouver} p\left(\beta, (\mu_{i})_{i=1..K}, (\tau_{i})_{i=1..K}, (x_{i,s})_{i\in \mathcal{K}_{s}\cap\bar{\mathcal{O}_{s}},s=1..t-1} | (r_{i,s})_{i\in \mathcal{K}_{s},s=1..t-1},(x_{i,s})_{i\in \mathcal{O}_{s},s=1..t-1} \right) \end{align} Le calcul de cette distribution en appliquant directement le théorème de Bayes posent de nombreuses difficultés calculatoires, et il est malheuresement impossible d'en obtenir une forme analytique. Pour pallier ce problème, nous proposons d'adopter une démarche variationnelle, qui nous permettra de dériver les distributions souhaitées. Nous présentons ci-dessous le principe général de cette approche, que nous appliquerons ensuite à notre cas d'étude. \paragraph{Principe de l'approche variationnelle: } \label{principeVariationalMethode} Rappelons dans un premier temps le principe de cette approche. Il s'agit d'un ensemble de techniques utilisant le calcul variationnel, permettant d'approximer des distributions \textit{a posteriori} dans le cas où ces dernières n'ont pas de forme analytique. Il s'agit d'une alternative aux méthodes dites MCMC (Monte Carlo Markov Chain) dont le Gibbs sampling fait partie. En particulier, alors que les techniques de Monte Carlo fournissent une approximation numérique de la véritable distribution \textit{a posteriori} (via un ensemble d'échantillons), la méthode bayésienne variationnelle fournit une solution analytique localement optimale à une approximation de la véritable distribution \textit{a posteriori}. L'idée de l'approche variationnelle est d'approximer la véritable distribution \textit{a posteriori} par une distribution d'une forme plus simple. On considère un ensemble de variables observées noté $X$, un ensemble de variables non observées noté $Z$. La distribution \textit{a posteriori} de $Z$ sachant $X$ , noté $p(Z|X)$ est approximée par une distribution dite variationnelle notée $q(Z)$. Le but est de trouver une distribution $q$ la plus proche possible de $p$ en minimisant une distance entre $p$ et $q$. On choisit comme distance la divergence de Kullback–Leibler de $p$ par rapport à $q$, notée $KL(p,q)$, dont on rappelle la définition ci-dessous: \begin{equation} \label{eqDivKLVar} KL(q,p)=\int q(Z) \log\left(\dfrac{q(Z)}{p(Z|X)}\right) \, \mathrm{d}Z \end{equation} On note que $q$ et $p$ sont inversées par rapport à ce à quoi l’on pourrait s'attendre. Cette utilisation de la divergence de Kullback–Leibler est conceptuellement similaire à ce qui est fait dans l'algorithme EM (Expectation-Maximisation). Comme le précisent les auteurs de \cite{varMessPassing}, le fait de minimiser $KL(q,p)$ (divergence dite "exclusive") peut mener à une distribution $q$ ignorant certains modes de $p$. En revanche, minimiser $KL(p,q)$ (divergence dite "inclusive") peut mener à une distribution $q$ donnant du poids à des régions où la distribution $p$ est absente. A titre informatif, l'algorithme EP (Expectation-Propagation) \cite{Minka2001}, qui constitue une autre méthode d'inférence, est basé sur la minimisation de la divergence "inclusive". Après quelques calculs, notamment détaillés dans \cite{varMessPassing}, le terme de l'équation \ref{eqDivKLVar} peut se réécrire sous la forme qui suit: \begin{equation} \log p(X) = KL(q,p) + F(q) \end{equation} où $F(q)$ est l'énergie libre et vaut $F(q)=\int q(Z) \log\left(\dfrac{p(X,Z)}{q(Z)}\right) \, \mathrm{d}Z$. Etant donnée que la log-vraisemblance $\log p(X)$ est fixe par rapport à $q$, maximiser le terme $F(q)$ revient à minimiser la divergence $KL(q,p)$. Ainsi, si l'on choisit bien $q$, on obtient non seulement une forme analytique d'une approximation de la véritable distribution \textit{a posteriori} $p(Z|X)$, mais aussi une borne inférieure de la log-vraisemblance des données $F(q)$. En pratique, il est d'usage d'utiliser une hypothèse supplémentaire sur la forme de la distribution $q$. Cette hypothèse est appelée \textit{mean field assumption} et consiste à factoriser la distribution $q$ selon une partition des variables $Z$. Si l'on considère une partition $Z_{1},...,Z_{M}$ de l'ensemble des variables $Z$, alors l'hypothèse se traduit par: \begin{equation} q(Z)=\prod\limits_{i=1}^{M}q_{i}(Z_{i}) \end{equation} On peut démontrer à l'aide du calcul variationnel que la distribution optimale pour chacune des composantes $q_{j}$, notée $q_{j}^{\star}$ satisfait: \begin{equation} q_{j}^{\star} (Z_{j})= \dfrac{e^{\mathbb{E}_{i\neq j}[\log p(Z,X)]}}{ \int e^{\mathbb{E}_{i\neq j}[\log p(Z,X)]} \, \mathrm{d}Z_{j}} \end{equation} où $\mathbb{E}_{i\neq j}[\log p(Z,X)]$ est l'espérance du logarithme de la probabilité jointe des données et des variables latentes, prise selon toutes les variables sauf $j$. En pratique, il est plus commode de travailler avec les logarithmes, c'est-à-dire: \begin{equation} \label{varOptSol} \log q_{j}^{\star} (Z_{j})= \mathbb{E}_{i\neq j}[\log p(Z,X)] +constante \end{equation} La constante dans l'expression ci-dessus correspond au terme de normalisation de la distribution, qui ne dépend pas de la valeur de $Z_j$. Elle peut être réinjectée \textit{a posteriori} lorsqu’une forme (gaussienne ou autre) est reconnue dans le numérateur. Cette formulation crée des dépendances circulaires entre les paramètres des distributions des variables présentes dans les différentes partitions. Cela suggère naturellement d'utiliser un algorithme itératif, dans lequel les espérances (et éventuellement les moments d'ordre supérieurs) des variables latentes sont initialisées d'une certaine manière, puis les paramètres de chaque partition sont calculés tour à tour en utilisant les distributions courantes des autres partitions, jusqu'à convergence de l'algorithme. \paragraph{Application à notre cas: } Nous introduisons les nouvelles notations ensemblistes suivantes, qui serviront pas la suite pour dériver les paramètres des différentes distributions: \begin{itemize} \item Pour tout $i$, l'ensemble des itérations jusqu'au temps $t-1$, telles que $i$ a été sélectionné en ayant eu un contexte observé est noté $\mathcal{A}_{i,t-1}=\left\{s \text{ tel que } 1\leq s\leq t-1 \text{ et } i\in \mathcal{K}_{s}\cap\mathcal{O}_{s} \right\}$; \item Pour tout $i$, l'ensemble des itérations jusqu'au temps $t-1$, telles que $i$ a été sélectionné sans avoir eu un contexte observé est noté $\mathcal{B}_{i,t-1}=\left\{s \text{ tel que } 1\leq s\leq t-1 \text{ et } i\in \mathcal{K}_{s}\cap\bar{\mathcal{O}_{s}} \right\}$; \item Pour tout $i$, l'ensemble des itérations jusqu'au temps $t-1$, telles que le contexte de $i$ a été observé est noté $\mathcal{C}_{i,t-1}=\left\{s \text{ tel que } 1\leq s\leq t-1 \text{ et } i\in \mathcal{O}_{s} \right\}$; \end{itemize} En utilisant ces notations, la distribution \textit{a posteriori} des différents paramètres, décrite dans l'équation \ref{distAtrouver}, peut se réécrire: \begin{align} p\left(\beta, (\mu_{i})_{i=1..K}, (\tau_{i})_{i=1..K}, (x_{i,s})_{i=1..K,s\in \mathcal{B}_{i,t-1}} | (r_{i,s})_{i=1..K, s\in \mathcal{A}_{i,t-1}\cup\mathcal{B}_{i,t-1}},(x_{i,s})_{i=1..K,s \in \mathcal{C}_{i,t-1}}\right) \end{align} \textbf{Factorisation: } Afin de se placer dans un cadre favorable à l'inférence variationnelle, on suppose la factorisation suivante à un instant $t$: \begin{equation} q\left(\beta, (\mu_{i})_{i=1..K}, (\tau_{i})_{i=1..K}, (x_{i,s})_{i=1..K,s\in \mathcal{B}_{i,t-1}}\right)=q_{\beta}(\beta)\prod\limits_{i=1}^{K}\left(q_{\mu_{i}}(\mu_{i})q_{\tau_{i}}(\tau_{i})\prod\limits_{s\in \mathcal{B}_{i,t-1}}q_{x_{i,s}}(x_{i,s})\right) \end{equation} Grâce à cette hypothèse et en utilisant la méthode variationnelle présentée plus haut, nous pouvons désormais calculer les distributions de chacun des paramètres. Les propositions \ref{distribVarBeta}, \ref{distribVarXit}, \ref{distribVarMui} et \ref{distribVarTaui} établissent ces distributions respectivement pour les variables $\beta$, $x_{i,s}$, $\mu_{i}$ et $\tau_{i}$. Les preuves sont disponibles en annexes \ref{PreuveVarContextualBeta}, \ref{PreuveVarContextualXit}, \ref{PreuveVarContextualMui} et \ref{PreuveVarContextualTaui}. \begin{prop} \label{distribVarBeta} La distribution variationnelle de $\beta$ après $t-1$ itérations est une gaussienne de moyenne $\hat{\beta}_{t-1}$ et de matrice de covariance $V_{t-1}^{-1}$: \begin{equation} \beta \sim \mathcal{N}(\hat{\beta}_{t-1}, V_{t-1}^{-1}) \end{equation} avec $V_{t-1}=I+\sum\limits_{i=1}^{K} \left[ \sum\limits_{s\in \mathcal{A}_{i,t-1}}x_{i,s}x_{i,s}^{\top} +\sum\limits_{s\in \mathcal{B}_{i,t-1}} \mathbb{E}[x_{i,s}x_{i,s}^{\top}] \right]$ $\hat{\beta}_{t-1}=V_{t-1}^{-1}\left(\sum\limits_{i=1}^{K}\left[ \sum\limits_{s\in \mathcal{A}_{i,t-1}}x_{i,s}r_{i,s} +\sum\limits_{s\in \mathcal{B}_{i,t-1}} \mathbb{E}[x_{i,s}]r_{i,s} \right]\right)$ \end{prop} On remarque que l'espérance sur les $x_{i,s}$ n'est calculée que lorsque l'action a été sélectionnée mais que son contexte \textbf{n'a pas} été observé. Par ailleurs, le calcul de $\mathbb{E}[x_{i,s}]$ et $\mathbb{E}[x_{i,s}x_{i,s}^{\top}]$ est effectué en utilisant le fait que $\mathbb{E}[xx^{\top}]=Var(x)+\mathbb{E}[x]\mathbb{E}[x]^{\top}$ et la proposition \ref{distribVarXit}. \begin{prop} \label{distribVarXit} Pour tout $i$ et pour tout $s\in \mathcal{B}_{i,t-1}$, la distribution variationnelle de $x_{i,s}$ est une gaussienne de moyenne $\hat{x}_{i,s}$ et de matrice de covariance $W_{i,s}^{-1}$: \begin{equation} x_{i,s}\sim \mathcal{N}(\hat{x}_{i,s}, W_{i,s}^{-1}) \end{equation} avec $W_{i,s}= \mathbb{E}[\beta\beta^{\top}]+\mathbb{E}[\tau_{i}]I$ $\hat{x}_{i,s}=W_{i,s}^{-1}(\mathbb{E}[\beta]r_{i,s}+\mathbb{E}[\tau_{i}]\mathbb{E}[\mu_{i}])$ \end{prop} Les expressions de $\mathbb{E}[\mu_{i}]$ et $\mathbb{E}[\tau_{i}]$ sont calculées selon les propositions \ref{distribVarMui} et \ref{distribVarTaui}. De plus, le calcul de $\mathbb{E}[\beta\beta^{\top}]$ s'effectue en utilisant la proposition \ref{distribVarBeta}. \begin{prop} \label{distribVarMui} Pour tout $i$, la distribution variationnelle de $\mu_{i}$ après $t-1$ itérations est une gaussienne de moyenne $\hat{\mu}_{i,t-1}$ et de matrice de covariance $\Sigma_{i,t-1}^{-1}$: \begin{equation} \mu_{i}\sim \mathcal{N}(\hat{\mu}_{i,t-1}, \Sigma_{i,t-1}^{-1}) \end{equation} avec $\Sigma_{i,t-1}= (1+n_{i,t-1})E[\tau_{i}]I$ $\hat{\mu}_{i,t-1}=\dfrac{\sum\limits_{s\in \mathcal{C}_{i,t-1}}x_{i,s} +\sum\limits_{s\in \mathcal{B}_{i,t-1}} \mathbb{E}[x_{i,s}]}{1+n_{i,t-1}}$ \end{prop} et $n_{i,t-1}=|\mathcal{B}_{i,t-1}|+|\mathcal{C}_{i,t-1}|$. \begin{prop} \label{distribVarTaui} Pour tout $i$, la distribution variationnelle de $\tau_{i}$ après $t-1$ itérations suit une loi gamma de paramètres $a_{i,t-1}$ et $b_{i,t-1}$: \begin{equation} \tau_{i}\sim Gamma(a_{i,t-1},b_{i,t-1}) \end{equation} avec $a_{i,t-1}= a_{0}+\dfrac{d(1+n_{i,t-1})}{2}$ $b_{i,t-1}=b_{0}+\dfrac{1}{2} \left[ (1+n_{i,t-1})\mathbb{E}[\mu_{i}^{\top}\mu_{i}]-2\mathbb{E}[\mu_{i}]^{\top}\left( \sum\limits_{s\in \mathcal{C}_{i,t-1}}x_{i,s} +\sum\limits_{s\in \mathcal{B}_{i,t-1}}\mathbb{E}[x_{i,s}] \right) \right.$ $\qquad \qquad \qquad ~~~~~~~~~ \left. + \sum\limits_{s\in \mathcal{C}_{i,t-1}}x_{i,s}^{\top}x_{i,s} + \sum\limits_{s\in \mathcal{B}_{i,t-1}}\mathbb{E}[x_{i,s}^{\top}x_{i,s}] \right] $ \end{prop} On a $\mathbb{E}[\tau_{i}]=a_{i,t-1}/b_{i,t-1}$, ce qui permet de calculer les paramètres dans les propositions \ref{distribVarXit} et \ref{distribVarMui}. De plus, le calcul de $\mathbb{E}[x_{i,s}^{\top}x_{i,s}] $ et $\mathbb{E}[\mu_{i}^{\top}\mu_{i}]$ s'effectue en remarquant que $\mathbb{E}[x^{\top}x]=Trace(Var(x))+\mathbb{E}[x]^{\top}\mathbb{E}[x]$ et les propositions \ref{distribVarXit} et \ref{distribVarMui}. \vspace{0.5cm} Les quatre propositions précédentes fournissent les distributions des différentes variables du problème. Il apparaît très clairement que les paramètres de chacune d'elles sont liés à tous les autres, d'où la nécessité d'une procédure itérative, dont le but est de converger vers une solution stable. Nous proposons d'expliciter cette procédure dans l'algorithme \ref{varPassLinear}. Cet algorithme prend en entrée un entier $nbIt$ qui correspond au nombre d'itérations à effectuer. Plus il est élevé, plus la solution trouvée sera précise. Dans la pratique, il est également possible de surveiller la convergence des différents paramètres et d'arrêter la procédure lorsque les variations de ces derniers ne dépassent pas un certain seuil d'une itération à la suivante. \begin{algorithm}[!ht] \KwIn{$nbIt$ (nombre d'itérations)} Initialiser les paramètres de façon aléatoire\; \For{$It = 1..nbIt$} { Calculer $\hat{\beta}_{t-1}$ et $V_{t-1}$ selon la proposition \ref{distribVarBeta}\; \For{$i =1.. K$} { Calculer $\hat{\mu}_{i,t-1}$ et $\Sigma_{i,t-1}$ selon la proposition \ref{distribVarMui} \; Calculer $a_{i,t-1}$ et $b_{i,t-1}$ selon la proposition \ref{distribVarTaui} \; \For{$s \in \mathcal{B}_{i,t-1}$} { Calculer $\hat{x}_{i,s}$ et $W_{i,s}$ selon la proposition \ref{distribVarXit} \; } } } \caption{\texttt{Processus itératif variationnel pour le modèle contextuel}} \label{varPassLinear} \end{algorithm} \textbf{Note sur la complexité :} La complexité de l'algorithme d'inférence variationnelle augmente avec le nombre d'itérations $t$. En effet, pour chaque $i$, à un instant $t$, on voit clairement qu'il est nécessaire de traiter tous les contextes cachés $x_{i,s}$ pour tous les temps passés $s\in \mathcal{B}_{i,t-1}$. Cette croissance, potentiellement très rapide (selon processus délivrant les contextes), peut mener à des problèmes de mémoire et n'est pas compatible avec la nature intrinsèquement "en ligne" des problèmes de bandits. Afin de s'affranchir de cet inconvénient, nous proposons d'utiliser une approximation des algorithmes se restreignant à une fenêtre de temps limitée dans le passé pour le calcul des distributions des $x_{i,s}$ lorsque $s\in \mathcal{B}_{i,t-1}$. Soit $S$ la taille de cette fenêtre, alors à un instant $t$, nous considérons l'algorithme précédent avec $\mathcal{B}_{i,t-1}\backslash \mathcal{B}_{i,t-1-S}$ au lieu de $\mathcal{B}_{i,t-1}$, rendant ainsi la complexité constante avec le temps. Le fait de considérer une fenêtre de temps influe sur les distributions de tous les paramètres, car chacun d'eux fait intervenir $\mathcal{B}_{i,t-1}$. Il est toutefois important de noter que cela n'a pas pour effet d'effacer entièrement l'influence des événements passés avant l'instant $t-1-S$. En effet pour l'apprentissage de $\beta$, les sommes $\sum\limits_{s\in \mathcal{A}_{i,t-1}}x_{i,s}x_{i,s}^{\top}$ et $\sum\limits_{s\in \mathcal{A}_{i,t-1}}x_{i,s}r_{i,s}$ peuvent être mise à jour sans avoir besoin de conserver tous les éléments en mémoire, comme cela est fait dans \texttt{LinUCB}. Une remarque similaire est possible pour l'apprentissage des paramètres $\mu_{i}$ et $\tau_{i}$ qui fait intervenir l'ensemble $\mathcal{C}_{i,t-1}$. \subsubsection{Algorithme de bandit} Nous disposons désormais d'une méthode permettant, à chaque instant $t$, de calculer la distribution des paramètres du problème en fonction des choix effectués jusqu'au temps $t-1$. Nous nous intéressons désormais à la politique de sélection que l'on peut y associer. Rappelons qu'à l'instant $t$, le but est de sélectionner $k$ actions (ensemble $\mathcal{K}_{t}$) parmi l'ensemble des actions disponibles (ensemble $\mathcal{K}$). Afin d'effectuer cette sélection, nous utilisons une approche de type UCB, qui choisit à chaque instant les actions dont la borne supérieure de l'intervalle de confiance est la plus élevée. La première étape consiste donc à déterminer une borne pour chaque action (comme dans la section \ref{subseqcontextvixibles}). Dans le cas présent, à un instant $t$ pour une action $i$, il existe deux possibilités: \begin{itemize} \item Le contexte de $i$ \textbf{est disponible} (c.-à-d. $i\in \mathcal{O}_{t}$): dans ce cas, l'utilisation de l'hypothèse de linéarité ($\mathbb{E}[r_{i,t}|x_{i,t}]=x_{i,t}^{\top}\beta$) et de la distribution variationnelle gaussienne de $\beta$ définie en proposition \ref{distribVarBeta} permet de considérer $\mathbb{E}[r_{i,t}|x_{i,t}]$ comme une variable aléatoire gaussienne de moyenne $x_{i,t}^{\top}\hat{\beta}_{t-1}$ et de variance $x_{i,t}^{\top}V_{t-1}^{-1}x_{i,t}$. Grâce à cela, il est directement possible de déterminer un intervalle de confiance comme nous l'avons précédemment effectué dans le théorème \ref{theoUCBICWSM}. Finalement, pour chaque action dont le contexte est visible, le score UCB associé est donc défini par la même formule que dans l'équation \ref{obsScoreChap3}. Il est important de noter cependant que les valeurs des paramètres $\hat{\beta}_{t-1}$ et $V_{t-1}^{-1}$ ne sont pas les mêmes et doivent être appris de façon itérative via l'approche variationnelle proposée plus haut. \item Le contexte de $i$ \textbf{n'est pas disponible} (c.-à-d. $i\notin \mathcal{O}_{t}$): dans ce cas, il n'est pas possible d'appliquer la méthode précédente, car le vecteur $x_{i,t}$ n'est pas observable. Dans la suite, nous proposons de dériver un intervalle de confiance de l’espérance des récompenses lorsque le contexte associé n'est pas observé, ce qui nous permettra finalement d'aboutir à un algorithme de type UCB mettant en jeu des intervalles de confiance de même niveau que ceux considérés pour les contextes observés. \end{itemize} Rappelons que notre modèle considère que pour chaque utilisateur $i$, il existe une distribution sous-jacente responsable des contextes observés. Ainsi, lorsque le contexte n'est pas observé à un instant $t$ pour une action $i$, nous proposons de prendre en considération l'espérance de la récompense de l'action selon la distribution de contexte associé. \begin{prop} A un instant $t$, la récompense moyenne de l'action $i$ prise selon la distribution de ses contextes peut s'écrire de la façon suivante: \begin{align*} \mathbb{E}[r_{i,t}]&=\int_{x_{i,t}} \mathbb{E}[r_{i,t}|x_{i,t}]p(x_{i,t}) \, \mathrm{d}x_{i,t}\\ &=\int_{x_{i,t}} x_{i,t}^{\top}\beta p(x_{i,t}) \, \mathrm{d}x_{i,t}\\ &=\beta^{\top} \int_{x_{i,t}} x_{i,t} p(x_{i,t}) \, \mathrm{d}x_{i,t}\\ &=\beta^{\top} \mathbb{E}[x_{i,t}] \\ &=\beta^{\top} \mu_{i}\\ &= \beta^{\top}\hat{\mu}_{i,t-1} +\beta^{\top}(\mu_{i}-\hat{\mu}_{i,t-1}) \end{align*} où $\hat{\mu}_{i,t-1}$ correspond à l'espérance de $\mu_{i}$ (voir proposition \ref{distribVarMui}) \end{prop} Cette écriture fait apparaître les termes $\beta^{\top}(\mu_{i}-\hat{\mu}_{i,t-1})$ et $\beta^{\top}\hat{\mu}_{i,t-1} $, dont nous allons dériver un intervalle de confiance dans les deux propositions qui suivent. \begin{prop} \label{ICterm1} Pour tout $0<\delta_{1}<1$, à un instant $t$ et pour tout $i$, on a: \begin{align} \mathbb{P}\left(|\beta^{\top}\hat{\mu}_{i,t-1} -\hat{\beta}_{t-1}^{\top}\hat{\mu}_{i,t-1}| \leq \alpha_{1} \sqrt{\hat{\mu}_{i,t-1}^{\top}V_{t-1}^{-1}\hat{\mu}_{i,t-1}}\right)= 1-\delta_{1} \end{align} où $\alpha_{1}=\Phi^{-1}(1-\delta_{1}/2)$. \end{prop} \begin{preuve} D'après la proposition \ref{distribVarBeta}, à un instant $t$, $\beta$ suit une loi gaussienne de moyenne $\hat{\beta}_{t-1}$ et de variance $V_{t-1}^{-1}$. Par conséquent $\beta^{\top}\hat{\mu}_{i,t-1}$ suit une loi gaussienne de moyenne $\hat{\beta}_{t-1}^{\top}\hat{\mu}_{i,t-1}$ et de variance $\hat{\mu}_{i,t-1}^{\top}V_{t-1}^{-1}\hat{\mu}_{i,t-1}$, donc~ $\mathbb{P}\left(|\beta^{\top}\hat{\mu}_{i,t-1}-\hat{\beta}_{t-1}^{\top}\hat{\mu}_{i,t-1} | \leq \alpha_{1} \sqrt{\hat{\mu}_{i,t-1}^{\top}V_{t-1}^{-1}\hat{\mu}_{i,t-1}}\right)= 1-\delta_{1}$. Ce qui prouve le résultat annoncé. \end{preuve} \begin{prop} \label{ICterm2} Pour tout $0<\delta_{2}<1$, à un instant $t$ et pour tout $i$, on a: \begin{align} \mathbb{P}\left(|\beta^{\top}(\mu_{i}-\hat{\mu}_{i,t-1}) | \leq \alpha_{2}\sqrt{\dfrac{b_{i,t-1}}{a_{i,t-1}(1+n_{i,t-1})}} \right)\geq 1-\delta_{2} \end{align} avec $\alpha_{2}=S\sqrt{\Psi^{-1}(1-\delta_{2})}$, $\Psi^{-1}$ la fonction de répartition inverse de la loi $\chi^{2}$ à $d$ degrés de liberté, et où $n_{i,t-1}$, $a_{i,t-1}$ et $b_{i,t-1}$ sont définis dans les propositions \ref{distribVarMui} et \ref{distribVarTaui}. \end{prop} \begin{preuve} On utilise dans un premier temps le fait que $|\beta^{\top}(\mu_{i}-\hat{\mu}_{i,t-1}) | \leq S||\mu_{i}-\hat{\mu}_{i,t-1}||$, où l'on rappelle que $S$ est une borne supérieure de $\beta$. D'après la proposition \ref{distribVarMui}, à un instant $t$, $\mu_{i}$ suit une loi gaussienne de moyenne $\hat{\mu}_{i,t-1}$ et de variance $\Sigma_{i,t-1}^{-1}$. Donc la varible aléatoire $\mu_{i}-\hat{\mu}_{i,t-1}$ suit une loi gaussienne de moyenne nulle et de variance $\Sigma_{i,t-1}^{-1}$. Toujours d'après la proposition \ref{distribVarMui}, la matrice $\Sigma_{i,t-1}^{-1}$ est diagonale et chaque composante de la diagonale sont égales. En effet on a $\Sigma_{i,t-1}^{-1}=((1+n_{i,t-1})E[\tau_{i}])^{-1}I$ que nous écrivons temporairement $\sigma_{i,t}^{2} I$. Par conséquent, toutes les composantes du vecteur $\dfrac{\mu_{i}-\hat{\mu}_{i,t-1}}{\sigma_{i,t}}$ suivent une loi normale $\mathcal{N}(0,1)$. Par définition de la loi $\chi^{2}$, $\dfrac{||\mu_{i}-\hat{\mu}_{i,t-1}||^{2}}{\sigma_{i,t}^{2}}$ suit donc une loi du $\chi^{2}$ à $d$ degrés de liberté. Notons $\Psi$ la fonction de répartition de cette loi. On a donc $\mathbb{P}\left(\dfrac{||\mu_{i}-\hat{\mu}_{i,t-1}||^{2}}{\sigma_{i,t}^{2}} \leq \eta \right)= \Psi(\eta)$ où, de façon équivalente $\mathbb{P}\left(||\mu_{i}-\hat{\mu}_{i,t-1}|| \leq \sqrt{\eta}\sigma_{i,t} \right)= \Psi(\eta)$. Finalement, comme $|\beta^{\top}(\mu_{i}-\hat{\mu}_{i,t-1}) | \leq S||\mu_{i}-\hat{\mu}_{i,t-1}||$, on a $\mathbb{P}\left(|\beta^{\top}(\mu_{i}-\hat{\mu}_{i,t-1}) | \leq S\sqrt{\eta}\sigma_{i,t} \right) \geq \Psi(\eta)$. On pose maintenant $\Psi(\eta)=1-\delta_{2}$, et on note $\Psi^{-1}$ la fonction de répartition inverse de la loi $\chi^{2}$. On a donc $\mathbb{P}\left(|\beta^{\top}(\mu_{i}-\hat{\mu}_{i,t-1}) | \leq S\sigma_{i,t}\sqrt{\Psi^{-1}(1-\delta_{2})} \right) \geq 1-\delta_{2}$. Par ailleurs, d'après la proposition \ref{distribVarTaui}, on a $\sigma_{i,t}=\sqrt{\dfrac{1}{(1+n_{i,t-1})E[\tau_{i}]}}=\sqrt{\dfrac{b_{i,t-1}}{a_{i,t-1}(1+n_{i,t-1})}}$, d'où le résultat annoncé. \end{preuve} \begin{theo} \label{theoUCBICWSMBis} Soit $0<\delta_1<1$ et $0<\delta_2<1$. Alors à un instant $t$ et pour tout $i$, on a: \begin{multline} P\left(|\mathbb{E}[r_{i,t}]-\hat{\beta}_{t-1}^{\top}\hat{\mu}_{i,t-1}| \leq \alpha_{1} \sqrt{\hat{\mu}_{i,t-1}^{\top}V_{t-1}^{-1}\hat{\mu}_{i,t-1}} + \alpha_{2}\sqrt{\dfrac{b_{i,t-1}}{a_{i,t-1}(1+n_{i,t-1})}}\right) \geq 1-\delta_{1}-\delta_{2} \\ \end{multline} où $\alpha_{1}=\Phi^{-1}(1-\delta_{1}/2)$ et $\alpha_{2}=S\sqrt{\Psi^{-1}(1-\delta_{2})}$ \end{theo} \begin{preuve} La preuve de ce résultat vient directement des résultats des propositions \ref{ICterm1} et\ref{ICterm2}. On a: $P\left(|\mathbb{E}[r_{i,t}]-\hat{\beta}_{t-1}^{\top}\hat{\mu}_{i,t-1}| > \alpha_{1} \sqrt{\hat{\mu}_{i,t-1}^{\top}V_{t-1}^{-1}\hat{\mu}_{i,t-1}} + \alpha_{2}\sqrt{\dfrac{b_{i,t-1}}{a_{i,t-1}(1+n_{i,t-1})}} \right)$ $=P\left(|\beta^{\top}\hat{\mu}_{i,t-1} +\beta^{\top}(\mu_{i}-\hat{\mu}_{i,t-1})-\hat{\beta}_{t-1}^{\top}\hat{\mu}_{i,t-1}| > \alpha_{1} \sqrt{\hat{\mu}_{i,t-1}^{\top}V_{t-1}^{-1}\hat{\mu}_{i,t-1}} + \alpha_{2}\sqrt{\dfrac{b_{i,t-1}}{a_{i,t-1}(1+n_{i,t-1})}} \right)$ $\leq \mathbb{P}\left(|\beta^{\top}\hat{\mu}_{i,t-1} - \hat{\beta}_{t-1}^{\top}\hat{\mu}_{i,t-1} |+|\beta^{\top}(\mu_{i}-\hat{\mu}_{i,t-1}) | > \alpha_{1} \sqrt{\hat{\mu}_{i,t-1}^{\top}V_{t-1}^{-1}\hat{\mu}_{i,t-1}}+\alpha_{2}\sqrt{\dfrac{b_{i,t-1}}{a_{i,t-1}(1+n_{i,t-1})}}\right)$ $\leq \mathbb{P}\left(\left\{|\beta^{\top}\hat{\mu}_{i,t-1} - \hat{\beta}_{t-1}^{\top}\hat{\mu}_{i,t-1} | > \alpha_{1} \sqrt{\hat{\mu}_{i,t-1}^{\top}V_{t-1}^{-1}\hat{\mu}_{i,t-1}} \right\} \text{ } \cup \text{ } \left\{|\beta^{\top}(\mu_{i}-\hat{\mu}_{i,t-1}) | >\alpha_{2}\sqrt{\dfrac{b_{i,t-1}}{a_{i,t-1}(1+n_{i,t-1})}}\right\}\right)$ $\leq\delta_{1}+\delta_{2}$ d'après les résultats des propositions \ref{ICterm1} et\ref{ICterm2} et l'inégalité de Boole. En prenant la contraposée, on obtient le résultat annoncé. \end{preuve} Ainsi, l'inégalité ci-dessus nous donne une borne relativement serrée de l'intervalle de confiance associé à la récompense espérée de l’utilisateur $i$, d'où nous pouvons dériver un nouveau score de sélection. À chaque itération $t$, si le contexte de $i$ n'est pas observé, son score noté $s_{i,t}$ est tel que: \begin{equation} s_{i,t}=\hat{\mu}_{i,t-1}^{\top}\hat{\beta}_{t-1}+\alpha_{1} \sqrt{\hat{\mu}_{i,t-1}^{\top}V_{t-1}^{-1}\hat{\mu}_{i,t-1}} + \alpha_{2}\sqrt{\dfrac{b_{i,t-1}}{a_{i,t-1}(1+n_{i,t-1})}} \label{scoreNotObsMeanChap3} \end{equation} La première partie du score ressemble fortement à un score \texttt{LinUCB} \cite{banditCtxtLinUCB} dans lequel on utilise $\hat{\mu}_{i,t-1}$ au lieu de $x_{i,t}$. De façon intuitive, il s'agit d'approximer le contexte $x_{i,t}$ par un terme proche de sa moyenne empirique lorsque celui-ci n'est pas visible. Cependant, cette approximation a un prix, et a pour effet d'ajouter un terme supplémentaire dans l'exploration. Ce terme correspond à l'incertitude sur les contextes. Nous proposons d'effectuer une analyse de ce terme d'exploration afin de comprendre son comportement général. Pour cela, on étudie $\dfrac{b_{i,t-1}}{a_{i,t-1}(1+n_{i,t-1})}$, vu comme une fonction de $n_{i,t-1}$. Le terme $n_{i,t-1}$ étant au moins égal au nombre de fois où le contexte de l'utilisateur $i$ a été observé jusqu'au temps $t$, nous pouvons facilement l'interpréter. En observant la formule pour $a_{i,t-1}$ dans la proposition \ref{distribVarTaui} on peut considérer que le terme dominant $a_{i,t-1}(1+n_{i,t-1})$ évolue en $n_{i,t-1}^{2}$. D'autre part, on remarque qu'en considérant toutes les espérances comme des valeurs finies que $b_{i,t-1}$ évolue en $n_{i,t-1}$. Ainsi, d'une façon générale, le terme d'exploration supplémentaire évolue en $1/\sqrt{n_{i,t-1}}$, qui diminue à mesure que le nombre d'observations du contexte de l'utilisateur augmente. Intuitivement, cela traduit la diminution de l'incertitude entre la moyenne empirique et l'espérance. Finalement, le score des utilisateurs dont le contexte n'est pas observé tend vers un score de type \texttt{LinUCB} \cite{banditCtxtLinUCB} dans lequel on utilise $\hat{\mu}_{i,t-1}$ au lieu de $x_{i,t}$ quand son contexte a été observé un nombre suffisant de fois. \textbf{Bilan :} Nous avons dérivé un intervalle de confiance de la récompense espérée de chaque utilisateur $i$ à un instant $t$, que son contexte soit observé ou non. Si l'on souhaite avoir une probabilité égale pour les deux cas (contexte observé et non observé), il suffira de choisir les paramètres $\delta$, $\delta_{1}$ et $\delta_{2}$ tels que $\delta=\delta_{1}+\delta_{2}$ dans les équations \ref{obsScoreChap3} et \ref{scoreNotObsMeanChap3}. Les différentes combinaisons de $\delta_{1}$ et $\delta_{2}$ respectant cette condition permettrons de jouer sur l'exploration. Nous sommes donc en mesure d'élaborer une approche de type UCB, que nous désignons par \texttt{HiddenLinUCB} et que nous décrivons dans l'algorithme \ref{HiddenLinUCB}. \textbf{Regret de l'algorithme \texttt{HiddenLinUCB} :} Notons qu'une borne supérieure du pseudo-regret ne peut être prouvée théoriquement en raison du fait que le pseudo-regret d'une stratégie de bandit contextuel considère les véritables valeurs de contextes. Or l'utilisation d'une valeur moyenne dans l'algorithme \texttt{HiddenLinUCB} pour les actions dont le contexte n'est pas observé, entraîne une erreur qui ne peut être réduite au fil des itérations. En effet, $\hat{\mu}_{i,t-1}$ n'est pas un estimateur asymptotique de $x_{i,t}$ (au sens où $\lim_{t\to\infty}||\hat{\mu}_{i,t-1}-x_{i,t}||= 0$ avec une forte probabilité). En revanche, comme nous allons le voir dans les expérimentations, la modélisation des contextes cachés effectuée par l'algorithme \texttt{HiddenLinUCB} permet en pratique d'obtenir de meilleurs performances que des algorithmes ne les utilisant pas. \begin{algorithm}[p] \KwIn{$k$, $T$, $\alpha$,$\alpha_1$,$\alpha_2$} $\mathcal{K} = \emptyset$\; $V_{0} = I_{d\times d}$ (matrice identité de taille $d$)\; $\hat{\beta}_{0} = 0_{d}$ (vecteur nul de taille $d$)\; \For{$t=1..T$} { Recevoir $\mathcal{O}_{t}$\; \label{getnewObservationsBis} $\mathcal{K} = \mathcal{O}_{t} \cup \mathcal{K}$\; \label{feedArmSetBis} \For{$i \in \mathcal{K}$} { \eIf {$i \in \mathcal{O}_{t}$}{ \If {$i$ est nouveau}{ $\mathcal{A}_{i}= \emptyset$, $\mathcal{B}_{i}= \emptyset$, $\mathcal{C}_{i}= \emptyset$\; Initialiser $\hat{\mu}_{i}$, $\Sigma_{i}$, $a_{i}$ et $b_{i}$ aléatoirement\; } Observer $x_{i,t}$\; \label{beginObserveAndUpdateBis} $\mathcal{C}_{i}=\mathcal{C}_{i} \cup \left\{t\right\} $ \; $s_{i,t} = x_{i,t}^{\top}\hat{\beta}_{t-1} + \alpha\sqrt{x_{i,t}^{\top}V_{t-1}^{-1}x_{i,t}}$ \; } { $s_{i,t}=\hat{\mu}_{i,t-1}^{\top}\hat{\beta}_{t-1}+\alpha_{1} \sqrt{\hat{\mu}_{i,t-1}^{\top}V_{t-1}^{-1}\hat{\mu}_{i,t-1}} + \alpha_{2}\sqrt{\dfrac{b_{i,t-1}}{a_{i,t-1}(1+n_{i,t-1})}}$\; } } Sélectionner les $k$ actions ayant les scores les plus élevés:\\ $\qquad\mathcal{K}_{t} \leftarrow \argmax\limits_{\hat{\mathcal{K}} \subseteq \mathcal{K}, |\hat{\mathcal{K}}|=k} \quad \sum\limits_{i \in \hat{\mathcal{K}}} s_{i,t}$ \; \label{userSelectionBis} \For{$i \in \mathcal{K}_{t}$} { \eIf {$i \in \mathcal{O}_{t}$}{ $\mathcal{A}_{i}=\mathcal{A}_{i} \cup \left\{t\right\}$ } { $\mathcal{B}_{i}=\mathcal{B}_{i} \cup \left\{t\right\}$\; Initialiser $\hat{x}_{i,t}$ et $W_{i,t}$ aléatoirement\; } } Exécuter le processus d'inférence variationnelle décrit dans l'algorithme \ref{varPassLinear} pour mettre à jour les distributions des variables aléatoires\; } \caption{\texttt{HiddenLinUCB}} \label{HiddenLinUCB} \end{algorithm} \section{Expérimentations} \label{XPChap3} \subsection{Données artificielles} \subsubsection{Protocole} \textbf{Génération des données:} Afin d'évaluer les performances de notre algorithme nous l'expérimentation dans un premier temps sur des données simulées. Pour cela, on fixe un horizon de $T=5000$ pas de temps, un ensemble de $K=50$ actions et $d=10$ dimensions. On tire ensuite un vecteur de régression $\beta$ aléatoirement dans $\left[-S/\sqrt{d}..S/\sqrt{d}\right]^{d}$, de façon à respecter la condition $||\beta||\leq S =1$. Pour chaque bras $i$ on tire un réel $\tau_{i}$ selon une loi gamma de paramètres $a_{0}=2$ et $b_{0}=1$, et un vecteur aléatoire $\mu_{i}$ de dimension $d$, depuis une loi normale $\mathcal{N}(0,\tau_{i}^{-1}I)$. Ensuite, pour chaque itération $t \in \left\{1,...,T \right\}$ on procède de la façon suivante pour simuler les données: \begin{enumerate} \item Pour chaque $i \in \left\{1,...,K \right\}$ on tire un échantillon $x_{i,t}$ suivant une loi normale $\mathcal{N}(\mu_{i},\tau_{i}^{-1}I)$; \item Pour chaque $i \in \left\{1,...,K \right\}$, on tire une récompense $r_{i,t}$ selon une normale $\mathcal{N}(x_{i,t}^{\top}\beta,1)$; \end{enumerate} 1000 jeux de données ont été générés de cette manière, les résultats présentés correspondent à une moyenne sur ces différents corpus. \textbf{Politiques testées:} Les algorithmes de bandits contextuels existants ne sont pas bien adaptés pour traiter notre problème de bandit avec contextes cachés. En effet, ces derniers ne peuvent pas prendre les actions dont le contexte n'est pas disponible à un instant donné dans le processus de sélection. Contrairement au cas du chapitre précédent, ici, notre problème ne peut pas se voir directement comme un problème de bandit stationnaire. Cependant, les algorithmes de bandits stationnaires peuvent être en mesure de détecter certaines tendances. En revanche, ils ne peuvent pas exploiter les contextes observés. Nous choisissons de nous comparer aux algorithmes suivants : \texttt{CUCB}, \texttt{CUCBV}, \texttt{MOSS} et un algorithme \texttt{Thompson Sampling} avec récompense gaussienne décrite dans l'état de l'art, et initialement proposé par \cite{banditSimpleThompsonAnalysis2}. Soulignons que ces trois politiques n'utilisent aucune information extérieure autre que les récompenses observées. Nous implémentons également la politique \texttt{HiddenLinUCB} proposée dans ce chapitre et décrite dans l'algorithme \ref{HiddenLinUCB}. On fixe $\delta=0.05$, $\delta{1}=\delta{2}=0.025$ et $S$, la taille de la fenêtre de temps à 100. Par ailleurs, nous implémentons les trois scénarios présentés au chapitre précédent pour le processus générant l'ensemble $\mathcal{O}_{t}$ à chaque itération. On rappelle que dans le cas 1 on a $\mathcal{O}_{t}=\mathcal{K}$, dans le cas 2, chaque action a une probabilité $p$ d'être dans $\mathcal{O}_{t}$ à chaque pas de temps et dans le cas 3, $\mathcal{O}_{t}=\mathcal{K}_{t-1}$. On compare différentes valeurs de $p\in \left\{0,0.1,0.2, 0.5,0.7, 1 \right\}$. On rappelle que lorsque $p=0$, les actions sélectionnées au temps $t$ sont ajoutées à $\mathcal{O}_{t+1}$. Lorsque $p=1$, le processus d'inférence variationnel n'est plus nécessaire car tout les contextes sont visibles, ce qui correspond à l'algorithme \texttt{LinUCB}. Pour l'ensemble des politiques, on considère que l'on sélectionne $k=5$ actions à chaque itération. \subsubsection{Résultats} Nous proposons de mesurer les performances de nos algorithmes en termes de regret cumulé dont nous rappelons la définition: \begin{equation*} \sum\limits_{t=1}^{T} \left(\sum\limits_{i\in \mathcal{K}_{t}^{\star}} r_{i,t} - \sum\limits_{i\in \mathcal{K}_{t}} r_{i,t}\right) \end{equation*} où $\mathcal{K}_{t}^{\star}$ est l'ensemble des $k$ actions ayant la plus grande valeur de $x_{i,t}^{\top}\beta$. La figure \ref{fig:regretVsTimeSimHiddenLinUCB} représente l'évolution du regret cumulé au cours du temps pour les différents algorithmes testés, où nous avons retiré l'algorithme \texttt{Random} en raison de ses trop mauvais résultats. On remarque que les deux politiques \texttt{CUCB} et \texttt{MOSS} offrent des performances pratiquements égales, tandis que \texttt{CUCBV} et \texttt{Thompson Sampling} sont moins performants. Il semble que dans ce cas, l'utilisation de la variance empirique par \texttt{CUCBV} dans l'exploration ne soit pas efficace. Plus intéressant est le fait que dans toutes les configurations (c.-à-d. pour n'importe quelle valeur de $p$) l'algorithme \texttt{HiddenLinUCB} offre de meilleurs résultats que les politiques de bandit stationnaire, toutes confondues. Il est donc possible de tirer partie du modèle contextuel dans le processus de sélection, même lorsque tous les contextes ne sont pas visibles. On note d'une façon générale que les performances se dégradent à mesure que $p$ diminue. Ceci semble cohérent, étant donné que plus $p$ est grand, plus le nombre de contextes observés est élevé. De plus, quand $p$ augmente, la qualité des estimateurs augmente aussi. En revanche lorsque $p$ est petit, on dispose de moins d'exemples pour effectuer l'apprentissage des différents paramètres. En outre, les performances de l'algorithme \texttt{HiddenLinUCB} s'avèrent meilleures pour le cas $p=0$ que pour le cas $p=0.1$. En ne faisant pas appel à un quelconque processus aléatoire externe délivrant les contextes, l'algorithme \texttt{HiddenLinUCB p=0} définit lui même ceux qui sont observés, puisque les contextes obtenus correspondent alors aux actions sélectionnées précédemment. Cette exploration active sur les contextes permet une identification plus efficace des bras les plus intéressants, pour un ratio de contextes observés identique (1/10). \begin{figureth} \includegraphics[width=0.9\linewidth]{HiddenLinUCBSimulationK500T5000RegretVar.pdf} \caption[Regret simulation \texttt{HiddenLinUCB}]{Regret cumulé en fonction du temps pour l'expérience sur données artificielles.} \label{fig:regretVsTimeSimHiddenLinUCB} \end{figureth} \begin{comment} \end{} \begin{figureth} \includegraphics[width=0.9\linewidth]{HiddenLinUCBSimulationK500T5000ErrorPlotVar.pdf} \caption[Regret avec variance simulation \texttt{HiddenLinUCB}]{Regret cumulé en fonction du temps pour l'expérience sur données artificielles pour l'algorithme \texttt{HiddenLinUCB} avec représenation de la variance par rapport au différentes simulations.} \label{fig:regretVsTimeSimHiddenLinUCB} \end{figureth} \end{comment} L'algorithme \texttt{HiddenLinUCB} obtient de très bons résultats quand les données utilisées respectent bien les hypothèses du modèle. Dans la section qui suit, nous expérimentons notre approche sur des données réelles, afin d'en mesurer l'efficacité lorsque les données ne suivent plus exactement les hypothèses ayant servies à dériver l'algorithme. \subsection{Données réelles} Nous proposons d'expérimenter l'algorithme proposé dans ce chapitre dans le cadre de notre tâche de collecte d'information sur Twitter. Nous nous évaluerons à la fois sur des jeux de données hors-ligne, mais aussi dans une expérimentation en conditions réelles. \subsubsection{Hors ligne} \paragraph{Modèle de contexte} On se place dans le même cadre que dans le chapitre précédent (c.f. \ref{modelProfilStat}) dans lequel, à un instant $t$, nous utilisions les messages postés au temps $t-1$ comme échantillons de profils à l'instant $t$ (pour les utilisateurs appartenant à $\mathcal{O}_{t}$). Formellement nous avions $x_{i,t}=F(\omega_{i,t-1})$ où $\omega_{i,t-1}$ représente les messages du compte $i$ à l'instant $t-1$ et $F$ est une transformation nous permettant de réduire la dimension de l'espace des profils. Nous proposons d'utiliser cette même représentation pour modéliser le contexte d'un utilisateur à un instant donné. \paragraph{Protocole} Nous utilisons le même protocole que celui présenté dans la partie \ref{protocole} du chapitre précédent, à savoir le modèle \textit{Topic+Influence} avec les trois thématiques \textit{Politique}, \textit{Religion} et \textit{Science}, et ce pour les trois bases de données collectées (toujours avec $k=100$). Nous comparons la politique \texttt{HiddenLinUCB} à tous les algorithmes testés jusqu'ici, à savoir \texttt{CUCB}, \texttt{CUCBV}, \texttt{UCB}-$\delta$, \texttt{MOSS} et \texttt{SampLinUCB}. On fixe $\delta=0.05$, $\delta_{1}=\delta_{2}=0.025$ et une fenêtre de temps de $S=10$ itérations, permettant de réduire la complexité du processus variationnel (voir remarque précédente). Pour les valeurs de $a_{0}$ et $b_{0}$, nous avons utilisé le jeu de données \textit{USElections} et la thématique politique comme ensemble de validation, ce qui a conduit à prendre $a_{0}=10$ et $b_{0}=1$\footnote{L'utilisation d'une valeur de $a_{0}$ plus élevée que $b_{0}$ a pour effet de réduire l'exploration sur les contextes.}. Finalement, pour les algorithmes nécessitant un processus de génération de l'ensemble $\mathcal{O}_{t}$, c'est-à-dire \texttt{SampLinUCB} et \texttt{HiddenLinUCB} on simule le processus pour différents $p\in \left\{0, 0.01,0.05, 0.1, 0.5,1 \right\}$. Comme précédemment, lorsque $p=0$, les individus écouté au temps $t$ sont ajoutés à l'ensemble $\mathcal{O}_{t+1}$ (ce qui correspond au cas 3) \footnote{Cet ajout aurait également pu être effectué pour $p> 0$, ce qui sera fait dans l'expérimentation en ligne qui suit, mais on souhaite ici isoler les comportements pour une analyse plus fine des différents cas.}. Notons que lorsqu’ un utilisateur $i$ est dans $\mathcal{O}_{t}$, la même valeur de $x_{i,t}$ est délivrée aux deux algorithmes (\texttt{SampLinUCB} et \texttt{HiddenLinUCB}), la différence se situe dans la manière dont ils s'en servent dans leur politique de sélection. \paragraph{Résultats} Le nombre d'algorithmes et de configurations étant élevé, la représentation graphique de l'évolution de la récompense cumulée en fonction du temps sur une même courbe n'est pas envisageable. Nous proposons plutôt une représentation condensée dans laquelle, pour chaque algorithme on illustre la valeur finale de la récompense cumulée. Ainsi les figures \ref{fig:finalRewardDBUS}, \ref{fig:finalRewardDBOG} et \ref{fig:finalRewardDBBrexit} représentent cette grandeur respectivement pour les bases \textit{USElections}, \textit{OlympicGames} et \textit{Brexit} selon les trois thématiques. Pour plus de lisibilité, nous utilisons une même couleur pour représenter les algorithmes dans lesquels la probabilité $p$ est la même. Premièrement, lorsque chaque contexte est observable ($p=1$), notre approche contextuelle correspond à un algorithme \texttt{LinUCB} classique et fonctionne mieux que les approches \texttt{CUCB}, \texttt{CUCBV}, \texttt{MOSS} et \texttt{UCB}-$\delta$. Ce résultat montre que nous sommes en mesure de mieux anticiper les utilisateurs qui vont être les plus pertinents à l'étape suivante, compte tenu de leur activité courante. Cela confirme aussi le comportement non stationnaire des utilisateurs. Considérer les contextes permet également de converger plus rapidement vers les utilisateurs intéressants puisque tous les comptes partagent le même paramètre $\beta$. En outre, les résultats montrent que, même pour de faibles probabilités d'observation des contextes $p$, notre politique contextuelle se comporte beaucoup mieux que les approches non contextuelles, ce qui valide empiriquement notre approche : il est possible de tirer parti de l'information contextuelle, même si une grande partie de cette information est cachée. En donnant la possibilité de sélectionner des utilisateurs même si leur contexte est inconnu, nous permettons à l'algorithme de compléter sa sélection en choisissant les utilisateurs dont le contexte moyen correspond à un profil appris. Si aucun utilisateur dans $\mathcal{O}_{t} $ ne semble actuellement pertinent, l'algorithme peut alors compter sur les différents estimateurs associés aux utilisateurs pour effectuer sa sélection. A titre d'exemple, pour la base \textit{USElections} et la thématique science, le nombre moyen d'utilisateurs sélectionnés pour lesquels le contexte a été observé à chaque pas de temps est de 43 pour $p=0.1$ et 58 pour $p=0.5$, ce qui confirme que l'utilisation de contextes intéressants lorsque ceux-ci sont disponibles, tout en conservant une probabilité de sélection non négligeable pour les utilisateurs de qualité dont le contexte n'est pas connu. Par ailleurs, nous remarquons que les résultats obtenus avec $p=0$ (correspondant a un ratio de contexte observés de 1/50) sont meilleurs que ceux obtenus avec $p=0.01$ (ratio de 1/100), et dans certains cas, que ceux obtenus avec $p=0.05$ (ratio de 1/20), ce qui confirme que le terme d'exploration utilisé, favorisant une exploration active des différents contextes, permet de s'orienter vers des utilisateurs prometteurs. Continuons cette analyse par une comparaison avec la méthode \texttt{SampLinUCB} du chapitre précédent, basée sur l'estimation des profils des utilisateurs. Il apparaît que pour une même valeur de $p$, \texttt{HiddenLinUCB} permet d'obtenir de meilleurs résultats que \texttt{SampLinUCB}. Ce résultat est plus prononcé sur les bases \textit{USElections} et \textit{Brexit} que sur la base \textit{OlympicGames}. Il semble que l'approche non stationnaire soit particulièrement pertinente dans un réseau social puisque les utilisateurs y ont une attitude très variable de façon générale, pouvant être mieux captée par le modèle contextuel utilisé. \begin{figureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBUS_PoliticFinalRwdNew.pdf} \caption{Politique} \end{subfigureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBUS_ReligionFinalRwdNew.pdf} \caption{Religion} \end{subfigureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBUS_ScienceFinalRwdNew.pdf} \caption{Science} \end{subfigureth} \caption[Récompense finale pour tous les algorithmes testés sur la base \textit{USElections}.]{Récompense finale pour tous les algorithmes testés sur la base \textit{USElections} et le modèle \textit{Topic+Influence} avec différentes thématiques.} \label{fig:finalRewardDBUS} \end{figureth} \begin{figureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBOG_PoliticFinalRwdNew.pdf} \caption{Politique} \end{subfigureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBOG_ReligionFinalRwdNew.pdf} \caption{Religion} \end{subfigureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBOG_ScienceFinalRwdNew.pdf} \caption{Science} \end{subfigureth} \caption[Récompense finale pour tous les algorithmes testés sur la base \textit{OlympicGames}.]{Récompense finale pour tous les algorithmes testés sur la base \textit{OlympicGames} et le modèle \textit{Topic+Influence} avec différentes thématiques.} \label{fig:finalRewardDBOG} \end{figureth} \begin{figureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBBrexit_PoliticFinalRwdNew.pdf} \caption{Politique} \end{subfigureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBBrexit_ReligionFinalRwdNew.pdf} \caption{Religion} \end{subfigureth} \begin{subfigureth}{0.5\textwidth} \includegraphics[width=\linewidth]{DBBrexit_ScienceFinalRwdNew.pdf} \caption{Science} \end{subfigureth} \caption[Récompense finale pour tous les algorithmes testés sur la base \textit{Brexit}.]{Récompense finale pour tous les algorithmes testés sur la base \textit{Brexit} et le modèle \textit{Topic+Influence} avec différentes thématiques.} \label{fig:finalRewardDBBrexit} \end{figureth} \subsubsection{En ligne} \paragraph{Protocole} Nous considérons notre tâche de collecte dans une expérimentation en ligne sur Twitter prenant en compte l'ensemble du réseau social ainsi que les contraintes des différentes API. Comme nous l'avons déjà présenté, l'API \textit{Follow} \textit{Streaming} de Twitter nous offre la possibilité d'écouter un total de 5000 utilisateurs du réseau social simultanément. À l'instar de l'expérimentation en ligne du chapitre \ref{FormalisationTache}, nous utiliserons cette dernière pour récupérer les contenus produits par les comptes dans $\mathcal{K}_{t}$. Dans le cas où l'on ne dispose d'aucune autre source d'information, cette API sert également à récupérer les contextes de certains utilisateurs, ce qui correspond au scénario où $\mathcal{O}_{t}=\mathcal{K}_{t-1}$. Comme nous l'avons vu dans les expérimentations hors-ligne, de façon générale, l'augmentation du nombre de contextes visibles à chaque itération permet d'améliorer les résultats. Dans cette optique, rendre disponible plus de contextes semble être pertinent. En plus des 5000 comptes que l'on peut écouter en même temps, Twitter propose également une API \textit{Sample} \textit{streaming}, qui renvoie en temps réel 1\% de tous les \textit{tweets} publics. Les éléments renvoyés par cette API sont les mêmes, peu importe la connexion utilisée. Ainsi, multiplier les comptes pour récupérer plus de données via cette API est inutile. Nous utilisons cette dernière pour découvrir de nouveaux utilisateurs, mais aussi pour récolter les contextes (activités) d'un grand nombre d'utilisateurs actifs à un moment donné. Concrètement, l'utilisation de cette seconde source d'information nous permet d'avoir plus d'utilisateurs dans $\mathcal{O}_{t}$ à chaque itération. Afin d'expliciter le fonctionnement du processus de collecte en temps réel dans ce cas, nous proposons une illustration dans la figure \ref{fig:processLiveCtxt}, où trois itérations sont représentées. Au début de chaque étape, la politique de sélection des sources choisit un ensemble d’utilisateurs à suivre parmi tous les utilisateurs connus du système, selon des observations et des connaissances fournies par un module d'apprentissage correspondant à la politique en question. Ensuite, les messages postés par les $k=5000$ profils sélectionnés sont collectés via l'API \textit{Follow streaming}. Comme nous pouvons le voir dans la partie centrale du schéma, après avoir suivi les utilisateurs de $\mathcal{K}_t$ pendant l'itération courante $t$, les messages collectés sont analysés et le résultat - traduisant la pertinence - est renvoyé au module d'apprentissage. En parallèle, à chaque itération, l'activité courante de certains utilisateurs est capturée par l'API \textit{Sample streaming}. Cela nous offre la possibilité d'enrichir la base des utilisateurs potentiels ${\cal K}$, mais aussi de construire l'ensemble des utilisateurs dont on connaît le contexte. Chaque utilisateur ayant publié au moins un message parmi ceux qui ont été collectés avec l'API \textit{Sample streaming} à l'étape $t$ sont inclus dans $\mathcal{O}_{t+1}$. À cet ensemble sont ajoutés les membres de $\mathcal{K}_{t}$, puisque leur activité a été suivie pendant l'étape $t$. \begin{figureth} \includegraphics[width=0.8\linewidth]{taskLast.pdf} \caption[Illustration du système]{Illustration du système.} \label{fig:processLiveCtxt} \end{figureth} Dans cette expérience, on fixe la durée d'une période d'écoute à $\mathcal{L}=15$ minutes et l'horizon à deux semaines, ce qui correspond à $T=1344$. Nous choisissons la fonction de récompense \textit{Topic+Influence} avec la thématique politique. Comme précédemment, compte tenu des restrictions de Twitter, chaque expérience nécessite un compte développeur, ce qui limite le nombre de politiques que nous pouvons tester en parallèle. Nous avons choisi de tester les quatre stratégies suivantes : notre approche contextuelle \texttt{HiddenLinUCB}, l'algorithme \texttt{CUCBV}, une politique \texttt{Random} et une autre appelée \texttt{Static}, qui suit les mêmes 5000 comptes, sélectionnés \textit{a priori}, à chaque étape du processus. Les 5000 comptes suivis par l'approche \texttt{Static} ont été choisis en sélectionnant les 5000 utilisateurs ayant cumulé le plus fort volume de récompenses selon les messages collectés par l'API \textit{Sample} sur une période de 24 heures. Pour information, certains comptes célèbres tels que \textit{@dailytelegraph}, \textit{@Independent} ou \textit{@CNBC} en faisaient partie. Remarquons enfin que $p$, la probabilité pour chaque utilisateur de révéler son activité n'est pas un paramètre, mais est contraint par la tâche. \paragraph{Résultats} La partie gauche de la figure \ref{fig:liveContextPolitic} représente l'évolution du gain cumulé en fonction du temps (représenté en termes de nombre d'itérations). On remarque le très bon comportement de notre algorithme dans un scénario réel, car la somme des récompenses qu'il accumule croît beaucoup plus rapidement que celle des autres politiques, surtout après les 500 premières itérations. Après ces premières itérations, notre algorithme semble avoir acquis une bonne connaissance sur les distributions de récompenses en fonction des contextes observés sur les différents utilisateurs du réseau. Afin d'analyser le comportement des politiques expérimentées pendant les premières itérations de la capture, nous représentons aussi à droite de la figure \ref{fig:liveContextPolitic} un zoom des mêmes courbes sur les 150 premiers pas de temps. Au début, la politique \texttt{Static} est plus performante que toutes les autres, ce qui peut s'expliquer par deux raisons: premièrement les algorithmes de bandits utilisés ont besoin de sélectionner tous les utilisateurs au moins une fois pour initialiser les scores et deuxièmement les utilisateurs faisant partie de l'ensemble \texttt{Static} sont supposés être des sources relativement pertinentes étant donné la façon dont ils ont été choisis. Vers l'itération 80, aussi bien l'algorithme \texttt{CUCBV} que l'algorithme contextuel deviennent meilleurs que \texttt{Static}, ce qui correspond au moment où ils commencent à pouvoir exploiter de ``bons'' comptes identifiés. Ensuite, une période d'environ 60 itérations est observée (approximativement entre les itérations 80 et 140), au cours de laquelle l'algorithme \texttt{CUCBV} et notre approche contextuelle ont des performances comparables. Cette période s'explique par le fait que notre approche nécessite un certain nombre d'itérations pour apprendre des corrélations efficaces entre contextes et récompenses afin d'en tirer avantage. Enfin, après cette période d'initialisation, on peut remarquer un changement significatif de pente pour la courbe correspondant à notre algorithme, ce qui souligne sa faculté à être bien plus réactif dans un environnement dynamique. De plus, le volume de récompenses collectées avec notre approche sur la période d'expérimentation représente plus du double de ce qui a été collecté avec l'approche état de l'art \texttt{CUCBV}. Enfin, il est à noter que le nombre de fois que chaque utilisateur a été sélectionné par notre algorithme est mieux réparti qu'avec un algorithme stationnaire comme \texttt{CUCBV}, ce qui confirme la pertinence d'adopter une approche dynamique. En conclusion, que ce soit en ligne ou hors ligne, notre approche se révèle très efficace pour la sélection dynamique d'utilisateurs pour la collecte de données ciblée. \begin{figureth} \begin{subfigureth}{0.45\textwidth} \includegraphics[width=\linewidth]{liveHybridk5000T900RwdRT.pdf} \caption{Récompense cumulée sur toute la durée de la collecte.} \end{subfigureth} \begin{subfigureth}{0.45\textwidth} \includegraphics[width=\linewidth]{liveHybridk5000T900RwdRTZoom.pdf} \caption{Agrandissement sur les 150 premiers pas de temps.} \end{subfigureth} \caption[Récompense cumulée en fonction du temps dans l'expérience en ligne]{Récompense cumulée en fonction du temps dans l'expérience en ligne pour différentes politiques. A gauche se trouve une version agrandie des 150 premiers pas de temps.} \label{fig:liveContextPolitic} \end{figureth} \section{Conclusion} Dans ce chapitre, nous avons formalisé la tâche de collecte de données sur les réseaux sociaux comme une instance spécifique du problème de bandit contextuel, dans laquelle, à cause des restrictions imposées par les médias sociaux, seule une partie des contextes est observable à chaque itération. Pour résoudre cette tâche, nous avons proposé un nouvel algorithme de bandit faisant intervenir un processus d'inférence variationnelle et permettant de prendre en compte les utilisateurs dont le contexte n'est pas disponible. L'approche proposée permet de définir un intervalle de confiance pour les récompenses de chaque utilisateurs et donc de définir un stratégie de type UCB. Les résultats expérimentaux ont montré la validité de cette méthode dans un cadre réel. Il aurait également été intéressant d'utiliser des modèles de contextes non gaussiens afin d'obtenir une meilleure modélisation des messages. Cependant, des approximations supplémentaires et des calculs plus lourds auraient été nécessaires pour dériver les distributions des différents paramètres. Dans le chapitre qui suit, nous introduisons un modèle dans lequel nous modélisons des relations temporelles entre les différents utilisateurs. \chapter{Modèles récurrents} \minitoc \newpage \label{ModeleRelationnel} L'approche du chapitre précédent a permis d'améliorer les performances de notre système de collecte en temps réel en utilisant des contextes décisionnels associés à chaque utilisateur. Cependant, le fait qu'une majorité de ces contextes ne soit pas accessible en raison des restrictions imposées pas les API de Twitter, constitue une contrainte forte. Nous proposons dans ce chapitre une approche ne nécessitant pas d'information extérieure, mais permettant de modéliser des relations entre utilisateurs, afin de mieux capter les variations d'utilité des récompenses associées, malgré les données manquantes. Le principe de ce modèle est de prendre en compte des dépendances temporelles afin de les exploiter dans la stratégie de sélection des différentes actions. Ceci nous amène à considérer un nouveau modèle de bandit de type récurrent dans lequel on introduit des transitions d'une itération à la suivante. Dans cette optique, deux types d'approches sont alors proposés: un premier modèle considérant des dépendances linéaires entre les récompenses de périodes d'écoute successives, et un second, faisant intervenir des hypothèses de transitions entre des états latents du système afin de capturer les variations d'utilité des différents comptes. Nous verrons en particulier que cette seconde approche possède à la fois l'avantage de pouvoir modéliser des dépendances à plus long terme, mais aussi de détecter des schémas de dépendance temporelle plus complexes. \section{Modèle relationnel récurrent} \label{modRecurrent} \subsection{Hypothèses et notations} On rappelle que le problème du bandit avec sélection multiple procède de la façon suivante: à chaque itération $t \in \left\{1,...,T\right\}$, un sous-ensemble $\mathcal{K}_{t} \subset \mathcal{K}$ d'actions de taille $k$ est sélectionné. Pour chaque action $i \in \mathcal{K}_{t}$, l'agent décisionnel reçoit une récompense $r_{i,t} \in \mathbb{R}$. Le choix de $\mathcal{K}_{t}$ à chaque instant est effectué grâce à une politique de sélection se basant sur l'historique des choix et des récompenses passés. Pour dériver une politique efficace, c'est à dire permettant de récolter un maximum de récompenses au cours du temps, certaines hypothèses sont nécessaires. Par exemple, dans le chapitre \ref{ModeleStationnaire} nous avons fait une hypothèse de stationnarité, tandis que dans le chapitre \ref{ModeleContextuelVariable} nous avons supposé qu'il existait une certaine structure dans l'espace des récompenses, avec notamment l'utilisation d'un contexte décisionnel. De nouvelles hypothèses sont émises dans ce chapitre afin de considérer des dépendances temporelles entre les utilités observées de chaque utilisateur. Dans un premier temps, nous proposons d'étudier une relation de récurrence directe entre les récompenses. Concrètement, l'espérance de la récompense de l'action $i$ au temps $t$ est supposée être une fonction de la somme pondérée des récompenses au temps $t-1$ plus un terme de biais visant à modéliser une qualité intrinsèque, indépendamment des relations. Nous formalisons le problème de la façon suivante: \begin{align} \label{modelVect} \forall i \in \left\{1,...,K\right\}, \exists \theta_{i} \in \mathbb{R}^{K+1} ~\text{tel que}~: \forall t \in \left\{2,...,T\right\}: \mathbb{E}[r_{i,t}|R_{t-1}]=\theta_{i}^{\top}R_{t-1} \end{align} Avec $R_{t}=(r_{1,t},...,r_{K,t},1)^{\top} \in \mathbb{R}^{K+1}$ le vecteur des récompenses au temps $t$ concaténé avec une valeur constante égale à 1 qui nous permet de modéliser un biais. Les vecteurs $\theta_{i}$ sont propres à chaque action et déterminent le poids des unes sur les autres entre deux itérations consécutives. Par ailleurs $R_{1}$ est un vecteur aléatoire que nous spécifierons par la suite. Dans le cadre de notre tâche de collecte d'information, ce genre de modélisation revient à considérer que l'information pertinente se propage sur le réseau selon des relations d'influence et/ou de communication entre utilisateurs. \begin{note} Nous insistons sur la différence avec le type de dépendances généralement étudiées (type graphe), que l'on pourrait qualifier de structurelles, en opposition aux dépendances temporelles que nous souhaitons prendre en compte. Plutôt que de on modéliser des corrélations ou des similarités entre les récompenses des différentes actions à un instant donné, nous cherchons ici à modéliser des phénomènes de propagation d'utilité d'un pas de temps à un autre. En outre, à la différence de la plupart des méthodes existantes, nous nous plaçons dans un cadre où le graphe de dépendances est inconnu a priori. \end{note} En vue de dériver un algorithme de bandit, nous spécifions, comme au chapitre précédent, des distributions pour les récompenses respectant l'équation \ref{modelVect}, mais aussi pour les paramètres du problème, c'est-à-dire les différents vecteurs $\theta_{i}$. Dans cette optique, nous proposons le modèle probabiliste gaussien suivant\footnote{Il aurait également été possible de définir une distribution \textit{a priori} sur les paramètres variance $\sigma^{2}$ et $\alpha^{2}$. Cependant, nous verrons que la complexité due au fait que de nombreuses composantes du vecteur de récompense sont manquantes rend le problème suffisamment complexe à résoudre. Il aurait également été possible de considérer une variance $\sigma_{i}$ propre à chaque utilisateur $i$, ce qui permettrait de prendre en compte des variabilités différentes d'un utilisateur à l'autre. En l'absence d'information, on choisit la même valeur $\sigma_{i}=\sigma$ pour chacun. }: \begin{itemize} \item \textbf{Vraisemblance : } $\forall i \in \left\{1,...,K\right\}, \exists \theta_{i} \in \mathbb{R}^{K+1} ~\text{tel que}~ \forall t \in \left\{2,...,T\right\}$: $r_{i,t}=\theta_{i}^{\top}R_{t-1} + \epsilon_{i,t}$, où $\epsilon_{i,t} \sim \mathcal{N}(0,\sigma^{2})$ (bruit gaussien de moyenne $0$ et de variance $\sigma^{2}$). \item \textbf{Prior sur les paramètres: } $\forall i \in \left\{1,...,K\right\}$: $\theta_{i} \sim \mathcal{N}(0,\alpha^{2}I)$ (bruit gaussien de dimension $K+1$, de moyenne $0$ et de matrice de covariance $\alpha^{2}I$, avec $I$ la matrice identité de taille $K+1$). \item \textbf{Prior au temps 1: } $\forall i \in \left\{1,...,K\right\}$: $r_{i,1} \sim \mathcal{N}(\mu_{i},\sigma^{2})$ avec $\mu_{i}\in \mathbb{R}$. \end{itemize} Notons que l'on a défini une distribution \textit{a priori} sur le vecteur des récompenses initiales $R_{1}$, ce dernier ne pouvant pas être modélisé par une somme pondérée des récompenses précédentes. \begin{note}[Lien avec les processus autorégressifs] D'une façon générale, un processus autorégressif vectoriel ("\textit{Vector autoregression}" ou \textit{VAR}) d'ordre $p \in \mathbb{N}^{\star}$ et de dimension $n$ suppose que les valeurs de $n$ séries différentes au temps $t$ sont des combinaisons linéaires des valeurs des séries aux pas de temps $t-1, t-2,...t-p$, plus un bruit. Le modèle présenté ici s'apparente donc à un processus autorégressif vectoriel de dimension $K$ et d'ordre 1. Lorsque les différents poids du modèle sont considérés comme des variables aléatoires, on se situe dans le cadre du "\textit{Bayesian Vector autoregression}" \cite{bayesianVectorAutoregression}. Une difficulté supplémentaire dans notre cas est qu'un certain nombre de valeurs au temps $t-1$ sont manquantes, en raison du processus décisionnel de bandit associé ne permettant d'observer que $k$ récompenses à chaque itération. \end{note} \textbf{Note sur de la cohérence du modèle:} En notant $A$ la matrice de taille $(K+1) \times (K+1)$ dont la ligne $i$ vaut $\theta_{i}$ pour $1\leq i\leq K$ et la ligne $K+1$ vaut $(0,..,0,1)$ on a: $\forall t \in \left\{1,...,T\right\}: \mathbb{E}[R_{t}]=A^{t}\mathbb{E}[R_{0}]$. Ainsi, selon les valeurs des $\theta_{i}$, le problème peut diverger, ce que nous souhaitons éviter. On a: $||\mathbb{E}[R_{t}]|| \leq ||A^{t}|| ||\mathbb{E}[R_{0}]|| \leq ||A||^{t} ||\mathbb{E}[R_{0}]||$ où $||A||$ est la norme spectrale, c'est-à-dire la racine carrée de la plus grande valeur propre de la matrice semi-définie positive $A^{\top}A$: $||A||=\sqrt{\lambda_{max}(A^{\top}A)}$. Donc on a: $||\mathbb{E}[R_{t}]|| \leq (\sqrt{\lambda_{max}(A^{\top}A)})^{t}||\mathbb{E}[R_{0}]||$. Pour s'assurer d'un modèle non divergent, on doit alors avoir $\lambda_{max}(A^{\top}A) \leq 1$, ce qui garantit $\lim\limits_{t \rightarrow +\infty} ||\mathbb{E}[R_{t}]|| < +\infty$. \textbf{Illustration d'un scénario simple:} La figure \ref{fig:RecurrentModelK3T100} représente une simulation du modèle sur un cas simple où l'a choisi $K=3$, $T=100$, $\mu_{i}=0$ et $\sigma=0.1$. Cette illustration a pour but de montrer le comportement apparemment chaotique d'un tel modèle. En effet bien que nous ayons incorporé un biais de valeur différente pour chaque action, il apparaît que les influences d'un pas de temps à l'autre ont plus d'importance, si bien qu'aucune des trois actions n'apparaît meilleure que les autres sur l'ensemble des pas de temps. \begin{figureth} \includegraphics[width=0.6\linewidth]{simpleCaseRecurrentK3T100Real.pdf} \caption[Simulation modèle récurrent $K=3$ et $T=100$ avec récompenses réelles.]{Simulation du modèle récurrent $K=3$ et $T=100$.} \label{fig:RecurrentModelK3T100} \end{figureth} \subsection{Algorithme} \label{sectionAlgorModelRec} Nous proposons dans ce chapitre d'utiliser une approche de type Thompson sampling. Rappelons que le principe de celle-ci est de produire un échantillon de la valeur espérée de chaque récompense à partir de distributions \textit{a posteriori}, apprises au fur et à mesure, puis de sélectionner l'action ayant la plus forte valeur échantillonnée. Dans notre cas, à chaque itération $t\geq 2$, on doit donc effectuer un échantillonnage de la variable aléatoire $\theta_{i}^{\top}R_{t-1}$, que l'on notera $\tilde{r}_{i,t}$, pour chaque action $i$\footnote{Au premier pas de temps, lorsque $t=1$ on effectue un échantillonnage selon la distribution \textit{a priori}.}. Cet échantillonnage doit être effectué en utilisant l'historique des choix $\mathcal{H}_{t-1}$ et les $k$ actions ayant les plus fortes valeurs de $\tilde{r}_{i,t}$ sont sélectionnées. Si les récompenses des actions non sélectionnées étaient révélées à chaque itération, c'est-à-dire si l'on avait accès à toutes les composantes de $R_{t-1}$, nous serions dans un problème de bandit contextuel classique. Cependant au temps $t$, pour tout $s \in \left\{1..t-1\right\}$ et tout $i \notin \mathcal{K}_{s}$, la composante $r_{i,s}$ est manquante, et doit donc être traitée comme une variable aléatoire. D'un point de vue formel, l'échantillonnage de chaque $\tilde{r}_{i,t}$ doit être effectué à partir de la distribution \textit{a posteriori} suivante: \begin{equation} p((r_{i,s})_{s=1..t-1,i\notin \mathcal{K}_{s}},(\theta_{i})_{i=1..K}| (r_{i,s})_{s=1..t-1,i\in \mathcal{K}_{s}}) \end{equation} Cependant, cette distribution est très complexe et ne peut être échantillonnée directement en raison de la complexité provenant de l'aspect récurrent du problème. Pour surmonter cette difficulté, nous proposons d'approximer cette distribution à l'aide d'une approche variationnelle. Cette méthode, que nous avons utilisée au chapitre \ref{ModeleContextuelVariable} pour modéliser les contextes cachés, nous permettra d'obtenir des distributions analytiques sur les différents paramètres. \begin{note} Il aurait également été possible d'utiliser un algorithme MCMC type Gibbs sampling, permettant d'échantillonner des variables aléatoires multivariées à partir de distributions jointes complexes. Cet algorithme procède de façon itérative en échantillonnant successivement chaque variable selon sa distribution conditionnelle par rapport à toutes les autres. Si l'on répète ce processus suffisamment de fois, alors il est possible de montrer que l'échantillon final provient de la distribution jointe originale. Chacune des deux méthodes d'inférence (Gibbs sampling / Variationnelle) possède des avantages et des inconvénients qui selon le cas d'usage orienteront le choix de l'utilisateur. Nous proposons un comparatif de certaines propriétés dans le tableau \ref{tab:compGibbsVSVar}\footnote{Données extraites du site \texttt{http://infernet.azurewebsites.net}}. Dans le cas présent, nous avons favorisé l'inférence variationnelle en raison du fait qu'il est plus commode de suivre sa convergence, mais aussi pour sa rapidité de convergence. \end{note} \begin{tableth} \begin{tabular}{|c|c|c|} \hline \textbf{Propriété} & \textbf{Gibbs sampling} & \textbf{Inférence variationnelle}\\ \hline Déterministe & Non & Oui \\ & & \\ \hline Résultat exact & Oui, mais au bout & Non\\ & d'un nombre infini d'itérations & \\ \hline Garantie de convergence & Oui, mais très souvent & Oui\\ & difficile à suivre & \\ \hline Efficacité & Peu efficace & Souvent le plus\\ & &efficace \\ \hline \end{tabular} \caption[Avantages et inconvénients Gibbs sampling vs variationnelle.]{Propriétés des méthodes d'inférences: Gibbs sampling vs variationnelle.} \label{tab:compGibbsVSVar} \end{tableth} La méthode d'inférence variationnelle nécessite de supposer une factorisation des différentes variables aléatoires cachées dont nous souhaitons obtenir la distribution. Dans cette optique, la factorisation suivante est supposée: \begin{equation} q\left((\theta_{i})_{i=1..K}, (r_{i,s})_{s=1..t-1,i\notin \mathcal{K}_{s}}\right)=\prod_{i=1}^{K}q_{\theta_{i}}(\theta_{i})\prod_{s=1}^{t-1}\prod_{i\notin \mathcal{K}_{s}} q_{r_{i,s}}(r_{i,s}) \end{equation} Grâce à cette hypothèse, nous pouvons désormais calculer les distributions de chacun des paramètres. Les propositions \ref{propThetaReal} et \ref{propRwdReal} établissent ces distributions respectivement pour les variables $(\theta_{i})_{i=1..K}$ et $(r_{i,s})_{s=1..t-1,\notin \mathcal{K}_{s}}$. Les preuves sont disponibles en annexes \ref{proofLin1Params} et \ref{proofLin1Rwds}. \begin{prop} \label{propThetaReal} Pour $t\geq 3$ , on note $D_{t-1}=((R_{s},1)^{\top})_{s=1..t-1}$ la matrice de taille $(t-1)\times (K+1)$ où la ligne $s$ correspond au vecteur de récompense au temps $s$ avec 1 à la fin, $D_{1..t-2}$ la matrice de taille $(t-2)\times K$ composée des $t-2$ premières lignes de $D_{t-1}$ et $D_{i:2..t-1}$ le vecteur de taille $t-2$ correspondant à la colonne $i$ et les $t-2$ dernières lignes de $D_{t-1}$ (c.-à-d. le vecteur de récompenses du bras $i$ du temps $1$ au temps $t-2$). Alors, pour tout $t \geq 2 $, et pour tout $i$, la distribution conditionnelle de $\theta_{i}$ est donnée par: \begin{equation} \theta_{i} \sim \mathcal{N}(A_{i,t-1}^{-1}b_{i,t-1}, A_{i,t-1}^{-1}) \label{dist2} \end{equation} Avec: \begin{itemize} \item $A_{i,t-1}=\dfrac{\mathbb{E}[D_{1..t-2}^{\top}D_{1..t-2}]}{\sigma^{2}}+\dfrac{I}{\alpha^{2}}$ \item $b_{i,t-1}=\dfrac{\mathbb{E}[D_{1..t-2}^{\top}]}{\sigma^{2}}\mathbb{E}[D_{i:2..t-1}]$ \end{itemize} Et par convention $b_{i,1}=0$ et $A_{i,1}= \dfrac{I}{\alpha^{2}}$. De plus, $\mathbb{E}[D_{1..t-2}^{\top}D_{1..t-2}]=\sum\limits_{s=1}^{t-2} \mathbb{E}[(R_{s},1)]\mathbb{E}[(R_{s},1)]^{\top}+Var((R_{s},1))$, les valeurs de $\mathbb{E}[(R_{s},1)]$ et $Var((R_{s},1))$ étant déterminées grâce à la proposition \ref{propRwdReal}. \end{prop} \begin{prop} \label{propRwdReal} On note $\Theta$ la matrice de taille $K \times (K+1)$ dont la ligne $i$ vaut $\theta_{i}$ et $\beta_{j}$ la $j^{eme}$ colonne de $\Theta$. Pour $t\geq 2$ et $1 \leq s \leq t-1$, la distribution variationnelle de $r_{i,s}$ est donnée par: \begin{equation} r_{i,s} \sim \mathcal{N}(\mu_{i,s}, \sigma_{i,s}^{2}) \label{dist1} \end{equation} Avec: \begin{itemize} \item si $s=1$: $\mu_{i,s}=\dfrac{\mathbb{E}[\beta_{i}]^{\top}\mathbb{E}[R_{s+1}] + \mu_{i} - \sum\limits_{j=1,j \neq i}^{K+1} \mathbb{E}[\beta_{i}^{\top}\beta_{j}]\mathbb{E}[r_{j,s}] }{1+\mathbb{E}[\beta_{i}^{\top}\beta_{i}]}$ , $\sigma_{i,s}^{2}=\dfrac{\sigma^{2}}{1+\mathbb{E}[\beta_{i}^{\top}\beta_{i}]}$ \item si $s=t-1$: $\mu_{i,s}=\mathbb{E}[\theta_{i}]^{\top}\mathbb{E}[R_{s-1}] $ ,$\sigma_{i,s}^{2}=\sigma^{2}$ \item si $1\leq s<t-1$: $\mu_{i,s}=\dfrac{\mathbb{E}[\beta_{i}]^{\top}\mathbb{E}[R_{s+1}] + \mathbb{E}[\theta_{i}]^{\top}\mathbb{E}[R_{s-1}] - \sum\limits_{j=1,j \neq i}^{K+1} \mathbb{E}[\beta_{i}^{\top}\beta_{j}]\mathbb{E}[r_{j,s}] }{1+\mathbb{E}[\beta_{i}^{\top}\beta_{i}]}$ , $\sigma_{i,s}^{2}=\dfrac{\sigma^{2}}{1+\mathbb{E}[\beta_{i}^{\top}\beta_{i}]}$ \end{itemize} où par convention on a pris $r_{j,K+1}=1$ pour tout $j$. De plus, $\mathbb{E}[\beta_{i}^{\top}\beta_{j}]$ peut être calculé de la façon suivante: $\mathbb{E}[\beta_{i}^{\top}\beta_{j}]=\sum\limits_{l=1}^{K} Var(\theta_{l})_{i,j}+\mathbb{E}[\theta_{l}]_{i}\mathbb{E}[\theta_{l}]_{j}$, où $Var(\theta_{l})_{i,j}$ désigne l'élément $(i,j)$ de la matrice de covariance de $\theta_{l}$ et $\mathbb{E}[\theta_{l}]_{i}$ désigne l'élement $i$ de la moyenne de $\theta_{l}$, tous deux définis dans la proposition \ref{propThetaReal}. \end{prop} Dans les propositions précédentes, lorsque une récompense a été observée, on utilise la valeur associée au lieu de l'espérance. Concrètement, la composante $i$ de $\mathbb{E}[R_{s}]$ est égale à $r_{i,s}$ si $i \in \mathcal{K}_{s}$ et à $\mathbb{E}[r_{i,s}]$ sinon. De plus, $Var(R_{s})$ correspond à une matrice diagonale de taille $K$ dont l'élément $(i,i)$ vaut 0 si $i \in \mathcal{K}_{s}$ et $\sigma_{i,s}^{2}$ dans le cas opposé. Finalement, $Var((R_{s},1))$ correspond à la matrice $Var(R_{s})$ à laquelle on a ajouté une colonne et une ligne de 0. Les deux propositions précédentes fournissent les distributions des différentes variables du problème. Il apparaît très clairement que les paramètres de chacune d'elles sont liés à tous les autres, d'où la nécessité d'une procédure itérative, dont le but est de converger vers une solution stable. Nous proposons d'expliciter cette procédure dans l'algorithme \ref{varPassRecLinear}. Cet algorithme prend en entrée un entier $nbIt$ qui correspond au nombre d'itérations à effectuer. \begin{algorithm}[!ht] \KwIn{$nbIt$ (nombre d'itérations)} \For{$It =1..nbIt$} { \For{$i =1..K$} { Calculer $A_{i,t-1}$ et $b_{i,t-1}$ selon la proposition \ref{propThetaReal}\; \For{$s =1..t-1$} { \If{$i\notin \mathcal{K}_{s}$}{ Calculer $\mu_{i,s}$ et $\sigma_{i,s}^{2}$ selon la proposition \ref{propRwdReal} \; } } } } \caption{\texttt{Processus itératif variationnel pour le modèle relationnel récurrent}} \label{varPassRecLinear} \end{algorithm} Nous disposons désormais de toutes les distributions variationnelles dont nous avons besoin pour dériver un algorithme de Thompson sampling adapté à notre problème de bandit relationnel récurrent. Cet algorithme, que nous désignons par \texttt{Recurrent Relational Thompson Sampling}, est décrit dans l'algorithme \ref{recurrentTS}. A chaque itération $t$ (sauf pour $t=1$ où l'on utilise uniquement les distributions \textit{a priori} du modèle), l'algorithme fait appel au processus itératif (algorithme \ref{varPassRecLinear}) permettant d'obtenir des distributions approchées pour les variables $\theta_{i}$ et les récompenses non observées à l'itération précédente. Une fois ces distributions obtenues, l'algorithme effectue un échantillonnage des variables en vue d'obtenir un échantillon $\tilde{r}_{i,t}$ de $\theta_{i}^{\top}R_{t-1}$ pour toutes les actions $i$. Il sélectionne ensuite les $k$ actions ayant les plus fortes valeurs de $\tilde{r}_{i,t}$ et récolte les récompenses associées. \begin{algorithm}[!ht] \For{$t =1..T$} { \eIf{$t=1$}{ Pour tout $i$, échantillonner $\tilde{r}_{i,1}$ selon les distributions \textit{a priori} du modèle de récompense\; } { Exécuter l'algorithme variationnel \ref{varPassRecLinear} pour obtenir les distributions de chaque $\theta_{i}$ et des $r_{i,s}$ manquants\; \For{$i =1..K$} { Echantillonner $\theta_{i}$\; \If{$i\notin \mathcal{K}_{t-1}$}{ Echantillonner $\tilde{r}_{i,t-1}$\; } Calculer $\tilde{r}_{i,t}=\theta_{i}^{\top}R_{t-1}$\; } } $\qquad\mathcal{K}_{t} \leftarrow \argmax\limits_{\hat{\mathcal{K}} \subseteq \mathcal{K}, |\hat{\mathcal{K}}|=k} \quad \sum\limits_{i \in \hat{\mathcal{K}}} \tilde{r}_{i,t}$ \; \For{$i \in \mathcal{K}_{t}$} { Recevoir $r_{i,t}$ \; } } \caption{\texttt{Recurrent Relational Thompson Sampling}} \label{recurrentTS} \end{algorithm} \textbf{Complexité :} La complexité de l'algorithme proposé, que l'on notera de façon condensée \texttt{Recurrent TS}, augmente de façon linéaire avec le nombre d'itérations $t$. Ceci est dû à la nécessité de calculer les distributions de chaque récompense manquante depuis le début. Plus précisément, on a $K(K+1)+(t-1)(K-k)$ variables aléatoires dont on doit trouver les paramètres au temps $t$. Cela prend en compte les $K-k$ récompenses manquantes du temps $1$ au temps $t-1$ et les $K$ vecteurs de $K+1$ variables. Ce taux de croissance très rapide, pouvant mener à des problèmes de mémoire, n'est pas compatible avec la nature intrinsèquement "en ligne" des problèmes de bandits. Afin de nous affranchir de cet inconvénient, nous proposons d'utiliser une approximation se restreignant à une fenêtre de temps limité du passé. Soit $S$ la taille de cette fenêtre, alors au lieu de considérer toutes les récompenses manquantes du temps $1$ au temps $t-1$, l'algorithme se limite aux itérations moins anciennes que $S$ pas de temps (de $t-S-1$ à $t-1$), rendant ainsi la complexité constante avec le temps. En revanche, les facteurs $K(K+1)$ et $(K-k)$ ne peuvent pas être réduits simplement. Cela provient du fait que les algorithmes essayent d'apprendre tous les paramètres du modèle. Lorsque le nombre d'actions $K$ augmente, il apparaît donc que la méthode proposée ne peut plus être envisageable. Dans la suite, nous proposons un modèle de récompenses faisant intervenir des transitions entre couches cachées et permettant de réduire considérablement le nombre de paramètres à apprendre. \section{Modèle récurrent à états cachés} \subsection{Hypothèses et notations} Dans le modèle présenté ici, on suppose à chaque itération l'existence d'un état caché du système $h_{t}\in \mathbb{R}^{d}$, qui sous-tend la génération des récompenses à chaque itération $t$. Par ailleurs, nous supposons qu'il existe une transformation linéaire permettant de passer de l'état $h_{t}$ à l'état $h_{t+1}$. Formellement, on a: \begin{equation} \label{hiddenRel} \exists \Theta \in \mathbb{R}^{d\times d}, \forall t \in \left\{2,...,T\right\}: \mathbb{E}[h_{t}|h_{t-1}]=\Theta h_{t-1} \end{equation} \begin{equation} \label{genRel} \forall i \in \left\{1,...,K\right\}, \exists W_{i} \in \mathbb{R}^{d}, \exists b_{i} \in \mathbb{R} ~\text{tels que}~: \forall t \in \left\{1,...,T\right\}: \mathbb{E}[r_{i,t}|h_{t}]=W_{i}^{\top}h_{t}+b_{i} \end{equation} Avec $h_{t}\in \mathbb{R}^{d}$ l'état caché associé à l'itération $t$, $\Theta$ la matrice carré de dimension $d$ constituée des poids du modèle récurrent (permettant de passer d'un état au suivant), $W_{i}\in \mathbb{R}^{d}$ le vecteur de poids liant l'état caché à la récompense de l'action $i$ à l'instant $t$, et $b_{i}$ un terme de biais spécifique à chaque action $i$. L'équation \ref{hiddenRel} décrit l'évolution du système entre deux itérations successives. Chaque composante du vecteur d'état à un instant donné est le résultat d'une combinaison linéaire des composantes du vecteur d'état au temps précédent. Le modèle de récompense est quant à lui décrit par l'équation \ref{genRel}. Il fait intervenir la couche cachée du temps courant pondérée par un vecteur $W_{i}$, plus un biais $b_{i}$ pour chaque action $i$. Le modèle est illustré sur trois itérations dans la figure \ref{fig:genmod}, où l'on distingue les dépendances temporelles entre états. Bien qu'à un instant $t$, l'état courant ne dépend que de l'état précédent, ce modèle est capable de capter des dépendances à plus long terme en raison de la relation de récurrence entre états cachés. \begin{figureth} \includegraphics[width=0.5\linewidth]{HiddenIlls.pdf} \caption[Modèle récurrent à états cachés.]{Modèle récurrent à états cachés.} \label{fig:genmod} \end{figureth} Comme précédemment, nous considérons un modèle génératif basé sur des ditributions gaussiennes: \begin{itemize} \item \textbf{Vraisemblance 1: } $\exists \Theta \in \mathbb{R}^{d\times d}, \forall t \in \left\{2,...,T\right\}: h_{t}=\Theta h_{t-1} +\epsilon_{t}$, où $\epsilon_{t} \sim \mathcal{N}(0,\delta^{2}I)$. \item \textbf{Vraisemblance 2: } $\forall i \in \left\{1,...,K\right\}, \exists W_{i} \in \mathbb{R}^{d}, \exists b_{i} \in \mathbb{R}$ \text{ tels que }: $\forall t \in \left\{1,...,T\right\}$ : $r_{i,t}=W_{i}^{\top}h_{t}+b_{i}$ $\epsilon_{i,t} \sim \mathcal{N}(0,\sigma^{2})$. \item \textbf{Prior au temps 1: } $h_{1} \sim \mathcal{N}(0,\delta^{2}I)$, où $I$ désigne la matrice identité de taille $d$. \item \textbf{Prior sur les paramètres 1: } $\forall i \in \left\{1,...,d\right\}$: $\theta_{i} \sim \mathcal{N}(0,\alpha^{2}I)$, où $\theta_{i}$ désigne la ligne $i$ de $\Theta$. \item \textbf{Prior sur les paramètres 2: } $\forall i \in \left\{1,...,K\right\}$: $(W_{i}, b_{i}) \sim \mathcal{N}(0,\gamma^{2}I)$, avec $(W_{i}, b_{i})$ le vecteur aléatoire de taille $d+1$ issu de la concaténation de $W_{i}$ et $b_{i}$, et $I$ la matrice identité de taille $d+1$. \end{itemize} Pour ne pas allourdir les écritures, on utilise la même notation pour désigner les matrices identité de taille $d$ et $d+1$. Le modèle probabiliste utilisé, avec la présence de variables observables, générées par un état latent non observable au sein duquel des transitions temporelles s'effectuent, nous rappelle le formalisme des modèles de Markov cachés ("Hidden Markov Model" - HMM) \cite{HiddenMarkovModel}. Dans les HMM classiques, les états possibles du système sont discrets et en nombre fini, ce qui n'est pas notre cas, puisque nous utilisons des états continus (les composantes de $h_{t}$ suivent des lois gaussiennes). Lorsque les états sont continus, que les distributions sont gaussiennes, et que les transitions entre états sont linéaires, ce type de modèle est appelé système dynamique linéaire (\textit{"Linear Dynamical System"}). De plus, lorsque les matrices de transition (notée $\Theta$) et d'émission (notée $(W_{i})_{i=1..K}$) sont connues, ce modèle correspond au Filtre de Kalman \cite{KalmanFilter}. Les filtres de Kalman ont généralement pour but de retrouver l'état d'un système physique (position, vitesse, etc.) en fonction de mesures bruitées, lorsqu’ un modèle de la dynamique de ce système est disponible. Le modèle dynamique, que décrit la matrice $\Theta$, provient généralement d'équations physiques, tandis que le modèle d'observation décrit par $(W_{i})_{i=1..K}$, dépend des capteurs disponibles. Dans le cas qui nous intéresse ici, ces paramètres ne sont pas connus et sont considérés comme des variables aléatoires. Ce problème entre dans le cadre générique des \textit{"Bayesian Linear Dynamical Systems"}, pour lequel une approche variationnelle permettant d'approximer les distributions des différents paramètres a été étudiée dans \cite{Variationalmethods}. L'application de la méthode très générique proposée par l'auteur à notre tâche n'étant pas directe, nous dériverons l'ensemble des distributions nécessaires à notre cas spécifique. \begin{note}[Lien avec un modèle de bandit existant] Cette remarque a pour but de clarifier la différence entre notre modèle et un modèle pouvant paraître proche, dans lequel un processus de Markov (MDP) régit l'évolution des différents états des actions \cite{restlessBandit2}. Dans cette approche, les auteurs supposent que chaque action $i$ possède un ensemble fini de $k_{i}$ états, dont les transitions sont gouvernées par une matrice $P_{i}$ de taille $k_{i} \times k_{i}$. De plus, à chaque état $j\in \left\{1,...,k_{i}\right\}$ correspond une espérance (inconnue) $\mu_{i,j}$. La première différence réside dans le fait que, dans leur approche, les auteurs utilisent des états (et des espérances de récompenses) discrets, contrairement à la représentation continue proposée ici. De plus, dans leur cas, chaque action possède un ensemble d'états qui lui est propre, et l'évolution d'un état à l'autre se fait de façon indépendante entre les actions, ce qui constitue une seconde différence avec notre modèle. En effet, nous utilisons un état "partagé" par toutes les actions. Enfin, le modèle proposé dans \cite{restlessBandit2} ne permet pas d'encoder des dépendances temporelles entre états, car les probabilités de transition sont constantes. \end{note} \subsection{Algorithme} \label{sectionalgoHiddenState} Notre but est de dériver un algorithme de Thompson sampling, ce qui se traduit par la nécessité d'échantillonner la variable aléatoire $W_{i}^{\top}\Theta h_{t-1}+b_{i}$ pour chaque action $i$ à l'instant $t$ en utilisant l'historique des choix effectués. Formellement, cet échantillonnage doit être effectué selon la distribution suivante: \begin{equation} p(h_{t-1},\Theta,W,b| (r_{i,s})_{s=1..t-1,i\in \mathcal{K}_{s}}) \end{equation} Comme précédemment, cette distribution n'est pas calculable directement et nous proposons d'adopter une méthode variationnelle afin d'approximer les distributions des différents paramètres. Dans notre cas, l'ensemble des variables observées est celui des récompenses des $k$ actions sélectionnées entre le temps $1$ et le temps $t-1$. L'ensemble des variables latentes est constitué des couches cachées entre le temps $1$ et le temps $t-1$ et des paramètres, à savoir $(h_{1},...,h_{t-1},\Theta,W,b)$. On rappelle que notre but est de trouver une approximation de la distribution des paramètres sachant les données observées. Commençons par factoriser l'ensemble des variables latentes de la façon suivante: \begin{equation} q(h_{1},...,h_{t-1},\Theta,W,b)=\prod\limits_{s=1}^{t-1}q_{h_{s}}(h_{s})\prod\limits_{i=1}^{K}q_{W_{i},b_{i}}(W_{i},b_{i})\prod\limits_{j=1}^{d}q_{\theta_{j}}(\theta_{j}) \end{equation} où pour tout $j \in \left\{1,...,d \right\}$, $\theta_{j}$ représente la ligne $j$ de la matrice $\Theta$. Cette factorisation séparant les couches cachées d'un pas de temps à l'autre, mais aussi les paramètres propres à chaque action nous semblent être la plus naturelle étant donné le modèle probabiliste décrit plus haut. Les propositions \ref{genModHiddenVar}, \ref{genModThetaVar} et \ref{genModWVar} qui suivent, dont nous fournissons les preuves en annexes \ref{proofLin1HiddenLayerVar}, \ref{proofLin1HiddenParamsThetaVar} et \ref{proofLin1HiddenParamsVar}, établissent les distributions variationnelles des différentes variables en se basant sur la factorisation précédente. Il est important de noter que chaque distribution fait appel aux paramètres des autres, il s'agit donc d'un modèle itératif. \begin{prop} \label{genModHiddenVar} On note $W$ la matrice de taille $K \times d$ dont la ligne $i$ vaut $W_{i}$ et $b$ le vecteur des biais de taille $K$. De plus au temps $s$, la sous-matrice (resp. le sous-vecteur) composée des lignes d'indexe $i\in \mathcal{K}_{s}$ de $W$ (resp. de $b$) est notée $W_{s}$ (resp. $b_{s}$). Finalement le vecteur de taille $k$ des récompenses observées au temps $s$ est noté $R_{s}$. A un instant $t\geq 2$, pour tout $s$ tel que $s\leq t-1$, la distribution variationnelle de $h_{s}$ est donnée par: \begin{equation} h_{s}\sim \mathcal{N}(F_{s}^{-1}g_{s}, F_{s}^{-1}) \label{distHs} \end{equation} Avec: \begin{itemize} \item si $s=1$: $F_{s}=\dfrac{I}{\delta^{2}} + \dfrac{\mathbb{E}[\Theta ^{\top}\Theta]}{\delta^{2}} + \dfrac{\mathbb{E}[W_{s}^{\top}W_{s}]}{\sigma^{2}}$ et $g_{s}= \dfrac{\mathbb{E}[\Theta]^{\top} \mathbb{E}[h_{s+1}]}{\delta^{2}} + \dfrac{\mathbb{E}[W_{s}]^{\top}\mathbb{E}[R_{s}]-\mathbb{E}[W_{s}^{\top}b_{s}]}{\sigma^{2}}$ \item si $s=t-1$: $F_{s}=\dfrac{I}{\delta^{2}} + \dfrac{\mathbb{E}[W_{s}^{\top}W_{s}]}{\sigma^{2}}$ et $g_{s}= \dfrac{\mathbb{E}[\Theta] \mathbb{E}[h_{s-1}]}{\delta^{2}} + \dfrac{\mathbb{E}[W_{s}]^{\top}\mathbb{E}[R_{s}]-\mathbb{E}[W_{s}^{\top}b_{s}]}{\sigma^{2}}$ \item si $1<s<t-1$: $F_{s}=\dfrac{I}{\delta^{2}} + \dfrac{\mathbb{E}[\Theta ^{\top}\Theta]}{\delta^{2}} + \dfrac{\mathbb{E}[W_{s}^{\top}W_{s}]}{\sigma^{2}}$ et $g_{s}= \dfrac{\mathbb{E}[\Theta] \mathbb{E}[h_{s-1}]}{\delta^{2}} + \dfrac{\mathbb{E}[W_{s}]^{\top}\mathbb{E}[R_{s}]-\mathbb{E}[W_{s}^{\top}b_{s}]}{\sigma^{2}} +\dfrac{\mathbb{E}[\Theta]^{\top} \mathbb{E}[h_{s+1}]}{\delta^{2}}$ Où: $\qquad \mathbb{E}[\Theta ^{\top}\Theta]=\sum\limits_{i=1}^{d}\mathbb{E}[\theta_{i}\theta_{i}^{\top}]=\sum\limits_{i=1}^{d}(\mathbb{E}[\theta_{i}]\mathbb{E}[\theta_{i}]^{\top}+Var(\theta_{i}))$; $\qquad \mathbb{E}[W_{s}^{\top}W_{s}]=\sum\limits_{i\in\mathcal{K}_{s}}\mathbb{E}[W_{i}W_{i}^{\top}]=\sum\limits_{i\in\mathcal{K}_{s}}(\mathbb{E}[W_{i}]\mathbb{E}[W_{i}]^{\top}+Var(W_{i}))$; $\qquad \mathbb{E}[W_{s}^{\top}b_{s}]=\sum\limits_{i\in\mathcal{K}_{s}} (\mathbb{E}[W_{i}]\mathbb{E}[b_{i}] + Cov(W_{i},b_{i}))$ \end{itemize} \end{prop} \begin{prop} \label{genModThetaVar} Pour $t\geq 3$, on note $D_{t-1}=(h_{s}^{\top})_{s=1..t-1}$ la matrice de taille $(t-1)\times d$ des états cachés jusqu'au temps $t-1$. Alors, pour tout $t\geq 2$ la distribution variationnelle de $\theta_{i}$ suit une loi gaussienne telle que : \begin{equation} \theta_{i}\sim \mathcal{N}(A_{i,t-1}^{-1}b_{i,t-1}, A_{i,t-1}^{-1}) \label{distTheta} \end{equation} Avec: \begin{itemize} \item $A_{i,t-1}=\dfrac{I}{\alpha^{2}}+\dfrac{\mathbb{E}[D_{1..t-2}^{\top}D_{1..t-2}]}{\sigma^{2}}$ \item $b_{i,t-1}=\dfrac{\mathbb{E}[D_{1..t-2}]^{\top}}{\sigma^{2}}\mathbb{E}[D_{i:2..t-1} ]$ \end{itemize} Où par convention $b_{i,1}=0$ et $A_{i,1}= \dfrac{I}{\alpha^{2}}$. Lorsque $t\geq 3$ on utilisera: $\qquad \mathbb{E}[D_{1..t-2}^{\top}D_{1..t-2}]=\sum\limits_{s=1}^{t-2} (\mathbb{E}[h_{s}]\mathbb{E}[h_{s}]^{\top}+Var(h_{s}))$ \end{prop} \begin{prop} \label{genModWVar} Pour chaque action $i$ on note $\mathcal{T}_{i,t-1}$ l'ensemble des itérations où elle a été choisie jusqu'au temps $t-1$, c'est-à-dire $\mathcal{T}_{i,t-1}=\left\{s \text{ tel que } i\in \mathcal{K}_{s} \text{ pour } 1\leq s\leq t-1\right\}$. On note également $M_{i,t-1}=((h_{s},1)^{\top})_{s\in \mathcal{T}_{i,t-1}}$ et $c_{i,t-1}=(r_{i,s})_{s\in \mathcal{T}_{i,t-1}}$. Pour tout $i$ et tout $t\geq 1$, la distribution variationnelle de $(W_{i},b_{i})$ suit une loi gaussienne telle que: \begin{equation} (W_{i},b_{i})\sim \mathcal{N}(V_{i,t-1}^{-1}v_{i,t-1}, V_{i,t-1}^{-1}) \label{distWb} \end{equation} \begin{itemize} \item $V_{i,t-1}=\dfrac{I}{\gamma^{2}}+\dfrac{\mathbb{E}[M_{i,t-1}^{\top}M_{i,t-1}]}{\sigma^{2}}$ \item $v_{i,t-1}=\dfrac{\mathbb{E}[M_{i,t-1}]^{\top}c_{i,t-1}}{\sigma^{2}}$ \end{itemize} Où par convention $v_{i,1}=0$ et $V_{i,1}= \dfrac{I}{\gamma^{2}}$ et lorsque $t\geq 2$ on utilisera: $\qquad \mathbb{E}[M_{i,t-1}^{\top}M_{i,t-1}]=\sum\limits_{s \in\mathcal{T}_{i,t-1}}(\mathbb{E}[(h_{s},1)]\mathbb{E}[(h_{s},1)]^{\top}+Var((h_{s},1)))$ \end{prop} On notera que la matrice de covariance $Var((h_{s},1))$ correspond à la matrice $Var(h_{s})$ à laquelle on a ajouté une colonne et une ligne finale de 0. De plus, le terme $Cov(W_{i},b_{i})$ de la proposition \ref{genModHiddenVar} s'extrait simplement de la matrice $Var((W_{i},b_{i}))$. Nous disposons maintenant de toutes les informations nécessaires pour calculer les paramètres des distributions des variables qui nous intéressent de façon itérative. Le processus itératif variationnel associé est décrit dans l'algorithme \ref{varPass}. \begin{algorithm}[!ht] \KwIn{$nbIt$ (nombre d'itérations)} \For{$It =1..nbIt$} { \For{$s =1..t-1$} { Calculer $g_{s}$ et $F_{s}$ selon la proposition \ref{genModHiddenVar} \; } \For{$i=1..d$} { Calculer $b_{i,t-1}$ et $A_{i,t-1}$ selon la proposition \ref{genModThetaVar} \; } \For{$i =1..K$} { Calculer $v_{i,t-1}$ et $V_{i,t-1}$ selon la proposition \ref{genModWVar} \; } } \caption{\texttt{Processus itératif variationnel pour le modèle récurrent à états cachés}} \label{varPass} \end{algorithm} L'algorithme de Thompson sampling \ref{varRecurrentTS} utilise cette procédure variationnelle afin d'être à même d'échantillonner une variable $W_{i}^{\top}\Theta h_{t-1}+b_{i}$ pour chaque action $i$ à l'instant $t$ et d'effectuer la sélection des meilleures actions. Il procède de façon similaire au précédent modèle, en faisant appel à la procedure variationnelle à chaque itération pour recalculer les paramètres des distributions en fonctions des nouvelles observations de récompenses. Un des atouts de cette méthode par rapport à celle du modèle précédent est que sa complexité est beaucoup moins élevée et croît moins vite avec le nombre d'actions $K$. En effet, ici, à chaque instant $t$, on doit considérer $d^{2}+d(t-1)+K(d+1)$ paramètres. Au lieu de grandir quadratiquement avec le nombre d'action, la complexité augmente avec le carré de l'espace latent, d'où l'intérêt de prendre $d<K$. La méthode utilisée précédemment, qui consiste à se restreindre à une fenêtre temporelle de taille $S$ est également utilisable pour réduire la complexité en temps. Cependant, elle peut être à la source d'une perte d'information. En effet, en ne regardant que $S$ pas de temps en arrière, il est possible que l'algorithme oublie les informations acquises avant. Dans cette optique, nous proposons d'introduire un concept de mémoire. Cette méthode simple consiste à utiliser les valeurs des paramètres calculés au temps $t-1-S$ comme \textit{prior}. Par exemple pour $\theta_{i}$, au lieu de prendre $A_{i,t-1}=\dfrac{I}{\alpha^{2}}+\dfrac{\mathbb{E}[D_{t-2-S..t-2}^{\top}D_{t-2-S..t-2}]}{\sigma^{2}}$, il suffit de prendre $A_{i,t-1}=A_{i,t-1-S}+\dfrac{\mathbb{E}[D_{t-2-S..t-2}^{\top}D_{t-2-S..t-2}]}{\sigma^{2}}$. On peut procéder ainsi également pour les paramètres $(W_{i},b_{i})$. En revanche, les couche cachées en dehors de la fenêtres de temps ne sont pas reconsidérées. \begin{algorithm}[!ht] \For{$t =1..T$} { \eIf{$t=1$}{ Pour tout $i$, échantillonner $\tilde{r}_{i,1}$ selon les distributions \textit{a priori} du modèle de récompense\; } { Exécuter le processus d'inférence variationnelle selon l'algorithme \ref{varPass} afin de calculer les paramètres de chaque distribution \; Echantillonner $h_{t-1}$ et $\Theta$ \; \For{$i =1..K$} { Echantillonner $(W_{i},b_{i})$ \; $\tilde{r}_{i,t}=W_{i}^{\top}\Theta h_{t-1}+b_{i}$\; } } $\qquad\mathcal{K}_{t} \leftarrow \argmax\limits_{\hat{\mathcal{K}} \subseteq \mathcal{K}, |\hat{\mathcal{K}}|=k} \quad \sum\limits_{i \in \hat{\mathcal{K}}} \tilde{r}_{i,t}$ \; \For{$i \in \mathcal{K}_{t}$} { Recevoir $r_{i,t}$ \; } } \caption{\texttt{Recurrent State Thompson Sampling }} \label{varRecurrentTS} \end{algorithm} \section{Expérimentations} Dans cette section nous proposons dans un premier temps des expérimentations sur données artificielles, générées selon le modèle relationnel défini en début de chapitre. Nous verrons que l'algorithme de Thompsons Sampling proposé offre des performances supérieures aux algorithmes de l'état de l'art. Dans le cas où le nombre d'actions devient trop grand, nous étudierons l'algorithme utilisant une couche cachée et verrons que ce dernier permet d'obtenir de bons résultats. Dans un second temps, nous étudierons les performances de notre algorithme dans un scénario simulé où les données seront générées d'une façon différente, en faisant intervenir des périodicités. Nous verrons à nouveau que l'algorithme utilisant une couche cachée est en mesure de retrouver la structuration temporelle des récompenses. Finalement, nous étudierons les approches proposées dans ce chapitre sur des données réelles, où nous aborderons en particulier les difficultés rencontrées pour apprendre notre modèle sur ces données. \subsection{Données artificielles relationnelles} \subsubsection{Protocole} \textbf{Génération des données:} Afin d'évaluer les performances des méthodes décrites précédemment, nous les expérimentons sur des données simulées selon le processus relationnel de la section \ref{modRecurrent}. Nous fixons $\sigma=\alpha=\gamma=\delta=1$ pour les valeurs des différentes variances, et $\mu_{i}=0$ pour la moyenne \textit{a priori} de chaque action $i$. Nous générons ensuite les paramètres $\Theta$ en prenant soin de vérifier que la condition sur les valeurs propres de la matrice des paramètres $\Theta$ est bien respectée pour éviter que le problème diverge (voir remarque en début de chapitre). Les récompenses sont générées selon le modèle probabiliste décrit dans la section \ref{modRecurrent} selon les deux scénarios suivant: \begin{itemize} \item \textbf{XP1: } on considère un nombre d'actions relativement faible de $K=30$ et un horizon temporel de $T=1000$ itérations. Nous testons différentes valeurs de $k \in \left\{ 1, 2, ..., 29 \right\}$. Cette expérimentation a pour but d'évaluer les performances de nos approches récurrentes lorsque le nombre d'actions est raisonnable. \item \textbf{XP2: } on se place dans un cas où $K=200$ et $T=10000$ avec des récompenses réelles. Nous testons également plusieurs valeurs de $k\in \left\{ 10, 20, ..., 190 \right\}$. La version originale sans couche cachée de l'algorithme n'est plus envisageable ici en raison du trop grand nombre de paramètres. Le but est donc de tester la version utilisant une couche générative cachée en présence de multiples bras. Les données utilisées ici sont générées selon un modèle linéaire classique comme dans le premier scénario. \end{itemize} Pour chacune de ces deux séries d'expérimentations, 100 jeux de données sont générés. Les résultats sont présentés correspondent à des moyennes sur ces différents corpus. \textbf{Politiques testées:} A notre connaissance , il n'existe pas d'algorithme adapté à notre problème de bandit récurrent. Cependant, afin d'évaluer les performances de nos politiques, on se compare à divers algorithmes de l'état de l'art (en plus d'une politique \texttt{Random}): \begin{itemize} \item Algorithmes de bandit stochastique: nous proposons de se comparer aux deux politiques optimistes \texttt{UCB} et \texttt{UCBV} et à un algorithme de Thompson sampling pour des récompenses suivant des gaussiennes, que nous appelons \texttt{TS classique}. Ce dernier est décrit dans l'état de l'art dans l'algorithme \ref{TSGauss}. Toutes ces politiques, bien que n'étant pas conçues pour les récompenses non stationnaires comme celles étudiées ici, peuvent néanmoins être en mesure de capter des tendances stationnaires pour les différentes actions. \item Algorithmes de bandit non stationnaire: nous nous comparons aux algorithmes \texttt{Discount UCB} et \texttt{Sliding Window UCB}, spécifiquement conçus pour des problèmes de bandit non stationnaire (présenté dans l'état de l'art en section \ref{nonstatBanditEtatArt}). Nous adaptons ces algorithmes au cas de la sélection multiple en sélectionnant les $k$ actions avec le meilleur score à chaque itération. On rappelle que l'algorithme \texttt{Discount UCB} utilise un facteur de \textit{discount} pour prendre en compte les variations dans le temps tandis que l'algorithme \texttt{Sliding Window UCB} utilise une fenêtre glissante. Dans les remarques 3 et 9 de \cite{nonStationaryBanditAbrupt}, les auteurs proposent des valeurs optimisées pour ces deux paramètres, à savoir pour l'algorithme \texttt{Discount UCB}, un facteur de \textit{discount} égal à $1-\sqrt{\gamma_{T}/T}/4$, et pour l'algorithme \texttt{Sliding Window UCB}, une fenêtre de temps égale à la partie entière de $2\sqrt{T\log(T)/\gamma_{T}}$, avec $\gamma_{T}$ le nombre de changements de moyenne des actions. Dans le scénario que nous étudions ici, sans hypothèses supplémentaires on a $\gamma_{T}=T$. \end{itemize} Nous implémentons également deux autres politiques non réalistes, au sens où elles ne sont pas envisageable dans un cas réel: \begin{itemize} \item Algorithme de bandit contextuel: à titre informatif, nous implémentons un algorithme de Thompson sampling pour bandit contextuel traditionnel (voir algorithme \ref{TSContextLin}), que nous notons \texttt{TS contextuel}, dans lequel \textbf{aucune} composante du vecteur de récompense ne serait manquante. Pour cela, à la fin de chaque itération, on met à disposition de l'algorithme le vecteur des récompenses complet. Notons que cette politique n'est pas réaliste dans la configuration que nous avons choisie puisque l'on n'a normalement pas accès au contexte complet. De plus, cette politique n'est pas testée pour $K=200$ (\textbf{XP2}) en raison de la complexité d'inverser 200 matrices de dimension 200 à chaque itération. \item Algorithme optimal linéaire: finalement, nous nous comparons à un oracle qui connaîtrait la véritable valeur des paramètres ayant permis de générer les données, et dans lequel aucune composante du vecteur de récompense ne serait manquante. Cet algorithme, noté \texttt{Optimal contextuel}, sélectionne à chaque itération les $k$ actions ayant la plus forte valeur de $\theta_{i}^{\top}R_{t-1}$. \end{itemize} Pour nos algorithmes, nous choisissons une fenêtre de temps de taille $S=200$ itérations et un total $nbIt=10$ itérations du processus variationnel à chaque instant. Dans la suite, \texttt{Recurrent TS} désigne notre modèle récurrent à relations directes, et \texttt{Recurrent TS d=valeur} désigne notre modèle à couche cachée, où $d$ désigne la dimension de l'espace latent. Pour \textbf{XP1} nous testons $d\in \left\{2, 4,8 \right\}$, et pour \textbf{XP2} nous testons $d\in \left\{ 5, 10, 20,30 \right\}$. \subsubsection{Résultats} Nous présentons les résultats en termes de gain cumulé final (c'est-à-dire au temps $t=T$) pour chaque politique en fonction du nombre d'actions sélectionnées $k$. Les figures \ref{fig:RecurrentTSK30} et \ref{fig:RecurrentTSK200} illustrent ces valeurs respectivement pour les scénarios \textbf{XP1} et \textbf{XP2}. Tout d'abord, on note que l'aspect en forme de cloche des courbes est dû au fait que les récompenses peuvent être négatives. Par conséquent, la récompense cumulative finale peut diminuer même si le nombre d'actions sélectionnées augmente. Tel qu'attendu, la politique \texttt{Optimal contextuel} obtient les meilleurs résultats, suivie par \texttt{TS contextuel} (présent dans \textbf{XP1}), qui, malgré ses observations de toutes les récompenses à chaque itération doit estimer les paramètres du modèle au fur et à mesure. \texttt{TS contextuel} constitue en quelques sorte une borne supérieure de ce que l'on peut espérer obtenir avec \texttt{Recurrent TS}. A noter que plus le nombre $k$ d'actions sélectionnées augmente, plus \texttt{Recurrent TS} observe des composantes de contexte, ce qui explique le rapprochement des ses résultats de ceux de cette borne supérieure. Nous remarquons en outre dans la figure \ref{fig:RecurrentTSK30}, que quel que soit ce nombre $k$, \texttt{Recurrent TS} obtient de meilleurs résultats que tous les autres algorithmes. Cela signifie que ce dernier est capable de reconstruire correctement les poids du modèle. L'utilisation de couches cachées permet également d'obtenir de bonnes performances, qui sont toutefois moins élevées que la version n'en utilisant pas. Ceci est cohérent étant donné le processus de génération des données qui correspond exactement au modèle recherché par \texttt{Recurrent TS}. Notons que nous n'avons pas représenté la courbe de \texttt{Recurrent TS d=8}, celle-ci n'étant que très légèrement au dessus la courbe de \texttt{Recurrent TS d=4}. De plus, il n'y a aucune amélioration avec les politiques \texttt{Discount UCB} et \texttt{Sliding Window UCB} par rapport aux politiques traditionnelles telles que \texttt{UCB}. Dans \textbf{XP1}, \texttt{Sliding Window UCB} est même moins performant qu'une stratégie aléatoire. Ceci s'explique par le fait que ces deux méthodes sont conçues pour le cas où les récompenses changent brusquement, comme c'est le cas ici, mais seulement un nombre restreint de fois pendant la durée de l'expérience, ce qui n'est pas vérifié ici puisque des changements se produisent à chaque itération. Dans la seconde expérience (\textbf{XP2}), l'algorithme \texttt{Recurrent TS} avec couche cachée obtient également de meilleures performances que n'importe quelle autre politique, ce qui nous permet de confirmer que notre algorithme est capable d'extraire des relations entre les actions depuis un espace de dimension réduite. Enfin, ses performances augmentent avec le nombre de dimensions de l'espace caché. Cependant, même si le taux d'amélioration entre $d=5$ et $d=10$ (ou entre $d=10$ et $d=20$) est élevé, nous remarquons qu'il diminue ensuite et atteint une limite lorsque $d=30$. \begin{figureth} \includegraphics[width=0.8\linewidth]{RecurrentTSSimulationK30T1000.pdf} \caption[Gain final simulation \texttt{Recurrent TS} $K=30$ données artificielles relationnelles.]{Gain cumulé final en fonction du nombre de bras sélectionnés à chaque itération sur données artificielles avec $K=30$.} \label{fig:RecurrentTSK30} \end{figureth} \begin{figureth} \includegraphics[width=0.8\linewidth]{RecurrentTSSimulationK200T10000.pdf} \caption[Gain final simulation \texttt{Recurrent TS} $K=200$ données artificielles relationnelles.]{Gain cumulé final en fonction du nombre de bras sélectionnés à chaque itération sur données artificielles avec $K=200$.} \label{fig:RecurrentTSK200} \end{figureth} \subsection{Données artificielles périodiques} \subsubsection{Protocole} Nous venons de voir que les algorithmes proposés dans ce chapitre sont en mesure de retrouver les relations existantes entre les différentes actions lorsque les données ont été générées selon un modèle relationnel récurrent. Nous proposons dans cette section d'étudier le comportement de notre algorithme dans un scénario ou les données ne sont pas directement générées par le modèle de la section \ref{modRecurrent}. \textbf{Génération des données:} Le modèle étudié considère une périodicité dans le comportement des différentes actions. On se place sur un horizon de $T=10000$ itérations et on prend un ensemble de $K=200$ actions. On découpe l'horizon en 100 cycles de 100 itérations chacun. On découpe chaque cycle en 4 périodes de 25 itérations. Pour chaque action $i$, on tire aléatoirement une moyenne $\mu_{i}$ entre 0 et 1, et un entier $j_{i}\in \left\{1,2,3,4\right\}$. Les récompenses sont ensuite générées de la façon suivante: à chaque temps $t\in \left\{1,...,T\right\}$, on calcule $j$, la période dans laquelle se trouve $t$. Pour chaque action $i$, si $j_{i}=j$ on génère une récompense $r_{i,t}$ selon une loi gaussienne de moyenne $\mu_{i}$ et de variance 1. Si $j_{i}\neq j$ on fixe une récompense nulle, c'est-à-dire $r_{i,t}=0$. Afin d'illustrer ce processus, nous représentons les récompenses générées pour un sous-ensemble de 7 actions sur 500 itérations dans la figure \ref{fig:SimProcessK200}, où l'on voit bien apparaître les différentes fenêtres pour chaque action. Nous souhaitons étudier dans quelle mesure le modèle avec couche cachée est capable de retrouver une structure de ce type dans les données sans avoir besoin de modéliser explicitement les différentes périodes. \begin{figureth} \includegraphics[width=0.6\linewidth]{SimulationK200T10000Period4.pdf} \caption[Echantillon de données artificielles périodiques.]{Illustration des récompenses produites au cours du temps pour 7 actions (parmi 200), sur 500 itérations.} \label{fig:SimProcessK200} \end{figureth} \textbf{Politiques testées:} Nous proposons d'étudier les performances de notre algorithme par rapport aux politiques décrites plus haut, à savoir: \texttt{Random}, \texttt{UCB}, \texttt{UCBV}, \texttt{TS classique}, \texttt{Discount UCB} et \texttt{Sliding Window UCB}. Pour les algorithmes \texttt{Discount UCB} et \texttt{Sliding Window UCB}, étant donné que le nombre de changements d'espérance pour chaque action sur l'horizon de l'expérience vaut $\gamma_{T}=200$, on fixe la valeur du facteur de \textit{discount} à 0.96 et celle de la fenêtre glissante à 42, afin de respecter les recommandations de la section précédente. Pour l'algorithme avec couche cachée, nous choisissons une fenêtre de temps de taille $S=100$ itérations et un total $nbIt=10$. Nous testons différentes valeurs de $d\in \left\{ 1, 2 ,4 \right\}$. De plus, afin de valider l'utilité d'utiliser une mémoire (voir note sur la complexité de l'algorithme dans la section \ref{sectionalgoHiddenState}) pour l'apprentissage des distributions nous testons différents cas, à savoir: \\ - avec mémoire sur les $(W_{i},b_{i})$ et avec mémoire sur les $\theta_{j}$;\\ - avec mémoire sur les $(W_{i},b_{i})$ et sans mémoire sur les $\theta_{j}$;\\ - sans mémoire sur les $(W_{i},b_{i})$ et sans mémoire sur les $\theta_{j}$;\\ - sans mémoire sur les $(W_{i},b_{i})$ et avec mémoire sur les $\theta_{j}$. \subsubsection{Résultats} \begin{comment} \textbf{Résultats préliminaires:} Avant d'expérimenter les différentes politiques, nous souhaitons étudier le comportement du modèle en mesurant sa capacité à prédire les récompenses à un instant $t$ en fonction des informations disponibles à jusqu'au temps $t-1$. En d'autres termes à chaque instant $t$, nous réalisons un apprentissage des paramètres en utilisant $\left\{r_{i,s}, i\in\left\{1,...,K\right\}, s\in \left\{1,...,t-1\right\}\right\}$ et on évalue l'erreur de prédiction faite par le modèle au temps $t$. On utilise la RMSE (\textit{root mean square error}) entre les valeurs prédites et les valeurs réelles comme mesure d'évaluation, à savoir: \[ err_{t}=\sqrt{\dfrac{1}{K}\sum\limits_{i=1}^{K}(r_{i,t}-(W_{i}^{\top}\Theta h_{t-1}+b_{i}))^{2}} \] où les valeurs des paramètres sont prises égales à leur moyenne apprise après 10 passes du processus variationnel, ce qui équivaut à prendre le MAP (maximum \textit{a posteriori}). On choisit dans cette étude un nombre de couches cachées de 4. De plus, afin de nous rapprocher de notre scénario de bandit, dans lequel toutes les données d'apprentissage ne sont pas disponibles, nous effectuons également cette expérimentation en ne laissant qu'un certain pourcentage de données disponibles. Finalement, dans tous les cas, on se compare à un modèle ne prenant en compte qu'un terme de biais par action. Nous présentons les résultats en termes de RMSE cumulée jusqu'au temps $T$ dans le tableau \ref{tab:RMSEHidden}. \begin{tableth} \begin{tabular}{|c|c|c|} \hline \textbf{Pourcentage de données utilisées} & \textbf{Avec seulement un biais} & \textbf{Avec couches cachées}\\ \hline 100\% & 265.22 & 132.01 \\ \hline 80\% & 265.23 & 140.97\\ \hline 50\% & 265.25 & 162.45\\ \hline 30\% & 265.28 & 205.75\\ \hline 20\% & 265.43 & 242.27\\ \hline 10\% & 266.16 & 245.55\\ \hline \end{tabular} \caption[RMSE cumulée des différents modèles sur données artificielles.]{RMSE cumulée des différents modèles en fonction de la part de données visibles sur le jeu de données artificielles.} \label{tab:RMSEHidden} \end{tableth} Il apparaît que le modèle ne prenant en compte que des termes de biais ne se détériore pas de façon significative à mesure que la part de données disponibles pour l'apprentissage baisse. Ceci est dû au fait que ce dernier n'apprend qu'un seul paramètre par action. D'autre part, le modèle avec couches cachées offre de bien meilleurs résultats que ce dernier, même lorsque le nombre de données utilisées diminue. Cependant, en dessous de 10\% de récompenses visibles, l'utilité d'utiliser des couches cachées est de moins en moins prononcée, car on arrive à des performances proches de la méthode n'utilisant que des biais. \end{comment} \textbf{Résultats préliminaires:} Avant d'expérimenter les différentes politiques, nous souhaitons étudier le comportement du modèle en mesurant sa capacité à retrouver les différents cycles présents dans les données. La figure \ref{fig:hiddelLayersEvolution} représente l'évolution de la valeur moyenne des couches cachées sur 500 itérations et pour différents nombres de passes de l'algorithme itératif variationnel, en considérant l'ensemble des données. On observe une évolution qui tend à se stabiliser au bout de la dixième passe. Il apparaît clairement qu'une certaine structure est découverte par le modèle, des motifs périodiques se détachant nettement sur les différentes dimensions. Nous souhaitons maintenant vérifier que dans le scénario du bandit qui nous intéresse, notre approche est en mesure de récolter de bonnes récompenses. \begin{figureth} \begin{subfigureth}{0.33\textwidth} \includegraphics[width=\linewidth]{HiddenAfter1Step.pdf} \caption{1 passe} \end{subfigureth} \begin{subfigureth}{0.33\textwidth} \includegraphics[width=\linewidth]{HiddenAfter2Step.pdf} \caption{2 passes} \end{subfigureth} \begin{subfigureth}{0.33\textwidth} \includegraphics[width=\linewidth]{HiddenAfter3Step.pdf} \caption{3 passes} \end{subfigureth} \begin{subfigureth}{0.33\textwidth} \includegraphics[width=\linewidth]{HiddenAfter10Step.pdf} \caption{10 passes} \end{subfigureth} \caption[Couches cachées avec $K=200$ et données artificielles périodiques: première expérimentation.]{Evolution des valeurs des différentes couches cachées au cours du temps pour $d=4$ sur un horizon de 500 itérations.} \label{fig:hiddelLayersEvolution} \end{figureth} \textbf{Performances des différentes politiques:} Premièrement, il est clairement apparu que l'utilisation d'une mémoire est importante dans ce scénario. En effet, nous avons observé que la version de l'algorithme \texttt{Recurrent TS} offrant les meilleurs résultats est celle qui utilise à la fois la mémoire sur les $(W_{i},b_{i})$ et les $\theta_{j}$. Ceci est illustré dans la figure \ref{fig:effectMemory}, où l'on représente le gain final obtenu par la politique \texttt{Recurrent TS d=4} lorsque $k=50$, dans les quatre configurations proposées plus haut ("true" signifie que la mémoire a été activée et "false" signifie que non). Il est également apparu que la mémoire sur les $(W_{i},b_{i})$ a plus d'impact que celle sur les $\theta_{j}$. Ceci est dû au fait que l'apprentissage des paramètres $\theta_{j}$ est mutualisé entre tous les bras, tandis que $(W_{i},b_{i})$ est propre à chaque action $i$. Ainsi, si une action n'est pas sélectionnée pendant $S$ itérations et que la mémoire sur les $(W_{i},b_{i})$ n'est pas active, toute l'information la concernant est perdue. \begin{figureth} \includegraphics[width=0.6\linewidth]{RecurrentTSSimulationK200T10000_k50_d4MemoryBarPlot.pdf} \caption[Effet de la mémoire sur les performances de \texttt{Recurrent TS}.]{Effet de la mémoire sur les performances de \textit{Recurrent TS}: représentation du gain final obtenu pour les quatre configurations proposées avec $k=50$.} \label{fig:effectMemory} \end{figureth} Nous présentons maintenant les résultats en terme de gain cumulé final (c'est-à-dire au temps $t=T$) pour chaque politique dans la figure \ref{fig:RecurrentTSK200Bis} en fonction du nombre d'actions sélectionnées $k$ (pour l'algorithme avec couches cachées, on illustre la version avec mémoire). La première chose que l'on remarque est la présence d'une sorte de plateau à $k=50$. Ceci est dû au fait que l'on a 200 actions au total et 4 périodes. Comme chaque action n'a une récompense non nulle que pendant une des quatre périodes, à chaque itération on a en moyenne 150 actions qui ont une récompense nulle. On remarque que les politiques de bandit non stationnaire \texttt{Discount UCB} et \texttt{Sliding Window UCB} ne se démarquent des politiques de bandit stationnaire \texttt{UCB}, \texttt{UCBV} et \texttt{TS classique} que lorsque $k$ est suffisamment grand (au-delà de 100). Toutes ces politiques apparaissent moins performantes que la politique \texttt{Recurrent TS}, du moins lorsque $d=2$ et $d=4$. Lorsque $d=1$ les résultats sont plus mitigés, mais nous arrivons tout de même à être performants sur une plage de $k$ entre 50 et 100. De plus, les performances de \texttt{Recurrent TS} sont plus élevées avec $d=4$ qu'avec $d=2$. Nous avons cependant observé qu'augmenter le nombre de dimensions au-delà de 4 ne permet pas d'améliorer les performances de l'algorithme. Ceci s'explique par le fait que 4 variables sont suffisantes pour reconstruire la structure périodique des récompenses (comme le suggère la figure \ref{fig:hiddelLayersEvolution}). \begin{figureth} \includegraphics[width=0.8\linewidth]{RecurrentTSSimulationK200T10000Bis.pdf} \caption[Gain final simulation \texttt{Recurrent TS} $K=200$ données artificielles périodiques: première expérimentation.]{Gain cumulé final en fonction du nombre de bras sélectionnés sur données artificielles avec $K=200$ et des récompenses périodiques.} \label{fig:RecurrentTSK200Bis} \end{figureth} \begin{note}[Expérimentation avec des cycles plus complexes] Afin de nous assurer de la capacité du modèle à détecter des variations de récompenses périodiques, nous avons également expérimenté celui-ci sur des données où chacune des 200 actions possède une dynamique plus singulière. Plutôt que d'avoir un socle commun de 4 périodes de 25 itérations, nous autorisons chaque action $i$ à avoir son propre cycle de $per_{i}$ périodes de $it_{i}$ itérations. Ces valeurs sont tirées aléatoirement pour chaque action, respectivement dans les ensembles $\left\{2,3,4,5\right\}$ et $\left\{10,20,30,40\right\}$. On représente l'évolution des valeurs des couches cachées pour $d=10$ dans la figure \ref{fig:XPSimPeriodRandomHiddenState}. On voit très nettement apparaître des formes cycliques de différentes tailles, ce qui nous pousse à penser que le modèle est en mesure de retrouver une certaine structure dans les données. La dynamique apparaît cependant plus complexe à détecter, car beaucoup plus de paramètres sont en jeu. Finalement, la figure \ref{fig:RecurrentTSK200BisBis} représente les récompenses finales obtenue par différentes politiques en fonction de $k$. A nouveau, notre algorithme permet d'obtenir de meilleurs résultats que ses compétiteurs lorsque $d$ est suffisamment élevé (à partire de $d=4$). \end{note} \begin{figureth} \includegraphics[width=0.7\linewidth]{HiddenAfter21StepsBis.pdf} \caption[Couches cachées avec $K=200$ et données artificielles périodiques: seconde expérimentation.]{Evolution des valeurs des différentes couches cachées au cours du temps pour $d=10$ sur un horizon de 1000 itérations lorsque les périodes des différentes actions peuvent être différentes et se chevaucher.} \label{fig:XPSimPeriodRandomHiddenState} \end{figureth} \begin{figureth} \includegraphics[width=0.8\linewidth]{RecurrentTSSimulationK200T10000BisBis.pdf} \caption[Gain final simulation \texttt{Recurrent TS} $K=200$ données artificielles périodiques: seconde expérimentation]{Gain cumulé final en fonction du nombre de bras sélectionnés sur données artificielles avec $K=200$ et des récompenses périodiques (avec chevauchement des périodes).} \label{fig:RecurrentTSK200BisBis} \end{figureth} \begin{note}[Modèle relationnel sur données cycliques] Nous terminons ce jeu d'expérimentations par un test de notre approche relationnelle (c.à.d. sans couche cachée), uniquement utilisable lorsque le nombre d'actions est faible, sur des données cycliques. Pour cela, nous générons des données périodiques de la même façon que précédemment (sans chevauchement, avec 4 périodes de 25 itérations), avec $K=30$ et $T=1000$. Le gain final cumulé en fonction du nombre de bras sélectionnés est présenté dans la figure \ref{fig:RecurrentTSK30Period4} pour différentes politiques. Si comme précédemment, notre approche utilisant des états cachés est la plus performante, il apparaît que l'approche sans couche cachée ne parvient pas à surpasser les performances des algorithmes de bandit stationnaire tel que \texttt{CUCB}. Cela s'explique par le fait que le modèle que l'approche relationnelle cherche à reconstruire considère chaque récompense comme un somme pondérée de toutes les précédentes, ce qui n'est pas le cas ici étant donné le processus de génération des données utilisé. \end{note} \begin{figureth} \includegraphics[width=0.8\linewidth]{RecurrentTSSimulationK30T1000Period4.pdf} \caption[Gain final simulation \texttt{Recurrent TS} données artificielles périodiques.]{Gain cumulé final en fonction du nombre de bras sélectionnés sur les données artificielles avec $K=30$ et des récompenses périodiques (sans chevauchement des périodes).} \label{fig:RecurrentTSK30Period4} \end{figureth} \subsection{Données réelles} \subsubsection{Etude préliminaire} Face au nombre élevé d'utilisateurs ($K=5000$) dans les différents jeux de données utilisés précédemment et au temps d'exécution des différentes expérimentations, nous avons fait le choix de n'utiliser que 500 utilisateurs sur les 5000 présents au total dans chaque base. Ces 500 comptes sont sélectionnés en amont de façon aléatoire et uniforme. De plus, au vu des résultats obtenus sur données artificielles, qui montrent que d'une façon générale les performances se détériorent à mesure que le $k$ diminue, nous choisissons de fixer le nombre d'utilisateurs pouvant être sélectionnés simultanément à 50. Nous sommes donc dans une situation où $K=500$ et $k=50$, c'est-à-dire où un dixième des actions peuvent être sélectionnées à chaque itération. De nombreux essais ont été effectués en utilisant un grand ensemble de jeux de paramètres, mais ne nous ont pas permis d'obtenir de meilleures performances que des algorithmes de bandit stationnaire (comme \texttt{UCB}, \texttt{UCBV} ou \texttt{TS classique}) pour les récompenses utilisées dans les chapitres précédents. En vue d'obtenir de meilleurs résultats, nous avons décidé d'augmenter la taille de la fenêtre d'écoute, précédemment d'une valeur de 100 secondes. En effet, cette valeur nous est apparue relativement faible dans un contexte ou l'on souhaite capter un certain nombre de régularités grâce au modèle récurrent. Dans cette optique, nous avons augmenté la période d'écoute pour la fixer à 30 minutes en vue de lisser les récompenses produites par les différents comptes. Grâce à cette première étape, les cycles potentiels dans les comportements des utilisateurs auront plus de chance d'être détectés par le modèle. Après de nombreux essais, nous ne sommes toujours pas parvenus à atteindre des performances satisfaisantes. Afin de mieux comprendre ces résultats, nous proposons d'étudier un cas, à savoir le jeu de données \textit{OlympicGames} et la thématique \textit{Science}\footnote{Les résultats présentés ici sont également valables pour les autres bases de données et les autres thématiques.}. Afin de mesurer la capacité maximale du modèle récurrent avec couches cachées à récolter des récompenses élevées au cours du temps, nous considérons une politique optimale, sélectionnant à chaque itération $t$ les 50 utilisateurs ayant les plus fortes valeurs $W_{i}^{\top}\Theta h_{t-1} + b_{i}$, où les valeurs des différents paramètres sont apprises en amont sur le jeu de données, selon différents pourcentages de données disponibles. Nous testons différentes valeurs de $d \in \left\{ 5,10,20\right\}$ et nous comparons à un modèle optimal n'utilisant que des biais (ce qui correspond à la politique optimale stationnaire). Nous fixons les écart-types des vraisemblances du modèle à $\sigma=\delta=0.1$ et les écart-types des distributions \textit{a priori} à $\alpha=\gamma=1.0$, ces valeurs offrant les meilleures résultats en moyenne. Il est ainsi possible de mesurer dans quelle mesure l'algorithme \texttt{Recurrent TS} peut offrir de meilleures performances que des algorithmes de bandit stationnaire selon les conditions expérimentales. Intuitivement, la part de données disponibles aura une influence directe sur la qualité des paramètres appris en amont. Le tableau \ref{tab:rwdOptScienceOGK500T1800} reporte les valeurs de récompenses finales obtenues par ces différentes politiques, où $d=0$ désigne la politique n'utilisant que des biais. Premièrement, nous remarquons que lorsque toutes les données sont disponibles (ligne 100\%), les performances augmentent avec le nombre de dimensions $d$. Par ailleurs, toujours dans cette configuration, le surplus de récompense obtenu avec $d=20$ par rapport à la politique optimale stationnaire ($d=0$) est d'environ 9\%, ce qui peut paraître assez faible. Lorsque le pourcentage de données disponibles diminue, nous observons que les performances des politiques utilisant des couches cachées se dégradent considérablement. Ce phénomène est d'autant plus marqué que le nombre de dimensions est grand. En revanche, les performances de la politique stationnaire sont beaucoup plus stables. Ceci semble cohérent puisque cette dernière a beaucoup moins de paramètres à apprendre. Finalement, lorsque seulement 10\% des données sont utilisées, ce qui correspond en moyenne à 50 (500$\times$0.1) valeurs par itération, l'utilisation d'un modèle avec couches cachées ne semble plus pertinente puisque l'on obtient des résultats pratiquement identiques à ceux d'un modèle stationnaire plus simple. Or, ce cas correspond à notre scénario, dans lequel $k=50$. Ainsi, les meilleurs résultats pouvant être obtenus avec notre algorithme ne sont pas supérieurs aux meilleurs résultats pouvant être obtenus avec un algorithme de bandit traditionnel. Cette analyse nous permet d'apporter une première explication au fait que nous ne sommes pas parvenus à obtenir des performances satisfaisantes précédemment. \begin{tableth} \begin{tabular}{|c|c|c|c|c|} \hline \textbf{\% données utilisées} & \textbf{Opt. d=0 (uniq. biais)} & \textbf{Opt. d=5}& \textbf{Opt. d=10}& \textbf{Opt. d=20}\\ \hline 100\% & 50378 & 51056 & 53735 & 55220 \\ \hline 80\% & 50304 & 51051 & 53264 & 54365 \\ \hline 50\% & 50201 & 50754 & 52007 & 52376 \\ \hline 30\% & 50123 & 50341 & 50609 & 512016 \\ \hline 20\% & 50048 & 49642 & 50019 & 50213 \\ \hline 10\% & 49923 & 49629 & 48976 & 49327\\ \hline \end{tabular} \caption[Récompense finale politiques optimales avec différentes valeurs de $d$, $k=50$ avec \textit{Science}+\textit{OlympicGames}.]{Récompense finale obtenue avec les politiques optimales pour différentes valeurs de $d$ et $k=50$ selon le pourcentage de données accessibles lors de l'apprentissage pour la thématique \textit{Science} et le jeu de données \textit{OlympicGames}.} \label{tab:rwdOptScienceOGK500T1800} \end{tableth} Pour mieux comprendre les raisons de ce phénomène, nous représentons dans la figure \ref{fig:HiddenScienceK500T1800} les valeurs des différentes couches cachées (après convergence) sur 500 itérations lorsque $d=5$ et que toutes les données sont disponibles. Bien que certains pics soient visibles par endroits, les valeurs prises par $h_{t}$ sont nulles la plupart du temps. Ainsi nous avons $W_{i}^{\top}\Theta h_{t-1} + b_{i} \approx b_{i}$ et la majorité des éléments appris par le modèle se situe dans les termes de biais. Cette remarque nous conforte dans le fait que l'utilisation du modèle proposé dans ce chapitre sur ces données n'est pas pertinente. Au vu de ces résultats, nous proposons dans la section suivante un autre modèle de récompense pour évaluer le modèle sur des données réelles possédant une structure plus explicite. \begin{figureth} \includegraphics[width=0.6\linewidth]{HiddenAfter10StepBisScience.pdf} \caption[Evolution couches cachées \textit{Science} + \textit{OlympicGames} ]{Evolution des valeurs des différentes couches cachées au cours du temps pour $d=5$ sur un horizon de 500 itérations, la thématique \textit{Science} et le jeu de données \textit{OlympicGames}.} \label{fig:HiddenScienceK500T1800} \end{figureth} \subsubsection{Seconde expérimentation} Nous utilisons le jeu de données \textit{OlympicGames}, et comme précédemment un sous-ensemble de $K=500$ utilisateurs et des fenêtres d'écoute de 30 minutes. Nous choisissons également de fixer le nombre d'utilisateurs pouvant être sélectionnés simultanément à $k=50$. \textbf{Modèle de récompense: }Nous proposons un modèle de récompense plus simple dans lequel un utilisateur produit une récompense égale à 1 s'il publie au moins un contenu durant la période d'écoute considérée, indépendamment du contenu. Lorsqu'un utilisateur ne publie pas, la récompense associée vaut 0. L'objectif est alors de retrouver des cycles d'activité, afin d'identifier à chaque itération les utilisateurs les plus susceptibles des produire du contenu. Ce type de collecte permet l'observation de plus de récompenses non nulles, ce qui permet d'espérer un meilleur apprentissage des dynamiques en jeu. \textbf{Résultats préliminaires: }Le tableau \ref{tab:rwdOptisTalkOG} présente les résultats d'une étude similaire à celle menée dans la section précédente sur les politiques optimales. Nous remarquons également que les performances des politiques optimales sont d'autant plus élevées que le nombre de couches cachées est grand lorsque toutes les données sont disponibles pour l'apprentissage des paramètres. Dans ce cas, on atteint une amélioration d'environ 30\% en utilisant notre modèle par rapport à une politique optimale stationnaire. Bien que ces résultats se détériorent lorsque le pourcentage de données visibles baisse (sauf pour $d=0$ qui est toujours stable), nous remarquons que, contrairement à l'étude précédente, même lorsque l'on n'a que 10\% de données disponibles, l'utilité d'utiliser le modèle récurrent est notable. Nous remarquons aussi que dans ce cas, l'utilisation d'un nombre $d$ élevé n'est pas la meilleure solution. En effet, il apparaît que les modèles avec $d=5$ et $=10$ sont plus stables que le modèle avec $d=20$ quand le nombre de données utilisées diminue. Nous expliquons cela par le fait que ce dernier possède trop de paramètres à apprendre. Les résultats obtenus favorisent l'idée que l'algorithme \texttt{Recurrent TS} pourrait fonctionner plus efficacement que ses compétiteurs stationnaires. \begin{tableth} \begin{tabular}{|c|c|c|c|c|} \hline \textbf{\% données utilisées} & \textbf{Opt. d=0 (uniq. biais)} & \textbf{Opt. d=5}& \textbf{Opt. d=10}& \textbf{Opt. d=20}\\ \hline 100\% & 30039 & 41866 & 42999 & 43795 \\ \hline 80\% & 30017 & 41813 & 42846 & 43560 \\ \hline 50\% & 29900 & 41569 & 42448 & 42746 \\ \hline 30\% & 29723 & 40748 & 41429 & 41357 \\ \hline 20\% & 29688 & 39968 & 40085 & 39588 \\ \hline 10\% & 29271 & 38015 & 37459 & 36024 \\ \hline \end{tabular} \caption[Récompense finale politiques optimales avec différentes valeurs de $d$, $k=50$ avec le nouveau modèle de récompense.]{Récompense finale obtenue avec les politiques optimales pour différentes valeurs de $d$ et $k=50$ selon le pourcentage de données accessibles lors de l'apprentissage pour le nouveau modèle de récompense et le jeu de données \textit{OlympicGames}.} \label{tab:rwdOptisTalkOG} \end{tableth} La figure \ref{fig:HiddenisTalkT1800US} représente l'évolution des couches cachées pour $d=5$ sur 500 itérations et après convergence du modèle. Non seulement les valeurs ne sont pas nulles, mais on voit clairement apparaître des cycles de périodicité différentes. Ce dernier élément nous conforte dans l'idée que les données possèdent une certaine structure, dont l'algorithme \texttt{Recurrent TS} pourrait tirer parti. Nous proposons donc de tester cette approche dans un scénario de bandit. \begin{figureth} \includegraphics[width=0.6\linewidth]{HiddenAfter15StepisTalkUS.pdf} \caption[Evolution couches cachées pour le nouveau modèle de récompense et le jeu de données \textit{OlympicGames}]{Evolution des valeurs des différentes couches cachées au cours du temps pour $d=5$ sur un horizon de 500 itérations pour le nouveau modèle de récompense et le jeu de données \textit{OlympicGames}.} \label{fig:HiddenisTalkT1800US} \end{figureth} \textbf{Politiques testées: }En vue de mesurer les performances de l'approche proposée dans ce chapitre, nous nous comparons à divers algorithmes de bandits stationnaires et non stationnaires, à savoir: \texttt{Random}, \texttt{CUCB}, \texttt{CUCBV}, \texttt{TS classique}, \texttt{Discount UCB} et \texttt{Sliding Window UCB}. Pour chacun de ces algorithmes, nous avons fixer les différents paramètres - lorsqu'ils en ont - à leurs valeurs optimales, c'est-à-dire celle offrant la meilleure récompense cumulée \textit{a posteriori}. En particulier pour \texttt{TS classique}, des valeurs de variance de la vraisemblance relativement faible de l'ordre de 0.01, favorisant l'exploitation, semblent mieux adaptées. Pour \texttt{Sliding Window UCB}, la taille de la fenêtre glissante optimale est de 200 itérations, et pour \texttt{Discount UCB}, la valeur optimale se situe proche de 1, correspondant à un \texttt{UCB} classique. Pour l'approche \texttt{Recurrent TS}, nous fixons les écarts-types des vraisemblances du modèle à $\sigma=\delta=0.1$ et les écarts-types des distributions \textit{a priori} à $\alpha=\gamma=1.0$ (pour les mêmes raisons que dans la section précédente). Nous utilisons par ailleurs la fonction de mémoire, conformément aux résultats observés sur données artificielles, avec une fenêtre glissante de 100 itérations. \textbf{Résultats: }La figure \ref{fig:resisTalkOGT1800K500} représente l'évolution du gain cumulé en fonction du temps pour les différentes politiques testées. Nous observons clairement que la politique \texttt{Recurrent TS} offre de meilleurs résultats que toutes ses compétitrices pour $d=5$ et $d=10$. En revanche, lorsque $d=20$, les performances se dégradent considérablement, pour atteindre le niveau des approches stationnaires, qui obtiennent toutes des résultats comparables (avec un léger avantage pour l'algorithme \texttt{CUCB}). L'algorithme de bandit non stationnaire \texttt{Sliding Window UCB} est quant à lui le plus efficace\footnote{Nous ne représentons pas explicitement \texttt{Discount UCB} puisqu'il est équivalent à \texttt{UCB} lorsque le facteur de \textit{discount} vaut 1.}. Finalement, les résultats obtenus dans un scénario de bandit confirme ceux de l'étude préliminaire puisque notre modèle est en mesure de surpasser toutes les autres approches sur ce type de problème lorsque l'on considère un nombre de dimensions limité. Plus d'itérations seraient sans doute nécessaires à l'apprentissage des paramètres lorsque $d>10$. \begin{figureth} \includegraphics[width=0.8\linewidth]{resIsTalkOGK500T1800.pdf} \caption[Gain cumulé en fonction du temps pour le scénario de collecte sur le jeu de données \textit{OlympicGames} avec le nouveau modèle de récompense.]{Gain cumulé en fonction du temps pour le scénario de collecte sur le jeu de données \textit{OlympicGames} avec le nouveau modèle de récompense. } \label{fig:resisTalkOGT1800K500} \end{figureth} \begin{comment} \begin{tableth} \begin{tabular}{|c|c|c|} \hline \textbf{\% données utilisées} & \textbf{Avec seulement un biais} & \textbf{Avec couches cachées}\\ \hline 100\% & 1684.62 & 1668.12 \\ \hline 80\% & 1685.15 & 1670.50\\ \hline 50\% & 1686.81 & 1665.23\\ \hline 30\% & 1689.98 & 1830.62\\ \hline 20\% & 1701.56 & 1801.21\\ \hline 10\% & 1705.06 & 1850.97\\ \hline \end{tabular} \caption[RMSE cumulée des différents modèles sur données réelles.]{RMSE cumulée des différents modèles en fonction de la part de données visibles sur les données réelles.} \label{tab:RMSEHiddenRealData} \end{tableth} \begin{figureth} \includegraphics[width=0.6\linewidth]{HiddenAfter15StepisTalkOG.pdf} \caption[Simulation \texttt{Recurrent TS} $K=200$ récompenses réelles avec périodes plus complexes.]{Gain cumulé final en fonction du nombre de bras sélectionnés à chaque itération sur données artificielles avec $K=200$ et des récompenses réelles périodiques plus complexes.} \label{fig:HiddenisTalkT1800OG} \end{figureth} \end{comment} \section{Conclusion} Dans ce chapitre, nous avons proposé un premier modèle de bandit récurrent dans lequel chaque action a la possibilité d'agir sur les autres d'une itération à l'autre, en vue de modéliser des phénomènes d'influence entre utilisateurs. Nous avons proposé un algorithme de Thompson sampling pour résoudre cette tâche, basé sur une approximation variationnelle des distributions des paramètres du modèle. Nous avons ensuite étudié un modèle utilisant une représentation intermédiaire cachée, au sein de laquelle on modélise des transitions entre états successifs, en vue de capter des dépendances temporelles plus complexes. Nous avons montré que ce dernier offre en outre l'avantage de pouvoir être utilisé lorsque le nombre d'actions est élevé. Les diverses expérimentations effectuées sur données artificielles ont révélé l'efficacité des diverses méthodes. En particulier, lorsque le nombre d'actions devient grand, l'utilisation du modèle comportant des représentations cachées est en mesure de capter divers types de structures au sein des récompenses. Ce modèle semble en outre bien adapté à la détection de structures périodiques. Nous avons ensuite expérimenté notre méthode sur des données réelles de réseaux sociaux. Les mauvaises performances de cette approche en considérant les récompenses utilisées dans les chapitres précédent nous ont menés à conduire une étude plus précise afin d'apporter des éléments explicatifs. Finalement, une modification des récompenses considérées a permis de montrer la validité de notre approche dans un contexte de collecte d'information en temps réel. Pour améliorer les performances dans un cadre plus large, il serait envisageable d'inclure dans le modèle une prise en compte de contextes observés (tels que dans le chapitre précédent), afin de disposer de plus d'information pour estimer les données manquantes du problème de collecte. \chapter{Conclusions et perspectives} \section{Conclusions} Au cours de ce travail de thèse, nous avons étudié le problème de la collecte de données en temps réel dans les médias sociaux. En raison des différentes limitations imposées par ces médias, mais aussi de la quantité très importante de données, nous sommes partis du principe que la collecte de la totalité des contenus produits n'est pas envisageable. Par conséquent, pour être en mesure de récolter des informations pertinentes, relativement à un besoin prédéfini, il est nécessaire de se focaliser sur un sous-ensemble des données existantes. En considérant chaque utilisateur comme une source de données pouvant être écoutée à chaque itération d'un processus de capture, nous avons modélisé la tâche de collecte comme un problème de bandit, dans lequel la qualité de l'information produite par un utilisateur correspond à une récompense. La notion de qualité peut être définie de diverses façons, selon le type d'information devant être récolté, et dépend de chaque application. Afin de cadrer l'étude, nous avons proposé divers modèles de récompense prenant en compte à la fois la thématique, mais aussi les réactions suscitées (\textit{Retweet} par exemple) par un contenu pour en mesurer sa qualité. Nous avons proposé plusieurs modèles de bandit visant à identifier en temps réel les utilisateurs les plus pertinents. Dans une première contribution (chapitre \ref{ModeleStationnaire}), le cas du bandit dit stochastique, dans lequel chaque utilisateur est associé à une distribution de probabilité stationnaire, a été étudié. Ce travail a permis de montrer la pertinence d'utiliser le formalisme du bandit pour notre tâche de collecte en temps réel. De plus, nous avons proposé un nouvel algorithme ainsi qu'une analyse théorique du regret associé. Par la suite, nous avons étudié deux modèles de bandit contextuel, l'un stationnaire (chapitre \ref{ModeleContextuelFixe}) et l'autre non stationnaire (chapitre \ref{ModeleContextuelVariable}), dans lesquels l'utilité de chaque utilisateur peut être estimée de façon plus efficace en supposant une certaine structure, permettant ainsi de mutualiser l'apprentissage. En particulier, la première approche introduit la notion de profil, qui correspond au contenu moyen produit par chaque compte. Ces derniers n'étant pas accessibles, à cause des contraintes imposées par les médias sociaux, nous avons défini un nouveau problème de bandit dans lequel l'agent décisionnel doit effectuer une double exploration, mêlant incertitude sur les profils et incertitude sur les paramètres de régression considérés. Une analyse théorique de l'algorithme associé nous a permis de qualifier une borne supérieure de son regret. La seconde approche prend en compte l'activité d'un utilisateur à un instant donné pour prédire son comportement futur. Dans cette approche, une méthode d'inférence variationnelle a été utilisée afin de prendre en compte les limitations des APIs, et permettant une estimation des contextes manquants. Pour finir, nous nous sommes intéressés à la modélisation de dépendances temporelles entres utilités des différents utilisateurs. Deux types d'approches ont été proposées: un premier modèle considérant des dépendances linéaires entre récompenses de périodes d'écoute successives, et un second, faisant intervenir des hypothèses de transitions entre des états latents du système, afin de capturer les variations d'utilité des différents comptes. Pour chacune des approches étudiées, nous avons mené des expérimentations sur des données artificielles, mais aussi sur divers jeux de données réelles provenant de Twitter. Les modèles proposés aux chapitres \ref{ModeleStationnaire}, \ref{ModeleContextuelFixe} et \ref{ModeleContextuelVariable}, en modélisant les dynamiques en jeu de plus en plus finement, ont permis d'offrir des performances croissantes sur les jeux de données et modèles de récompenses proposés. Pour le modèle récurrent du chapitre \ref{ModeleRelationnel}, nous avons défini un modèle de récompense alternatif, répondant mieux aux hypothèses du modèle, afin de valider cette approche sur données réelles. \section{Perspectives} Les travaux effectués dans cette thèse ouvrent la voie à différentes perspectives, dont nous en énumérons certaines ci-dessous: \begin{itemize} \item \textbf{Modèle hybride: } Il aurait été intéressant de combiner l'ensemble des modèles proposés dans un unique modèle, prenant en compte à la fois des profils moyens, des contextes instantanés et des dépendances temporelles. Concrètement, l'utilité espérée d'un utilisateur à un instant donné pourrait se modéliser par une fonction des différentes composantes de chaque modèle. Dans ces conditions, l'élaboration d'un modèle probabiliste gaussien (du même type que ceux proposés aux chapitres \ref{ModeleContextuelVariable} et \ref{ModeleRelationnel}) permettrait de définir un algorithme de Thompson sampling utilisant des approximations variationnelles des véritables distributions \textit{a posteriori} des paramètres. Ce type de modèle, bien que nécessitant probablement des approximations supplémentaires pour l'apprentissage des paramètres, permettrait de modéliser d'une façon plus réaliste le comportement d'un utilisateur sur un média social, et donc d'améliorer les performances du processus de collecte. \item \textbf{Modèle récurrent: }Le modèle récurrent linéaire proposé dans le dernier chapitre pourrait être étendu en utilisant des relations temporelles plus complexes d'un pas de temps à l'autre, à l'instar des nombreux travaux existants sur les réseaux de neurones récurrents. Ceux-ci permettraient en outre de capter des relations plus abstraites, qu'un modèle linéaire peut difficilement modéliser. La difficulté majeure d'appliquer ces approches à des problèmes de bandit est double. D'une part, une grande partie de l'information permettant d'effectuer un apprentissage efficace est manquante, de par la nature du problème qui ne permet d'observer qu'un sous-ensemble restreint de la donnée. D'autre part, pour répondre au besoin d'exploration du processus de décision, il est nécessaire de maintenir soit des intervalles de confiance, soit des distributions sur les différents paramètres, afin de dériver les politiques respectivement optimistes et de Thompson sampling associées. Ceci peut s'avérer complexe lorsque des réseaux de neurones sont impliqués en raison des formes prises par les différentes fonctions d'activation. Un certain nombre de travaux, utilisant entre autres des méthodes variationnelles, existent à ce sujet et permettent d'approximer les distributions des paramètres (voir \cite{varAutoEnco} par exemple). Nous pensons que l'étude de ces méthodes pour des problèmes de bandit avec récompenses non stationnaires possédant des corrélations temporelles constituerait un travail intéressant. \item \textbf{Modèles de récompenses alternatifs: }Finalement, les récompenses utilisées tout au long de ce manuscrit sont relativement simples et pourraient également être étendues en vue de récolter des informations de nature plus complexe. Dans cette optique, il aurait été intéressant d'utiliser des fonctions de récompenses prenant en compte la diversité des contenus produits par les utilisateurs écoutés (voir \cite{banditCtxtCombLinUCB} pour des exemples de fonctions). La principale difficulté d'utiliser ce type de fonction vient de la combinatoire complexe qu'elles engendrent. En effet, la récompense d'un ensemble d'actions n'est alors plus égale à la somme des récompenses des actions individuelles, ce qui ne permet plus d'utiliser les algorithmes proposés dans ce manuscrit directement. \end{itemize} \chapter{Problèmes de bandits et algorithmes} \minitoc \newpage \label{EtatArt} \label{EtatArtBandit} Dans ce chapitre, nous introduisons le problème du bandit multibras (MAB en abrégé), que nous considérerons dans l'ensemble de cette thèse pour notre tâche de collecte de données en temps réel dans les réseaux sociaux. Nous commençons par une présentation générale du problème et des notations qui seront utilisées dans la suite. Nous nous intéressons ensuite à diverses instances particulières. Dans un premier temps, on présente le bandit stochastique, qui constitue le cas le plus étudié dans la littérature. Le bandit contextuel, qui considère la présence d'un contexte décisionnel, est ensuite présenté. On considère également l'extension de ces deux modèles au cas des sélections multiples. Nous présenterons ensuite brièvement les problèmes de bandit dans les graphes et ceux de bandit non stationnaire. Pour chacune de ces configurations, nous définissons la notion centrale de regret et présentons les principaux algorithmes de l'état de l'art. Notons que nous nous restreignons aux approches les plus populaires qui ne représentent pas l'intégralité de la multitude de variantes existantes \section{Problème générique et notations} \subsection{Position du problème} Le problème du bandit traite du compromis entre exploration et exploitation dans un processus de décision séquentielle dans lequel, à chaque pas de temps, un agent doit choisir une action parmi un ensemble de $K$ actions disponibles. A l'issue de ce choix, l'agent reçoit une récompense qui quantifie la qualité de l'action choisie. Le but de l'agent est de maximiser ses gains cumulés au cours du temps. Le terme "bandit" provient du monde des jeux de casino, dans lequel il désigne une machine à sous. Il modélise un joueur en face d'un certain nombre de machines, ayant la possibilité d'en jouer une chaque itération. Son but est évidemment de maximiser la somme de ses gains. Pour cela, le joueur doit trouver compromis entre l'\textbf{exploitation} des bonnes machines à sous et l'\textbf{exploration} de nouvelles, ou peu connues. Ce compromis représente le point central de tous les algorithmes de bandit. Plus précisément, il s'agit de trouver un équilibre entre: \begin{itemize} \item \textbf{Exploitation: } choisir les actions offrant des récompenses empiriques élevées; \item \textbf{Exploration: } choisir les actions moins connues afin de ne pas passer à côté d'actions potentiellement de bonne qualité. \end{itemize} En partant de ce principe générique, un grand nombre d'instances du problème de bandit ont été proposées et se distinguent de par les hypothèses faites sur les distributions des différentes récompenses. Le premier cas, le plus étudié dans la littérature, est nommé bandit stochastique et considère que les récompenses observées pour une action donnée proviennent d'une loi stationnaire et sont tirées de façon indépendante. L'étude de ce problème consitue cœur de la section \ref{SectionBanditStochastique}. D'autre part, dans le cas du bandit contextuel présenté en section \ref{SectionBanditContextuel}, les distributions de récompenses des différentes actions sont liées aux valeurs d'un vecteur de contexte décisionnel observé. Il est également possible de structurer les différentes actions à l'aide d'un graphe (voir section \ref{graphBanditEtatArt}) ou encore de se placer dans le cadre très large des récompenses non stationnaires (voir section \ref{nonstatBanditEtatArt}). Finalement, notons qu'un champ d'étude à part entière, nommé bandit adverse, concerne le cas où les récompenses sont choisies par un agent extérieur (adversaire). Plus de détails à ce sujet peuvent être trouvés dans \cite{nonStoBandit}, \cite{banditMOSS} et \cite{Bubeck2012}. \subsection{Notations} Dans cette partie, nous introduisons un ensemble de notations que nous utiliserons dans toute la suite du document. \begin{itemize} \item $\mathcal{K}$ désigne l'ensemble des $K$ actions disponibles à chaque instant; \item $i_{t}$ désigne l'action choisie à l'itération courante $t$; \item $r_{i,t}$ désigne la récompense produite par le bras (ou action) $i$ au temps $t$; \item $r_{t}$ est une notation simplifiée pour la récompense obtenue à l'instant $t$, c.-à-d. nous avons: $r_{t}=r_{i_{t},t}$; \end{itemize} De façon générique, un problème de bandit est un processus séquentiel dans lequel à chaque instant $t=1,2...,T$, un agent doit: \begin{enumerate} \item Choisir une action $i_{t} \in \mathcal{K}$ en fonction des choix passés; \item Recevoir la récompense $r_{t}$; \item Améliorer la stratégie de sélection grâce aux nouvelles observations. \end{enumerate} \subsection{Applications courantes} Les algorithmes de bandits trouvent de nombreuses applications dans des problèmes pratiques. En voici une liste non exhaustive: \begin{itemize} \item Placement de publicité en ligne: dans ce cas, chaque publicité correspond à une action. Le but est de sélectionner la publicité à présenter à chaque utilisateur d'un site internet en vue de maximiser le nombre de clics. Les bandits ont été appliqués à cette tâche avec succès dans \cite{banditAd} et \cite{UnbiasedEvaluationBanditCtxt}. \item Routage: considérons un réseau représenté par un graphe dans lequel on doit envoyer une séquence de paquets d'un nœud à un autre. Pour chaque paquet, on choisit un chemin à travers le graphe et le paquet en question met un certain temps à arriver à destination. En fonction du trafic, les temps de parcours peuvent changer et la seule information disponible est le temps de parcours sur le chemin choisi à un instant donné. L'objectif est de minimiser ce délai total pour la séquence de tous les paquets de données. Ce problème peut être vu comme un bandit, l'ensemble des bras étant l'ensemble des chemins entre les deux sommets que chaque paquet peut emprunter (cf. \cite{banditRouting}). \item Monte Carlo tree search: une application importante des algorithmes de bandits est le programme MoGo de \cite{banditUCT2} permettant de jouer au Go contre des humains professionnels. Avec une méthode de Monte-Carlo pour évaluer la valeur d'une position, il est possible de voir le problème du jeu de Go comme des bandits dans un arbre. Les auteurs abordent ce problème avec la célèbre stratégie \texttt{UCT} décrite dans \cite{banditUCT}. \item Allocation de chaîne dans les réseaux de téléphonie: lors d'une communication entre deux téléphones mobiles, l'opérateur peut changer le canal de communication plusieurs fois. Ici, l'ensemble des bras correspond à l'ensemble des canaux possibles et un pas de temps représente un intervalle de temps où le canal est fixe. Ainsi le but est de choisir les meilleurs canaux tout au long de la communication (cf. \cite{banditAllocation}). \item Optimisation de fonction sous contraintes: les travaux de \cite{banditOptimPreux} proposent d'appliquer le formalisme du bandit à l'optimisation de fonctions mathématiques. Dans ce cas, l'ensemble des actions possibles correspond au domaine de définition de la fonction à optimiser (une action=un point de l'espace) et la récompense associée correspond à la valeur de la fonction en ce point, le but étant de touver le point où la fonction à la valeur la plus élevée. \item Optimisation des paramètres d'un algorithme: considérons un algorithme avec un paramètre à régler, et dont la performance peut facilement être évaluée à un bruit aléatoire près. En considérant ce problème comme un problème de bandit stochastique, où l'ensemble des bras correspond à l'ensemble des valeurs de paramètres possibles, on peut construire des stratégies pour ajuster automatiquement le paramètre au cours du temps. \end{itemize} Dans le contexte particulier des médias sociaux, les algorithmes de bandit ont également des applications, dont on présente certaines ci-dessous: \begin{itemize} \item Le travail effectué dans \cite{Lage2013} s'intéresse à une tâche de maximisation de l'audience dans un réseau social. Dans ce contexte, un algorithme de bandit est utilisé pour sélectionner quels messages un utilisateur doit publier s'il souhaite maximiser le nombre de réactions (\textit{re-posts} par exemple). \item Dans \cite{banditSNApp}, les auteurs proposent une approche générique permettant d'orienter un robot d'indexation dans réseau social, visant à assurer un bon équilibre entre exploration et exploitation grâce à un algorithme de bandit. \item Dans \cite{gangOfBandit}, il est question d'utiliser la structure de graphe sous-jacente d'un réseau social pour améliorer les performances des algorithmes de recommandation. Cette approche, nommée \textit{Gang of Bandit}, fait l'hypothèse que des utilisateurs connectés entre eux auront des préférences similaires. Elle est évaluée empiriquement sur divers réseaux tels que \textit{Last.fm} ou \textit{Delicious}. \item Dans \cite{clusteringOfBandit} on s'intéresse également au problème de la recommandation dans un réseau social, mais contrairement à l'approche précédente, la structure de graphe n'est pas connue au préalable. Cette approche, plus réaliste, est également testée sur des données réelles. \item Dans \cite{banditSNAppInfMax}, les auteurs abordent le problème de la maximisation de l'influence sous la forme d'un problème de bandit. Cette tâche consiste à sélectionner un ensemble d'utilisateurs source auxquels partager une information ou un produit dans le but de maximiser sa diffusion dans un réseau social. La validité de cette approche est évaluée empiriquement sur des données du un site de partage de photographies et de vidéos \textit{Flickr}. \end{itemize} Nous verrons par la suite et tout au long de ce manuscrit que les approches de bandits peuvent aussi être appliquées à la collecte d'information ciblée dans un réseau social. \section{Bandit stochastique} \label{SectionBanditStochastique} \subsection{Problème et notations} Comme indiqué précédemment, le problème du bandit stochastique consiste à choisir une action parmi $K$, en considérant des distributions de récompenses stationnaires et des tirages indépendants d'un pas de temps à l'autre. Nous utilisons les notations suivantes dans la suite du chapitre: \begin{itemize} \item $\nu_{i}$ représente la distribution de la récompense du bras $i$, c.-à-d. $\forall t\geq 1, r_{i,t} \underset{iid}{\sim} \nu_{i}$; \item $\mu_{i}$ désigne l'espérance de la récompense de l'action $i$, c.-à-d. $\mu_{i}=\mathbb{E}\left[\nu_{i}\right]$; \item $\mu^{\star}=\max\limits_{i\in \left\{1,2,...,K\right\}}\quad \mu_{i}$ la moyenne la plus élevée; \item $i^{\star}$ l'action correspondant à la plus grande moyenne, c.-à-d. l'action $i$ telle que $\mu^{\star}=\mu_{i}$. Notons que cet indice n'est pas forcément unique dans le cas général; \item $\Delta_{i}=\mu^{\star}-\mu_{i}$ la différence des moyennes entre l'action optimale et l'action $i$; \item $N_{i,t}$ représente le nombre de fois que l'action $i$ a été choisie jusqu'au temps $t$, c.-à-d. $N_{i,t}=\sum\limits_{s=1}^{t}\mathbb{1}_{\left\{i_{t}=i\right\}}$ \item $\hat{\mu}_{i,t}$ représente la moyenne empirique de la récompense du bras $i$ jusqu'au temps $t$, c.-à-d. $\hat{\mu}_{i,t}=\dfrac{1}{N_{i,t}}\sum\limits_{s=1}^{t}\mathbb{1}_{\left\{i_{t}=i\right\}}r_{i,s}$; \item $V_{i,t}$ représente la variance empirique de la récompense du bras $i$ jusqu'au temps $t$, c.-à-d. $V_{i,t}=\dfrac{1}{N_{i,t}}\sum\limits_{s=1}^{t}(\mathbb{1}_{\left\{i_{t}=i\right\}}r_{i,s}-\hat{\mu}_{i,t})^{2}$; \end{itemize} Dans ce qui suit, sauf indication contraire explicite, on considère des récompenses positives et bornées, autrement dit: $\forall t \in \left\{1,2,...,T\right\}, \forall i \in \left\{1,2,...,K\right\}: r_{i,t}\in \left[0,b\right]$, avec $b$ une constante strictement positive. \subsection{Regret} Le but d'un algorithme de bandit est de maximiser la somme des récompenses collectées au cours du processus décisionnel d'horizon $T$. Afin d'analyser les performances des algorithmes, il est d'usage de se comparer à une politique optimale (inconnue) qui choisirait l'action possédant la plus haute somme de récompenses. Plus précisément, on définit la notion de regret de la façon suivante: \begin{defi} \label{regretCumulto} Le regret est défini par: \begin{equation} R_{T}=\max\limits_{i\in \left\{1,2,...,K\right\}}\sum\limits_{t=1}^{T}r_{i,t} - \sum\limits_{t=1}^{T}r_{i_{t},t} \end{equation} \end{defi} Cependant, les récompenses, mais aussi la politique permettant de choisir $i_{t}$, étant des variables aléatoires, on s'intéresse plus souvent à la moyenne du regret, dont on définit deux notions dans ce qui suit: le regret moyen et le pseudo-regret (cette nomenclature est tirée de l'article de \cite{Bubeck2012}). \begin{defi} \label{regretCumultoEsp} Le regret moyen est défini par: \begin{equation} \mathbb{E}[R_{T}]=\mathbb{E}\left[\max\limits_{i\in \left\{1,2,...,K\right\}}\sum\limits_{t=1}^{T}r_{i,t} - \sum\limits_{t=1}^{T}r_{i_{t},t}\right] \end{equation} \end{defi} \begin{defi} \label{regretCumultoPseudo} Le pseudo-regret est défini par: \begin{equation} \hat{R}_{T}=\max\limits_{i\in\left\{1,2,...,K\right\}}\mathbb{E}\left[\sum\limits_{t=1}^{T}r_{i,t} - \sum\limits_{t=1}^{T}r_{i_{t},t}\right] \end{equation} \end{defi} Dans les deux cas, l'espérance est calculée selon la politique et les distributions de récompenses. On remarque que le pseudo-regret est une notion moins forte que le regret moyen. En effet, le pseudo-regret utilise la meilleure action seulement en moyenne tandis que le regret moyen prend en compte la séquence des récompenses. Formellement, on a $\hat{R}_{T}\leq \mathbb{E}[R_{T}]$. En pratique on cherche à minimiser le pseudo-regret, qui peut se réécrire de la façon suivante, en faisant intervenir le nombre de fois que les bras sous optimaux sont choisis par l'algorithme à étudier: \begin{align*} \hat{R}_{T} &=\max\limits_{i\in\left\{1,2,...,K\right\}}\mathbb{E}\left[\sum\limits_{t=1}^{T}r_{i,t} - \sum\limits_{t=1}^{T}r_{i_{t},t}\right] \\ &= \max\limits_{i\in\left\{1,2,...,K\right\}}\mathbb{E}\left[\sum\limits_{t=1}^{T}r_{i,t}\right] - \mathbb{E}\left[\sum\limits_{t=1}^{T}r_{i_{t},t}\right] \\ &= \max\limits_{i\in\left\{1,2,...,K\right\}}\sum\limits_{t=1}^{T}\mathbb{E}\left[r_{i,t}\right] - \sum\limits_{t=1}^{T}\mathbb{E}\left[r_{i_{t},t}\right] \\ &=\sum\limits_{t=1}^{T} \mu^{\star}-\sum\limits_{t=1}^{T}\mathbb{E}\left[\mu_{i_{t}}\right] \\ &=T\mu^{\star}-\sum\limits_{i=1}^{K}\mu_{i}\mathbb{E}\left[N_{i,T}\right]\\ &=\sum\limits_{i=1}^{K}\Delta_{i}\mathbb{E}\left[N_{i,T}\right]\\ &=\sum\limits_{i: \Delta_{i}>0}\Delta_{i}\mathbb{E}\left[N_{i,T}\right] \end{align*} On peut montrer qu'une politique purement aléatoire possède un regret linéaire en $T$. En effet si chaque action est sélectionnée uniformément, alors $\mathbb{E}\left[N_{i,T}\right]$ est de l'ordre de $T/K$, d'où, d'après l'équation précédente, un regret linéaire en temps. On s'intéresse donc naturellement à des politiques a minima meilleures qu'une politique purement aléatoire. On appelle ainsi politique admissible, une politique dont le pseudo-regret est sous-linéaire, c'est-à-dire telle que $\hat{R}_{T}=o(T^{\beta})$ avec $0<\beta < 1$. En utilisant la formule ci-dessus, on peut montrer que la condition $\mathbb{E}[N_{i,t}]=o(T^{\beta})$ pour tout $i\neq i^{\star}$ est suffisante pour obtenir un regret sous-linéaire. En montrant qu'il existe des politiques dont le pseudo-regret est majoré par un terme de la forme $C\log (T)$, où $C$ est une constante, les auteurs de \cite{LaiRobbins} ont prouvé l'existence de politiques admissibles. On définit ci-dessous la divergence de Kullback-Leibler, qui permettra ensuite de définir une borne inférieure du pseudo-regret pour n'importe quelle politique de bandit. \begin{defi}[Kullback-Leibler] \label{KLDiv} La divergence de Kullback-Leibler entre deux distributions discrètes $P$ et $Q$ avec pour support $\mathcal{S}$ est définie comme: \begin{equation} KL(P,Q)=\sum\limits_{j\in \mathcal{S} }P_{j}\log\left(\dfrac{P_{j}}{Q_{j}}\right) \end{equation} La divergence de Kullback-Leibler entre deux distributions continues $P$ et $Q$ ayant pour densité respectivement $p$ et $q$ est définie comme: \begin{equation} KL(P,Q)=\int_{-\infty}^{+\infty} p(x) \log\left(\dfrac{p(x)}{q(x)}\right) \, \mathrm{d}x \end{equation} \end{defi} \begin{theo}[Borne inférieure] \label{infRegSto} D'après \cite{LaiRobbins}, pour toute politique telle que pour tout $i\neq i^{\star}$, $\mathbb{E}[N_{i,t}]=o(T^{\beta})$ avec $0<\beta < 1$, on a: \begin{equation} \label{bonreInfnbPlayes} \liminf\limits_{T\rightarrow\infty} \dfrac{\mathbb{E}[N_{i,T}]}{\log(T)} \geq \dfrac{1}{KL_{inf}(i,i^{\star})} \end{equation} Avec $KL_{inf}(i,i^{\star})=\inf\left\{KL(\nu_{i},\nu):~\mathbb{E}[\nu] > \mu_{i^{\star}}\right\}$. Par conséquent: \begin{equation} \label{bonreInfReg} \liminf\limits_{T\rightarrow\infty} \dfrac{\hat{R}_{T}}{\log(T)} \geq \sum\limits_{i: \Delta_{i}>0} \dfrac{\Delta_{i}}{KL_{inf}(i,i^{\star})} \end{equation} \end{theo} Le théorème précédent établit une limite inférieure du pseudo-regret de la meilleure politique atteignable. Une politique est dite optimale si la borne supérieure de son pseudo-regret tend vers à la borne inférieure lorsque $T$ augmente. Pour étudier les performances d'un algorithme de bandit, il est donc de coutume d'établir une borne supérieure de son pseudo-regret. Nous présentons dans ce qui suit différents algorithmes ainsi que la borne supérieure du regret associé. \subsection{Algorithmes} Nous présentons dans ce paragraphe les trois différents types de stratégies suivantes: \begin{itemize} \item \textbf{Algorithmes de type $\epsilon$-greedy :} il s'agit de la stratégie la plus simple dans laquelle on fait varier la probabilité d'exploration. \item \textbf{Algorithmes de type UCB :} cette méthode utilise la borne supérieure de l'intervalle de confiance sur les moyennes des récompenses. Cette borne est maintenue pour chaque bras à chaque itération. Ainsi, à chaque pas de temps, l'agent choisit l'action ayant la borne supérieure la plus élevée. Ce type d'algorithme est dit optimiste car il considère pour chaque bras la meilleure utilité possible étant donné son intervalle de confiance. \item \textbf{Algorithmes de Thompson sampling :} ce type d'algorithme choisit l'action à jouer en fonction de sa probabilité \textit{a posteriori} d'être la meilleure en mettant à jour un modèle bayésien à chaque itération et pour chaque bras. \end{itemize} \subsubsection{Algorithmes de type $\epsilon$-greedy} Imaginons une politique qui, après avoir initialisé chaque action en la jouant une fois, sélectionne l'action ayant la plus forte moyenne empirique à chaque itération. En raison de l'aspect aléatoire des récompenses, il est possible que ce genre de politique s'enferme dans un séquence de décisions sous-optimales, sans pouvoir reconsidérer les meilleures actions. A titre d'exemple, considérons deux actions $A$ et $B$ suivant des lois de Bernouilli de moyennes $\mu_{A}$ et $\mu_{B}$, avec $\mu_{A}>\mu_{B}$. Imaginons qu'à l'initialisation, la récompense associée à $A$ soit de 0 et celle associée à $B$ soit de 1. Une politique se basant uniquement sur la moyenne empirique sélectionnerait indéfiniment l'action $B$, malgré le fait que $\mu_{A}>\mu_{B}$. Le pseudo-regret à l'instant $T$ vaudrait donc à $(\mu_{A}-\mu_{B})(T-1)$, qui est une fonction linéaire. Il apparaît donc que les politiques uniquement basées sur l'exploitation ne peuvent pas, d'une façon générale, conduire à une borne supérieure du regret sous-linéaire. Pour éviter ce genre de focalisation sur des actions sous-optimales, les politiques de type $\epsilon$-greedy consistent à exploiter (c-à-d sélectionner l'action ayant la meilleure moyenne empirique) avec une probabilité $\epsilon \in \left[ 0,1\right]$ et à explorer (c-à-d sélectionner une action au hasard) avec une probabilité $1-\epsilon$. Cette méthode, fut introduite par \cite{Sutton}. Cependant, comme le montre \cite{banditUCB}, l'utilisation d'un terme d'exploration $\epsilon$ constant conduit également à un regret linéaire. Pour remédier à cela, ces mêmes auteurs proposent de faire décroître le terme d'exploration, noté $\epsilon_{t}$, avec le temps. Cette politique, nommée $\epsilon_{t}$-\texttt{greedy} est décrite dans l'algorithme \ref{epsilonreedy}, pour une suite de valeurs du paramètre $\epsilon_{t}$ définies à l'avance. \begin{algorithm}[h!] \KwIn{$\epsilon_1$,$\epsilon_2$,...,$\epsilon_T$} \For{$t=1..K$}{ Sélectionner $i_{t} =t $ \\ Recevoir récompense $r_{i_{t}}$ et mettre à jour $\hat{\mu}_{i_{t},t}$\\ } \For{$t=K+1..T$}{ $ i_{t}=\begin{cases} \argmax\limits_{i \in \left\{1,...,K \right\}} \hat{\mu}_{i,t-1} & \text{avec probabilité~} 1-\epsilon_t \\ \text{Uniform}(\left\{1,...,K \right\}) & \text{avec probabilité~} \epsilon_t \end{cases} $\\ Recevoir récompense $r_{i_{t}}$ et mettre à jour $\hat{\mu}_{i_{t},t}$\\ } \caption{$\epsilon_{t}$-\texttt{greedy} \cite{banditUCB}} \label{epsilonreedy} \end{algorithm} Le théorème suivant établit une borne supérieure du regret de l'algorithme $\epsilon_{t}$-\texttt{greedy}, lorsque les valeurs des $\epsilon_{t}$ possèdent une forme particulière. \begin{theo} \label{RegEpsilongreedy} \cite{banditUCB} Soit $c>0$ et $0<d\leq\min\limits_{i\in \left\{1,...,K \right\}, i\neq i^{\star}}\Delta_{i}$. Le pseudo-regret de l'algorithme $\epsilon_{t}$-\texttt{greedy}, avec $\epsilon_{t}=\min\left(1,\dfrac{cK}{d^{2}t}\right)$, est majoré pour tout $t>\dfrac{cK}{d}$ comme suit: \begin{equation} \hat{R}_{T} \leq \sum\limits_{i: \Delta_{i}>0} \Delta_{i} \left( \dfrac{cd^{2}}{T} + 2\left(\dfrac{c}{d^{2}}\log \left(\dfrac{(T-1)d^{2}e^{1/2}}{cK} \right)\right)\left(\dfrac{cK}{(T-1)d^{2}e^{1/2}}\right)^{c/(5d^{2})} +\dfrac{4e}{d^{2}} \left(\dfrac{cK}{(T-1)d^{2}e^{1/2}}\right)^{c/2} \right) \end{equation} \end{theo} Une étude fine des différents termes de la formule ci-dessus montre que le regret est bien sous-linéaire. Cependant, la valeur du paramètre de l'algorithme $d$ dépend des paramètres inconnus du problème. En effet, $d$ doit être fixé de façon à avoir $0<d\leq\min\limits_{i\in \left\{1,...,K \right\}, i\neq i^{\star}}\Delta_{i}$, or, la valeur de $\min\limits_{i\in \left\{1,...,K \right\}, i\neq i^{\star}}\Delta_{i}$ n'est généralement pas connue à l'avance. Cette politique est donc en pratique impossible à mettre en œuvre sous cette forme exacte, et $d$ doit être fixé à la main, ce qui ne permet alors pas d'atteindre une borne du regret sous-linéaire. Nous proposons dans la section suivante d'étudier les algorithmes de type UCB qui, eux, ne nécessitent pas de connaissance \textit{a priori} sur les paramètres du problème, en dehors de la valeur de $b$, la borne supérieure des récompenses. \subsubsection{Algorithmes optimistes} Ce type d'algorithme traduit le concept d'optimisme face à l'incertain. En dépit du manque de connaissance exacte de l'action optimale, une estimation optimiste de la qualité de chacune est établie, puis l'action ayant la plus élevée est sélectionnée. Si cette estimation est erronée alors la supposition optimiste décroît et permet de sélectionner une action différente aux itérations suivantes. En revanche s'il s'avère que le choix effectué est bon, l'algorithme est en mesure d'exploiter cette action et d'atteindre un regret faible. Le compromis exploitation / exploration est abordé de cette façon. Concrètement, cela se traduit par la construction d'un intervalle de confiance pour chaque action, dans lequel la récompense moyenne associée est comprise avec une forte probabilité. Il est important de noter que chaque action possède son propre intervalle de confiance, mais que ces intervalles doivent tous correspondre à une même probabilité de confiance. Le principe optimiste revient alors à sélectionner à chaque itération l'action ayant la borne supérieure de l'intervalle de confiance (UCB pour Upper Confidence Bound) la plus élevée. Ce principe est illustré dans la figure \ref{fig:UCBConfInt}, où l'on dispose de quatre actions, avec pour chacune une estimation de la moyenne (en trait plein) ainsi qu'une borne supérieure de l'intervalle de confiance à 95$\%$ (en pointillé). Il apparaît que, même si l'action située en bas possède la moyenne empirique la plus faible, son incertitude lui confère la meilleure borne supérieure. Un algorithme de type UCB, basé sur l'intervalle de confiance en question, sélectionnerait alors cette action. Dans cet exemple, de simples fonctions gaussiennes sont utilisées, cependant de façon générale diverses inégalités de concentration sont utilisées pour dériver les algorithmes de type optimiste. Nous proposons des exemples d'algorithmes dans la suite. \begin{figureth} \includegraphics[width=0.9\linewidth]{UCBConfInt.pdf} \caption[Principe des algorithmes optimistes.]{Principes des algorithmes optimistes.} \label{fig:UCBConfInt} \end{figureth} \paragraph{Algorithme \texttt{UCB}} La politique \texttt{UCB}, initialement proposée par \cite{banditUCB} et décrite dans l'algorithme \ref{UCB}, utilise l'inégalité de Hoeffding \cite{Hoeffding}, qui se traduit de la façon suivante dans notre cas. \begin{theo} \label{Hoeffding} \cite{Hoeffding} Soit $\epsilon>0$, on a, $\forall i \in \left\{1,...,K \right\}, \forall t>K$: \begin{align} \mathbb{P}(\hat{u}_{i,t}-\mu_{i} \geq \epsilon) & \leq e^{-2\epsilon^{2}N_{i,t}/b^{2}} \\ \mathbb{P}(\hat{u}_{i,t}-\mu_{i} \leq -\epsilon) & \leq e^{-2\epsilon^{2}N_{i,t}/b^{2}} \\ \mathbb{P}(|\hat{u}_{i,t}-\mu_{i}| \geq \epsilon) & \leq 2e^{-2\epsilon^{2}N_{i,t}/b^{2}} \end{align} \end{theo} Avec $\epsilon=\epsilon_{i,t-1}=\sqrt{\dfrac{2b^{2}\log(t)}{N_{i,t-1}}}$, on a $\mathbb{P}(\mu_{i} \leq \hat{u}_{i,t-1} + \epsilon_{i,t-1} ) \geq 1-\dfrac{1}{t^{4}}$. Ainsi, à l'instant $t$, pour chaque $i$, le terme $\hat{u}_{i,t-1} + \epsilon_{i,t-1}$ est une borne supérieure de l'intervalle de confiance de la récompense associée, qui constitue le score associé à chaque action de l'algorithme \texttt{UCB}. Ce score est constitué d'un terme d'exploitation $\hat{u}_{i,t-1}$ favorisant les actions ayant de bonnes moyennes empiriques d'une part, et d'un terme d'exploration $\epsilon_{i,t-1}$ d'autre part. Le terme $\epsilon_{i,t-1}$ favorise bien l'exploration des actions les moins connues puisqu'il est d'autant plus élevé que le terme $N_{i,t-1}$ est faible. Le choix de la forme de ce terme d'exploration permet d'assurer un regret logarithmique, comme le montre le théorème suivant. \begin{algorithm}[h!] \For{$t=1..K$}{ Sélectionner $i_{t} =t $ \\ Recevoir récompense $r_{i_{t}}$ et mettre à jour $\hat{\mu}_{i_{t},t}$\\ } \For{$t=K+1..T$}{ $ i_{t} = \argmax\limits_{i \in \left\{1,...,K \right\}} \hat{\mu}_{i,t-1} +\sqrt{2\dfrac{b^{2}\log(t)}{N_{i,t-1}}} $\\ Recevoir récompense $r_{i_{t}}$\\ Mettre à jour $\hat{\mu}_{i_{t},t}$ \\ $N_{i_{t},t}=N_{i_{t},t-1}+1$\\ } \caption{\texttt{UCB} \cite{banditUCB}} \label{UCB} \end{algorithm} \begin{note} Dans les algorithmes présentés, nous explicitons uniquement les calculs des paramètres $\hat{\mu}_{i_{t},t}$ et $N_{i_{t},t}$ pour l'action $i_{t}$ sélectionnée au temps $t$. Pour les bras non sélectionnés, la valeur de ces paramètres est la même qu'au temps précédent, autrement dit à un instant $t$, $\forall i \in \left\{1,...,K\right\}$ tels que $i\neq i_{t}$, on a $\hat{\mu}_{i,t}=\hat{\mu}_{i,t-1}$ et $N_{i,t}=N_{i,t-1}$. Nous n'explicitons volontairement pas cette mise à jour triviale afin de ne pas alourdir les algorithmes. \end{note} \begin{theo} \label{RegUCB} \cite{banditUCB} Le pseudo-regret moyen de l'algorithme \texttt{UCB} est majoré par: \begin{equation} \hat{R}_{T} \leq 8 \left(\sum\limits_{i: \Delta_{i}>0} \dfrac{b^{2}}{\Delta_{i}}\right) \log(T) +\left(1+\dfrac{\pi^{2}}{3}\right)\sum\limits_{i: \Delta_{i}>0} \Delta_{i} \end{equation} \end{theo} \textbf{Schéma de preuve: }Nous proposons ici de prouver le résultat du théorème précédent. Non seulement ceci donnera une justification plus claire de la pertinence d'utiliser l'inégalité de Hoeffding mais aussi une idée de la méthode à utiliser. Comme nous l'avons vu précédemment, trouver une borne supérieure du regret dans le cadre du bandit stochastique revient à majorer l'espérance $\mathbb{E}[N_{i,T}]$ du nombre de fois où chaque bras sous optimal a été choisi jusqu'à l'instant $T$. Dans la suite, on prend, sans perte de généralité $b=1$. D'après l'inégalité de Hoeffding, pour tout bras $i$ à l'instant $t$, on a: $P(\hat{\mu}_{i,t-1} + \sqrt{\dfrac{2\log(t)}{N_{i,t-1}}}\leq \mu_i) \leq t^{-4} $ \text{ et } $P(\widehat{\mu}_{i,t-1} - \sqrt{\dfrac{2\log(t)}{N_{i,t-1}}} \geq \mu_i) \leq t^{-4} $ Ce qui définit l'intervalle de confiance de niveau $1-t^{-4}$ suivant: $ \hat{\mu}_{i,t-1}- \sqrt{\dfrac{2\log(t)}{N_{i,t-1}}} \leq^{(a)} \mu_{i} \leq^{(b)} \hat{\mu}_{i,t-1} + \sqrt{\dfrac{2\log(t)}{N_{i,t-1}}} $. Lorsque l'algorithme \texttt{UCB} sélectionne une action sous-optimale $i$ à un instant $t$, on a forcément: $\hat{\mu}_{i,t-1} +\sqrt{\dfrac{2\log(t)}{N_{i,t-1}}} \geq \hat{\mu}_{i^{\star},t-1} + \sqrt{\dfrac{2\log(t)}{N_{i^{\star},t-1}}} $ Ainsi, les deux possibilités suivantes existent: \begin{itemize} \item Si on est dans l'intervalle de confiance, on a alors: $\mu_{i} + 2\sqrt{\dfrac{2\log(t)}{N_{i,t-1}}} \geq \mu^{\star}$, ce qui implique : $N_{i,t-1} \leq \dfrac{8 \log{t}}{\Delta_i^2}$ ; \item Sinon, c'est que l'une des inégalités (a) ou (b) n'est pas vérifiée pour $i$ ou $i^{\star}$. \end{itemize} Par ailleurs, en notant $s=N_{i,t-1}$ et $s^{\star}=N_{i^{\star},t-1}$, pour tout $u \geq 0$ on a: $N_{i,T}\leq u + \sum\limits_{t=u+1}^{T} \mathbb{1}_{\left\{i_{t}=i, N_{i,t}>u\right\}}$ $N_{i,T}\leq u + \sum\limits_{t=u+1}^{T} \mathbb{1}_{\left\{\exists s: u < s \leq t, \exists s^{\star}: 1 \leq s^{\star} \leq t, \hat{\mu}_{i,t-1} + \sqrt{2\log(t)/s} \geq \hat{\mu}_{i^{\star},t-1} + \sqrt{2\log(t)/s^{\star} }\right\}}$ En choisissant $u=\dfrac{8 \log{T}}{\Delta_i^2}$, on sait alors qu'un bras sous-optimal est choisi seulement si (a) ou (b) n'est pas vérifiée. Or: \begin{itemize} \item (a) n'est pas vérifiée avec une probabilité de $t^{-4}$ \item (b) n'est pas vérifiée avec une probabilité de $t^{-4}$ \end{itemize} Donc : $\mathbb{E}[N_{i,T}] \leq \dfrac{8 \log{T}}{\Delta_i^2} + \sum\limits_{t=u+1}^{T} \left[\sum\limits_{s=u+1}^t t^{-4} + \sum\limits_{s=1}^t t^{-4}\right] \leq \dfrac{8 \log{T}}{\Delta_i^2} + 1 + \dfrac{\pi^2}{3} $, ce qui conclut la preuve. \paragraph{Algorithme \texttt{UCBV}} La politique \texttt{UCBV} (que nous décrivons dans l'algorithme \ref{UCBV}) a été proposée par \cite{banditUCBV} et utilise la variance empirique des actions pour le calcul de l'intervalle de confiance (inégalité de Bernstein). Initialement, l'idée d'utiliser la variance fut introduite par \cite{banditUCB} avec l'algorithme \texttt{UCB-Tuned}. Bien qu'offrant des performances empiriques élevées, aucune garantie théorique de convergence n’a pu être démontrée pour \texttt{UCB-Tuned}, contrairement à \texttt{UCBV} (voir le théorème ci-après). L'idée de cet algorithme est de donner un bonus d'exploration aux actions ayant une variance empirique élevée. Cet algorithme fait intervenir deux paramètres $a$ et $c$ permettant de régler l'exploration. \begin{algorithm}[h!] \KwIn{$c>0, a>0$} \For{$t=1..K$}{ Sélectionner $i_{t} =t $ \\ Recevoir récompense $r_{i_{t}}$ et mettre à jour $\hat{\mu}_{i_{t},t}$\\ } \For{$t=K+1..T$}{ $ i_{t} = \argmax\limits_{i \in \left\{1,...,K \right\}} \hat{\mu}_{i,t-1} +\sqrt{\dfrac{2aV_{i,t-1}\log(t)}{N_{i,t-1}}}+3cb\dfrac{\log(t)}{N_{i,t-1}} $\\ Recevoir récompense $r_{i_{t}}$\\ Mettre à jour $\hat{\mu}_{i_{t},t}$ et $V_{i,t}$\\ $N_{i_{t},t}=N_{i_{t},t-1}+1$ \\ } \caption{\texttt{UCBV} \cite{banditUCBV}} \label{UCBV} \end{algorithm} \begin{theo} \label{RegUCBV} \cite{banditUCBV} En prenant $c=1$ et $a=1.2$, le pseudo-regret de l'algorithme \texttt{UCBV} est majoré par: \begin{equation} \hat{R}_{T}\leq 10 \left(\sum\limits_{i: \Delta_{i}>0} \dfrac{\sigma_{i}^{2}}{\Delta_{i}}+2b\right) \log(T) \end{equation} Où $\sigma_{i}^{2}$ est la variance de l'action $i$. \end{theo} Comparée à la borne pour l'algorithme \texttt{UCB} proposé dans le théorème \ref{RegUCB}, cette dernière ne varie pas avec $b^{2}$ dans la somme, mais en $\sigma_{i}^{2}$. Nous observons par ailleurs qu'il existe toujours une dépendance linéaire en $b$, qui d'après l'étude de \cite{banditUCBV} est inévitable. Ainsi, selon les distributions de récompenses considérées, cette borne peut être plus large ou plus serrée que la borne de l'algorithme \texttt{UCB}. \paragraph{Algorithme \texttt{UCB}-$\delta$} La stratégie \texttt{UCB}-$\delta$, décrite dans l'algorithme \ref{UCBDelta}, fut proposée par \cite{OFUL} et dérivée à partir d'une instance spécifique d'un problème de bandit contextuel (c.f. section \ref{SectionBanditContextuel}). Les auteurs utilisent une inégalité de concentration basée sur la théorie des processus auto normalisés \cite{PenaLaiShao2009}, permettant de déterminer une borne supérieure de l'intervalle de confiance de chaque action. \begin{algorithm}[h!] \KwIn{$0<\delta<1$} \For{$t=1..K$}{ Sélectionner $i_{t} =t $ \\ Recevoir récompense $r_{i_{t}}$ et mettre à jour $\hat{\mu}_{i_{t},t}$\\ } \For{$t=K+1..T$}{ $ i_{t} = \argmax\limits_{i \in \left\{1,...,K \right\}} \hat{\mu}_{i,t-1} +\sqrt{\dfrac{1+N_{i,t-1}}{N_{i,t-1}^{2}}\left(1+2\log\left(\dfrac{K(1+N_{i,t-1})^{1/2}}{\delta}\right)\right)} $\\ Recevoir récompense $r_{i_{t}}$\\ Mettre à jour $\hat{\mu}_{i_{t},t}$\\ $N_{i_{t},t}=N_{i_{t},t-1}+1$ \\ } \caption{\texttt{UCB}-$\delta$ \cite{banditUCBV}} \label{UCBDelta} \end{algorithm} \begin{theo} \label{RegUCBdelta} \cite{OFUL} Soit $0<\delta<1$, alors avec une probabilité au moins égale à $1-\delta$, pour l'algorithme \texttt{UCB}-$\delta$, on a: \begin{equation} \sum\limits_{i: \Delta_{i}>0}\Delta_{i}N_{i,T} \leq \sum\limits_{i: \Delta_{i}>0} \left(3\Delta_{i}+ \dfrac{16}{\Delta_{i}}\log\left(\dfrac{2K}{\delta\Delta_{i}}\right)\right) \end{equation} \end{theo} On remarque qu'il ne s'agit pas exactement d'une borne du pseudo-regret, car c'est directement $N_{i,T}$ qui apparaît et non son espérance $\mathbb{E}[N_{i,T}]$ dans la grandeur qui est majorée. La borne supérieure proposée dépend de $\delta$ et est valide avec une certaine probabilité (dépendant aussi de $\delta$). Notons qu'en prenant $\delta=1/T$, on a bien une dépendance logarithmique en $T$, vraie avec une probabilité tendant vers 1 quand l'horizon est suffisamment grand. Le lecteur intéressé par une borne du pseudo-regret peut se référer à l'article de \cite{OFUL} qui précise qu'une borne du même type que celle de \cite{banditUCB} peut être dérivée en utilisant une approche similaire. Cependant, contrairement à l'algorithme \texttt{UCB} classique qui est conçu à l'origine pour des récompenses bornées, l'algorithme \texttt{UCB}-$\delta$ fait l'hypothèse de récompenses sous-gaussiennes. Nous reviendrons par la suite sur cette notion dans la section sur les problèmes de bandits contextuels. Nous testerons les performances de cet algorithme au cours de ce manuscrit \paragraph{Algorithme \texttt{MOSS}} La politique \texttt{MOSS}, proposé par \cite{banditMOSS}, est décrite dans l'algorithme \ref{MOSS}. Dans ce travail, les auteurs étudient le problème du bandit adverse pour lequel ils proposent une nouvelle caractérisation du regret. Ils considèrent par la suite le problème du bandit stochastique (qui nous intéresse ici) et proposent un algorithme de type UCB. Dans cet algorithme, le score de chaque action ayant été sélectionnée plus de $T/K$ fois correspond exactement à sa moyenne empirique. Pour les autres, il s'agit d'une borne supérieure de la récompense moyenne associée, provenant de l'inégalité de Hoeffding. Notons par ailleurs que cet algorithme nécessite la connaissance \textit{a priori} de l'horizon $T$, ce qui selon les applications peut ne pas être le cas. \begin{algorithm}[h!] \For{$t=1..K$}{ Sélectionner $i_{t} =t $ \\ Recevoir récompense $r_{i_{t}}$ et mettre à jour $\hat{\mu}_{i_{t},t}$\\ } \For{$t=K+1..T$}{ $ i_{t} = \argmax\limits_{i \in \left\{1,...,K \right\}} \hat{\mu}_{i,t-1} +\sqrt{\dfrac{\max\left(\log\left(\dfrac{T}{KN_{i,t-1}}\right),0\right)}{N_{i,t-1}}} $\\ Recevoir récompense $r_{i_{t}}$\\ Mettre à jour $\hat{\mu}_{i_{t},t}$\\ $N_{i_{t},t}=N_{i_{t},t-1}+1$ \\ } \caption{\texttt{MOSS} \cite{banditMOSS}} \label{MOSS} \end{algorithm} \begin{theo} \label{RegMOSS} \cite{banditMOSS} Le pseudo-regret de l'algorithme \texttt{MOSS} est majoré par: \begin{equation} \hat{R}_{T} \leq 23K \sum\limits_{i: \Delta_{i}>0} \dfrac{\max\left(\log\left(\dfrac{n\Delta_{i}^{2}}{K}\right),1\right)}{\Delta_{i}} \end{equation} \end{theo} La preuve de cette borne fait appel à de nombreux outils mathématiques, que nous ne détaillerons pas ici. D'une façon générale, il est nécessaire d'introduire des variables intermédiaires ayant pour but de découpler les dépendances entre bras, puis de majorer les différents termes en utilisant l'inégalité de Hoeffding. A nouveau, on ne peut pas comparer directement cette borne avec celles des autres algorithmes dans un cas général. Nous verrons lors de diverses expérimentations que selon les situations, on peut obtenir des performances plus ou moins élevées. \paragraph{Algorithme \texttt{kl-UCB} et \texttt{Empirical KL-UCB}} Les algorithmes précédemment présentés ont une borne supérieure du pseudo-regret logarithmique en $T$. En effet, que ce soit pour \texttt{UCB} \cite{banditUCB}, \texttt{UCBV} \cite{banditUCBV},\texttt{UCB}-$\delta$ \cite{OFUL} ou \texttt{MOSS} \cite{banditMOSS}, le nombre $\mathbb{E}[N_{i,T}]$ de fois où une action sous-optimale $i\neq i^{\star}$ est sélectionnée peut être majoré par un terme de la forme: \begin{equation} \mathbb{E}[N_{i,T}] \leq \dfrac{K_{1}}{\Delta_{i}^{2}}\log(T)+K_{2} \end{equation} Pour étudier l'optimalité d'un algorithme, au sens où la borne supérieure et la borne inférieure sont identiques, ce terme est à comparer avec la borne inférieure de l'équation \ref{bonreInfnbPlayes}, à savoir: \begin{equation*} \liminf\limits_{T\rightarrow\infty} \dfrac{\mathbb{E}[N_{i,T}]}{\log(T)} \geq \dfrac{1}{KL_{inf}(i^{\star},i)} \end{equation*} Or, l'inégalité de Pinsker, utilisée en particulier par \cite{banditKLUCBBis}, spécifie que le terme $KL_{inf}(i^{\star},i)$ peut être bien plus grand $\Delta_{i}^{2}/2$. Par conséquent, les bornes précédemment exposées ne sont pas optimales car le terme multiplicatif devant $\log(T)$ ne correspond pas à celui de la borne inférieure. Dans le but de s'approcher de la borne inférieure, une famille d'algorithmes utilisant directement la divergence de Kullback-Leibler dans le calcul de l'intervalle de confiance des récompenses est présentée en détail dans \cite{banditKLUCBBounded}. L'algorithme générique proposé est nommé \texttt{KL-UCB}. La borne supérieure de l'intervalle de confiance utilisée dans ce dernier fait appel à un problème d'optimisation mathématique, qui n'est pas soluble dans un cadre général. De plus, la borne supérieure du regret associé n'est optimale que sous certaines conditions. Ainsi, les auteurs proposent l'étude de différents scénarios répondant à diverses hypothèses dans le but de concrétiser l'algorithme, mais aussi de prouver son optimalité: \begin{enumerate} \item \textbf{Récompenses dans la famille exponentielle}: dans ce cas, chaque distribution de récompense est supposée appartenir à la famille exponentielle canonique. L'algorithme associé (algorithme \ref{klUCB}), nommé \texttt{kl-UCB} est optimal au sens définit précédemment. La fonction non décroissante $f$ nécessaire à l'implémentation de l'algorithme est en pratique prise égale au logarithme. Le calcul du score de chaque action revient à trouver le zéro d'une fonction croissante et convexe, ce qui peut se faire par de nombreux processus itératifs (dichotomie, méthode de Newton, etc.). D'autre part, pour initialiser la recherche de façon pertinente, il est possible de partir d'un intervalle de confiance de type Hoeffding. Dans \cite{banditKLUCBGeneral}, les auteurs effectuent les calculs de façon explicite pour les distributions binomiales, de Poisson, binomiales négatives, gaussiennes et Gamma. \item \textbf{Récompenses bornées à support fini}: dans ce cas, les distributions de récompenses sont supposées à la fois bornées et à support fini. Les auteurs montrent alors que le score associé à chaque bras admet une forme pouvant être explicitement calculée. L'algorithme correspondant est nommé \texttt{Empirical KL-UCB} et est décrit dans l'algorithme \ref{EmpKLUCB}. Son optimalité est également démontrée pour un choix judicieux de la fonction $f$\footnote{$f(t)=\log(t)+\log(\log (t))$ pour $t\geq 2$}. \item \textbf{Récompenses bornées}: ici, les récompenses sont uniquement supposées bornées, comme dans le cadre étudié par \cite{banditUCB} (algorithme \texttt{UCB}). Bien qu'aucun algorithme ne soit spécifiquement créé pour ce cas, les auteurs montrent que l'application de l'algorithme \texttt{kl-UCB}, en supposant des distributions de Bernouilli offre de meilleures performances théoriques que l'algorithme \texttt{UCB}. Les auteurs évoquent par ailleurs l'utilisation directe de l'algorithme \texttt{Empirical KL-UCB} dans ce cas. Bien que l'optimalité ne puisse pas être démontrée, une analyse préliminaire permettant de justifier les bonnes performances expérimentales est conduite. \end{enumerate} \begin{note} Nous ne détaillons volontairement pas les différentes notations ensemblistes présentes dans le calcul des scores de chaque action en raison de leur complexité, ces dernières sont présentées de façon détaillée dans \cite{banditKLUCBGeneral}. \end{note} \begin{algorithm}[h!] \KwIn{Une fonction non décroissante $f:\mathbb{N}\rightarrow\mathbb{R}$} \For{$t=1..K$}{ Sélectionner $i_{t} =t $ \\ Recevoir récompense $r_{i_{t}}$ \\ } \For{$t=K+1..T$}{ $ i_{t} = \argmax\limits_{i \in \left\{1,...,K \right\}} \sup\left(\mu \in \bar{I}: d(\hat{\mu}_{i,t},\mu)\leq \dfrac{f(t)}{N_{i,t-1}}\right) $\\ Recevoir récompense $r_{i_{t}}$\\ } \caption{\texttt{kl-UCB} \cite{banditKLUCBBounded}} \label{klUCB} \end{algorithm} \begin{algorithm}[h!] \KwIn{Une fonction non décroissante $f:\mathbb{N}\rightarrow\mathbb{R}$} \For{$t=1..K$}{ Sélectionner $i_{t} =t $ \\ Recevoir récompense $r_{i_{t}}$ et mettre à jour $\hat{\mu}_{i_{t},t}$\\ } \For{$t=K+1..T$}{ $ i_{t} = \argmax\limits_{i \in \left\{1,...,K \right\}} \sup\left(\mathbb{E}[\nu]: \nu\in \mathcal{M}_{1}\left(Supp(\hat{\nu}_{i,t})\cup \left\{1\right\}\right) et \leq KL(\hat{\nu}_{i,t},\nu) \leq \dfrac{f(t)}{N_{i,t}} \right) $\\ Recevoir récompense $r_{i_{t}}$\\ } \caption{\texttt{Empirical KL-UCB} \cite{banditKLUCBGeneral}} \label{EmpKLUCB} \end{algorithm} \subsubsection{Algorithmes de \texttt{Thompson sampling}} L'algorithme du \texttt{Thompson sampling} fut introduit par \cite{Tho33}. Il s'agit d'une stratégie stochastique permettant d'aborder le compromis exploitation / exploration par tirages successifs à partir de distributions des moyennes des récompenses estimées pour chaque bras. D'une façon générale, il s'agit de maintenir une distribution \textit{a posteriori} sur les moyennes de chaque action, à mesure que les observations de récompenses arrivent. Formellement, les éléments suivants sont manipulés: \begin{enumerate} \item Une distribution \textit{a priori} pour chaque bras $i$ sur le paramètre $\mu_{i}$ notée $p(\mu_{i})$ ; \item L'ensemble des observations passées, noté $\mathcal{H}_{t-1}=\left\{(i_{s},r_{s})\right\}_{ s=1..t-1}$, avant le temps $t$; \item Une vraisemblance $p(r_{i,t}|\mu_{i})$ pour la récompense de chaque bras $i$ à l'instant $t$; \item Grâce au théorème de Bayes, on peut calculer la distribution \textit{a posteriori} $p(\mu_{i}|\mathcal{H}_{t-1})\propto p(\mu_{i})p(\mathcal{H}_{t-1}|\mu_{i})$ pour chaque $i$ à l'instant $t$; \end{enumerate} La stratégie du \texttt{Thompson sampling} consiste à sélectionner l'action selon sa probabilité \textit{a posteriori} d'être optimale. En pratique, on effectue un tirage $\tilde{\mu}_{i}$ suivant la loi $p(\mu_{i}|\mathcal{H}_{t-1})$ et on choisit l'action $i_{t}=\argmax\limits_{i \in \left\{1,...,K \right\}} \tilde{\mu}_{i}$. Si la distribution \textit{a posteriori} est de la même forme que la distribution \textit{a priori}, la distribution \textit{a priori} est appelé \textit{prior conjugué} de la \textit{vraisemblance}. Cela permet en particulier de garantir que les distributions \textit{a posteriori} possèdent une forme analytique et sont échantillonnables facilement. Ce type de \textit{prior conjugué} existe pour de nombreuses distributions, en particulier pour les distributions de la famille exponentielle. Le Thompson sampling, bien que découvert en 1933 fut longtemps ignoré de par le manque de garanties théoriques. Cependant, à la suite de la publication de l'article de \cite{banditThompsonCtxtEmpirical} mettant en avant les performances empiriques ainsi que la simplicité d'implémentation de ce dernier, un regain d'intérêt pour cet algorithme fut observé. Des garanties théoriques sur le regret ont été démontrées dans de nombreux articles, on citera en particulier \cite{banditBernThompsonAnalysis} qui ont démontré l'optimalité dans le cas où les récompenses suivent des lois de Bernoulli et \cite{banditSimpleThompsonAnalysis} qui ont montré une borne supérieure du regret (non optimale) pour le cas plus général des récompenses bornées. Par la suite, les travaux de \cite{banditThompsonPriorFree} et \cite{banditSimpleThompsonAnalysis2} on démontré la convergence pour des cas plus généraux. \begin{note}[Regret fréquentiste et regret bayésien] Etant donné que les paramètres des distributions sont ici considérés comme des variables aléatoires, il est possible de définir une nouvelle notion du regret, prenant l'espérance sur ces paramètres. Ce regret est nommé regret bayésien, en opposition au regret dit fréquentiste que nous avons étudié dans les sections précédentes, et qui considère les paramètres des distributions comme des constantes. Dans la suite, lorsque nous parlerons de regret, nous ferons référence au regret fréquentiste. L'étude du regret bayésien constitue un champ de recherche spécifique, hors du scope de ce manuscrit. Le lecteur intéressé pourra se référer aux travaux présentés dans \cite{banditTSbayesianReg2} ou \cite{banditTSbayesianReg}. \end{note} Dans la suite, on présente des algorithmes considérant d'une part des récompenses binaires et d'autre part des récompenses gaussiennes. \paragraph{Récompenses binaires} L'algorithme proposé dans cette section est le plus étudié dans la littérature. Il traite le cas ou les récompenses des actions sont binaires (0 ou 1) et suivent des lois de Bernoulli, c.-à-d. $\forall i, \forall t: p(r_{i,t}=1|\mu_{i})=\mu_{i}$ avec $0<\mu_{i}<1$. Afin d'obtenir une distribution \textit{a posteriori} soluble analytiquement pour les moyennes des récompenses des différentes actions, on utilise le \textit{prior} conjugué de la distribution de Bernoulli, à savoir la loi Beta. Soient $\alpha$ et $\beta$ les paramètres de la loi \textit{a priori} de $\mu_{i}$: $\mu_{i} \sim$ Beta$(\alpha,\beta)$. Si l'on note $S_{i,t}$ le nombre de 1 et $F_{i,t}$ le nombre de 0 obtenu en tirant le bras $i$, alors la distribution \textit{a posteriori} de $\mu_{i}$ est une loi Beta$(\alpha+S_{i,t},\beta+F_{i,t})$. L'algorithme \ref{TSBetaBern} décrit la politique de Thompson sampling associée (notons qu'on prend $\alpha=\beta=1$, ce qui correspond à la loi uniforme sur $\left[0,1\right]$). \begin{algorithm}[h!] \For{$i=1..K$}{ $S_{i,0}=0$ \\ $F_{i,0}=0$ \\ } \For{$t=1..T$}{ \For{$i=1..K$}{ Échantillonner $\tilde{\mu}_{i} \sim$ Beta$(S_{i,t-1}+1,F_{i,t-1}+1)$ \\ } $ i_{t} = \argmax\limits_{i \in \left\{1,...,K \right\}} \tilde{\mu}_{i} $\\ Recevoir récompense $r_{i_{t}}$\\ \eIf{$r_{i_{t}}=1$}{ $S_{i_{t},t}=S_{i_{t},t-1}+1$ \\ } { $F_{i_{t},t}=F_{i_{t},t-1}+1$ \\ } } \caption{\texttt{Thompson sampling} récompenses binaires \cite{banditBernThompsonAnalysis}} \label{TSBetaBern} \end{algorithm} \textbf{Extension au cas des récompenses bornées:} Plutôt que de considérer des récompenses binaires, l'algorithme \ref{TSBetaGen} est une extension de l'algorithme \ref{TSBetaBern} dans le cas plus général des distributions bornées dans $\left[0,1\right]$. Notons que ce cas entre bien dans notre cadre (notre hypothèse étant que les récompenses sont dans $\left[0,b\right]$) à une normalisation par $b$ près. Cet algorithme fait intervenir une variable aléatoire extérieure $X$ que l'on échantillonne de façon à ce que sa moyenne soit la même que la moyenne du bras choisi. En effet, soit $p(r_{i,t})$ la densité de probabilité de la variable $r_{i,t}$ et soit X une variable aléatoire telle que $X \sim \text{Ber}(r_{i,t})$, on a $p(X=1)=\int_{0}^{1} p(X=1|r_{i,t}) p(r_{i,t}) \, \mathrm{d}r_{i,t} =\int_{0}^{1} r_{i,t} p(r_{i,t}) \, \mathrm{d}r_{i,t}=\mathbb{E}[r_{i,t}]=\mu_{i}$. \begin{algorithm}[h!] \For{$i=1..K$}{ $S_{i,0}=0$ \\ $F_{i,0}=0$ \\ } \For{$t=1..T$}{ \For{$i=1..K$}{ Échantillonner $\tilde{\mu}_{i} \sim$ Beta$(S_{i,t-1}+1,F_{i,t-1}+1)$ \\ } $ i_{t} = \argmax\limits_{i \in \left\{1,...,K \right\}} \tilde{\mu}_{i} $\\ Recevoir récompense $r_{i_{t}}$\\ Échantillonner $X \sim \text{Ber}(r_{i_{t}})$ \\ \eIf{$X=1$}{ $S_{i_{t},t}=S_{i_{t},t-1}+1$ \\ } { $F_{i_{t},t}=F_{i_{t},t-1}+1$ \\ } } \caption{\texttt{Thompson sampling} récompenses bornées \cite{banditSimpleThompsonAnalysis}} \label{TSBetaGen} \end{algorithm} \begin{theo} \label{RegTSBernBeta} \cite{banditBernThompsonAnalysis} Le pseudo-regret de l'algorithme \texttt{Thompson sampling} est optimal dans le cas ou les récompenses suivent des lois de Bernouilli. \end{theo} \paragraph{Récompenses gaussiennes} Nous présentons dans ce paragraphe un cas où les récompenses sont gaussiennes \cite{banditSimpleThompsonAnalysis2}. On utilise pour cela des ditributions \textit{a priori} gaussiennes. Formellement, $\forall i, \forall t: p(r_{i,t}|\mu_{i})=\mathcal{N}\left(r_{i,t};\mu_{i},\sigma^{2}\right)$ et $p(\mu_{i})=\mathcal{N}\left(\mu_{i};a,b\right)$ où $\mathcal{N}\left(x;a,b\right)$ est la densité de probabilité d'une gaussienne de moyenne $a$ et de variance $b$. Ainsi, après $t$ pas de temps, la distribution \textit{a posteriori} pour l'action $i$ s'écrit : $p(\mu_{i})=\mathcal{N}\left(\mu_{i};\left(\dfrac{a}{b}+\dfrac{S_{i,t}}{\sigma^{2}}\right)\left(\dfrac{N_{i,t}}{\sigma^{2}}+\dfrac{1}{b}\right)^{-1},\left(\dfrac{N_{i,t}}{\sigma^{2}}+\dfrac{1}{b}\right)^{-1}\right)$, où $S_{i,t}$ est la somme des récompenses du bras $i$ jusqu'au temps $t$. Il est ainsi possible pour chaque action $i$ d'effectuer un échantillonnage de sa moyenne \textit{a posteriori}. On présente cette politique dans l'algorithme \ref{TSGauss}. \begin{algorithm}[h!] \KwIn{a,b} \For{$i=1..K$}{ $S_{i,0}=0$ \\ $N_{i,0}=0$ \\ } \For{$t=1..T$}{ \For{$i=1..K$}{ Échantillonner $\tilde{\mu}_{i} \sim \mathcal{N}\left(\mu_{i};\left(\dfrac{a}{b}+\dfrac{S_{i,t-1}}{\sigma^{2}}\right)\left(\dfrac{N_{i,t-1}}{\sigma^{2}}+\dfrac{1}{b}\right)^{-1},\left(\dfrac{N_{i,t-1}}{\sigma^{2}}+\dfrac{1}{b}\right)^{-1}\right)$ \\ } $ i_{t} = \argmax\limits_{i \in \left\{1,...,K \right\}} \tilde{\mu}_{i} $\\ Recevoir récompense $r_{i_{t}}$\\ $S_{i_{t},t}=S_{i_{t},t-1}+r_{i_{t}}$ \\ $N_{i_{t},t}=N_{i_{t},t-1}+1$ \\ } \caption{\texttt{Thompson sampling} récompenses gaussiennes \cite{banditSimpleThompsonAnalysis2}} \label{TSGauss} \end{algorithm} \subsubsection{Autres algorithmes notables} Proposé par \cite{bayesUCBunifyingModel}, l'algorithme \texttt{Bayes-UCB} se situe à la croisée des chemins entre l'approche purement bayésienne du Thompson sampling et l'approche UCB. Il s'agit du premier algorithme bayésien pour lequel l'optimalité a été démontrée. Ce dernier utilise la notion de quantile pour calculer les scores de chaque action. D'autre part, l'algorithme \texttt{DMED} (Deterministic Minimum Empirical Divergence) fut proposé par \cite{banditDMED,banditDMED2}. Ce dernier utilise également la divergence de Kullbak-Leibler et il est prouvé que le regret associé est asymptotiquement optimal. Pour plus de détails sur ces deux dernières méthodes le lecteur intéressé pourra se référer respectivement à \cite{bayesUCBunifyingModel} et \cite{banditDMED,banditDMED2}. \section{Bandit contextuel} \label{SectionBanditContextuel} On peut montrer que le regret des algorithmes précédents augmente en $\sqrt{K}$, ce qui, lorsque le nombre d'actions devient grand, peut s'avérer problématique. Lorsque des informations auxiliaires associées aux actions sont disponibles, il est possible d'exploiter une notion de structure entre les actions, afin que l'apprentissage de la qualité des unes fournisse des informations sur les autres. Cela permet de réduire l'exploration des mauvaises actions et d'augmenter l'exploitation des bonnes. Le problème du bandit contextuel fait l'hypothèse qu'il existe un contexte décisionnel (nous préciserons sa forme par la suite) dont l'utilisation peut permettre à l'agent d'améliorer sa stratégie de sélection. D'autre part, si ce contexte varie au cours du temps, alors sa prise en compte peut en particulier mener à une meilleure appréhension de la non-stationnarité des différentes récompenses. La suite de cette section est dédiée dans un premier temps à la formalisation du problème, puis à l'étude d'un certain nombre d'algorithmes de l'état l'art permettant d'exploiter la notion de contexte. \subsection{Problème et notations} D'une façon générale, dans le problème du bandit contextuel, on fait l'hypothèse qu'à chaque itération, un contexte est présenté à l'agent décisionnel avant qu'il prenne sa décision. L'agent dispose d'informations supplémentaires lui permettant d'améliorer sa stratégie en apprenant une fonction - supposée linéaire dans le bandit contextuel classique étudié ici - liant contextes et récompenses. La structure induite dans l'espace des récompenses permet de mutualiser l'apprentissage et de s'orienter plus rapidement vers les actions les plus prometteuses à un instant donné. Dans un scénario de publicité en ligne, ce contexte peut par exemple représenter les caractéristiques d'un utilisateur (son genre, son âge, son historique...) à qui on souhaite présenter la publicité la plus adaptée. Chaque publicité correspondant à une action, il est possible de modifier l'espérance de clic sur chacune selon les caractéristiques de l'utilisateur considéré, permettant ainsi d'améliorer la pertinence des publicités proposées. Le bandit contextuel peut se décliner sous différentes instances : \begin{itemize} \item Avec contexte global (état général du monde au moment de la décision) ou individuel (chaque action a des caractéristiques qui lui sont propres) \item Avec contexte fixe (stationnarité des contextes) ou variable (le contexte décisionnel ou les caractéristiques de chaque action ont changé). \item Avec prise en compte globale (paramètres de mise en relation entre contexte et utilité espérée partagés) ou individuelle (chaque bras - ou plutôt son utilité espérée - réagit différemment à un changement de contexte décisionnel et/ou propriétés individuelles) \end{itemize} La variabilité des contextes (qu'ils soient communs ou individuels) peut permettre d'appréhender des variations d'utilité espérée pour chaque action. En outre, l'observation de contextes individuels (même fixes) peut permettre de mieux explorer les actions en les considérant disposés dans un espace de caractéristiques (exploitation de la structure). A noter cependant que le cas du contexte global fixe n'a pas d'intérêt (même contexte pour tout le monde, donc ne permet pas de discrimination entre les actions, et stationnaire, donc ne permet pas d'appréhender des variations d'utilité espérée). Par ailleurs, le cas du contexte global variable avec prise en compte commune ne présente pas d'intérêt non plus, puisque les utilités espérées sont dans ce cas les mêmes pour tous les bras. Le tableau \ref{tab:configBanditCtxt} référence les différentes possibilités, en donnant pour chacune la manière dont est déterminée l'espérance de la récompense de chaque action dans le cas linéaire (bien que bien d'autres hypothèses pourraient être envisagées). Différentes hybridations de ces instances peuvent également être considérées. Par exemple, \cite{banditCtxtLinUCB} proposent d'utiliser un algorithme de bandit contextuel pour un problème de recommandation d'articles à des visiteurs d'un site de nouvelles, en considérant des vecteurs de contexte incluant à la fois des informations sur l'utilisateur considéré à l'instant $t$ (contexte commun variable) et des informations sur les articles à présenter (propriétés fixes propres à chaque article). Les auteurs proposent également une hybridation au niveau de la prise en compte des contextes, en considérant à la fois des paramètres individuels et des paramètres partagés par l'ensemble des actions. \begin{tableth} \setlength\extrarowheight{5pt} \begin{tabular}{|c|c||c|c|} \hline \multicolumn{2}{|c||}{\cellcolor{black}} & \multicolumn{2}{|c|}{\textbf{\Large{Paramètres}}} \\ \hline \multicolumn{2}{|c||}{\Large{\textbf{Contextes}}} & \textbf{Globaux: $\beta$} & \textbf{Individuels: $(\theta_{1},...,\theta_{K})$} \\ \hline\hline \textbf{Constants} & \textbf{Individuels: $x_{i}$} &$x_{i}^{\top}\beta$ & $x_{i}^{\top}\theta_{i}$\\ \hline \multirow{2}{*}{\textbf{Variables}} & \textbf{Communs: $x_{t}$ } & \cellcolor{gray} & $x_{t}^{\top}\theta_{i}$ \\ \cline{2-4} & \textbf{Globaux: $x_{i,t}$} & $x_{i,t}^{\top}\beta$ & $x_{i,t}^{\top}\theta_{i}$ \\ \hline \end{tabular} \caption[Configurations bandit contextuel]{Différentes instances possibles du bandit contextuel linéaire à $K$ bras.} \label{tab:configBanditCtxt} \end{tableth} \begin{comment} De nombreuses instances de ce problème existent, selon si l'on considère des contextes communs à toutes les actions, ou propres à chacune. De plus ces contextes peuvent être considérés constants ou variants dans le temps. En effet, on peut considérer un contexte global fixe, ou variant à chaque itération, mais aussi des contextes individuels sur chaque bras, pouvant également être fixes (modélisant un profil pour chaque action) ou variables. Par exemple, l'utilisation d'un contexte fixe commun à tous les bras peut permettre d'accélérer la sélection des meilleurs bras en apprenant des zones de l'espace des récompenses pertinentes. Par ailleurs, la prise en compte du/des contexte(s), c'est-à-dire les paramètres liant les contextes aux actions, peut également être commune ou individuelle. Toutes les combinaisons entre ces différentes variantes sont envisageables, le point commun étant l'hypothèse de linéarité entre les contextes et les récompenses. Le tableau \ref{tab:configBanditCtxt} référence les différents cas possibles en donnant pour chacun la manière dont est déterminée l'espérance de la récompense de chaque action. Dans celui-ci, les poids du modèle linéaires sont notés $\beta$ lorsqu'ils sont communs et $\theta_{i}$ (pour chaque action $i$) lorsqu'ils sont individuels. Les contextes sont d'une façon générale notés $x$, et l'utilisation des indices permet d'identifier le cas d'étude (individuel/commun et constant/variable). \begin{tableth} \setlength\extrarowheight{5pt} \begin{tabular}{|c|c||c|c|c|} \hline \multicolumn{2}{|c||}{\cellcolor{black}} & \multicolumn{3}{|c|}{\textbf{\Large{Paramètres}}} \\ \hline \multicolumn{2}{|c||}{\Large{\textbf{Contextes}}} & \textbf{Communs: $\beta$} & \textbf{Individuels: $(\theta_{1},...,\theta_{K})$} & \textbf{Hybride: $\beta$ et $(\theta_{1},...,\theta_{K})$} \\ \hline\hline \multirow{2}{*}{\textbf{Constants}} & \textbf{Communs: $x$} & \cellcolor{gray} & $x^{\top}\theta_{i}$ &\cellcolor{gray} \\ \cline{2-5} & \textbf{Individuels: $x_{i}$} & $x_{i}^{\top}\beta$ & $x_{i}^{\top}\theta_{i}$ &$x_{i}^{\top}\beta + z_{i}^{\top}\theta_{i}$ \\ \hline \multirow{2}{*}{\textbf{Variables}} & \textbf{Communs: $x_{t}$ } & \cellcolor{gray} & $x_{t}^{\top}\theta_{i}$ &\cellcolor{gray} \\ \cline{2-5} & \textbf{Individuels: $x_{i,t}$} & $x_{i,t}^{\top}\beta$ & $x_{i,t}^{\top}\theta_{i}$ & $x_{i,t}^{\top}\beta + z_{i,t}^{\top}\theta_{i}$ \\ \hline \end{tabular} \caption[Configurations bandit contextuel]{Différentes instances possibles du bandit contextuel linéaire à $K$ bras.} \label{tab:configBanditCtxt} \end{tableth} Deux exemples d'applications concrets sont explicités ci-dessous: \begin{itemize} \item \textit{Contextes individuels variables et paramètres individuels}: ici, on fait l'hypothèse qu'il existe des paramètres $\theta_{i}\in \mathbb{R}^{p}$ spécifiques à chaque bras tel que: $r_{i,t} = x_{i,t}^{\top}\theta_{i} + \eta_{i,t}$. Dans un scénario de recommandation d'articles $x_{i,t}$ représente les caractéristiques de l'article $i$ à l'instant $t$, lorsqu'un utilisateur visite un site internet. Comme le précisent les auteurs de \cite{banditCtxtLinUCB}, ce vecteur peut contenir des informations relatives à l'utilisateur présent. De cette façon, chaque publicité possède un paramètre $\theta_{i}$ qui lui est propre, lui permettant de s'adapter à des profils d'utilisateur; \item \textit{Hybride}: dans cette instance, on a non seulement des contextes individuels variables et des paramètres individuels, mais aussi un paramètre commun à tous les bras, notés $\beta$. Pour différencier la partie du contexte lié aux paramètres communs et celle liée aux contextes individuels, on distingue $x_{i,t}$ et $z_{i,t}$ de telle sorte que: $r_{i,t} = x_{i,t}^{\top}\beta + z_{i,t}^{\top}\theta_{i} + \eta_{i,t}$. Le paramètre $\beta$ permet de partager des informations entre les différentes actions. Dans le scénario de recommandation d'articles \cite{banditCtxtLinUCB}, le vecteur $x_{i,t}$ correspond à des attributs partagés entre les articles; \end{itemize} Dans ce qui suit, nous étudions le cas où les contextes de chaque action sont individuels et variables au cours du temps, et dont les poids sont partagés. Formellement, nous faisons l'hypothèse de linéarité suivante: \end{comment} Dans ce qui suit, nous étudions le cas où les contextes de chaque action sont individuels et variables au cours du temps, et dont les paramètres de prise en compte sont partagés. Formellement, nous faisons l'hypothèse de linéarité suivante : \begin{equation} \exists \beta \in \mathbb{R}^{d} \text{ tel que } r_{i,t} = x_{i,t}^{\top}\beta + \eta_{i,t} \end{equation} Où $\eta_{i,t}$ est un bruit sous-gaussien de moyenne nulle et de constante caractéristique $R$, c'est à dire: $\forall \lambda \in \mathbb{R}: \mathbb{E}[e^{\lambda\eta_{i,t}}|\mathcal{H}_{t-1}] \leq e^{\lambda^{2}R^{2}/2}$ avec $\mathcal{H}_{t-1}=\left\{(i_{s},x_{i_{s},s},r_{i_{s},s})\right\}_{s=1..t-1}$. Soulignons qu'un bruit gaussien $\mathcal{N}(0,\sigma^{2})$ est sous-gaussien de constante $\sigma$ et qu'une variable uniforme dans l'intervalle $[-a,a]$ est aussi sous-gaussienne de constante $a$ (voir \cite{subGaussian} pour plus de résultats sur les variables aléatoires sous-gaussiennes). Ainsi, étant donné un ensemble $\mathcal{K}$ de $K$ actions, le problème du bandit contextuel procède de la façon suivante à chaque itération $t \in \left\{ 1, 2, 3,\ldots, T\right\}$: \begin{enumerate} \item Pour tout $i \in \left\{1,...,K\right\}$, observer $x_{i,t}\in \mathbb{R}^{d}$, le vecteur de contexte de chaque action $i$; \item En utilisant les observations historiques, sélectionner l'action $i_{t}$ et recevoir la récompense $r_{i_{t},t}$; \item Améliorer la stratégie de décision en considérant la nouvelle observation $(i_{t},x_{i_{t},t},r_{i_{t},t})$. \end{enumerate} \begin{note} Dans cette thèse, on s'intéresse principalement à une structure linéaire entre les récompenses des actions, mais d'autres possibilités existent. En particulier, l'utilisation d'un graphe sous jacent peut également permettre de structurer les actions entre elle et améliorer l'exploration (voir la section \ref{graphBanditEtatArt}). D’autre part, le lecteur intéressé pourra se référer au travail de \cite{banditUnimodal} lorsqu'on fait l'hypothèse d'une structure unimodale et à celui de \cite{banditXArmed} lorsqu'il s'agit d'une structure lipchitzienne. Notons qu'il est possible de travailler dans des espaces d'actions continues, par conséquent avec un nombre d'actions infini (nous faisons un point sur ce sujet dans la section \ref{sectionOFUL}). \end{note} Dans la partie suivante, on définit la notion de regret pour le problème du bandit contextuel, puis nous présenterons un certain nombre d'algorithmes de l'état de l'art permettant de tirer profit des contextes décisionnels observés. \subsection{Regret} Tout comme dans le cadre du bandit stochastique, on définit la notion de regret, qui quantifie la qualité d'un algorithme par rapport à une stratégie optimale. Ici, la stratégie optimale est définie par un oracle ayant connaissance du paramètre $\beta$ et qui choisirait à chaque instant l'action $ i_{t}^{\star}=\argmax\limits_{i\in \left\{ 1,..., K\right\}} x_{i,t}^{\top}\beta$. \begin{defi} \label{defRegCtxt} Dans le cadre du bandit contextuel le regret est défini par: \begin{equation} R_{T}=\sum\limits_{t=1}^{T} r_{i_{t}^{\star},t}-r_{i_{t},t} \end{equation} \end{defi} \begin{defi} \label{defPseudoRegCtxt} On définit également le pseudo-regret, calculé en prenant l'espérance du regret: \begin{equation} \hat{R}_{T}=\sum\limits_{t=1}^{T} x_{i_{t}^{\star},t}^{\top}\beta - x_{i_{t},t}^{\top}\beta \end{equation} \end{defi} Dans la pratique, on cherchera à borner le pseudo-regret d'un algorithme avec une forte probabilité pour en analyser les performances théoriques. Pour deux fonctions $f$ et $g$ à variable entière, on utilisera la notation $f=\mathcal{O}(g)$ s'il existe une constante $C$ et un entier $M$ tels que $f(n)\leq Cg(n), \forall n\geq M$. \begin{theo}[Borne inférieure] D'après \cite{banditCtxtLinUCBpreuve}, pour tout algorithme de bandit contextuel linéaire il existe une constante $\gamma>0$, telle que pour $T \geq d^{2}$: \begin{equation} \label{borneInfRegCtxt} \hat{R}_{T} \geq \gamma \sqrt{dT} \end{equation} \end{theo} Ce théorème décrit une borne inférieure du pseudo-regret de tout algorithme de bandit contextuel linéaire, définissant les performances de la meilleure politique atteignable. \subsection{Algorithmes} Pour les trois algorithmes que nous allons décrire, nous utiliserons les notations matricielles suivantes: \begin{itemize} \item $D_{t}$ la matrice de taille $t \times d$ des contextes correspondant aux actions sélectionnées jusqu'au temps $t$: $D_{t}=\left(x_{i_{s},s}^{\top}\right)_{s=1..t}$; \item $c_{t}$ le vecteur de taille $t$ des récompenses reçues jusqu'au temps $t$: $c_{t}=\left(r_{i_{s},s}\right)_{s=1..t}$; \item $V_{t}=D_{t}^{\top}D_{t}+\lambda I$, avec $I$ la matrice identité de taille $d$; \item $b_{t}=D_{t}^{\top}c_{t}$ (vecteur de taille $d$). \end{itemize} \subsubsection{Algorithme \texttt{LinUCB}} L'algorithme \texttt{LinUCB} fut introduit par \cite{banditCtxtLinUCB}. Nous présentons ici une formulation légèrement différente, à savoir celle de \cite{banditCtxtLinUCBpreuve}, qui correspond à notre instance avec contextes individuels et paramètres communs. Cet algorithme fait usage des paires (contexte,récompense) observées dans le passé pour apprendre un estimateur $\hat{\beta}_{t}$ du paramètre $\beta$, avec un certaine confiance, permettant de dériver un intervalle de confiance pour chaque action. De cette façon, il est possible de définir une politique optimiste sélectionnant l'action ayant la borne supérieure de l'intervalle de confiance la plus élevée. On note $\hat{\beta}_{t}$ la solution du problème de régression linéaire $l^{2}$-régularisé avec coefficient de régularisation $\lambda >0$ jusqu'au temps $t$: \begin{align*} \hat{\beta}_{t}&=\argmin\limits_{\beta}\sum\limits_{s=1}^{t} (r_{i_{s},s}-x_{i_{s},s}^{\top}\beta)^{2} +\lambda||\beta||^{2}\\ &=\argmin\limits_{\beta} ||c_{t}-D_{t}\beta||^{2}+\lambda||\beta||^{2} \\ &= \left(D_{t}^{\top}D_{t}+\lambda I\right)^{-1}D_{t}^{\top}c_{t} \\ &= V_{t}^{-1}b_{t} \end{align*} Le théorème suivant définit l'intervalle de confiance associé à chaque action $i$ au temps $t$ (avant d'effectuer la sélection de $i_{t}$) en fonction des paramètres de l'estimateur de $\beta$. \begin{prop} \cite{banditCtxtLinUCB} Soit $0<\delta<1$, alors avec une probabilité au moins égale à $1-\delta$ on a pour toute action $i$ et à chaque instant $t \geq 1$: \begin{equation} |x_{i,t}^{\top}\hat{\beta}_{t-1}-x_{i,t}^{\top}\beta|\leq \alpha \sqrt{x_{i,t}^{\top}V_{t-1}^{-1}x_{i,t}} \end{equation} Avec $\alpha=1+\sqrt{\dfrac{\log(2/\delta)}{2}}$, en utilisant les conventions $A_{0}=\lambda I$ et $b_{0}=0$ le vecteur nul de taille $d$. \end{prop} Ainsi, on peut définir une borne supérieure de l'intervalle de confiance avec une probabilité $\delta$, notée $s_{i,t}$, de l'action $i$ à l'instant $t$ telle que: $s_{i,t}=x_{i,t}^{\top}\hat{\beta}_{t-1}+\alpha \sqrt{x_{i,t}^{\top}V_{t-1}^{-1}x_{i,t}}$. Le paramètre $\alpha$, qui dépend de $\delta$ permet de régler l'exploration. Si l'on souhaite un algorithme dont la composante exploratoire est élevée, il faut choisir une valeur de $\delta$ faible, correspondant à un intervalle de confiance large, et donc un paramètre $\alpha$ élevé. La politique finale est décrite dans l'algorithme \ref{LinUCB}. \begin{algorithm}[h!] \KwIn{$\alpha >0$, $\lambda>0$} $V=\lambda I$\\ $b=0$\\ \For{$t=1..T$}{ $\hat{\beta}=V^{-1}b$\\ \For{$i=1..K$}{ Observer contexte $x_{i,t}$ \\ Calculer $s_{i,t}=x_{i,t}^{\top}\hat{\beta}+\alpha \sqrt{x_{i,t}^{\top}V^{-1}x_{i,t}}$ \\ } Sélectionner $ i_{t} = \argmax\limits_{i \in \left\{1,...,K \right\}} s_{i,t} $\\ Recevoir récompense $r_{i_{t}}$\\ $V =V+x_{i_{t},t}x_{i_{t},t}^{\top}$\\ $b=b+r_{i_{t},t}x_{i_{t},t}$ } \caption{\texttt{LinUCB} \cite{banditCtxtLinUCBpreuve}} \label{LinUCB} \end{algorithm} \begin{note} La mise à jour des paramètres de l'algorithme d'un temps à un autre ne nécessite pas de conserver en mémoire l'intégralité des contextes et récompenses passés. En effet, les matrices $V_{t}$ et le vecteur $b_{t}$ sont mis à jour grâce aux formules de récurrence suivantes: \begin{itemize} \item $V_{t}=V_{t-1}+x_{i_{t},t}x_{i_{t},t}^{\top}$ ; \item $b_{t}=b_{t-1}+r_{i_{t},t}x_{i_{t},t}$. \end{itemize} \end{note} Bien que l'algorithme \texttt{LinUCB} classique soit extrêmement performant et rapide d'un point de vue expérimental \cite{banditCtxtLinUCB}, son analyse théorique pose des difficultés techniques. En effet, comme le font remarquer les auteurs dans \cite{banditCtxtLinUCBpreuve}, pour pouvoir utiliser l'inégalité de Azuma-Hoeffding dans l'analyse de son regret, il faut que les estimateurs de récompenses à chaque itération proviennent d'une combinaison linéaire de récompenses passées indépendantes. Or, l'algorithme \texttt{LinUCB} calcule un estimateur de $\beta$ qui dépend des choix précédents. Pour outrepasser cette difficulté, les auteurs proposent une modification de \texttt{LinUCB}, appelée \texttt{SupLinUCB}, garantissant une estimation des paramètres indépendante des décisions passées, en maintenant différents ensembles d'apprentissage en parallèle afin d'isoler la constitution de ces ensembles du processus de sélection. Bien que bien moins performant que \texttt{LinUCB} du fait de la dispersion des observations sur les différents ensembles d'apprentisage, \texttt{SupLinUCB} permet de garantir la borne supérieure du regret sous-linéaire présentée ci-dessous. \begin{theo} \cite{banditCtxtLinUCBpreuve} Soit $0<\delta<1$. Si $\forall i, \forall t: ||x_{i,t}|| \leq 1$, $0\leq||r_{i,t}||\leq 1$ et $||\beta || \leq 1$ alors avec une probabilité au moins égale à $1-\delta$, le pseudo-regret de l'algorithme \texttt{SupLinUCB} est tel que: \begin{equation} \hat{R}_{T} = \mathcal{O}\left(\sqrt{dT\log^{3}\left(\dfrac{KT\log(T)}{\delta}\right)}\right) \end{equation} \end{theo} Cette borne est dite optimale à un facteur logarithmique près. \subsubsection{Algorithme \text{OFUL}} \label{sectionOFUL} L'algorithme \texttt{OFUL} (Optimism in the Face of Uncertainty Linear) présenté dans \cite{OFUL} est un algorithme optimiste traitant le problème du bandit contextuel linéaire, dans lequel l'espace des actions peut être continu. Cette instance spécifique du bandit contextuel fut auparavant étudiée par \cite{Dani2008} puis par \cite{Tsitsiklis2008}. Nous verrons par la suite que l'on peut aisément adapter cet algorithme au cas discret. Commençons par présenter le problème sous sa forme générique. A chaque instant $t$, l'agent décisionnel doit choisir une action $x_{t}$ dans un espace $\mathcal{D}_{t} \subset \mathbb{R}^{d}$. La récompense associée à cette action est toujours égale à $r_{t}=x_{t}^{\top}\beta+\eta_{t}$, avec $\beta \in \mathbb{R}^{d}$ et $\eta_{t}$ un bruit sous-gaussien de constante $R>0$. Soit $\hat{\beta}_{t}$ la solution du problème de régression linéaire $l^{2}$-régularisé avec coefficient de régularisation $\lambda >0$ jusqu'au temps $t$. Comme précédemment on a: $\hat{\beta}_{t}=\left(D_{t}^{\top}D_{t}+\lambda I\right)^{-1}D_{t}^{\top}c_{t}$. \cite{OFUL} montre qu'à un instant $t$, le véritable paramètre appartient à un ellipsoïde centré sur l'estimateur $\hat{\beta}_{t}$, noté $\mathcal{C}_{t}$ avec une certaine probabilité, selon la théorie des processus auto normalisés de \cite{PenaLaiShao2009}. Dans la suite, on note $||x||_{A}=\sqrt{x^{\top}Ax}$ la norme induite par une matrice définie positive $A$. \begin{theo} \label{ellipOFUL} Soit $\delta > 0$ et $\lambda >0$. Si $||\beta|| \leq S$, alors avec une probabilité au moins égale à $1-\delta$: \begin{equation} \label{ellipOFULEq} \beta \in \mathcal{C}_{t} = \left\{\tilde{\beta} \in \mathbb{R}^{d}: ||\hat{\beta}_{t}-\tilde{\beta} ||_{V_{t}} \leq R\sqrt{2\log\left(\dfrac{det(V_{t})^{1/2}det(\lambda I)^{-1/2}}{\delta}\right )}+\lambda^{1/2}S \right\} \end{equation} \end{theo} Cet ellipsoïde de confiance est plus serré que celui trouvé précédemment par \cite{Dani2008} ou \cite{Tsitsiklis2008}, pour cette raison nous ne présentons pas les algorithmes associés à ces deux publications. Le lecteur intéressé pourra se référer à \cite{OFUL} pour une comparaison exhaustive. A un instant $t$, l'agent décisionnel est en mesure de calculer $\mathcal{C}_{t-1}$ en fonction des choix passés. L'idée de l'algorithme est de calculer un estimateur optimiste $\tilde{\beta}_{t-1}=\argmax\limits_{\tilde{\beta}\in \mathcal{C}_{t-1}}( \max\limits_{x\in \mathcal{D}_{t} } (x^{\top}\tilde{\beta}))$ puis de choisir $x_{t}=\argmax\limits_{x\in \mathcal{D}_{t}} x^{\top}\tilde{\beta}_{t-1}$. Dans l'article original, les auteurs proposent la notation compacte suivante : $(x_{t},\tilde{\beta}_{t-1})=\argmax\limits_{(x,\tilde{\beta})\in \mathcal{D}_{t}\times \mathcal{C}_{t-1}} x^{\top}\tilde{\beta}$. La politique associée est détaillée dans l'algorithme \ref{OFUL}. \begin{algorithm}[h!] Initialiser $\mathcal{C}_{0}$ (équation \ref{ellipOFULEq})\\ \For{$t=1..T$}{ $(x_{t},\tilde{\beta}_{t-1})=\argmax\limits_{(x,\tilde{\beta})\in \mathcal{D}_{t}\times \mathcal{C}_{t-1}} x^{\top}\tilde{\beta}$ \\ Sélectionner $x_{t}$\\ Recevoir récompense $r_{t}$\\ Mettre à jour $\mathcal{C}_{t}$ (équation \ref{ellipOFULEq}) } \caption{\texttt{OFUL} \cite{OFUL}} \label{OFUL} \end{algorithm} Bien que dans le cas continu, où l'espace $\mathcal{D}_{t}$ peut être complexe, la résolution du problème d'optimisation $(x_{t},\tilde{\beta}_{t-1})=\argmax\limits_{(x,\tilde{\beta})\in \mathcal{D}_{t}\times \mathcal{C}_{t-1}} x^{\top}\tilde{\beta}$ puisse s'avérer très compliquée, dans le cas qui nous intéresse dans cette thèse, c.-à-d. le cas discret ($\mathcal{D}_{t}=\left\{x_{1,t},...,x_{K,t}\right\}$), on a: $$i_{t} = \argmax\limits_{i \in \left\{1,...,K\right\}} \left( x_{i,t}^{\top}\hat{\beta}_{t-1}+\left(R\sqrt{2\log\left(\dfrac{det(V_{t-1})^{1/2}det(\lambda I)^{-1/2}}{\delta}\right )}+\lambda^{1/2}S\right)||x_{i,t}||_{V_{t-1}^{-1}}\right)$$ Si l'on note $\alpha_{t-1}=R\sqrt{2\log\left(\dfrac{det(V_{t-1})^{1/2}det(\lambda I)^{-1/2}}{\delta}\right )}+\lambda^{1/2}S$, l'algorithme \texttt{OFUL} consiste à sélectionner l'action ayant le score $s_{i,t}=x_{i,t}^{\top}\hat{\beta}_{t-1}+\alpha_{t-1} \sqrt{x_{i,t}^{\top}V_{t-1}^{-1}x_{i,t}}$ le plus élevé. Ce score ressemble fortement au score utilisé dans \texttt{LinUCB}, sauf qu'ici, le paramètre d'exploration $\alpha_{t-1}$ varie au cours du temps. \begin{theo} \cite{OFUL} Soit $0<\delta<1$. Si l’on fait l'hypothèse que $||\beta|| \leq S$ et que $|x^{\top}\beta|\leq 1$, alors avec une probabilité au moins égale à $1-\delta$, le pseudo-regret de l'algorithme \texttt{OFUL} est tel que: \begin{equation} \hat{R}_{T} = \mathcal{O}\left( d\log(T)\sqrt{T}+\sqrt{dT\log\left(\dfrac{T}{\delta}\right)}\right) \end{equation} \end{theo} Cette borne a l'avantage d'être relativement serrée, avec un algorithme relativement simple à implémenter. En effet il possède la même complexité que \texttt{LinUCB}, pour une borne du même ordre que \texttt{SupLinUCB}, beaucoup plus lourd à mettre en œuvre. \begin{note} Il existe une version allégée de l'algorithme \texttt{OFUL}, nommée \texttt{Rarely Switching OFUL} ne nécessitant qu'un nombre restreint de mises à jour du paramètre $\tilde{\beta}_{t}$. Ce dernier n'est alors recalculé que lorsque le réel $det(V_{t})$ augmente d'un facteur $(1+C)$ où $C$ est un paramètre de l'algorithme. Cet algorithme possède une borne supérieure du regret du même ordre que l'algorithme \texttt{OFUL} pour un coût bien moindre. \end{note} \subsubsection{\texttt{Thompson sampling} contextuel} \label{TSLinBanditEtatArt} Sur le même principe que l'algorithme de \texttt{Thompson sampling} dans le cas du bandit stochastique, il s'agit d'un algorithme bayésien qui fut analysé par \cite{banditThompsonCtxtPreuve} pour le bandit contextuel linéaire. Ce type d'approche fut dans un premier temps remarqué grâce au travail de \cite{banditThompsonCtxtEmpirical}, dans lequel les auteurs en ont montré les performances empiriques dans un cas concret d'application concernant la publicité en ligne. Comme dans le cas stochastique, le \texttt{Thompson sampling} nécessite de spécifier deux distributions: \begin{itemize} \item Une distribution \textit{a priori} sur le paramètre inconnu $\beta$: $p(\beta)$; \item Une vraisemblance des récompenses $r_{i,t}$: $p(r_{i,t}|\beta)$. \end{itemize} Cela permet, grâce au théorème de Bayes, de maintenir une distribution \textit{a posteriori} sur le paramètre $\beta$ à mesure que les exemples d'apprentissages arrivent, c.-à-d à un instant $t$: $p(\beta|\mathcal{H}_{t-1})\propto \prod\limits_{s=1}^{t-1}p(r_{i_{s},s}|\beta)p(\beta)$. Soient les distributions suivantes: \begin{itemize} \item $p(\beta)=\mathcal{N}\left(\beta;0,\sigma^{2} I\right)$; \item $p(r_{i,t}|\beta)=\mathcal{N}\left(r_{i,t};x_{i,t}^{\top}\beta,\sigma^{2}\right)$. \end{itemize} On peut alors déterminer $p(\beta|\mathcal{H}_{t-1})$ en fonction des observations réalisées jusqu'au temps $t-1$: \begin{align*} p(\beta|\mathcal{H}_{t-1}) & \propto \prod\limits_{s=1}^{t-1} \exp\left(-\dfrac{1}{2\sigma^{2}}(r_{i_{s},s}-x_{i_{s},s}^{\top}\beta)^{2}\right) \exp\left(-\dfrac{\beta^{\top}\beta}{2\sigma^{2}}\right)\\ &=\exp\left(-\dfrac{1}{2\sigma^{2}}\left( \sum\limits_{s=1}^{t-1}(r_{i_{s},s}-x_{i_{s},s}^{\top}\beta)^{2} + \beta^{\top}\beta \right) \right)\\ &= \exp\left(-\dfrac{1}{2\sigma^{2}}\left( (c_{t-1}-D_{t-1}\beta)^{\top}(c_{t-1}-D_{t-1}\beta) + \beta^{\top}\beta \right) \right) \end{align*} En remaniant les termes présents dans cette formule et en utilisant le fait que le terme $c_{t-1}^{\top}c_{t-1}$ ne dépend pas de $\beta$, on arrive à: $p(\beta|\mathcal{H}_{t-1})\propto \exp\left(-\dfrac{1}{2\sigma^{2}}\left( (\beta - V_{t-1}^{-1}b_{t-1})^{\top}V_{t-1}(\beta - V_{t-1}^{-1}b_{t-1}) \right) \right)$, avec $V_{t-1}=D_{t-1}^{\top}D_{t-1}+ I$ et $b_{t-1}=D_{t-1}^{\top}c_{t-1}$. Ceci correspond à une densité de probabilité représentant une loi gaussienne $\mathcal{N}(\beta; V_{t-1}^{-1}b_{t-1},\sigma^{2}V_{t-1}^{-1})$. Remarquons que la matrice $V_{t-1}$ est toujours définie positive et par conséquent la densité est toujours bien définie. La politique finale, décrite dans l'algorithme \ref{TSContextLin}, échantillonne la paramètre $\tilde{\beta}$ selon cette loi gaussienne et sélectionne l'action $i_{t}=\argmax\limits_{i \in \left\{1,...,K \right\}} x_{i,t}^{\top}\tilde{\beta}$ \begin{algorithm}[h!] $V=I$\\ $b=0$\\ \For{$t=1..T$}{ $\hat{\beta}=V^{-1}b$\\ Échantillonner $\tilde{\beta}\sim \mathcal{N}(\hat{\beta}, \sigma^{2}V^{-1})$\\ \For{$i=1..K$}{ Observer contexte $x_{i,t}$ \\ } Sélectionner $ i_{t} = \argmax\limits_{i \in \left\{1,...,K \right\}} x_{i,t}^{\top}\tilde{\beta} $\\ Recevoir récompense $r_{i_{t}}$\\ $V=V+x_{i_{t},t}x_{i_{t},t}^{\top}$\\ $b=b+r_{i_{t},t}x_{i_{t},t}$ } \caption{\texttt{Thompson sampling} contextuel linéaire \cite{banditThompsonCtxtPreuve}} \label{TSContextLin} \end{algorithm} \begin{note} Finalement pour chaque action $i$ à l'instant $t$, une fois son contexte observé, la variable aléatoire $\mathbb{E}[r_{i,t}]=x_{i,t}^{\top}\beta$ suit une loi gaussienne unidimensionnelle $\mathcal{N}(x_{i,t}^{\top}V_{t-1}^{-1}b_{t-1},\sigma^{2}x_{i,t}^{\top}V_{t-1}^{-1}x_{i,t})$, d'où l'on peut directement retrouver l'intervalle de confiance utilisé dans l'algorithme \texttt{LinUCB}. \end{note} \begin{theo} \cite{banditThompsonCtxtPreuve} Soit $0<\delta<1$, $0<\epsilon<1$ et $\sigma^{2}=R\sqrt{\dfrac{24}{\epsilon}d\log\left(\dfrac{1}{\delta}\right)}$. Si $\forall i, \forall t: ||x_{i,t}|| \leq 1$ et $||\beta || \leq 1$ alors avec une probabilité au moins égale à $1-\delta$, le pseudo-regret de l'algorithme \texttt{Thompson sampling} contextuel linéaire est tel que: \begin{equation} \hat{R}_{T} = \mathcal{O}\left(\dfrac{d^{2}}{\epsilon}\sqrt{T^{1+\epsilon}}\log(dT)\log\left(\dfrac{1}{\delta}\right)\right) \end{equation} \end{theo} Ce théorème fut le premier résultat théorique établi sur les \texttt{Thompson sampling} contextuel. La borne proposée, bien que non optimale au sens où elle n'est pas exactement égale à la valeur de la borne inférieure, s'en rapproche à un terme logarithmique près. \section{Bandit avec sélections multiples} \label{banditMultSel} Le problème du bandit avec sélections multiples est une extension du problème du bandit traditionnel dans le cas où l'agent sélectionne plus d'une action à chaque itération. On notera $\mathcal{K}_{t} \subset \mathcal{K}$ l'ensemble des actions sélectionnées et $k$ le nombre d'éléments qu'il contient ($k=|\mathcal{K}_{t}|$), c'est-à-dire le nombre d'actions à sélectionner. Notons que $k$ est un paramètre du problème fixé à l'avance dans notre cas. Le problème se décline sous les mêmes formes que dans le cas traditionnel, à savoir le cas stochastique et le cas contextuel, que l'on propose de détailler ci-dessous. Finalement, nous nous restreignons ici au cas où la récompense associée à $k$ actions est la somme des récompenses individuelles. Cette instance spécifique est incluse dans un champ de recherche désignée sous l'appellation anglophone \textit{Combinatorial optimization with semi-bandit feedback} \cite{combOptSemiBandit}. Notons toutefois que des structures de récompenses plus complexes peuvent également être considérées. Le cas générique où la récompense de $k$ actions est une fonction lipschitzienne des $k$ récompenses individuelles est présenté dans \cite{banditCombinatoire} pour le bandit stochastique et dans \cite{banditCtxtCombLinUCB} pour le bandit contextuel. \subsection{Cas stochastique} Le bandit stochastique avec sélections multiples fut dans un premier temps introduit par \cite{banditThompsonCombinatorialLowerBound}. Dans ce travail, les auteurs proposent une borne inférieure du regret ainsi qu'un algorithme permettant d'atteindre cette borne. Cependant, leur méthode très complexe d'un point de vue calculatoire n'est pas aisée à implémenter de façon efficace. Plus récemment, \cite{banditCombinatoire} et \cite{banditCombinatoireESCB} ont proposé respectivement \texttt{CUCB} et \texttt{ESCB}, des algorithmes de type UCB permettant une implémentation efficace et rapide. D'autre part, \cite{banditThompsonComplexProblem} ont étendu la méthode de Thompson sampling à une classe plus large de problèmes, incluant celui qui nous intéresse ici. Dans les deux cas, les auteurs montrent une borne supérieure du regret pour l'algorithme associé, mais cette dernière n'est pas optimale. Finalement, dans les travaux récents de \cite{banditThompsonCombinatorialProof}, un algorithme de Thompson Sampling spécifique au cas du bandit stochastique avec sélections multiples est proposé et son optimalité est également démontrée lorsque les récompenses suivent des lois de Bernoulli. On suppose que les moyennes des actions sont distinctes et ordonnées de la façon suivante, c.-à-d. $\mu_{1} > \mu_{2} >...> \mu_{K}$ et on note $\mathcal{K}^{\star}$ l'ensemble des $k$ actions optimales $\left\{1,,...,k\right\}$. Évidemment les algorithmes n'ont pas connaissance de cette relation d'ordre. \begin{defi} \label{regretCumultoPseudoMP} Le pseudo-regret dans le cas du bandit stochastique avec sélections multiples est défini par: \begin{equation} \hat{R}_{T}= \mathbb{E}\left[\sum\limits_{t=1}^{T} \left( \sum\limits_{i\in \mathcal{K}^{\star}} \mu_{i} - \sum\limits_{i\in \mathcal{K}_{t}} \mu_{i}\right) \right] \end{equation} \end{defi} Contrairement au cas classique, le regret ici ne dépend pas uniquement du nombre de fois ou les actions sous-optimales ont été sélectionnées. En effet, ce dernier dépend fortement de la structure combinatoire des récompenses. Pour illustrer cela nous présentons ci-dessous un exemple évoqué dans \cite{banditThompsonCombinatorialProof}: on prend $K=4$, $k=2$, $T=2$ et $(\mu_{1},\mu_{2},\mu_{3},\mu_{4}) =(0.10,0.09,0.08,0.07)$ et on propose de comparer deux scénarios. Dans le premier on prend $\mathcal{K}_{1}=\left\{1,2\right\}$, $\mathcal{K}_{2}=\left\{3,4\right\}$ et dans le second $\mathcal{K}_{1}=\left\{1,3\right\}$, $\mathcal{K}_{2}=\left\{1,4\right\}$. Ainsi le regret du premier vaut $\hat{R}_{2}=0.04$ et dans le second $\hat{R}_{2}=0.03$. Or dans les deux cas on a $N_{3,2}=1$ et $N_{4,2}=1$ et donc bien que les actions sous-optimales aient été jouées le même nombre de fois le regret est différent. Par conséquent pour atteindre un regret optimal, un algorithme ne peut se limiter à sélectionner les actions sous-optimales le moins de fois possibles. En se basant sur ce constat \cite{banditThompsonCombinatorialLowerBound} ont montré que le pseudo-regret est minoré par une fonction dépendant du nombre de fois où les actions sous optimales ont été sélectionnées: $\hat{R}_{T}\geq \sum\limits_{i\in \mathcal{K}\backslash \mathcal{K}^{\star}} (\mu_{k}-\mu_{i})\mathbb{E}[N_{i,T}]$, où $\mu_{k}$ est l'espérance de la moins bonne action optimale. Le théorème suivant établit une borne inférieure de $\mathbb{E}[N_{i,T}]$ pour chaque action $i$, d'où l'on peut déduire une borne inférieure du regret grâce à l'étude précédente. \begin{theo}[Borne inférieure] \label{infRegStoMP} D'après \cite{banditThompsonCombinatorialLowerBound}, pour toute politique telle que $\mathbb{E}[N_{i,T}]=o(T^{\beta})$ avec $0<\beta < 1$, on a: \begin{equation} \label{bonreInfnbPlayesMP} \liminf\limits_{T\rightarrow\infty} \dfrac{\mathbb{E}[N_{i,T}]}{\log(T)} \geq \dfrac{1}{KL_{inf}(i_{k},i)} \end{equation} Où l'on rappelle que $i_{k}$ désigne l'indice de la moins bonne action optimale. Ceci se traduit sur la borne inférieure du regret par: \begin{equation} \label{bonreInfRegMP} \liminf\limits_{T\rightarrow\infty} \dfrac{\hat{R}_{T}}{\log(T)} \geq \sum\limits_{i: \Delta_{i,k}>0} \dfrac{\Delta_{i,k}}{KL_{inf}(i_{k},i)} \end{equation} où $\Delta_{i,k}=\mu_{k}-\mu_{i}$ \end{theo} Pour un descriptif précis des algorithmes cités plus haut, nous orientons le lecteur vers les références correspondantes. Cependant, notons que dans le cas qui nous intéresse ici, à savoir celui où la récompense d'un ensemble de bras est égale à la somme des récompenses individuelles de chaque bras, ces algorithmes prennent une forme simplifiée. En effet, \texttt{CUCB} consiste à sélectionner les $k$ meilleurs bras, ordonnés selon un score \texttt{UCB} classique, tandis que \texttt{Thompson sampling} revient à échantillonner chaque bras indépendamment puis à sélectionner les $k$ meilleurs. \subsection{Cas contextuel} Le problème du bandit contextuel avec sélections multiples est une extension naturelle du cas contextuel traditionnel dans lequel à chaque itération $t$ et pour chaque action $i$, un vecteur de contexte $x_{i,t}$ est fourni à l'agent avant qu'il effectue sa sélection. Ce problème a été étudié et appliqué à un scénario de recommandation dans \cite{banditCtxtCombLinUCB}. Dans ce travail, les auteurs proposent l'algorithme \texttt{C$^{2}$UCB} (Contextual Combinatorial UCB) et une borne (non optimale) associée. Il s'agit d'une extension de l'algorithme \texttt{OFUL} au cas des sélections multiples. Dans notre cas il s'agit de sélectionner à chaque instant les $k$ actions ayant les meilleurs scores. On peut également étendre les autres algorithmes de bandit contextuel (\texttt{LinUCB}, \texttt{Thompson Sampling} etc.) à cette situation. Le pseudo-regret est défini de la façon suivante. \begin{defi} \label{defPseudoRegCtxtMP} Le pseudo-regret dans le cas du bandit contextuel avec sélections multiples est défini par: \begin{equation} \hat{R}_{T}=\sum\limits_{t=1}^{T} \left(\sum\limits_{i\in \mathcal{K}_{t}^{\star}} x_{i,t}^{\top}\beta - \sum\limits_{i\in \mathcal{K}_{t}} x_{i,t}^{\top}\beta\right) \end{equation} Où $\mathcal{K}_{t}^{\star}$ est l'ensemble des actions optimales c.-à-d. les $k$ actions ayant la plus grande valeur de $x_{i,t}^{\top}\beta$. \end{defi} \section{Bandit dans les graphes} \label{graphBanditEtatArt} Plusieurs travaux se sont intéressés à des problèmes de bandit dans lesquels une structure de graphe sous-jacente existe. Nous proposons dans cette section un aperçu de certains travaux, ce qui nous permettra par la suite de situer notre travail, en particulier dans le chapitre \ref{ModeleRelationnel}. Dans ce type de problème, l'agent décisionnel a la possibilité de tirer parti de cette structure, ce qui lui permet d'apprendre plus rapidement comparé au cas du bandit stochastique, où l'apprentissage est effectué sur chaque nœud séparément. En raison des nombreuses applications possibles, en particulier dans le marketing et la publicité en ligne, cette formulation du problème de bandits a connu un fort intérêt ces dernières années. Typiquement, le graphe peut être une représentation d'un réseau social dans lequel un nœud correspond à un utilisateur et une arrête à un lien social. Nous proposons ci-dessous de référencer les principales instances de ce problème: \begin{itemize} \item Les problèmes de bandits dans les graphes furent introduits dans \cite{banditNetworfFirst} pour le cas du bandit adverse puis dans \cite{banditNetwork1UCBN} pour le bandit stochastique. L'hypothèse sous-jacente est que lorsque l'on sélectionne une action, on reçoit la récompense associée, ainsi que celles de toutes les actions voisines (dans le graphe), permettant ainsi d'accélérer considérablement l'apprentissage. Ainsi, les algorithmes optimistes \texttt{UCB-N} et \texttt{UCB-MaxN}, proches de la politique \texttt{UCB} classique sont étudiés dans \cite{banditNetwork1UCBN}. Dans le premier, on utilise simplement le fait que l'on accumule plus de connaissances à chaque itération, nous permettant ainsi d'avoir un score UCB plus fin et de converger plus rapidement vers la solution optimale. Dans le second, on choisit dans un premier temps un nœud via un score UCB classique, et on sélectionne ensuite l'action ayant la meilleure moyenne empirique dans le voisinage de ce nœud. Ces méthodes permettent d'améliorer les garanties de convergence et en particulier d'ôter la dépendance explicite du regret en $K$, ce qui est bénéfique lorsque le nombre d'actions est important. Ces résultats ont ensuite été améliorés par \cite{banditNetwork2UCBLP} grâce à l'algorithme \texttt{UCB-LP}. \item D'autre part, le problème nommé \textit{spectral bandits} fut étudié dans \cite{spectralBandit} et \cite{spectralBandit2}. Dans cette configuration, on suppose une hypothèse de régularité sur le graphe, les nœuds connectés du réseau étant supposés se comporter de manière similaire. Les nœuds connectés ont alors tendance à posséder des distributions d'utilité proches, ce qui peut être exploité pour définir des stratégies efficaces : l'observation d'une récompense sur un noeud du réseau permet de faire des suppositions sur le niveau de récompense (que l'on n'a pas observé) pour tous les noeuds de son voisinage et ainsi accroître la vitesse d'apprentissage. \item Dans un autre cadre, les bandits contextuels ont également été étudiés lorsqu'une structure de graphe est présente. En particulier dans \cite{gangOfBandit} et \cite{clusteringOfBandit}, chaque nœud correspond à un bandit contextuel et les arêtes du graphe sont utilisées pour définir les similarités entre les poids des différents bandits. Dans \cite{gangOfBandit} (algorithme \texttt{Gob.Lin}) les poids des arêtes sont connus à l'avance et sont directement utilisés dans la stratégie de sélection. Dans \cite{clusteringOfBandit} (algorithme \texttt{CLUB}), les actions sont supposées appartenir à différents \textit{clusters}, inconnus à l'avance, caractérisant des similarités entre elles. Plus récemment, des approches utilisant les bandits dans des environnements collaboratifs ont été développées pour des problèmes de recommandation. On citera en particulier les travaux de \cite{banditCollaborative2} et \cite{banditCollaborative}, dans lesquels les algorithmes \texttt{CoLinUCB} et \texttt{COFIBA} sont développés. \item Dans un autre registre, les travaux récents de \cite{banditInfluence} traitent du problème de la maximisation de l'influence locale (c'est à dire chaque noeud ne peut influencer que ses voisins directes), dans lequel aucune connaissance du graphe n'est supposée \textit{a priori}. Une des applications de ce modèle concerne le marketing dans les réseaux sociaux, où les marques souhaitent tirer profit des utilisateurs les plus influents pour diffuser leurs produits. Le modèle suppose l'existence d'un graphe sous-jacent dont les poids des arcs modélise les probabilités d'influence des nœuds entre eux. A chaque itération, l'agent sélectionne un nœud, observe l'ensemble des nœuds influencés, et la récompense associée correspond au nombre de nœuds ayant été influencés. Les auteurs proposent une politique nommée \texttt{BARE} permettant à de maximiser les récompenses récoltées. Cet algorithme, dans lequel l'horizon $T$ doit être connu, extrait un sous-ensemble de nœuds après une phase d'exploration pure, puis un algorithme de bandit classique est appliqué à ce sous-ensemble pour trouver le plus influent. Notons que cette approche fait une hypothèse de stationnarité des récompenses. \end{itemize} Nous nous sommes volontairement limités au cadre du bandit stochastique et contextuel. Cependant, de nombreux travaux sur les problèmes de bandit adverse dans les graphes ont été formalisés. Nous orientons le lecteur intéressé vers les lectures suivantes : \cite{banditNetworfFirst}, \cite{advBanditGraph}, \cite{advBanditGraph2}, \cite{banditGraph}, \cite{advBanditGraph3}. \section{Bandit non stationnaire} \label{nonstatBanditEtatArt} Dans un certain nombre d'applications, des changements dans les distributions de récompense au cours du temps sont inhérents et doivent être pris en compte dans le modèle. En réalité, l'hypothèse de stationnarité, bien que permettant de caractériser très finement le regret, n'est souvent pas réaliste, comme le soulignent les auteurs dans \cite{nonStationaryBanditBound}. Ainsi, un champ de la littérature au sujet des bandits s'intéresse au cas où les récompenses sont non-stationnaires. Dans ce cas pour chaque action $i$, on note $\mu_{i}(t)$ la valeur moyenne de la récompense associée à un instant $t$. Si dans un problème de bandit stochastique traditionnel les performances d'un algorithme sont comparées à celles d'un oracle statique choisissant toujours la même action, ceci n'est plus pertinent dans le scénario non stationnaire. En effet, il convient de définir une autre notion de regret, mesurant les performances d'un algorithme par rapport à celle d'un oracle dynamique. \begin{defi} \label{defregNonStat} En notant $i_{t}^{\star}=\argmax\limits_{i\in \left\{1,...,K\right\}}$ l'action ayant la plus forte espérance à un instant $t$, le regret cumulé au temps $T$ est défini par: \begin{equation} \label{defregNonStatFormule} \hat{R}_{T}=\mathbb{E}\left[\sum\limits_{t=1}^{T} \mu_{i_{t}^{\star}}(t) - \mu_{i_{t}}(t)\right] \end{equation} Où $\mathbb{E}[.]$ est l'espérance prise selon la politique de sélection considérée. \end{defi} L'expression "non stationnaire" étant relativement vague, il convient lors de chaque étude d'effectuer des hypothèses supplémentaires afin de cadrer le problème. Nous proposons ci-dessous différents scénarios ayant été étudiés concernant la façon dont cette instationnarité se manifeste: \begin{itemize} \item La première instance du bandit non stationnaire a été introduite dans \cite{restlessBandit}, où le terme \textit{restless bandit} fut introduit. Dans ce modèle l'état de chaque action est modifié à chaque itération selon un processus aléatoire\footnote{Lorsque seul l'état de l'action sélectionnée change à chaque itération, le problème et appelé \textit{rested bandit}.}. En partant de cette hypothèse, de nombreux processus ont ensuite été étudiés. Par exemple dans \cite{nonStationaryBanditBrown} les récompenses espérées de chaque action évoluent selon des mouvements browniens indépendants. D'autre part dans, \cite{restlessBandit2} et \cite{restlessBandit3}, un processus de Markov (MDP) discret régit l'évolution des différents états. Ainsi, pour chaque action, on suppose l'existence de probabilités de transition entre états (inconnues de l'agent), chaque état correspondant à une espérance de récompense différente (inconnue de l'agent). Notons que dans cette dernière approche, les états des différentes actions évoluent de façon indépendante. Par ailleurs, les travaux de \cite{restlessBanditLiva} étudient un autre instance du \textit{restless bandit}, dans le cas où les actions sont associées à des processus de mélange ($\phi$\textit{-mixing process}), et où, par conséquent, des dépendances entre les récompenses d'une même action à différents pas de temps existent \item Dans un autre contexte, le cas où l'espérance des récompenses varie de façon abrupte au cours du temps a été étudié dans \cite{nonStationaryBanditAbrupt}. Dans ce cas, on fait cependant l'hypothèse que le nombre de changements est limité. Si l'on note $\gamma_{T}$ le nombre de changements sur un horizon de taille $T$, alors les auteurs démontrent que la borne inférieure du regret associé est en $\mathcal{O}(\sqrt{\gamma_{T}T})$. Les auteurs étudient deux algorithmes permettant de traiter ce problème: \begin{itemize} \item Le premier, nommé \texttt{Dicounted UCB}, utilise un facteur de \textit{discount} pour estimer l'espérance des récompenses à un instant donné. Il est ainsi possible de régler l'importance que l'on donne aux exemples récents relativement aux exemples les plus anciens. Si l'on choisit $\gamma=1$ comme facteur de \textit{discount} alors cet algorithme est équivalent à l'algorithme \texttt{UCB} classique. Si le nombre de changements $\gamma_{T}$ est connu à l'avance, alors les auteurs démontrent que le regret est en $\mathcal{O}(\sqrt{\gamma_{T}T}\log(T))$. \item Le second, nommé \texttt{Sliding Window UCB}, utilise une fenêtre glissante permettant de ne prendre en compte les récompenses passées que sur un intervalle de taille fixe. Ainsi à un instant donné, au lieu d'utiliser un facteur de \textit{discount} comme dans \texttt{Dicounted UCB}, on calcule les scores de sélection de la même façon que dans un \texttt{UCB}, mais en utilisant uniquement les $\tau$ derniers pas de temps. Les auteurs montrent également que si l'on connaît $\gamma_{T}$ à l'avance, le regret est également en $\mathcal{O}(\sqrt{\gamma_{T}T}\log(T))$. \end{itemize} \item Plus récemment dans \cite{nonStationaryBanditBound}, les auteurs introduisent une notion de budget total de variation contraignant également les changements des valeurs espérées des récompenses. Cependant, ces contraintes sont moins fortes que dans les deux cas précédents, qui sont englobés dans le formalisme proposé. Dans ce modèle, les récompenses peuvent changer un nombre de fois arbitraire, mais c'est la variation totale des valeurs espérées, définie par $\sum\limits_{t=1}^{T-1}\sup\limits_{i\in \mathcal{K}} |\mu_{i}(t) - \mu_{i}(t+1) |$, qui est bornée. L'algorithme proposé dans ce travail est nommé \texttt{Rexp3}. \end{itemize} \begin{note} Le bandit contextuel permet de capter des variations d'utilités des récompenses en fonction d'un contexte décisionnel pouvant évolué dans le temps. Dans ce sens, il modélise des récompenses non stationnaires. Cependant, on considère généralement que les paramètres du modèle, c'est-à-dire les poids définissant la relation entre contextes et récompenses, sont constants au cours du temps. Des poids évoluant avec le temps pourraient également être considérés. Dans ce cadre, une démarche similaire à celle de l'algorithme \texttt{Sliding Window UCB} pourrait être appliquée, en restreignant l'apprentissage des poids du modèle à une fenêtre de temps. Cependant, les garanties théoriques de convergence ne seraient plus assurées a priori. \end{note} \part{Etat de l'art} \label{partEtatArt} \chapter[De la RI traditionnelle à l'exploitation en ligne des réseaux sociaux]{De la recherche d'information traditionnelle à l'exploitation en ligne des réseaux sociaux} \minitoc \newpage \label{EtatArtRI} Depuis l'apparition des réseaux sociaux, le mode de consommation de l'information sur internet a beaucoup évolué. Traditionnellement, le web d'une façon générale est considéré comme un répertoire géant, plus ou moins statique, dans lequel un ensemble de pages ou documents sont référencés dans un index. Pour accéder à un contenu particulier, un utilisateur d'internet doit traduire son besoin sous la forme d'une requête, à l'image d'une recherche sur le célèbre moteur Google. Aujourd'hui, grâce aux réseaux sociaux l'information nous arrive en temps réel, de façon continue, et provient de multiples sources. Ces trois facteurs ont révolutionné notre façon d'appréhender le web, dans lequel une multitude de "mini-sources" peuvent maintenant créer des contenus et les partager avec les autres utilisateurs en une fraction de seconde. La vision du web comme un répertoire statique semble alors dépassée. Nous proposons dans la suite de ce chapitre quelques éléments associés à cette conception, ce qui permettra de souligner en quoi ceux-ci ne sont pas adaptés au mode de fonctionnement du web actuel et des réseaux sociaux. Nous verrons par la suite que ces nouveaux médias requièrent la définition de nouveaux enjeux et par conséquent de nouvelles tâches de recherche, dont nous présenterons certains aspects. Nous positionnerons le problème de la collecte en temps réel traité dans cette thèse au fur et à mesure du discours. \section{Traitement de l'information hors-ligne} \subsection{Modèle classique} Depuis sa création au début des années 1990, Internet a connu une croissance exponentielle. De quelques centaines de sites, sa taille estimée dépasse aujourd’hui plusieurs dizaines de milliards de pages. Progressivement, les données qu'il contient sont devenues extrêmement intéressantes pour les entreprises, mais aussi les particuliers. Naturellement, la question de la récupération et de l'exploitation de cette source quasi inépuisable de données est apparue. C’est dans le cadre de cette problématique qu'a émergé le concept de \textit{crawling}, outil majeur de la collecte de données sur le web. Originellement, le \textit{crawling} consiste à parcourir et indexer le web afin d’en établir la cartographie, le but final étant de permettre à un moteur de recherche de trouver les documents les plus pertinents pour une requête donnée. Les trois principales étapes d'un processus de recherche d'information sont les suivantes : \begin{enumerate} \item Le \textit{crawl} - ou \textbf{exploration} - est effectué par un robot d’indexation qui parcourt récursivement tous les hyperliens qu’il trouve. Cette exploration est lancée depuis un nombre restreint de pages web (\textit{seeds}); \item L’\textbf{indexation} des ressources récupérées consiste à extraire les termes considérés comme significatifs du corpus de documents exploré. Diverses structures - tel que le dictionnaire inverse - permettent alors de stocker les représentations des documents; \item Finalement, la fonction d'\textbf{appariement} permet d'identifier dans le corpus documentaire (en utilisant l’index) les documents qui correspondent le mieux au besoin exprimé dans la requête afin de retourner les résultats par ordre de pertinence. \end{enumerate} En partant de ce principe générique, un grand nombre de méthodes existe pour effectuer chacune des sous-tâches en questions. \subsubsection{Crawling} Un \textit{crawler} est un programme qui explore automatiquement le web afin de collecter les ressources (pages web, images, vidéos, etc.) dans le but de les indexer. L'hypothèse sous-jacente est que les contenus du web évoluent de façon relativement lente, autorisant les crawlers à se rafraîchir de façon plus ou moins régulière selon les sites pour maintenir l'index à jour. D'un côté, les sites de nouvelles, dont les contenus évoluent rapidement, sont visités très régulièrement, alors que d'un autre, une page personnelle par exemple peut avoir une inertie de quelques jours. Par ailleurs, étant donné la taille du réseau, il est impossible, même pour les plus grands moteurs de recherche de couvrir la totalité des pages publiques. Une étude datant de 2005 \cite{studyWebCrawl} a montré que ceux-ci ne sont en mesure d'indexer qu'entre 40\% et 70\% du web. Dans cette optique, il est souhaitable que la portion de pages visitées contienne les pages les plus pertinentes et pas seulement un échantillon aléatoire. Ceci amène à considérer la nécessité d'une métrique permettant de hiérarchiser les pages web par ordre d'importance, celle-ci étant souvent définie comme une fonction du contenu et de la popularité en termes de liens ou de visites. Dans ce contexte, les algorithmes de \textit{crawling} sont très nombreux et se différencient entre autres par l'heuristique permettant de donner un score aux différentes adresses visitées, ou à visiter, dans le but de prioriser les visites les plus utiles (en fonction de leur importance et/ou de leur fréquence de modification). Parmi les nombreux algorithmes de \textit{crawling} nous citerons \texttt{Breadth first} \cite{breathfirst}, \texttt{Depth first} \cite{depthfirst}, \texttt{OPIC} \cite{OPIC}, \texttt{HITS} \cite{HITS} ou encore \texttt{Page Rank} \cite{PageRank}. A titre illustratif, l'algorithme \texttt{PageRank} de Google attribue à chaque page une valeur proportionnelle au nombre de fois que passerait par cette page un utilisateur parcourant le web en cliquant aléatoirement sur un des liens apparaissant sur chaque page. Ainsi, une page a un score d'autant plus important qu'est grande la somme des scores des pages qui pointent vers elle. Nous orientons le lecteur vers le travail de \cite{surveyCrawl} pour une étude des différentes possibilités. Dans un contexte où le nombre pages est de plus en plus grand, et pour répondre à un besoin de collecte d'information plus ciblée, le concept de \textit{focused crawling} est apparu. Au lieu de réaliser une exploration du web uniquement basé sur les liens entre les différentes pages, ce dernier permet de cibler particulièrement des pages présentant certaines caractéristiques. On peut par exemple s'intéresser uniquement aux pages parlant de tel ou tel sujet, rendant ainsi la tâche d'exploration moins coûteuse, le nombre de pages à visiter étant restreint. Le \textit{crawling} ciblé fut introduit dans \cite{Chakrabarti1999}, où les auteurs définissent une méthode permettant de décider si oui ou non une page doit être visitée en fonction des informations dont on dispose - par exemple selon ses métadonnées - et de ses liens vers d'autres pages considérées pertinentes relativement à un sujet prédéfini. De nombreuses variantes ont été proposées par la suite, par exemple dans \cite{Micarelli2007} où une stratégie de \textit{crawling } adaptatif est élaborée. \subsubsection{Indexation} D'autre part, le processus d'indexation consiste à établir une représentation des différents documents, sur laquelle la fonction d'appariement pourra se baser pour trouver des scores de pertinence de manière efficace. Le modèle le plus simple, nommé sac de mots, fut évoqué pour la première fois dans \cite{bagOfWord}. Il s'agit de représenter les corpus sous forme d'une matrice creuse dans laquelle chaque document est encodé selon les termes qui le composent (matrice indexée par les termes dans le cas du dictionnaire inversé). Des modèles plus élaborés permettent de prendre en compte l'importance relative des termes dans un corpus afin d'augmenter ou de diminuer leur pouvoir discriminant, comme c'est le cas du schéma de pondération TF-IDF. Ce type de modèle utilise en particulier les notions de fréquence de terme (TF) et de fréquence inverse de document (IDF). Pour un terme et un document donné, la première grandeur correspond simplement au nombre d'occurrences du terme dans le document considéré (on parle de "fréquence" par abus de langage) tandis que la seconde grandeur est une mesure d'importance du terme dans l'ensemble du corpus. Chaque document peut donc être représenté par un vecteur composé des scores TF-IDF de chacun de ses termes, où TF-IDF peut correspondre à différentes combinaisons des deux grandeurs TF et IDF. Notons qu'il est également possible d'ajouter un prétraitement des données visant en particulier à enlever les mots les plus courants (\textit{stop words}), procéder à une racinisation (\textit{stemming}) ou encore une lemmatisation. Des modèles plus complexes tels LSA (\textit{Latent Semantic Analysis}), PLSA (\textit{Probabilisitc Latent Semantic Analysis}) \cite{PLSA} ou encore LDA (\textit{Latent Dirichlet Allocation}) \cite{LDA} ont ensuite permis de réduire la dimension de l'espace des représentations en vue d'obtenir des formes plus concises des différents documents. Leur objectif est d'obtenir une meilleure généralisation en passant d'une représentation dans l'espace des mots à une représentation dans un espace de concepts latents. La méthode LSA consiste en la factorisation de la matrice termes-documents du modèle sac de mots via une décomposition en valeurs singulières. Les méthodes PLSA et LDA quant à elles ne sont pas purement algébriques contrairement à LSA. Elles contiennent une dimension probabiliste permettant de modéliser chaque document comme un tirage échantillonné selon un modèle plus ou moins complexe. Plus récemment dans \cite{word2vec}, le très populaire modèle \textit{word2vec} définit une représentation distribuée des termes dans un espace de dimension restreinte, de manière à encoder de façon compacte différents types de dépendances, grâce à des techniques basées sur des architectures de réseaux de neurones. \subsubsection{Recherche} Etant donné une requête - qui peut elle-même être considérée comme un document de petite taille - et un ensemble de documents indexés, le but est d'ordonnancer ces derniers en fonction de leur pertinence relativement à un besoin d'information exprimé dans la requête. D'une façon générale, il s'agit d'attribuer un score numérique à chaque document, dont le calcul peut être effectué de différentes manières. Les modèles les plus simples reposent directement sur le modèle sac de mots. Par exemple, il peut s'agir d'un score binaire traduisant la présence ou non des termes de la requête dans un document (modèle booléen). D'autre part, le populaire modèle vectoriel mesure la similarité entre requête et document en considérant l'angle séparant leurs vecteurs dans l'espace des représentations (TF-IDF, \textit{word2vec} ou autre). Des scores plus complexes peuvent aussi être pris en compte, par exemple BM25 \cite{BM25} et ses extensions BM25F \cite{BM25F} et BM25$+$ \cite{BM25Plus} qui sont encore considérés comme des méthodes à l'état de l'art dans le domaine. Enfin, d'autres approches consistent en l'élaboration d'un modèle de lanque par document. La pertinence de chaque document est alors mesurée en fonction de la probabilité que la requête ait été générée selon le modèle de langue correspondant. Les premiers modèles de langues furent introduits dans les années 80 et considèrent des distributions de probabilité sur des séquences de mots (modèle de type $n$-grammes par exemple) \cite{surveyLangModel}. En outre, si des méthodes d'indexation plus complexes sont utilisées en amont (voir plus haut), on peut effectuer des comparaisons de documents dans un espace de dimension réduite. D'une façon générale, afin d'améliorer la pertinence des résultats renvoyés, il est possible d'utiliser des informations additionnelles comme le fait notamment Google en utilisant \texttt{PageRank} pour donner un score d'importance \textit{a priori} à chaque page. Finalement, l'ordonnancement des résultats d'une requête peut être considéré comme un problème d'apprentissage (\textit{learning to rank}) \cite{Letor}. Les différentes approches sont divisées en trois catégories, selon la fonction de coût à optimiser: \textit{pointwise ranking}, \textit{pairwise ranking} et \textit{listwise ranking}. Les détails de chacune des approches sont décrits dans \cite{learningToRank}. \subsection{Le cas particulier des réseaux sociaux} De par le nombre d'utilisateurs y étant actifs et la rapidité avec laquelle les contenus y sont produits, il apparaît que les méthodes de \textit{crawling} et d'indexation, jusqu'alors considérées comme des processus hors-ligne effectués en arrière-plan, et donc avec une inertie plus ou moins importante, ne sont pas toujours adaptés au cas des réseaux sociaux. En effet, si l'on souhaitait utiliser ces dernières sans modification, cela nécessiterait de référencer en continu toutes les publications de tous les utilisateurs dans chaque réseau social, soit plusieurs dizaines de milliers par seconde. De plus, l'aspect éphémère de l'information, sur laquelle nous reviendrons, pose des difficultés supplémentaires. Les modèles permettant l'accès à l'information sur les réseaux sociaux doivent donc être adaptés par rapport au cas traditionnel. Sur ces derniers, les utilisateurs sont acteurs et ont la possibilité d'interagir directement avec les autres sans aucun besoin de passer par un quelconque moteur de recherche intermédiaire. L'accès à l'information en devient beaucoup plus rapide et plus libre, mais aussi moins contrôlé si bien que l'étude des phénomènes sous-jacents est beaucoup plus complexe. Afin d'avoir une compréhension plus fine des mécanismes à l'œuvre, un certain nombre de tâches ont été étudiées dans la littérature ces dernières années. En voici quelques-unes à titre illustratif : \begin{itemize} \item Diffusion de l'information : ce champ d'étude cherche à modéliser la façon dont une information se propage d'utilisateur en utilisateur dans un réseau social. De nombreux modèles ont été proposés dans la littérature pouvant utiliser des modèles de graphe connu ou pas \textit{a priori} \cite{ IC,NetRate}, mais aussi des modèles de représentation dans des espaces latents \cite{heatDiffSimon}; \item Détection de source : il s'agit de retrouver le ou les utilisateurs étant source d'une rumeur sur un réseau social \cite{sourceDetection,sourceDetectionSimon,sourceDetectionSIR}; \item Détection de communauté : il s'agit de partitionner les utilisateurs en sous-ensembles dans lesquels les différents membres ont des caractéristiques communes, par exemple un centre d'intérêt \cite{communityDetection}; \item Maximisation de l’influence : le but est ici de trouver un ensemble de comptes tels que la propagation d'une information provenant de ces derniers soit maximale sur le réseau \cite{Kempe2003}. \end{itemize} Chacune de ces tâches est propre aux réseaux sociaux et peut, bien que l'aspect dynamique de ces derniers soit inhérent, être traitée avec des modèles hors-ligne et statiques (en utilisant les hypothèses adéquates). Par exemple, on peut considérer que l'information se diffuse via un graphe figé dans le temps et que les liens entre utilisateurs sont fixes. Ainsi, beaucoup de travaux ont été effectués sur l'idée qu'un réseau social pouvait être considéré comme un graphe du web, où les nœuds correspondraient aux utilisateurs, et les liens aux relations sociales existantes entre eux. Avec un tel modèle, il est possible d'appliquer les approches de \textit{crawling} présentées plus haut. Sur ce principe, des systèmes personnalisés et adaptés à chaque utilisateur ont vu le jour pour permettre d'orienter les choix des utilisateurs vers des sources pertinentes dans le réseau. En particulier, dans \cite{recoFollow} et \cite{WTF}, les auteurs construisent des systèmes de recommandation, appelées respectivement \textit{Twittomender} et \textit{Who to Follow}. Dans le premier, des méthodes de filtrage collaboratif sont utilisées pour trouver les comptes Twitter qui sont susceptibles d'intéresser un utilisateur cible. Dans le second, une approche appelée \textit{circle of trust} (correspondant au résultat d'une marche aléatoire égocentrique similaire au \texttt{personalized PageRank} \cite{personalizedPageRank}) est adoptée. Cependant, ce genre d'approche nécessite d'avoir en entrée le graphe des relations entre entités considérées, ce qui n'est pas évident. En effet, d'une façon générale, les relations entres les utilisateurs ne sont pas connues. Or, si dans le cas classique, les liens entre pages sont découverts à mesure que le robot d'indexation parcourt les pages web, dans le cas des réseaux sociaux, seul un nombre limité d'arcs du graphe social peuvent être obtenus via les APIs mises à disposition par les réseaux sociaux. Dans cette optique, les auteurs de \cite{Boanjak2012} ont proposé un système distribué permettant de faire du \textit{crawling} sur Twitter en interrogeant l'API depuis de nombreux clients distincts pour éviter les restrictions. Dans cette veine, les travaux proposés dans \cite{crawlingFB} et \cite{walkingFB} s'intéressent à l'exploration du réseau social Facebook. Le point commun à tous ces systèmes est qu'ils doivent prendre en compte le fait que l'acquisition de données est à la fois limitée et coûteuse. Cependant, les politiques des médias sociaux étant de plus en plus restrictives (en termes de requêtes) à l'heure actuelle, une telle approche ne semble pas viable. En effet si l'on prend l'exemple de Twitter, un maximum de 180 requêtes peut être effectué par tranche de 15 minutes pour récolter les informations dans leur base de données, ce qui peut rapidement s'avérer contraignant lorsque l'on souhaite récupérer un graphe d'utilisateurs de façon récursive par exemple. Toutes ces approches classiques ont donc des applications limitées dans un cadre réel pour deux raisons principales : premièrement, l'apprentissage d'un modèle hors-ligne n'est pas compatible avec la dynamique des réseaux sociaux dans lesquelles les conditions peuvent évoluer très rapidement. Deuxièmement, comme nous l'avons déjà évoqué, quand bien même ce ne serait pas le cas, des problématiques d'accès à l'information se posent. En effet, dans la plupart des modèles appris hors-ligne, le processus d'apprentissage nécessite l'accès à beaucoup d'information pour s'effectuer. Il peut s'agir par exemple d'un graphe d'utilisateurs, qui dans la pratique n'est pas accessible à cause des restrictions imposées par les médias sociaux. Dans tous les cas, ces modèles nécessitent en amont un ensemble de données pour être appris, dont la collecte est souvent considérée comme une étape préparatoire. La plupart des médias sociaux proposent à leurs utilisateurs deux moyens d'accéder aux informations qu'ils contiennent. La première consiste à interroger une base dans laquelle toutes les données passées sont enregistrées\footnote{Documentation Twitter disponible à l'URL: \url{https://dev.twitter.com/rest/public}}. Cette approche peut être pertinente dans certaines situations, par exemple pour étudier des phénomènes \textit{a posteriori}, ou valider certaines hypothèses, mais possède l'inconvénient d'être extrêmement contraint. En effet, comme il est précisé plus haut, le nombre de requêtes est très limité, les médias sociaux ayant rapidement compris la valeur des données qu'ils détiennent. La seconde approche consiste à récupérer en temps réel les données produites par les utilisateurs, il s'agit de la collecte en ligne, qui nous intéresse particulièrement puisqu'elle permet de s'adapter à la dynamique des réseaux sociaux. La partie suivante est dédiée aux modèles d'exploitation en temps réel de l'information, ce qui nous permettra au passage de positionner les travaux effectués dans cette thèse de façon plus précise. \section{Exploitation en temps réel de l'information} De nombreuses applications nécessitent aujourd’hui le traitement d'informations en continu. Or dans la majorité des cas les méthodes hors-ligne ne sont pas transposables directement pour une utilisation en ligne. Cela implique l'élaboration de nouvelles méthodes pour exploiter les flux de données en temps réel. Ces modèles, en incorporant de nouvelles connaissances en continu, ont l'avantage d'être en mesure de s'adapter à des environnements changeants plus ou moins rapidement. Nous proposons dans la suite de faire un état des lieux des principales problématiques liées à ce champ d'études spécifique. Nous parlerons ensuite des diverses applications dans les réseaux sociaux. \subsection{La fouille de flux de données: un besoin de méthodes adaptées} Face à l'augmentation constante des données produites sur le web, d'importants efforts ont été déployés pour proposer des méthodes efficaces permettant de les exploiter. En particulier, des progrès considérables ont été réalisés dans le domaine du stockage de la donnée, de la parallélisation et du calcul distribué. Cependant, le rythme de production de certaines sources de données telles que les réseaux sociaux ne cessant d'augmenter, de nouvelles méthodes permettant de ne pas avoir à stocker l'intégralité des données se sont développées. Ces dernières se consacrent à l'étude de flux de données en ligne, qui contrairement aux approches classiques ne nécessitent pas - ou peu - de stockage de l'information. En effet, on considère dans ces approches qu'une donnée n'est lisible qu'une fois - ou un nombre de fois très faible - dans un système limité en capacité de stockage. Les flux sont continus, potentiellement illimités et arrivent rapidement. De plus, leurs distributions ne sont pas stationnaires. En effet dans beaucoup de situations, la distribution qui sous-tend les données ou les règles sous-jacentes peuvent changer avec le temps. Ainsi, les algorithmes de fouille de données (classification, clustering...) doivent prendre en compte ce facteur pouvant potentiellement modifier leurs sorties. Ce phénomène est appelé dérive conceptuelle (\textit{concept drift}). Par exemple, le trafic réseau, les contenus postés sur Twitter, les conversations téléphoniques, etc. sont des flux de données où l'on peut observer des évolutions au cours du temps et dans lesquels il s'agit de réussir à capturer les dynamiques. Différents types de solutions permettant de traiter les flux de données ont été développés. Nous présentons ci-dessous les méthodes classiques permettant de traiter les flux de données, soit en n'utilisant qu'un sous-ensemble des données, soit en cherchant à en extraire des descripteurs plus concis: \begin{itemize} \item \textbf{Echantillonnage} : Il s'agit de définir un processus probabiliste permettant de sélectionner les exemples à traiter ou non dans l'apprentissage, tout en conservant suffisamment d'information utile. Par exemple, les arbres de Hoeffding, qui constitue une extension des arbres de décision classiques, utilisent l'idée selon laquelle un petit échantillon de données est suffisant pour effectuer l'apprentissage d'un modèle de classification. Ceux-ci sont en mesure de déterminer, avec une forte probabilité, le nombre minimal d'exemples nécessaires pour effectuer un apprentissage de façon efficace. Les algorithmes \texttt{VFDT} \cite{hoeffdingTree} et \texttt{CVFDT} \cite{hoeffdingTree2} reposent sur ce principe. Cette technique a l'avantage d'être simple et rapide, mais comporte un certain nombre de désavantages. En effet, comme l'évoque \cite{streamReview}, elle ne prend pas en compte les fluctuations possibles dans la quantité d'information présente dans le flot de données \item\textbf{Load shedding} : Proche de l'échantillonnage, cette méthode consiste à directement écarter une partie des données à traiter, souvent selon un processus aléatoire \cite{dataBasedShedding}. Elle a été appliquée avec succès pour effectuer des requêtes dans un flux de données dans \cite{dataBasedSheddingApp}. En outre, cette approche possède les mêmes inconvénients que l'échantillonnage présenté ci-dessus. \item \textbf{Sketching} : Cette méthode fut proposée à l'origine dans \cite{dataBasedSketching} et consiste à projeter les données dans un espace de dimension réduite pour permettre de résumer le flot de données à l'aide d'un petit nombre de variables aléatoires. On distingue deux types de projection: le premier type, dit \textit{data-oblivious}, consiste à utiliser des projections aléatoires, ou apprises sur en ensemble de données hors-ligne. Dans ce cas, les projections sont fixées à l'avance et ne peuvent évoluer en fonction des données du flux. Les méthodes LSH \cite{LSH}, MDSH \cite{MDSH} et KLSH \cite{KLSH} font partie de cette famille. Le second type de projection, nommé \textit{data-dependent}, utilise directement les données du flux et sont apprises en ligne. Ces méthodes, dont \textit{PCA} \cite{dataBasedSketchingPCA}, \textit{Laplacian Eigenmaps} \cite{LaplacianEigen} et \textit{Spherical Hashing} \cite{SphericalHashing} font partie, sont souvent plus performantes que les méthodes \textit{data-oblivious}, mais sont plus coûteuses à mettre en œuvre. \item \textbf{Agrégation} : Il s'agit de calculer un certain nombre de valeurs statistiques telles que la moyenne ou la variance, de les agréger et de les utiliser comme entrée de l'algorithme d'apprentissage. Ces méthodes ont l'avantage d'être simples à mettre en oeuvre, mais atteignent leurs limites lorsque les flux de données sont hautement non-stationnaires. Elles ont été appliquées avec succès dans \cite{dataBasedAggreg} et \cite{dataBasedAggreg2} respectivement pour des tâches de \textit{clustering} et de classification dans les flux de données. \item \textbf{Ondelettes}: Cette technique consiste à reconstruire un signal en le projetant sur une base orthogonale de fonctions particulières. Les vecteurs de base les plus utilisés sont les ondelettes de Haar, qui sont des fonctions constantes par morceaux, ce qui en fait les ondelettes les plus simples à comprendre et à implémenter. Grâce à ces dernières, la reconstruction du signal est la meilleure approximation selon la norme $l^{2}$. On citera le travail de \cite{classifApp1}, dans lequel les auteurs spécifient l'algorithme de classification \texttt{AWESOME}, utilisant la technique des ondelettes pour rendre plus compacte la représentation des informations. \item \textbf{Histogrammes}: Il s'agit de structures qui agrègent les données en les découpant selon une règle prédéfinie, ayant pour but d'approximer les distributions des données dans le flux considéré. La technique de référence dans ce domaine consiste à utiliser les histogrammes dits \textit{V-Optimal} \cite{dataBasedHisto3}, permettant d'approximer la distribution d'un ensemble de valeurs par une fonction constante par morceaux, de façon à minimiser l'erreur quadratique. \item \textbf{Fenêtre glissante} : La méthode des fenêtres glissantes consiste à restreindre l'analyse aux éléments les plus récents du flux de données. Cette technique a notamment été étudiée théoriquement dans \cite{taskBasedSliding}. Elle possède l'avantage d'être aisée à implémenter, relativement facile à analyser de par sa nature déterministe, mais peut s'avérer trop simpliste dans certaines applications nécessitant de prendre en compte le passé de façon plus structurée. \end{itemize} Toutes les approches présentées ci-dessus constituent une étape préalable pour résoudre des tâches d'apprentissage classique (régression, classification, etc.) dans lesquelles les exemples arrivent au fil de l'eau, de façon potentiellement rapide, et sans pouvoir être réutilisés. Grâce aux avancées technologiques de ces dernières années, les capteurs qui nous entourent sont de plus en plus nombreux et variés. Le terme de \textit{sensor network}, qui désigne un ensemble de capteurs permettant de mesurer toutes sortes de conditions dans des environnements divers (conditions météo, trafic routier, flux de messages, etc.), prend de plus en plus d'importance aujourd'hui, en particulier avec l'avènement des objets connectés. Dans cette optique, chaque capteur peut être considéré comme source d'un flux de données particulier. Si l'exploitation d'un seul flux de données représente déjà un défi, l'exploitation de plusieurs flux de données est une tâche encore plus difficile, nécessitant d'adapter les techniques présentées plus haut (voir par exemple les travaux de \cite{multipleStreamClust} qui étendent une méthode pour du \textit{clustering} sur les données d'un flux unique, à une méthode pour du \textit{clustering} sur les données d'un grand nombre de flux). Un autre champ d'étude s'intéresse directement à l'étude des flux de données multiples en tant qu'objets. Dans cette optique, chaque flux de données est considéré comme une séquence de mesures évoluant au cours du temps. Ainsi, diverses sous-tâches de prédiction (modèles autorégressifs par exemple), d'analyse de tendance, de classification de séquences ou de recherche de similarité entre séries temporelles existent. Par exemple les travaux de \cite{timeSeriesApp3} étudient le \textit{clustering} de séries temporelles provenant de téléphones mobiles (accélération, niveau sonore, luminosité, etc.) afin d'inférer un contexte utilisateur pour proposer divers services personnalisés. Par ailleurs dans \cite{timeSeriesApp4}, les auteurs ont développé une approche générique de détection d'événements dans les séries temporelles, qui constitue aujourd'hui un domaine à part entière (voir plus bas dans la partie sur les réseaux sociaux). En outre, dans le domaine de la santé, le sujet de la classification de séries provenant d'électrocardiogrammes constitue un sujet très étudié à l'heure actuelle \cite{ECGClassif}. Finalement, dans un contexte plus proche des travaux effectués dans ce manuscrit, l'étude de la sélection de capteurs constitue un domaine dans lequel on considère des contraintes sur le nombre de flux auxquels il est possible d'accéder. Il s'agit donc de sélectionner le meilleur sous-ensemble de $k$ capteurs, dans le but d'estimer au mieux un certain nombre de grandeurs \cite{sensorSelection}. Par exemple, le déploiement de caméras de vidéosurveillance dans une ville constitue un problème de sélection de capteurs, dans lequel on cherche à avoir une vision de la ville la plus complète, tout en minimisant le nombre de caméras utilisées. Ce problème est d'autant plus complexe dans un cadre dynamique, c'est-à-dire lorsque les capteurs sélectionnés sont modifiés au cours du temps. Par exemple dans \cite{sensorSelectionDyna}, les auteurs étudient la sélection d'un sous-ensemble de flux d'images en temps réel, la totalité de ceux-ci n'étant pas exploitable, en vue de maximiser une fonction objectif. Nous verrons par la suite que le problème de la sélection de capteurs a été appliqué à la collecte d'information dans les réseaux sociaux, qui nous intéresse particulièrement ici. Dans la section suivante, on s'intéresse au cas particulier des flux de données produits par les médias sociaux. \subsection{Applications en temps réel dans les médias sociaux} \label{twitterAPI} Aujourd'hui, les plus importants flux de données sur le web proviennent des médias sociaux. A titre illustratif, sur Twitter on peut atteindre un taux de 7000 messages par secondes. Pour permettre de traiter cette quantité de données arrivant en flux continus, les algorithmes en ligne ont rapidement suscité un intérêt très particulier. Afin d'offrir la possibilité à des applications tierces d'utiliser ces données, les réseaux sociaux mettent la plupart du temps des API dites de \textit{streaming} à disposition. Ces dernières permettent de récupérer les flux de données produits en temps réel sur un média social. Cependant, les conditions d'accès aux données produites sur les réseaux sociaux sont souvent très restrictives. Par exemple pour Twitter, seulement 1\% du trafic total est accessible en temps réel. Dans la section précédente, nous nous sommes concentrés sur le fait que la totalité des données ne pouvait pas être stockée et/ou traitée. Ainsi, des méthodes intervenant directement au niveau des données ou au niveau des algorithmes ont été développées pour répondre à ce challenge. Entre autres, des stratégies de sous-échantillonnage ont été établies en supposant que toute la donnée était potentiellement accessible. Il apparaît désormais de façon claire qu'une seconde contrainte vient se poser dans le cadre particulier des médias sociaux. En effet, notre accès aux flux de données est fortement restreint par les propriétaires de ces médias. Au regard des différents éléments présentés jusqu'ici, les spécificités de la tâche de collecte d'information en temps réel dans les médias sociaux qui fait l'objet de cette thèse commencent à apparaître. Rappelons que le but est le suivant: étant donné un ensemble d'utilisateurs postant des contenus en temps réel et un système permettant l'écoute d'un nombre restreint d'entre eux, notre objectif est de définir des stratégies permettant de choisir lesquels écouter à chaque itération afin de maximiser la pertinence des contenus récoltés. A cause de la fonction que l'on souhaite maximiser, nous verrons que des stratégies d'échantillonnage aléatoires ne sont pas adaptées et nous devrons utiliser des approches sélectionnant les sources de façon active, en effectuant un apprentissage. Un certain nombre de recherches se sont déjà intéressées aux flux de données en temps réel dans les médias sociaux ainsi qu'à des cas d'applications. Avant d'étudier le cas particulier de la collecte, nous présentons un certain nombre de cas d'applications. \subsubsection{Cas d'applications courants} \begin{itemize} \item \textbf{Topic Detection and Tracking}: Une très large littérature s'est intéressée à l'identification et le suivi d'événements dans les flux de données. Le domaine du Topic Detection and Tracking (TDT), introduit dans \cite{Allan98}, propose des modèles pour traiter cette problématique. Cela inclut en particulier le découpage du flux, la détection d’événements et l'assemblage d'éléments d'une même histoire provenant de sources différentes dans le flux de données. Bien que cela puisse paraître très proche de notre tâche, car traitant des flux de données textuelles, le TDT considère que tous les flux sont disponibles. Dans notre cas, non seulement les flux ne sont pas tous disponibles, mais le but est de chercher à sélectionner les meilleurs, relativement à une fonction de qualité définie \textit{a priori}. Les travaux sur la détection de \textit{trending topics} se situent dans cette lignée. Il s'agit de détecter en temps réel, via l'analyse des flux de données, des sujets tendance sur un réseau social à un moment précis. Par exemple dans \cite{Cataldi2010}, les auteurs proposent une approche traitant en continu des messages provenant de Twitter afin de découvrir des mots-clés correspondant à des sujets en vogue sur le réseau. La question de la collecte des données n'est cependant pas traitée dans ce travail, qui considère uniquement le flux aléatoire de Twitter renvoyant en temps réel 1\% des contenus publics postés sur le réseau. Plus récemment dans \cite{Colbaugh2011}, la blogosphère est modélisée comme un réseau où chaque nœud correspond à un blog. L'objectif est d'identifier les blogs qui font suivre les contenus émergents du moment. En ce sens, l'approche proposée oriente la collecte vers des sources de données utiles, mais cela se fait de manière statique, sur des données d'apprentissage collectées sur tous les nœuds du réseau, ce qui n'est possible que lorsque le réseau est suffisamment petit. Finalement, le travail présenté dans \cite{Li2013} propose un processus de réorientation de la collecte en utilisant l'API \textit{streaming} de Twitter permettant de suivre l'emploi de certains mots en temps réel. Dans ce travail, les auteurs redéfinissent l'ensemble complet des mots à suivre à chaque étape, en sélectionnant les termes les plus employés du moment à partir d'observations faites depuis le flux aléatoire proposé par Twitter. Le fait de sonder le réseau à partir de mots-clés peut poser un certain nombre de problèmes dans le cadre de la collecte de données. En effet, si une collecte relative à un sujet peut bien être effectuée à partir d'une liste de mots-clés, les données récoltées avec cette approche peuvent s'avérer très bruitées ou bien hors sujet, en raison du faible pouvoir expressif d'une telle formulation du besoin d'une part et du grand nombre de messages retournés d'autre part. \item \textbf{Analyse de sentiment}: l’objectif est d'analyser de grandes quantités de données afin d'en déduire les différents sentiments qui y sont exprimés. Les sentiments extraits peuvent ensuite faire l'objet d'études sur le ressenti général d'une communauté. Ce domaine a connu un succès grandissant dû à l'abondance de données provenant des réseaux sociaux, notamment celles fournies par Twitter. Ce type d'outils est aujourd'hui très utilisé dans de nombreux domaines. Ainsi, en politique il est possible d'extraire le sentiment des citoyens sur certaines thématiques/personnalités, en marketing de se faire une idée de l'opinion des clients sur un produit, etc. Le travail effectué dans \cite{opinionMiningSurvey} fait un état des lieux des nombreuses méthodes d'apprentissages permettant de traiter cette tâche. En particulier lorsque les données arrivent en continu sur un réseau social, il s'agit d'un problème de classification en ligne, pour lequel les auteurs de \cite{realTimeOpinionMining} proposent une architecture. D'autre part dans \cite{opinionMiningRealTimeUSElections}, un système d'analyse de sentiment en temps réel sur Twitter au sujet des candidats à l'élection présidentielle de 2012 est décrit. De nombreux autres travaux, comme ceux de \cite{opinionMiningRealTimeTwitter} ou encore \cite{opinionMiningRealTimeTwitter2Hadoop}, ont été effectués à ce sujet. \item \textbf{Analyse de la propagation d'informations en temps réel}: le phénomène de propagation de l'information dans les réseaux sociaux a beaucoup été étudié dans une configuration hors-ligne. Cependant, la croissance rapide des données sociales a fait émerger le besoin d'inventer des modèles plus réalistes, appris en ligne directement. Dans cette optique, les travaux décrits dans \cite{diffusionRealTime,diffusionRealTime2} proposent des approches en temps réel pour traiter cette tâche. Leur approche se base sur le graphe social (\textit{follower/followees}) pris à un instant donné, et ne permet donc pas de prendre en compte la dynamique des relations entre les utilisateurs. \end{itemize} \subsubsection{La collecte orientée en ligne} Comme le font remarquer les travaux récents de \cite{dataCapture}, la collecte de donnée dans les réseaux sociaux est souvent vue comme une étape préliminaire, mais n'a pas beaucoup été étudiée. \textit{A fortiori}, le sujet plus complexe de la collecte en temps réel dans ces médias, qui comporte des contraintes spécifiques, représente un champ d'étude peu exploré. Il est important de noter que dans ce cas, si une information n'est pas récupérée au moment où elle est produite alors elle est perdue, ce qui n'est pas le cas dans les approches traditionnelles. Ainsi il est primordial pour le processus de collecte de réussir à bien s'orienter dans les différents flux de données afin de minimiser l'information perdue, ou de façon équivalente, de maximiser les contenus pertinents récoltés. Les travaux décrits dans \cite{deployMonitPoint} s'intéressent à cette problématique. Dans leur cas, il s'agit de déployer un ensemble de capteurs sur le réseau dans un contexte où il est impossible de collecter la donnée en positionnant un capteur sur chaque compte (restrictions des APIs). Dans ce travail, les auteurs considèrent que les relations sociales peuvent être exploitées de la façon suivante: si un utilisateur A suit (\textit{follow}) un utilisateur B alors, lorsque l'utilisateur B poste un contenu, cette information parvient à A. Il n'est ainsi pas nécessaire de placer un capteur sur B, puisque toutes les interactions de B avec le réseau social seront notifiées à A. En se basant sur ce principe, les auteurs utilisent une approche de couverture par ensembles (\textit{Set Cover problem}), dont le but est de trouver comment positionner les $k$ capteurs disponibles de manière à couvrir au mieux les informations produites sur un réseau social, sachant que selon leur positionnement, les capteurs permettent de collecter des informations sur des zones plus ou moins vastes du réseau. Cette approche possède deux inconvénients majeurs: premièrement, elle nécessite la connaissance du graphe social, dont l'acquisition constitue un problème à part entière. Par ailleurs, cette approche est stationnaire et considère le problème de la couverture du réseau à un instant donné, ne prenant ainsi pas en compte la dynamique des comportements des utilisateurs. \begin{comment} Dans cette thèse, nous proposons une approche différente dans laquelle, l'unité de capture se situe au niveau de l'utilisateur. Il est ainsi impossible d'obtenir des unités couvrant plusieurs utilisateurs en même temps. En d'autres termes, si l'on considère $\mathcal{U}=\left\{1,...,K\right\}$ l'ensemble des utilisateurs du réseau, le sous-ensemble $\mathcal{T}$ serait composé uniquement des sous-ensembles de taille 1, c'est à dire des utilisateurs de façon individuelle ($\mathcal{T}=\left\{\left\{1\right\},...,\left\{K\right\}\right\}$). \end{comment} Dans cette thèse, nous proposons une autre approche pour la collecte d'information en ligne, plus réaliste, dans laquelle le graphe social n'est pas disponible. De plus, la méthode que nous utilisons considère des sources potentiellement instationnaires, dont l'utilité peut évoluer au cours du temps. Ainsi, dans notre scénario, les positions de l'ensemble des capteurs peuvent être reconsidérées à chaque itération d'un processus de collecte dynamique. N'ayant pas d'information \textit{a priori} sur le comportement des utilisateurs, le processus de collecte doit être en mesure d'apprendre au fur et à mesure à s'orienter dans le flux de données. Le problème du choix du positionnement des capteurs se pose alors. En effet, imaginons que notre système, à un instant donné, repère une source de bonne qualité après y avoir positionné un capteur pendant un certain temps. Etant donné que cette source mobilise un capteur et que le nombre de capteurs est restreint, la question est de savoir si le système doit exploiter cette ressource ou alors tenter d'en explorer d'autres, potentiellement meilleures. Il s'agit donc d’un processus de décision séquentielle devant faire face au célèbre dilemme exploitation/exploration, auquel les problèmes de bandits sont spécifiquement dédiés. Dans le chapitre \ref{EtatArt} qui suit, nous proposons un état de l’art relatif aux problèmes de bandits. Nous formalisons ensuite au chapitre \ref{FormalisationTache} la tâche de collecte en ligne comme un problème de bandit, ce qui fournira les bases nécessaires aux différentes études menées dans cette thèse. \chapter{Introduction} \section{Les réseaux sociaux aujourd'hui} Depuis leur apparition il y a une quinzaine d'années, les médias sociaux en ligne sont rapidement devenus un vecteur d'information incontournable, mettant en jeu des dynamiques complexes de communication entre utilisateurs. Le premier réseau social, nommé Classmates, dont le but était de remettre en contact d’anciens camarades de classe, fut créé en 1995 par Randy Conrads. Il fut largement détrôné par l'arrivée des géants comme Facebook en 2004 ou Twitter en 2006 qui comptent aujourd'hui respectivement plus d'un milliard et 300 millions d'utilisateurs. Ils ont ensuite été suivis par une multitude d’autres réseaux plus spécifiques : Instagram, Vine, Periscope, Pinterest, Snapchat... A l'heure actuelle, pour beaucoup d’internautes, utiliser ces sites est considéré comme une activité sociale à part entière. Ces nouveaux moyens de communication ont entraîné la création d'une nouvelle génération de consommateurs de l'information, toujours plus désireux de savoir vite, et plus. Dans le monde ultra connecté de 2016, la communication via les réseaux sociaux est donc devenue un enjeu majeur, si bien que la compréhension des dynamiques sous-jacentes constitue une question clé pour de nombreux acteurs, industriels ou académiques. D'un point de vue industriel, les entreprises ont rapidement compris le potentiel des médias sociaux. Il s'agit en effet d'un outil permettant de toucher un public très large et de façon quasi instantanée, si bien que de nombreuses campagnes de publicité ont désormais lieu sur les réseaux sociaux. Les réseaux sociaux leur permettent de gérer leur image, de se développer financièrement et d’enrichir leur expérience sur un marché du web offrant de nouvelles opportunités, auparavant inexistantes. L'apparition de nouveaux métiers tels que \textit{community manager}, \textit{content manager} et autres \textit{social media planner} témoigne de l'intérêt porté à ces moyens de communication. D'autre part, dans le monde de la recherche, de nombreux scientifiques se sont intéressés à rendre compte des mécaniques à l'œuvre sur les réseaux sociaux. En effet, la mise à disposition d'une quantité d'informations considérable permet d'étudier des phénomènes auparavant impalpables si bien que le domaine de l'analyse des réseaux sociaux a fait des progrès considérables. Cette branche des sciences mêle sociologie, théorie des graphes et statistiques au sens large. A titre illustratif, de nombreux aspects tels que la modélisation du phénomène de bouche à oreille, la détection de communautés, la détection de source et beaucoup d'autres sont désormais des sujets à part entière. Toutes ces études sont rendues possibles par la présence de données sociales sur le web, dont la collecte représente une étape clé. Or, l'accès à la donnée des réseaux sociaux est contraint par différents facteurs qu'il convient de prendre en compte. D'une part, cette dernière soulève de nombreuses questions liées au respect de la vie privée et les débats à ce sujet ont été nombreux ces dernières années. La plupart des réseaux sociaux autorisent désormais chaque utilisateur à personnaliser les conditions d'accès à son profil par des tiers. D'autre part, même sur les réseaux sociaux les plus ouverts comme Twitter, l'accès à la donnée est restreint par les médias eux-mêmes. En effet, conscients de la valeur financière de celle-ci, il est souvent impossible d'avoir accès à la totalité des contenus. La collecte des données produites par les réseaux sociaux constitue donc un enjeu majeur en amont de toute étude. Nous proposons dans cette thèse de s'intéresser à cette problématique. \section{La collecte d'information} Afin de permettre le suivi de l'activité de leurs utilisateurs sur leur système, la plupart des médias sociaux actuels proposent un service de capture de données via des API (Application Programming Interface). D'une façon générale, il existe deux types d'API - sur lesquels nous reviendrons en détail par la suite - permettant d'accéder aux données: des API donnant accès à des données historiques stockées en base et des API fournissant les données en temps réel, au fur et à mesure qu'elles sont produites. Alors que la navigation dans les bases de données historiques peut s'avérer difficile et coûteuse, l'accès temps réel permet en outre de s'adapter aux dynamiques des réseaux étudiés. Dans ce manuscrit, nous étudierons ce second moyen d'accès aux données permettant l'acquisition en temps réel des flux produits sur le média social considéré. Néanmoins, l'utilisation d'un tel service peut se heurter à diverses contraintes, aussi bien techniques que politiques. Tout d'abord, les ressources de calcul disponibles pour le traitement de ces données sont souvent limitées. D'autre part, des restrictions sont imposées par les médias sociaux sur l'utilisation des API, dites de \textit{streaming}, qu'ils mettent à disposition pour permettre un traitement en temps réel de leur contenu. Bien souvent, comme c'est le cas sur Twitter, seules les données relatives à un nombre limité d'indicateurs (auteurs ou mots-clés contenus par exemple) peuvent être considérées simultanément, restreignant alors considérablement la connaissance du réseau à un sous-ensemble limité de son activité globale. La collecte en temps réel de la totalité des données produites sur un média social est donc bien souvent impossible et il s'agit alors d'échantillonner les données collectées, en définissant des méthodes automatiques de collecte. Une stratégie consiste à définir des filtres permettant d'orienter la collecte vers des données correspondant à un besoin particulier. Il s'agit de sélectionner les sources de données à écouter les plus susceptibles de produire des données pertinentes pour le besoin défini. Dans ce contexte, définir un besoin de données / informations peut s'avérer une tâche complexe : comment définir un ensemble d'indicateurs permettant une collecte efficace, alors que l'on ne connaît pas la distribution des données pertinentes sur le réseau ? D'autant plus dans un contexte dynamique ? Si une collecte concernant une thématique particulière peut se faire en définissant une liste de mots-clés spécifiques que doivent contenir les messages à récupérer, les données obtenues via cette méthode sont souvent très bruitées ou hors sujet du fait du trop grand nombre de réponses ou d'interférences entre divers événements. Les entreprises qui vendent des solutions d'accès aux données des réseaux sociaux connaissent bien cette problématique et beaucoup d'entre elles ont recours à l’intervention d'un opérateur humain pour définir et modifier les indicateurs permettant de filtrer les données à collecter, ce qui est onéreux et n'est pas envisageable à grande échelle. Ceci nous amène à considérer le problème général de la collecte de données dans un réseau social pour un besoin spécifique lorsque le nombre de sources simultanément observables est restreint. Plus formellement, considérons un système d'écoute qui, compte tenu d'un ensemble d'utilisateurs sources à écouter, fournit le contenu produit par ces derniers pendant une période de temps donnée. Etant donné une fonction de qualité spécifique à la tâche en question, permettant d'évaluer la pertinence du contenu délivré par une source pour un besoin particulier, nous proposons une solution à ce problème d'échantillonnage de sources, basée sur une méthode d'apprentissage automatique. Nous utilisons pour cela le formalisme du problème du bandit manchot qui, comme nous le verrons, s'adapte bien à cette tâche de collecte orientée. En effet, le problème du bandit traite du compromis entre exploration et exploitation dans un processus de décision séquentiel où, à chaque pas de temps, un agent doit choisir une action parmi un ensemble d'actions possibles puis reçoit une récompense traduisant la qualité de l'action choisie. Dans notre cas, en optimisant à chaque pas de temps la fonction de qualité, les algorithmes de bandits nous permettront d'explorer, d'évaluer et de redéfinir l'ensemble des sources à considérer à chaque pas de temps. Cela permettra en particulier d'apprendre progressivement à se concentrer sur les sources d'information les plus pertinentes du réseau, sous les contraintes spécifiées (relatives à la capacité d'écoutes simultanées). Cette méthode a l'avantage de fonctionner pour n'importe quel besoin, sous réserve que ce dernier puisse être exprimé sous la forme d'une fonction de qualité associant une note à un contenu. Cette dernière peut prendre diverses formes et peut être utilisée par exemple pour collecter des messages d'actualité, identifier des influenceurs thématiques ou capturer des données qui tendent à satisfaire un panel d'utilisateurs finaux donnés. La partie \ref{partEtatArt} de ce manuscrit est dédiée à l'état de l'art. En particulier, dans le chapitre \ref{EtatArtRI}, nous proposons un état des lieux des principales tâches et méthodes liées à la collecte d'informations sur le web. Nous commencerons par nous intéresser aux modèles traditionnels de recherche d'information, fondés sur une approche statique de la donnée disponible. Nous verrons par la suite comment l'évolution du web, avec en particulier la présence de flux de données évoluant en continu dans les médias sociaux, a entraîné l'apparition de nouvelles tâches - et donc de nouvelles méthodes - devant prendre en compte les contraintes propres à ce nouveau cadre. En particulier, les enjeux liés à l'exploration de l'environnement nous permettront de faire un premier pas dans le monde des bandits, auxquels nous dédions tout le chapitre \ref{EtatArt}. Nous verrons que ce problème de décision séquentielle peut prendre un grand nombre de formes et détaillerons les plus célèbres. La partie \ref{partContributions} de ce manuscrit sera consacrée aux différents modèles que nous avons proposés, dont nous décrivons les grandes lignes ci-après. \section{Contributions} \subsection{\nameref{FormalisationTache} (chapitre \ref{FormalisationTache})} Dans cette première contribution, nous nous intéressons à la tâche de collecte d'informations en temps réel dans les médias sociaux, que nous formalisons comme un problème de bandit. Supposons que l'on dispose d'un processus permettant de collecter l'information produite par un utilisateur pendant une fenêtre de temps, et d'une fonction de qualité donnant un score aux contenus récupérés (dans la pratique, une API de \textit{streaming} nous autorise à faire cela). Notre but est de maximiser la qualité de l'information récoltée au cours du temps. Etant donné que l'on est restreint sur le nombre d'utilisateurs que l'on peut écouter simultanément, il est nécessaire de définir une stratégie de positionnement des capteurs à chaque instant. Il s'agit donc d'un problème de bandit avec sélection multiple. Il s'agira en particulier de décrire un modèle mathématique de la tâche et de faire le lien avec les problèmes de bandits décrits auparavant. Nous présenterons au passage les différents jeux de données utilisés tout au long du manuscrit, ainsi que certaines fonctions de qualité utilisées lors des différentes expérimentations. \subsection{\nameref{ModeleStationnaire} (chapitre \ref{ModeleStationnaire})} La première approche proposée consiste en un modèle de bandit stationnaire pour la collecte d'informations. Dans ce modèle, chaque utilisateur est associé à une distribution de récompense stationnaire, dont l'espérance reflète la qualité des informations qu'il produit, relativement à une fonction de qualité mesurant la pertinence de ses contenus. Dans cette optique, nous proposons une extension d'un algorithme existant adapté à notre tâche ainsi qu'une borne de convergence théorique. Les résultats obtenus à partir de ce modèle montrent que cette approche est pertinente pour la tâche de collecte de données sur Twitter. \textbf{Publications associées :} \begin{itemize} \item \bibentry{icwsm15} \item \bibentry{dn15} \end{itemize} \subsection{\nameref{ModeleContextuelFixe} (chapitre \ref{ModeleContextuelFixe})} Dans une seconde contribution, nous proposons un modèle de bandit contextuel basé sur des profils utilisateurs. L'hypothèse est que l'utilité espérée des différents utilisateurs dépend de profils constants définis sur chacun d'entre eux, et que leur utilisation peut permettre une meilleure exploration des utilisateurs. Nous considérons néanmoins le cas, correspondant aux contraintes de notre tâche, où ces profils ne sont pas directement visibles, seuls des échantillons bruités de ces profils (les messages postés par les utilisateurs) sont obtenus au cours de la collecte. Nous proposons un nouvel algorithme, avec garanties théoriques de convergence, permettant d'améliorer l'efficacité de la collecte dans diverses configurations expérimentales réalistes. \textbf{Publication associée :} \begin{itemize} \item \bibentry{ecml16} \end{itemize} \subsection{\nameref{ModeleContextuelVariable} (chapitre \ref{ModeleContextuelVariable})} Dans les contributions précédentes, des hypothèses de stationnarité nous ont permis de définir des algorithmes efficaces avec des garanties de convergences théoriques. Néanmoins, cette stationnarité n'est pas toujours vérifiée. Nous proposons alors un modèle contextuel avec contextes variables, permettant d'appréhender les variations d'utilité espérée des utilisateurs. En supposant que l'utilité espérée d'un utilisateur à un pas de temps dépend du contenu qu'il a diffusé au pas de temps précédent, l'idée est d'exploiter ces corrélations pour améliorer les choix d'utilisateurs successifs. Cependant, dans notre cas, du fait des restrictions imposées par les API des médias considérés, seule une partie des contextes est visible à chaque pas de temps. On propose un algorithme adapté à ce genre de contraintes, ainsi que des expérimentations associées. \textbf{Publications associées :} \begin{itemize} \item \bibentry{icwsm16} \item \bibentry{dn16} \end{itemize} \subsection{\nameref{ModeleRelationnel} (chapitre \ref{ModeleRelationnel})} Enfin, ce dernier chapitre propose un nouveau type de bandit, dans lequel il existe des dépendances entre les distributions d'utilité des périodes de temps successives. Pour notre tâche de collecte, il s'agit alors d'émettre des hypothèses sur la manière dont transite l'information pertinente afin d'estimer les meilleurs utilisateurs à écouter à chaque période de temps. Deux modèles basés sur l'algorithme de Thompson sampling et des approximations variationnelles ont été proposées. \section{Références}} \usepackage[frenchb]{babel} \usepackage{lmodern} \usepackage{ae,aecompl} \usepackage[upright]{fourier} \usepackage{sectsty} \usepackage[top=2.5cm, bottom=2cm, left=3cm, right=2.5cm, headheight=15pt]{geometry} \setcounter{secnumdepth}{5} \usepackage{fancyhdr} \pagestyle{fancy} \lfoot[\thepage]{} \cfoot{} \rfoot[]{\thepage} \fancyhead[RO, LE] {} \usepackage{enumerate} \usepackage{enumitem} \usepackage[section]{placeins} \usepackage{epigraph} \usepackage[font={small}]{caption} \usepackage[francais]{minitoc} \setcounter{minitocdepth}{4} \usepackage{pdflscape} \usepackage{amsmath} \usepackage{amssymb} \usepackage{amsfonts} \usepackage{nicefrac} \usepackage{upgreek} \usepackage[boxed,ruled,linesnumbered,french]{algorithm2e} \usepackage{multirow} \usepackage{booktabs} \usepackage{colortbl} \usepackage{tabularx} \usepackage{multirow} \usepackage{threeparttable} \usepackage{etoolbox} \appto\TPTnoteSettings{\footnotesize} \addto\captionsfrench{\def\tablename{{\textsc{Tableau}}}} \usepackage{graphicx} \usepackage{subcaption} \usepackage{pdfpages} \usepackage{rotating} \usepackage{pgfplots} \usepgfplotslibrary{groupplots} \usepackage{tikz} \usetikzlibrary{backgrounds,automata} \pgfplotsset{width=7cm,compat=1.3} \tikzset{every picture/.style={execute at begin picture={ \shorthandoff{:;!?};} }} \pgfplotsset{every linear axis/.append style={ /pgf/number format/.cd, use comma, 1000 sep={\,}, }} \usepackage{eso-pic} \usepackage{import} \usepackage{cclicenses} \usepackage{pgfplotstable} \usepackage{verbatim} \makeatletter \patchcmd{\BR@backref}{\newblock}{\newblock(page~}{}{} \patchcmd{\BR@backref}{\par}{)\par}{}{} \makeatother \usepackage{breakcites} \usepackage{bibentry} \nobibliography* \usepackage[pdftex,pdfborder={0 0 0}, colorlinks=false, linkcolor=blue, citecolor=blue, pagebackref=true, ]{hyperref} \usepackage{silence} \WarningFilter{minitoc(hints)}{W0023} \WarningFilter{minitoc(hints)}{W0024} \WarningFilter{minitoc(hints)}{W0028} \WarningFilter{minitoc(hints)}{W0030} \chapterfont{\centering} \chapternumberfont{\centering} \tolerance 1000 \chapter*{Remerciements} Je remercie chaleureusement toutes les personnes du LIP6 qui m’ont aidé pendant l’élaboration de ma thèse et notamment mon directeur Monsieur Patrick Gallinari, pour son intérêt et ses conseils tout au long de ses trois années. Je tiens en particulier à dire merci mon encadrant, Monsieur Sylvain Lamprier pour son soutien et sa grande disponibilité. Ce travail est le fruit d'une collaboration étroite entre nous. Il a toujours été à l’écoute, et s’est toujours beaucoup impliqué dans mes travaux. Les nombreuses discussions que nous avons eues ainsi que ses conseils sont pour beaucoup dans le résultat final de ce travail. Enfin, ses relectures et ses corrections ont été très appréciables. Je souhaite également remercier l'equipe MLIA et en particulier Ludovic Denoyer pour son aide dans la rédaction de divers articles. Ce travail n’aurait pas été possible sans le soutien de l'Institut de Recherche Technologique SystemX et du projet au projet IMM, qui m’ont permis, grâce aux aides financières, de me consacrer sereinement à l’élaboration de ma thèse. Je pense à tous les intervenants avec qui j'ai eu l'honneur de travailler et souhaite en particulier remercier Olivier Mesnard, chef du projet IMM, de m'avoir apporté son soutien. Je remercie également Nicolas, Jérémy, Jean-Alexis, Pierre et Romain pour leur aide scientifique et technique, mais aussi pour les nombreuses échanges que nous avons eus. Je voudrais aussi remercier Philippe Preux et Liva Ralaivola d’avoir accepté de relire cette thèse et d’en être rapporteurs, ainsi que Michèle Sebag et Olivier Sigaud d’avoir accepté d’être membres du jury. Au terme de ce parcours, je remercie enfin celles et ceux qui me sont chers et que j’ai quelque peu délaissé ces derniers mois pour achever cette thèse. Leurs attentions et encouragements m’ont accompagné tout au long de ces années. Merci à mes parents, pour leur soutien moral et matériel et leur confiance, et à ma tante pour sa relecture du manuscrit.
\section*{Abstract} {\bf We explore in detail the implementation of arbitrary abelian and non-abelian symmetries in the setting of infinite projected entangled pair states on the two-dimensional square lattice. We observe a large computational speed-up; easily allowing bond dimensions $D=10$ in the square lattice Heisenberg model at computational effort comparable to calculations at $D=6$ without symmetries. We also find that implementing an unbroken symmetry does not negatively affect the representative power of the state and leads to identical or improved ground-state energies. Finally, we point out how to use symmetry implementations to detect spontaneous symmetry breaking.} \section{Introduction} \label{sec:intro} Tensor network methods have become the de facto method of choice in the numerical treatment of one-dimensional quantum systems \cite{schollwoeck11}. The extension to other loop-free geometries is relatively straightforward\cite{shi06:_class, murg10:_simul, tagliacozzo09:_simul, gerster14:_uncon, gunst18:_t3ns, bauernfeind17:_fork_tensor_produc_states} and preserves most of the numerical advantages of the one-dimensional systems. Work is still ongoing, however, to effectively and efficiently handle large two-dimensional systems which are firstly both of extremely high experimental and theoretical interest and secondly difficult to treat numerically with any method. For example, the dynamical mean-field theory is being combined with new and different solvers\cite{wolf15:_imagin_time_matrix_produc_state, stadler15:_dynam_mean_field_theor_plus, bauernfeind17:_fork_tensor_produc_states} to allow the treatment of larger clusters within the dynamical cluster approximation; a similar approach is taken for the density matrix embedding theory\cite{knizia12:_densit_matrix_embed,knizia13:_densit_matrix_embed} to likewise allow for larger clusters\cite{zheng17:_strip_hubbar} potentially necessary for the treatment of two-dimensional lattices. Recently, a diagrammatic formulation of quantum Monte Carlo\cite{deng15:_emerg_bcs_hubbar} was also used to further avoid the sign problem, which otherwise makes calculations in frustrated or fermionic systems very hard. Standard matrix-product state/density-matrix renormalisation group (MPS-DMRG) methods are also continuously applied to wider and wider cylinders, but computational costs essentially explode beyond relatively limited cylinder circumferences\cite{stoudenmire12:_study_two_dimen_system_densit, leblanc15:_solut_two_dimen_hubbar_model, ehlers17:_hybrid_hubbar, depenbrock12:_natur_spin_liquid_groun_state}. Projected entangled pair states \cite{verstraete04:_renor}, the two-dimensional generalisation of matrix-product states, were proposed soon after the understanding of the latter in the context of the density matrix renormalisation group and a further generalisation to \emph{infinite} two-dimensional systems\cite{verstraete08:_matrix, jordan08:_class_simul_infin_size_quant} followed with continuous improvements\cite{corboz10:_simul, corboz10:_simulb, corboz14:_compet_states_model_b, lubasch14:_algor, phien15:_fast, phien15:_infin, vanderstraeten16:_gradien, corboz16:_variat, corboz16:_improv_hubbar} to the method over the last few years. In this work, we explore the implementation of both abelian and non-abelian symmetries -- which is a standard method in one-dimensional MPS codes -- with the infinite projected entangled pair states (iPEPS) method used to calculate two-dimensional ground-state properties. In particular, we will show that, absent spontaneous symmetry breaking, implementing an abelian or non-abelian symmetry provides a major computational advantage and considerably improved estimates for the ground-state energy. This will be done using the explicit Clebsch-Gordan Coefficients approach introduced in Ref.~\cite{weichselbaum12:_non}. Furthermore, we will showcase how the implementation of a symmetry allows additional control over a calculation: First, once the symmetry is implemented, one forces the calculation into a canonical ensemble, hence exactly preserving e.g.~particle number at the desired and manually-selected value. Second, enabling or disabling the preservation of the symmetry allows selecting between symmetry-unbroken and symmetry-broken states and phases. By comparing the energies of these states, it becomes very easy and very stable to pinpoint phase transitions. To this end, the paper is structured as follows: Sec.~\ref{sec:syms} reviews the implementation of arbitrary symmetries in tensor networks and establishes some notation. Sec.~\ref{sec:impl-details} goes into further detail of required adaptations of the standard iPEPS algorithms to allow for such an implementation as well as different considerations of computational effort. In Sec.~\ref{sec:comp-speed}, we use the Heisenberg $S=\nicefrac{1}{2}$ Hamiltonian on a square and Kagomé lattice to show the computational speed-up attainable by implementing symmetries in the network. In particular, a large benefit due to the implementation of the unbroken $\mathrm{SU}(2)$-spin symmetry in the Kagomé lattice is observed. The selection of symmetry-broken and symmetry-unbroken states and their use in diagnosing spontaneous symmetry breaking is discussed in Sec.~\ref{sec:sym-breaking}. Finally, we conclude in Sec.~\ref{sec:conclusions}. \section{\label{sec:syms}Symmetries in tensor networks} The implementation of global abelian symmetries in low-rank loop-free tensor networks is generally well-understood and a cornerstone of efficient computations in modern codes\cite{schollwoeck11, hauschild:_tensor_networ_python_tenpy, mcculloch16:_mp_toolk, stoudenmire:_itens_c}. In contrast to this, global non-abelian symmetries\cite{mcculloch02:_abelian} have seen less widespread use and proposals on how to implement them for higher-rank tensor networks are relatively new \cite{weichselbaum12:_non, singh12:_tensor_su}. While global abelian symmetries generalise straightforwardly to higher-rank tensors (see e.g.~Ref.~\cite{bauer11:_implem_abelian, haghshenas18:_j_heisen} for applications to (i)PEPS), for non-abelian symmetries there are two alternative approaches: the \emph{implicit Clebsch-Gordan coefficients approach} relies on analytical knowledge of Clebsch-Gordan coefficients (CGCs) for rank-3 tensors and decomposes any higher-rank tensor into a double tree of rank-3 tensors \cite{singh10:_tensor, singh12:_tensor_su}. Alternatively, the \emph{explicit CGC approach} generalises the notion of CGCs to higher-rank tensors and explicitly stores those coefficients within the tensor \cite{weichselbaum12:_non}. The latter approach was already applied to iPEPS calculations in Ref.~\cite{bruognolo17:_tensor, liu15:_simpl_heisen}. Here, we will briefly summarise the implementation of arbitrary symmetries following the \emph{explicit CGC approach} as done in the \textsc{SyTen} toolkit \cite{hubig:_syten_toolk}. For a more extensive discussion of this approach, see Refs.~\cite{weichselbaum12:_non, hubig17:_symmet_protec_tensor_networ}. In Sec.~\ref{sec:impl-details} we will then go on to discuss implementation details specific to iPEPS calculations. Fundamentally, a rank-$R$ tensor $T$ is represented as a direct sum of a finite number of blocks $\{ t_i \}$: \begin{equation} T = \bigoplus_{i=1}^{N_t} t_i \quad. \label{eq:tensor-blocks} \end{equation} Each of the $R$ legs of the tensor is given a direction corresponding to the tensor acting on the vector space on this leg or its dual. A matrix, for example, would have one incoming leg and one outgoing leg. Every block $t_i$ then firstly contains a single quantum number label for every symmetry in the system (e.g.~$\mathrm{U}(1)$ particle number $n$ and $\mathrm{SU}(2)$ spin $S$) on each of its $R$ legs. Furthermore, each block contains one dense \emph{reduced} rank-$R$ tensor $m_i$ and, for every symmetry $\gamma$, a \emph{generalised CGC} rank-$R$ tensor $c^\gamma_i$: \begin{equation} t_i = m_i \bigotimes_{\gamma=1}^{N_S} c^\gamma_i \quad. \label{eq:tensor-cgc} \end{equation} Blocks with the same quantum numbers on all legs can be added directly, blocks with different quantum numbers are placed next to each other (cf.~Eq.~\eqref{eq:tensor-blocks-diag}). If there are no symmetries in the system, the tensor $T$ only contains a single block $t_1$ which, in turn, only contains the collection of scalar coefficients of the tensor. For abelian symmetries, $c^\gamma_i$ are one-dimensional tensors which are non-zero if the addition rules for the abelian symmetry are fulfilled by the quantum numbers assigned to the tensor legs and zero if the addition rules are broken. Alternatively, the $c^\gamma_i$ can be left off and the addition rules enforced by hand. For rank-2 tensors with one incoming and one outgoing index, $c^\gamma_i$ are proportional to identity matrices, for rank-3 tensors, they correspond directly to the standard Clebsch-Gordan coefficients. \paragraph{As an example,} consider a rank-2 tensor $T$ with a single preserved $\mathrm{SU}(2)$-spin symmetry. The blocks of the tensor are labelled by the $\mathrm{SU}(2)$-spin quantum numbers of the states on the incoming and outgoing tensor legs. Let the tensor contain three blocks corresponding to $S=0$, $S=\nicefrac{1}{2}$ and $S=1$: \begin{equation} T = t_{0,0} \bigoplus t_{\nicefrac{1}{2},\nicefrac{1}{2}} \bigoplus t_{1,1} \quad. \end{equation} The implicit direct sum is equivalent to placing the three blocks on the diagonal of a larger matrix: \begin{equation} T = \begin{pmatrix} \left[ t_{0,0} \right] & 0 & 0 \\ \xcancel{t_{\nicefrac{1}{2},0}} & \left[ t_{\nicefrac{1}{2},\nicefrac{1}{2}} \right] & 0 \\ 0 & 0 & \left[ t_{1,1} \right] \end{pmatrix} \quad. \label{eq:tensor-blocks-diag} \end{equation} The location of a hypothetical block $t_{\nicefrac{1}{2},0}$ is also shown but this block (like all other zeros in the $T$ tensor) is forbidden by the symmetry and must be identically zero. The decomposition according to Eq.~\eqref{eq:tensor-cgc} then allows rewriting each block $t_i$ as the tensor product of a reduced block and a symmetry-protected CGC tensor $c_i$. Since the tensor $T$ is a rank-2 tensor, the $c_i$ are simply identity matrices of the appropriate size: $1 \times 1$, $2 \times 2$ and $3 \times 3$ respectively, as the irreducible representations $S=0$, $S=\nicefrac{1}{2}$ and $S=1$ are one-, two- and three-dimensional respectively: \begin{align} t_{0,0} & = m_{0,0} \bigotimes \mathbf{1}_1 \\ t_{\nicefrac{1}{2},\nicefrac{1}{2}} & = m_{\nicefrac{1}{2},\nicefrac{1}{2}} \bigotimes \mathbf{1}_2 \\ t_{1,1} & = m_{1,1} \bigotimes \mathbf{1}_3 \quad. \end{align} While $t_{0,0}$ and $m_{0,0}$ have exactly the same number of rows and columns, $t_{\nicefrac{1}{2},\nicefrac{1}{2}}$ has twice the number of rows and columns as $m_{\nicefrac{1}{2},\nicefrac{1}{2}}$ (and four times the number of elements) while $t_{1,1}$ has nine times as many elements as $m_{1,1}$! This already is an indicator of the power of non-abelian symmetries in tensor networks. In comparison, an \emph{abelian} symmetry would still allow for the decomposition of the tensor $T$ into blocks. The $S^z = 0$ block $t_{0,0}$, however, would contain contributions from the $S=0$ and the $S=1$ sector (and hence would be larger). It would also not be possible to exploit the two-fold degeneracy of the $S=\nicefrac{1}{2}$ sector, one would instead have to keep two blocks $t_{\pm \nicefrac{1}{2}}$. In this case, all $c_i$ would be $1 \times 1$ dummy matrices. Note that here we force every tensor to preserve the symmetry exactly and do not allow for a shift of all quantum numbers within a tensor, as such shifts are only well-defined for abelian symmetries and would break down immediately when including non-abelian symmetries. \paragraph{Tensor operations} can then be implemented to largely act independently on each block and also the $m_i$ and $c^\gamma_i$ within each block. The addition of two tensors $T + S$ is simply a direct sum over all blocks: \begin{equation} T + S = \bigoplus_{x=t,s} \bigoplus_{i=1}^{N_x} x_i \quad. \end{equation} However, we may then end up with many blocks with identical quantum numbers on all legs and an identical Clebsch-Gordan structure. If for every symmetry in the system, the associated CGC tensors of two blocks are parallel to each other, we may move those factors into the reduced dense tensors and then add the reduced dense tensors together to arrive at a single block consisting of the sum of the dense tensors as well as one set of CGC tensors. This operation hence reduces the number of blocks in the direct sum and is called a \emph{reduction} in the following (not to be confused with the reduced tensor $m_i$ above). The contraction of two tensors $T$ and $S$, $R = T \cdot S$ over a set of legs is evaluated as follows: First, collect all pairs of blocks $\{ t_i, s_j \}$ which are labelled by identical quantum numbers on the contracted legs. Then construct result blocks $r_k$ as \begin{equation} r_k = \left( m_{t,i} \cdot m_{s,j} \right) \bigotimes_{\gamma=1}^{N_s} \left( c^\gamma_{t,i} \cdot c^\gamma_{s,j} \right) \end{equation} where $\cdot$ denotes the desired contraction. Afterwards reduce the number of blocks of the result tensor $R$ as described above by adding parallel tensor blocks. While it is straightforward to parallelise over the pairs of all possible contractions, to reduce memory usage, one should also first collect all contraction pairs resulting in a given quantum number configuration on the open legs, contract and reduce those and only then move on to the next set of quantum numbers on the open legs. Otherwise, the intermediate, unreduced $R$ tensor can easily exceed the size of the actual reduced $R$ by a factor of 100. \paragraph{Reduced and Total Dimensions} When speaking about the \emph{bond dimension} of a tensor network state or more generally the dimensions of a tensor, it is useful to differentiate between the \emph{reduced} and the \emph{total} dimension. Here, the \emph{reduced dimension} of a tensor on one of its legs is the sum of the sizes of every reduced block (counted only once per quantum number sector). In comparison, the \emph{total dimension} of a tensor on one of its legs is the sum of the sizes of every reduced block multiplied by the product of the sizes of the associated generalised CGC tensors. Put another way, a spin doublet state with two duplicate singular values associated to $\pm \nicefrac{1}{2}$ has a total dimension of two regardless of the symmetries used to represent it. However, if the tensor implements the $\mathrm{SU}(2)$ spin symmetry, the \emph{reduced} dimension of the state is merely $1$, the duplicate-ness of the singular values is not counted. We then typically expect computational effort to scale cubically in the reduced dimensions, whereas the expressivity of a tensor and the potentially carried entanglement scales with its total dimensions. To differentiate the two in the following text, we will use capital letters ($D$, $X$) to refer to total dimensions whereas lower-case letters ($d$, $\chi$) refer to the reduced dimensions. In the iPEPS calculations to follow, $d$ and $D$ respectively will denote the state bond dimension whereas $\chi$ and $X$ respectively will denote the environment bond dimension. The distribution of states among the different quantum number sectors is in principle open and should be adapted according to the specific state represented. While at relatively small bond dimensions (as encountered in iPEPS calculations) it may be feasible to fix that distribution by hand beforehand, finding the optimal choice a priori becomes combinatorially expensive. To avoid this problem, minimal care must be taken to allow flexibility in the choice of quantum number sectors. Within the full update scheme with imaginary time evolution, this flexibility comes naturally. For the newer variational update schemes \cite{vanderstraeten16:_gradien, corboz16:_variat} one may have to consider either two-site updates or an expansion scheme analogous to the subspace expansion in DMRG \cite{hubig15:_stric_dmrg}. \section{Implementation details specific to iPEPS} \label{sec:impl-details} Our iPEPS calculation largely follows the existing literature, making use of imaginary time evolution with the fast full update (FFU)\cite{phien15:_fast} and gauge fixing\cite{lubasch14:_algor, phien15:_infin}. The corner transfer matrix is truncated as suggested in \cite{corboz14:_compet_states_model_b}. During the optimisation, we aim for a total environment bond dimension $X$ approximately ten times the total state bond dimension $D$. Errors for observables from the corner transfer matrix method are estimated as follows: First, at given environment bond dimension $\chi$, corner transfer matrix (CTM) steps are done until the observable changes by less than a small threshold ($10^{-8}$) or 15 steps are done. The first error is then the maximum change between the last three steps, the last value is taken as the result of this fixed-$\chi$ calculation. Second, $\chi$ is multiplied by 2 and the previous procedure repeated until the resulting values differ by less than the small threshold $10^{-8}$ or $\chi$ is larger than 128. The second error is then the change between the value at the last fixed $\chi$ and the second-to-last calculation at fixed $\chi$. The error is the larger of the first and second error. In our experience, this is a very conservative error measure which is likely to overestimate the error of the obtained value. Absent a better error estimation method, we will however use it in the following figures. While the variational update is not yet implemented, its improvements are orthogonal to those discussed here, so we expect all results to carry over from imaginary time evolution to the variational update with minimal modifications. The same applies to the new extrapolation schemes for observables\cite{corboz16:_improv_hubbar, rader18:_finit_correl_lengt_scalin_loren}. Additionally, we should differentiate this tensor-based approach to global symmetries from an alternative in which one first parametrises all (e.g.) $\mathrm{SU}(2)$ invariant tensors with a specific bond dimension and specific quantum numbers on each bond. In this alternative approach, one then works with dense state tensors (with complicated parametrised entries, which are optimised) but the symmetries do not necessarily extend to (e.g.) the environment tensors. This approach is in particular useful if the obtainable bond dimension is relatively small, as one may categorise and understand each individual state at a specific bond dimension and the relative advantage of a symmetry implementation at very small bond dimensions is also small. \subsection{Required adaptations of the iPEPS setup} \begin{figure}[tb] \centering \tikzpic{figures/ipeps-unitcell}{ \begin{tikzpicture} \node (A) [draw,circle,inner sep=0pt, minimum size=1.5em] at (0,0) {A}; \node (B) [draw,circle,inner sep=0pt, minimum size=1.5em] at (2,0) {B}; \node (C) [draw,circle,inner sep=0pt, minimum size=1.5em] at (4,0) {C}; \node (D) [draw,circle,inner sep=0pt, minimum size=1.5em] at (1,2) {D}; \node (E) [draw,circle,inner sep=0pt, minimum size=1.5em] at (3,2) {E}; \node (F) [draw,circle,inner sep=0pt, minimum size=1.5em] at (5,2) {F}; \node (R) [draw,circle,inner sep=0pt, minimum size=1.5em] at (-0.5,-1) {R}; \draw[<-] (A) -- +(0.7,0); \draw[->] (A) -- +(-0.7,0); \draw[<-] (A) -- +(0.35,0.7); \draw[->] (A) -- +(-0.2,-0.4); \draw[<-] (A) -- +(-0.4,0.8) node[above] {$q(\sigma_A)$}; \draw[<-] (B) -- +(0.7,0); \draw[->] (B) -- +(-0.7,0); \draw[<-] (B) -- +(0.35,0.7); \draw[->] (B) -- +(-0.35,-0.7); \draw[<-] (B) -- +(-0.4,0.8) node[above] {$q(\sigma_B)$}; \draw[<-] (C) -- +(0.7,0); \draw[->] (C) -- +(-0.7,0); \draw[<-] (C) -- +(0.35,0.7); \draw[->] (C) -- +(-0.35,-0.7); \draw[<-] (C) -- +(-0.4,0.8); \draw[<-] (C) -- +(-0.4,0.8) node[above] {$q(\sigma_C)$}; \draw[<-] (D) -- +(0.7,0); \draw[->] (D) -- +(-0.7,0); \draw[<-] (D) -- +(0.35,0.7); \draw[->] (D) -- +(-0.35,-0.7); \draw[<-] (D) -- +(-0.4,0.8); \draw[<-] (D) -- +(-0.4,0.8) node[above] {$q(\sigma_D)$}; \draw[<-] (E) -- +(0.7,0); \draw[->] (E) -- +(-0.7,0); \draw[<-] (E) -- +(0.35,0.7); \draw[->] (E) -- +(-0.35,-0.7); \draw[<-] (E) -- +(-0.4,0.8); \draw[<-] (E) -- +(-0.4,0.8) node[above] {$q(\sigma_E)$}; \draw[<-] (F) -- +(0.7,0); \draw[->] (F) -- +(-0.7,0); \draw[<-] (F) -- +(0.35,0.7); \draw[->] (F) -- +(-0.35,-0.7); \draw[<-] (F) -- +(-0.4,0.8); \draw[<-] (F) -- +(-0.4,0.8) node[above] {$q(\sigma_F)$}; \draw[->] (R) -- +(-0.2,-0.4); \draw[<-] (R) -- +(0.2,0.4); \draw[->] (R) -- +(-0.25,0.5) node at +(-0.35,0.7) {Q}; \draw [dotted] (A) -- (D); \draw [dotted] (A) -- (B); \draw [dotted] (B) -- (C); \draw [dotted] (B) -- (E); \draw [dotted] (C) -- (F); \draw [dotted] (D) -- (E); \draw [dotted] (E) -- (F); \draw [dotted] (A) -- (R); \draw [dotted] (A) -- +(-1,0); \draw [dotted] (D) -- +(-1,0); \draw [dotted] (C) -- +(+1,0); \draw [dotted] (F) -- +(+1,0); \draw [dotted] (D) -- +(0.5,1); \draw [dotted] (E) -- +(0.5,1); \draw [dotted] (F) -- +(0.5,1); \draw [dotted] (B) -- +(-0.9,-1.8); \draw [dotted] (C) -- +(-0.9,-1.8); \draw [dotted] (R) -- +(-0.4,-0.8); \end{tikzpicture} } \caption{\label{fig:remover}Layout of an example $2 \times 3$ iPEPS unit cell as used here. Each of the individual site tensors $A$, $B$, $C$, $D$, $E$ and $F$ inserts some charge into the network (which also depends on the local state), the special remover tensor $R$ is used to extract a total charge $Q$ from the unit cell. Auxiliary leg contractions are indicated by the dotted lines. The average quantum number on the inter-unit-cell auxiliary legs is zero (with some fluctuations) whereas intra-unit-cell legs can have non-zero average quantum number depending on the values of $q(\sigma)$ and the ``routing'' of charges through the unit cell.} \end{figure} \label{sec:impl-details:adaptations} The first step to combine symmetry-preserving tensors with an established tensor network algorithm is to define a consistent leg direction such that the tensor contractions required to, for example, represent the state are well-defined. The specific leg directions are entirely arbitrary, but of course have to be consistent within a calculation.\footnote{Even when not enforcing the symmetry at the tensor level, a consistent choice of directions is required, as observed e.g.~in Ref.~\cite{hackenbroich18:_inter_peps}.} Second, when enforcing the symmetry, we effectively work in a canonical ensemble of a fixed average quantum number per unit cell. If this average quantum number is non-zero (e.g. 1 particle per site in the Hubbard model), it shifts the outgoing auxiliary tensor legs relative to the incoming auxiliary tensor legs. To account for this shift and give an overall consistent state, we insert an additional rank-3 \emph{remover} tensor on the boundary of each unit cell. The remover tensor has a ``physical'' leg which points in the opposite direction of the usual physical legs on our iPEPS sites and simply removes as many particles as desired from the calculation. The additional leg is traced out during all calculations, for abelian symmetries, it amounts to an additional shift of the quantum numbers in each unit cell. The remover tensor is initialised as a random tensor with the required quantum number sectors on its three legs and then optimised during the iPEPS update of its two neighbouring sites. Third, when constructing a single-site operator such as $\hat s^+$ in a $\mathrm{U}(1)$-$S^z$ preserving system, it is necessary to insert an additional tensor leg to carry the additional quantum number. In the product $\hat s^+_i \hat s^-_j$, these legs then combine to form a two-site gate acting on sites $i$ and $j$ connected by the contracted leg. If the contracted leg crosses any other tensor legs, the usual rule for fermionic PEPS applies\cite{corboz10:_simul} and a swap gate has to be inserted\cite{corboz10:_simulb}. This swap gate fulfills the same role as Jordan-Wigner strings between operators $\hat c^\dagger$ and $\hat c$ in matrix-product operators \cite{hubig17:_gener}. \subsection{Performance and accuracy necessitated by iPEPS compared to MPS} In a typical MPS-DMRG calculation, the maximal ranks of temporary tensors is typically limited to four or five, with the basic state building blocks having rank three. This has two beneficial side effects: first, the number of blocks in a tensor is limited to approximately $O(1000)$ with each individual block being relatively large. Second, the entries of the CGC tensors are regularly constructed from rank-2 and rank-3 tensors, which helps alleviate the buildup of numerical errors due to limited accuracy. In an iPEPS calculation, in contrast, the maximal tensor ranks are much larger (rank 10 or above!), naively leading to tensors with $O(10^6)$ or more blocks. Furthermore, numerical errors in the CGC tensors build up very quickly as the basic rank-5 tensors already display a complicated Clebsch-Gordan structure. The first issue is solely a performance problem and can be avoided by minimising tensor ranks wherever possible. In particular, it turns out that first constructing the rank-4 double-layer tensors and then applying the CTM algorithm based on the rank-4 tensors is effectively computationally more efficient than contracting the single-layer rank-5 tensors individually into the existing CTM tensors, even though the latter approach is asymptotically cheaper. However, the former decreases the overhead both from bookkeeping the tensors and initialising many extremely small matrix-matrix products. As iPEPS bond dimensions $D$ are typically relatively small, argument about asymptotic efficiency also carry less weight than in (e.g.) MPS methods. The second problem is more intricate and delayed by three tricks: First, we use higher-precision floating point numbers\footnote{Specifically, the \texttt{boost::multiprecision::cpp\_bin\_float<76>} type is used.} to represent the entries of the CGC tensors. Second, within a tensor, we regularly check all non-zero coefficients (of which there are typically very few) and set those coefficients which are close in magnitude equal to each other. As an illustrative example, if a CGC tensor contains coefficients $[0.99, 1.01, -1.01, 0.99]$, we set them to $[1.00, 1.00, -1.00, 1.00]$. The actual closeness threshold used is $\approx 10^{-16}$. This relies on the fact that the coefficients of a CGC tensor are computed from very few inputs in very specific ways and no (typical) CGC tensor should truly contain coefficients different from each other but closer than $10^{-16}$. Finally, it is helpful to regularly reconstruct the CGC tensors from scratch to remove all numerically buildup errors. This is done by first merging all tensor legs of the tensor until one arrives at a tensor with a single incoming and a single outgoing leg. In this tensor, the CGC tensors should be proportional to identity matrices which is then ensured manually. Afterwards, the tensor legs are split again to rebuild the original tensor structure. An alternative solution for the issue of numerical accuracy would be to use continued fractions to represent the CGC coefficients to high accuracy as suggested in Ref.~\cite{weichselbaum12:_non, bruognolo17:_tensor} at the cost of a higher effort to implementation. With these relatively minor changes, it becomes possible to do $\mathrm{SU}(2)$- and $\mathrm{U}(1)$-symmetric calculations on infinite projected entangled pair states using symmetric tensors in place of standard dense tensors without internal structure. \section{Computational speed-up}\label{sec:comp-speed} In classical DMRG calculations, implementing an abelian $\mathrm{U}(1)$ symmetry typically leads to an approximately ten-fold computational speed-up or, alternatively, an approximately tripled bond dimension. Changing from a $\mathrm{U}(1)$ to a $\mathrm{SU}(2)$ symmetry has a similar effect of approximately tripling the effective bond dimension. To test the effect of the implemented symmetries, we pick two example systems, namely $S = \nicefrac{1}{2}$ spins on the Kagomé and square lattice. \subsection{Spin-\nicefrac{1}{2} square lattice Heisenberg model} As a first example, we consider the $S=\nicefrac{1}{2}$ Heisenberg Hamiltonian on a square lattice at the Heisenberg point of isotropic coupling: \begin{equation} \hat H = \sum_{\langle i, j \rangle} \hat s^x_i \hat s^x_j + \hat s^y_i \hat s^y_j + \hat s^z_i \hat s^z_j \quad. \end{equation} The system spontaneously breaks the $\mathrm{SU}(2)$ symmetry of the Hamiltonian but preserves both the $\mathbb{Z}_2$ and $\mathrm{U}(1)$-$S^z$ symmetries. \paragraph{The computational speed-up} obtainable is first estimated by measuring the time required to re-initialise the corner transfer matrix with eight steps in each direction, evaluate the energy (evaluating eight two-site expectation values) and then do five full updates for imaginary time evolution of a second-order Trotter decomposition on a 2x2 unit cell. Each step requires the application of 16 gates. 8 of the 16 gates connect two neighbouring unit cells and hence also require a directional (up/down or left/right) CTM step. The runtime measurement is done after sufficiently many initial steps that the iPEPS bond dimension $d$ and the bond dimension $\chi$ of the environment has saturated. For abelian (or no) symmetries, we set $\chi = 10(d+1)$, while for the non-abelian $\mathrm{SU}(2)$ case, $\chi = 5(d+1)$ appears to be enough to obtain stability and convergence. Fig.~\ref{fig:sq:effort-d} shows the CPU time in seconds for the above procedure. These measurements were done on a single core of a Intel Xeon CPU E5-2630 v4 clocked at 2.20GHz. Except at minimal bond dimension $D=2$, enforcing the $\mathrm{U}(1)$ or $\mathbb{Z}_2$ symmetry has a very beneficial effect on the runtime. At larger bond dimensions, the $\mathrm{U}(1)$-symmetric calculation is also much faster than the $\mathbb{Z}_2$-symmetric calculation. Comparing the reduced bond dimension $d$ of a $\mathrm{SU}(2)$-symmetric calculation, one observes a very large cost (e.g. at $d=3$: 89, 22, 12 and 653 seconds respectively without symmetries, with $\mathbb{Z}_2$, $\mathrm{U}(1)$ and $\mathrm{SU}(2)$). Part of this large cost is due to a relatively large overhead of the CGC tensors, but another part comes from intermediate tensors (e.g. the rank-4 double layer tensors) having a larger relative bond dimension which is less amenable to a reduction in size by the symmetry implementation. On the other hand, when comparing the total effective bond dimension $D$, the $\mathrm{SU}(2)$-symmetric implementation is always faster (at $D=4, 8, 12$) than a comparable calculation without this symmetry. Due to the model spontaneously breaking the $\mathrm{SU}(2)$ symmetry in the ground state the obtained energies are not comparable and the data is included here only for completeness. \begin{figure}[tb] \begin{minipage}[t]{0.49\textwidth} \includegraphics{figures/heisenberg-speedup-syms-Dx} \caption{\label{fig:sq:effort-d}Computational effort for CTM initialisation, energy evaluation and five FFU steps in imaginary time in the Heisenberg square lattice model. Data for the $\mathrm{SU}(2)$-symmetric calculation is plotted over the reduced ($d$) and total ($D$) bond dimension.} \end{minipage} \hspace{0.02\textwidth} \begin{minipage}[t]{0.49\textwidth} \includegraphics{figures/heisenberg-energies-syms-Dx} \caption{\label{fig:sq:error-d}Error in energy per spin calculated in the Heisenberg square lattice model at $\Delta = 1$ with $E_0 = -0.669437$. Error bars are obtained from the CTM calculation and give the error of the observable relative to its true value in the given variational state.} \end{minipage} \end{figure} \paragraph{The error in energy} per spin with and without symmetries is given in Fig.~\ref{fig:sq:error-d} relative to the reference value $E_0 \equiv -0.669437$ \cite{sandvik97:_finit_heisen}. The calculation is initialised in a Néel state ($D=1$) or (for the $\mathrm{SU}(2)$ case) two singlets ($D=2$) and then proceeds in stages. We first increase the bond dimension to $d=2$ and then time evolve with step size $\delta\tau = 1, 0.1, 0.01$ until the energy (estimated every five steps) stops decreasing. Subsequently, we either decrease $\delta\tau$ or, if we reached the minimal specified $\delta\tau$, increase $d$ and reset $\delta\tau$ to a larger value ($0.1$). Starting at $d = 3$, we allow a smaller minimal $\delta\tau = 0.001$. The Trotter error should hence be of order $O(\delta\tau^2) \approx 10^{-6}$. The energy estimates during the time evolution are at a fixed $\chi$ and with a re-initialised environment to trade-off accuracy and computational effort. Each obtained state is however also saved to disk. The expectation values shown are then evaluated on the stored states as described in Sec.~\ref{sec:impl-details}, in particular, error bars estimate the error of the calculated value compared to the true value of the given state. Due to our maximal environment bond dimension being limited to $\chi = 128$, error bars become relatively large in the logarithmic plot. Data for $\mathrm{SU}(2)$ is only included for completeness, so let us focus on the three other curves for calculations with no symmetries, $\mathbb{Z}_2$ symmetry and $\mathrm{U}(1)$ symmetry: Contrary to Ref.~\cite{bauer11:_implem_abelian} but in agreement with Refs.~\cite{liu15:_simpl_heisen, haghshenas18:_j_heisen} we find very comparable results with and without symmetries at identical bond dimensions. In particular at larger bond dimensions ($D=5,6$), enforcing the symmetry appears to aid the calculation as we can guide the state into the correct sector. This difference is most likely an effect of the fixed quantum number distribution with an equal number of states per sector used in Ref.~\cite{bauer11:_implem_abelian} which reduces the expressive power of the state. As expected, growing computational effort makes calculations at larger $D$ only accessible with the full $\mathrm{U}(1)$ symmetry. In addition to the reduced matrix sizes, the blocking of tensors also allows for a straightforward shared-memory parallelisation which was used here to obtain converged $D \geq 7$ results at acceptable wallclock times of no more than two days. For these larger bond dimensions, we observe that the obtained error gradually ceases to shrink. We expect that a variational update of the tensors should decrease the energy further. \subsection{The Kagomé lattice} While the Heisenberg Hamiltonian on the Kagomé lattice is the subject of ongoing research (e.g.~cf.~Refs.~\cite{depenbrock12:_natur_spin_liquid_groun_state, he17:_signat_dirac_cones_dmrg_study, corboz12:_simpl_su_heisen, mei17:_gapped_heisen, liao17:_gaples_spin_liquid_groun_state_kagom_antif, yan11:_spin_liquid_groun_state_s}), here, we only wish to benchmark the effect of a $\mathrm{SU}(2)$ spin symmetry which is probably not spontaneously broken in the ground state. Our implementation currently only handles square lattices, requiring a mapping of the Kagomé lattice to the square lattice (cf.~Fig.~\ref{fig:kag:lattice} and e.g.~Ref.~\cite{corboz12:_simpl_su_heisen}). This mapping is exact, the resulting $8$-dimensional space of the square lattice sites is not truncated.\footnote{One could, of course, consider such a truncation in future works, e.g. excluding the high-spin states $S=\nicefrac{3}{2}$ completely from the calculation.} However, the mapping is not optimal as two links in the Kagomé lattice are represented by just a single link in the square lattice, which then requires an approximately squared bond dimension to represent the same amount of entanglement. This difficulty should affect the calculations with and without symmetries mostly in the same way and hence does not preclude an analysis of the effect of the symmetry implementation here. A smarter approach is to adapt the structure of the tensor network to the Kagomé lattice and potentially introducing additional tensors to aid in convergence \cite{corboz12:_simpl_su_heisen, mei17:_gapped_heisen, liao17:_gaples_spin_liquid_groun_state_kagom_antif}. \begin{figure}[tb] \begin{minipage}[t]{0.49\textwidth} \includegraphics[width=\textwidth]{figures/kagome-lattice} \caption{\label{fig:kag:lattice}The mapping of the Kagomé lattice to the square lattice used here. Three sites of the Kagomé lattice (black circles) are merged into one site of the square lattice (dark blue). Each link between two square-lattice sites (light blue) corresponds to two links of the Kagomé lattice (black lines).} \end{minipage} \hspace{0.02\textwidth} \begin{minipage}[t]{0.49\textwidth} \includegraphics[width=\textwidth]{figures/kagome-energies-syms-Dx} \caption{\label{fig:kagome:energy-dx}Ground state energy per spin on the Kagomé lattice. The square lattice mapping leads to energies which are considerably worse than the current best estimates $E_0 \approx 0.437$ (values from \cite{mei17:_gapped_heisen}, \cite{liao17:_gaples_spin_liquid_groun_state_kagom_antif}, \cite{yan11:_spin_liquid_groun_state_s}, \cite{depenbrock12:_natur_spin_liquid_groun_state} shown as lines in top-down order, 9-site PESS from Ref.~\cite{liao17:_gaples_spin_liquid_groun_state_kagom_antif} as pink crosses).} \end{minipage} \end{figure} Earlier work\cite{mei17:_gapped_heisen, liao17:_gaples_spin_liquid_groun_state_kagom_antif} has found a ground state energy of approximately $-0.437$ using iPEPS calculations with the simple update mechanism. DMRG calculations on cylinders extrapolated to the 2D thermodynamic limit resulted in ground state energies per spin of $-0.4386(5)$\cite{depenbrock12:_natur_spin_liquid_groun_state} if $\mathrm{SU}(2)$ symmetry was conserved and $-0.4379(3)$ without conservation of $\mathrm{SU}(2)$ symmetry\cite{yan11:_spin_liquid_groun_state_s} and subsequently a smaller effective bond dimension. Fig.~\ref{fig:kagome:energy-dx} shows the results for the energy per spin with and without symmetries for our implementation. The figure also includes reference values as follows: first, solid lines show the extrapolated, final values from Ref. \cite{mei17:_gapped_heisen}, \cite{liao17:_gaples_spin_liquid_groun_state_kagom_antif}, \cite{yan11:_spin_liquid_groun_state_s} and \cite{depenbrock12:_natur_spin_liquid_groun_state} (in top-down order); the first two are iPEPS calculations whereas the latter two are DMRG calculations on cylinders extrapolated to the thermodynamic limit. Second, light pink crosses reproduce the 9-site PESS data in Ref.~\cite{liao17:_gaples_spin_liquid_groun_state_kagom_antif}. Third, the two bright pink crosses on the right-hand side show the same data, but for an effectively squared bond dimension as Ref.~\cite{liao17:_gaples_spin_liquid_groun_state_kagom_antif} does not use the square lattice mapping. Calculations with no symmetries, $\mathbb{Z}_2$ symmetry and $\mathrm{U}(1)$ symmetry obtain essentially identical results with the only difference being a drastic computational speed-up allowing $D=5$ without symmetries but $D=9$ with $\mathrm{U}(1)$ symmetry. This is expected and fully in-line with calculations on the square lattice above. Given our mapping of the Kagomé to the square lattice, also the difference between the results here and earlier works is not too worrisome. Even a certain degree of continuity between our data and the data from Ref.~\cite{liao17:_gaples_spin_liquid_groun_state_kagom_antif} plotted over the squared bond dimension (bright pink crosses) is visible. As the square lattice bonds need to transport approximately twice as much entanglement as the Kagomé lattice bonds in Ref.~\cite{liao17:_gaples_spin_liquid_groun_state_kagom_antif}, this is also expected. The comparison with the $\mathrm{SU}(2)$-invariant calculation (yellow circles in Fig.~\ref{fig:kagome:energy-dx}) is more interesting: Comparing both reduced and total bond dimensions, we obtain substantially lower energies with $\mathrm{SU}(2)$-invariant tensors than without. While the former is to be expected, the latter is surprising: Given two tensors of the same total bond dimension $D$, both are able to represent the same state and hence can be used to construct states with identical energies. Instead, the update procedure used here (fast full update) and its associated convergence problems must be responsible for the drastic difference in energies: it appears to be much easier to obtain a low-energy state using $\mathrm{SU}(2)$-invariant tensors than using unconstrained tensors. Multiple effects likely contribute: first, the initial random state with $\mathrm{SU}(2)$ invariance is typically a much better ground-state candidate than a random state which is not $\mathrm{SU}(2)$ invariant. In the latter case, the imaginary time evolution first has to rebuild the $\mathrm{SU}(2)$ invariance of the state from an initially symmetry-broken state. Second, during this reconstruction, the truncation of the state is not guaranteed to preserve its (attempt at) $\mathrm{SU}(2)$ invariance. Instead, degenerate multiplets may be truncated in the middle to obtain the target bond dimension. Third, while the gauge fixing mechanism used here greatly improves the accuracy and efficiency of the calculation, it is still not perfect and large bond dimensions may still lead to relatively large condition numbers of the norm tensors. By only considering smaller reduced tensors, this problem is avoided longer in the $\mathrm{SU}(2)$ invariant calculation. \subsection{Summary for the computational speed-up} In this section, we presented results showing that by implementing either abelian or non-abelian symmetries, larger bond dimensions and hence better results are obtainable at comparable computational effort. In the Heisenberg model, $d=10$ is possible when implementing the $\mathrm{U}(1)$ symmetry, which approximately doubles the bond dimension compared to our best calculations without any symmetries. As expected, the $\mathbb{Z}_2$ symmetry provides a smaller benefit than the $\mathrm{U}(1)$ symmetry but still a noticeable speed-up. In the Kagomé model, implementing the $\mathrm{SU}(2)$ symmetry leads to much faster convergence and hence much better results compared to calculations without symmetries. We must stress that these are ``merely'' practical advantages: given a sufficiently fast computer, there is no computational benefit in implementing a symmetry into a tensor network. However, we will show in the next section that implementing or not implementing a symmetry provides an additional control which can be used to obtain qualitatively different results. \section{Diagnosing spontaneous symmetry breaking}\label{sec:sym-breaking} Implementing a symmetry in a system not only allows for a potential computational speed-up, but also provides additional measures to control the calculation. First, forcing a state to transform uniquely under a symmetry is equivalent to doing the calculation in a canonical instead of grand-canonical ensemble. As a result, it becomes possible to fix total particle number (or average particle number per unit cell) exactly to a desired value. For example in the Kagomé calculation, the states with $\mathrm{SU}(2)$ symmetry are exact eigenstates of the total spin operator with eigenvalue $S \equiv 0$ and the states with $\mathrm{U}(1)$ symmetry are exact eigenstates of the total $\hat S^z$ operator with eigenvalue $S^z \equiv 0$. In contrast, the states without any symmetry only have $S^z \approx 0$. It then becomes possible to e.g.~exactly fix the total particle number per unit cell in the Hubbard model instead of relying on a chemical potential to obtain the desired filling fraction. On the flip side, filling fraction and unit cell size have to be commensurate to provide an integer average particle number per unit cell. This integer average particle number is removed by the ``remover'' tensor described in Sec.~\ref{sec:impl-details:adaptations} and Fig.~\ref{fig:remover}. Second, symmetry-preserving tensors can only represent eigenstates of the symmetry. If the symmetry operator and the Hamiltonian commute and are non-degenerate, each eigenstate of the Hamiltonian is also an eigenstate of the symmetry operator and this is no restriction. If, however, the Hamiltonian has a degenerate spectrum, eigenstates of the Hamiltonian are not necessarily eigenstates of the symmetry operator. Then optimising eigenstates of the symmetry operator for the lowest energy does not yield a natural eigenstate of the Hamiltonian but instead some superposition of degenerate eigenstates. Such superpositions have typically larger entanglement, or, if we fix the maximal entanglement, a higher energy than if we allowed breaking of the symmetry in the ansatz. The increased entanglement of symmetric superpositions can be used to diagnose spontaneous symmetry breaking: If a symmetry is not broken, then it should be possible to implement this symmetry in the tensor network. The resulting state should be an equally good candidate to represent the ground state as a state constructed from unrestricted tensors. As such, at a fixed bond dimension, we expect to find the same variational energy regardless of whether we implement an abelian symmetry or not provided that there are no problems with convergence and the symmetry sectors are chosen in an optimal fashion. Non-abelian symmetries are more tricky, as they increase the effective bond dimension of the state and hence lead to more difficult comparisons. If, on the other hand, a symmetry is spontaneously broken, we expect a better variational energy if we also allow the tensors in our tensor network state to break this symmetry. For lack of spontaneous symmetry breaking in finite and also one-dimensional infinite systems, this is not a problem often encountered. In iPEPS calculations, however, it does become relevant. \begin{figure}[tb] \begin{minipage}[t]{0.49\textwidth} \includegraphics[width=\textwidth]{figures/heisenberg-symmbreak-d2.pdf} \caption{\label{fig:diagnose:heisenberg-d2}Obtainable ground-state energies in the anisotropic Heisenberg model at $D = 2$ with and without $\mathrm{U}(1)$ symmetry. Inset: Zoom into the central region, $\Delta$ values are placed $0.0025$ apart. Lines are guides to the eye. The results start to differ at $\Delta < 1$.} \end{minipage} \hspace{0.02\textwidth} \begin{minipage}[t]{0.49\textwidth} \includegraphics[width=\textwidth]{figures/heisenberg-symmbreak-d4.pdf} \caption{\label{fig:diagnose:heisenberg-d4}As left, for $D=4$. At small enough $\Delta$, the $\mathrm{U}(1)$ symmetric state becomes competitive again but still has slightly higher energy than the unconstrained state. Monte Carlo reference value at $\Delta = 1$ taken from Ref.~\cite{sandvik97:_finit_heisen}. Error bars are smaller than symbol size in all cases.} \end{minipage} \end{figure} \paragraph{The Heisenberg model on the square lattice} as discussed before can serve as an example of this effect. The Hamiltonian is: \begin{equation} \hat H = \sum_{\langle i, j \rangle} \hat s^x_i s^x_j + \hat s^y_i \hat s^y_j + |\Delta| \hat s^z_i \hat s^z_j \quad. \end{equation} with now $\Delta$ not fixed at $1$. At $\Delta < 1$, the ground state spontaneously breaks the $\mathrm{U}(1)$-$S^z$ symmetry and only keeps a canted order. If, for a fixed and finite bond dimension $D$, we then plot the optimal energy obtained over the value of $\Delta$ for different calculations with and without that symmetry, we can straightforwardly diagnose the transition point, cf.~Figs.~\ref{fig:diagnose:heisenberg-d2} and \ref{fig:diagnose:heisenberg-d4}. Here, we only need to measure the energy of the system -- a local observable which is straightforward to evaluate with reliable error bars. More importantly, states are optimised for their energy. The energy is hence typically the observable which behaves in the most stable manner and most closely represents the value obtained in an actual physical state. By comparing the behaviour of the different calculations over the transition point at $\Delta = 1$, we can easily conclude that the $\mathrm{U}(1)$-$S^z$ symmetry is spontaneously broken at $\Delta < 1$ due to the considerably lower energy obtained from an unconstrained calculation. Furthermore, while a clear kink at $\Delta = 1$ is visible in the energy in calculations without symmetry, this kink is absent and the energy a nearly linear function of $\Delta$ around $\Delta = 1$ in the calculation with $\mathrm{U}(1)$ symmetry. The strong bias towards a symmetry-unbroken state completely hides the symmetry-broken phase from the $\mathrm{U}(1)$-symmetric calculation. Hence, by implementing a symmetry in a system, we can not only select a sector in which we want to do our calculation (e.g. $S^z = 0$ or $N/L = 0.5$) but also -- to some extent -- select the symmetries present in the calculated states. Of course, at abitrarily large $D$, it becomes possible for the calculation to hide the symmetry-breaking by a suitable superposition as discussed before. This effect can be seen at $\Delta < 0.8$ and $D \geq 4$, where the $\mathrm{U}(1)$-symmetric calculation is again somewhat comparable to the unsymmetric calculation. \paragraph{If we implement the $\mathbb{Z}_2$ symmetry,} we disallow unit cell states with $ S^z = \pm 1$, on the $2 \times 2$ unit cell in a vacuum environment this hence limits us to the two ferromagnetic states (which are very highly energetic and don't play a role) and the six $ S^z = 0$ states. With a suitable environment, one could alleviate this problem by combining a $ S^z = 1$ state from the environment with a local $S^z = -1$. However, introducing such a state would break the $\mathrm{U}(1)$ symmetry (as it should), which is \emph{preserved by the Hamiltonian we use for the evolution}. Put another way, starting from an antiferromagnetic state $|\psi\rangle$ with $S^z = 0$, the global ground state is not contained in the Krylov subspace of $\hat H$ and $|\psi\rangle$. As such, it is not possible to obtain it by imaginary time evolution alone. Worse, if we initialise the evolution with a symmetry-broken state (of comparatively high energy), the symmetry-broken contribution to this state is very quickly removed by the automatic truncation and hence not available when it would be useful to lower the energy. This problem is not limited to calculations with $\mathbb{Z}_2$ symmetry. Also for calculations without any symmetries, it was necessary to select multiple random initial states and run the calculation at $D=2$ multiple times to obtain the correct ground-state energy. Initialising the calculation without symmetries with a Néel state resulted in energies typically very close to those obtained from the calculation with full $\mathrm{U}(1)$ symmetry. Only very rarely have we found the error from the truncation to lead to spontaneous symmetry breaking by itself. Avenues to avoid this problem could be random noise terms added to the state or special ``tunneling'' Hamiltonians (e.g.~$\hat s^+ \hat s^+ + \hat s^- \hat s^-$) which are added to the Hamiltonian with a small prefactor and allow for tunneling between different symmetry sectors. The latter approach is already fairly common when solving complicated systems using DMRG. This, however, is outside the scope of the present paper. \section{Conclusion}\label{sec:conclusions} We have shown a considerable computational advantage to be derived from the implementation of symmetries in iPEPS tensor networks. For example implementing a $\mathrm{U}(1)$-$S^z$ symmetry in the Heisenberg square lattice model allows for a maximal bond dimension $D=10$ at effort comparable to a calculation without any symmetries at $D=6$. Furthermore, we show that the explicit Clebsch-Gordan Coefficient approach is sufficient to represent $\mathrm{SU}(2)$-symmetric tensors and provides for a large advantage in the Kagomé Heisenberg model. Finally, we provide an example of how implementing a symmetry allows for further control of the calculation by firstly either enabling or disabling the symmetry itself and secondly selecting the desired quantum number sector if the symmetry is enabled. \section*{Acknowledgements} We are thankful for very helpful discussions with I. P. McCulloch, M. C. Ba\~{n}uls, J. I. Cirac, L. Vanderstraten, F. Verstraete and N. Schuch. We also much appreciated comments by E.~M.~Stoudenmire on the first version of this paper. \paragraph{Funding information} Funding through ERC Grant QUENOCOBA, ERC-2016-ADG (Grant no. 742102) is acknowledged.
\section{Introduction} Stimulated by commercial quantum computers developed by D-Wave systems~\cite{Harris2008a,Harris2010a,Johnson2011a,Lanting2014a,Boixo2014a,Denchev2016a}, which are based on quantum annealing~\cite{Kadowaki1998a,Brooke1999a,Santoro2002a,Das2008a} or adiabatic quantum computation~\cite{Farhi2000a,Farhi2001a,Kaminsky2004a,Amin2008a,Albash2018a}, hardware devices for combinatorial optimization have attracted much attention. D-Wave's quantum annealers are Ising machines, that is, designed for finding ground states of the Ising model~\cite{Barahona1982a}. Since many combinatorial optimization problems can be mapped to the Ising problem~\cite{Lucas2014a}, fast Ising machines are expected to be useful for various real-world problems, including very-large-scale integrated (VLSI) circuit design~\cite{Barahona1988a}, computational biology~\cite{Perdomo2008a,Perdomo-Ortiz2012a,Li2018a}, classification problems~\cite{Neven2008a,Neven2009a}, scheduling or planning problems~\cite{Rieffel2015a,Venturelli2015a}, drug design~\cite{Sakaguchi2016a}, financial portfolio management~\cite{Rosenberg2016a}, and traffic-flow optimization~\cite{Neukart2017a}. Other kinds of Ising machines have also been proposed and developed using laser pulses~\cite{Utsunomiya2011a,Takata2012a,Taketa2014a,Utsunomiya2015a,Wang2013a,Marandi2014a, Haribara2015a,Haribara2016a,Takata2016a,Takesue2016a,Inagaki2016a,McMahon2016a,Haribara2017a, Takata2015a,Shoji2017a,Yamamura2017a,Yamamoto2017a}, electromechanical resonators~\cite{Mahboob2016a}, CMOS circuits~\cite{Yamaoka2016a}, and magnetic devices~\cite{Mizushima2017a}. The first kind of laser-based Ising machine was proposed by Utsunomiya et al.~\cite{Utsunomiya2011a} and later developed by them~\cite{Takata2012a,Taketa2014a,Utsunomiya2015a}. This machine uses an injection-locked laser network and the ``up" and ``down" states of each Ising spin are represented by the polarizations~\cite{Utsunomiya2011a,Takata2012a,Taketa2014a} or phases~\cite{Utsunomiya2015a} of each mode. Importantly, Utsunomiya et al. introduced a new operational principle referred to as the \textit{minimum-gain principle}~\cite{Utsunomiya2011a,Wang2013a}. The Ising energy (the cost function of the problem) is mapped to the total loss in the laser network. Then, the mode configuration with the minimum total loss requires the minimum gain for oscillation (the lowest threshold). Hence it oscillates most stably among all the configurations. Thus, we will obtain the ground state of the Ising model from the mode configuration of the steady state, assuming that the system chooses the most stable state with the minimum total loss as the steady state. The second kind of laser-based Ising machine, which is called a \textit{coherent Ising machine} (CIM), was proposed by Wang et al.~\cite{Wang2013a} and experimentally realized by them~\cite{Marandi2014a}. This is also based on the minimum-gain principle, but uses a network of optical parametric oscillators (OPOs). An OPO is suitable for Ising machines, because it has two stable oscillating states above the threshold, which naturally represent an Ising spin. In other words, an OPO is an optical implementation of the ``parametron."~\cite{Goto1959a} Large-scale CIMs have already been realized~\cite{Inagaki2016a,McMahon2016a} using a measurement-feedback technique~\cite{Haribara2015a,Haribara2016a}. Interestingly, operation of the CIM was explained in an opposite way to annealing approaches~\cite{Marandi2014a}. That is, in contrast to annealing, the CIM finds the ground state of the Ising model by increasing the gain gradually and finding the mode configuration with the lowest threshold, where the direction of the search is ``upward" in the energy landscape~\cite{Marandi2014a}. The proposal of CIMs suggested parametric-oscillator implementations of Ising machines. Mahboob et al.~\cite{Mahboob2016a} proposed an Ising machine with electromechanical parametric resonators as a phononic counterpart of optical CIMs. Since the above minimum-gain principle inevitably requires losses, which usually degrade quantum superpositions and lead to decoherence, it seems difficult for machines based on this principle to realize quantum computation in the standard sense. To make the minimum-gain principle compatible with quantum coherence, Goto theoretically proposed an Ising machine composed of Kerr-nonlinear parametric oscillators (KPOs)~\cite{Goto2016a}. A KPO is a parametric oscillator with large Kerr (or Duffing) nonlinearity and without losses in the ideal case. Here, Kerr (Duffing) nonlinearity provides a quadratic (quartic) energy term with respect to oscillation power (amplitude). While in an OPO, the threshold is determined by one-photon loss and the oscillation is stabilized by two-photon loss, in a KPO, a detuning and the Kerr effect play the roles of the threshold and the stabilization, respectively. Since the detuning and the Kerr effect are described by the corresponding Hamiltonian terms, a KPO operates without dissipation and can maintain quantum coherence. That is, a KPO is a nondissipative counterpart of an OPO. A KPO can deterministically generate Schr\"{o}dinger cat states~\cite{Leonhardt,Haroche2013a,Wineland2013a,Ourjoumtsev2006a,Ourjoumtsev2007a, Deleglise2008a,Vlastakis2013a,Leghtas2015a,Wang2016a,Sychev2017a} (quantum superpositions of coherent states) via quantum adiabatic evolution increasing the pumping rate gradually. Here, coherent states are eigenstates of annihilation operators~\cite{Leonhardt} and regarded as the ``most classical" states of light. The cat-state generation is understood as a result of a \textit{quantum adiabatic bifurcation} of the KPO~\cite{Goto2016a}. By introducing nondissipative linear couplings between KPOs according to the coupling coefficients of a given Ising model, the Ising energy is approximately mapped to the threshold of the KPO network. Thus, the minimum-gain principle is generalized to nondissipative oscillator networks. However, the two approaches rely on different mechanisms. In the case of an OPO network, the state of the system converges to an attractive steady state corresponding to a low Ising energy due to network losses. On the other hand, the KPO network has no losses and therefore has no attractive states. Instead, the KPO network can find the ground state of the Ising model via quantum adiabatic evolution increasing the pumping rate gradually. That is, convergence of the KPO network to an optimal solution is guaranteed by the quantum adiabatic theorem. This is called \textit{bifurcation-based adiabatic quantum computation}~\cite{Goto2016a}, to distinguish it from conventional adiabatic quantum computation or quantum annealing, where quantum fluctuation terms are decreased gradually. (Puri et al.~\cite{Puri2017a} reformulated adiabatic quantum computation using KPOs in a similar manner to quantum annealing.) Machines based on quantum adiabatic bifurcations of KPOs are called \textit{quantum bifurcation machines} (QbMs)~\cite{Goto2018a} (with a lower-case ``b" to distinguish this from quantum Boltzmann machines (QBMs)~\cite{Amin2018a}). KPOs that can generate cat states deterministically have not been experimentally realized to date. As suggested in Ref.~\citenum{Goto2016a}, superconducting circuits with Josephson junctions are promising for implementing KPOs, because large Kerr effects can be realized using the nonlinearity of Josephson junctions~\cite{Kirchmair2013a,Rehak2014a} and parametric modulation can be implemented easily by modulating the magnetic flux through a dc superconducting quantum interference device (SQUID)~\cite{Yamamoto2008a,Bourassa2012a,Wustmann2013a,Krantz2013a,Eichler2014a,Lin2014a,Krantz2016a}. Superconducting devices using such parametric modulation are known as Josephson parametric amplifiers (JPAs) or Josephson parametric oscillators (JPOs). KPOs and QbMs offer a new application of JPOs. Nigg et al.~\cite{Nigg2017a} and Puri et al.~\cite{Puri2017a} proposed superconducting-circuit implementations for QbMs with \textit{all-to-all connectivity}. The scheme proposed by Puri et al.~\cite{Puri2017a}, which is based on the Lechner-Hauke-Zoller (LHZ) scheme~\cite{Lechner2015a,Rocchetto2016a,Chancellor2017a} proposed for all-to-all connected quantum annealers, is particularly promising. The four-body constraint required for the LHZ scheme, which is a technical difficulty in this scheme, is naturally realized by four-wave mixing in a Josephson junction. Using the technique to transform the four-body constraint to a three-body one~\cite{Leib2016a}, Zhao et al. proposed an alternative architecture with three-dimensional microwave cavities~\cite{Zhao2017a}. Single KPOs with small dissipation have been studied theoretically in the field of quantum nonlinear dynamics~\cite{Dykman,Marthaler2006a,Dykman2011a}. These studies have led to ``quantum heating," which is a heating process among quasienergy states by dissipation, where quasienergy states are eigenstates of the Hamiltonian in a rotating frame and in the rotating-wave approximation. Recently, Goto et al.~\cite{Goto2018a} generalized the concept of quantum heating from a single nonlinear oscillator to multiple coupled nonlinear oscillators through the study of dissipative QbMs. This has opened new possibilities for the application of KPO networks, such as Boltzmann sampling for Boltzmann machine learning in the field of artificial intelligence~\cite{Goto2018a,Amin2018a,MacKay}. KPOs and QbMs have also opened new possibilities for standard gate-based quantum computers. After the proposal of the Ising machine with KPOs~\cite{Goto2016a}, Goto~\cite{Goto2016b} and Puri et al.~\cite{Puri2017b} proposed gate-based universal quantum computation using two oscillating states of a KPO as a qubit. (Other kinds of quantum computers with cat states or similar bosonic codes have also been proposed and developed~\cite{Nigg2014a,Mirrahimi2014a,Albert2016a,Ofek2016a,Zhang2017a,Rosenblum2018a,Chou2018a,Puri2018a,Rosenblum2018b}.) The fact that QbMs can perform universal quantum computation is significant, because it suggests that classical simulation of QbMs is extremely hard for the following reason. If QbMs are efficiently simulated using classical computers by any method, universal quantum computation can be simulated classically through QbM simulation. On the other hand, from quantum computational complexity theory, it is strongly believed that even non-universal quantum computation cannot be simulated classically~\cite{Bremner2011a}. This leads to the hardness of classical simulation of QbMs. In contrast, there has not been such evidence for the hardness of classical simulation of CIMs so far. In this paper, we describe the physics of KPOs and QbMs in comparison with OPOs and CIMs. Comparisons of a single KPO and a KPO network (QbM) with a single OPO and an OPO network (CIM) are summarized in Tables~\ref{table-summary-1} and \ref{table-summary-2}, respectively. (The present models for an OPO and an OPO network are minimum ones for direct comparisons with a KPO and a KPO network. See Refs.~\citenum{Wang2013a,Marandi2014a,Takata2016a,Takesue2016a,Inagaki2016a,McMahon2016a,Haribara2015a,Haribara2016a,Haribara2017a,Takata2015a,Yamamura2017a,Shoji2017a,Yamamoto2017a} for more sophisticated or realistic models for OPOs and CIMs.) From these comparisons, the KPO is a nondissipative (imaginary) counterpart of the OPO. The remainder of this paper is organized as follows. In Sect.~\ref{sec-KPO}, we describe the dynamics of a single KPO using its quantum and classical models. In Sect.~\ref{sec-network}, we start with a summary of the theoretical aspects of a KPO network (QbM), and then we present simulation results for two coupled KPOs and four-spin Ising machines. In Sect.~\ref{sec-SC}, we present superconducting-circuit implementations of a KPO and QbMs. In Sect.~\ref{sec-universal}, we briefly explain how to realize a universal gate set for QbMs. Finally, a summary and outlook are provided in Sect.~\ref{sec-conclusion}. \begin{widetext} \begin{table} \caption{ Comparison of a single KPO and a single OPO. $\mathcal{H}$ and $\mathcal{L}$ are the Hamiltonian for a KPO and the Liouvillian for an OPO, respectively. (We use the unit ${\hbar=1}$.) $p$ is the parametric pumping rate. $K$ and $\Delta$ are the Kerr coefficient and the detuning, respectively, for the KPO. $\kappa$ and $\kappa_2$ are the one-photon and two-photon loss rates, respectively, for the OPO. The classical models are defined with a complex amplitude ${\alpha = x + iy}$. $H$ and $E$ are the Hamiltonian for the classical KPO and the energy for the classical OPO, respectively. $p_{\mathrm{th}}$ denotes the thresholds (bifurcation points) for the classical models of the oscillators. ``Oscillation amplitudes" are amplitudes corresponding to stable fixed points in the classical models.} \label{table-summary-1} \begin{center} \begin{tabular}{c|c|c} \hline \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{Single KPO} & \multicolumn{1}{c}{Single OPO} \\ \hline & Schr\"{o}dinger equation & Master equation \\ & $\displaystyle |\dot{\psi} \rangle = -i \mathcal{H} |\psi \rangle$ & $\displaystyle \dot{\rho}= \mathcal{L} \rho = -i [\mathcal{H},\rho] + \mathcal{L}_1 \rho + \mathcal{L}_2 \rho $ \\ \shortstack{Quantum \\ model} & $\displaystyle {\mathcal{H}=\frac{K}{2} a^{\dagger 2} a^2 + \Delta a^{\dagger} a - \frac{p}{2} \left( a^{\dagger 2} + a^2\right)}$ & $\displaystyle {\mathcal{H}=i \frac{p}{2} \left( a^{\dagger 2} - a^2\right)}$ \\ & & $\displaystyle \mathcal{L}_1 \rho = \kappa \left( 2 a \rho a^{\dagger} - a^{\dagger} a \rho - \rho a^{\dagger} a \right)$ \\ & & $\displaystyle \mathcal{L}_2 \rho = \frac{\kappa_2}{2} \left( 2 a^2 \rho a^{\dagger 2} - a^{\dagger 2} a^2 \rho - \rho a^{\dagger 2} a^2 \right)$ \\ \cline{1-3} & $\displaystyle \dot{\alpha}= i \left( p \alpha^* - \Delta \alpha - K|\alpha |^2 \alpha \right)$ & $\displaystyle \dot{\alpha}= p \alpha^* - \kappa \alpha - \kappa_2|\alpha |^2 \alpha$ \\ \shortstack{Classical \\ model} & $\displaystyle \dot{x}=\frac{\partial H}{\partial y}= \left[ p+\Delta+K(x^2+y^2)\right]y$ & $\displaystyle \dot{x}=-\frac{\partial E}{\partial x}= \left[ p-\kappa-\kappa_2(x^2+y^2)\right]x$ \\ & $\displaystyle \dot{y}=-\frac{\partial H}{\partial x}= \left[ p-\Delta-K(x^2+y^2)\right]x$ & $\displaystyle \dot{y}=-\frac{\partial E}{\partial y}= -\left[ p+\kappa+\kappa_2(x^2+y^2)\right]y$ \\ \cline{1-3} \shortstack{ \\ Classical \\ energy} & $\displaystyle {H=-\frac{p}{2} \left( x^2-y^2 \right) + \frac{\Delta}{2} \left( x^2+y^2 \right) + \frac{K}{4} \left( x^2+y^2 \right)^2}$ & $\displaystyle {E=-\frac{p}{2} \left( x^2-y^2 \right) + \frac{\kappa}{2} \left( x^2+y^2 \right) + \frac{\kappa_2}{4} \left( x^2+y^2 \right)^2}$ \\ \cline{1-3} Threshold & $p_{\mathrm{th}}=\Delta$~(Detuning) & $p_{\mathrm{th}}=\kappa$~(One-photon loss) \\ \cline{1-3} Stabilization & Kerr effect & Two-photon loss \\ \cline{1-3} \shortstack{ \\ Oscillation \\ amplitudes} & $\displaystyle \pm \sqrt{\frac{p-\Delta}{K}}$ & $\displaystyle \pm \sqrt{\frac{p-\kappa}{\kappa_2}}$ \\ \hline \end{tabular} \end{center} \caption{ Comparison of a KPO network (QbM) and an OPO network (CIM). $\mathcal{H}_i^{(1)}$ and $\mathcal{L}_i^{(1)}$ are the Hamiltonian for the $i$-th KPO and the Liouvillian for the $i$-th OPO, respectively, defined as $\mathcal{H}$ and $\mathcal{L}$ in Table~\ref{table-summary-1}. $\mathcal{H}_c$ and $\mathcal{L}_c$ describe the couplings for KPOs and OPOs, respectively. $J_{i,j}$ is the coupling coefficient between the $i$-th and $j$-th Ising spins in a given Ising model. $\xi_0$ is a positive constant with the dimension of frequency. $H_i^{(1)}$ and $E_i^{(1)}$ are the classical Hamiltonian for the $i$-th KPO and the classical energy for the $i$-th OPO, respectively, defined as $H$ and $E$ in Table~\ref{table-summary-1}. $p_{\mathrm{th}}$ denotes the thresholds (bifurcation points) for the classical models of the oscillator networks. $\lambda_{\mathrm{max}}$ is the maximum eigenvalue of coupling matrix $J$.} \label{table-summary-2} \begin{center} \begin{tabular}{c|c|c} \hline \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{KPO network (QbM)} & \multicolumn{1}{c}{OPO network (CIM)} \\ \hline & Schr\"{o}dinger equation & Master equation \\ \shortstack{Quantum \\ model} & $\displaystyle |\dot{\psi} \rangle = -i \sum_{i=1}^N \mathcal{H}^{(1)}_i |\psi \rangle -i\mathcal{H}_c |\psi \rangle$ & $\displaystyle \dot{\rho}= \sum_{i=1}^N \mathcal{L}^{(1)}_i \rho + \mathcal{L}_c \rho $ \\ & $\displaystyle {\mathcal{H}_c= - \xi_0 \sum_{i=1}^N \sum_{j=1}^N J_{i,j} a^{\dagger}_i a_j}$ & $\displaystyle \mathcal{L}_c \rho = -\xi_0 \sum_{i=1}^N \sum_{j=1}^N J_{i,j} \left( 2 a_i \rho a^{\dagger}_j - a^{\dagger}_j a_i \rho - \rho a^{\dagger}_j a_i \right)$ \\ \cline{1-3} & $\displaystyle \dot{\alpha}_i= i \left( p \alpha^*_i - \Delta \alpha_i - K|\alpha_i |^2 \alpha_i +\xi_0 \sum_{j=1}^N J_{i,j} \alpha_j \right)$ & $\displaystyle \dot{\alpha}_i= p \alpha^*_i - \kappa \alpha_i - \kappa_2|\alpha_i |^2 \alpha_i +\xi_0 \sum_{j=1}^N J_{i,j} \alpha_j$ \\ \shortstack{Classical \\ model} & $\displaystyle \dot{x}_i=\frac{\partial H}{\partial y_i}= \left[ p+\Delta+K(x_i^2+y_i^2)\right]y_i -\xi_0 \sum_{j=1}^N J_{i,j} y_j$ & $\displaystyle \dot{x}_i=-\frac{\partial E}{\partial x_i}= \left[ p-\kappa-\kappa_2(x_i^2+y_i^2)\right]x_i +\xi_0 \sum_{j=1}^N J_{i,j} x_j$ \\ & $\displaystyle \dot{y}_i=-\frac{\partial H}{\partial x_i}= \left[ p-\Delta-K(x_i^2+y_i^2)\right]x_i +\xi_0 \sum_{j=1}^N J_{i,j} x_j$ & $\displaystyle \dot{y}_i=-\frac{\partial E}{\partial y_i}= -\left[ p+\kappa+\kappa_2(x_i^2+y_i^2)\right]y_i +\xi_0 \sum_{j=1}^N J_{i,j} y_j$ \\ \cline{1-3} \shortstack{ \\ \\ Classical \\ energy} & $\displaystyle {H= \sum_{i=1}^N H^{(1)}_i - \frac{\xi_0}{2} \sum_{i=1}^N \sum_{j=1}^N J_{i,j} (x_i x_j + y_i y_j)}$ & $\displaystyle {E= \sum_{i=1}^N E^{(1)}_i - \frac{\xi_0}{2} \sum_{i=1}^N \sum_{j=1}^N J_{i,j} (x_i x_j + y_i y_j)}$ \\ \cline{1-3} Threshold & $p_{\mathrm{th}}=\Delta- \xi_0 \lambda_{\mathrm{max}}$ & $p_{\mathrm{th}}=\kappa- \xi_0 \lambda_{\mathrm{max}}$ \\ \hline \end{tabular} \end{center} \end{table} \end{widetext} \section{Physics of a KPO} \label{sec-KPO} In a frame rotating at half the pump frequency, $\omega_p/2$, and in the rotating-wave approximation, a quantum model of a KPO is given by the Schr\"{o}dinger equation with the Hamiltonian $\mathcal{H}$ in Table~\ref{table-summary-1}~\cite{Goto2016a,Goto2016b}, where $a^{\dagger}$ and $a$ are the creation and annihilation operators, respectively, for the KPO. The Hamiltonian includes three terms corresponding to a Kerr effect, a detuning, and parametric pumping (two-photon driving). Here we assume a positive Kerr coefficient (${K>0}$). If ${K<0}$ as in the case of Josephson parametric oscillators~\cite{Puri2017a,Nigg2017a,Puri2017b,Bourassa2012a,Wustmann2013a,Krantz2013a,Eichler2014a,Lin2014a,Krantz2016a}, we redefine the Hamiltonian $\mathcal{H}$ by flipping the overall phase, after which we obtain the same results. The detuning $\Delta$ is defined as ${\Delta = \omega_{\mathrm{KPO}} - \omega_p/2}$, where $\omega_{\mathrm{KPO}}$ is the one-photon resonance frequency of the KPO. Hereafter we assume ${\Delta>0}$. This is a natural choice because the Kerr effect leads to larger detunings for larger amplitudes, and therefore stabilizes the oscillation. The case where ${\Delta<0}$ is briefly discussed later. This corresponds to the case in Ref.~\citenum{Puri2017a}, where the Kerr coefficient is negative and the detuning is positive. A corresponding model for an OPO is given by the master equation in Table~\ref{table-summary-1}, where the Kerr effect and the detuning are replaced by two-photon and one-photon losses, respectively. In the case of OPOs, the two-photon loss leads to larger losses for larger amplitudes, and thus stabilizes the oscillation. The phase of the pump amplitude is also redefined so that the oscillation phases are the same as those for the KPO. Here we introduce classical models~\cite{Goto2016a} corresponding to the quantum models, which are useful for grasping the dynamics of the oscillators. The classical models in Table~\ref{table-summary-1} are derived as follows. Using the Schr\"{o}dinger and master equations, the expectation values of the annihilation operator $a$ satisfy \begin{align} &\mathrm{KPO}:~ \langle \dot{a} \rangle = i \left( p \langle a^{\dagger} \rangle - \Delta \langle a \rangle -K \langle a^{\dagger} a^2 \rangle \right), \label{eq-expectation-KPO} \\ &\mathrm{OPO}:~ \langle \dot{a} \rangle = p \langle a^{\dagger} \rangle - \kappa \langle a \rangle -\kappa_2 \langle a^{\dagger} a^2 \rangle, \label{eq-expectation-OPO} \end{align} where $\langle O \rangle$ represents the expectation value of an operator $O$ and the dot denotes differentiation with respect to time $t$. These equations clearly show that the KPO is an imaginary counterpart of the OPO, and the detuning and the Kerr effect correspond to the one-photon and two-photon losses, respectively. When the state is near to a coherent state $|\alpha \rangle$, moments are approximated as $\langle a^{\dagger m} a^n \rangle \approx \alpha^{* m} \alpha^n$, where the asterisk denotes complex conjugation. Thus, the classical models in Table~\ref{table-summary-1} are derived from Eqs.~(\ref{eq-expectation-KPO}) and (\ref{eq-expectation-OPO}). The classical model for the KPO can be reformulated as a classical Hamiltonian dynamical system with the Hamiltonian $H$ in Table~\ref{table-summary-1}. Thus, $H$ is conserved in this model, provided that the system parameters are constant. On the other hand, in the classical model for the OPO, the energy $E$ in Table~\ref{table-summary-1} of the same form as $H$ decreases monotonically, because \begin{align} \dot{E} \approx \frac{\partial E}{\partial x} \dot{x} +\frac{\partial E}{\partial y} \dot{y} =-\left( \dot{x}^2 + \dot{y}^2 \right) < 0, \end{align} where the term proportional to $\dot{p}$ has been disregarded. Thus, the state of the OPO varies towards a local minimum of $E$. \begin{figure}[b] \includegraphics[width=6.5cm]{single-KPO.pdf} \caption{Simulation results for a KPO and an OPO. Parameters are set as ${K=\Delta=1}$ and ${\kappa_2 = \kappa =1}$ ($K$ or $\kappa_2$ is the unit of frequency), and $p$ is increased linearly from 0 to 4 at ${t=100}$. (a) Time evolution of a classical KPO. (b) and (c) Phase portraits of the classical KPO at ${p=1}$ (b) and ${p=3}$ (c). (d) and (e) Wigner functions of the corresponding quantum KPO at ${p=1}$ (d) and ${p=3}$ (e). (f)--(j) are the corresponding results for an OPO. Stable and unstable fixed points in the classical models are represented, respectively, by the dotted and dashed lines in (a) and (f), and by the filled and open circles in the figures for the Wigner functions, Vertical lines in (a) and (f) indicate the values of $p$ for the phase portraits and the Wigner functions.} \label{fig-single-KPO} \end{figure} Before explaining the quantum models, we discuss the dynamics of the classical models to grasp the essence of these oscillators. Simulation results for the classical models of KPOs and OPOs are shown in Figs.~\ref{fig-single-KPO}(a) and \ref{fig-single-KPO}(f), respectively. In these simulations, we set the parameters as ${K=\Delta=1}$ and ${\kappa_2 = \kappa =1}$ ($K$ or $\kappa_2$ is the unit of frequency) and increase the pumping rate $p$ linearly from 0 to 4 at the final time ${t=100}$. The initial values are set as ${x=y=0.1}$. In these figures, the dotted and dashed lines represent stable and unstable fixed points~\cite{Strogatz}, respectively, where the fixed points are defined by ${\dot{x}=\dot{y}=0}$. That is, the fixed points correspond to extrema of the Hamiltonian $H$ or energy $E$. At ${p=\Delta}$ or ${p=\kappa}$, a single fixed point at the origin becomes two stable fixed points and an unstable fixed point, which is called a pitchfork bifurcation~\cite{Strogatz}. Stable fixed points are given by the ``oscillation amplitudes" in Table~\ref{table-summary-1}. As shown in these figures, the system follows or converges to one of the two stable fixed points. In the case of an OPO, this is natural because the equations of motion lead to a monotonical decrease of $E$, and therefore the state approaches one of the local minima of $E$, which correspond to the stable fixed points. These dynamics are depicted in the phase portraits~\cite{Strogatz} in Figs.~\ref{fig-single-KPO}(g) and \ref{fig-single-KPO}(h), where the lines represent contours of $E$. On the other hand, the energy of the KPO is conserved and the state varies along a contour of $H$, as shown in Figs.~\ref{fig-single-KPO}(b) and \ref{fig-single-KPO}(c). The dynamics of the KPO in Fig.~\ref{fig-single-KPO}(a) can be explained using an adiabatic invariant in classical mechanics ~\cite{Goto2016a,Landau,Goldstein,Arnold}. The adiabatic invariant is defined as the area enclosed by the trajectory in the phase space. When $p$ varies slowly, the adiabatic invariant is kept at a small value, which holds only near the local minima of the Hamiltonian. Consequently, the system follows one of them. We refer to this process as an \textit{adiabatic bifurcation}. Next, we perform similar simulations using the quantum models, where both the systems are initially in vacuum. The Wigner functions corresponding to the phase portraits are shown in Fig.~\ref{fig-single-KPO}, where filled and open circles represent stable and unstable fixed points, respectively, in the classical models. Here the Wigner function is a quasi-probability distribution defined as $\displaystyle {W(\alpha ) = \frac{2}{\pi} \mbox{Tr} \! \left[ D(-\alpha) \rho D(\alpha) P \right]}$~\cite{Leonhardt,Deleglise2008a,Goto2016a} (${\alpha =x+iy}$), where $\displaystyle {D(\alpha)=\exp \! \left( {\alpha a^{\dagger} - \alpha^* a} \right)}$ is the displacement operator and $\displaystyle {P=\exp \! \left( i\pi a^{\dagger} a \right)}$ is the parity operator. At the classical bifurcation points (thresholds), the two oscillators become similar squeezed states, as shown in Figs.~\ref{fig-single-KPO}(d) and \ref{fig-single-KPO}(i). The large quantum fluctuations in the $x$ direction may be useful when searching for optimal solutions in QbMs~\cite{Goto2016a} and CIMs~\cite{Yamamoto2017a}. In the case of the OPO, the quantum state above the threshold is a mixed state of two coherent states corresponding to the classical stable fixed points, as shown in Fig.~\ref{fig-single-KPO}(j). This can be understood from the master equation as follows. When ${\kappa =0}$, the master equation in Table~\ref{table-summary-1} has exactly two steady states $|{\pm \alpha_{SS}} \rangle$, where $|{\pm \alpha_{SS}} \rangle$ are coherent states and ${\alpha_{SS} =\sqrt{p/\kappa_2}}$. When there exists small one-photon loss, coherence between the two states is lost due to the loss, and consequently the steady state becomes a mixed state of the two coherent states. The amplitudes become smaller due to the loss, which correspond to the classical stable fixed points (the ``oscillation amplitudes" in Table~\ref{table-summary-1}). (If the one-photon loss is negligibly small, the relaxation due to the two-photon loss leads to steady cat states~\cite{Milburn}. This has been experimentally demonstrated using superconducting circuits~\cite{Leghtas2015a,Touzard2018a}.) On the other hand, the Wigner function for a KPO above the threshold in Fig.~\ref{fig-single-KPO}(e) shows an interference fringe between two coherent states, which means that the two states are superposed. That is, a KPO above the threshold becomes an even cat state, ${|\alpha_S \rangle + |{- \alpha_S} \rangle}$, where ${\pm \alpha_S}$ correspond to the two classical stable fixed points (the ``oscillation amplitudes" in Table~\ref{table-summary-1}). Thus in quantum mechanics, the system follows two bifurcating branches ``simultaneously."~\cite{Goto2016a} This intriguing process is referred to as a \textit{quantum adiabatic bifurcation}~\cite{Goto2016a}. Its mechanism is explained as follows. For simplicity, we first assume no detuning. Then the Hamiltonian $\mathcal{H}$ in Table~\ref{table-summary-1} can be rewritten as \begin{align} \mathcal{H} =\frac{K}{2} \left( a^{\dagger 2} - \frac{p}{K} \right) \left( a^{2} - \frac{p}{K} \right), \end{align} where a c-number term has been dropped. Note that this is a positive semidefinite operator and that ${\mathcal{H}|{\pm \alpha_S} \rangle = 0}$. Hence the two coherent states are exactly degenerate ground states of $\mathcal{H}$. From the quantum adiabatic theorem, the final state becomes a ground state of the final Hamiltonian as long as the variation of $p$ is sufficiently slow. Since the Hamiltonian is symmetric under the parity inversion ${a\to -a}$, parity is conserved. The vacuum state has even parity, and therefore we obtain the even cat state ${|\alpha_S \rangle+ |{- \alpha_S} \rangle}$ via the quantum adiabatic evolution. When ${\Delta>0}$, the vacuum state is a single ground state of the initial Hamiltonian. If the final value of $p$ is large as compared to $\Delta$, the detuning term can be treated as a perturbation. Assuming the final states are approximately composed of coherent states, the amplitudes are determined by the variational method minimizing the final energy~\cite{Goto2018a}. The resultant amplitudes are exactly the same as the stable fixed points of the classical model (the ``oscillation amplitudes" in Table~\ref{table-summary-1}). Again, the parity symmetry results in the even cat state with these amplitudes, as shown in Fig.~\ref{fig-single-KPO}(e). Here we briefly discuss the case where ${\Delta<0}$. As mentioned above, this corresponds to the case in Ref.~\citenum{Puri2017a}. In this case, the Kerr effect decreases the detuning, and hence does not suppress oscillation amplitudes. Nevertheless, the Kerr effect stabilizes the oscillation after the amplitudes becomes sufficiently large. The simulation result for the Wigner function at ${p=3}$ is shown in Fig.~\ref{fig-negative-Delta}(a), where the parameter setting is the same as in Fig.~\ref{fig-single-KPO} except for ${\Delta=-1}$. It turns out that we cannot obtain a cat state in this case. (Instead, we obtain a very intriguing state. Using such adiabatic processes with negative detunings, Zhang and Dykman~\cite{Zhang2017b} theoretically proposed a method for preparation of intriguing quantum states other than cat states.) However, if we set $\Delta$ to a smaller value like ${\Delta=-0.2}$, we can obtain an even cat state~\cite{Puri2017a}, as shown in Fig.~\ref{fig-negative-Delta}(b). This is understood as follows. In this case, the vacuum state is the first excited state of the initial Hamiltonian, whose ground state is the single-photon state. Since the quantum adiabatic theorem holds for any energy eigenstate, the even cat state is obtained via the adiabatic process following the first excited state. On the other hand, in the case where ${\Delta=-1}$, the vacuum state and the three-photon state are initially degenerate, which spoils the adiabatic cat-state generation. In summary, in the case of negative detunings, we can control quantum states of a KPO via quantum adiabatic evolution, but it is necessary to carefully set the detuning to avoid degeneracy. This is unnecessary in the case of positive detunings. \begin{figure}[t] \includegraphics[width=7cm]{negative-Delta.pdf} \caption{Simulation results for a KPO with a negative detuning. (a) and (b) Wigner functions at ${p=3}$ with ${\Delta=-1}$ (a) and ${\Delta=-0.2}$ (b). Other parameters are set to the same values as in Fig.~\ref{fig-single-KPO}. Filled and open circles represent stable and unstable fixed points, respectively, in the classical model. } \label{fig-negative-Delta} \end{figure} \section{KPO network} \label{sec-network} \subsection{Theory} Here we first explain how to introduce couplings between KPOs for solving the Ising problem using a KPO network (QbM). Next, we explain why the QbM can solve the Ising problem. Then, the corresponding explanations for an OPO network (CIM) are presented for comparison. The Ising problem~\cite{Barahona1982a} requires finding the spin configuration that minimizes the following Ising energy: \begin{align} E_{\mathrm{Ising}}(\mathbf{s})= -\frac{1}{2} \sum_{i=1}^N \sum_{j=1}^N J_{i,j} s_i s_j, \label{eq-Ising-energy} \end{align} where $s_i$ is the $i$-th Ising spin, which takes $+1$ (``up") or $-1$ (``down"), $N$ is the total number of the Ising spins, ${\mathbf{s}=(s_1~s_2~\cdots~s_N)}$ is the vector representation of a spin configuration, and $J_{i,j}$ is the dimensionless coupling coefficient between the $i$-th and $j$-th spins (${J_{i,j}=J_{j,i}}$ and ${J_{i,i}=0}$). In this paper, for simplicity we do not consider local magnetic fields. See Refs.~\cite{Sakaguchi2016a,Puri2017a,Goto2018a} for their treatments. In the case of a KPO network (QbM), the linear couplings described by the Hamiltonian $\mathcal{H}_c$ in Table~\ref{table-summary-2} are introduced~\cite{Goto2016a}, where $a^{\dagger}_i$ and $a_i$ are the creation and annihilation operators, respectively, for the $i$-th KPO and $\xi_0$ is a positive constant with the dimension of frequency. To satisfy the condition that the vacuum state is the ground state of the initial Hamiltonian, we set $\xi_0$ such that the initial Hamiltonian is positive semidefinite. This is sufficient for the initial condition, because the pumping rate $p$ is initially zero and therefore the vacuum state is a zero-eigenvalue eigenstate of the initial Hamiltonian. The condition is satisfied when ${\Delta - \xi_0 \lambda_{\mathrm{max}} \ge 0}$~\cite{Goto2016a}, where $ \lambda_{\mathrm{max}}$ is the maximum eigenvalue of the coupling matrix $J$, because then the detuning and coupling terms result in a positive semidefinite operator and the Kerr term is also positive semidefinite. The physical meaning of the linear couplings is photon exchange between two KPOs. This is easily implemented by coupling two KPOs directly or by using a far off-resonant coupling resonator. In the latter case, we can obtain the linear coupling Hamiltonian by adiabatically eliminating the resonator terms. The corresponding classical model for the KPO network, which is provided in Table~\ref{table-summary-2}, is derived in the same manner as in the single-KPO case, The bifurcation point (the threshold for the KPO network) in the classical model is given by ${p_{\mathrm{th}}=\Delta- \xi_0 \lambda_{\mathrm{max}}}$~\cite{Goto2016a}. The above condition for a positive semidefinite initial Hamiltonian in the quantum model corresponds to a nonnegative threshold in the classical model. When solving the Ising problem, the pumping rate $p$ is increased gradually from zero. Since the initial state is the ground state of the initial Hamiltonian as shown above, the final state will be the ground state of the final Hamiltonian according to the quantum adiabatic theorem, provided that the variation of $p$ is sufficiently slow. If the final value of $p$ is sufficiently large and the pumping and Kerr terms are dominant, the final state will be composed of coherent states, as in the single-KPO case. Thus, the final Hilbert space is approximately spanned by the $N$-mode coherent states ${| \mathbf{s} \rangle = |{s_1 \alpha_S} \rangle \cdots |{s_N \alpha_S} \rangle}$, where ${\alpha_S =\sqrt{(p-\Delta)/K}}$ and ${s_j = \pm 1}$ (${j=1,\ldots, N}$). In this basis, the eigenvalues of the total Hamiltonian are given by \begin{align} \langle \mathbf{s}|H|\mathbf{s} \rangle = \sum_{i=1}^N \left( \frac{K}{2} \alpha_S^4 + \Delta \alpha_S^2 - p \alpha_S^2 \right) -\xi_0 \alpha_S^2 \sum_{i=1}^N \sum_{j=1}^N J_{i,j} s_i s_j. \nonumber \end{align} Note that the first term is constant and the second term is proportional to the Ising energy in Eq.~(\ref{eq-Ising-energy}). That is, the ground state of the KPO network corresponds to the ground state of the Ising model. Thus, we obtain the solution of the Ising problem from the signs of the final amplitudes. The Ising problem has two optimal solutions: $\mathbf{S}$ and $-\mathbf{S}$. Correspondingly, the KPO network has degenerate ground states $|\mathbf{S} \rangle$ and $|{-\mathbf{S}} \rangle$. Because of simultaneous parity symmetry of the total Hamiltonian~\cite{Goto2016a}, we obtain the \textit{entangled coherent states} (multimode cat states) $|\mathbf{S} \rangle +|{-\mathbf{S}} \rangle$ via the quantum adiabatic evolution from vacuum states. In the case of an OPO network (CIM), couplings are implemented by mutual injection~\cite{Wang2013a}. (The measurement-feedback technique~\cite{Haribara2015a,Inagaki2016a,McMahon2016a} is not considered in this paper.) In the classical model, mutual injection is modeled by adding terms proportional to the coupling coefficients~\cite{Wang2013a}, as shown in Table~\ref{table-summary-2}. Then the total energy $E$ in Table~\ref{table-summary-2} decreases monotonically. Since $E$ is of the same form as $H$ for a KPO network, the threshold for the OPO network is given in a similar manner to that for the KPO network, as shown in Table~\ref{table-summary-2}. When the pumping rate $p$ is sufficiently large, the variables for the steady state are approximated as ${x_j \approx s_j x_{SS}}$ and ${y_j \approx 0}$, where ${x_{SS} =\sqrt{(p-\kappa)/\kappa_2}}$ and ${s_j = \pm 1}$. Then, the first term in $E$ is constant and the second term in $E$ is proportional to the Ising energy. Hence, the signs of the $x$ values for the steady state provide an approximate solution of the Ising problem. The corresponding quantum model is given by the master equation in Table~\ref{table-summary-2}. This is reformulated in the standard Lindblad form~\cite{Breuer} as follows: \begin{align} \dot{\rho} &= -i[\mathcal{H},\rho] + \mathcal{L}_1 \rho + \mathcal{L}_2 \rho + \mathcal{L}_3 \rho, \label{eq-Lindblad-1} \\ \mathcal{H} &= i\frac{p}{2} \sum_{i=1}^N \left( a_i^{\dagger 2} - a_i^2 \right), \label{eq-Lindblad-2} \\ \mathcal{L}_1 \rho &= \sum_{i=1}^N \left( \kappa - \xi_0 \sum_{j=1}^N |J_{i,j}| \right) \left( 2 a_i \rho a_i^{\dagger} - a_i^{\dagger} a_i \rho - \rho a_i^{\dagger} a_i \right), \label{eq-Lindblad-3} \\ \mathcal{L}_2 \rho &= \sum_{i=1}^N \frac{\kappa_2}{2} \left( 2 a_i^2 \rho a_i^{\dagger 2} - a_i^{\dagger 2} a_i^2 \rho - \rho a_i^{\dagger 2} a_i^2 \right), \label{eq-Lindblad-4} \\ \mathcal{L}_3 \rho &= \sum_{i=1}^N \sum_{j=1}^{i-1} \xi_0 |J_{i,j}| \left( 2 L_{i,j} \rho L_{i,j}^{\dagger} - L_{i,j}^{\dagger} L_{i,j} \rho - \rho L_{i,j}^{\dagger} L_{i,j} \right), \label{eq-Lindblad-5} \end{align} where the Lindblad operators for the couplings are defined as $\displaystyle {L_{i,j} = a_i - \frac{J_{i,j}}{|J_{i,j}|} a_j}$. This is implemented by using lossy injection paths~\cite{Takata2015a}, where adiabatic elimination of the injection-path terms leads to the Lindblad operators. This is a fully quantum-mechanical model for an OPO network (CIM). Interestingly, the classical models can also find good solutions of the Ising problem with high probability~\cite{Goto2016a}, as shown in Fig.~\ref{fig-four-KPO} later. This is because in the two models, the $x$ values become the maximum-eigenvalue eigenvector of the coupling matrix $J$ at the threshold, which provides an approximate solution of the Ising problem~\cite{Goto2016a}. This is easily understood from the fact that the Ising energy in Eq.~(\ref{eq-Ising-energy}) is a quadratic form with the coefficient matrix $-J$. This is an explanation of the minimum-gain principle from a classical point of view. However, the $x$ values are continuous, unlike Ising spins, and hence their dispersion induces errors (trapping at a wrong configuration). In the quantum model of QbMs, quantum fluctuations lead to a superposition of many spin configurations at the threshold, and consequently the system escapes from the trap. This results in higher performance of the quantum model of QbMs than the classical counterpart~\cite{Goto2016a} (see Fig.~\ref{fig-four-KPO}). \subsection{Two coupled oscillators} \label{sec-two-KPO} As a simplest example of the Ising problem, here we consider two coupled oscillators for a two-spin Ising model with ferromagnetic coupling, whose ground states are ${s_1=s_2=1}$ and ${s_1=s_2=-1}$. Simulation results using the quantum models are shown in Fig.~\ref{fig-two-KPO}. In this simulation, we set ${J_{1,2}=J_{2,1}=1}$ and ${\xi_0=0.5}$, and the other parameters are set to the same values as in Fig.~\ref{fig-single-KPO}. Figures~\ref{fig-two-KPO}(a) and \ref{fig-two-KPO}(b) show the two-mode Wigner functions for the two KPOs and the two OPOs, respectively, at the final time. Here, the two-mode Wigner function is defined as~\cite{Wang2016a} \begin{align} W(\alpha_1, \alpha_2 ) = \left( \frac{2}{\pi} \right)^2 \mbox{Tr} \! \left[ D_1(-\alpha_1) D_2(-\alpha_2) \rho D_1(\alpha_1) D_2(\alpha_2) P_1 P_2 \right], \nonumber \end{align} where $D_i$ and $P_i$ are the displacement and parity operators for the $i$-th oscillator, respectively. To display the two-mode Wigner functions with four variables, we set ${y_1=y_2=0}$ in the left figures and ${x_1=x_2=0}$ in the right figures in Fig.~\ref{fig-two-KPO}. The two peaks around ${x_1=x_2=2}$ and ${x_1=x_2=-2}$ in Figs.~\ref{fig-two-KPO}(a) and \ref{fig-two-KPO}(c) correspond to the ground states of the Ising model. That is, both models successfully find the solutions. However, there are apparent differences around the origin. There is nothing around the origin in the case of OPOs. This means that the final state of the two OPOs is a mixed state of two-mode coherent states. On the other hand, there is an interference fringe for KPOs. This shows that the final state of the two KPOs is an entangled coherent state (two-mode cat state), as expected. Such Wigner functions have recently been experimentally observed using two microwave cavities coupled to a Y-shaped superconducting qubit~\cite{Wang2016a} by a different technique. \begin{figure}[t] \includegraphics[width=7cm]{two-KPO.pdf} \caption{Simulation results for the quantum models of two coupled oscillators. (a) Two-mode Wigner function for KPOs at the final time ${t=100}$. Left: ${y_1=y_2=0}$. Right: ${x_1=x_2=0}$. (b) Corresponding results for OPOs. Parameter setting: ${J_{1,2}=J_{2,1}=1}$, $\xi_0=0.5$, and others are set to the same values as in Fig.~\ref{fig-single-KPO}.} \label{fig-two-KPO} \end{figure} \subsection{Four-spin Ising machines} \label{sec-QbM} So far, we have considered four oscillator-network models (KPO/OPO and quantum/classical). Hereafter, we use the following abbreviations: `qQbM' and `cQbM' represent the quantum and classical models, respectively, for QbMs (KPO networks); `qCIM' and `cCIM' represent the quantum and classical models, respectively, for CIMs (OPO networks). To evaluate the performances of the four models, we perform numerical simulation for the four-spin Ising problem with all-to-all connectivity. We solve 100 instances using the four models, where the coupling coefficients $\{ J_{i,j} \}$ for each instance are set randomly from among the 21 values $\{-1, -0.9, \ldots, 1\}$. In this simulation, ${\xi_0=0.25}$ and other parameters are set to the same values as in Figs.~\ref{fig-single-KPO} and \ref{fig-two-KPO}. For the qQbM simulation, we numerically solve the Schr\"{o}dinger equation in Table~\ref{table-summary-2}. In the qCIM simulation, we use a Monte Carlo simulation called the quantum jump (or trajectory) approach~\cite{Breuer,Carmichael,Plenio1998a} for the Lindblad-form master equation given by Eqs.~(\ref{eq-Lindblad-1})--(\ref{eq-Lindblad-5}), instead of solving the master equation directly. This approach, which is applicable to any Lindblad-form master equation, uses a state vector, instead of a density matrix, and its implementation is therefore easier and consumes less memory. We repeat the Monte-Carlo simulation 20 times, and take their average result. To simulate the classical models, we numerically solve the equations of motion in Table~\ref{table-summary-2} $10^3$ times with initial values set randomly within the interval ${(-0.1, 0.1)}$, and take their average result. \begin{figure}[b] \includegraphics[width=7cm]{four-KPO.pdf} \caption{Simulation results for four-spin Ising machines. (a) qQbM. (b) cQbM. (c) qCIM. (d) cCIM. (e) qCIM without quantum jumps due to one-photon losses in OPOs and injection paths. Left: Success probability for obtaining the ground states. Right: Residual energy (difference between the average Ising energy obtained in the simulations and the ground-state energy). Parameter setting: $\xi_0=0.25$, $\{ J_{i,j} \}$ are set randomly from among $\{-1, -0.9, \ldots, 1\}$, and others are set to the same values as in Figs.~\ref{fig-single-KPO} and \ref{fig-two-KPO}.} \label{fig-four-KPO} \end{figure} The simulation results are shown by the histograms in Fig.~\ref{fig-four-KPO}, where the probabilities for spin configurations in the quantum models are calculated using the formula in Ref.~\citenum{Goto2016a}. Comparing Figs.~\ref{fig-four-KPO}(a)--\ref{fig-four-KPO}(d), we conclude that qQbM achieves the best performance among the four models. The high performance of qQbMs as compared with cQbMs is explained by quantum superpositions and quantum fluctuations~\cite{Goto2016a}. The performance of qCIM is remarkably low. This is due to quantum noises (quantum jumps) from one-photon losses in OPOs and injection paths. In fact, its performance becomes much higher under the condition that no such quantum jumps exist, as shown in Fig.~\ref{fig-four-KPO}(e). (This is an unrealistic illustrative condition for observing the effects of quantum noise in the present simulation.) \section{Superconducting-circuit implementations} \label{sec-SC} KPOs that can generate cat states have not been experimentally realized so far. A condition for this realization is negligibly small dissipation relative to the Kerr coefficient and a parametric pumping rate, which would be difficult to realize in optical or mechanical systems. Superconducting circuits with Josephson junctions are natural candidates and the most promising for realizing such low-loss KPOs. Here, we explain how a KPO and Ising machines with KPOs (QbMs) are implemented with superconducting circuits~\cite{Puri2017a,Nigg2017a,Zhao2017a}. \subsection{Implementation of a KPO} As a simplest model for a KPO, here we consider a frequency-tunable transmon qubit, an equivalent circuit of which is shown in Fig.~\ref{fig-transmon}. Transmons~\cite{Koch2007a,Schuster2007a,Majer2007a,Houck2007a,Fink2008a,DiCarlo2009a,DiCarlo2010a,Reed2012a,Barends2013a,Barends2014a,Kelly2015a} are widely used superconducting qubits, which are composed of a capacitor with large capacitance $C$ and a Josephson junction characterized by a critical current $I_c$. Since a Josephson junction can be regarded as a nonlinear inductor with ${L_J=\phi_0/(I_c \cos \varphi)}$~\cite{Martinis2004a}, the transmon is a LC resonator with anharmonicity, where ${\phi_0=\Phi_0/(2\pi)=\hbar /(2e)}$ is the reduced flux quantum ($\Phi_0$ is the flux quantum) and $\varphi$ is the phase difference across the junction. The large capacitance of a transmon leads to a charging energy ${E_C=e^2/(2C)}$ that is smaller than a Josephson energy ${E_J=I_c \phi_0}$, making it insensitive to charge noises. By replacing the Josephson junction with a dc SQUID (a loop with two identical Josephson junctions), the critical current can be controlled by the magnetic flux $\Phi$ through the dc SQUID as ${\tilde{I}_c=2I_c \cos \! \left( \pi \Phi /\Phi_0 \right)}$~\cite{Tinkham,Makhlin2001a}, where $\tilde{I}_c$ denotes the effective critical current for a dc SQUID. Thus, the resonance frequency of the transmon can be controlled by the flux bias. The Hamiltonian for a frequency-tunable transmon is given by~\cite{Koch2007a,Martinis2004a,Makhlin2001a} \begin{align} H=\frac{Q^2}{2C} - \tilde{E}_J \cos \varphi, \label{eq-H-transmon} \end{align} where $Q$ is the capacitor charge and ${\tilde{E}_J=\tilde{I}_c \phi_0}$ is the effective Josephson energy for the dc SQUID. $\varphi$ and $Q$ satisfy the commutation relation $[\varphi, Q]=i(2e)$~\cite{Martinis2004a}. In fact, using this, their Heisenberg equations of motion reproduce the ac and dc Josephson relations~\cite{Martinis2004a,Tinkham} as follows: \begin{align} \frac{Q}{C} = \phi_0 \dot{\varphi},\quad -\dot{Q} = \tilde{I}_c \sin \varphi. \end{align} \begin{figure}[t] \includegraphics[width=4.5cm]{transmon.pdf} \caption{Equivalent circuit for a frequency-tunable transmon qubit. $C$: Shunt capacitance for the transmon. $I_c$: Critical current for each Josephson junction of the dc SQUID. $\Phi (t)$: Magnetic flux through the dc SQUID.} \label{fig-transmon} \end{figure} In the transmon regime (${E_C \ll \tilde{E}_J}$), the phase difference is confined at the bottom of the potential, that is, ${\langle \varphi^2 \rangle \ll 1}$. Therefore, we approximate $\displaystyle {\cos \varphi \approx 1 -\frac{\varphi^2}{2} + \frac{\varphi^4}{24}}$. Here we express the dc and ac parts of the flux separately as \begin{align} \Phi (t) = \Phi^{\mathrm{dc}} + \Phi^{\mathrm{ac}}(t),~ \Phi^{\mathrm{ac}}(t) = \delta_p \Phi_0 \cos \omega_p t, \nonumber \end{align} where $\delta_p$ and $\omega_p$ denote the amplitude and frequency, respectively, of the modulation for parametric pumping. When $\delta_p \ll 1$, the Hamiltonian in Eq.~(\ref{eq-H-transmon}) is approximated as \begin{align} H &\approx \frac{Q^2}{2C} + \frac{\tilde{E}_J^{\mathrm{dc}}}{2} \varphi^2 + \frac{\tilde{E}_J^{\mathrm{ac}}(t)}{2} \varphi^2 - \frac{\tilde{E}_J^{\mathrm{dc}}}{24} \varphi^4, \label{eq-H-transmon-app} \\ \tilde{E}_J^{\mathrm{dc}} &\approx 2 E_J \cos \! \left( \pi \frac{\Phi^{\mathrm{dc}}}{\Phi_0} \right), \nonumber \\ \tilde{E}_J^{\mathrm{ac}}(t) &\approx -2 \pi \delta_p E_J \sin \! \left( \pi \frac{\Phi^{\mathrm{dc}}}{\Phi_0} \right) \cos \omega_p t. \nonumber \end{align} Note that the first and second terms in Eq.~(\ref{eq-H-transmon-app}) describe a harmonic oscillator. Hence $\varphi$ and $Q$ are expressed with creation and annihilation operators as \begin{align} \varphi = \left( \frac{2E_C}{\tilde{E}_J^{\mathrm{dc}}} \right)^{\frac{1}{4}} \! \left( a + a^{\dagger} \right),~ Q = i e \left( \frac{\tilde{E}_J^{\mathrm{dc}}}{2E_C} \right)^{\frac{1}{4}} \! \left( a^{\dagger} - a \right). \label{eq-quantization} \end{align} Substituting these into Eq.~(\ref{eq-H-transmon-app}) and disregarding c-number terms, the Hamiltonian in a frame rotating at $\omega_p/2$ and in the rotating-wave approximation is given by the KPO Hamiltonian in Table~\ref{table-summary-1} with the following parameters: \begin{align} \hbar \Delta &= \sqrt{8E_C \tilde{E}_J^{\mathrm{dc}}} - E_C - \hbar \frac{\omega_p}{2}, \\ \hbar K &= -E_C, \\ \hbar p &= \pi \delta_p E_J \sin \! \left( \pi \frac{\Phi^{\mathrm{dc}}}{\Phi_0} \right) = \frac{\pi \delta_p \tilde{E}_J^{\mathrm{dc}}}{2} \tan \! \left( \pi \frac{\Phi^{\mathrm{dc}}}{\Phi_0} \right), \end{align} where $\hbar$ is shown explicitly. It is notable that the Kerr coefficient is determined only by the charging energy $E_C$~\cite{Koch2007a} and the one-photon resonance frequency $\omega_{\mathrm{KPO}}$ is approximately given by the Josephson plasma frequency $\sqrt{8E_C \tilde{E}_J^{\mathrm{dc}}}/\hbar$~\cite{Koch2007a,Tinkham}. The average photon number for the parametric oscillation with ${\Delta=0}$ is expressed as \begin{align} \frac{p}{|K|} \approx \frac{\pi \delta_p}{16} \left( \frac{\omega_{\mathrm{KPO}}}{K} \right)^2 \tan \! \left( \pi \frac{\Phi^{\mathrm{dc}}}{\Phi_0} \right), \end{align} where ${\hbar \omega_{\mathrm{KPO}} \approx \sqrt{8E_C \tilde{E}_J^{\mathrm{dc}}}}$ has been used. The photon number is upper bounded by the condition ${\langle \varphi^2 \rangle \ll 1}$. Using Eq.~(\ref{eq-quantization}), this condition is rewritten as \begin{align} \langle \varphi^2 \rangle \approx \sqrt{\frac{2E_C}{\tilde{E}_J^{\mathrm{dc}}}} \left( 4 |\alpha|^2 +1 \right) \ll 1 ~\Rightarrow~ |\alpha|^2 \ll \! \frac{\omega_{\mathrm{KPO}}}{16|K|}, \end{align} assuming a coherent state with amplitude $\alpha$ ($|\alpha |^2$ is the average photon number). For typical transmon qubits~\cite{Barends2014a}, $\omega_{\mathrm{KPO}}/(2\pi) \approx 5~\mathrm{GHz}$ and $|K|/(2\pi) \approx 200~\mathrm{MHz}$, and therefore $\omega_{\mathrm{KPO}}/(16|K|) \approx 1.6$. This value is too small for parametric oscillations. This indicates that a larger capacitance and a larger critical current are desirable for the implementation of a KPO. \subsection{Architectures for QbMs} Here we present two proposed architectures for QbMs~\cite{Nigg2017a,Puri2017a}. Nigg et al.~\cite{Nigg2017a} proposed the KPO-ring architecture shown in Fig.~\ref{fig-Nigg} for QbMs with all-to-all connectivity. Antiferromagnetic coupling, which is required for interesting problems, is realized by setting the flux bias as $\Phi_e = \Phi_0/2$ or by shunting the ring with a $\pi$-junction~\cite{Ryazanov2001a,Kontos2002a,Gingrich2016a}. In this scheme, the coupling coefficients are given by ${J_{i,j} \propto \sqrt{Z_i Z_j}}$, where $Z_i$ is the mode impedance for the $i$-th KPO. Thus, this scheme has only $N$ tunable parameters $\{ Z_1, \ldots , Z_N \}$, not all ${N(N-1)/2}$ patterns. Nevertheless, this can be used for hard problems such as the number partitioning problem, which is an NP-hard combinatorial optimization problem in which $N$ numbers $\{ n_1, \ldots , n_N \}$ are partitioned into two groups such that the sum of one group is equal to that of the other. The number partitioning problem is equivalent to the Ising problem with ${J_{i,j} \propto n_i n_j}$~\cite{Lucas2014a}, which can be treated in this scheme. To tune mode impedances to desired values without changing the mode frequencies, Nigg et al. proposed the use of tunable capacitors. A scheme to extend the connectivity from ${O(N)}$ to ${O(N \log N)}$ has also been proposed (see the Supplemntary Materials in Ref.~\citenum{Nigg2017a}). Another QbM architecture with all-to-all connectivity was proposed by Puri et al.~\cite{Puri2017a} using the LHZ scheme~\cite{Lechner2015a}. A conventional approach to all-to-all connected quantum annealers is ``minor embedding."~\cite{Choi2008a,Choi2011a} The LHZ scheme was proposed as an alternative approach to all-to-all connected quantum annealers for realizing a fully two-dimensional layout of qubits with only nearest-neighbor interactions. In the LHZ scheme, each physical qubit represents the product of an Ising-spin pair, instead of an individual Ising spin. Therefore, this scheme is also called parity adiabatic quantum computing (PAQC)~\cite{Leib2016a}. Coupling coefficients are introduced as local fields for the physical qubits, and hence can be controlled more easily than real coupling strengths between qubits. Corresponding to the coupling coefficients, this scheme uses ${N(N-1)/2}$ physical qubits. To reduce the degrees of freedom, this scheme requires four-body constraints among four adjacent qubits, where the eigenvalue of the four-qubit Pauli-$Z$ operator must be one~\cite{Lechner2015a}. This is an obstacle for quantum annealers based on the LHZ scheme~\cite{Chancellor2017a}. Remarkably, the four-body constraint is easily implemented for KPOs by four-wave mixing in a Josephson junction coupled to four adjacent KPOs, as shown in Fig.~\ref{fig-Puri}a. When the four KPOs have different resonance frequencies and a four-photon resonance condition, e.g., ${\omega_1+\omega_2 = \omega_3+\omega_4}$ is satisfied, the four-body interaction yields only terms such as $a_1^\dagger a_2^{\dagger} a_3 a_4$ in the rotating-wave approximation. These result in the four-body constraint in the coherent-state basis~\cite{Puri2017a}. \begin{figure}[b] \includegraphics[width=7cm]{Nigg.pdf} \caption{ KPO-ring architecture for QbM with all-to-all connectivity. Adapted from Ref.~\citenum{Nigg2017a} under the CC BY-NC 4.0 license.} \label{fig-Nigg} \includegraphics[width=7cm]{Puri.pdf} \caption{ QbM architecture based on the LHZ scheme. Adapted from Ref.~\citenum{Puri2017a} under the CC BY 4.0 license.} \label{fig-Puri} \end{figure} \section{Universal quantum computation using KPOs} \label{sec-universal} A KPO network (QbM) can also be used for gate-based universal quantum computation~\cite{Goto2016b,Puri2017b}, where a qubit is represented by two oscillating states, $|{\pm \alpha_S} \rangle$, of each KPO. Although ${|\bar{0} \rangle=|{\alpha_S} \rangle}$ and ${|\bar{1} \rangle=|{-\alpha_S} \rangle}$ are not orthogonal to each other, the inner product $\langle {-\alpha_S} |{\alpha_S} \rangle = e^{-2\alpha_S^2}$ is negligible for large $\alpha_S$, and hence they can be used for computational-basis states. Here we briefly explain how to realize a universal gate set for the coherent-state qubits. A universal gate set is composed of two kinds of single-qubit rotation, $R_Z (\phi)$ and $R_X(\theta)$, and a two-qubit gate, $U_{ZZ}(\Theta)$, which are defined as follows~\cite{Goto2016b,Nielsen}: \begin{align} & R_Z(\phi) \left( \alpha_0|\bar{0} \rangle + \alpha_1|\bar{1} \rangle \right) =\alpha_0 e^{-i\phi/2} |\bar{0} \rangle + \alpha_1 e^{i\phi/2} |\bar{1} \rangle, \nonumber \\ & R_X(\theta) (\alpha_0|\bar{0} \rangle + \alpha_1|\bar{1} \rangle) = \left( \alpha_0 \cos \! \frac{\theta}{2} -i \alpha_1 \sin \! \frac{\theta}{2} \right) |\bar{0} \rangle \nonumber \\ & \qquad \qquad \qquad \qquad \quad + \left( \alpha_1\cos \! \frac{\theta}{2} -i \alpha_0 \sin \! \frac{\theta}{2} \right)|\bar{1} \rangle, \label{eq-Rx} \\ & U_{ZZ}(\Theta) \left( \alpha_{00} |\bar{0} \rangle |\bar{0} \rangle + \alpha_{01} |\bar{0} \rangle |\bar{1} \rangle +\alpha_{10} |\bar{1} \rangle |\bar{0} \rangle + \alpha_{11} |\bar{1} \rangle |\bar{1} \rangle \right) \nonumber \\ &= e^{-i\Theta/2} \left( \alpha_{00} |\bar{0} \rangle |\bar{0} \rangle + \alpha_{11} |\bar{1} \rangle |\bar{1} \rangle \right) \nonumber \\ &+e^{i\Theta/2} \left( \alpha_{01} |\bar{0} \rangle |\bar{1} \rangle + \alpha_{10} |\bar{1} \rangle |\bar{0} \rangle \right). \nonumber \end{align} The single-qubit rotation $R_Z (\phi)$ can be implemented by external driving described by the following Hamiltonian: \begin{align} H_{Z}(t) = E_{\mathrm{in}}(t) \left( a+a^{\dagger} \right). \label{eq-Ein-Hamiltonian} \end{align} In the coherent-state basis, this Hamiltonian is represented as a diagonal matrix with eigenvalues ${\pm 2E_{\mathrm{in}}(t) \alpha_S}$. Thus, the two states acquire opposite phases via quantum adiabatic evolution with a pulse-shaped $E_{\mathrm{in}}(t)$, and hence $R_Z (\phi)$ is realized. Similarly, the two-qubit gate $U_{ZZ}(\Theta)$ can be implemented by time-dependent linear coupling: \begin{align} H_{ZZ}=g(t) \left( a_1 a_2^{\dagger}+a_1^{\dagger} a_2 \right). \label{eq-g-Hamiltonian} \end{align} Here, $|\alpha_S \rangle |\alpha_S \rangle $ and $|{-\alpha_S} \rangle |{-\alpha_S} \rangle $ acquire phases opposite to those for $|{-\alpha_S} \rangle |\alpha_S \rangle $ and $|{\alpha_S} \rangle |{-\alpha_S} \rangle $ via quantum adiabatic evolution with a pulse-shaped $g(t)$, and hence $U_{ZZ}(\Theta)$ is realized. Finally, $R_X (\theta)$ is implemented by controlling the detuning as follows. First, Eq.~(\ref{eq-Rx}) is rewritten as \begin{align} & R_X(\theta) \left[ \frac{\alpha_0 + \alpha_1}{2} (|\bar{0} \rangle + |\bar{1} \rangle) + \frac{\alpha_0 - \alpha_1}{2} (|\bar{0} \rangle - |\bar{1} \rangle) \right] \nonumber \\ & = \frac{\alpha_0 + \alpha_1}{2} e^{-i\theta/2} (|\bar{0} \rangle + |\bar{1} \rangle) + \frac{\alpha_0 - \alpha_1}{2} e^{i\theta/2} (|\bar{0} \rangle - |\bar{1} \rangle). \label{eq-Rx-2} \end{align} Note that ${|\bar{0} \rangle \pm |\bar{1} \rangle}$ are even and odd cat states. By increasing the detuning slowly, even and odd cat states change adiabatically to vacuum and single-photon states, respectively. These cat states acquire different phases depending on the energy gap between the two states during the adiabatic process. Thus, $R_X (\theta)$ is realized. \section{Summary and outlook} \label{sec-conclusion} We have explained theoretical aspects of Kerr-nonlinear parametric oscillators (KPOs) and quantum computers with KPOs (quantum bifurcation machines or QbMs), comparing these with their dissipative counterparts, namely, optical parametric oscillators (OPOs) and coherent Ising machines (CIMs). KPOs can generate Schr\"{o}dinger cat states deterministically via quantum adiabatic bifurcations increasing the pumping rate gradually. Two coupled KPOs can yield entangled coherent states (two-mode cat states). KPO networks (QbMs) can solve the Ising problem via quantum adiabatic evolution and also can perform gate-based universal quantum computation. Superconducting-circuit implementations of a KPO and QbMs have also been presented. They offer a new application of Josephson parametric oscillators (JPOs). The first step toward the realization of QbMs is an experimental demonstration of the cat-state generation using a KPO. However, cat states generated inside a KPO are hard to observe directly. For such observation, Goto et al.~\cite{Goto2018b} have recently proposed a method for on-demand generation of traveling cat states using a KPO. Since the output field from a KPO can be directly measured, this method can be used for the experiment. On-demand generation of traveling cat states has been experimentally demonstrated using superconducting circuits very recently~\cite{Pfaff2017a}. The method with a KPO also offers an alternative approach to this challenging task. Thus, the theoretical proposals of KPOs and QbMs have opened broad possibilities for theoretical and experimental research in the fields of quantum optics, superconducting circuits, and quantum information science. \section*{Acknowledgments} This work was partially supported by JST ERATO (Grant No. JPMJER1601). \newpage
\section{Introduction} There is an increasing need to accurately simulate and compute solutions to engineering problems whilst taking into account model uncertainties. Methods for such uncertainty quantification and propagation in structural engineering can roughly be categorized into two groups: non-sampling methods and sampling methods. Examples of non-sampling methods are the perturbation method and the Stochastic Galerkin Finite Element method. The perturbation method is based on a Taylor series expansion approximating the mean and variance of the solution \cite{Kleiber}. The method is quite effective, but its use is restricted to models with a limited number of relatively small uncertainties. The Stochastic Galerkin method, first proposed by Ghanem and Spanos \cite{GhanemAndSpanos}, is based on a spectral representation in the stochastic space. It transforms the uncertain coefficient partial differential equation (PDE) problem by means of a Galerkin projection technique into a large coupled system of deterministic PDEs. This method allows for somewhat larger numbers of uncertainties and is quite accurate. However, it is highly intrusive and memory demanding, making its implementation cumbersome and restricting its use to rather low stochastic dimensions. Sampling methods, on the other hand, are typically non-intrusive. Each sample corresponds to a deterministic solve for a set of specified parameter values. Two particularly popular examples are the Stochastic Collocation method \cite{Bab} and the Monte Carlo (MC) method \cite{Fishman}. The former samples a stochastic PDE at a carefully selected multidimensional set of collocation points. After this sampling, a Lagrange interpolation is performed leading to a polynomial response surface. From this, the relevant stochastic characteristics can easily be computed in a post-processing step. However, as is also the case for Stochastic Galerkin, the Stochastic Collocation method suffers from the curse of dimensionality; the computational cost grows exponentially with the number of random variables considered in the problem. The MC method on the other hand, selects its samples randomly and does not suffer from the curse of dimensionality. A drawback is its slow convergence as a function of the number of samples taken. The convergence of Monte Carlo can be accelerated in a variety of ways. For example, alternative non-random selections of sampling points can be used, as in Quasi-Monte Carlo \cite{Caflish,Niederreiter}, and Latin Hypercube \cite{Loh} sampling methods. Also, variance reduction techniques such as Multilevel Monte Carlo (MLMC) \cite{Giles} and its generalizations, see, e.g., \cite{PJ, PJ2}, can speed up the method. Note that there also exist hybrid variants which exhibit both a sampling and non-sampling character. This type of methods combines, for example, the Stochastic Finite Element methodology with Monte Carlo sampling or a multi-dimensional cubature method, see, e.g., \cite{Ghanem_Hyrbid,Acharjee}. Monte Carlo methods have since long been used in the field of structural engineering, for example in problems of structural dynamics \cite{Masanobu} or in elastoplastic problems where the structure's reliability is assessed \cite{Pulido}. The focus of this paper is to apply the MLMC method to a structural engineering problem, discretized by means of the Finite Element method. A comparison with the standard MC method will show a significant reduction in computational cost. The structure of the paper is as follows. In section 2, we formulate the mathematical model, introduce the problem statement and describe how the uncertainty is modeled. Section 3 recalls the MLMC method, and provides some additional algorithmic implementation details. In Section 4, numerical results are presented. First, a performance comparison is made between standard MC and MLMC for a static elastic and elastoplastic load case. Next, results showing the uncertainty propagation for the static elastic, static elastoplastic and the dynamic elastic response are shown for when the Young's modulus is modeled by means of a random variable coming from a univariate Gamma distribution and as multiple random variables sampled from a Gamma random field. The fifth and last section offers concluding remarks and details some paths for further research. \section{The mathematical model} \subsection{Beam models and material parameters} The considered engineering problem is the response of a cantilever beam clamped at one side and a beam clamped at both sides as seen in Fig.\ref{fig:bean_configurations}, assuming plane stress. The following responses are considered: the static elastic response, the dynamic elastic response and the static elastoplastic response. The first two respectively simulate the spatial displacement and the frequency response function of a concrete beam model solely in the elastic region. The third one simulates the spatial displacement of a steel beam in the elastic as well as in the plastic region. The dimensions of the beam are $2.5\,\mathrm{m}$ (length) by $0.25\,\mathrm{m}$ (height) by $1\,\mathrm{m}$ (width) for the elastic responses and $10^{-3}\,\mathrm{m}$ (width) for the elastoplastic response. The material parameters of the concrete are as follows: a mass density of $2500\,\mathrm{kg/m^3}$, a Poisson ratio of $0.15$ and a Young's modulus subjected to some uncertainty with a mean value of $30\,\mathrm{GPa}$. The material parameters of the steel are as follows: a yield strength of $240\,\mathrm{MPa}$, a Poisson ratio of $0.25$ and a Young's modulus subjected to a certain degree of uncertainty with a mean value of $200\,\mathrm{GPa}$. In order to model the material uncertainty, two uncertainty models will be considered. The first model consists of a homogeneous Young's modulus characterized by means of a single random variable. The second model is a heterogeneous Young's modulus represented as a random field. Both uncertainty models will be used to compute the stochastic characteristics of the static elastic and elastoplastic response of a beam clamped at both sides as seen in Fig.\ref{fig:bean_configurations} (right) and the dynamic response of a cantilever beam clamped at one side as seen in Fig.\ref{fig:bean_configurations} (left). \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \includegraphics[height=1.9cm]{Beam_nogrid.pdf} \end{subfigure} \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[height=1.9cm]{DoubleClampedBeam.pdf} \end{subfigure} \caption{Cantilever beam loaded on its right end (left) and beam clamped at both sides loaded in the middle (right).} \label{fig:bean_configurations} \end{figure} \subsubsection{The homogeneous model} Following \cite{YongLiu}, we opt to describe the Young's modulus in the homogeneous model by means of a univariate Gamma distribution. This distribution is characterized by a shape parameter $\alpha$ and a scale parameter $\beta$: \begin{linenomath*} \begin{equation} f(x|\alpha,\beta) = \dfrac{1}{\beta^{\alpha} \Gamma(\alpha)} x^{\alpha-1} e^{\left(-\dfrac{x}{\beta}\right)}. \end{equation} \end{linenomath*} The corresponding mean value and variance can be computed respectively as $\mu=\alpha \beta$ and $\sigma^2=\alpha \beta^2$. In this paper, we will select $\alpha\!=\!7.1633$ and $\beta\!=\!4.1880 \times 10^9$ in order to model the material uncertainty for the concrete beam, which are based on values coming from \cite{Ellen}. This leads to a mean of $30\,\mathrm{GPa}$ and a standard deviation of $11.2\,\mathrm{GPa}$. For modeling the material uncertainty in the steel beam, we select $\alpha\!=\!934.2$ and $\beta\!=\!0.214\times 10^9$, see \cite{Hess}. This gives a mean of $200\,\mathrm{GPa}$ and a standard deviation of $6.543\,\mathrm{GPa}$. The Gamma distribution for both materials is plotted in Fig.\,\ref{fig:pdf_gam_prior}. \begin{figure}[H] \centering \begin{subfigure}[b]{0.54\textwidth} \scalebox{0.45}{ \input{PDF_Gam_Dis.pdf_tex}} \end{subfigure} \begin{subfigure}[b]{0.45\textwidth} \scalebox{0.45}{ \input{PDF_steel.pdf_tex}} \end{subfigure} \centering \caption{Probability density function for Young's modulus as a univariate distribution for concrete (left) and steel (right). Shown also is the mean $\mu$ and the standard deviation $\sigma$.} \label{fig:pdf_gam_prior} \end{figure} \subsubsection{The heterogeneous model} The Young's modulus with spatially varying uncertainty will be represented by means of a (truncated) Gamma random field. The construction of this random field is done by means of a classical, two step process. First, a (truncated) Gaussian random field is generated, using a Karhunen-Lo\`eve (KL) expansion \cite{Loeve}. Next, this Gaussian random field is transformed into a Gamma random field with a memoryless transformation \cite{Grigoriu}. Consider a Gaussian random field $Z(\mathbf{x},\omega)$, where $\omega$ is a random variable, with exponential covariance kernel, \begin{linenomath*} \begin{equation}\label{eq:covariance_kernel} C(\mathbf{x},\mathbf{y}):= \sigma^2 \exp\left(-\dfrac{\norm{\mathbf{x}-\mathbf{y}}_p}{\lambda}\right)\,. \end{equation} \end{linenomath*} We selected the 1-norm ($p\!=\!1$), a correlation length $\lambda\!=\!0.3$ and a standard deviation $\sigma \!=\!1.0$. The corresponding KL expansion can then be formulated as follows: \begin{linenomath*} \begin{equation} Z(\mathbf{x},\omega)=\overline{Z}(\mathbf{x},.)+\sum_{n=1}^{\infty} \sqrt{\theta_n} \xi_n(\omega) b_n(\mathbf{x})\,. \label{eq:KLExpansion} \end{equation} \end{linenomath*} $\overline{Z}(\mathbf{x},.)$ denotes the mean of the field, and is set to zero. The $\xi_n(\omega)$ denote i.i.d.\,standard normal random variables. The symbols $\theta_n$ and $b_n(\mathbf{x})$ denote, respectively, the eigenvalues and eigenfunctions of the covariance kernel \eqref{eq:covariance_kernel}. For the parameter values selected above, those eigenvalues and eigenfunctions can be computed analytically, see \cite{GhanemAndSpanos,Cliffe,Ghanem_prob,Zhang}. For a one-dimensional domain $\left[0 , 1\right]$, they are given by \begin{linenomath*} \begin{equation}\label{eq:1D_eigVec \theta_n^{1\text{D}}= \dfrac{2 \lambda}{\lambda^2 w_n^2 +1} ~~~~\mbox{and}~~~ b^{1\text{D}}_n(x) = A_n \left(\sin(w_n x) +\lambda w_n \cos(w_n x)\right)\,. \end{equation} \end{linenomath*} The normalizing constants $A_n$ are chosen such that $ \norm{b_n}_2 = 1$. The constants $w_n$ represent the real solutions, in increasing order, of the transcendental equation \begin{linenomath*} \begin{equation}\label{eq:transcendental} \tan(w)=\dfrac{2 \lambda w}{\lambda^2 w^2 -1}\,. \end{equation} \end{linenomath*} For the two-dimensional case, the eigenvalues and functions are obtained in a tensorproduct way, \begin{linenomath*} \begin{equation}\label{eq:2d_eigenVal \theta_n^{2\text{D}} = \theta_{i_{n}}^{1\text{D}} \theta_{j_n}^{1\text{D}} ~~~\mbox{and}~~ b_n^{2\text{D}} (\mathbf{x}) = b_{i_n}^{1\text{D}} (x_1) b_{j_n}^{1\text{D}} (x_2)~~ \mbox{with}~~n = (i_n, j_n)\,. \end{equation} \end{linenomath*} In an actual implementation, the number of KL-terms in \eqref{eq:KLExpansion} is truncated to a finite value. This value depends on the magnitude and, more precisely, on the decay of successive eigenvalues. Those eigenvalues are plotted in Fig.\,\ref{fig:Eigenvalf} (left). Inclusion of the first 101 KL-terms is sufficient in order to represent 90\% of the variance of the random field. The percentage of the variance that is accounted for as a function of the number of included eigenvalues, corresponds to the cumulative sum of the eigenvalues, and is also illustrated in the figure. A cumulative sum of 1.0 corresponds to 100\% of the variance of the field being accounted for. \begin{figure}[H] \centering \begin{subfigure}[b]{0.54\textwidth} \scalebox{0.45}{ \input{"EigenValues.pdf_tex"}} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \scalebox{0.45}{ \input{"Mem_Trans.pdf_tex"}} \end{subfigure} \caption{Magnitude of the eigenvalues and their cumulative sum (left) and memoryless transformation used to generate the Gamma random field (right).} \label{fig:Eigenvalf} \end{figure} Once the Gaussian field has been generated, a memoryless transformation is applied pointwise, \begin{linenomath*} \begin{equation}\label{eq:MemTrans} g(y) = F^{-1}\left[\Phi(y)\right], \end{equation} \end{linenomath*} in order to obtain the Gamma random field \cite{Grigoriu}. Here, $F$ denotes the marginal cumulative density function (CDF) of the target distribution and $\Phi$ the marginal CDF of the standard normal distribution. This transformation is depicted in Fig.\,\ref{fig:Eigenvalf} (right) with the full line representing a realization of $F$, and the dashed line representing a realization of $\Phi$. Contour plots of a realization of a Gaussian random field and the corresponding Gamma random field are presented for illustration purposes in Fig.\,\ref{fig:contour}. \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Contour_Gaus_Field.pdf_tex}}} \label{fig:Gaussian Random field} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Contour_Gam_Field.pdf_tex}}} \label{fig:Gamma random field} \end{subfigure} \caption{Gaussian random field (left) and the corresponding Gamma random field (right).} \label{fig:contour} \end{figure} \subsection{The Finite Element method} The Finite Element method will be used to compute the responses of the beam assuming plane stress. An equidistant, regular rectangular mesh is applied with bilinear quadrilateral elements. The implemented solver for the elastic and the elastoplastic response is different. The underlying equations and solution methods are reviewed hereunder. \\ \\ For the static elastic response, the system equation is of the form \label{Displacement_eq} \begin{linenomath*} \begin{equation} \mathbf{K} \mathbf{\underline{u}} = \mathbf{\underline{f}}, \end{equation} \end{linenomath*} with $\mathbf{K}$ the global stiffness matrix, $\mathbf{\underline{f}}$ the global nodal force vector and $\mathbf{\underline{u}}$ the displacement. The global stiffness matrix and nodal force vector are obtained from the element stiffness matrices $\mathbf{K^e}$ and the element force vectors $\mathbf{\underline{f}^e}$. These are computed analytically by evaluation of the following integrals: \begin{linenomath*} \begin{equation}\label{eq:K \mathbf{K^e} = \int_{\Omega} \mathbf{B}^T \mathbf{D} \mathbf{B} d \Omega ~~~~\mbox{and}~~~ \mathbf{\underline{f}^e} = \int_{\Gamma_t} \mathbf{N}^T \mathbf{\overline{t}}_n d \Gamma_t. \end{equation} \end{linenomath*} The element nodal force vector $\mathbf{\underline{f}^e}$ is modeled as a Neumann boundary condition, where $\mathbf{\overline{t}}_n$ stands for the surface traction specified as a force per unit area and $\mathbf{N}$ the element shape function matrix, integrated over the free element boundary $\Gamma_t$. The element stiffness matrix $\mathbf{K^e}$ is obtained by integrating the matrix $\mathbf{B^TDB}$ over the element's surface $\Omega$. Matrix $\mathbf{B}$ is defined as $\mathbf{LN}$ with $\mathbf{L}$ the derivative matrix specified below, and with $\mathbf{D}$ the elastic constitutive matrix for plane stress, containing the element wise material parameters, \begin{linenomath*} \begin{equation} \mathbf{L} = \begin{bmatrix} \pdv{}{x} & 0 \\ 0 & \pdv{}{y} \\ \pdv{}{y} & \pdv{}{x} \\ \end{bmatrix}\, ~~~~\mbox{and}~~~ \mathbf{D} = \dfrac{E}{1-\nu^2} \begin{bmatrix} 1 & \nu & 0 \\ \nu & 1 & 0 \\ 0 & 0 & \dfrac{1-\nu}{2} \\ \end{bmatrix}\,. \label{eq:BDmatrix} \end{equation} \end{linenomath*} For the dynamic response case the following equation is obtained, \begin{linenomath*} \begin{equation}\label{eq:dyn} \left(\mathbf{K}(1+\imath \,\eta) - (2 \pi f)^2 \mathbf{M}\right)\mathbf{\underline{u}} = \mathbf{\underline{f}} ~~~\mbox{with}~~\mathbf{M}^e= \int_{\Omega} \mathbf{N}^T \rho \mathbf{N} d \Omega\,. \end{equation} \end{linenomath*} Matrix $\mathbf{M}$ denotes the system mass matrix obtained from the assembly of the element mass matrices $\mathbf{M^e}$. $f$ denotes the frequency and $\rho$ the volumetric mass density of the material. The multiplication of the system stiffness matrix $\mathbf{K}$ with the imaginary unit $\imath$ and the constant $\eta$, denotes the damping matrix. \\ \\ The approach for solving the static elastoplastic case differs due to the nonlinear stress-strain relation in the plastic domain. The plastic region is governed by the von Mises yield criterion with isotropic linear hardening. An incremental load approach is used starting with a force of $0\,\mathrm{N}$. The methods used to solve the elastoplastic problem are based on Chapter 2 $\S$4 and Chapter 7 $\S$3 and $\S$4 of \cite{Borst}. For this case, the system equation takes the following form: \begin{linenomath*} \begin{equation}\label{Displacement_eq_plast} \mathbf{K} \Delta\mathbf{\underline{u}} = \mathbf{\underline{r}}, \end{equation} \end{linenomath*} where $\Delta\mathbf{\underline{u}}$ stands for the resulting displacement increment. The vector $\mathbf{\underline{r}}$ is the residual, \begin{linenomath*} \begin{equation} \mathbf{\underline{r}}=\mathbf{\underline{f}}+\Delta\mathbf{\underline{f}}-\mathbf{\underline{q}}, \end{equation} \end{linenomath*} where $\mathbf{\underline{f}}$ stands for the sum of the external force increments applied in the previous steps, $\Delta\mathbf{\underline{f}}$ for the applied load increment of the current step and $\mathbf{\underline{q}}$ for the internal force resulting from the stresses \begin{linenomath*} \begin{equation} \mathbf{\underline{q}}=\int_{\Omega} \mathbf{B}^T \bm{\sigma} d\Omega. \end{equation} \end{linenomath*} First the displacement increment of all the nodes is computed according to \eqref{Displacement_eq_plast}, with an initial system stiffness matrix $\mathbf{K}$ resulting from the assembly of the element stiffness matrix $\mathbf{K^e}$, computed by means of a Gauss quadrature \begin{linenomath*} \begin{equation} \label{K_el_plast} \mathbf{K^e} = \int_{\Omega} \mathbf{B}^T \mathbf{D}^{ep} \mathbf{B} d \Omega, \end{equation} \end{linenomath*} where $\mathbf{D}^{ep}$ denotes the elastoplastic constitutive matrix. The initial state of $\mathbf{D}^{ep}$ is the elastic constitutive matrix from \eqref{eq:BDmatrix}. Secondly, the strain increment $\Delta \varepsilon$ is computed, \begin{linenomath*} \begin{equation} \Delta \varepsilon = \mathbf{B}\Delta\mathbf{\underline{u}}. \end{equation} \end{linenomath*} Thirdly, the nonlinear stress-strain relationship, \begin{linenomath*} \begin{equation} d\bm{\sigma} = \mathbf{D}^{ep} d\varepsilon, \end{equation} \end{linenomath*} is integrated by means of a backward Euler method. The backward Euler method essentially acts as an elastic predictor-plastic corrector; an initial stress state that is purely elastic is computed and then projected in the direction of the yield surface as to obtain the plastic stress state. Due to the implicit nature of the integrated stress-strain relation, this equation must be supplemented with the integrated form of the hardening rule and the yield condition. This system of nonlinear equations is then solved with an iterative Newton-Raphson method. Afterwards, the consistent tangent stiffness matrix is computed \cite{Agusti}. This matrix is then used to compute the updated element stiffness matrix \eqref{K_el_plast}, resulting in an updated system stiffness matrix $\mathbf{K}$. The inner iteration step of solving the stress-strain relation and the updated system stiffness matrix is repeated for each outer iteration step which solves equation \eqref{Displacement_eq_plast}. The outer step consists in balancing the internal forces with the external ones as to satisfy the residual, which in our case equals $10^{-4}$ times the load increment. The procedure used is incremental-iterative, relying on the iterative Newton-Raphson method. This process is repeated for each load increment. Each finite element is assigned a value of the Young's modulus. This is accomplished by means of the midpoint approach, i.e., the value is taken constant within each individual element and equal to the value of the realization of the random field at the center point of the element \cite{jie_lie}. \section{The Multilevel Monte Carlo method} \subsection{Method overview} \label{sec:MethodOverview} The Multilevel Monte Carlo method (MLMC) is an extension of the standard Monte Carlo (MC) method, see, e.g.,~\cite{Giles, Giles2}. The method relies on a clever combination of many computationally cheap low resolution samples and a relatively small number of higher resolution, but computationally more expensive samples. The application of MLMC to our problem will be based on a hierarchy of nested finite element meshes. These meshes will be indexed from $0$ to $L$, with $0$ indicating the coarsest mesh and $L$ the finest mesh. An example of such a hierarchy is shown in Fig.\,\ref{fig:gridrefinement}. It is common in the PDE setting to use a geometric relation for the number of degrees of freedom between the different levels. We set the number of finite elements for a mesh at level $\ell$ proportional to $2^{d\ell}$, where $d$ is the dimension of the problem. \begin{figure}[H] \centering \includegraphics[height=1.9cm]{Grid.pdf} \caption{Illustrative example of a hierarchy used in the MLMC method.} \label{fig:gridrefinement} \end{figure} Let $\E[P_L(\omega)]$, or $\E[P_L]$ for short, be the expected value of a particular quantity of interest $P$ depending on a random variable $\omega$, discretized on mesh $L$. The standard MC estimator for $\E[P_L]$ using $N_L$ samples on mesh $L$, denoted as $Q^{\textrm{MC}}_L$, can be written as \begin{linenomath*} \begin{equation} Q^{\textrm{MC}}_L={\frac{1}{N_L}}\sum_{n=1}^{N_L} P_L(\omega^n)\,. \label{eq:SimpleMC} \end{equation} \end{linenomath*} Multilevel Monte Carlo, on the other hand, starts from a reformulation of $\E[P_L]$ as a telescoping sum. The expected value of the quantity of interest on the finest mesh is expressed as the expected value of the quantity of interest on the coarsest mesh, plus a series of correction terms (or \emph{differences}): \begin{linenomath*} \begin{equation} \E[P_L]=\E[P_0]+\sum_{\ell=1}^L \E[P_\ell -P_{\ell-1}]\,. \label{Eq:TelescopingSum} \end{equation} \end{linenomath*} Each term in the right-hand side is then estimated separately by a standard Monte Carlo estimator with $N_\ell$ samples, i.e., \begin{linenomath*} \begin{equation} Q^{\textrm{MLMC}}_L=\frac{1}{N_0}\sum_{n=1}^{N_0} P_0(\omega^{n}) + \sum_{\ell=1}^L \left \{ \frac{1}{N_\ell} \sum_{n=1}^{N_\ell} \left( P_\ell(\omega^{n})-P_{\ell-1}(\omega^{n})\right) \right \}, \label{eq:MLMC} \end{equation} \end{linenomath*} where $Q^{{\textrm{MLMC}}}_L$ is the Multilevel Monte Carlo estimator for the expected value $\E[P_L]$, which is a discrete approximation of the continuous solution $\E[P]$. The mean square error (MSE) is defined as \begin{linenomath*} \begin{equation}\label{eq:MSE} \begin{split} \textrm{MSE}(Q^{\textrm{MLMC}}_L) & := \E\left[\left(Q^{\textrm{MLMC}}_L - \E\left[P\right]\right)^2\right] \\ & := \V\left[Q^{\textrm{MLMC}}_L\right] + \left(\E\left[Q^{\textrm{MLMC}}_L\right] - \E\left[P\right]\right)^2, \end{split} \end{equation} \end{linenomath*} with $\V\left[\mathrm{x}\right]$ denoting the variance of a random variable $\mathrm{x}$. The MLMC estimator in \eqref{eq:MLMC} can be written as a sum of $L+1$ estimators for the expected value of the difference on each level, i.e., \begin{linenomath*} \begin{equation} Q^{\textrm{MLMC}}_L = \sum_{\ell = 0}^L Y_{\ell}, \quad \text{where} \quad Y_{\ell} = \frac{1}{N_\ell} \sum_{n=1}^{N_\ell} \left( P_\ell(\omega^{n})-P_{\ell-1}(\omega^{n})\right). \end{equation} \end{linenomath*} where we defined $P_{-1}\coloneqq0$. Because of the telescoping sum, the MLMC estimator is an unbiased estimator for the quantity of interest on the finest mesh, i.e., \begin{linenomath*} \begin{equation} \E[P_L] = \E[Q^{\textrm{MLMC}}_L]. \end{equation} \end{linenomath*} Denoting by $V_{\ell}$ the variance of the difference $P_{\ell} - P_{\ell-1}$, the variance of the estimator can be written as \begin{linenomath*} \begin{equation} \V[Q^{\textrm{MLMC}}_L] = \sum_{\ell=0}^L \frac{V_{\ell}}{N_{\ell}}. \end{equation} \end{linenomath*} In order to ensure that the MSE is below a given tolerance $\epsilon^2$, it is sufficient to enforce that the variance $\V[Q^{\textrm{MLMC}}_L]$ and the squared bias $(\E[P_L-P])^2$ are both less than $\epsilon^2/2$. The condition on the variance of the estimator can be used to determine the number of samples needed on each level $\ell$. Following the classic argument by Giles in~\cite{Giles}, we minimize the total cost of the MLMC estimator \begin{linenomath*} \begin{equation} \text{cost}(Q^{\textrm{MLMC}}) = \sum_{\ell=0}^{L} N_\ell C_\ell, \end{equation} \end{linenomath*} where $C_\ell$ denotes the cost to compute a single realization of the difference $P_\ell-P_{\ell-1}$, subject to the constraint \begin{linenomath*} \begin{equation} \sum_{\ell=0}^L \frac{V_{\ell}}{N_{\ell}} \leq \frac{\epsilon^2}{2}. \end{equation} \end{linenomath*} Treating the $N_\ell$ as continuous variables, we find \begin{linenomath*} \begin{equation}\label{eq:nopt} N_\ell = \frac{2}{\epsilon^2} \sqrt{\frac{V_\ell}{C_\ell}} \sum_{\ell=0}^L \sqrt{V_\ell C_\ell} . \end{equation} \end{linenomath*} Note that if $\E[P_\ell]\rightarrow\E[P]$, then $V_\ell\rightarrow0$ as $\ell$ increases. Hence, the number of samples $N_\ell$ will be a decreasing function of $\ell$. This means that most samples will be taken on the coarse mesh, where samples are cheap, and increasingly fewer samples are required on the finer, but more expensive meshes. In practice, the number of samples must be truncated to $\lceil N_\ell \rceil$, the least integer larger than or equal to $N_\ell$. Using~\eqref{eq:nopt}, the total cost of the MLMC estimator can be written as \begin{linenomath*} \begin{equation}\label{eq:cost} \text{cost}(Q^{\textrm{MLMC}}) = \frac{2}{\epsilon^2}\left(\sum_{\ell=0}^L \sqrt{V_\ell C_\ell}\right)^{2}. \end{equation} \end{linenomath*} This can be interpreted as follows. When the variance $V_\ell$ decreases faster with increasing level $\ell$ than the cost increases, the dominant computational cost is located on the coarsest level. The computational cost is then proportional to $V_0 C_0$, which is small because $C_0$ is small. Conversely, if the variance decreases slower with increasing level $\ell$ than the cost increases, the dominant computational cost will be located on the finest level $L$, and proportional to $V_L C_L$. This quantity is small because $V_L$ is small. For comparison, the computational cost of a Monte Carlo simulation that reaches the same accuracy is proportional to $V_0 C_L$. In our numerical results presented next, we will compare the cost of the MLMC estimator to the cost of a standard MC simulation, both in actual runtime (seconds) and in some normalized cost measure. This cost is chosen such that the time needed to obtain a sample on the coarsest mesh (level zero) is equal to a cost of one unit. When using the standard geometric mesh hierarchy, the cost for a single sample on level $\ell$ is proportional to $2^{\gamma \ell}$. The factor $\gamma$ is determined by the efficiency of the solver. The advantage of using this normalized cost is that it decouples the cost of the simulation from the specific computer hardware. The second term in \eqref{eq:MSE} is used to determine the maximum number of levels $L$. A typical MLMC implementation is level-adaptive, i.e., starting from a coarse finite element mesh, finer meshes are only added if required to reach a certain accuracy. Assume that the convergence $\E[P_\ell]\rightarrow\E[P]$ is bounded as $|\E[P_{\ell} - P]| = \mathcal{O}(2^{-\alpha \ell})$. Then, we can use the heuristic \begin{linenomath*} \begin{equation}\label{eq:bias_constraint} \abs{\E[P_L-P]} = \abs{\sum_{\ell=L+1}^{\infty} \E[P_\ell-P_{\ell-1}]} \approx \frac{\abs{\E[P_L-P_{L-1}]}}{2^\alpha-1} \end{equation} \end{linenomath*} and check for convergence using $|\E[P_L-P_{L-1}]|/(2^\alpha-1)\leq\epsilon/\sqrt{2}$, see~\cite{Giles} for details. For completion, we now mention the central MLMC complexity theorem. We refer to~\cite{Giles2} for a proof. \begin{theorem} Given the positive constants $\alpha, \beta, \gamma, c_1, c_2, c_3$ such that $\alpha \geq \dfrac{1}{2} \mathrm{min}\left(\beta,\gamma\right)$ and assume that the following conditions hold: \begin{enumerate} \item $\lvert \E[P_{\ell} - P] \rvert \leq c_1 2^{-\alpha \ell}$, \item $V_{\ell} \leq c_2 2^{-\beta \ell}$ \;and \item $C_{\ell} \leq c_3 2^{\gamma \ell}$. \end{enumerate} Then, there exists a positive constant $c_4$ such that for any $\epsilon < \exp(-1)$ there exists an $L$ and a sequence $\{N_{\ell}\}_{\ell=0}^L$ for which the multilevel estimator, $Q^{\mathrm{MLMC}}_L$ has an $\mathrm{MSE}\leq\epsilon^2$, and \begin{linenomath*} \begin{equation} \mathrm{cost}(Q^{\mathrm{MLMC}}) \leq \left\{ \begin{aligned} & c_4 \epsilon^{-2} && \mathrm{if} \quad \beta > \gamma, \\ & c_4 \epsilon^{-2}\left(\log \;\epsilon \right)^2 && \mathrm{if} \quad \beta = \gamma, \\ & c_4 \epsilon^{-2-\left(\gamma-\beta\right)/\alpha} && \mathrm{if} \quad \beta < \gamma. \\ \end{aligned} \right. \label{eq:Algo_regime} \end{equation} \end{linenomath*} \label{Theorem_1} \end{theorem} \subsection{Implementation aspects}\label{Implementation_aspects} The MLMC method is non-intrusive. Only an interface between the Finite Element solver routine and the multilevel routine is necessary. All modules used in the simulation are written in \textsc{Matlab}. The elastic computations are run in sequential mode, without making use of parallelization. The elastoplastic computations are run in parallel mode because of their significantly larger computational cost. In particular, the computation of the individual samples is parallelized in order to get a speedup. This is possible because of the \emph{embarrassingly parallel} nature of the MLMC and the MC methods. For the aforementioned configuration, a number of $12$ samples can be computed concurrently. For more details on load balancing of MLMC samplers, we refer to \cite{Scheichl} Computation of the optimal number of samples per level according to \eqref{eq:nopt} is based on the variances of one finite element node on these levels. The node chosen for this task, is the node with the biggest variance of all the nodes which make up the finite element mesh. This way, the variance constraint is guaranteed to be satisfied for all nodes that constitute the finite element mesh. The first estimation of these variances is done by computing a trial sample set on levels 0, 1 and 2. The size of this sample set is $200$ for the elastic responses and $24$ for the elastoplastic responses. Variances on additional levels are estimated according to the second condition from Theorem \ref{Theorem_1}, following \cite{Giles, Giles2}. These trial samples are not included in the results presenting the number of samples per level. They are, however, included in the total runtime in seconds and the normalized cost of the algorithm. For MC, the number of trial samples taken for the elastic and elastoplastic response is identical as for level 0 in MLMC. As in the MLMC case, these samples will not be included in the tables. \section{Numerical Results} In this section, we discuss our numerical experiments with the MLMC method. We consider the static and dynamic response, using both a homogeneous and a heterogeneous uncertain Young's modulus. First a comparison will be made between the MC method and the MLMC method. Secondly, the rates from Theorem 1 will be estimated. For these first two parts, only the static responses (elastic and elastoplastic) are considered. This is because solutions for the static responses require only one MLMC simulation and one MC simulation for comparison. In contrast, solutions for the dynamic response require multiple individual MLMC simulations and multiple MC simulations: one for each individual frequency of the frequency response function. The third and last part visually presents solutions and their uncertainty. For both static responses, the solutions consist of displacements of the beam in the spatial domain. For the dynamic response, the solution is a frequency response function. All the results have been computed on a workstation equipped with 12 physical (24 logical) cores, Intel Xeon E5645 CPU's, clocked at 2.40 GHz, and a total of 49 GB RAM. \subsection{Comparison between MC and MLMC} \label{par:comparison} First, we compare the efficiency of MLMC and MC for the static elastic and elastoplastic response of the beam clamped at both sides and loaded in the middle as shown in Fig.\,\ref{fig:bean_configurations} (right). For both the elastic and the elastoplastic case, the load is modeled as a distributed load acting on each of the vertical middle nodes of the beam. The sum of all these individual loads is independent of the refinement of the mesh. For the elastic case, the total load equals $10000\,\mathrm{kN}$. For the elastoplastic case, the beam is loaded in steps of $135\,\mathrm{N}$ from $0\,\mathrm{N}$ to $13.5\,\mathrm{kN}$. The quantity of interest is the node with the maximum transversal deflection, which coincidently also corresponds to the node with the largest variance. The coarsest finite element mesh (level 0) consists of 410 degrees of freedom with a square element size of $0.0625\,\mathrm{m}$, while the finest finite element mesh considered (level 4) consists of 83330 degrees of freedom with a square element size of $0.0039\,\mathrm{m}$. The coarsest mesh is chosen so as to discretize the beam in the height by at least four elements. \subsubsection{Elastic Response} Fig.\,\ref{fig:Times} compares the actual simulation time needed to reach a certain tolerance $\epsilon$ on the root mean square error (RMSE) for both standard MC and MLMC, for a homogeneous (left) and heterogeneous uncertain Young's modulus (right). Our MLMC method consistently outperforms the standard MC method, with speedups up to a factor ten or more. In Tab.\,\ref{table:times}, we summarize the results expressed in actual simulation time and in standard cost. For MC, some values of the RMSE have been omitted. This is due to the long computation time, which is of the order of days. Also note that the MC simulation is run at the finest level $L$ of the corresponding MLMC simulation, where $L$ is chosen according to~\eqref{eq:bias_constraint}. This explains the sudden jump in the MC simulation time in Fig.\,\ref{fig:Times} (right). As stated in $\S$\ref{Implementation_aspects}, $200$ samples are taken on the first three levels. The average time needed for this is $35$ seconds in case of a homogeneous Young's modulus and $48$ seconds in case of a heterogeneous Young's modulus. For the lowest listed tolerance of 2.5E-4, the percentage of time used to compute these trial samples amounts to $55$ percent of the total time. For finer tolerances, however, the relative cost of this preparatory work rapidly drops and becomes negligible compared to the cost of the remaining part of the algorithm. For the finest tolerance listed of 2.5E-5, this percentage is below $1$ percent. \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Times_Gam_Dist.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Times_Gam_Field.pdf_tex}}} \end{subfigure} \caption{Actual simulation time in seconds as a function of the desired tolerance on the RMSE applied to the concrete beam clamped at both sides in Fig.\,\ref{fig:bean_configurations} (right) for a homogeneous (left) and heterogeneous (right) Young's modulus, in the elastic domain.} \label{fig:Times} \end{figure} \begin{table}[H] \scalebox{1}{ \begin{tabular}{lllllllll} \toprule \multirow{3}{*}{RMSE [/]} & \multicolumn{4}{c}{Homogeneous Young's modulus} & \multicolumn{4}{c}{Heterogeneous Young's modulus} \\ [0.5ex] \cmidrule(rl{4pt}){2-5} \cmidrule(rl{4pt}){6-9} & \multicolumn{2}{c}{Time [sec]} & \multicolumn{2}{c}{Norm. Cost} & \multicolumn{2}{c}{Time [sec]} & \multicolumn{2}{c}{Norm. Cost}\\ \cmidrule(rl{4pt}){2-3} \cmidrule(rl{4pt}){4-5} \cmidrule(rl{4pt}){6-7} \cmidrule(rl{4pt}){8-9} & MLMC & MC & MLMC & MC & MLMC & MC & MLMC & MC \\ \cmidrule{1-9} 2.5E-4 & 84& 934 & 9.43E3 & 8.79E4 & 86& 227 & 6.91E3 & 1.69E4\\ 7.5E-5 & 514& 9671 & 5.89E4& 9.88E5 & 334& 1578 & 3.49E4 & 1.33E5\\ 5.0E-5 & 1287 & -& 1.34E5& - & 991& 17588 & 1.15E5 & 2.01E6\\ 2.5E-5 & 4650& - & 5.19E5&-& 5244& - & 5.68E5 & - \\ \bottomrule \end{tabular}} \caption{Actual simulation time in seconds and normalized cost for MLMC and MC applied to the concrete beam clamped at both sides in Fig.\,\ref{fig:bean_configurations} (right) for a homogeneous and heterogeneous Young's modulus, in the elastic domain.} \label{table:times} \end{table} \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Samples_Gam_Dist.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Samples_Gam_Field.pdf_tex}}} \end{subfigure} \caption{Total number of samples on each level for different tolerances $\epsilon$ on the RMSE using a homogeneous (left) and heterogeneous (right) Young's modulus for the elastic response.} \label{fig:sample_sizes} \end{figure} \begin{table}[H] \setlength{\tabcolsep}{.16667em} \scalebox{1}{ \begin{tabular}{ccccccccccccccc} \toprule \multirow{5}{*}{RMSE [/]} & \multicolumn{7}{c}{Homogeneous Young's modulus} & \multicolumn{7}{c}{Heterogeneous Young's modulus}\\ \cmidrule(rl{4pt}){2-8} \cmidrule(rl{4pt}){9-15} \multicolumn{1}{c}{} & \multicolumn{6}{c}{MLMC} & \multicolumn{1}{c}{MC} & \multicolumn{6}{c}{MLMC} & \multicolumn{1}{c}{MC}\\ \cmidrule(rl{4pt}){2-7} \cmidrule(rl{4pt}){8-8} \cmidrule(rl{4pt}){9-14} \cmidrule(rl{4pt}){15-15} &\multicolumn{5}{c}{level}&\multirow{1}{*}{equivalent}&\multirow{1}{*}{level}&\multicolumn{5}{c}{level}&\multirow{1}{*}{equivalent}&\multirow{1}{*}{level}\\ &{0} & {1} & {2} & {3} & 4& Max &Max &{0} & {1} &{2} & {3} & {4}&Max & Max \\ [0.5ex] \cmidrule{1-15} 2.5E-4 & 4408 & 56 & 6 & / &/&262 &4651 & 1183 & 202 & 33 & / & /&153& 771\\ 7.5E-5 & 49816 & 635 & 61 & / &/&2697& 49308 & 13477 & 2169 & 370 & / & /&1568& 6750 \\ 5.0E-5 & 116934 & 1446 & 172 & 49 &/&1651& - & 38322 & 5728 & 893 & 180 & /&918& 16700 \\ 2.5E-5 & 464180 & 5393 & 669 & 71 & 7&1091& -&173742 & 27492 & 4412 & 958 & 218&1374& - \\ \bottomrule \end{tabular}} \caption{Number of samples for MLMC and MC for the elastic response.} \label{tab:Samples} \end{table} Fig.\,\ref{fig:sample_sizes} shows the number of samples over the different levels in function of the desired tolerance. Note that the number of samples is decreasing as the level $\ell$ increases, as required. Numerical values for $N_\ell$ are repeated in Tab.\,\ref{tab:Samples}. In order to make a better comparison between the cost of MC and MLMC, we also list, under the column label ``equivalent Max", the equivalent number of samples on the finest level $L$, that is, the number of samples on level $L$ that would yield a cost equal to the MLMC cost without including the cost of the trial samples. These results show a considerably lower sample size in favor of MLMC. Comparing the actual number of samples of MLMC with MC, we notice that when the Young's modulus is homogeneous, the number of samples on the coarsest level in the MLMC simulation is of the same order of magnitude as the number of samples on the finest level $L$ in the MC simulation. This would allow the estimation of the number of samples needed for a MC simulation given the results of a MLMC simulation if required. However, when the Young's modulus is heterogeneous, this number of samples differs. This stems from the fact that on this coarsest level a very rough approximation of the random field is used for the MLMC simulation, while the MC simulation uses a random field corresponding to the finest level of the MLMC simulation. It is thus probable that on the coarsest level, the variability of the random field is not fully and adequately captured. In order to better illustrate this point, the same Gaussian random field is shown in Fig.\,\ref{fig:level_overview} at different resolution levels. As can be seen, a sufficiently high number of points is required to appropriately capture the variability. In order to validate this hypothesis, MLMC simulations with a heterogeneous Young's modulus have been rerun with a finer coarsest level. The results are presented in Tab.\,\ref{tab:Samples_GRF_refinement}. As can be seen from this table, the number of samples of MC is of similar magnitude as the number of samples on the coarsest level of MLMC. \begin{figure}[H] \begin{subfigure}[b]{0.32\textwidth} \scalebox{0.32}{ \makebox[\textwidth]{ \input{Level_0.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.32\linewidth} \centering \scalebox{0.32}{ \makebox[\textwidth]{ \input{Level_1.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.32\linewidth} \hspace{2.5cm} \scalebox{0.32}{ \makebox[\textwidth]{ \input{Level_2.pdf_tex}}} \end{subfigure} \caption{Realizations of a Gaussian random field on level 0 (left), level 1 (middle), level 2 (right). } \label{fig:level_overview} \end{figure} \begin{table}[H] \scalebox{1}{ \begin{tabular}{cc c c c c c} \toprule \multirow{3}{*}{RMSE [/]}& \multicolumn{5}{c}{MLMC} & \multicolumn{1}{c}{MC}\\ \cmidrule(rl{4pt}){2-6} \cmidrule(rl{4pt}){7-7} & \multicolumn{5}{c}{level}& level \\ [0.5ex] & 0 & 1 & 2 & 3 &4 & Max\\ [0.5ex] \cmidrule{1-7} 2.5E-4 & / & 738 & 38 & 10 & /& 649 \\ 7.5E-5 & / & 8628 & 468 & 97 & /& 7178 \\ 5.0E-5 & / & 19477 & 969 & 234 & /& 15947 \\ \bottomrule \end{tabular}} \caption{Number of samples for MLMC and MC for a heterogeneous Young's modulus with a finer coarsest level.} \label{tab:Samples_GRF_refinement} \end{table} \subsubsection{Elastoplastic Response} For the elastic response, the MLMC simulations are level adaptive. The number of extra levels to be added depends on the condition of the bias, \eqref{eq:bias_constraint}. However, for the elastoplastic response we chose to manually set the maximum level. This level is chosen based on a mesh convergence analysis. This is done because for the tolerances considered in Tab.\,\ref{table:times_Plast}, samples would have to be taken on levels up to 5 or more. This would constitute a considerable time cost, which results from the iterative nature of the Finite Element implementation. The results of a mesh convergence study are shown in Fig.\,\ref{fig:mesh_convergence}, respectively for the elastoplastic response (left) and the elastic response (right), with a beam configuration that is clamped at both sides and loaded in the middle. The figures show the transverse deflection of the middle node located on the beam's top layer per level, represented as a full line, and the absolute value of its difference over the levels, represented as a dashed line. Comparing the results for both responses, it shows that for the elastic response the absolute value of the deflection's difference on the finest mesh is much smaller than the one for the elastoplastic response. For the elastoplastic response, the deflection starts stagnating at around level three. Following these results, we thus state that the bias condition for the elastoplastic response is fulfilled at level three; no more than four MLMC levels are used. \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \scalebox{0.45}{ \hspace{-1cm} \makebox[\textwidth]{ \input{Mesh_Convergence_plast.pdf_tex}}} \end{subfigure} \centering \begin{subfigure}[b]{0.45\linewidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Mesh_Convergence_elast.pdf_tex}}} \end{subfigure} \caption{Deflection and difference of the deflection of the beam's top layer middle node for the elastoplastic response (left) and elastic response (right).} \label{fig:mesh_convergence} \end{figure} Fig.\,\ref{fig:Times_plast} lists the actual simulation time needed to reach a user specified tolerance $\epsilon$ on the root mean square error (RMSE) for MLMC for a homogeneous and a heterogeneous Young's modulus for the elastoplatic response, i.e., the steel beam clamped at both sides. These values are presented in Tab.\,\ref{table:times_Plast}. As can be observed, the MLMC simulation outperforms the MC simulation in terms of computational speed and cost. A speedup of up to a factor ten in favor of MLMC is observed. As can be seen in Tab.\,\ref{table:times_Plast}, the costs in case of lower tolerances for MLMC and MC are close together, while for finer tolerances, MLMC is significantly cheaper than MC. As elaborated in $\S$\ref{Implementation_aspects}, $24$ samples are taken on the first three levels in order to obtain an initial estimate for the variances on the coarsest levels. The average time needed for this is $3728$ seconds in case of a homogeneous Young's modulus and $3927$ seconds in case of a heterogeneous Young's modulus. It can be observed that for the lowest tolerance of 2.5E-5 listed here, the percentage of time taken to compute these trial samples is about $33$ percent. For the finest tolerance of 2.5E-6 listed here, this percentage drops below $6$ percent. \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Times_levl_Dist_plast.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Times_levl_Field_plast.pdf_tex}}} \end{subfigure} \caption{Actual simulation time in seconds as a function of the desired tolerance on the $\text{RMSE}$ applied to the steel beam clamped at both sides in Fig.\,\ref{fig:bean_configurations} (right) for a homogeneous (left) and heterogeneous (right) Young's modulus in the elastoplastic domain.} \label{fig:Times_plast} \end{figure} \begin{table}[H] \scalebox{1}{ \begin{tabular}{ccccccccc} \toprule \multirow{3}{*}{$\text{RMSE}$ [/]} & \multicolumn{4}{c}{Homogeneous Young's modulus} & \multicolumn{4}{c}{Heterogeneous Young's modulus} \\ [0.5ex] \cmidrule(rl{4pt}){2-5} \cmidrule(rl{4pt}){6-9} & \multicolumn{2}{c}{Time [sec]} & \multicolumn{2}{c}{Norm. Cost} & \multicolumn{2}{c}{Time [sec]} & \multicolumn{2}{c}{Norm. Cost}\\ \cmidrule(rl{4pt}){2-3} \cmidrule(rl{4pt}){4-5} \cmidrule(rl{4pt}){6-7} \cmidrule(rl{4pt}){8-9} & MLMC & MC & MLMC & MC & MLMC & MC & MLMC & MC \\ \cmidrule{1-9} 2.5E-5 & 11870& 72513 & 1247& 10437 & 12000& 31427 & 1220 & 5732\\ 7.5E-6 & 18415& 868410 & 2810& 183180 & 16869& 192384 & 2014 & 34515\\ 5.0E-6 & 27249 & -& 4915& - & 20854& - & 3182 & -\\ 2.5E-6 & 68047& - & 14089&-& 69641& - & 11241 & - \\ \bottomrule \end{tabular}} \caption{Actual simulation time in seconds and normalized cost for MLMC and MC applied to the steel beam clamped at both sides in Fig.\,\ref{fig:bean_configurations} (right) for a homogeneous and heterogeneous Young's modulus in the elastoplastic domain.} \label{table:times_Plast} \end{table} Fig.\,\ref{fig:sample_sizes_plast} shows again the number of samples over the different levels in function of the desired tolerance. Numerical values are listed in Tab.\,\ref{tab:Samples_plast}. As is the case for the elastic response, the sample size decreases with increasing level. Note that on the finest level, only a few samples are required. For completeness, we need to mention a technical implementation detail. When \eqref{eq:nopt} suggests a value of $N_{\ell}$ equal to or less than 2 on an extra level, i.e., a level greater than 2, our algorithm still enforces a minimal number of 3 samples. This explains the lower limit of 3 samples in Tab.\,\ref{tab:Samples_plast}. As stated before, the parallelization enables the algorithm to compute $12$ samples concurrently. This is highly efficient for levels with a large number of samples, as is the case for coarser levels, and less efficient for finer levels. This is due to the load imbalance in the latter case. \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Samples_Gam_Dist_Plast.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Samples_Gam_Field_Plast.pdf_tex}}} \end{subfigure} \caption{Total number of samples on each level for different tolerances $\epsilon$ on the RMSE using a homogeneous (left) and heterogeneous (right) Young's modulus for the elastoplastic response.} \label{fig:sample_sizes_plast} \end{figure} \begin{table}[H] \setlength{\tabcolsep}{.36667em} \scalebox{1}{ \begin{tabular}{c c c c c c cc c c c c c} \toprule \multirow{5}{*}{$\text{RMSE}$ [/]} & \multicolumn{6}{c}{Homogeneous Young's modulus} & \multicolumn{6}{c}{Heterogeneous Young's modulus}\\ \cmidrule(rl{4pt}){2-7} \cmidrule(rl{4pt}){8-13} \multicolumn{1}{c}{} & \multicolumn{5}{c}{MLMC} & \multicolumn{1}{c}{MC} & \multicolumn{5}{c}{MLMC} & \multicolumn{1}{c}{MC}\\ \cmidrule(rl{4pt}){2-6} \cmidrule(rl{4pt}){7-7} \cmidrule(rl{4pt}){8-12} \cmidrule(rl{4pt}){13-13} &\multicolumn{4}{c}{level}&\multirow{1}{*}{equivalent}&\multirow{1}{*}{level}&\multicolumn{4}{c}{level}&\multirow{1}{*}{equivalent}&\multirow{1}{*}{level}\\ &{0} & {1} & {2} & {3} & 3 &3 &{0} & {1} &{2} & {3} & 3 & 3 \\ [0.5ex] \cmidrule{1-13} 2.5E-5 & 172 & 4 & 3 & 3 &6& 75 & 41 & 5 & 3 & 3 &5& 24 \\ 7.5E-6 & 1371 & 30 & 3 & 3 &15& 1302 & 477 & 58 & 7 & 3 &11& 265 \\ 5.0E-6 & 3293 & 73 & 4 & 3 &33& - & 940 & 123 & 14 & 3 &17& - \\ 2.5E-6 & 11328 & 271 & 7 & 3 &99& -&4111 & 524 & 73 & 18 &90& - \\ \bottomrule \end{tabular}} \caption{Number of samples for MLMC and MC for the elastoplastic response.} \label{tab:Samples_plast} \end{table} \subsection{Rate verification} In this section, we estimate the rates $\alpha$, $\beta$ and $\gamma$ from Theorem 1, first for the static elastic response, then for the static elastoplastic response. \subsubsection{Elastic Response} We list the online estimated rates, i.e., the rates estimated during the run of the algorithm, for various tolerances $\epsilon$ on the RMSE, see Tab.\,\ref{tab:Parameters for the MLMC algorithm}, corresponding to the tolerances considered in Fig.\,\ref{fig:Times}. Following the results in this table, it is possible to estimate the asymptotic cost of the MLMC estimator, using the different regimes from Eq.\,\eqref{eq:Algo_regime}. Since $\beta>\gamma$ in all cases, we expect an optimal cost proportional to $\epsilon^{-2}$. This is indeed what we observed in the numerical experiments in Fig.\,\ref{fig:Times}. \begin{table}[H] \centering \scalebox{1}{ \begin{tabular}{c c c cc c c} \toprule \multirow{3}{*}{RMSE [/]} & \multicolumn{3}{c}{Homogeneous } & \multicolumn{3}{c}{Heterogeneous }\\ & \multicolumn{3}{c}{Young's modulus} & \multicolumn{3}{c}{Young's modulus}\\ \cmidrule(rl{4pt}){2-4} \cmidrule(rl{4pt}){5-7} & $\alpha$ & $\beta$ & $\gamma$ & $\alpha$ & $\beta$ & $\gamma$ \\ [0.5ex] \cmidrule{1-7} 2.5E-4 & 1.97 & 4.38 & 2.09 & 2.18 & 3.22 & 2.03\\ 7.5E-5 & 2.03 & 5.11 & 2.16 & 2.13 & 2.99 & 2.13 \\ 5.0E-5 & 1.88 & 4.03 & 2.10 & 1.86 & 3.08 & 2.30 \\ 2.5E-5 & 1.87 & 3.80 & 2.22 & 1.61 & 3.12 & 2.17 \\ \bottomrule \end{tabular}} \caption{Parameters for the MLMC algorithm.} \label{tab:Parameters for the MLMC algorithm} \end{table} Fig.\,\ref{fig:rates} shows the behavior of the expected value and the variance of the quantity of interest $P_\ell$, and of the difference $P_\ell-P_{\ell-1}$, in case of a tolerance $\epsilon$ equal to 2.5E-5. Note that the mean and the variance of $P_\ell$ over the different levels remains constant while the variance and the mean of the differences between two successive levels continuously decreases. The rates $\alpha$ and $\beta$ can be read off as the slope of the lines labeled with $\triangledown$. In case where the Young's modulus is homogeneous, Fig.\,\ref{fig:rates} (left), the variance corresponding to the finest level is lower than the variance on the previous levels. This phenomenon can be explained by the number of samples on that level, which is used to estimate the variance. Only 7 samples were taken. Taking a higher number of samples on that level would bring the variance to equal the variance of the other levels. \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Rates_stat_gam_dist.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Rates_stat_gam_field.pdf_tex}}} \end{subfigure} \caption{Elastic response rates for a homogeneous (left) and a heterogeneous Young's modulus (right), in case of a tolerance $\epsilon$ equal to 2.5E-5.} \label{fig:rates} \end{figure} \subsubsection{Elastoplastic Response} As for the elastic response, we list the online rates for various tolerances $\epsilon$ on the $\text{RMSE}$ in Tab.\,\ref{tab:Parameters for the MLMC algorithm plast}. For all tolerances, $\beta>\gamma$. \begin{table}[H] \centering \scalebox{1}{ \begin{tabular}{c c c cc c c} \toprule \multirow{3}{*}{$\text{RMSE}$ [/]} & \multicolumn{3}{c}{Homogeneous } & \multicolumn{3}{c}{Heterogeneous }\\ & \multicolumn{3}{c}{Young's modulus} & \multicolumn{3}{c}{Young's modulus}\\ \cmidrule(rl{4pt}){2-4} \cmidrule(rl{4pt}){5-7} & $\alpha$ & $\beta$ & $\gamma$ & $\alpha$ & $\beta$ & $\gamma$ \\ [0.5ex] \cmidrule{1-7} 2.5E-5 & 1.50 & 3.59 & 2.24 & 1.53 & 5.28 & 2.22 \\ 7.5E-6 & 1.50 & 4.81 & 2.26 & 1.51 & 4.21 & 2.17 \\ 5.0E-6 & 1.51 & 9.62 & 2.25 & 1.49 & 4.51 & 2.11 \\ 2.5E-6 & 1.50 & 8.30 & 2.21 & 1.50 & 3.43 & 2.17 \\ \bottomrule \end{tabular}} \caption{Parameters for the MLMC algorithm.} \label{tab:Parameters for the MLMC algorithm plast} \end{table} Fig.\,\ref{fig:rates_plast} shows the behavior of the expected value and the variance of the quantity of interest $P_\ell$, and of the difference $P_\ell-P_{\ell-1}$, in case of a RMSE equal to 2.5E-6. Comparing Fig.\,\ref{fig:rates} with Fig.\,\ref{fig:rates_plast}, one notices that for the elastoplastic response the mean is not perfectly constant over the levels. This slight increase stems from the number of elements used for the discretization; the displacement is indeed dependent upon the discretization of the mesh, Fig.\,\ref{fig:mesh_convergence}, for the mesh sizes considered here. \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Rates_stat_gam_dist_plast.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Rates_stat_gam_field_plast.pdf_tex}}} \end{subfigure} \caption{Elastoplastic response rates for a homogeneous (left) and a heterogeneous Young's modulus (right), in case of a tolerance $\epsilon$ equal to 2.5E-6.} \label{fig:rates_plast} \end{figure} \subsection{Visualization of the solution} In this part, the static response, i.e., the displacement of the beam in the spatial domain, and the dynamic response, i.e., the frequency response functions (FRF), are shown. First, the static elastic response is presented. This consists of a visualization of the transverse displacement of the nodes along the top side of the beam. Secondly, results for the static elastoplastic response will be shown. The results consists of a visualization of a force deflection curve of the middle top side node of the beam. Thirdly and lastly, solutions for the dynamic response are presented. These consist of frequency responses functions for a single node of the finite element mesh. This node is chosen as the one that has the largest variance of all the nodes that make up the mesh. \subsubsection{Static Elastic Response}\label{Sec:Viz_Sta_El} In this part we show the displacement of the concrete beam under a static load including uncertainty bounds in the elastic domain. The beam configuration is a beam clamped at both ends, loaded at mid span, as shown in Fig.\,\ref{fig:bean_configurations} (right). The load is modeled as a distributed load acting on each of the vertical middle nodes of the beam. The force on each node is such that the sum of these forces equals $10000\,\mathrm{kN}$, regardless of the refinement of the mesh. \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Deflection_stat_gam_dist.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Deflection_stat_gam_field.pdf_tex}}} \end{subfigure} \caption{Deflection of the beam for when the Young's modulus is homogeneous (left) and heterogeneous (right).} \label{fig:deflection_total} \end{figure} Fig.\,\ref{fig:deflection_total} shows the deflection of the beam with a homogeneous Young's modulus (left) and with a heterogeneous Young's modulus (right). The full orange line represents the average of the displacement, the dashed orange lines are the 1$\sigma$ bounds equidistant around the average, which are only relevant in case of a Normal distribution. The shades of blue represent the PDF, with the dark blue line corresponding to the most probable value. As can be observed from Fig.\,\ref{fig:deflection_total} (right), the average value and the most probable value of the PDF tend to coincide for the heterogeneous case. Here, the PDF of the displacement closely resembles that of a Normal distribution. This is however not the case when the Young's modulus is homogeneous. Then the distribution of the solution has a non-negligible skewness. The homogeneous Young's modulus case exhibits a larger uncertainty on its displacement due to the fact that the Young's modulus is uncertain for each individual computed sample but uniform in each point for that sample. Averaging all these individual samples gives rise to wider uncertainty bounds. While for the heterogeneous Young's modulus case, each individual computed sample is also uncertain but non-uniform; in each individual point the value for the Young's modulus is different. This means that in different locations of the beam the Young's modulus will be different. These locations will tend to compensate each other so that beam does not become overly stiff or weak. Fig.\,\ref{fig:indiv_samples_elast} shows ten samples in case of a homogeneous Young's modulus (left) and a heterogeneous Young's modulus (right). \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \scalebox{0.44}{ \makebox[\textwidth]{ \input{Real_Gam_Dist_stat_el.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \centering \scalebox{0.44}{ \makebox[\textwidth]{ \input{Real_Gam_Field_stat_el.pdf_tex}}} \end{subfigure} \caption{Ten different deflection samples for when the Young's modulus is homogeneous (left) and heterogeneous (right).} \label{fig:indiv_samples_elast} \end{figure} \begin{figure}[H] \begin{subfigure}[b]{0.54\linewidth} \centering \scalebox{0.35}{ \makebox[\textwidth]{ \input{Interm_Deflection_stat_gam_dist.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.45\textwidth} \centering \scalebox{0.35}{ \makebox[\textwidth]{ \input{Interm_Deflection_stat_gam_dist_cut_1.pdf_tex}}} \end{subfigure} \caption{Visualization of the PDF when the Young's modulus is homogeneous, beam displacement (left), AB cut-through (right).} \label{fig:Construction of the PDF Gam Dist} \end{figure} \begin{figure}[H] \begin{subfigure}[b]{0.54\linewidth} \centering \scalebox{0.35}{ \makebox[\textwidth]{ \input{Interm_Deflection_stat_gam_field.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.45\textwidth} \centering \scalebox{0.35}{ \makebox[\textwidth]{ \input{Interm_Deflection_stat_gam_field_cut_1.pdf_tex}}} \end{subfigure} \caption{Visualization of the PDF when the Young's modulus is heterogeneous, beam displacement (left), AB cut-through (right).} \label{fig:Construction of the PDF Gam Field} \end{figure} Fig.\,\ref{fig:Construction of the PDF Gam Dist} and Fig.\,\ref{fig:Construction of the PDF Gam Field} show a cut-through in order to better illustrate how the shades of blue represent the PDF. \subsubsection{Static Elastoplastic Response} The solution is presented as a force deflection curve, Fig.\,\ref{fig:deflection_total_plast}. The beam configuration is the same as for the static elastic response but with a different material; a steel beam clamped at both sides loaded at mid span, Fig.\,\ref{fig:bean_configurations} (right). The load is modeled in the same way as for the static elastic response. The beam is loaded from $0\,\mathrm{N}$ to $13.5\,\mathrm{kN}$ in steps of $135\,\mathrm{N}$. \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Plast_dist_sol.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Plast_field_sol.pdf_tex}}} \end{subfigure} \caption{Force deflection curve of the steel beam for when the Young's modulus is homogeneous (left) and heterogeneous (right).} \label{fig:deflection_total_plast} \end{figure} The line style and color convention is the same as for the static elastic response. As can be observed, the uncertainty bounds in case of a homogeneous Young's modulus, Fig.\,\ref{fig:deflection_total_plast} (left) are wider and more spread out than in case of a heterogeneous modulus (right). This behavior corroborates with the ones from the static elastic response. In Fig.\,\ref{fig:indiv_samples_plast}, ten individual samples are shown for a homogeneous Young's modulus (left) and a heterogeneous Young's modulus (right). Comparing these two sets of figures, it shows that, the deflection corresponding to the highest applied force in Fig.\,\ref{fig:indiv_samples_plast} (left and right) is less than the deflection shown in Fig.\,\ref{fig:deflection_total_plast} (left and right). This stems from the fact that these ten samples per Young's modulus are generated on the coarsest mesh. These results illustrate even better the power of the MLMC method; even whilst taking most of the samples on coarser meshes, one still gets the result as if the simulation was run on the finest mesh. \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \scalebox{0.44}{ \makebox[\textwidth]{ \input{Indiv_Samples_Dist.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \centering \scalebox{0.44}{ \makebox[\textwidth]{ \input{Indiv_Samples_Field.pdf_tex}}} \end{subfigure} \caption{Ten different force deflection curve samples for when the Young's modulus is homogeneous (left) and heterogeneous (right).} \label{fig:indiv_samples_plast} \end{figure} \subsubsection{Dynamic Elastic Response} For the dynamic elastic response, the solution is a frequency response function (FRF). The beam configuration we consider is a concrete cantilever beam clamped on the left side and loaded on the right side, as shown in Fig.\,\ref{fig:bean_configurations} (left), with a dynamic load. The load is modeled in the same way as for the static elastic response with the same magnitude. In order to ensure the correct representation of the dynamic response, and to determine the minimum number of finite elements required, the bending wavelength, $\lambda_{\mathrm{min}}$, must be evaluated as \begin{linenomath*} \begin{equation} \lambda_{\mathrm{min}} = \sqrt{\dfrac{2 \pi}{f_{\mathrm{max}}}} \sqrt[4]{\dfrac{E I}{\rho A}}, \label{eq:MinElements} \end{equation} \end{linenomath*} with $E$ the mean Young's modulus, $I$ the moment of inertia, $A$ the area, $\rho$ the density, $f_{\mathrm{max}}$ the highest simulated frequency, and $\lambda_{\mathrm{min}}$ the smallest obtained wavelength for the highest input frequency. For the considered beam configuration, it has been checked that at least six elements are used to represent the wavelength on the coarsest grid for the highest simulated frequency, which in this case is 400 Hz. \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \scalebox{0.46}{ \makebox[\textwidth]{ \input{DynRes_cantilever_Gam_Dist.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \centering \scalebox{0.43}{ \makebox[\textwidth]{ \input{DynRes_cantilever_Gam_Field.pdf_tex}}} \end{subfigure} \caption{Dynamic Responses of the beam for when the Young's modulus is homogeneous (left) and heterogeneous (right).} \label{fig:dynamic_total} \end{figure} The FRF results are presented in Fig.\,\ref{fig:dynamic_total}. As was the case for the static elastic and elastoplastic response, the shades of blue represent the PDF, with the blue line being the most probable value, and the orange line the average value. As can be observed, the uncertainty bounds for the FRF are wider and more spread out when the Young's modulus is homogeneous, Fig.\,\ref{fig:dynamic_total} (left), as opposed to a heterogeneous Young's modulus, Fig.\,\ref{fig:dynamic_total} (right). This discrepancy is due to the fact that in case of a homogeneous Young's modulus, the resonance frequency will be shifted for each different sample. Averaging all these samples gives rise to a broad and wide uncertainty bound. In case of a heterogeneous Young's modulus, the different samples compensate each other, in analogy with the explanation given in $\S$\ref{Sec:Viz_Sta_El}. This gives rise to much smaller uncertainty bounds. Fig.\,\ref{fig:dynamic_samples} shows the resulting FRF for ten realizations. \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \scalebox{0.44}{ \makebox[\textwidth]{ \input{Real_Gam_Dist.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \centering \scalebox{0.44}{ \makebox[\textwidth]{ \input{Real_Gam_Field.pdf_tex}}} \end{subfigure} \caption{Ten different FRF samples for when the Young's modulus is homogeneous (left) and heterogeneous (right).} \label{fig:dynamic_samples} \end{figure} An important inequality that must hold for MLMC to work well is \begin{linenomath*} \begin{equation} \V[P_1-P_0] \ll \V[P_1]. \label{eq:Variance_ineq} \end{equation} \end{linenomath*} It has been observed empirically that \eqref{eq:Variance_ineq} is not necessarily fulfilled for resonance frequencies and frequencies close by those resonance frequencies for the dynamic elastic response in case of a heterogeneous Young's modulus. The reason for this phenomenon appears to be closely linked to the resolution of random fields on the different levels, as discussed in \S \ref{par:comparison}. In order to remedy to this, we use the following strategy. Using a small number of samples, the magnitude of $\V[P_1] - \V[P_1-P_0]$ is estimated. When the estimation is below a certain threshold $T$, the coarsest level is discarded and the algorithm is started on a finer mesh. We write this condition in a $\log_2$ base, in order not to lose consistency with Fig.\,\ref{fig:rates}, which depict the rates in a $\log_2$ base. The estimation after simplification is written as \begin{linenomath*} \begin{equation} \log_2\left(\dfrac{\V[P_1]}{\V[P_1-P_0]}\right) > \log_2{T}. \label{eq:tresh} \end{equation} \end{linenomath*} For the experiments reported here, we selected the right-hand side of \eqref{eq:tresh} heuristically to be equal to $2.3$. \section{Conclusion} In this work, it has been demonstrated that the Multilevel Monte Carlo method provides a significant computational cost reduction and speedup compared to the standard Monte Carlo method for computing the stochastics of the response in a structural engineering problem. This has been shown by means of actual computing times and normalized computational costs. Speedups are typically of the order of a factor ten for moderate accuracies and can be even much higher for higher accuracies. In addition, figures depicting the static elastic, the static elastoplastic and the dynamic elastic response have been presented with uncertainty bounds. To model the uncertainty in the Young's modulus, we considered both a homogeneous model, represented by a single random variable, and a heterogeneous model, modeled by means of a random field. We observed that the nature of the uncertainty in the Young's modulus has a big impact on the uncertainty characteristics of the simulation results. For the homogeneous Young's modulus, the variance in the solution is larger than for the heterogeneous Young's modulus. This is apparent from the wider and more spread out uncertainty bounds in $\S$\ref{Sec:Viz_Sta_El}. Hence, for realistic applications, the appropriate choice of the uncertainty model is of great importance. Further paths of research will focus on ways to exploit the similarities between the responses for neighboring frequencies and to couple the Finite Element solvers with an existing Multilevel/Multi-index framework \cite{PJ,PJ2}. \section*{Acknowledgements} This research was funded by project IWT/SBO EUFORIA: ``Efficient Uncertainty quantification For Optimization in Robust desgn of Industrial Applications" (IWT-140068) of the Agency for Innovation by Science and Technology, Flanders, Belgium. The authors gratefully acknowledge the support from the research council of KU Leuven though the funding of project C16/17/008 ``Efficient methods for large-scale PDE-constrained optimization in the presence of uncertainty and complex technological constraints". The authors also would like to thank the Structural Mechanics Section of the KU Leuven and Jef Wambacq for supplying their StaBIL code and providing support. \section*{References} \section{Introduction} There is an increasing need to accurately simulate and compute solutions to engineering problems whilst taking into account model uncertainties. Methods for such uncertainty quantification and propagation in structural engineering can roughly be categorized into two groups: non-sampling methods and sampling methods. Examples of non-sampling methods are the perturbation method and the Stochastic Galerkin Finite Element method. The perturbation method is based on a Taylor series expansion approximating the mean and variance of the solution \cite{Kleiber}. The method is quite effective, but its use is restricted to models with a limited number of relatively small uncertainties. The Stochastic Galerkin method, first proposed by Ghanem and Spanos \cite{GhanemAndSpanos}, is based on a spectral representation in the stochastic space. It transforms the uncertain coefficient partial differential equation (PDE) problem by means of a Galerkin projection technique into a large coupled system of deterministic PDEs. This method allows for somewhat larger numbers of uncertainties and is quite accurate. However, it is highly intrusive and memory demanding, making its implementation cumbersome and restricting its use to rather low stochastic dimensions. Sampling methods, on the other hand, are typically non-intrusive. Each sample corresponds to a deterministic solve for a set of specified parameter values. Two particularly popular examples are the Stochastic Collocation method \cite{Bab} and the Monte Carlo (MC) method \cite{Fishman}. The former samples a stochastic PDE at a carefully selected multidimensional set of collocation points. After this sampling, a Lagrange interpolation is performed leading to a polynomial response surface. From this, the relevant stochastic characteristics can easily be computed in a post-processing step. However, as is also the case for Stochastic Galerkin, the Stochastic Collocation method suffers from the curse of dimensionality; the computational cost grows exponentially with the number of random variables considered in the problem. The MC method on the other hand, selects its samples randomly and does not suffer from the curse of dimensionality. A drawback is its slow convergence as a function of the number of samples taken. The convergence of Monte Carlo can be accelerated in a variety of ways. For example, alternative non-random selections of sampling points can be used, as in Quasi-Monte Carlo \cite{Caflish,Niederreiter}, and Latin Hypercube \cite{Loh} sampling methods. Also, variance reduction techniques such as Multilevel Monte Carlo (MLMC) \cite{Giles} and its generalizations, see, e.g., \cite{PJ, PJ2}, can speed up the method. Note that there also exist hybrid variants which exhibit both a sampling and non-sampling character. This type of methods combines, for example, the Stochastic Finite Element methodology with Monte Carlo sampling or a multi-dimensional cubature method, see, e.g., \cite{Ghanem_Hyrbid,Acharjee}. Monte Carlo methods have since long been used in the field of structural engineering, for example in problems of structural dynamics \cite{Masanobu} or in elastoplastic problems where the structure's reliability is assessed \cite{Pulido}. The focus of this paper is to apply the MLMC method to a structural engineering problem, discretized by means of the Finite Element method. A comparison with the standard MC method will show a significant reduction in computational cost. The structure of the paper is as follows. In section 2, we formulate the mathematical model, introduce the problem statement and describe how the uncertainty is modeled. Section 3 recalls the MLMC method, and provides some additional algorithmic implementation details. In Section 4, numerical results are presented. First, a performance comparison is made between standard MC and MLMC for a static elastic and elastoplastic load case. Next, results showing the uncertainty propagation for the static elastic, static elastoplastic and the dynamic elastic response are shown for when the Young's modulus is modeled by means of a random variable coming from a univariate Gamma distribution and as multiple random variables sampled from a Gamma random field. The fifth and last section offers concluding remarks and details some paths for further research. \section{The mathematical model} \subsection{Beam models and material parameters} The considered engineering problem is the response of a cantilever beam clamped at one side and a beam clamped at both sides as seen in Fig.\ref{fig:bean_configurations}, assuming plane stress. The following responses are considered: the static elastic response, the dynamic elastic response and the static elastoplastic response. The first two respectively simulate the spatial displacement and the frequency response function of a concrete beam model solely in the elastic region. The third one simulates the spatial displacement of a steel beam in the elastic as well as in the plastic region. The dimensions of the beam are $2.5\,\mathrm{m}$ (length) by $0.25\,\mathrm{m}$ (height) by $1\,\mathrm{m}$ (width) for the elastic responses and $10^{-3}\,\mathrm{m}$ (width) for the elastoplastic response. The material parameters of the concrete are as follows: a mass density of $2500\,\mathrm{kg/m^3}$, a Poisson ratio of $0.15$ and a Young's modulus subjected to some uncertainty with a mean value of $30\,\mathrm{GPa}$. The material parameters of the steel are as follows: a yield strength of $240\,\mathrm{MPa}$, a Poisson ratio of $0.25$ and a Young's modulus subjected to a certain degree of uncertainty with a mean value of $200\,\mathrm{GPa}$. In order to model the material uncertainty, two uncertainty models will be considered. The first model consists of a homogeneous Young's modulus characterized by means of a single random variable. The second model is a heterogeneous Young's modulus represented as a random field. Both uncertainty models will be used to compute the stochastic characteristics of the static elastic and elastoplastic response of a beam clamped at both sides as seen in Fig.\ref{fig:bean_configurations} (right) and the dynamic response of a cantilever beam clamped at one side as seen in Fig.\ref{fig:bean_configurations} (left). \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \includegraphics[height=1.9cm]{Beam_nogrid.pdf} \end{subfigure} \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[height=1.9cm]{DoubleClampedBeam.pdf} \end{subfigure} \caption{Cantilever beam loaded on its right end (left) and beam clamped at both sides loaded in the middle (right).} \label{fig:bean_configurations} \end{figure} \subsubsection{The homogeneous model} Following \cite{YongLiu}, we opt to describe the Young's modulus in the homogeneous model by means of a univariate Gamma distribution. This distribution is characterized by a shape parameter $\alpha$ and a scale parameter $\beta$: \begin{linenomath*} \begin{equation} f(x|\alpha,\beta) = \dfrac{1}{\beta^{\alpha} \Gamma(\alpha)} x^{\alpha-1} e^{\left(-\dfrac{x}{\beta}\right)}. \end{equation} \end{linenomath*} The corresponding mean value and variance can be computed respectively as $\mu=\alpha \beta$ and $\sigma^2=\alpha \beta^2$. In this paper, we will select $\alpha\!=\!7.1633$ and $\beta\!=\!4.1880 \times 10^9$ in order to model the material uncertainty for the concrete beam, which are based on values coming from \cite{Ellen}. This leads to a mean of $30\,\mathrm{GPa}$ and a standard deviation of $11.2\,\mathrm{GPa}$. For modeling the material uncertainty in the steel beam, we select $\alpha\!=\!934.2$ and $\beta\!=\!0.214\times 10^9$, see \cite{Hess}. This gives a mean of $200\,\mathrm{GPa}$ and a standard deviation of $6.543\,\mathrm{GPa}$. The Gamma distribution for both materials is plotted in Fig.\,\ref{fig:pdf_gam_prior}. \begin{figure}[H] \centering \begin{subfigure}[b]{0.54\textwidth} \scalebox{0.45}{ \input{PDF_Gam_Dis.pdf_tex}} \end{subfigure} \begin{subfigure}[b]{0.45\textwidth} \scalebox{0.45}{ \input{PDF_steel.pdf_tex}} \end{subfigure} \centering \caption{Probability density function for Young's modulus as a univariate distribution for concrete (left) and steel (right). Shown also is the mean $\mu$ and the standard deviation $\sigma$.} \label{fig:pdf_gam_prior} \end{figure} \subsubsection{The heterogeneous model} The Young's modulus with spatially varying uncertainty will be represented by means of a (truncated) Gamma random field. The construction of this random field is done by means of a classical, two step process. First, a (truncated) Gaussian random field is generated, using a Karhunen-Lo\`eve (KL) expansion \cite{Loeve}. Next, this Gaussian random field is transformed into a Gamma random field with a memoryless transformation \cite{Grigoriu}. Consider a Gaussian random field $Z(\mathbf{x},\omega)$, where $\omega$ is a random variable, with exponential covariance kernel, \begin{linenomath*} \begin{equation}\label{eq:covariance_kernel} C(\mathbf{x},\mathbf{y}):= \sigma^2 \exp\left(-\dfrac{\norm{\mathbf{x}-\mathbf{y}}_p}{\lambda}\right)\,. \end{equation} \end{linenomath*} We selected the 1-norm ($p\!=\!1$), a correlation length $\lambda\!=\!0.3$ and a standard deviation $\sigma \!=\!1.0$. The corresponding KL expansion can then be formulated as follows: \begin{linenomath*} \begin{equation} Z(\mathbf{x},\omega)=\overline{Z}(\mathbf{x},.)+\sum_{n=1}^{\infty} \sqrt{\theta_n} \xi_n(\omega) b_n(\mathbf{x})\,. \label{eq:KLExpansion} \end{equation} \end{linenomath*} $\overline{Z}(\mathbf{x},.)$ denotes the mean of the field, and is set to zero. The $\xi_n(\omega)$ denote i.i.d.\,standard normal random variables. The symbols $\theta_n$ and $b_n(\mathbf{x})$ denote, respectively, the eigenvalues and eigenfunctions of the covariance kernel \eqref{eq:covariance_kernel}. For the parameter values selected above, those eigenvalues and eigenfunctions can be computed analytically, see \cite{GhanemAndSpanos,Cliffe,Ghanem_prob,Zhang}. For a one-dimensional domain $\left[0 , 1\right]$, they are given by \begin{linenomath*} \begin{equation}\label{eq:1D_eigVec \theta_n^{1\text{D}}= \dfrac{2 \lambda}{\lambda^2 w_n^2 +1} ~~~~\mbox{and}~~~ b^{1\text{D}}_n(x) = A_n \left(\sin(w_n x) +\lambda w_n \cos(w_n x)\right)\,. \end{equation} \end{linenomath*} The normalizing constants $A_n$ are chosen such that $ \norm{b_n}_2 = 1$. The constants $w_n$ represent the real solutions, in increasing order, of the transcendental equation \begin{linenomath*} \begin{equation}\label{eq:transcendental} \tan(w)=\dfrac{2 \lambda w}{\lambda^2 w^2 -1}\,. \end{equation} \end{linenomath*} For the two-dimensional case, the eigenvalues and functions are obtained in a tensorproduct way, \begin{linenomath*} \begin{equation}\label{eq:2d_eigenVal \theta_n^{2\text{D}} = \theta_{i_{n}}^{1\text{D}} \theta_{j_n}^{1\text{D}} ~~~\mbox{and}~~ b_n^{2\text{D}} (\mathbf{x}) = b_{i_n}^{1\text{D}} (x_1) b_{j_n}^{1\text{D}} (x_2)~~ \mbox{with}~~n = (i_n, j_n)\,. \end{equation} \end{linenomath*} In an actual implementation, the number of KL-terms in \eqref{eq:KLExpansion} is truncated to a finite value. This value depends on the magnitude and, more precisely, on the decay of successive eigenvalues. Those eigenvalues are plotted in Fig.\,\ref{fig:Eigenvalf} (left). Inclusion of the first 101 KL-terms is sufficient in order to represent 90\% of the variance of the random field. The percentage of the variance that is accounted for as a function of the number of included eigenvalues, corresponds to the cumulative sum of the eigenvalues, and is also illustrated in the figure. A cumulative sum of 1.0 corresponds to 100\% of the variance of the field being accounted for. \begin{figure}[H] \centering \begin{subfigure}[b]{0.54\textwidth} \scalebox{0.45}{ \input{"EigenValues.pdf_tex"}} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \scalebox{0.45}{ \input{"Mem_Trans.pdf_tex"}} \end{subfigure} \caption{Magnitude of the eigenvalues and their cumulative sum (left) and memoryless transformation used to generate the Gamma random field (right).} \label{fig:Eigenvalf} \end{figure} Once the Gaussian field has been generated, a memoryless transformation is applied pointwise, \begin{linenomath*} \begin{equation}\label{eq:MemTrans} g(y) = F^{-1}\left[\Phi(y)\right], \end{equation} \end{linenomath*} in order to obtain the Gamma random field \cite{Grigoriu}. Here, $F$ denotes the marginal cumulative density function (CDF) of the target distribution and $\Phi$ the marginal CDF of the standard normal distribution. This transformation is depicted in Fig.\,\ref{fig:Eigenvalf} (right) with the full line representing a realization of $F$, and the dashed line representing a realization of $\Phi$. Contour plots of a realization of a Gaussian random field and the corresponding Gamma random field are presented for illustration purposes in Fig.\,\ref{fig:contour}. \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Contour_Gaus_Field.pdf_tex}}} \label{fig:Gaussian Random field} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Contour_Gam_Field.pdf_tex}}} \label{fig:Gamma random field} \end{subfigure} \caption{Gaussian random field (left) and the corresponding Gamma random field (right).} \label{fig:contour} \end{figure} \subsection{The Finite Element method} The Finite Element method will be used to compute the responses of the beam assuming plane stress. An equidistant, regular rectangular mesh is applied with bilinear quadrilateral elements. The implemented solver for the elastic and the elastoplastic response is different. The underlying equations and solution methods are reviewed hereunder. \\ \\ For the static elastic response, the system equation is of the form \label{Displacement_eq} \begin{linenomath*} \begin{equation} \mathbf{K} \mathbf{\underline{u}} = \mathbf{\underline{f}}, \end{equation} \end{linenomath*} with $\mathbf{K}$ the global stiffness matrix, $\mathbf{\underline{f}}$ the global nodal force vector and $\mathbf{\underline{u}}$ the displacement. The global stiffness matrix and nodal force vector are obtained from the element stiffness matrices $\mathbf{K^e}$ and the element force vectors $\mathbf{\underline{f}^e}$. These are computed analytically by evaluation of the following integrals: \begin{linenomath*} \begin{equation}\label{eq:K \mathbf{K^e} = \int_{\Omega} \mathbf{B}^T \mathbf{D} \mathbf{B} d \Omega ~~~~\mbox{and}~~~ \mathbf{\underline{f}^e} = \int_{\Gamma_t} \mathbf{N}^T \mathbf{\overline{t}}_n d \Gamma_t. \end{equation} \end{linenomath*} The element nodal force vector $\mathbf{\underline{f}^e}$ is modeled as a Neumann boundary condition, where $\mathbf{\overline{t}}_n$ stands for the surface traction specified as a force per unit area and $\mathbf{N}$ the element shape function matrix, integrated over the free element boundary $\Gamma_t$. The element stiffness matrix $\mathbf{K^e}$ is obtained by integrating the matrix $\mathbf{B^TDB}$ over the element's surface $\Omega$. Matrix $\mathbf{B}$ is defined as $\mathbf{LN}$ with $\mathbf{L}$ the derivative matrix specified below, and with $\mathbf{D}$ the elastic constitutive matrix for plane stress, containing the element wise material parameters, \begin{linenomath*} \begin{equation} \mathbf{L} = \begin{bmatrix} \pdv{}{x} & 0 \\ 0 & \pdv{}{y} \\ \pdv{}{y} & \pdv{}{x} \\ \end{bmatrix}\, ~~~~\mbox{and}~~~ \mathbf{D} = \dfrac{E}{1-\nu^2} \begin{bmatrix} 1 & \nu & 0 \\ \nu & 1 & 0 \\ 0 & 0 & \dfrac{1-\nu}{2} \\ \end{bmatrix}\,. \label{eq:BDmatrix} \end{equation} \end{linenomath*} For the dynamic response case the following equation is obtained, \begin{linenomath*} \begin{equation}\label{eq:dyn} \left(\mathbf{K}(1+\imath \,\eta) - (2 \pi f)^2 \mathbf{M}\right)\mathbf{\underline{u}} = \mathbf{\underline{f}} ~~~\mbox{with}~~\mathbf{M}^e= \int_{\Omega} \mathbf{N}^T \rho \mathbf{N} d \Omega\,. \end{equation} \end{linenomath*} Matrix $\mathbf{M}$ denotes the system mass matrix obtained from the assembly of the element mass matrices $\mathbf{M^e}$. $f$ denotes the frequency and $\rho$ the volumetric mass density of the material. The multiplication of the system stiffness matrix $\mathbf{K}$ with the imaginary unit $\imath$ and the constant $\eta$, denotes the damping matrix. \\ \\ The approach for solving the static elastoplastic case differs due to the nonlinear stress-strain relation in the plastic domain. The plastic region is governed by the von Mises yield criterion with isotropic linear hardening. An incremental load approach is used starting with a force of $0\,\mathrm{N}$. The methods used to solve the elastoplastic problem are based on Chapter 2 $\S$4 and Chapter 7 $\S$3 and $\S$4 of \cite{Borst}. For this case, the system equation takes the following form: \begin{linenomath*} \begin{equation}\label{Displacement_eq_plast} \mathbf{K} \Delta\mathbf{\underline{u}} = \mathbf{\underline{r}}, \end{equation} \end{linenomath*} where $\Delta\mathbf{\underline{u}}$ stands for the resulting displacement increment. The vector $\mathbf{\underline{r}}$ is the residual, \begin{linenomath*} \begin{equation} \mathbf{\underline{r}}=\mathbf{\underline{f}}+\Delta\mathbf{\underline{f}}-\mathbf{\underline{q}}, \end{equation} \end{linenomath*} where $\mathbf{\underline{f}}$ stands for the sum of the external force increments applied in the previous steps, $\Delta\mathbf{\underline{f}}$ for the applied load increment of the current step and $\mathbf{\underline{q}}$ for the internal force resulting from the stresses \begin{linenomath*} \begin{equation} \mathbf{\underline{q}}=\int_{\Omega} \mathbf{B}^T \bm{\sigma} d\Omega. \end{equation} \end{linenomath*} First the displacement increment of all the nodes is computed according to \eqref{Displacement_eq_plast}, with an initial system stiffness matrix $\mathbf{K}$ resulting from the assembly of the element stiffness matrix $\mathbf{K^e}$, computed by means of a Gauss quadrature \begin{linenomath*} \begin{equation} \label{K_el_plast} \mathbf{K^e} = \int_{\Omega} \mathbf{B}^T \mathbf{D}^{ep} \mathbf{B} d \Omega, \end{equation} \end{linenomath*} where $\mathbf{D}^{ep}$ denotes the elastoplastic constitutive matrix. The initial state of $\mathbf{D}^{ep}$ is the elastic constitutive matrix from \eqref{eq:BDmatrix}. Secondly, the strain increment $\Delta \varepsilon$ is computed, \begin{linenomath*} \begin{equation} \Delta \varepsilon = \mathbf{B}\Delta\mathbf{\underline{u}}. \end{equation} \end{linenomath*} Thirdly, the nonlinear stress-strain relationship, \begin{linenomath*} \begin{equation} d\bm{\sigma} = \mathbf{D}^{ep} d\varepsilon, \end{equation} \end{linenomath*} is integrated by means of a backward Euler method. The backward Euler method essentially acts as an elastic predictor-plastic corrector; an initial stress state that is purely elastic is computed and then projected in the direction of the yield surface as to obtain the plastic stress state. Due to the implicit nature of the integrated stress-strain relation, this equation must be supplemented with the integrated form of the hardening rule and the yield condition. This system of nonlinear equations is then solved with an iterative Newton-Raphson method. Afterwards, the consistent tangent stiffness matrix is computed \cite{Agusti}. This matrix is then used to compute the updated element stiffness matrix \eqref{K_el_plast}, resulting in an updated system stiffness matrix $\mathbf{K}$. The inner iteration step of solving the stress-strain relation and the updated system stiffness matrix is repeated for each outer iteration step which solves equation \eqref{Displacement_eq_plast}. The outer step consists in balancing the internal forces with the external ones as to satisfy the residual, which in our case equals $10^{-4}$ times the load increment. The procedure used is incremental-iterative, relying on the iterative Newton-Raphson method. This process is repeated for each load increment. Each finite element is assigned a value of the Young's modulus. This is accomplished by means of the midpoint approach, i.e., the value is taken constant within each individual element and equal to the value of the realization of the random field at the center point of the element \cite{jie_lie}. \section{The Multilevel Monte Carlo method} \subsection{Method overview} \label{sec:MethodOverview} The Multilevel Monte Carlo method (MLMC) is an extension of the standard Monte Carlo (MC) method, see, e.g.,~\cite{Giles, Giles2}. The method relies on a clever combination of many computationally cheap low resolution samples and a relatively small number of higher resolution, but computationally more expensive samples. The application of MLMC to our problem will be based on a hierarchy of nested finite element meshes. These meshes will be indexed from $0$ to $L$, with $0$ indicating the coarsest mesh and $L$ the finest mesh. An example of such a hierarchy is shown in Fig.\,\ref{fig:gridrefinement}. It is common in the PDE setting to use a geometric relation for the number of degrees of freedom between the different levels. We set the number of finite elements for a mesh at level $\ell$ proportional to $2^{d\ell}$, where $d$ is the dimension of the problem. \begin{figure}[H] \centering \includegraphics[height=1.9cm]{Grid.pdf} \caption{Illustrative example of a hierarchy used in the MLMC method.} \label{fig:gridrefinement} \end{figure} Let $\E[P_L(\omega)]$, or $\E[P_L]$ for short, be the expected value of a particular quantity of interest $P$ depending on a random variable $\omega$, discretized on mesh $L$. The standard MC estimator for $\E[P_L]$ using $N_L$ samples on mesh $L$, denoted as $Q^{\textrm{MC}}_L$, can be written as \begin{linenomath*} \begin{equation} Q^{\textrm{MC}}_L={\frac{1}{N_L}}\sum_{n=1}^{N_L} P_L(\omega^n)\,. \label{eq:SimpleMC} \end{equation} \end{linenomath*} Multilevel Monte Carlo, on the other hand, starts from a reformulation of $\E[P_L]$ as a telescoping sum. The expected value of the quantity of interest on the finest mesh is expressed as the expected value of the quantity of interest on the coarsest mesh, plus a series of correction terms (or \emph{differences}): \begin{linenomath*} \begin{equation} \E[P_L]=\E[P_0]+\sum_{\ell=1}^L \E[P_\ell -P_{\ell-1}]\,. \label{Eq:TelescopingSum} \end{equation} \end{linenomath*} Each term in the right-hand side is then estimated separately by a standard Monte Carlo estimator with $N_\ell$ samples, i.e., \begin{linenomath*} \begin{equation} Q^{\textrm{MLMC}}_L=\frac{1}{N_0}\sum_{n=1}^{N_0} P_0(\omega^{n}) + \sum_{\ell=1}^L \left \{ \frac{1}{N_\ell} \sum_{n=1}^{N_\ell} \left( P_\ell(\omega^{n})-P_{\ell-1}(\omega^{n})\right) \right \}, \label{eq:MLMC} \end{equation} \end{linenomath*} where $Q^{{\textrm{MLMC}}}_L$ is the Multilevel Monte Carlo estimator for the expected value $\E[P_L]$, which is a discrete approximation of the continuous solution $\E[P]$. The mean square error (MSE) is defined as \begin{linenomath*} \begin{equation}\label{eq:MSE} \begin{split} \textrm{MSE}(Q^{\textrm{MLMC}}_L) & := \E\left[\left(Q^{\textrm{MLMC}}_L - \E\left[P\right]\right)^2\right] \\ & := \V\left[Q^{\textrm{MLMC}}_L\right] + \left(\E\left[Q^{\textrm{MLMC}}_L\right] - \E\left[P\right]\right)^2, \end{split} \end{equation} \end{linenomath*} with $\V\left[\mathrm{x}\right]$ denoting the variance of a random variable $\mathrm{x}$. The MLMC estimator in \eqref{eq:MLMC} can be written as a sum of $L+1$ estimators for the expected value of the difference on each level, i.e., \begin{linenomath*} \begin{equation} Q^{\textrm{MLMC}}_L = \sum_{\ell = 0}^L Y_{\ell}, \quad \text{where} \quad Y_{\ell} = \frac{1}{N_\ell} \sum_{n=1}^{N_\ell} \left( P_\ell(\omega^{n})-P_{\ell-1}(\omega^{n})\right). \end{equation} \end{linenomath*} where we defined $P_{-1}\coloneqq0$. Because of the telescoping sum, the MLMC estimator is an unbiased estimator for the quantity of interest on the finest mesh, i.e., \begin{linenomath*} \begin{equation} \E[P_L] = \E[Q^{\textrm{MLMC}}_L]. \end{equation} \end{linenomath*} Denoting by $V_{\ell}$ the variance of the difference $P_{\ell} - P_{\ell-1}$, the variance of the estimator can be written as \begin{linenomath*} \begin{equation} \V[Q^{\textrm{MLMC}}_L] = \sum_{\ell=0}^L \frac{V_{\ell}}{N_{\ell}}. \end{equation} \end{linenomath*} In order to ensure that the MSE is below a given tolerance $\epsilon^2$, it is sufficient to enforce that the variance $\V[Q^{\textrm{MLMC}}_L]$ and the squared bias $(\E[P_L-P])^2$ are both less than $\epsilon^2/2$. The condition on the variance of the estimator can be used to determine the number of samples needed on each level $\ell$. Following the classic argument by Giles in~\cite{Giles}, we minimize the total cost of the MLMC estimator \begin{linenomath*} \begin{equation} \text{cost}(Q^{\textrm{MLMC}}) = \sum_{\ell=0}^{L} N_\ell C_\ell, \end{equation} \end{linenomath*} where $C_\ell$ denotes the cost to compute a single realization of the difference $P_\ell-P_{\ell-1}$, subject to the constraint \begin{linenomath*} \begin{equation} \sum_{\ell=0}^L \frac{V_{\ell}}{N_{\ell}} \leq \frac{\epsilon^2}{2}. \end{equation} \end{linenomath*} Treating the $N_\ell$ as continuous variables, we find \begin{linenomath*} \begin{equation}\label{eq:nopt} N_\ell = \frac{2}{\epsilon^2} \sqrt{\frac{V_\ell}{C_\ell}} \sum_{\ell=0}^L \sqrt{V_\ell C_\ell} . \end{equation} \end{linenomath*} Note that if $\E[P_\ell]\rightarrow\E[P]$, then $V_\ell\rightarrow0$ as $\ell$ increases. Hence, the number of samples $N_\ell$ will be a decreasing function of $\ell$. This means that most samples will be taken on the coarse mesh, where samples are cheap, and increasingly fewer samples are required on the finer, but more expensive meshes. In practice, the number of samples must be truncated to $\lceil N_\ell \rceil$, the least integer larger than or equal to $N_\ell$. Using~\eqref{eq:nopt}, the total cost of the MLMC estimator can be written as \begin{linenomath*} \begin{equation}\label{eq:cost} \text{cost}(Q^{\textrm{MLMC}}) = \frac{2}{\epsilon^2}\left(\sum_{\ell=0}^L \sqrt{V_\ell C_\ell}\right)^{2}. \end{equation} \end{linenomath*} This can be interpreted as follows. When the variance $V_\ell$ decreases faster with increasing level $\ell$ than the cost increases, the dominant computational cost is located on the coarsest level. The computational cost is then proportional to $V_0 C_0$, which is small because $C_0$ is small. Conversely, if the variance decreases slower with increasing level $\ell$ than the cost increases, the dominant computational cost will be located on the finest level $L$, and proportional to $V_L C_L$. This quantity is small because $V_L$ is small. For comparison, the computational cost of a Monte Carlo simulation that reaches the same accuracy is proportional to $V_0 C_L$. In our numerical results presented next, we will compare the cost of the MLMC estimator to the cost of a standard MC simulation, both in actual runtime (seconds) and in some normalized cost measure. This cost is chosen such that the time needed to obtain a sample on the coarsest mesh (level zero) is equal to a cost of one unit. When using the standard geometric mesh hierarchy, the cost for a single sample on level $\ell$ is proportional to $2^{\gamma \ell}$. The factor $\gamma$ is determined by the efficiency of the solver. The advantage of using this normalized cost is that it decouples the cost of the simulation from the specific computer hardware. The second term in \eqref{eq:MSE} is used to determine the maximum number of levels $L$. A typical MLMC implementation is level-adaptive, i.e., starting from a coarse finite element mesh, finer meshes are only added if required to reach a certain accuracy. Assume that the convergence $\E[P_\ell]\rightarrow\E[P]$ is bounded as $|\E[P_{\ell} - P]| = \mathcal{O}(2^{-\alpha \ell})$. Then, we can use the heuristic \begin{linenomath*} \begin{equation}\label{eq:bias_constraint} \abs{\E[P_L-P]} = \abs{\sum_{\ell=L+1}^{\infty} \E[P_\ell-P_{\ell-1}]} \approx \frac{\abs{\E[P_L-P_{L-1}]}}{2^\alpha-1} \end{equation} \end{linenomath*} and check for convergence using $|\E[P_L-P_{L-1}]|/(2^\alpha-1)\leq\epsilon/\sqrt{2}$, see~\cite{Giles} for details. For completion, we now mention the central MLMC complexity theorem. We refer to~\cite{Giles2} for a proof. \begin{theorem} Given the positive constants $\alpha, \beta, \gamma, c_1, c_2, c_3$ such that $\alpha \geq \dfrac{1}{2} \mathrm{min}\left(\beta,\gamma\right)$ and assume that the following conditions hold: \begin{enumerate} \item $\lvert \E[P_{\ell} - P] \rvert \leq c_1 2^{-\alpha \ell}$, \item $V_{\ell} \leq c_2 2^{-\beta \ell}$ \;and \item $C_{\ell} \leq c_3 2^{\gamma \ell}$. \end{enumerate} Then, there exists a positive constant $c_4$ such that for any $\epsilon < \exp(-1)$ there exists an $L$ and a sequence $\{N_{\ell}\}_{\ell=0}^L$ for which the multilevel estimator, $Q^{\mathrm{MLMC}}_L$ has an $\mathrm{MSE}\leq\epsilon^2$, and \begin{linenomath*} \begin{equation} \mathrm{cost}(Q^{\mathrm{MLMC}}) \leq \left\{ \begin{aligned} & c_4 \epsilon^{-2} && \mathrm{if} \quad \beta > \gamma, \\ & c_4 \epsilon^{-2}\left(\log \;\epsilon \right)^2 && \mathrm{if} \quad \beta = \gamma, \\ & c_4 \epsilon^{-2-\left(\gamma-\beta\right)/\alpha} && \mathrm{if} \quad \beta < \gamma. \\ \end{aligned} \right. \label{eq:Algo_regime} \end{equation} \end{linenomath*} \label{Theorem_1} \end{theorem} \subsection{Implementation aspects}\label{Implementation_aspects} The MLMC method is non-intrusive. Only an interface between the Finite Element solver routine and the multilevel routine is necessary. All modules used in the simulation are written in \textsc{Matlab}. The elastic computations are run in sequential mode, without making use of parallelization. The elastoplastic computations are run in parallel mode because of their significantly larger computational cost. In particular, the computation of the individual samples is parallelized in order to get a speedup. This is possible because of the \emph{embarrassingly parallel} nature of the MLMC and the MC methods. For the aforementioned configuration, a number of $12$ samples can be computed concurrently. For more details on load balancing of MLMC samplers, we refer to \cite{Scheichl} Computation of the optimal number of samples per level according to \eqref{eq:nopt} is based on the variances of one finite element node on these levels. The node chosen for this task, is the node with the biggest variance of all the nodes which make up the finite element mesh. This way, the variance constraint is guaranteed to be satisfied for all nodes that constitute the finite element mesh. The first estimation of these variances is done by computing a trial sample set on levels 0, 1 and 2. The size of this sample set is $200$ for the elastic responses and $24$ for the elastoplastic responses. Variances on additional levels are estimated according to the second condition from Theorem \ref{Theorem_1}, following \cite{Giles, Giles2}. These trial samples are not included in the results presenting the number of samples per level. They are, however, included in the total runtime in seconds and the normalized cost of the algorithm. For MC, the number of trial samples taken for the elastic and elastoplastic response is identical as for level 0 in MLMC. As in the MLMC case, these samples will not be included in the tables. \section{Numerical Results} In this section, we discuss our numerical experiments with the MLMC method. We consider the static and dynamic response, using both a homogeneous and a heterogeneous uncertain Young's modulus. First a comparison will be made between the MC method and the MLMC method. Secondly, the rates from Theorem 1 will be estimated. For these first two parts, only the static responses (elastic and elastoplastic) are considered. This is because solutions for the static responses require only one MLMC simulation and one MC simulation for comparison. In contrast, solutions for the dynamic response require multiple individual MLMC simulations and multiple MC simulations: one for each individual frequency of the frequency response function. The third and last part visually presents solutions and their uncertainty. For both static responses, the solutions consist of displacements of the beam in the spatial domain. For the dynamic response, the solution is a frequency response function. All the results have been computed on a workstation equipped with 12 physical (24 logical) cores, Intel Xeon E5645 CPU's, clocked at 2.40 GHz, and a total of 49 GB RAM. \subsection{Comparison between MC and MLMC} \label{par:comparison} First, we compare the efficiency of MLMC and MC for the static elastic and elastoplastic response of the beam clamped at both sides and loaded in the middle as shown in Fig.\,\ref{fig:bean_configurations} (right). For both the elastic and the elastoplastic case, the load is modeled as a distributed load acting on each of the vertical middle nodes of the beam. The sum of all these individual loads is independent of the refinement of the mesh. For the elastic case, the total load equals $10000\,\mathrm{kN}$. For the elastoplastic case, the beam is loaded in steps of $135\,\mathrm{N}$ from $0\,\mathrm{N}$ to $13.5\,\mathrm{kN}$. The quantity of interest is the node with the maximum transversal deflection, which coincidently also corresponds to the node with the largest variance. The coarsest finite element mesh (level 0) consists of 410 degrees of freedom with a square element size of $0.0625\,\mathrm{m}$, while the finest finite element mesh considered (level 4) consists of 83330 degrees of freedom with a square element size of $0.0039\,\mathrm{m}$. The coarsest mesh is chosen so as to discretize the beam in the height by at least four elements. \subsubsection{Elastic Response} Fig.\,\ref{fig:Times} compares the actual simulation time needed to reach a certain tolerance $\epsilon$ on the root mean square error (RMSE) for both standard MC and MLMC, for a homogeneous (left) and heterogeneous uncertain Young's modulus (right). Our MLMC method consistently outperforms the standard MC method, with speedups up to a factor ten or more. In Tab.\,\ref{table:times}, we summarize the results expressed in actual simulation time and in standard cost. For MC, some values of the RMSE have been omitted. This is due to the long computation time, which is of the order of days. Also note that the MC simulation is run at the finest level $L$ of the corresponding MLMC simulation, where $L$ is chosen according to~\eqref{eq:bias_constraint}. This explains the sudden jump in the MC simulation time in Fig.\,\ref{fig:Times} (right). As stated in $\S$\ref{Implementation_aspects}, $200$ samples are taken on the first three levels. The average time needed for this is $35$ seconds in case of a homogeneous Young's modulus and $48$ seconds in case of a heterogeneous Young's modulus. For the lowest listed tolerance of 2.5E-4, the percentage of time used to compute these trial samples amounts to $55$ percent of the total time. For finer tolerances, however, the relative cost of this preparatory work rapidly drops and becomes negligible compared to the cost of the remaining part of the algorithm. For the finest tolerance listed of 2.5E-5, this percentage is below $1$ percent. \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Times_Gam_Dist.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Times_Gam_Field.pdf_tex}}} \end{subfigure} \caption{Actual simulation time in seconds as a function of the desired tolerance on the RMSE applied to the concrete beam clamped at both sides in Fig.\,\ref{fig:bean_configurations} (right) for a homogeneous (left) and heterogeneous (right) Young's modulus, in the elastic domain.} \label{fig:Times} \end{figure} \begin{table}[H] \scalebox{1}{ \begin{tabular}{lllllllll} \toprule \multirow{3}{*}{RMSE [/]} & \multicolumn{4}{c}{Homogeneous Young's modulus} & \multicolumn{4}{c}{Heterogeneous Young's modulus} \\ [0.5ex] \cmidrule(rl{4pt}){2-5} \cmidrule(rl{4pt}){6-9} & \multicolumn{2}{c}{Time [sec]} & \multicolumn{2}{c}{Norm. Cost} & \multicolumn{2}{c}{Time [sec]} & \multicolumn{2}{c}{Norm. Cost}\\ \cmidrule(rl{4pt}){2-3} \cmidrule(rl{4pt}){4-5} \cmidrule(rl{4pt}){6-7} \cmidrule(rl{4pt}){8-9} & MLMC & MC & MLMC & MC & MLMC & MC & MLMC & MC \\ \cmidrule{1-9} 2.5E-4 & 84& 934 & 9.43E3 & 8.79E4 & 86& 227 & 6.91E3 & 1.69E4\\ 7.5E-5 & 514& 9671 & 5.89E4& 9.88E5 & 334& 1578 & 3.49E4 & 1.33E5\\ 5.0E-5 & 1287 & -& 1.34E5& - & 991& 17588 & 1.15E5 & 2.01E6\\ 2.5E-5 & 4650& - & 5.19E5&-& 5244& - & 5.68E5 & - \\ \bottomrule \end{tabular}} \caption{Actual simulation time in seconds and normalized cost for MLMC and MC applied to the concrete beam clamped at both sides in Fig.\,\ref{fig:bean_configurations} (right) for a homogeneous and heterogeneous Young's modulus, in the elastic domain.} \label{table:times} \end{table} \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Samples_Gam_Dist.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Samples_Gam_Field.pdf_tex}}} \end{subfigure} \caption{Total number of samples on each level for different tolerances $\epsilon$ on the RMSE using a homogeneous (left) and heterogeneous (right) Young's modulus for the elastic response.} \label{fig:sample_sizes} \end{figure} \begin{table}[H] \setlength{\tabcolsep}{.16667em} \scalebox{1}{ \begin{tabular}{ccccccccccccccc} \toprule \multirow{5}{*}{RMSE [/]} & \multicolumn{7}{c}{Homogeneous Young's modulus} & \multicolumn{7}{c}{Heterogeneous Young's modulus}\\ \cmidrule(rl{4pt}){2-8} \cmidrule(rl{4pt}){9-15} \multicolumn{1}{c}{} & \multicolumn{6}{c}{MLMC} & \multicolumn{1}{c}{MC} & \multicolumn{6}{c}{MLMC} & \multicolumn{1}{c}{MC}\\ \cmidrule(rl{4pt}){2-7} \cmidrule(rl{4pt}){8-8} \cmidrule(rl{4pt}){9-14} \cmidrule(rl{4pt}){15-15} &\multicolumn{5}{c}{level}&\multirow{1}{*}{equivalent}&\multirow{1}{*}{level}&\multicolumn{5}{c}{level}&\multirow{1}{*}{equivalent}&\multirow{1}{*}{level}\\ &{0} & {1} & {2} & {3} & 4& Max &Max &{0} & {1} &{2} & {3} & {4}&Max & Max \\ [0.5ex] \cmidrule{1-15} 2.5E-4 & 4408 & 56 & 6 & / &/&262 &4651 & 1183 & 202 & 33 & / & /&153& 771\\ 7.5E-5 & 49816 & 635 & 61 & / &/&2697& 49308 & 13477 & 2169 & 370 & / & /&1568& 6750 \\ 5.0E-5 & 116934 & 1446 & 172 & 49 &/&1651& - & 38322 & 5728 & 893 & 180 & /&918& 16700 \\ 2.5E-5 & 464180 & 5393 & 669 & 71 & 7&1091& -&173742 & 27492 & 4412 & 958 & 218&1374& - \\ \bottomrule \end{tabular}} \caption{Number of samples for MLMC and MC for the elastic response.} \label{tab:Samples} \end{table} Fig.\,\ref{fig:sample_sizes} shows the number of samples over the different levels in function of the desired tolerance. Note that the number of samples is decreasing as the level $\ell$ increases, as required. Numerical values for $N_\ell$ are repeated in Tab.\,\ref{tab:Samples}. In order to make a better comparison between the cost of MC and MLMC, we also list, under the column label ``equivalent Max", the equivalent number of samples on the finest level $L$, that is, the number of samples on level $L$ that would yield a cost equal to the MLMC cost without including the cost of the trial samples. These results show a considerably lower sample size in favor of MLMC. Comparing the actual number of samples of MLMC with MC, we notice that when the Young's modulus is homogeneous, the number of samples on the coarsest level in the MLMC simulation is of the same order of magnitude as the number of samples on the finest level $L$ in the MC simulation. This would allow the estimation of the number of samples needed for a MC simulation given the results of a MLMC simulation if required. However, when the Young's modulus is heterogeneous, this number of samples differs. This stems from the fact that on this coarsest level a very rough approximation of the random field is used for the MLMC simulation, while the MC simulation uses a random field corresponding to the finest level of the MLMC simulation. It is thus probable that on the coarsest level, the variability of the random field is not fully and adequately captured. In order to better illustrate this point, the same Gaussian random field is shown in Fig.\,\ref{fig:level_overview} at different resolution levels. As can be seen, a sufficiently high number of points is required to appropriately capture the variability. In order to validate this hypothesis, MLMC simulations with a heterogeneous Young's modulus have been rerun with a finer coarsest level. The results are presented in Tab.\,\ref{tab:Samples_GRF_refinement}. As can be seen from this table, the number of samples of MC is of similar magnitude as the number of samples on the coarsest level of MLMC. \begin{figure}[H] \begin{subfigure}[b]{0.32\textwidth} \scalebox{0.32}{ \makebox[\textwidth]{ \input{Level_0.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.32\linewidth} \centering \scalebox{0.32}{ \makebox[\textwidth]{ \input{Level_1.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.32\linewidth} \hspace{2.5cm} \scalebox{0.32}{ \makebox[\textwidth]{ \input{Level_2.pdf_tex}}} \end{subfigure} \caption{Realizations of a Gaussian random field on level 0 (left), level 1 (middle), level 2 (right). } \label{fig:level_overview} \end{figure} \begin{table}[H] \scalebox{1}{ \begin{tabular}{cc c c c c c} \toprule \multirow{3}{*}{RMSE [/]}& \multicolumn{5}{c}{MLMC} & \multicolumn{1}{c}{MC}\\ \cmidrule(rl{4pt}){2-6} \cmidrule(rl{4pt}){7-7} & \multicolumn{5}{c}{level}& level \\ [0.5ex] & 0 & 1 & 2 & 3 &4 & Max\\ [0.5ex] \cmidrule{1-7} 2.5E-4 & / & 738 & 38 & 10 & /& 649 \\ 7.5E-5 & / & 8628 & 468 & 97 & /& 7178 \\ 5.0E-5 & / & 19477 & 969 & 234 & /& 15947 \\ \bottomrule \end{tabular}} \caption{Number of samples for MLMC and MC for a heterogeneous Young's modulus with a finer coarsest level.} \label{tab:Samples_GRF_refinement} \end{table} \subsubsection{Elastoplastic Response} For the elastic response, the MLMC simulations are level adaptive. The number of extra levels to be added depends on the condition of the bias, \eqref{eq:bias_constraint}. However, for the elastoplastic response we chose to manually set the maximum level. This level is chosen based on a mesh convergence analysis. This is done because for the tolerances considered in Tab.\,\ref{table:times_Plast}, samples would have to be taken on levels up to 5 or more. This would constitute a considerable time cost, which results from the iterative nature of the Finite Element implementation. The results of a mesh convergence study are shown in Fig.\,\ref{fig:mesh_convergence}, respectively for the elastoplastic response (left) and the elastic response (right), with a beam configuration that is clamped at both sides and loaded in the middle. The figures show the transverse deflection of the middle node located on the beam's top layer per level, represented as a full line, and the absolute value of its difference over the levels, represented as a dashed line. Comparing the results for both responses, it shows that for the elastic response the absolute value of the deflection's difference on the finest mesh is much smaller than the one for the elastoplastic response. For the elastoplastic response, the deflection starts stagnating at around level three. Following these results, we thus state that the bias condition for the elastoplastic response is fulfilled at level three; no more than four MLMC levels are used. \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \scalebox{0.45}{ \hspace{-1cm} \makebox[\textwidth]{ \input{Mesh_Convergence_plast.pdf_tex}}} \end{subfigure} \centering \begin{subfigure}[b]{0.45\linewidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Mesh_Convergence_elast.pdf_tex}}} \end{subfigure} \caption{Deflection and difference of the deflection of the beam's top layer middle node for the elastoplastic response (left) and elastic response (right).} \label{fig:mesh_convergence} \end{figure} Fig.\,\ref{fig:Times_plast} lists the actual simulation time needed to reach a user specified tolerance $\epsilon$ on the root mean square error (RMSE) for MLMC for a homogeneous and a heterogeneous Young's modulus for the elastoplatic response, i.e., the steel beam clamped at both sides. These values are presented in Tab.\,\ref{table:times_Plast}. As can be observed, the MLMC simulation outperforms the MC simulation in terms of computational speed and cost. A speedup of up to a factor ten in favor of MLMC is observed. As can be seen in Tab.\,\ref{table:times_Plast}, the costs in case of lower tolerances for MLMC and MC are close together, while for finer tolerances, MLMC is significantly cheaper than MC. As elaborated in $\S$\ref{Implementation_aspects}, $24$ samples are taken on the first three levels in order to obtain an initial estimate for the variances on the coarsest levels. The average time needed for this is $3728$ seconds in case of a homogeneous Young's modulus and $3927$ seconds in case of a heterogeneous Young's modulus. It can be observed that for the lowest tolerance of 2.5E-5 listed here, the percentage of time taken to compute these trial samples is about $33$ percent. For the finest tolerance of 2.5E-6 listed here, this percentage drops below $6$ percent. \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Times_levl_Dist_plast.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Times_levl_Field_plast.pdf_tex}}} \end{subfigure} \caption{Actual simulation time in seconds as a function of the desired tolerance on the $\text{RMSE}$ applied to the steel beam clamped at both sides in Fig.\,\ref{fig:bean_configurations} (right) for a homogeneous (left) and heterogeneous (right) Young's modulus in the elastoplastic domain.} \label{fig:Times_plast} \end{figure} \begin{table}[H] \scalebox{1}{ \begin{tabular}{ccccccccc} \toprule \multirow{3}{*}{$\text{RMSE}$ [/]} & \multicolumn{4}{c}{Homogeneous Young's modulus} & \multicolumn{4}{c}{Heterogeneous Young's modulus} \\ [0.5ex] \cmidrule(rl{4pt}){2-5} \cmidrule(rl{4pt}){6-9} & \multicolumn{2}{c}{Time [sec]} & \multicolumn{2}{c}{Norm. Cost} & \multicolumn{2}{c}{Time [sec]} & \multicolumn{2}{c}{Norm. Cost}\\ \cmidrule(rl{4pt}){2-3} \cmidrule(rl{4pt}){4-5} \cmidrule(rl{4pt}){6-7} \cmidrule(rl{4pt}){8-9} & MLMC & MC & MLMC & MC & MLMC & MC & MLMC & MC \\ \cmidrule{1-9} 2.5E-5 & 11870& 72513 & 1247& 10437 & 12000& 31427 & 1220 & 5732\\ 7.5E-6 & 18415& 868410 & 2810& 183180 & 16869& 192384 & 2014 & 34515\\ 5.0E-6 & 27249 & -& 4915& - & 20854& - & 3182 & -\\ 2.5E-6 & 68047& - & 14089&-& 69641& - & 11241 & - \\ \bottomrule \end{tabular}} \caption{Actual simulation time in seconds and normalized cost for MLMC and MC applied to the steel beam clamped at both sides in Fig.\,\ref{fig:bean_configurations} (right) for a homogeneous and heterogeneous Young's modulus in the elastoplastic domain.} \label{table:times_Plast} \end{table} Fig.\,\ref{fig:sample_sizes_plast} shows again the number of samples over the different levels in function of the desired tolerance. Numerical values are listed in Tab.\,\ref{tab:Samples_plast}. As is the case for the elastic response, the sample size decreases with increasing level. Note that on the finest level, only a few samples are required. For completeness, we need to mention a technical implementation detail. When \eqref{eq:nopt} suggests a value of $N_{\ell}$ equal to or less than 2 on an extra level, i.e., a level greater than 2, our algorithm still enforces a minimal number of 3 samples. This explains the lower limit of 3 samples in Tab.\,\ref{tab:Samples_plast}. As stated before, the parallelization enables the algorithm to compute $12$ samples concurrently. This is highly efficient for levels with a large number of samples, as is the case for coarser levels, and less efficient for finer levels. This is due to the load imbalance in the latter case. \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Samples_Gam_Dist_Plast.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Samples_Gam_Field_Plast.pdf_tex}}} \end{subfigure} \caption{Total number of samples on each level for different tolerances $\epsilon$ on the RMSE using a homogeneous (left) and heterogeneous (right) Young's modulus for the elastoplastic response.} \label{fig:sample_sizes_plast} \end{figure} \begin{table}[H] \setlength{\tabcolsep}{.36667em} \scalebox{1}{ \begin{tabular}{c c c c c c cc c c c c c} \toprule \multirow{5}{*}{$\text{RMSE}$ [/]} & \multicolumn{6}{c}{Homogeneous Young's modulus} & \multicolumn{6}{c}{Heterogeneous Young's modulus}\\ \cmidrule(rl{4pt}){2-7} \cmidrule(rl{4pt}){8-13} \multicolumn{1}{c}{} & \multicolumn{5}{c}{MLMC} & \multicolumn{1}{c}{MC} & \multicolumn{5}{c}{MLMC} & \multicolumn{1}{c}{MC}\\ \cmidrule(rl{4pt}){2-6} \cmidrule(rl{4pt}){7-7} \cmidrule(rl{4pt}){8-12} \cmidrule(rl{4pt}){13-13} &\multicolumn{4}{c}{level}&\multirow{1}{*}{equivalent}&\multirow{1}{*}{level}&\multicolumn{4}{c}{level}&\multirow{1}{*}{equivalent}&\multirow{1}{*}{level}\\ &{0} & {1} & {2} & {3} & 3 &3 &{0} & {1} &{2} & {3} & 3 & 3 \\ [0.5ex] \cmidrule{1-13} 2.5E-5 & 172 & 4 & 3 & 3 &6& 75 & 41 & 5 & 3 & 3 &5& 24 \\ 7.5E-6 & 1371 & 30 & 3 & 3 &15& 1302 & 477 & 58 & 7 & 3 &11& 265 \\ 5.0E-6 & 3293 & 73 & 4 & 3 &33& - & 940 & 123 & 14 & 3 &17& - \\ 2.5E-6 & 11328 & 271 & 7 & 3 &99& -&4111 & 524 & 73 & 18 &90& - \\ \bottomrule \end{tabular}} \caption{Number of samples for MLMC and MC for the elastoplastic response.} \label{tab:Samples_plast} \end{table} \subsection{Rate verification} In this section, we estimate the rates $\alpha$, $\beta$ and $\gamma$ from Theorem 1, first for the static elastic response, then for the static elastoplastic response. \subsubsection{Elastic Response} We list the online estimated rates, i.e., the rates estimated during the run of the algorithm, for various tolerances $\epsilon$ on the RMSE, see Tab.\,\ref{tab:Parameters for the MLMC algorithm}, corresponding to the tolerances considered in Fig.\,\ref{fig:Times}. Following the results in this table, it is possible to estimate the asymptotic cost of the MLMC estimator, using the different regimes from Eq.\,\eqref{eq:Algo_regime}. Since $\beta>\gamma$ in all cases, we expect an optimal cost proportional to $\epsilon^{-2}$. This is indeed what we observed in the numerical experiments in Fig.\,\ref{fig:Times}. \begin{table}[H] \centering \scalebox{1}{ \begin{tabular}{c c c cc c c} \toprule \multirow{3}{*}{RMSE [/]} & \multicolumn{3}{c}{Homogeneous } & \multicolumn{3}{c}{Heterogeneous }\\ & \multicolumn{3}{c}{Young's modulus} & \multicolumn{3}{c}{Young's modulus}\\ \cmidrule(rl{4pt}){2-4} \cmidrule(rl{4pt}){5-7} & $\alpha$ & $\beta$ & $\gamma$ & $\alpha$ & $\beta$ & $\gamma$ \\ [0.5ex] \cmidrule{1-7} 2.5E-4 & 1.97 & 4.38 & 2.09 & 2.18 & 3.22 & 2.03\\ 7.5E-5 & 2.03 & 5.11 & 2.16 & 2.13 & 2.99 & 2.13 \\ 5.0E-5 & 1.88 & 4.03 & 2.10 & 1.86 & 3.08 & 2.30 \\ 2.5E-5 & 1.87 & 3.80 & 2.22 & 1.61 & 3.12 & 2.17 \\ \bottomrule \end{tabular}} \caption{Parameters for the MLMC algorithm.} \label{tab:Parameters for the MLMC algorithm} \end{table} Fig.\,\ref{fig:rates} shows the behavior of the expected value and the variance of the quantity of interest $P_\ell$, and of the difference $P_\ell-P_{\ell-1}$, in case of a tolerance $\epsilon$ equal to 2.5E-5. Note that the mean and the variance of $P_\ell$ over the different levels remains constant while the variance and the mean of the differences between two successive levels continuously decreases. The rates $\alpha$ and $\beta$ can be read off as the slope of the lines labeled with $\triangledown$. In case where the Young's modulus is homogeneous, Fig.\,\ref{fig:rates} (left), the variance corresponding to the finest level is lower than the variance on the previous levels. This phenomenon can be explained by the number of samples on that level, which is used to estimate the variance. Only 7 samples were taken. Taking a higher number of samples on that level would bring the variance to equal the variance of the other levels. \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Rates_stat_gam_dist.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Rates_stat_gam_field.pdf_tex}}} \end{subfigure} \caption{Elastic response rates for a homogeneous (left) and a heterogeneous Young's modulus (right), in case of a tolerance $\epsilon$ equal to 2.5E-5.} \label{fig:rates} \end{figure} \subsubsection{Elastoplastic Response} As for the elastic response, we list the online rates for various tolerances $\epsilon$ on the $\text{RMSE}$ in Tab.\,\ref{tab:Parameters for the MLMC algorithm plast}. For all tolerances, $\beta>\gamma$. \begin{table}[H] \centering \scalebox{1}{ \begin{tabular}{c c c cc c c} \toprule \multirow{3}{*}{$\text{RMSE}$ [/]} & \multicolumn{3}{c}{Homogeneous } & \multicolumn{3}{c}{Heterogeneous }\\ & \multicolumn{3}{c}{Young's modulus} & \multicolumn{3}{c}{Young's modulus}\\ \cmidrule(rl{4pt}){2-4} \cmidrule(rl{4pt}){5-7} & $\alpha$ & $\beta$ & $\gamma$ & $\alpha$ & $\beta$ & $\gamma$ \\ [0.5ex] \cmidrule{1-7} 2.5E-5 & 1.50 & 3.59 & 2.24 & 1.53 & 5.28 & 2.22 \\ 7.5E-6 & 1.50 & 4.81 & 2.26 & 1.51 & 4.21 & 2.17 \\ 5.0E-6 & 1.51 & 9.62 & 2.25 & 1.49 & 4.51 & 2.11 \\ 2.5E-6 & 1.50 & 8.30 & 2.21 & 1.50 & 3.43 & 2.17 \\ \bottomrule \end{tabular}} \caption{Parameters for the MLMC algorithm.} \label{tab:Parameters for the MLMC algorithm plast} \end{table} Fig.\,\ref{fig:rates_plast} shows the behavior of the expected value and the variance of the quantity of interest $P_\ell$, and of the difference $P_\ell-P_{\ell-1}$, in case of a RMSE equal to 2.5E-6. Comparing Fig.\,\ref{fig:rates} with Fig.\,\ref{fig:rates_plast}, one notices that for the elastoplastic response the mean is not perfectly constant over the levels. This slight increase stems from the number of elements used for the discretization; the displacement is indeed dependent upon the discretization of the mesh, Fig.\,\ref{fig:mesh_convergence}, for the mesh sizes considered here. \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Rates_stat_gam_dist_plast.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Rates_stat_gam_field_plast.pdf_tex}}} \end{subfigure} \caption{Elastoplastic response rates for a homogeneous (left) and a heterogeneous Young's modulus (right), in case of a tolerance $\epsilon$ equal to 2.5E-6.} \label{fig:rates_plast} \end{figure} \subsection{Visualization of the solution} In this part, the static response, i.e., the displacement of the beam in the spatial domain, and the dynamic response, i.e., the frequency response functions (FRF), are shown. First, the static elastic response is presented. This consists of a visualization of the transverse displacement of the nodes along the top side of the beam. Secondly, results for the static elastoplastic response will be shown. The results consists of a visualization of a force deflection curve of the middle top side node of the beam. Thirdly and lastly, solutions for the dynamic response are presented. These consist of frequency responses functions for a single node of the finite element mesh. This node is chosen as the one that has the largest variance of all the nodes that make up the mesh. \subsubsection{Static Elastic Response}\label{Sec:Viz_Sta_El} In this part we show the displacement of the concrete beam under a static load including uncertainty bounds in the elastic domain. The beam configuration is a beam clamped at both ends, loaded at mid span, as shown in Fig.\,\ref{fig:bean_configurations} (right). The load is modeled as a distributed load acting on each of the vertical middle nodes of the beam. The force on each node is such that the sum of these forces equals $10000\,\mathrm{kN}$, regardless of the refinement of the mesh. \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Deflection_stat_gam_dist.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Deflection_stat_gam_field.pdf_tex}}} \end{subfigure} \caption{Deflection of the beam for when the Young's modulus is homogeneous (left) and heterogeneous (right).} \label{fig:deflection_total} \end{figure} Fig.\,\ref{fig:deflection_total} shows the deflection of the beam with a homogeneous Young's modulus (left) and with a heterogeneous Young's modulus (right). The full orange line represents the average of the displacement, the dashed orange lines are the 1$\sigma$ bounds equidistant around the average, which are only relevant in case of a Normal distribution. The shades of blue represent the PDF, with the dark blue line corresponding to the most probable value. As can be observed from Fig.\,\ref{fig:deflection_total} (right), the average value and the most probable value of the PDF tend to coincide for the heterogeneous case. Here, the PDF of the displacement closely resembles that of a Normal distribution. This is however not the case when the Young's modulus is homogeneous. Then the distribution of the solution has a non-negligible skewness. The homogeneous Young's modulus case exhibits a larger uncertainty on its displacement due to the fact that the Young's modulus is uncertain for each individual computed sample but uniform in each point for that sample. Averaging all these individual samples gives rise to wider uncertainty bounds. While for the heterogeneous Young's modulus case, each individual computed sample is also uncertain but non-uniform; in each individual point the value for the Young's modulus is different. This means that in different locations of the beam the Young's modulus will be different. These locations will tend to compensate each other so that beam does not become overly stiff or weak. Fig.\,\ref{fig:indiv_samples_elast} shows ten samples in case of a homogeneous Young's modulus (left) and a heterogeneous Young's modulus (right). \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \scalebox{0.44}{ \makebox[\textwidth]{ \input{Real_Gam_Dist_stat_el.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \centering \scalebox{0.44}{ \makebox[\textwidth]{ \input{Real_Gam_Field_stat_el.pdf_tex}}} \end{subfigure} \caption{Ten different deflection samples for when the Young's modulus is homogeneous (left) and heterogeneous (right).} \label{fig:indiv_samples_elast} \end{figure} \begin{figure}[H] \begin{subfigure}[b]{0.54\linewidth} \centering \scalebox{0.35}{ \makebox[\textwidth]{ \input{Interm_Deflection_stat_gam_dist.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.45\textwidth} \centering \scalebox{0.35}{ \makebox[\textwidth]{ \input{Interm_Deflection_stat_gam_dist_cut_1.pdf_tex}}} \end{subfigure} \caption{Visualization of the PDF when the Young's modulus is homogeneous, beam displacement (left), AB cut-through (right).} \label{fig:Construction of the PDF Gam Dist} \end{figure} \begin{figure}[H] \begin{subfigure}[b]{0.54\linewidth} \centering \scalebox{0.35}{ \makebox[\textwidth]{ \input{Interm_Deflection_stat_gam_field.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.45\textwidth} \centering \scalebox{0.35}{ \makebox[\textwidth]{ \input{Interm_Deflection_stat_gam_field_cut_1.pdf_tex}}} \end{subfigure} \caption{Visualization of the PDF when the Young's modulus is heterogeneous, beam displacement (left), AB cut-through (right).} \label{fig:Construction of the PDF Gam Field} \end{figure} Fig.\,\ref{fig:Construction of the PDF Gam Dist} and Fig.\,\ref{fig:Construction of the PDF Gam Field} show a cut-through in order to better illustrate how the shades of blue represent the PDF. \subsubsection{Static Elastoplastic Response} The solution is presented as a force deflection curve, Fig.\,\ref{fig:deflection_total_plast}. The beam configuration is the same as for the static elastic response but with a different material; a steel beam clamped at both sides loaded at mid span, Fig.\,\ref{fig:bean_configurations} (right). The load is modeled in the same way as for the static elastic response. The beam is loaded from $0\,\mathrm{N}$ to $13.5\,\mathrm{kN}$ in steps of $135\,\mathrm{N}$. \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Plast_dist_sol.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \centering \scalebox{0.45}{ \makebox[\textwidth]{ \input{Plast_field_sol.pdf_tex}}} \end{subfigure} \caption{Force deflection curve of the steel beam for when the Young's modulus is homogeneous (left) and heterogeneous (right).} \label{fig:deflection_total_plast} \end{figure} The line style and color convention is the same as for the static elastic response. As can be observed, the uncertainty bounds in case of a homogeneous Young's modulus, Fig.\,\ref{fig:deflection_total_plast} (left) are wider and more spread out than in case of a heterogeneous modulus (right). This behavior corroborates with the ones from the static elastic response. In Fig.\,\ref{fig:indiv_samples_plast}, ten individual samples are shown for a homogeneous Young's modulus (left) and a heterogeneous Young's modulus (right). Comparing these two sets of figures, it shows that, the deflection corresponding to the highest applied force in Fig.\,\ref{fig:indiv_samples_plast} (left and right) is less than the deflection shown in Fig.\,\ref{fig:deflection_total_plast} (left and right). This stems from the fact that these ten samples per Young's modulus are generated on the coarsest mesh. These results illustrate even better the power of the MLMC method; even whilst taking most of the samples on coarser meshes, one still gets the result as if the simulation was run on the finest mesh. \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \scalebox{0.44}{ \makebox[\textwidth]{ \input{Indiv_Samples_Dist.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \centering \scalebox{0.44}{ \makebox[\textwidth]{ \input{Indiv_Samples_Field.pdf_tex}}} \end{subfigure} \caption{Ten different force deflection curve samples for when the Young's modulus is homogeneous (left) and heterogeneous (right).} \label{fig:indiv_samples_plast} \end{figure} \subsubsection{Dynamic Elastic Response} For the dynamic elastic response, the solution is a frequency response function (FRF). The beam configuration we consider is a concrete cantilever beam clamped on the left side and loaded on the right side, as shown in Fig.\,\ref{fig:bean_configurations} (left), with a dynamic load. The load is modeled in the same way as for the static elastic response with the same magnitude. In order to ensure the correct representation of the dynamic response, and to determine the minimum number of finite elements required, the bending wavelength, $\lambda_{\mathrm{min}}$, must be evaluated as \begin{linenomath*} \begin{equation} \lambda_{\mathrm{min}} = \sqrt{\dfrac{2 \pi}{f_{\mathrm{max}}}} \sqrt[4]{\dfrac{E I}{\rho A}}, \label{eq:MinElements} \end{equation} \end{linenomath*} with $E$ the mean Young's modulus, $I$ the moment of inertia, $A$ the area, $\rho$ the density, $f_{\mathrm{max}}$ the highest simulated frequency, and $\lambda_{\mathrm{min}}$ the smallest obtained wavelength for the highest input frequency. For the considered beam configuration, it has been checked that at least six elements are used to represent the wavelength on the coarsest grid for the highest simulated frequency, which in this case is 400 Hz. \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \scalebox{0.46}{ \makebox[\textwidth]{ \input{DynRes_cantilever_Gam_Dist.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \centering \scalebox{0.43}{ \makebox[\textwidth]{ \input{DynRes_cantilever_Gam_Field.pdf_tex}}} \end{subfigure} \caption{Dynamic Responses of the beam for when the Young's modulus is homogeneous (left) and heterogeneous (right).} \label{fig:dynamic_total} \end{figure} The FRF results are presented in Fig.\,\ref{fig:dynamic_total}. As was the case for the static elastic and elastoplastic response, the shades of blue represent the PDF, with the blue line being the most probable value, and the orange line the average value. As can be observed, the uncertainty bounds for the FRF are wider and more spread out when the Young's modulus is homogeneous, Fig.\,\ref{fig:dynamic_total} (left), as opposed to a heterogeneous Young's modulus, Fig.\,\ref{fig:dynamic_total} (right). This discrepancy is due to the fact that in case of a homogeneous Young's modulus, the resonance frequency will be shifted for each different sample. Averaging all these samples gives rise to a broad and wide uncertainty bound. In case of a heterogeneous Young's modulus, the different samples compensate each other, in analogy with the explanation given in $\S$\ref{Sec:Viz_Sta_El}. This gives rise to much smaller uncertainty bounds. Fig.\,\ref{fig:dynamic_samples} shows the resulting FRF for ten realizations. \begin{figure}[H] \begin{subfigure}[b]{0.54\textwidth} \centering \scalebox{0.44}{ \makebox[\textwidth]{ \input{Real_Gam_Dist.pdf_tex}}} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \centering \scalebox{0.44}{ \makebox[\textwidth]{ \input{Real_Gam_Field.pdf_tex}}} \end{subfigure} \caption{Ten different FRF samples for when the Young's modulus is homogeneous (left) and heterogeneous (right).} \label{fig:dynamic_samples} \end{figure} An important inequality that must hold for MLMC to work well is \begin{linenomath*} \begin{equation} \V[P_1-P_0] \ll \V[P_1]. \label{eq:Variance_ineq} \end{equation} \end{linenomath*} It has been observed empirically that \eqref{eq:Variance_ineq} is not necessarily fulfilled for resonance frequencies and frequencies close by those resonance frequencies for the dynamic elastic response in case of a heterogeneous Young's modulus. The reason for this phenomenon appears to be closely linked to the resolution of random fields on the different levels, as discussed in \S \ref{par:comparison}. In order to remedy to this, we use the following strategy. Using a small number of samples, the magnitude of $\V[P_1] - \V[P_1-P_0]$ is estimated. When the estimation is below a certain threshold $T$, the coarsest level is discarded and the algorithm is started on a finer mesh. We write this condition in a $\log_2$ base, in order not to lose consistency with Fig.\,\ref{fig:rates}, which depict the rates in a $\log_2$ base. The estimation after simplification is written as \begin{linenomath*} \begin{equation} \log_2\left(\dfrac{\V[P_1]}{\V[P_1-P_0]}\right) > \log_2{T}. \label{eq:tresh} \end{equation} \end{linenomath*} For the experiments reported here, we selected the right-hand side of \eqref{eq:tresh} heuristically to be equal to $2.3$. \section{Conclusion} In this work, it has been demonstrated that the Multilevel Monte Carlo method provides a significant computational cost reduction and speedup compared to the standard Monte Carlo method for computing the stochastics of the response in a structural engineering problem. This has been shown by means of actual computing times and normalized computational costs. Speedups are typically of the order of a factor ten for moderate accuracies and can be even much higher for higher accuracies. In addition, figures depicting the static elastic, the static elastoplastic and the dynamic elastic response have been presented with uncertainty bounds. To model the uncertainty in the Young's modulus, we considered both a homogeneous model, represented by a single random variable, and a heterogeneous model, modeled by means of a random field. We observed that the nature of the uncertainty in the Young's modulus has a big impact on the uncertainty characteristics of the simulation results. For the homogeneous Young's modulus, the variance in the solution is larger than for the heterogeneous Young's modulus. This is apparent from the wider and more spread out uncertainty bounds in $\S$\ref{Sec:Viz_Sta_El}. Hence, for realistic applications, the appropriate choice of the uncertainty model is of great importance. Further paths of research will focus on ways to exploit the similarities between the responses for neighboring frequencies and to couple the Finite Element solvers with an existing Multilevel/Multi-index framework \cite{PJ,PJ2}. \section*{Acknowledgements} This research was funded by project IWT/SBO EUFORIA: ``Efficient Uncertainty quantification For Optimization in Robust desgn of Industrial Applications" (IWT-140068) of the Agency for Innovation by Science and Technology, Flanders, Belgium. The authors gratefully acknowledge the support from the research council of KU Leuven though the funding of project C16/17/008 ``Efficient methods for large-scale PDE-constrained optimization in the presence of uncertainty and complex technological constraints". The authors also would like to thank the Structural Mechanics Section of the KU Leuven and Jef Wambacq for supplying their StaBIL code and providing support. \section*{References}
\section{Introduction} Singular cycle (generally refers to a homoclinic orbit connecting a singularity to itself, or a heteroclinic cycle connecting different singular elements at least one of which is a singularity\cite{Ara2010Three}) is one of the most important mechanisms leading to complicated dynamic behaviors and bifurcations \cite{Shilnikov2001Methods,Wiggins1990Introduction,Homburg2010Homoclinic,Liang2012Limit,Wei2015Limit}. For example, the well known Shil'nikov theory \cite{Shilnikov2001Methods,Wiggins1990Introduction} shows that the existence of singular cycles involved only in equilibrium points implies the existence of a countable number of chaotic invariant sets under some conditions. In addition, another type of singular cycle connecting a saddle equilibrium point and a saddle periodic orbit can generate a so-called singular horseshoe, which means the existence of a non-uniformly hyperbolic chaotic invariant set, and is the basis for the theoretical study of the geometrical Lorenz model\cite{Ara2010Three,Guckenheimer1979Structural,Carrasco2010One,Labarca1986Stability} motivated from the study of the famous Lorenz attractor \cite{Lorenz2004Deterministic,Afra1977Origin,Tucker1999The}.\\ \indent Although theoretical importance of singular cycles, it is very difficult to prove the existence of the singular cycles for a concrete smooth system, which is always a meaningful topic for many years \cite{BO1994CONSTRUCTING, Deng2002Food,Tigan2011Analytical,Leonov2012General,Leonov2014Fishing}. Consequently, it is interesting to find some concrete systems possessing the singular cycles.\\ \indent Due to the wide applications, the dynamics in piecewise smooth have received much attention recently \cite{leine2013dynamics,bernardo2008piecewise,llibre2003existence,llibre2013existence,wang2018existence1,wang2018existence}. By using the piecewise smooth models, the existence of some types of singular cycles involved only in equilibrium points were proved by studying the spatial location relationship between the (un)stable manifolds of the subsystems and the switching manifold, based on which some important results of the Shil'nikov theory have been generalized and upgraded to the piecewise smooth systems, see \cite{Huan2012Chaos,Wang2017Heteroclinic,Wu2016Chaos,Song2014Existence}. \\ \indent In this paper, we will study the existence of singular cycles involved in saddle periodic orbits in a class of piecewise smooth systems. In more detail, two types of such singular cycles are investigated: one is the heteroclinic cycle connecting a saddle point with only real eigenvalues and a saddle periodic orbit, and the other is the heteroclinic cycle connecting a saddle-focus point and a saddle periodic orbit. In particular, for each type of singular cycles, we obtain the sufficient conditions under which there exists only one heteroclinic cycle or only two heteroclinic cycles. At last, some examples are given to illustrate our main results.\\ \indent The rest of this paper is organized as follows. Section 2 introduces the considered systems and two main results of this paper. Section 3 gives some lemmas. Sections 4 shows in detail the proofs of the main results in Section 2. Section 5 presents some examples to illustrate the main results. Section 6 gives some further conclusions. \section{Systems and Main results: Existence of heteroclinic cycles connecting a periodic orbit and an equilibrium} Consider the following systems: \begin{eqnarray}\label{M1} \dot{\mathbf{x}}=\left\{\begin{array}{l} (A-\textup{diag}(x_1^2+x_2^2,x_1^2+x_2^2,0))\mathbf{x}, ~~ \textup{if}~~\textbf{c}^T\mathbf{x}\leq d\\ B(\mathbf{x}-\textbf{q}),~~~~~~~\textup{if}~~ \textbf{c}^T\mathbf{x}>d \end{array}\right., \end{eqnarray} where $\mathbf{x}=(x_1, x_2,x_3)^T\in \mathbb{R}^3$ is a vector of state variables, $d\in \mathbb{R}^+$ is a constant$, \textbf{q}=(q_1,q_2,q_3)^T\in\mathbb{R}^3$, $\textbf{c}=(1,0,1)^T\in\mathbb{R}^3$, and \begin{eqnarray*} A=\left( \begin{array}{ccc} \rho &-\omega &0\\ \omega & \rho& 0\\ 0 & 0& \mu \end{array}\right),~B=\left( \begin{array}{ccc} b_{11} &b_{12} &0\\ b_{21} & b_{22}& 0\\ 0 & 0& \lambda \end{array}\right) \end{eqnarray*} with $\rho\in \mathbb{R}^+$, $\omega\in \mathbb{R}^+$, $\mu\in \mathbb{R}^+$, $\lambda\in \mathbb{R}^+$ and $b_{ij}\in \mathbb{R}(i,j=1,2)$. Moreover, matrix $B$ satisfies the following hypotheses\\ $~~~~~$\emph{(H1) the eigenvalues of $B$: $\lambda_{1,2}<0$ and $\lambda>0$,}\\ or \emph{(H2) the eigenvalues of $B$: $\alpha\pm \beta i$ and $\lambda$ where $\alpha<0$, $\beta>0$ and $\lambda>0$}; \\ and matrix $A$ and $\mathbf{q}$ satisfy the following hypothesis \\ $~~~~~$\emph{(H3) $0<\sqrt{\rho}<d,~\textbf{c}^T\mathbf{q}>d, ~q_1=d.$} \\ \indent For convenience, we give some notations in the following. Denote by \begin{eqnarray*}\label{subflow} \phi_A(t,\cdot) ~~\textup{and}~~\phi_B(t,\cdot) \end{eqnarray*} the flows generated by the left subsystem \begin{eqnarray}\label{M2} \dot{\mathbf{x}}= (A-\textup{diag}(x_1^2+x_2^2,x_1^2+x_2^2,0))\mathbf{x}, ~x\in \mathbb{R}^3 \end{eqnarray} and right subsystem \begin{eqnarray}\label{M3} \dot{\mathbf{x}}= B(\mathbf{x}-\textbf{q}),~x\in \mathbb{R}^3 \end{eqnarray} respectively. Obviously, $\mathbf{q}$ is the only saddle equilibrium of (\ref{M3}) with its stable manifold and unstable manifold being \begin{eqnarray}\label{smq} W^s(\mathbf{q})=\{\mathbf{x}\in \mathbb{R}^3|x_3=q_3\}, W^u(\mathbf{q})=\{\mathbf{x}\in \mathbb{R}^3|x_1=q_1,x_2=q_2\}, \end{eqnarray} respectively. Furthermore, by the general polar coordinates transformation to $x_1$ and $x_2$, i.e., \begin{eqnarray}\label{vand} x_1=rcos\theta,x_2=rsin\theta, \end{eqnarray} (\ref{M2}) can be transformed to \begin{eqnarray*} \left\{\begin{array}{l} \dot{r}=r(\rho-r^2)\\ \dot{\theta}=\omega\\ \dot{x_3}=\mu x_3\\ \end{array}\right.. \end{eqnarray*} Let \begin{eqnarray}\label{Upsilon} \Upsilon=\{(x_1,x_2,x_3)\in \mathbb{R}^3|x_1^2+x_2^2=\rho,x_3=0\}. \end{eqnarray} From the classical results related to the Van der Pol oscillator \cite{Wiggins1990Introduction, Holmes1977Bifurcations} (refer the analysis for (\ref{S3}) below in Section 3), it is not hard to see that $\Upsilon$ is the only saddle periodic orbit of (\ref{M2}) with its stable manifold and unstable manifold being \begin{eqnarray}\label{smUpsilon} W^s(\Upsilon)=\{0\neq\mathbf{x}\in \mathbb{R}^3|x_3=0\}, W^u(\Upsilon)=\{\mathbf{x}\in\mathbb{R}^3|x_1^2+x^2_2=\rho\}, \end{eqnarray} respectively.\\ \indent For simplifying further statements, let \begin{eqnarray} \Sigma=\{\mathbf{x}\in \mathbb{R}^3|\mathbf{c}^T\mathbf{x}=d\}, \Sigma^-=\{\mathbf{x}\in \mathbb{R}^3|\mathbf{c}^T\mathbf{x}<d\}, \Sigma^+=\{\mathbf{x}\in \mathbb{R}^3|\mathbf{c}^T\mathbf{x}>d\},\label{Sigma1}\\ \mathbf{p}_0=(\sqrt{\rho},0,d-\sqrt{\rho})^T\in \Sigma,~~ \mathbf{p}_1=(-\sqrt{\rho},0,d+\sqrt{\rho})^T\in \Sigma ,~~\mathbf{q}_0=(d,q_2,0)^T\in \Sigma,\label{Sigma2}\\ L_1=\{\mathbf{x}\in \mathbb{R}^3|x_1=d,x_3=0\}\subset \Sigma,~~ L_2=\{\mathbf{x}\in \mathbb{R}^3|x_1=d-q_3,x_3=q_3\}\subset \Sigma,\label{Sigma3}\\ \sigma_{\pm}=\frac{-\omega\pm\sqrt{\omega^2- 4d^2(d^2-\rho)}}{2d},\mathbf{v}_1=(d,\sigma_+,0)^T\in L_1,\label{Sigma4}\\ \mathbf{x}_-=\frac{d-\mathbf{c}^T\mathbf{q}}{\mathbf{c}^TB^{-1}\mathbf{c}^\bot} B^{-1}\mathbf{c}^\bot+\mathbf{q }~~\textup{with}~~\mathbf{c}^\bot=(0,1,0)^T.\label{Sigma5} \end{eqnarray} It is readily achieved that $\mathbf{c}^T\mathbf{x}_-=d$. Thus $$\mathbf{x}_-\in \Sigma.$$ From (H3), it is easy to see that \begin{center} $\mathbf{q}\in \Sigma^+$ and $\Upsilon\subset \Sigma^+$, \end{center} which shows $\mathbf{q}$ and $\Upsilon$ are respectively the admissible saddle equilibrium and admissible saddle periodic orbit of (\ref{M1}). Moreover, denote the closed line segment and the open line segment between $\mathbf{x}_1$ and $\mathbf{x}_2$ by $[\mathbf{x}_1,\mathbf{x}_2]$ and $(\mathbf{x}_1,\mathbf{x}_2)$ for any $\mathbf{x}_1,\mathbf{x}_2\in \mathbb{R}^3$ (or $\mathbb{R}^2$), respectively, i.e., \begin{eqnarray*}\label{M4} \begin{aligned}~~[\mathbf{x}_1,\mathbf{x}_2]=\{\mathbf{x}|\mathbf{x}=\lambda\mathbf{x}_1+(1-\lambda) \mathbf{x}_2, 0\leq\lambda\leq1\},\\ (\mathbf{x}_1,\mathbf{x}_2)=\{\mathbf{x}|\mathbf{x}=\lambda\mathbf{x}_1+(1-\lambda) \mathbf{x}_2, 0<\lambda< 1\}. \end{aligned} \end{eqnarray*} And let \begin{eqnarray}\label{bkbb} [\mathbf{x}_1,\mathbf{x}_2)=[\mathbf{x}_1,\mathbf{x}_2]-\{\mathbf{x}_2\},(\mathbf{x}_1,\mathbf{x}_2]=[\mathbf{x}_1,\mathbf{x}_2]-\{\mathbf{x}_1\}. \end{eqnarray} \indent Two main results on the existence of heteroclinic cycles connecting $\Upsilon$ and $\mathbf{q}$ can be presented in the following two theorems, which will be proved in Section 4. \begin{theorem} For system (\ref{M1}) with hypotheses (H1) and (H3). \begin{enumerate}[(i)] \item When $d^2-\rho\geq \frac{\omega^2}{4d^2}$. \begin{enumerate}[a)] \item if $q_3=d-\sqrt{\rho}$ and $\mathbf{c}^TB(\mathbf{p}_0-\mathbf{q})\geq0$, then there exists only one heteroclinic cycle connecting $\Upsilon$(see (\ref{Upsilon})) and $\mathbf{q}$; \item if $q_3=d+\sqrt{\rho}$ , $\omega^2\rho<\mu^2(d^2-\rho)$ and $\mathbf{c}^TB(\mathbf{p}_1-\mathbf{q})\geq0$, there exists only one heteroclinic cycle connecting $\Upsilon$ and $\mathbf{q}$; \item if $q_3\in (d-\sqrt{\rho}, d+\sqrt{\rho})$, $\omega^2\rho<\mu^2(d^2-\rho)$ and $\mathbf{c}^TB(\mathbf{p}_\pm-\mathbf{q})\geq0$, where $\mathbf{p}_\pm=(d-q_3,\pm\sqrt{\rho-(d-q_3)^2},q_3)$, then there exist only two heteroclinic cycles each of which connects $\Upsilon$ and $\mathbf{q}$. \end{enumerate} \vspace{2mm} \item When $0<d^2-\rho<\frac{\omega^2}{4d^2}$.\\ Then the flow $\phi_A(t,\mathbf{v}_1)$ will intersect with $L_1$ under negative flight time, where $\mathbf{v}_1\in L_1$ is given in (\ref{Sigma4}). Denote by $\mathbf{v}^*=(d,v^*_2,0)^T\in L_1$ the first intersection of $\phi_A(t,\mathbf{v}_1)$ and $\mathbf{v}_1$ under negative flight time.\\ Additionally, suppose that the following two conditions hold \begin{enumerate}[1)] \item if $v^*_2>\sigma_+$, then $q_2\in [\sigma_+,v^*_2]$,\item if $v^*_2<\sigma_-$, then $q_2 \in (\infty,- v^*_2]\cup [\sigma_+,+\infty)$, \end{enumerate} \noindent where $\sigma_{\pm}$ is given by (\ref{Sigma4}). Then, the three conclusions in a), b) and c) in (i) above still hold. \end{enumerate} \end{theorem} \begin{theorem} For system (\ref{M1}) with hypotheses (H2) and (H3), then $\phi_B(t,\mathbf{x}_-)$ must intersect with $L_2$ under negative flight time, where $\mathbf{x}_1$ and $L_2$ are defined as (\ref{Sigma5}) and (\ref{Sigma3}) respectively. Denote by $\mathbf{x}_+$ the first intersection of the flow $\phi_B(t,\mathbf{x}_-)$ and $L_2$ under negative flight time. \begin{enumerate}[(i)] \item When $d^2-\rho\geq \frac{\omega^2}{4d^2}$. \begin{enumerate}[a)] \item if $q_3=d-\sqrt{\rho}$ and $\mathbf{p}_0\in [\mathbf{x}_-,\mathbf{x}_+)$, then there exists only one heteroclinic cycle connecting $\Upsilon$ and $\mathbf{q}$; \item if $q_3=d+\sqrt{\rho}$, $\omega^2\rho<\mu^2(d^2-\rho)$ and $\mathbf{p}_1\in [\mathbf{x}_-,\mathbf{x}_+)$, there exists only one heteroclinic cycle connecting $\Upsilon$ and $\mathbf{q}$; \item if $q_3\in (d-\sqrt{\rho}, d+\sqrt{\rho})$, $\omega^2\rho<\mu^2(d^2-\rho)$ and $\mathbf{p}_\pm\in [\mathbf{x}_-,\mathbf{x}_+),$ where \begin{eqnarray}\label{p+-} \mathbf{p}_\pm=(d-q_3,\pm\sqrt{\rho-(d-q_3)^2},q_3), \end{eqnarray} there exists only two heteroclinic cycle each of which connects $\Upsilon$ and $\mathbf{q}$. Here $[\mathbf{x}_-,\mathbf{x}_+)$ is defined as (\ref{bkbb}). \end{enumerate} \vspace{2mm} \item When $0<d^2-\rho<\frac{\omega^2}{4d^2}$.\\ Then the flow $\phi_A(t,\mathbf{v}_1)$ will intersect with $L_1$ under negative flight time. Denote by $\mathbf{v}^*=(d,v^*_2,0)^T\in L_1$ the first intersection of $\phi_A(t,\mathbf{v}_1)$ and $\mathbf{v}_1$ under negative flight time.\\ Additionally, suppose that the following two conditions hold \begin{enumerate}[1)] \item if $v^*_2>\sigma_+$, $q_2\in [\sigma_+,v^*_2]$, \item if $v^*_2<\sigma_-$, $q_2 \in (\infty,- v^*_2]\cup [\sigma_+,+\infty)$, \end{enumerate} then the three conclusions a), b) and c) in (i) still hold. \end{enumerate} \end{theorem} \indent To accomplish the proof of Theorem 1 and Theorem 2, we need some preliminaries in Section 3. \section{Preliminaries: some important lemmas in planar smooth systems} \subsection{An interesting result on the classical van der Pol oscillator} Considering the classical van der Pol oscillator \begin{eqnarray}\label{S1} \dot{\mathbf{x}}=(A_0-||\mathbf{x}||^2I)\mathbf{x}, \end{eqnarray} where $\mathbf{x}=(x_1,x_2)^T\in \mathbb{R}^2$, $A_0=\left( \begin{array}{cc} \rho &-\omega\\ \omega & \rho \end{array}\right)$ with $\rho>0$ and $\omega>0$, $||\mathbf{x}||=\sqrt{x_1^2+x_2^2}$ and $I$ denotes the identity matrix of order 2.\\ \indent For $\textbf{\textup{x}}_0\in \mathbb{R}^2$, denote by $O(\textbf{\textup{x}}_0)$, $O_+(\textbf{\textup{x}}_0)$ and $O_-(\textbf{\textup{x}}_0)$ the whole orbit, the positive semi-orbit and the negative semi-orbit of $\textbf{\textup{x}}_0$, respectively, i.e., \begin{center} $O(\textbf{\textup{x}}_0)=\{\varphi(t,\textbf{\textup{x}}_0)|t\in \mathbb{R}\},~O_+(\textbf{\textup{x}}_0)=\{\varphi(t,\textbf{\textup{x}}_0)|t>0\}$ and $O_-(\textbf{\textup{x}}_0)=\{\varphi(t,\textbf{\textup{x}}_0)|t<0\},$ \end{center} where $\varphi(t,\cdot)$ denotes the flow generated by (\ref{S1}). Let $$L=\{\textbf{\textup{x}}\in \mathbb{R}^2|x_1=k\}$$ with $k>0$. Then, $L$ is perpendicular to $x_1$-axis, does not pass through the origin and divides the plane into three disjoint subsets $L$, $L_+$ and $L_-$, where $$L_+=\{\textbf{\textup{x}}\in \mathbb{R}^2|x_1>k\},L_-=\{\textbf{\textup{x}}\in \mathbb{R}^2|x_1<k\}.$$ Obviously, the origin is in $L_{-}$. In addition, let \begin{eqnarray}\label{varrho} \varrho_{\pm}=\frac{-\omega\pm\sqrt{\omega^2- 4k^2(k^2-\rho)}}{2k}. \end{eqnarray} \textbf{Lemma 1}. \begin{enumerate}[(i)] \item\emph{When} $k^2-\rho\geq \frac{\omega^2}{4k^2}$. \begin{center} $O_+(\mathbf{x})\subset L_-$ \emph{for any} $\mathbf{x}\in L$. \end{center} \item \emph{When} $0<k^2-\rho<\frac{\omega^2}{4k^2}$.\\ \emph{Let} \begin{eqnarray*}\label{S4} \mathbf{u}_1=(k,\varrho_+), \mathbf{u}_2=(k,\varrho_-), \end{eqnarray*} then $O_-(\mathbf{u}_1)$ must intersect with $L$. \emph{Denote by} $\mathbf{x}^*=(k,x^*_2)^T\in L$ \emph{the first intersection of the flow} $\varphi(t,\mathbf{u}_1)$ \emph{under negative flight time and} $L$.\\ $\textup{a)}$ \emph{If }$x^*_2>\varrho_+$, \emph{then} $$O_+(\mathbf{x})\subset L_-\cup L \Leftrightarrow \mathbf{x}\in [\mathbf{x}^*, \mathbf{u}_1],~ \textup{for}~~ \mathbf{x}\in L$$ and $$ O_+(\mathbf{x})\subset L_- \Leftrightarrow \mathbf{x}\in (\mathbf{x}^*, \mathbf{u}_1],~ \textup{for}~~ \mathbf{x}\in L.$$ $\textup{b)}$ \emph{If} $x^*_2<\varrho_-$, \emph{then} $$O_+(\mathbf{x})\subset L_-\cup L\Leftrightarrow \mathbf{x}\in L-(\mathbf{u}_1,\mathbf{x}^*),~ \textup{for}~~ \mathbf{x}\in L$$ and $$O_+(\mathbf{x})\subset L_-\Leftrightarrow \mathbf{x}\in L-(\mathbf{u}_1,\mathbf{x}^*],~ \textup{for}~~ \mathbf{x}\in L.$$ \end{enumerate} \textbf{Proof.} In $L$, the points at which the sector field is tangent to $L$ must meet the following equations on $\mathbf{x}$. \begin{eqnarray*} \left\{\begin{array}{l} x_1=k\\ \rho x_1-\omega x_2-x_1(x_1^2+x_2^2)=0 \end{array}\right., \end{eqnarray*} then, \begin{eqnarray}\label{S2} k x_2^2+\omega x_2+k(k^2-\rho)=0. \end{eqnarray} \noindent\textbf{ Case (i):} When $k^2-\rho\geq\frac{\omega^2}{4k^2}$.\\ \indent This case is trivial. In fact, since $\dot{x}_1=-kx_2^2-\omega x_2+k(\rho-k^2)\ \leq 0$ in $L$, the vector field in $L$ either points to the interior of $L_-$ or is tangent to $L$ at only one point (i.e., $(k,\frac{-\omega}{2k})^T)$. Hence, for any $\mathbf{x}\in L$, $O_+(\mathbf{x})\subset L_-$.\\\\ \noindent \textbf{Case (ii)}: When $0<k^2-\rho<\frac{\omega^2}{4k^2}$.\\ \indent In the case, $\varrho_\pm$ defined by (\ref{varrho}) are just two negative real roots of (\ref{S2}). Thus, $\mathbf{u}_{1}$ and $\mathbf{u}_{2}$ are the only two points in $L$ at which the vector fields are tangent to $L$, and divide $L$ into the following three segments: $ L_{u}, L_m, L_d$ (see Figs \ref{fig1}, \ref{fig2}) where $$L_{u}=\{(x_1,x_2)^T\in L|x_2>\varrho_+\},L_{m}=\{(x_1,x_2)^T\in L|\varrho_-<x_2<\varrho_+\},L_{d}=\{(x_1,x_2)^T\in L|x_2<\varrho_-\}.$$ Obviously $L=L_{u}\cup {\mathbf{u}_1}\cup L_m\cup{\mathbf{u}_2} \cup L_d$. Now we analyse the directions of vector fields of (\ref{S1}) at $L_u,L_m,L_d$ respectively.\\ \indent 1) Provided $(x_1,x_2)^T \in L_u$.\\ \indent Since $x_2>\varrho_+$, we have $\dot{x}_1=-kx^2_2-\omega x_2-k(k^2-\rho)<0$ by the general nature of quadratic function, which shows that in $L_u$ the vector field of system (\ref{S1}) must be transverse to the direction of $L$ and point to the interior of $L_-$, see Figure \ref{fig1}. \\ \indent 2) Provided $(x_1,x_2)^T \in L_m$.\\ \indent Since $\varrho_-<x_2<\varrho_+$, $\dot{x}_1=-kx^2_2-\omega x_2-k(k^2-\rho)>0$ in $L_m$. Therefore, in $L_m$ the vector field of (\ref{S1}) must be transverse to the direction of $L$ and point to the interior of $L_+$, see Figure \ref{fig1}.\\ \indent 3) Provided $(x_1,x_2)^T \in L_d$.\\ \indent Similarly, it can be readily got that in $L_u$ the vector field of (\ref{S1}) is transverse to the direction of $L$ and point to the interior of $L_-$, see Figure \ref{fig1}.\\ \indent From the discussions in 1), 2) and 3), it follows that $\varphi(t,\mathbf{u}_1)\in L_-$ and $\varphi(t,\mathbf{u}_2)\in L_+$ for small $t\neq 0$ . \\ \begin{figure}[!htbp] \renewcommand{\figurename}{Fig.} \begin{minipage}{0.25\textwidth} \caption{An illustration for the directions of the vector fields in $L_u, L_m$ and $L_d$, which are represented by the gray short directed line segments passing through $L$. And an illustration for the the proof of subcase a) in Case (ii).}\label{fig1} \end{minipage} \hspace{0cm} \begin{minipage}{0.75\textwidth} \includegraphics[width=14cm]{figtest.eps} \end{minipage} \end{figure} \begin{figure}[!htbp] \renewcommand{\figurename}{Fig.} \begin{minipage}{0.25\textwidth} \caption{an illustration for the the proof of subcase b) in Case (ii). Here the gray short directed line segments passing through $L$ represents the directions of vector field in $L$.}\label{fig2} \end{minipage} \hspace{0cm} \begin{minipage}{0.75\textwidth} \includegraphics[width=12cm]{fig_2.eps} \end{minipage} \end{figure} \indent In addition, by the general polar coordinates transformation (\ref{vand}), (\ref{S1}) can be transformed to \begin{eqnarray}\label{S3} \left\{\begin{array}{l} \dot{r}=r(\rho-r^2)\\ \dot{\theta}=\omega \end{array}\right.. \end{eqnarray} As we all known, (\ref{S3}) has an asymptotically stable limit cycle $\Gamma:r=\sqrt{\rho}$ with its attracting region being $\mathbb{R}^2-\{O\}$, and the flow $r(t,r_0)$ with $r_0>\sqrt{\rho}$ will tend to positive infinity with clockwise rotation around $\Gamma$ as $t\rightarrow -\infty$. Thus the negative semi-orbit $O_-(\mathbf{u}_1)$ must intersect $L$ infinite times. Denote by $\mathbf{x}^*=(k,x^*_2)^T=\varphi(t_*,\mathbf{u}_1)$ the first intersection of the flow $\varphi(t,\mathbf{u}_1)$ under negative flight time $t_*$ with $L$. Then, from the direction of vector field in $L$ showed in 1), 2) and 3), $\mathbf{x}^*$ must be either in $L_u$ (i.e., $x^*_2>\varrho_+$, see the red point in Figure 1) or in $L_d$ (i.e., $x^*_2<\varrho_-$, see the red point in Figure 2).\\ \indent a) If $\mathbf{x}^*\in L_u$ (i.e., $x^*_2>\varrho_+$), see Figure 1.\\ \indent Consider the open region $D_1$ surrounded by $[\mathbf{x}^*, \mathbf{u}_1]\cup \{\varphi(t,\mathbf{u}_1)|t_*<t<0\}$ as shown in Figure \ref{fig1}. Obviously, $D$ is a positively invariant set contained in $L_-$. Therefore, for any $\mathbf{x} \in [\mathbf{x}^*, \mathbf{u}_1]$, $O_+(x) \subset L_-$ and $\phi(t,\mathbf{x})\rightarrow\Gamma$ as $t\rightarrow +\infty$. In the other hand, since the attracting region of $\Gamma$ is $\mathbb{R}^2-\{O\}$, for any $\mathbf{x}\in (L_u-[\mathbf{x}^*, \mathbf{u}_1])\cup L_d$, the flow $\varphi(t,\mathbf{x})$ must first enter into $L_--D$, and then leave $L_-$ by intersecting $L_m$, and enter into $D_1$ ultimately by intersecting $(\mathbf{x}^*, \mathbf{u}_1)$ under positive flight time. Moreover, it is obvious that for $\mathbf{x}\in L_m$, $\varphi(t,\mathbf{x})$ will first enter into $L_+$ and eventually enter into $D_1$ by intersecting $(\mathbf{x}^*, \mathbf{u}_1)$ under positive flight time. In conclusion, $$O_+(\mathbf{x})\subset L_-\Leftrightarrow \mathbf{x}\in (\mathbf{x}^*, \mathbf{u}_1],~ \textup{for}~~ \mathbf{x}\in L.$$ Furthermore, $O_+(\mathbf{x}^*)\subset L_-\cup L$ is tangent to $L$ at $\mathbf{u}_1$. Thus $$O_+(\mathbf{x})\subset L_-\cup L \Leftrightarrow \mathbf{x}\in [\mathbf{x}^*, \mathbf{u}_1],~ \textup{for}~~ \mathbf{x}\in L.$$ \indent b) If $\mathbf{x}^*\in L_d$ (i.e., $x^*_2<\varrho_-$), see Figure 2.\\ \indent Consider the open region $D_2$ surrounded by $[\mathbf{u}_1,\mathbf{x}^*]\cup \{\varphi(t,\mathbf{u}_1)|t_*<t<0\})$. Obviously, $L_--D_2$ is a positively invariant set contained in $L_-$. Furthermore, for any $\mathbf{x}\in (\mathbf{u}_2, \mathbf{x}^*)$, under positive flight time $\varphi(t,\mathbf{x})$ must enter first into $D_2$, and then enter into $L_+$ by intersecting $L_m$, and eventually enter into $L_-$ by intersecting $L_u$. Combining the directions of the vector fields in $L$ shown in 1), 2) and 3) above, it follows that $$O_+(\mathbf{x})\subset L_-\cup L\Leftrightarrow \mathbf{x}\in L-(\mathbf{u}_1,\mathbf{x}^*),~ \textup{for}~~ \mathbf{x}\in L$$ and $$O_+(\mathbf{x})\subset L_-\Leftrightarrow \mathbf{x}\in L-(\mathbf{u}_1,\mathbf{x}^*],~ \textup{for}~~ \mathbf{x}\in L.$$ ~~~~~~~~$\square$\\\\ \indent From the proof of Lemma 1, it is not hard to get the following conclusion if omitting the points in $L$ at which the vector fields are tangent to $L$ in all cases. \begin{corollary}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \begin{enumerate}[(i)] \item When $0<k^2-\rho<\frac{\omega^2}{4k^2}$. \\ \textup{a)} If $x^*_2>\varrho_+$, then, for $\mathbf{x}\in L$, $O_+(\mathbf{x})\subset L_- $ and $O(\mathbf{x})$ intersects $L$ at $\mathbf{x}$ transversely if and only if $$ \mathbf{x}\in (\mathbf{x}^*, \mathbf{u}_1).$$ \textup{b)} \emph{If} $x^*_2<\varrho_-$, then, for $\mathbf{x}\in L$, $O_+(\mathbf{x})\subset L_- $ and $O(\mathbf{x})$ intersects $L$ at $\mathbf{x}$ transversely if and only if $$O_+(\mathbf{x})\subset L_-\Leftrightarrow \mathbf{x}\in L-[\mathbf{u}_1,\mathbf{x}^*].$$ \item When $k^2-\rho= \frac{\omega^2}{4k^2}$, then, for $\mathbf{x}\in L$, $O_+(\mathbf{x})\subset L_- $ and $O(\mathbf{x})$ intersects $L$ at $\mathbf{x}$ transversely if and only if $$\mathbf{x}\in L-\{(k,\frac{-\omega}{2k})^T\}.$$ \item When $k^2-\rho>\frac{\omega^2}{4k^2}$, then, for any $\mathbf{x}\in L$, $O_+(\mathbf{x})\subset L_- $ and $O(\mathbf{x})$ intersects $L$ at $\mathbf{x}$ transversely. \end{enumerate} \end{corollary} \indent Now, we generalize the conclusion of Lemma 1 to the more general situation, namely, the location relationship between any planar line $\tilde{L}$ and the flow of (\ref{S1}) with initial conditions being in $\tilde{L}$, where \begin{eqnarray}\label{S5} \tilde{L}=\{\textbf{\textup{x}}\in \mathbb{R}^2|\textbf{\textup{k}}^T\textbf{\textup{x}}=1\}, \mathbf{0}\neq\textbf{\textup{k}}=(k_1,k_2)^T\in \mathbb{R}^2. \end{eqnarray} It is readily derived that $\tilde{L}$ can be transformed to the form of $L$ by an orthogonal coordinate transformation such that the more general situation can be studied by Lemma 1 directly. \\ \indent Let \begin{eqnarray}\label{S6} \tilde{L}_+=\{\textbf{\textup{x}}\in \mathbb{R}^2|\textbf{\textup{k}}^T\textbf{\textup{x}}>1\}, \tilde{L}_-=\{\textbf{\textup{x}}\in \mathbb{R}^2|\textbf{\textup{k}}^T\textbf{\textup{x}}<1\}. \end{eqnarray} Then $\mathbb{R}^2$ is equivalent to the disjoint union of $\tilde{L}$, $\tilde{L}_+$ and $\tilde{L}_-$. Moreover, denote $$\tilde{k}=\frac{1}{\sqrt{k_1^2+k_2^2}},~~\tilde{\varrho}_\pm=\frac{-\omega\pm\sqrt{\omega^2-4\tilde{k}^2(\tilde{k}^2-\rho)}}{2\tilde{k}},$$ $$L_2=\{\mathbf{x}\in \mathbb{R}^2|x_1=\tilde{k}\},~~\mathbf{u}_1=(\tilde{k},\tilde{\varrho}_+)^T\in L_2,$$ \begin{eqnarray}\label{B} B=\left(\begin{array}{cc} k_1\tilde{k} &-k_2\tilde{k}\\ k_2\tilde{k} & k_1\tilde{k} \end{array}\right).\end{eqnarray} Then, simple calculation shows that $$\tilde{\mathbf{u}}_1=B\mathbf{u}_1\in \tilde{L}.$$ \indent As a consequence, we have the following corollary \begin{corollary}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \begin{enumerate}[(i)] \item\emph{ When} $\tilde{k}^2-\rho\geq \frac{\omega^2}{4\tilde{k}^2}$. \begin{center} $O_+(\mathbf{x})\subset \tilde{L}_-$ \emph{for any} $\mathbf{x}\in \tilde{L}$. \end{center} \item When $0<\tilde{k}^2-\rho<\frac{\omega^2}{4\tilde{k}^2}$. \\ Let $\tilde{\mathbf{x}}^*=B\mathbf{x}^*$, with $\mathbf{x}^*=(\tilde{k},x^*_2)^T\in L_2$ be the first intersection of the flow $\phi(t,\mathbf{u}_1)$ under negative flight time and $L_2$ . \textup{a)} If $x^*_2>\tilde{\varrho}_+$, \emph{then} $$O_+(\mathbf{x})\subset \tilde{L}_-\Leftrightarrow \mathbf{x}\in [\tilde{\mathbf{x}}^*, \tilde{\mathbf{u}}_1],~ \textup{for}~~ \mathbf{x}\in \tilde{L}.$$ \textup{b)} If $x^*_2<\tilde{\varrho}_-$, \emph{then} $$O_+(\mathbf{x})\subset \tilde{L}_-\Leftrightarrow \mathbf{x}\in \tilde{L}-(\tilde{\mathbf{u}}_1,\tilde{\mathbf{x}}^*],~ \textup{for}~~ \mathbf{x}\in \tilde{L}.$$ \end{enumerate} \end{corollary} \textbf{Proof.} Obviously, $B$ defined as (\ref{B}) is an orthogonal matrix under which $L_2$ can be transformed to $\tilde{L}$ with distance preserving. Then, by Lemma 1, the proof of this corollary is trivial.~~~~~~~~~~~~$\square$ \subsection{Two useful results on planar linear systems} Consider general planar linear system as follows \begin{eqnarray}\label{A0} \dot{\textbf{\textup{x}}}=A_0\textbf{\textup{x}},~~\textbf{\textup{x}}\in \mathbb{R}^2. \end{eqnarray} \noindent\textbf{Lemma 2}\cite{Wang2017Heteroclinic} \emph{For system (\ref{A0}), suppose that the eigenvalues of ${A}_0$ are given by $\mu_{1,2}<0$ and $\textbf{\textup{x}}_0\in \tilde{L}$, then \noindent\begin{center} $O_+(\textbf{\textup{x}}_0)\subset \tilde{L}_-$ if and only if $\textbf{\textup{k}}^TA_0\textbf{\textup{x}}_0\leq0.$ \end{center}} \noindent \emph{Here $\tilde{L}$ and $\tilde{L}^-$ are defined as (\ref{S5}) and (\ref{S6}), respectively}. \\\\ \noindent \textbf{Lemma 3}\cite{Wang2017Heteroclinic} \emph{ For system (\ref{A0}), suppose that the eigenvalues of $\textup{A}_0$ are given by \begin{center} $\alpha\pm \beta i$ \end{center} with $\alpha<0$, $\beta>0$ and $i=\sqrt{-1}$. Let \begin{equation*} \textbf{\textup{x}}_*=\frac{1}{\textbf{\textup{k}}^TA_0^{-1}\textbf{\textup{k}}^{\bot}} A_0^{-1}\textbf{\textup{k}}^{\bot} \end{equation*} with $\textbf{\textup{k}}^{\bot}=(-k_2,k_1)^T$. Obviously $\textbf{\textup{x}}_*\in \tilde{L}$. Moreover, denote the first intersection of the flow with initial condition $\textbf{\textup{x}}_*$ under negative flight time and straight line $\tilde{L}$ by $\textbf{\textup{x}}^*$. Then, for $\textbf{\textup{x}}_0\in \tilde{L}$, \begin{center} $O_+(\textbf{\textup{x}}_0)\subset \tilde{L}_-$ if and only if $\textbf{\textup{x}}_0\in [\textbf{\textup{x}}_*,\textbf{\textup{x}}^*),$ \end{center}} \noindent where $[\mathbf{x}_*,\mathbf{x}^*)$ is defined as (\ref{bkbb}). \section{Proof of Theorem 1,2} \subsection{Proof of Theorem 1} \vspace{3mm} \textbf{The proof of (i)( When $d^2-\rho\geq \frac{\omega^2}{4d^2}$).} \vspace{3mm}\\ To prove the existence of a heteroclinic cycle connecting $\Upsilon$ and $\mathbf{q}$, the key is to prove the existence of two heteroclinic orbits.\\ From (\ref{smq}), (\ref{smUpsilon}), (\ref{Sigma1}) and (\ref{Sigma2}), we have \begin{eqnarray}\label{q0} \{ \mathbf{q}_0\}= W^s(\Upsilon)\cap \Sigma \cap W^u(\mathbf{q}). \end{eqnarray} Then, \begin{eqnarray*}\label{q01} \phi_B(t,\mathbf{q}_0)\rightarrow \mathbf{q} ( t\rightarrow-\infty),\phi_A(t,\mathbf{q}_0)\rightarrow \Upsilon ( t\rightarrow+\infty). \end{eqnarray*} Let \begin{eqnarray}\label{gama1} \Gamma_1=\{\phi_B(t,\mathbf{q}_0)|t<0\}\cup \{\mathbf{q}_0\}\cup \{\phi_A(t,\mathbf{q}_0)|t>0\}. \end{eqnarray} We now want to prove that $\Gamma_1$ is the only heteroclinic orbit from $\mathbf{q}$ to $\Upsilon$ for system (\ref{M1}). To do this, it is sufficient to prove \begin{eqnarray} \{\phi_B(t,\mathbf{q}_0)|-\infty<t<0\}\subset \Sigma^+\label{M7}\\ \{\phi_A(t,\mathbf{q}_0)|0<t<+\infty\}\subset \Sigma^-\cup \Sigma,\label{M8} \end{eqnarray} From (\ref{q0}) and (\ref{q01}), it is obvious that $\{\phi_B(t,\mathbf{q}_0)|-\infty<t<0\}=(\mathbf{q},\mathbf{q}_0)$ must belong to $\Sigma^+$ since $\mathbf{q}_0\in \Sigma$ and $\mathbf{q}\in \Sigma^+$. Thus (\ref{M7}) holds. In addition, we have \begin{center} $\mathbf{q}_0\in L_1$ and $\{\phi_A(t,\mathbf{q}_0)|0<t<+\infty\}\subset W^s(\Upsilon)$ ,\end{center} where $L_1$ is defined by (\ref{Sigma3}). Obviously, $L_1=W^s(\Upsilon)\cap \Sigma$. From system (\ref{M2}), we know that in $W^s(\Upsilon)$ the flow of (\ref{M2}) is determined absolutely only by the planar Van der Pol oscillator $$\dot{x}_1=\rho x_1-\omega x_2-x_1(x_1^2+x_2^2),\dot{x}_2=\omega x_1+\rho x_2-x_2(x_1^2+x_2^2).$$ Since $d^2-\rho\geq \frac{\omega^2}{4d^2}$, according to the conclusion (i) in Lemma 1, $\{\phi_A(t,\mathbf{x})|0<t<\infty\}$ is contained in $L_1^{-}=\{\mathbf{x}\in \mathbb{R}^3|x_1<d,x_3=0\}\subset \Sigma^{-}$ for any $\mathbf{x}\in L_1$ which shows (\ref{M8}) holds. \noindent Thus $\Gamma_1$ given by (\ref{gama1}) is indeed a heteroclinic orbit from $\mathbf{q}$ to $\Upsilon$.\\ \indent To show the existence of heteroclinic cycles, we now need to show the existence of other heteroclinic orbits of (\ref{M1}) from $\Upsilon$ to $\mathbf{q}$. \\ \indent a) If $q_3=d-\sqrt{\rho}$ and $\mathbf{c}^TB(\mathbf{p}_0-\mathbf{q})\geq0$. \\ From (\ref{smq}), (\ref{smUpsilon}), (\ref{Sigma1}) and (\ref{Sigma2}), \begin{eqnarray}\label{p0} \{\mathbf{p}_0\}= W^u(\Upsilon)\cap \Sigma \cap W^s(\mathbf{q}). \end{eqnarray} Then \begin{eqnarray*}\label{q01} \phi_B(t,\mathbf{p}_0)\rightarrow \Upsilon ( t\rightarrow-\infty),\phi_A(t,\mathbf{p}_0)\rightarrow \mathbf{q} ( t\rightarrow+\infty). \end{eqnarray*} Let \begin{eqnarray}\label{gama2} \Gamma_2=\{\phi_A(t,\mathbf{p}_0)|-\infty<t<0\}\cup \{\mathbf{p}_0\} \cup\{\phi_B(t,\mathbf{p}_0)|0<t<+\infty\}. \end{eqnarray} We now show that $\Gamma_2$ is a heteroclinic orbit from $\Upsilon$ to $\mathbf{q}$. For this, it is sufficient to show that \begin{eqnarray} \{\phi_A(t,\mathbf{p}_0)|-\infty<t<0\}\subset \Sigma^-,\label{M6}\\ \{\phi_B(t,\mathbf{p}_0)|0<t<+\infty\}\subset \Sigma^+.\label{M9} \end{eqnarray} From (\ref{p0}), it follows that for any $t_1<0$, $$\phi_A(t_1,\mathbf{p}_0)=(x_1(t_1), x_2(t_1),x_3(t_1))^T \subset W^u(\Upsilon).$$ Thus $x_1^2(t_1)+x_2^2(t_1)=\rho$. Additionally, $0<x_3(t_1)<d-\sqrt{\rho}$ since the $x_3$-coordinate of $\mathbf{p}_0$ is $d-\sqrt{\rho}$ from (\ref{Sigma2}) and $\dot{x}_3=\mu>0$ for any $(x_1(t),x_2(t),x_3(t))^T\in W^u(\Upsilon)$ from (\ref{M2}). Hence $$x_3(t_1)+x_1(t_1)\leq x_3(t_1)+\sqrt{x_1^2(t_1)+x_2^2(t_1)}<d-\sqrt{\rho}+\sqrt{\rho}=d,$$ which means that (\ref{M6}) holds.\\ \indent Furthermore, since $\mathbf{p}_0\in W^s(\mathbf{q})\cap \Sigma$, $\{\phi_B(t,\mathbf{p}_0)|0<t<+\infty\}\subset W^s(\mathbf{q})$. From ($\ref{M3}$), in $W^s(\mathbf{q})$, the flow of (\ref{M3}) is absolutely determined by the following planar system $$\left(\begin{array}{c} \dot{x}_1\\ \dot{x}_2 \end{array}\right)=B_0 \left(\begin{array}{c}x_1-q_1\\x_2-q_2\end{array}\right),$$ where $B_0=\left(\begin{array}{cc}b_{11}&b_{12}\\b_{21}&b_{22}\end{array}\right)$ with eigenvalues $\lambda_{1,2}<0$ from (H1). Since $\mathbf{c}^TB(\mathbf{p}_0-\mathbf{q})\geq0$, by normal coordinate transformation, it is not hard to know (\ref{M9}) holds by using Lemma 2. Therefore, $\Gamma_2$ given by (\ref{gama2}) is ideed the only heteroclinic orbit from $\Upsilon$ to $\mathbf{q}$.\\ \indent Hence, in this case, there exists only one heteroclinic cycle connecting $\Upsilon$ and $\mathbf{q}$, which can be expressed as \begin{eqnarray}\label{heter1} \Upsilon \cup \Gamma_2 \cup \mathbf{q}\cup \Gamma_1. \end{eqnarray}\\ \indent b) if $q_3=d+\sqrt{\rho}$ , $\omega^2\rho<\mu^2(d^2-\rho)$ and $\mathbf{c}^TB(\mathbf{p}_1-\mathbf{q})\geq0$.\\\\ In this subcase, $$\{\mathbf{p}_1\}= W^u(\Upsilon)\cap \Sigma \cap W^s(\mathbf{q}).$$ Therefore, \begin{eqnarray*}\label{p10} \phi_A(t,\mathbf{p}_1)\rightarrow \Upsilon ( t\rightarrow-\infty),\phi_B(t,\mathbf{p}_1)\rightarrow \mathbf{q} ( t\rightarrow+\infty). \end{eqnarray*} Let \begin{eqnarray} \label{gama3} \Gamma_3=\{\phi_A(t,\mathbf{p}_1)|-\infty<t<0\}\cup \{\mathbf{p}_1\} \cup\{\phi_B(t,\mathbf{p}_1)|0<t<+\infty\}. \end{eqnarray} To prove thta $\Gamma_3$ is the only heteroclinic orbit from $\Upsilon$ to $\mathbf{q}$, we need only to show that \begin{eqnarray} \{\phi_B(t,\mathbf{p}_1)|0<t<+\infty\}\subset \Sigma^+, \label{M10}\\ \{\phi_A(t,\mathbf{p}_1)|-\infty<t<0\}\subset \Sigma_-.\label{M11} \end{eqnarray} Since $\mathbf{p}_1\in W^s(\mathbf{q})\cap \Sigma$ and $\mathbf{c}^TB(\mathbf{p}_1-\mathbf{q})\geq0$, the proof of (\ref{M10}) can be easily carried out similarly to the proof (\ref{M9}).\\ \indent Now we prove (\ref{M11}). Let $$E=W^u(\Upsilon)\cap \Sigma.$$ Then $E$ is an elliptic secant line of $W^u(\Upsilon)$ and can be parameterized by $$E=\{(\sqrt{\rho}cos\varsigma,\sqrt{\rho}sin\varsigma, d-\sqrt{\rho}cos\varsigma)^T|\varsigma\in [0,2\pi)\}.$$ Furthermore, it is not hard to see that $\mathbf{p}_1$ is one of the endpoints of the large axis of $E$. Moveover, for any $$\mathbf{p}(\varsigma)=(\sqrt{\rho}cos\varsigma,\sqrt{\rho}sin\varsigma, d-\sqrt{\rho}cos\varsigma)^T\in E,$$ the tangent sector to the elliptic secant line in $\Sigma$ can be calculated as $$\mathbf{p}'(\varsigma)=(-\sqrt{\rho}sin\varsigma,\sqrt{\rho}cos\varsigma, \sqrt{\rho}sin\varsigma)^T.$$ Let $\theta_1(\varsigma)$ be the angle between $\mathbf{p}'(\varsigma)$ and $(0,0,-1)^T$. Then $$cos(\theta_1(\varsigma))=\frac{-\sqrt{\rho}sin\varsigma}{\sqrt{\rho+\rho sin^2\varsigma}}=-\frac{sin\varsigma}{\sqrt{1+sin^2\varsigma}}.$$ Moreover, from (\ref{M2}), the sector field at $\mathbf{p}(\varsigma)$ can be formulated by $$\mathbf{f}=(-\omega\sqrt{\rho}sin\varsigma,\omega\sqrt{\rho}cos\varsigma,\mu(d-\sqrt{\rho}cos\varsigma)).$$ Then $$cos(\theta_2(\varsigma))=\frac{\mu(d-\sqrt{\rho}cos\varsigma)}{\sqrt{\omega^2\rho+\mu^2(d-\sqrt{\rho}cos\varsigma)^2}},$$ where $\theta_2(\varsigma)$ denotes the angle between $-\mathbf{f}$ and $(0,0,-1)^T$. From $d>\sqrt{\rho}$, we have $cos(\theta_2(\varsigma))>0$ for any $\varsigma\in [0,2\pi)$. Thus, \begin{eqnarray}\label{theta2} \theta_2(\varsigma)\in (0,\frac{\pi}{2}). \end{eqnarray} Now, we consider the sign of $cos^2(\theta_2(\varsigma))-cos^2(\theta_1(\varsigma))$. Simple calculation shows that \begin{eqnarray}\label{M12} \begin{aligned} cos^2(\theta_2(\varsigma))-cos^2(\theta_1(\varsigma))&=\frac{\mu^2(d-\sqrt{\rho}cos\varsigma)^2-\omega^2\rho sin^2\varsigma}{(1+sin^2\varsigma)(\omega^2\rho+\mu^2(d-\sqrt{\rho}cos\varsigma)^2)}\\ &=\frac{(\mu d-\mu\sqrt{\rho}cos\varsigma-\omega\sqrt{\rho}sin\varsigma)(\mu d-\mu\sqrt{\rho}cos\varsigma+\omega\sqrt{\rho}sin\varsigma)}{(1+sin^2\varsigma)(\omega^2\rho+\mu^2(d-\sqrt{\rho}cos\varsigma)^2)}. \end{aligned} \end{eqnarray} Since $\omega^2\rho<\mu^2(d^2-\rho)$, we have $\sqrt{\mu^2+\omega^2}<\frac{\mu d}{\sqrt{\rho}}$. Thus \begin{center} $\mu\sqrt{\rho}cos\varsigma+\omega\sqrt{\rho}sin\varsigma\leq \sqrt{\rho}\sqrt{\mu^2+\omega^2}<\mu d$ and $\mu\sqrt{\rho}cos\varsigma-\omega\sqrt{\rho}sin\varsigma\leq \sqrt{\rho}\sqrt{\mu^2+\omega^2}<\mu d.$ \end{center} Combining these with (\ref{M12}) show $cos^2(\theta_2(\varsigma))-cos^2(\theta_1(\varsigma))>0$, which implies that \begin{center} $\theta_2(\varsigma)< \theta_1(\varsigma)$ \end{center} by (\ref{theta2}). This shows that the flow with any initial condition $\mathbf{p}(\varsigma)$ will tend to $\Upsilon$ along $W^s(\Upsilon)$ without intersecting with $\Sigma$ once again as $t\rightarrow-\infty$. Hence (\ref{M11}) holds. Obviously, the only heteroclinic cycle connecting $\Upsilon$ and $\mathbf{q}$ in this subcase can be expressed as \begin{eqnarray}\label{heter2} \Upsilon\cup\Gamma_3\cup \{\mathbf{q}\}\cup\Gamma_1. \end{eqnarray} \indent c) If $d-\sqrt{\rho}<q_3<d+\sqrt{\rho}$, $\omega^2\rho<\mu^2(d^2-\rho)$ and $\mathbf{c}^TB(\mathbf{p}_\pm-\mathbf{q})\geq0$. \\\\ In this case, it is easy to get \begin{eqnarray}\label{mani1} W^u(\Upsilon)\cap \Sigma \cap W^s(\mathbf{q})=\{\mathbf{p}_+,\mathbf{p}_-\}. \end{eqnarray} from (\ref{smq}), (\ref{smUpsilon}), (\ref{Sigma1}) and (\ref{p+-}). Hence \begin{eqnarray}\label{q01} \phi_A(t,\mathbf{p}_{\pm})\rightarrow \Upsilon ( t\rightarrow-\infty),\phi_B(t,\mathbf{p}_{\pm})\rightarrow \mathbf{q} ( t\rightarrow+\infty). \end{eqnarray} Let \begin{eqnarray}\label{Gammapn} \Gamma_{\pm}=\{\phi_A(t,\mathbf{p}_\pm)|-\infty<t<0\}\cup \{\mathbf{p}_{\pm}\} \cup\{\phi_B(t,\mathbf{p}_\pm)|0< t<+\infty\}. \end{eqnarray} Since $\omega^2\rho<\mu^2(d^2-\rho)$, by the similar proof for (\ref{M11}) in b) above, we obtain \begin{eqnarray}\label{phi1} \{\phi_A(t,\mathbf{p}_\pm)|-\infty<t<0\}\subset \Sigma_-. \end{eqnarray} Since $\mathbf{c}^TB(\mathbf{p}_\pm-\mathbf{q})\geq0$, \begin{eqnarray}\label{phi2} \{\phi_B(t,\mathbf{p}_\pm)|0<t<+\infty\}\subset \Sigma^+ \end{eqnarray} by Lemma 2. Then $\Gamma_{\pm}$ are two different heteroclinic orbits from $\Upsilon$ to $\mathbf{q}$ from (\ref{mani1})$\sim$(\ref{phi2}). Then, \begin{eqnarray}\label{heter3} \Upsilon\cup\Gamma_{\pm} \cup \{\mathbf{q}\}\cup \Gamma_1. \end{eqnarray} are only two heteroclinic cycles of (\ref{M1}), each of which connect $\Upsilon$ and $\mathbf{q}$.\\ \indent \vspace{3mm} The proof of (i) is accomplished.\\ \indent \textbf{The proof of (ii) (When $0<d^2-\rho< \frac{\omega^2}{4d^2}$).} \vspace{3mm} \\ \indent Now, we first prove that $\Gamma_1$ defined still as (\ref{gama1}) is a heteroclinic orbit from $\mathbf{q}$ to $\Upsilon$ for system (\ref{M1}) in the following. To do this, it is still sufficient to prove that (\ref{M7}) and (\ref{M8}) are both hold. (\ref{M7}) is obvious ture by using the same disccusion in (i). Now it is crucial to prove (\ref{M8}). Since $0<d^2-\rho< \frac{\omega^2}{4d^2}$, $\{\phi_A(t,\mathbf{v}_1)|t<0\}$ will intersect with $L_1$ according to Lemma 1, where $\mathbf{v}_1$ is defined in (\ref{Sigma4}). Let $\mathbf{v}^*=(d,v^*_{2},0)^T$ be the first intersection of flow $\phi_A(t,\mathbf{v}_1)$ under negative flight time and $L_1$. \\ \indent 1) if $v^*_{2}>\sigma_+$,\\ then $q_2\in [\sigma_+,v_2^*]$ which means $\mathbf{q}_0\in [\mathbf{v}_*,\mathbf{v}_1]$. This shows that (\ref{M8}) holds by Lemma 1,\\ \indent 2) if $v^*_{2}<\sigma_-$,\\ then $q_2 \in (\infty,- v^*_2]\cup [\sigma_+,+\infty)$ which means $\mathbf{q}_0\in L_1-(\mathbf{v}_1,\mathbf{v}_*)$. Hence (\ref{M8}) still holds from Lemma 1. \\ \indent Thus $\Gamma_1$ is still a heteroclinic orbit from $\Upsilon$ to $\mathbf{q}$ in this case. In addition,\\ \indent a) If $q_3=d-\sqrt{\rho}$ and $\mathbf{c}^TB(\mathbf{p}_0-\mathbf{q})\geq0$.\\ By the completely same discussion used in subcase a) in the proof of (i), $\Gamma_2$ given in (\ref{gama2}) is still a heteroclinic orbit from $\mathbf{q}$ to $\Upsilon$. Hence, (\ref{heter1}) is still the only heteroclinic cycle of (\ref{M1}) connecting $\Upsilon$ and $\mathbf{q}$.\\ \indent b) if $q_3=d+\sqrt{\rho}$ , $\omega^2\rho<\mu^2(d^2-\rho)$ and $\mathbf{c}^TB(\mathbf{p}_1-\mathbf{q})\geq0.$\\ The discussion is also completely same as subcase b) in the proof of (i). (\ref{heter2}) is the only heteroclinic cycle of (\ref{M1}) connecting $\Upsilon$ and $\mathbf{q}$ as before.\\ \indent c) If $d-\sqrt{\rho}<q_3<d+\sqrt{\rho}$, $\omega^2\rho<\mu^2(d^2-\rho)$ and $\mathbf{c}^TB(\mathbf{p}_\pm-\mathbf{q})\geq0$ . \\ Using the same discussion as subcase c) in the proof of (i), (\ref{heter3}) are the only two heteroclinic cycles of (\ref{M1}), each of which connects $\Upsilon$ and $\mathbf{q}$.\\ \indent The proof of (ii) is accomplished~~~~~~~~~~$\Box$. \subsection{Proof of Theorem 2} Under condition (H2), the fundament difference between Theorem 1 and Theorem 2 is that $\mathbf{q}$ is a pure saddle point (with purely real eigenvalues) in Theorem 1, while $\mathbf{q}$ is a saddle-focus in Theorem 2. In addition, Lemma 3 can play the similar role as Lemma 2 in the proof of Theorem 1 when proving Theorem 2. Thus, for the proof of Theorem 2, we don't present the more details but a briefly description below.\vspace{3mm}\\ \textbf{The proof of (i)( When $d^2-\rho\geq \frac{\omega^2}{4d^2}$).}\vspace{3mm}\\ All of the dicussions for (\ref{q0}), (\ref{gama1}), (\ref{M7}) and (\ref{M8}) can be achieved in this case. Thus $\Gamma_1$ defined as (\ref{gama1}) is still the only heteroclinic orbit from $\mathbf{q}$ to $\Upsilon$. \\\indent a) If $q_3=d-\sqrt{\rho}$ and $\mathbf{p}_0\in [\mathbf{x}_-,\mathbf{x}_+).$ \\ \indent Then (\ref{p0}) holds still. Let $\Gamma_2$ be defined as (\ref{gama2}). Since the left subsystem in Theorem 2 is same as Theorem 1, the verification for $\{\phi_A(t,\mathbf{p}_0)|-\infty<t<0\}\subset \Sigma_-$ is same as (\ref{M6}) in Theorem 1. Now we will prove \begin{eqnarray}\label{M15} \{\phi_B(t,\mathbf{p}_0)|0<t<+\infty\} \subset \Sigma^+. \end{eqnarray} Obviously, $\{\phi_B(t, \mathbf{p}_0)|t>0\}$ is contained in $W^s(\mathbf{q})$. From $B=\left( \begin{array}{ccc} b_{11} &b_{12} &0\\ b_{21} & b_{22}& 0\\ 0 & 0& \lambda \end{array}\right)$ and condition (H2), we know, in $W^s(\mathbf{q})$, the flow of (\ref{M3}) is determined only by the following planar system $$\left(\begin{array}{c} \dot{x}_1\\ \dot{x}_2 \end{array}\right)=B_0 \left(\begin{array}{c}x_1-q_1\\x_2-q_2\end{array}\right),$$ where $B_0=\left(\begin{array}{cc}b_{11}&b_{12}\\b_{21}&b_{22}\end{array}\right)$ with its eigenvalues being $\alpha\pm \beta i$ ($\alpha<0,\beta>0$). From Lemma 3 and the definitions of $\mathbf{x}_-$ (see (\ref{Sigma5})) and $\mathbf{x}_+$(see Theorem 2), it is readily obtained that (\ref{M15}) holds by $\mathbf{p}_0\in [\mathbf{x}_-,\mathbf{x}_+)$. Thus, $\Gamma_2$ is the only heteroclinic orbit from $\Upsilon$ to $\mathbf{q}$. Therefore, $$\Upsilon\cup \Gamma_2 \cup \mathbf{q} \cup \Gamma_1$$ is the only heteroclinic cycle connecting $\Upsilon$ and $\mathbf{q}$.\\\\\ \indent b) If $q_3=d+\sqrt{\rho}$, $\omega^2\rho<\mu^2(d^2-\rho)$ and $\mathbf{p}_1\in [\mathbf{x}_-,\mathbf{x}_+)$.\\ \indent In this subcase,$$W^u(\Upsilon)\cap \Sigma \cap W^s(\mathbf{q})=\{\mathbf{p}_1\}.$$ Moreover, the proof for $\{\phi_A(t,\mathbf{p}_1)|-\infty<t<0\}\subset \Sigma_-$ is the same as the proof of (\ref{M11}), the proof for $\{\phi_B(t,\mathbf{p}_1)|0<t<+\infty\}\subset \Sigma^+$ is similar to the proof of (\ref{M15}). We omit them here. Then, the only heteroclinic cycle connecting $\Upsilon$ and $\mathbf{q}$ in this subcase can be expressed by $$\Upsilon\cup \Gamma_3 \cup \mathbf{q} \cup \Gamma_1,$$ where $\Gamma_1$ and $\Gamma_3$ are defined as (\ref{gama1}) and (\ref{gama3}).\\ \indent c) if $d-\sqrt{\rho}<q_3<d+\sqrt{\rho}$, $\omega^2\rho<\mu^2(d^2-\rho)$ and $\mathbf{p}_\pm\in [\mathbf{x}_-,\mathbf{x}_+)$.\\ \indent In this subcase, we have $$W^u(\Upsilon)\cap \Sigma \cap W^s(q)=\{\mathbf{p}_+,\mathbf{p}_-\}.$$ The proofs for $\{\phi_A(t,\mathbf{p}_\pm)|t<0\}\subset \Sigma_-$ and $\{\phi_B(t,\mathbf{p}_\pm)|t>0\}\subset \Sigma^+$ is similar to the proofs of (\ref{M11}) and (\ref{M15}), respectively. We omit them here. Then, the only two heteroclinic cycles connecting $\Upsilon$ and $\mathbf{q}$ in this subcase can be expressed by $$\Upsilon\cup \Gamma_\pm \cup \mathbf{q} \cup \Gamma_1,$$ where $\Gamma_1$ and $\Gamma_\pm$ are defined as (\ref{gama1}) and (\ref{Gammapn}), respectively.~~~~~$\square$\vspace{3mm}\\ \textbf{The proof of (ii)( When $0<d^2-\rho<\frac{\omega^2}{4d^2}$).}\vspace{3mm}\\ \indent Combining the proof of (ii) of Theorem 1 and the proof of (i) of Theorem 2, this proof is easy to achieve here. We omit it for simplification. $\square$. \section{Examples} \noindent \textbf{Example 1:Heteroclinic cycle connecting a pure saddle (i.e., all eigenvalues are real) and a saddle periodic orbit}. \\ For system (\ref{M1}), let $$ A=\left( \begin{array}{ccc} \rho &-\omega &0\\ \omega & \rho& 0\\ 0 & 0& \mu \end{array}\right)=\left( \begin{array}{ccc} 1 &-10 &0\\ 10 & 1& 0\\ 0 & 0& 5 \end{array}\right),B=\left( \begin{array}{ccc} b_{11} &b_{12} &0\\ b_{21} & b_{22}& 0\\ 0 & 0& \lambda \end{array}\right)=\left( \begin{array}{ccc} -2 &1&0\\ 0 & -1& 0\\ 0 & 0& 2 \end{array}\right),$$ $$~\mathbf{q}=(q_1,q_2,q_3)^T=(1.2,0,0.2)^T,~d=1.2.$$ Then, \begin{eqnarray*} \mathbf{p}_0=(\sqrt{\rho},0,d-\sqrt{\rho})^T=(1,0,0.2)^T , \mathbf{q}_0=(d,q_2,0)^T=(1.2,0,0)^T. \end{eqnarray*} $$\sigma_+=\frac{-\omega+\sqrt{\omega^2-4d^2(d^2-\rho)}}{2d}=-0.05314,~~\mathbf{\mathbf{v}}_1=(d,,0)^T=(1.2,-0.05314,0)^T.$$ $$\rho=1<1.44=d^2, \textbf{c}^T\mathbf{q}=1.4>1.2=d,q_1=d=1.2.$$ Moreover, the eigenvalues of $B$: $\lambda_1=-2<0,\lambda_2=-1<0$ and $\lambda=2>0$, thus, $B$ satisfies (H1) and (H3). And $$0<d^2-\rho=0.44<\frac{625}{36}=\frac{\omega^2}{4d^2}.$$ In addition, $\mathbf{v}^*=(d,v^*_2,0)^T=(1.2,2.363,0)^T$ by numerical calculation. $$v^*_2=2.363>-0.05314=\sigma_+,~~\sigma_+< q_2=0< v^*_2.$$ $$q_3=d-\sqrt{\rho}=0.2,~~ \mathbf{c}^TB(\mathbf{p}_0-\mathbf{q})=0.4\geq0.$$ According to conclusion a) in case (ii) in Theorem 1, there exists only one heteroclinic cycle connecting periodic orbit $\Upsilon=\{(x,y,z)\in \mathbb{R}^3|x^2+y^2=1,z=0\}$ and equilibrium $\mathbf{q}$ as shown in Figure \ref{fig3}. \begin{figure}[!htbp] \renewcommand{\figurename}{Fig.} \begin{minipage}{0.25\textwidth} \caption{A heteroclinic cycle connecting $\Upsilon$ and $\mathbf{q}$ in Example 1. }\label{fig3} \end{minipage} \hspace{0cm} \begin{minipage}{0.75\textwidth} \includegraphics[width=9cm]{exam1_saddle.eps} \end{minipage} \end{figure} \\ \noindent \textbf{Example 2: Heteroclinic cycle connecting a saddle-focus and a saddle periodic orbit}.\\ For system (\ref{M1}), let \begin{eqnarray*} A=\left( \begin{array}{ccc} 1 &-35^{\frac{1}{2}} &0\\ 35^{\frac{1}{2}} & 1& 0\\ 0 & 0& 5 \end{array}\right),B=\left( \begin{array}{ccc} -0.5 &4 &0\\ -4 & -0.5& 0\\ 0 & 0& 2 \end{array}\right), \end{eqnarray*} $$d=(35/11)^{\frac{1}{2}}, ~\mathbf{q}=(d,-4.5,d+1)^T$$ Then $$\mathbf{p}_1=(-\sqrt{\rho},0,d+\sqrt{\rho})^T=(-1,0,d+1),$$ $$\sigma_+=\frac{-\omega+\sqrt{\omega^2-4d^2(d^2-\rho)}}{2d}=-0.9045,\sigma_-=\frac{-\omega-\sqrt{\omega^2-4d^2(d^2-\rho)}}{2d}=-2.4121.$$ \begin{figure}[!htbp] \renewcommand{\figurename}{Fig.} \begin{minipage}{0.25\textwidth} \caption{A heteroclinic cycle connecting periodic orbit $\Upsilon=\{(x_1,x_2,x_3)^T|x_1^2+x_2^2=1,x_3=0\}$ and saddle-focus $\mathbf{q}$ in Example 2. }\label{fig4} \end{minipage} \hspace{0cm} \begin{minipage}{0.75\textwidth} \includegraphics[width=10cm]{exam2_saddle_focus.eps} \end{minipage} \end{figure} $$\rho=1<\frac{35}{11}=d^2,~~\textbf{c}^T\mathbf{q}=2d+1>d,~~q_1=d=(35/11)^{\frac{1}{2}},$$ $$\mathbf{\mathbf{v}}_1=(d,\sigma_+,0)^T=(d, -0.9045,0)^T,$$ Then, the eigenvalues of $B$ are $-0.5\pm 4i$ and 2. Thus, $B$ satisfies (H2) and (H3). And $$0<d^2-\rho=\frac{24}{11}<\frac{11}{4}=\frac{\omega^2}{4d^2}.$$ By numerical calculation, $\mathbf{v}^*=(d,v^*_2,0)^T=(d, -4.4162,0)^T$. Then, $$v^*_2=-4.4162<-2.4124=\sigma_-,~~q_2=-4.5<v^*_2=-4.4162.$$ In addition, $$q_3=d+\sqrt{\rho}=d+1,~ \omega^2\rho=35<\frac{600}{11}=\mu^2(d^2-\rho).$$ Meanwhile, $\mathbf{x}_-=\frac{d-\mathbf{c}^T\mathbf{q}}{\mathbf{c}^TB^{-1}\mathbf{c}^\bot} B^{-1}\mathbf{c}^\bot+\mathbf{q }=(-1, -4.848,d+1)^T$ and $\mathbf{x}^*=(-1,0.0476,d+1)^T$ by numerical calculation. Thus $$\mathbf{p}_1=(-\sqrt{\rho},0,d+\sqrt{\rho})^T=(-1,0,d+1)\in [\mathbf{x}_-,\mathbf{x}^*).$$ According to conclusion b) in case (ii) of Theorem 2, there exists only one heteroclinic cycle connecting periodic orbit $\Upsilon=\{(x,y,z)\in \mathbb{R}^3|x^2+y^2=\rho=1,z=0\}$ and equilibrium $\mathbf{q}$ as shown in Figure \ref{fig4}. \begin{figure}[!htbp] \renewcommand{\figurename}{Fig.} \begin{minipage}{0.25\textwidth} \caption{Two heteroclinic cycles each connecting periodic orbit $\Upsilon=\{(x_1,x_2,x_3)^T|x_1^2+x_2^2=1,x_3=0\}$ and saddle-focus $\mathbf{q}$ in Example 3. }\label{fig5} \end{minipage} \hspace{0cm} \begin{minipage}{0.75\textwidth} \includegraphics[width=12cm]{exam_3_two_hetero.eps} \end{minipage} \end{figure} \noindent \textbf{Example 3: A pair of heteroclinic cycles each connecting a saddle-focus and a saddle periodic orbits}.\\ For system (1), let \begin{eqnarray*} A=\left( \begin{array}{ccc} 1 &-3 &0\\ 3 & 1& 0\\ 0 & 0& 4 \end{array}\right),B=\left( \begin{array}{ccc} -3.5 &6 &0\\ -6 & -3.5& 0\\ 0 & 0& 2 \end{array}\right),. \end{eqnarray*} $$d=2, ~\mathbf{q}=(2,0,2)^T.$$ Then, $$\mathbf{p}_-=(0,-1,2)^T,~\mathbf{p}_+=(0,1,2)^T,~\mathbf{q}_0=(2,0,0)^T.$$ $$\rho=1<4=d^2,~~\textbf{c}^T\mathbf{q}=4>2=d,~~q_1=d=2.$$ Moreover, the eigenvalues of $B$: $-3.5\pm 6i$, thus, $B$ satisfies (H2). And $$d^2-\rho=3>2.5=\frac{\omega^2}{4d^2}.$$ Furthermore, \begin{center} $d-\sqrt{\rho}=1<q_3=2<3=d+\sqrt{\rho}$, $\omega^2\rho=36<48=\mu^2(d^2-\rho)$, \end{center} and $\mathbf{x}_-=(0,-1.1667,2)^T$ and $\mathbf{x}^*=( 0,27.6586,2)^T$ by numerical calculation. Thus $$\mathbf{p}_\pm\in (\mathbf{x}_-,\mathbf{x}^*).$$ According to the conclusion c) in case (i) of Theorem 2, there exist only two heteroclinic cycles each connecting periodic orbit $\Upsilon=\{(x,y,z)\in \mathbb{R}^3|x^2+y^2=\rho=1,z=0\}$ and saddle-focus $\mathbf{q}$ as shown in Figure \ref{fig5}. \section{Conclusions} In this paper, we have investigated the existence of heteroclinic cycles connecting saddle periodic orbit and saddle equilibrium in a class of piecewise smooth systems. Two types of such heteroclinic cycles are constructed: one is the heteroclinic cycle connecting a saddle point with only real eigenvalues and a saddle periodic orbit, and the other is the heteroclinic cycle connecting a saddle-focus point and a saddle periodic orbit. What's more, the main results are convenient and feasible to be used in the construction of piecewise smooth systems possessing such heteroclinic cycles, see these examples in Section 5.\\ \indent As mentioned in the Introduction section, for flows, the singular cycles connecting saddle periodic orbit and saddle equilibrium can potentially result in the so-called singular horseshoe, which implies the existence of a non-uniformly hyperbolic chaotic invariant set. Maybe, It can be conjectured that the singular cycles studied in this paper for the piecewise smooth systems may also result in the emerge of the singular horseshoe under some conditions. We will investigate this interesting issue in the future work. \section*{Acknowledgments} \noindent The first author takes this opportunity to thank Prof. Sebastian Walther (Department of Mathematics, RWTH Aachen University, Germany) for providing a good research environment and office space during the visit in the RWTH Aachen University from July 2018 to July 2019.\\ This study was supported by the National Natural Science Foundation of China (Grant numbers 11702077 and 11472111), the Natural Science Foundation of Anhui Province (Grant number 1708085QA12), the Overseas Visiting and Training Foundation of Outstanding Young Talents in the Universities of Anhui Province (Grant number gxgwfx2018070), the Fostering Master's Degree Empowerment Point Project of Hefei University(Grant number 2018xs03) and the Anhui Provincial Teaching Studio (Grant number 2014MSGZS159). \section*{References} \bibliographystyle{elsarticle-num}
\section{Introduction} \label{sec:intro} \IEEEPARstart{I}{n} recent years, radar systems that use fewer measurements in temporal, spectral, Doppler or spatial signal domains and yet achieve identical or even better performance than conventional systems, have captured significant research interest\cite{griffiths2014radar,mishra2018sub,cohen2018sub}. The savings in metrics such as antenna aperture, bandwidth, sampling rate or dwell time lead to low cost and small size systems that are not very demanding on data throughput. Further, reduction in system resources enables the radar to share them among different applications. For instance, technologies like multi-function integrated radio-frequency (RF) aperture systems \cite{Darpa2016Concerto, mishra2017high,mishra2014compressed}, spectral coexistence \cite{cohen2018spectrum,mishra2017auto}, cognitive radars \cite{mishra2016cognitive, mishra2017performance} and reconfigurable arrays \cite{wang2014reconfig} provide multiple services such as surveillance, tracking, and communication using a single system. The literature indicates several different approaches towards realizing reduced-rate radars (see e.g. \cite{mishra2018sub,cohen2018sub} and references therein) mostly based on compressed sensing (CS). In this work, we focus on those reduced-rate techniques which model the analog received radar signal utilizing the theory of finite-rate-of-innovation (FRI) \cite{eldar2015sampling}. These systems - referred to as sub-Nyquist radars - perform signal detection and parameter estimation from much fewer measurements than that required by Nyquist sampling and employ the Xampling framework \cite{eldar2015sampling} to obtain low-rate samples of the signal. In the temporal domain, \cite{baransky2014prototype} proposed a sub-Nyquist radar to recover target delays relying on the FRI model. Similar techniques were later studied for delay channel estimation problems in ultra-wideband \cite{cohen2014channel} and millimeter wave \cite{mishra2017sub} communication systems. The \textit{Doppler focusing} technique was added to the temporal sub-Nyquist radar in \cite{barilan2014focusing} to recover both delays and Dopplers. However, this system reduced samples only in time but not in the Doppler domain. The sub-Nyquist reduced time-on-target radar in \cite{cohen2016reduced} demonstrated dilution of samples in both the time and Doppler domains. For spatial compression, thinned arrays were examined for a multiple-input-multiple-output (MIMO) array radar in \cite{rossi2014spatial} and later for phased arrays in \cite{mishra2017high}. In \cite{Cohen2016SUMMeR}, targets' ranges, velocities, and directions were recovered in a new radar structure called Sub-Nyquist MIMO Radar (SUMMeR) by thinning a colocated MIMO array and collecting low-rate samples at each receiver element. The SUMMeR system was also implemented in a hardware prototype \cite{mishra2018cognitive,mishra2016cognitive}. In this work, motivated by the recent advancements in exploring the high-order data structure \cite {Sidiropoulos2017Tensor} in multidimensional harmonic retrieval \cite{Haardt2008Higher}, dictionary learning \cite{roemer2014tensor}, channel sounding \cite{landmann2012impact}, and bistatic MIMO radar processing \cite{wen2017angle}, we propose a Tensor-based four dimensional (4D) Sub-Nyquist Radar (TenDSuR), which is a Spectral-Spatial-Doppler-Temporal (S-S-D-T) domain compressed 4D radar system that processes the received echoes by applying tensor-based signal processing. In TenDSuR, the spatial compression is achieved by deploying a thinned MIMO antenna as in \cite{mishra2017high, Cohen2016SUMMeR}. For the spectral thinning of transmit waveforms as in \cite{Yu2012CSSF, Huang2014Congnitive}, TenDSuR employs frequency-diversity waveforms which occupy only a small part of the full bandwidth required for the range resolution of SUMMeR \cite{Cohen2016SUMMeR}. The sub-Nyquist receiver recovers the target parameters via Xampling leading to temporal compression. The transmitters send agile waveforms with the reduced number of pulses thereby requiring fewer measurements in the Doppler domain. So, unlike SUMMeR, the TenDSuR system does not transmit pulses at a uniform Pulse Repetition Interval (PRI). This leads to significant reduction in the total duration which each of the antenna elements are dedicated to a specific RF service. Further, SUMMeR employs Doppler focusing, which is carried out over the set of frequencies that are fixed \textit{a priori}. The resultant Doppler resolution is limited by the focusing, i.e., inversely proportional to the number of pulses $P$ as is also the case with conventional radar. In contrast, the TenDSuR processing algorithm is based on tensor completion (TC) \cite{gandy2011tensor} leading to higher resolution recovery of the targets with off-grid range, Doppler, and Direction of Arrival (DoA). The flexible signal model of TenDSuR is suitable for arbitrary waveforms. The results show that in order to achieve the same detection performance with same resolutions in Doppler and DoA, TenDSuR requires fewer pulses per transmitter than SUMMeR \cite{Cohen2016SUMMeR}. When all pulses and frequency points are used, TenDSuR signal model is equivalent to SUMMeR. But, for off-grid targets, TC-based recovery outperforms SUMMeR even when pulses are not diluted. Throughout this paper, we use bold lowercase, bold uppercase and calligraphic letters for the vectors, matrices and tensors respectively. The $i$th element of a vector $\mathbf{y}$ is $[\mathbf{y}]_i$; the $(i,j)$th entry of a matrix $\textbf{Y}$ is $[\textbf{Y}]_{i,j}$; the $s$th column of matrix $\mathbf{Y}$ is $[\mathbf{Y}]_{s}$; the sub-matrix of $\mathbf{Y}$ that has columns specified by the index $\Pi$ is $[\mathbf{Y}]_{\Pi}$; and the $(i,j,k)$th entry of a tensor $\mathcal{Y}$ is $[\mathcal{Y}]_{i,j,k}$. The notations $\otimes$, $\circ$, and $\diamond$ are the Kronecker, outer vector, and Khatri-Rao products, respectively; $|\cdot|$ is the element-wise magnitude or absolute value; $[\![\cdot]\!]$ is the multi-linear product; $(\cdot)^{\ast}$, $(\cdot)^{T}$, $(\cdot)^{H}$, and $\|\cdot\|_{\ast}$ denote conjugate, transpose, Hermitian and nuclear norm of a matrix, respectively. Following denote operators: $\mathcal{P}_{\Gamma}\{\cdot\}$ selects only those entries of its argument that are listed within the index set $\Gamma$; $\mathcal{H}\{\cdot\}$ transforms a vector to its corresponding Hankel matrix; $\mathcal{S}_{\emptyset}\{\cdot\}$ removes the zero entries; $\text{vec}(\cdot)$ vectorizes a tensor by stacking its matrices column-wise. \section{System Model} \label{sec:model} \begin{figure} \centering \includegraphics[width=6.0cm]{figures/TensorSamples} \caption{Illustration of sub-Nyquist sampling. Different colors refer to different transmit antenna elements. The solid circles denote sampling instants along the virtual aperture. The triangles in one Frequency-Pulse plane indicate the measurements correspond to the same transmit and receive elements.} \label{Fig:SpatialCompression} \end{figure} Consider a traditional collocated MIMO radar with full Nyquist sampling. The operating wavelength of the radar is $\lambda$ and the total number of transmit and receive elements are $T$ and $R$, respectively. The MIMO antenna adopts a virtual Uniform Linear Array (ULA) structure, with receive antennas spaced $\lambda/2$ and transmit antennas spaced by $R\lambda/2$. The coherent processing of a total of $TR$ channels in the receiver creates a virtual equivalent of a phased array antenna that has $TR$ elements each spaced $\lambda/2$ distance apart. As shown in Fig. \ref{Fig:SpatialCompression}, spatial compression is realized by a thinned array, which has $M<T$ transmit and $Q<R$ receive antennas, as in \cite{Cohen2016SUMMeR}. The $m$th transmitting antenna is located at $\xi_m\lambda/2$, and the $q$th receive antenna is located at $\zeta_q\lambda/2$, where $\xi_m$ and $\zeta_q$ are integers. The pulse train sent by the $m$th transmitting antenna over a coherent processing interval (CPI) spanning duration of $P$ pulses is \par\noindent \small\begin{equation} s_m(t)=\sum_{p=0}^{P-1}\delta_{m}[p]\cdot h_m(t-p\tau)e^{j2\pi f_c t}, \quad0\le t\le P\tau, \end{equation}\normalsize \noindent where $\tau$ denotes the pulse repetition interval (PRI), $P\tau$ is the coherent processing interval (CPI), ${{f}_{c}} = c/\lambda$ is the common carrier frequenc , $c$ is the speed of light, $\delta_m[p]=1$ or $0$ indicates whether in the $p$th PRI, the $m$th transmitter emits a pulse or not, and $\{{{h}_{m}}\left( t \right)\}_{m=0}^{M-1}$ is a set of narrowband, orthogonal pulses each with the continuous-time Fourier transform (CTFT) $H_m(\omega)=\int\limits_{-\infty}^{\infty}h_m(t)e^{-j\omega t}dt$. In TenDSuR, only $P_m < P$ pulses are emitted by each transmitter in a CPI and $\delta_m[p]$ can admit different values for the same $p$ and different $m$. In SUMMeR, $\delta_m[p]$ is always unity for all $m$ and $p$. We define the total duration for which the antenna elements are dedicated to a specific RF service as the aperture occupancy, $\mathrm{AO}=\sum_{m=0}^{M-1}P_m$. Suppose there exist $L$ non-fluctuating point targets (Swerling-0 model), where the $l^{\text{th}}$ target is characterized by its complex reflectivity $\alpha_l$, range $r_l$, radial velocity $v_l$, DoA $\vartheta_l = \sin\theta_l$ ,and $\theta_l$ is the azimuth. As derived in \cite{Cohen2016SUMMeR}, the received echo of the $p$th pulse at the $q$th receiving antenna can be represented by its Fourier series, as \par\noindent \small\begin{equation} x_q^p(t)=\sum_{n\in\mathbb{Z}}c_q^p[n]e^{-j2\pi nt/\tau}, \end{equation}\normalsize where for $-NT/2\leq n\leq NT/2-1$, with $N=B_h\tau$, \par\noindent\small \begin{eqnarray} \label{Eq:EchoCoefficientsPartial_scalar} c_q^p[n]=\frac{1}{\tau}\sum_{m=0}^{M-1}\sum_{l=1}^{L}\delta_m[p]\cdot\alpha_le^{j2\pi\beta_{mq}\vartheta_l}e^{-j\frac{2\pi}{\tau}n\tau_l}e^{-j2\pi f_l^Dp\tau}H_m\left(\frac{2\pi}{\tau}n\right), \end{eqnarray} \normalsize where time delay $\tau_l = 2r_l/c$ is proportional to $l$th target's range $r_l$, $f_l^D=2\frac{v_l}{c}f_c$ is the Doppler frequency, parameter ${\beta _{mq}} = ({\zeta _q} + {\xi _m})({f_m}\frac{\lambda }{c} + 1)$ is governed by the array structure We now apply Xampling in time, pulses and space to obtain low-rate samples of the received signal. The sampling technique is the same as in temporal sub-Nyquist radar \cite{barilan2014focusing}, except that now the samples are obtained in range, Doppler and azimuth domains. The received signal $x^p_q(t)$ is downconverted to baseband, separated into $M$ channels, aligned and normalized. The Fourier coefficients of the received signal corresponding to the channel that processes the $p$th pulse of $m$th transmitter echo at the $q$th receiver are\par\noindent\small \begin{eqnarray} \label{Eq:BasebandEchoCoefficients} y_{mq}^p[k]&=&\tau H^{\ast}_m(2\pi k/\tau + f_m)c_{q}^{p}[k+f_m \tau]/|H_0(2\pi k/\tau){|^2}\nonumber\\ &=&\sum_{l=1}^{L}\delta_m[p]\cdot\alpha_le^{j2\pi\beta_{mq}\vartheta_l}e^{-j\frac{2\pi}{\tau}k\tau_l}e^{-j2\pi f_m\tau_l}e^{-j2\pi f_l^{D}p\tau}. \end{eqnarray}\normalsize where $-\frac{N}{2} \leq k \leq -\frac{N}{2}-1$, $f_m$ is the (baseband) carrier frequency of the $m$th transmitter and $N$ is the number of Fourier coefficients per channel. Xampling obtains a set $\mathcal{K}$ of arbitrarily chosen Fourier coefficients from low rate samples of the received channel signal such that $|\mathcal{K}| = K < N$. Let $\mathbf{Z}^m$ be the $KQ\times P_m$ matrix with $q$th column given by the vertical concatenation of $y_{mq}^p[k]$, $k \in \mathcal{K}$, $0 \leq q \leq Q-1$ and $p \in \Pi_m$, where $\Pi_m$ is the set of pulses chosen arbitrarily for transmission by the $m$th transmit antenna out of a total of $P$ pulses such that $|\Pi_m| = P_m$. We can write $\mathbf{Z}^m$ as \par\noindent \small\begin{equation} \label{Eq:SUMMeRMode2} \mathbf{Z}^m=(\mathbf{B}^m\otimes\mathbf{A}^m)\mathbf{X}_{\rm{D}}(\mathbf{F}^m)^T, \end{equation}\normalsize where $\mathbf{A}^m$ denotes the $K \times TN$ matrix whose $(k,n)$th element is $e^{- j \frac{2 \pi}{TN} \mathcal{K}_kn} e^{-j2\pi \frac{f_m}{B_h} \frac{n}{T}}$ with $\mathcal{K}_k$ the $k$th element in $\mathcal{K}$, $\mathbf{B}^m$ is the $Q \times TR$ matrix with $(q,p)$th element $e^{-j2 \pi \beta_{mq} (-1 +\frac{2}{TR}p)}$ and $\mathbf{F}^m$ denotes the $P_m \times P$ partial Fourier matrix. The matrix $\mathbf{X}_D$ is a $T^2NR \times P$ sparse matrix that contains the values $\alpha_l$ at the $L$ indices. In TenDSuR, the row size of partial Fourier matrix $\mathbf{F}^m$ can be different across all $m$. However, in SUMMeR, $\mathbf{F}^m$ is always a full Fourier matrix for all transmitters. Vectorizing both sides of (\ref{Eq:SUMMeRMode2}) gives $\mathrm{vec}(\mathbf{Z}^m)=\mathrm{vec}((\mathbf{B}^m\otimes\mathbf{A}^m)\mathbf{X}_{\rm{D}}(\mathbf{F}^m)^T) =(\mathbf{F}^m\otimes\mathbf{B}^m\otimes\mathbf{A}^m)\mathrm{vec}(\mathbf{X}_{\rm{D}})$. Consider a $K\times Q\times P_m$ tensor $\mathcal{Z}^m$ such that $\mathrm{vec}(\mathbf{Z}^m)=\mathrm{vec}(\mathcal{Z}^m)$. Then, \par\noindent \small\begin{equation} \label{Eq:TensorModel_m} \mathcal{Z}^m=[\![\mathcal{X}; \mathbf{A}^m, \mathbf{B}^m, \mathbf{F}^m]\!], \end{equation}\normalsize where $\mathcal{X}\in\mathbb{C}^{TN\times TR\times P}$ such that $\mathrm{vec}(\mathbf{X}_{\rm{D}})=\mathrm{vec}(\mathcal{X})$. The matrices $\mathbf{A}^m$, $\mathbf{B}^m$ and $\mathbf{F}^m$ are obtained by selecting $K$, $Q$ and $P_m$ rows, respectively, of their full counterparts: $TN\times TN$ matrix $\mathbf{A}$, $TR\times TR$ matrix $\mathbf{B}$ and $P \times P$ matrix $\mathbf{F}$. Hence, the partial tensor $\mathcal{Z}^m$ is obtained by selecting a total of $KQ\sum_{m=0}^{M-1}P_m$ entries from the corresponding full tensor $\mathcal{Z}=[\![\mathcal{X}; \mathbf{A}, \mathbf{B}, \mathbf{F}]\!]$ of size $TN\times TR\times P$. For on-grid targets, the Fourier coefficients of the received signal are obtained from $\mathcal{Z}$ as \par\noindent \small\begin{equation} \label{Eq:SignalModelTensor} \bar{\mathcal{Z}} = \mathcal{P}_{\Gamma}\{\mathcal{Z}\} = \mathcal{P}_{\Gamma}\big\{[\![\mathcal{X}; \mathbf{A}, \mathbf{B}, \mathbf{F}]\!]\big\}, \end{equation}\normalsize where $\bar{\mathcal{Z}}$ represents the entries of $\mathcal{Z}$ specified by the set $\Gamma$ which is constructed as per the Algorithm~\ref{Alg:Construction}. Here, the sets $\Omega$, $\Lambda$ and $\Pi$ index the rows of $\mathbf{A}^m$, $\mathbf{B}^m$ and $\mathbf{F}^m$ selected from $\mathbf{A}$, $\mathbf{B}$ and $\mathbf{F}$, respectively. \begin{algorithm} \caption{The construction of index sets $\Gamma$, $\Omega$, $\Lambda$, and $\Pi$.} \label{Alg:Construction} \begin{algorithmic}[1] \Require $H_m(2\pi (k)/\tau)$; \Ensure $\Gamma$, $\Omega$, $\Lambda$, $\Pi$, ; \State $\Gamma={\emptyset}$, $\Omega={\emptyset}$, $\Lambda={\emptyset}$, $\Pi={\emptyset}$, ; \For{$m=0$ to $M-1$} \For{$q=0$ to $Q-1$} \For{$p=0$ to $P-1$} \For{$k\in\mathcal{K}$ \If {$\delta_m[p]\cdot|H_m(2\pi k/\tau)| \neq 0$ } \State $\Gamma=\Gamma \cup \{k+f_m \tau,\xi_m+\zeta_q,p\}$ $\Omega=\Omega \cup \{k+f_m \tau\}$, $\Lambda = \Lambda \cup \{\xi_m+\zeta_q\}$, $\Pi=\Pi \cup \{p\}$, \EndIf \EndFor \EndFor \EndFor \EndFor \end{algorithmic} \end{algorithm} For continuous-valued parameters, the entries of $\bar{\mathcal{Z}}$ are \par\noindent \small\begin{equation} \label{Eq:EchoCoefficientsPartial} [\bar{\mathcal{Z}}]_{k+f_m\tau,\xi_m+\zeta_q,p}=\sum_{l=1}^{L}\alpha_l \cdot e^{j2\pi\beta_{mq} \vartheta_l} e^{-j\frac{2\pi}{\tau}k\tau_l } e^{-j2\pi f_m\tau_l}e^{-j2\pi f_l^Dp\tau} \end{equation}\normalsize \section{Target Recovery} \label{sec:algorithm} We first derive the number of samples needed for perfect recovery of $\{\alpha_l, \vartheta_{l}, \tau_{l}, f^D_{l}\}_{l=1}^L$ or $\mathcal{X}$. In the results below, the total number of transceiver frequencies, antennas, and pulses equals the number of $\bar{\mathcal{Z}}$'s non-zero matrix slices obtained by fixing the first, second, and third index, respectively \begin{theorem} \label{TH: MiniContin} The minimal total number of antenna channels, transceiver frequencies, and pulses required for perfect recovery of $L$ off-grid targets in a noiseless setting are each no less than $2L$ \end{theorem} \begin{IEEEproof} We first prove the necessary condition for the overall number of pulses. The cases for overall number of antenna channels and transceiver frequency points are similar. Consider the case where all targets have identical DoAs and ranges, as $\vartheta_l=\vartheta_0$, $\tau_l=\tau_0$. Then, from (\ref{Eq:BasebandEchoCoefficients}), \begin{eqnarray} \label{Eq:EchoCoefficientsIdential} &&e^{j2\pi\tau_{0} (f_m\tau+k)/\tau}e^{j2\pi\vartheta_{0}(\xi_m+\zeta_q)}\tau H^{\ast}_m(2\pi k/\tau+f_m)c_{q}^{p}[k+f_m \tau] = \nonumber\\ &&|H_0(2\pi k /\tau)|^2\sum_{l=1}^{L}\delta_m[p]\cdot\alpha_l e^{-j2\pi f_l^D p}. \end{eqnarray} Summing over $m=0, \dots, M-1$, $q=0, \dots, Q-1$, and $k\in \mathcal{K}$ on both sides yields \par\noindent \small\begin{equation} \label{Eq:EchoCoefficientsEqual} z'[p]=\sum_{l=1}^{L}\alpha_l e^{-j2\pi f_l^D p}, \end{equation}\normalsize where \begin{flalign} \label{Eq:EchoCoefficientsEqualDef} z'[p]=&\frac{\sum_{m=0}^{M-1}\sum_{q=0}^{Q-1}\sum_{k\in \mathcal{K}}e^{j2\pi\tau_{0} (f_m\tau+k)/\tau}e^{j2\pi\vartheta_{0}(\xi_m+\zeta_q)}H^{\ast}_m(2\pi k/\tau+f_m)}{Q\sum_{m=0}^{M-1}\sum_{k\in \mathcal{K}}\delta_m[p]\cdot|H_0(2\pi k/\tau)|^2 }\nonumber\\ &\cdot c_{q}^{p}[k+f_m \tau]. \end{flalign} In (\ref{Eq:EchoCoefficientsEqualDef}), if there exists a pulse index $p'$ such that for all $k\in \mathcal{K}$, $m=0, \dots, M-1 $, the term $\delta_m[p']\cdot|H_0(2\pi k/\tau)|^2$ in the denominator vanishes, then $z'[p']$ is undefined. Then, according to FRI theory, there are only $2L$ degrees of freedom in (\ref{Eq:EchoCoefficientsEqual}) thereby requiring no less than $2L$ overall pulses for a successful recovery of $L$ targets. \end{IEEEproof} \begin{theorem} \label{TH: MiniDiscre} The minimal total number of antenna channels, transceiver frequencies, and pulses required for perfect recovery of $\mathcal{X}$ with $L$ on-grid targets in a noiseless setting are each no less than $2L$. \end{theorem} \begin{IEEEproof} For all $k\in \mathcal{K}, m=0, \dots, M-1, p=0,\dots P-1$, if $|H_0(2\pi k/\tau)|^2\neq 0$, then he signal model in (\ref{Eq:SignalModelTensor}) can be unfolded as the following $KQ\sum_{m=0}^{M-1}P_m$ equations \par\noindent \small\begin{equation} [\bar{\mathcal{Z}}]_{k,\xi_m+\zeta_q,p}=\left(([\mathbf{F}^T]_p)^T\otimes ([\mathbf{B}^T]_{\xi_m+\zeta_q})^T\otimes ([\mathbf{A}^T]_{k})^T\right)\rm{vec}(\mathcal{X}). \end{equation}\normalsize As per the FRI theory and Lemma 1 in \cite{Cohen2016SUMMeR}, the sparse tensor $\mathcal{X}$ can be perfect recovered provided \par\noindent \small\begin{equation} \min\left\{spark(([\mathbf{F}^T]_{\Pi})^T), spark(([\mathbf{A}^T]_{\Omega})^T),spark(([\mathbf{B}^T]_{\Lambda})^T)\right\}> 2L.\nonumber \end{equation}\normalsize As per $\Omega$, $\Lambda$, and $\Pi$, if the overall number of tranceived frequency points is larger than $2L$, then $ spark(([\mathbf{A}^T]_{\Omega})^T)>2L$; if the overall number of antenna channels is larger than $2L$, then $spark(([\mathbf{B}^T]_{\Lambda})^T)>2L$; and if the overall number of pulses is larger than $2L$, then $spark(([\mathbf{F}^T]_{\Pi})^T)>2L$. \end{IEEEproof} The crucial difference between the above two theorems and their counterparts Theorems 3 and 4 in \cite{Cohen2016SUMMeR}, is that in SUMMeR, all transmitters have to transmit no less than $2L$ pulses in one CPI. However, in TenDSuR, we need at least $2L$ pulses in a CPI but only one transmitter need to be active. This significantly reduces the AO of an RF service. As the reserved antenna elements can be used for other services, the efficiency of the multi-function RF aperture is remarkably improved. For continuous target parameters, one could estimate the unknown parameters via TC \cite{gandy2011tensor} and parallel factor analysis (PARAFAC)\cite{Sidiropoulos2017Tensor} or higher order harmonic retrieval algorithms\cite{Haardt2008Higher}. In this work, we utilize the Hankel Matrix nuclear norm Regularized low-CP-rank Tensor Completion (HMRTC) introduced in \cite{Ying2017Hankel}, which explores both the low-CP-rank and the Vandermonde structure of the tensor ${\mathcal{Z}}$, to recovery the targets' DoAs, ranges, and velocities \par\noindent \small\begin{align} \label{Eq:HMRTC} \{\hat{\mathbf{a}}_{l}, \hat{\mathbf{b}}_{l}, \hat{\mathbf{f}}_{l}\}_{l=1}^{L}=&\arg\min_{\{\mathbf{a}_{l}, \mathbf{b}_{l}, \mathbf{f}_{l}\}_{l=1}^{L}} \sum_{l=1}^{L} \|\mathcal{H}\{\mathbf{a}_{l}\}\|_{\ast}+\|\mathcal{H}\{\mathbf{b}_{l}\}\|_{\ast}+\|\mathcal{H}\{\mathbf{f}_{l}\}\|_{\ast}\nonumber\\ &+\frac{\mu}{2}\left\|\mathcal{P}_{\Gamma}\left\{\sum_{l=1}^{L} {{\bf{a}}_{l}} \circ {{\bf{b}}_{l}} \circ {{\bf{f}}_{l}}\right\}-\mathcal{P}_{\Gamma}\{\mathcal{Z}\}\right\|_2^2, \end{align}\normalsize where $\mu$ is a regularization parameter \cite{Ying2017Hankel} and, as per (\ref{Eq:EchoCoefficientsPartial}), \par\noindent\small\begin{equation} \begin{array}{l} {{\bf{a}}_l} = {\left[ {1,{e^{ - j2\pi \frac{{{\tau _l}}}{\tau }}}, \ldots ,{e^{ - j2\pi (TN - 1)\frac{{{\tau _l}}}{\tau }}}} \right]^T},\\ {{\bf{b}}_l} = {\left[ {1,{e^{ - j2\pi ({f_m}\frac{\lambda }{c} + 1){\vartheta _l}}}, \ldots ,{e^{ - j2\pi (TR - 1)({f_m}\frac{\lambda }{c} + 1){\vartheta _l}}}} \right]^T},\\ {{\bf{f}}_l} = {\left[ {1,{e^{ - j2\pi f_l^D\tau }}, \ldots ,{e^{ - j2\pi (P - 1)f_l^D\tau }}} \right]^T}. \end{array} \end{equation}\normalsize The target parameters are obtained after recovering $\{\hat{\mathbf{a}}_{l}, \hat{\mathbf{b}}_{l}, \hat{\mathbf{f}}_{l}\}_{l=1}^{L}$. For on-grid target parameters, the $\mathcal{X}$ or $\mathbf{x}$ is retrieved by solving the sparse recovery problem: \par\noindent \small\begin{equation} \label{Eq:DefTensorL0MinNoisy} \min_{\mathcal{X}}\|\mathcal{X}\|_{0}\phantom{1}\text{subject to}\phantom{1} \|\mathcal{P}_{\Gamma}\{[\![\mathcal{X}; \mathbf{A}, \mathbf{B}, \mathbf{F}]\!]\}-\mathcal{P}_{\Gamma}\{\mathcal{Z}\}\|_2\leq \varepsilon,\end{equation}\normalsize where $\varepsilon$ is the error threshold determined by the noise power. Among several CS algorithms to solve this problem \cite{eldar2012compressed}, we use Orthogonal Matching Pursuit (OMP) \cite{eldar2015sampling}, popular for its good trade-off between recovery accuracy and computational load. Our Algorithm~\ref{Alg:OMP} is the tensor version of OMP. Here, \par\noindent \small\begin{equation} \label{Eq:SupportObservingMatrix} \mathbf{U}_{\Phi_i}\triangleq[\bar{\mathbf{F}}]_{\Phi_{i}(3)}\diamond[\bar{\mathbf{B}}]_{\Phi_{i}(2)}\diamond[\bar{\mathbf{A}}]_{\Phi_{i}(1)} \end{equation}\normalsize where $\bar{\mathbf{A}}=[\mathbf{A}_0^T, \mathbf{A}_1^T,\dots, \mathbf{A}_{M-1}^T]^T$, $\bar{\mathbf{B}}=[\mathbf{B}_0^T, \mathbf{B}_1^T,\dots, \mathbf{B}_{M-1}^T]^T$, $\bar{\mathbf{F}}=[\mathbf{F}_0^T, \mathbf{F}_1^T,\dots, \mathbf{F}_{M-1}^T]^T$, and $\Phi_i$ is a set whose entries are triples of integers, and $\Phi_{i}(j)$ $(j=1, 2, 3)$ is a set composed of all the $j$th integer in the triples. $\Omega_{\Gamma}$ is a set of integers which has the same cardinality as $\Gamma$, and the $k$th entry of $\Omega_{\Gamma}$ is $[\Gamma(1)]_k\cdot (TR)P + [\Gamma(2)]_k\cdot P + [\Gamma(3)]_k$, where the definition of $\Gamma(j)$ is similar as that of $\Phi_{i}(j)$. Once the tensor $\mathcal{X}$ and its support set $\Phi$ are recovered, the target parameters are estimated as $ \phantom{1}\hat{\tau}_l=\frac{\tau}{TN}\phi_{l}(1)$, $\phantom{1}\hat{\vartheta}_l=\frac{2}{TR}\phi_{l}(2)$ and $\phantom{1}\hat{f}^D_l=\frac{1}{P\tau}\phi_{l}(3).$ \begin{algorithm} \caption{Target Recovery in TenDSuR through OMP} \label{Alg:OMP} \begin{algorithmic}[1] \Require $\Gamma$, $\bar{\mathcal{Z}}$, $L$; \Ensure Estimated support $\hat{\Phi}$ of $\mathcal{X}$, sparse tensor estimate $\hat{\mathcal{X}}$; \State (\textit{Initialization}): $\mathcal{R}=\bar{\mathcal{Z}}$, $\Phi_0={\emptyset}$, $i=1$; \State (\textit{Projection}): $\mathcal{Y} = [\![\mathcal{R}; \mathbf{A}^H, \mathbf{B}^H, \mathbf{F}^H]\!]$; \State (\textit{Support set augmentation}): $\Phi_i=\Phi_{i-1}\cup \{\phi_i\}$, where \par\noindent \small\begin{equation} \phi_i=\big\{\phi_{i}(1),\phi_{i}(2),\phi_{i}(3)\big\} =\arg\max_{\{s_1,s_2,s_3\}}\big|[\mathcal{Y}]_{s_1,s_2,s_3}\big|;\nonumber \end{equation}\normalsize \State (\textit{Signal estimation}): $ \bm{\alpha}_i=\big(\mathbf{U}_{\Phi_i}^H\mathbf{U}_{\Phi_i}\big)^{-1}\mathbf{U}_{\Phi_i}^H\mathcal{S}_{\emptyset}\left\{\mbox{vec}\big(\bar{\mathcal{Z}}\big)\right\};\nonumber $ \State (\textit{Compute residual}): $ \mathcal{R} = \bar{\mathcal{Z}}-\mathcal{P}_{\Gamma}\left\{\sum_{l=1}^{i}[\bm{\alpha}_i]_l \cdot \left([\mathbf{A}]_{\phi_{l}(1)}\circ[\mathbf{B}]_{\phi_{l}(2)}\circ[\mathbf{F}]_{\phi_{l}(3)}\right)\right\}$; \State (\textit{Iteration}): if $i < L$, $i=i+1$ and go to Step 2, else stop; \State (\textit{Output}): $\hat{\Phi} = \Phi_L$; $\hat{\mathcal{X}}\in \mathbb{C}^{TN\times TR\times P}$, where \par\noindent \small\begin{equation} [\hat{\mathcal{X}}]_{\phi_{l}(1),\phi_{l}(2),\phi_{l}(3)} =\left\{\begin{array}{cc} [\bm{\alpha}]_l, &l=1,2,\dots, L,\nonumber\\ 0, &\mbox{otherwise.} \end{array} \right. \end{equation}\normalsize \end{algorithmic} \end{algorithm} \section{Numerical Experiments} \label{sec:results} In all our numerical experiments, radar with full antenna aperture $TR=20$, $\lambda = 0.03$ m, $P=16$, and $\tau = 0.016$ ms was compressed by a thinned MIMO array with $M = 2$ transmit and $Q = 5$ receive elements with locations $\{0,\phantom{1}\lambda/2\}$ and $\{\lambda,\phantom{1}5\lambda/2,\phantom{1}11\lambda/2,\phantom{1}13\lambda/2,\phantom{1}15\lambda/2\}$, respectively. The native range resolution corresponding to the full bandwidth is $150$ m. Thus, $TN=16$. We assumed additive white Gaussian noise was present at each receiver with identical noise power. We consider the matched filter definition of the signal-to-noise-ratio, $ {\rm{SNR}} = \frac{\left(\sum_{m=0}^{M-1}\sum_{k\in\mathcal{K}}|H_0(2\pi k/\tau)|\right)^2}{\sigma^2\cdot KQ\sum_{m=0}^{M-1}P_m}$, where $\sigma ^2$ denotes the noise power corresponding to the bandwidth $1/\tau$ of a single receiver. \begin{figure} \centering \includegraphics[width=8.5cm]{figures/fig2_3} \caption{(a) The recovered normalized delay-Doppler-DoA map. Detections via tensor-OMP, TC and SUMMeR are indicated by circles, diamonds, and oblique crosses respectively. The crosses indicate true location of the targets. (b) Hit rate comparison under different SNRs and compression ratios. (TEF for total energy fixed and SPEF for single pulse energy fixed.)} \label{Fig:Fourtarget_DifferentSNR} \end{figure} First, we provide an example of target detection with S-S-D-T compression. We consider a target scene with $L = 4$ targets distributed in the direction-range-velocity observation scene, whose reflectivities were all set to unity (see Fig.~\ref{Fig:Fourtarget_DifferentSNR}(a)). Two of the targets were placed on the grid while the others were off-grid. In every PRI, the number of frequency points transmitted by each transmitter were $4$, i.e. a quarter of the whole bandwidth. The frequency points of the two transmitters were kept different from each other to ensure waveform orthogonality. To quantify the effect of dilution in the Doppler domain, we define the Normalized Aperture Occupancy (NAO) as the AO divided by the whole transmit pulse product: $ \mathrm{NAO}=\frac{\sum_{m=0}^{M-1}P_m}{M P}$. In this experiment, each transmitter sent only $4$ pulses implying $\mathrm{NAO}=0.25$. In comparison, the NAO of SUMMeR must be no less than $0.5$. We apply the hit-or-miss criterion as the performance metric to compare tensor-OMP and TC. Here, a ``hit'' occurs when the estimated target is within one Nyquist bin (defined as $2/(TR)$, $\tau/(TN)$, and $1/(P\tau)$ for the DoA, delay and Doppler, respectively - from the true target location. In Fig.~\ref{Fig:Fourtarget_DifferentSNR}(a), the on-grid targets are successfully detected by both OMP and TC. However, only TC showed successful detections of off-grid targets at the exact location while OMP found several solutions many bins away from the true target location. The Doppler-focusing-based SUMMeR recovery algorithm \cite{Cohen2016SUMMeR} fails to recover most of the targets. Next, we placed $L = 2$ targets on the scene. Each pulse contained $4$ frequency points. The hit rate was computed over 10,000 Monte-Carlo trials (see Fig. \ref{Fig:Fourtarget_DifferentSNR}(b)). We note that when the total transmitted energy is the same, the reduction of AO does not significantly influence target detection. On the other hand, when the transmit energy in each pulse is fixed, performance deteriorates and the hit rate curve moves to approximately $3$ dB and $6$ dB to the right for $\mathrm{NAO}=0.5$ and $0.25$, respectively \clearpage \balance \bibliographystyle{IEEEtran}
\section{Introduction} In a large class of X-ray spectroscopic techniques like X-ray photoemission spectroscopy (XPS), X-ray absorption spectroscopy (XAS) and resonant inelastic X-ray scattering (RIXS) an incident high energy X-ray photon (typically with an energy $\sim 1-10\mbox{ keV}$) knocks an electron out of a deep core level state either out of the sample (XPS) or to an unoccupied state in the conduction band (XAS and RIXS) thereby creating a hole in the deep core level state. The conduction band electrons then feel a local attractive static potential due to the created core-hole and the system relaxes to a new orthogonal ground state through particle-hole excitations in the conduction band. As a direct consequence of this many body effect, the XAS and XPS show power-law divergences at the threshold energy when $T=0$. This phenomenon is known as the orthogonality catastrophe, as proposed by Anderson.~\cite{AndersonPRL1967} For noninteracting metals at zero temperature the exponent of the power law and the relative intensity~\cite{MahanPR1967,NozieresPR1969,DoniachJPC1970} of the XPS spectra are well understood. At finite temperature the power-law singularity is cut off by the thermal fluctuations. Much less is known about the fate of the power law divergence in the XPS spectra of strongly correlated metals and Mott insulators, although this question has been examined by others.\cite{LeePRL1992,MedenPRB1998,CornagliaPRB2007} The theory for strongly correlated XPS can be applied to XPS studies of transition-metal oxide compounds~\cite{HoribaPRL2004,KimPRL2004,TaguchiPRB2005,PanaccionePRL2006}, which are either Mott insulators or doped Mott insulators with interesting ground state magnetic properties. Cornaglia and Georges\cite{CornagliaPRB2007} have studied core-level photoemission spectra of the Hubbard model across the metal-insulator transition. The calculated XPS spectra in the metallic phase show an asymmetric power law divergence with an exponent that depends on both the Hubbard interaction $U$ and the core-hole potential $Q$. With increasing $U$, the exponent either vanishes continuously (when $Q$ is less than half the bandwidth) or remains nearly constant, but the weight under the peak vanishes (when $Q$ is more than half the bandwidth). This study was limited to zero temperature so it is not able to determine how the behavior changes as the temperature is raised (except to note that an actual power-law divergence only holds exactly at $T=0$). These thermal effects become increasingly important for anticipated experiments with X-ray free-electron lasers, where pumping the system before probing it can lead the system to be in an effective high-temperature state. This work would then be a first approximation to describing that complicated nonequilibrium phenomena by an effective high-temperature equilibrium theory. We study the temperature dependence of core-hole spectral function in the Falicov-Kimball (FK) model,\cite{FalicovPRL1969} which is also the XPS spectral function because the core-hole level is so far below the Fermi level. The FK-model can be thought of as a special case of the more general Hubbard model in which one of the spin species (say the down spins) is static, while the other spin species (say the up spins) hop through the annealed background of the static spin species with a nearest-neighbor hopping amplitude $t$. When two electrons of opposite spin are on the same lattice site, they interact with a Coulomb interaction $U$. Despite its simplicity, the FK-model has a metal-insulator transition for large Coulomb repulsion $U>U_{c}$ and is exactly solvable via dynamical mean-field theory (DMFT).\cite{freericks_zlatic_review} The local propagator for the itinerant species can be calculated exactly while the propagator for the static species can be calculated systematically by using numerical renormalization group~\cite{WilsonRMP1975,KrishnamurthyPRB,KrishnamurthyPRB2,BullaRMP2008,AndersPRL2005,AndersPRB2006,PetersPRB2006,WeichselbaumPRL2007} (NRG) or the Weiner-Hopf sum equation approach~\cite{McCoyBook,ShvaikaCMP2008,ShvaikaCMP2012} (at finite temperature). The most notable difference between the two models is that the metallic state of the FK-model is a non-Fermi liquid, while the metallic state in the Hubbard model is a Fermi liquid. The insulating state in both models has the same origin and the charge dynamics in the incompressible Mott insulating state is similar. This relationship between the two models in the insulating phase has been illustrated in studies of nonresonant Raman scattering.\cite{FreericksPRB2001,FreericksPRB2001s} We introduce an additional core-hole into the FK-model and study its finite temperature spectral properties using the Wiener-Hopf sum equation approach for various parameter strengths. This gives the XPS spectral function as well. The organization of the rest of the paper is as follows; In Sec. II, we introduce the core-hole problem, in Sec. III we introduce a mathematical formulation for calculation of the real time Green's function. In Sec. IV, we study the core-hole spectral function using the Wiener-Hopf sum equation approach and finally, in Sec. V, we conclude. \section{Core-hole problem in the Falicov-Kimball model} The Falicov-Kimball~\cite{FalicovPRL1969} was originally proposed as a model for rare-earth compounds near a metal-insulator transition. It involves the interaction between mobile conduction $d$-electrons and the static localized $f$-electrons. The model can be applied to real rare earth compounds in an approximate way (in the \textit{incoherent} high temperature region).\cite{ybin4} The Hamiltonian for the Falicov-Kimball model (in the hole representation, with an additional core hole) is given by \begin{eqnarray} \mathcal{H} & = & -\frac{t^{*}}{2\sqrt{D}}\sum\limits_{\langle ij \rangle} d_{i}^{\dagger}d_{j} - \sum_{i}\mu n_{di}+\sum_{i}(E_{f}-\mu)n_{fi}\nonumber \\ & & +\sum_{i}(E_{h}-\mu)n_{hi} + \sum_{i}Un_{di}n_{fi}+\sum_{i} Q_{d} n_{di}n_{hi}\nonumber \\ & & +\sum_{i}Q_{f}n_{fi}n_{hi}, \label{eq:Hcore-hole} \end{eqnarray} where $t^{*}/2\sqrt{D}$ is the nearest neighbor hopping amplitude of the itinerant $d$-holes on a $D$-dimensional hypercubic lattice and $\mu$ is the common chemical potential (we take the limit $D\to\infty$ and use $t^*$ as our energy unit). The symbols $n_{di}=d_{i}^{\dagger}d_{i}$, $n_{fi}=f_{i}^{\dagger}f_{i}$ and $n_{hi}=h_{i}^{\dagger}h_{i}$ are the occupation number operators for the $d$-hole, $f$-hole and the core-hole at a given site $i$, respectively. $U$ is the on-site repulsive Coulomb interaction between the itinerant $d$-hole and static $f$-hole, whereas $Q_{d}$ and $Q_{f}$ are the repulsive Coulomb interactions between the core-hole and the $d$-hole and $f$-hole, respectively. $E_{f}\sim 1\mbox{ eV}$ and $E_{h}\sim 0.1 - 10\mbox{ keV}$ are the site energies of the $f$ state and the core-hole state, respectively. The case of half-filling ($n_{f} = n_{d} = 0.5$) corresponds to the choice of $\mu=U/2$ and $E_{f} = 0$; this is the particle-hole symmetric case (in the restricted subspace involving $d$ and $f$ electrons only). Also, under a partial hole-particle transformation $d \rightarrow d^{\dagger}$ and $f \rightarrow f^{\dagger}$, the interaction between the core-hole and the $d$ and $f$ states transforms as $Q_{d} \rightarrow -Q_{d}$ and $Q_{f}\rightarrow -Q_{f}$, respectively, \textit{i.e.} becomes attractive instead and the core-hole energy $E_{h}$ gets shifted to $E_{h}+Q_{d}+Q_{f}$. Under DMFT, the model reduces to an effective single-impurity problem, described by the following local Hamiltonian \begin{eqnarray} \mathcal{H}_{\textrm{loc}} = Un_{d}n_{f}+Q_{d}n_{d}n_{h}+Q_{f}n_{f}n_{h}-\mu n_{n}\nonumber \\ +(E_{f}-\mu)n_{f}+(E_{h}-\mu)n_{h} \label{eq:Hloc} \end{eqnarray} along with an effective time-dependent bath (arising from the degrees of freedom at all other sites except the site chosen) to which the $d$-holes hop in and out. The equilibrium density matrix for the single-impurity problem is given by \begin{eqnarray} \rho = \rho_{\textrm{loc}}\mathcal{T}_{c}\exp\left\{ - i\int_{c} dt' \int_{c} dt'' d^{\dagger}(t')\lambda_{c}(t',t'')d(t'')\right\}, \label{eq: density_matrix} \end{eqnarray} where $\rho_{\textrm{loc}}=e^{-\beta H_{\textrm{loc}}}/\mathcal{Z}$, $\mathcal{Z}$ is the partition function (including the effects of the dynamical mean field), $\beta=1/k_{B} T$ is the inverse temperature and the time-ordering and integration are performed over the Kadanoff-Baym-Keldysh~\cite{Kadanoff-Baym,Keldysh} contour in Fig.~\ref{fig:KeldyshContour}. The time dependence of the operators in Eq.~(\ref{eq: density_matrix}) are given by the interaction representation with respect to $\mathcal{H}_{\textrm{loc}}$. \begin{figure}[!htb] \includegraphics[scale=1.0]{KeldyshContour.pdf} \caption{The Kadanoff-Baym-Keldysh contour. The contour starts at time $t=0$, moves forward in time along the real axis to time $t$ then moves backward in time along the real axis to time $t=0$ and finally moves downwards along the imaginary axis to time $-i\beta$.} \label{fig:KeldyshContour} \end{figure} The time-translation-noninvariant dynamical mean field $\lambda_{c}(t,t')$ is given by \begin{equation} \lambda_{c}(t,t')=-\frac{i}{\pi}\!\!\int\limits_{-\infty}^{+\infty}\!\!d\omega\textrm{Im}\left[\lambda(\omega)\right]e^{i\omega(t'-t)}\left[f(\omega) -\Theta_{c}(t,t')\right], \end{equation} where $f(\omega)=1/[1+\exp(\beta\omega)]$ is the Fermi-Dirac distribution function and $\Theta_{c}(t,t')$ is the Heaviside function on the contour which is equal to 1 when $t$ is ahead of $t'$ on the contour, is equal to $0$ when $t$ is behind $t'$ and is equal to 1/2 when $t=t'$. Note that the dynamical mean field $\lambda(\omega)$ and the chemical potential $\mu$ are obtained from the equilibrium solution of the impurity problem without the core-hole. This in effect means that we are treating the creation of the core-hole under the sudden approximation instead of a fully self-consistent nonequilibrium treatment. The creation of the core-hole under the sudden approximation is commonly done because it is consistent with experiments. Because of the conserved core-hole number, $n_{h}$, and the conserved $f$-hole number, $n_{f}$, the full Hilbert space of the core-hole problem can be expressed as the direct sum of the Hilbert spaces in each conserved $\{n_{h},n_{f}\}$ sector. For the spinless case, the total partition function for the single-impurity problem $\mathcal{Z}$ contains four terms $\mathcal{Z}_{\alpha}\equiv\mathcal{Z}_{n_{h}n_{f}}$, each of which corresponds to the partition function for the Hilbert space in the conserved $\{n_{h},n_{f}\}$ sector. We have \begin{eqnarray} \mathcal{Z}=\mathcal{Z}_{00}+\mathcal{Z}_{01}+e^{-\beta(E_{h}-\mu)}\left[\mathcal{Z}_{10}+Z_{11}\right] \end{eqnarray} with \begin{eqnarray} \mathcal{Z}_{00}&=&\left[1+e^{\beta\mu}\right]\prod_{m}\frac{i\omega_{m}+\mu-\lambda_{m}}{i\omega_{m}+\mu}\\ \mathcal{Z}_{01}&=&e^{\beta(\mu-E_{f})}\left[1+e^{\beta(\mu-U)}\right]\prod_{m}\frac{i\omega_{m}+\mu-U-\lambda_{m}}{i\omega_{m}+\mu-U}\\ \mathcal{Z}_{10}&=&\left[1+e^{\beta(\mu-Q_{d})}\right]\prod_{m}\frac{i\omega_{m}+\mu-Q_{d}-\lambda_{m}}{i\omega_{m}+\mu-Q_{d}}\\ \mathcal{Z}_{11}&=&e^{\beta(\mu-E_{f}-Q_{f})}\left[1+e^{\beta(\mu-U-Q_{d})}\right]\nonumber\\ &&\times\prod_{m}\frac{i\omega_{m}+\mu-U-Q_{d}-\lambda_{m}}{i\omega_{m}+\mu-U-Q_{d}}, \end{eqnarray} where $i\omega_{m}=i\pi(2m+1)k_{B}T$ is the fermionic Matsubara frequency and \begin{eqnarray} \lambda_{m}=\int_{0}^{\beta} d\tau \; e^{i\omega_{m}\tau}\lambda(\tau) \end{eqnarray} is the dynamical mean field evaluated at $i\omega_{m}$. The contour-ordered dynamical mean field $\lambda_{c}$ depends on the difference of its two time arguments when both of them lie on the imaginary time axis of the Kadanoff-Baym-Keldysh contour; we also use the notation $\lambda(\tau)=-i\lambda_{c}(-i\tau,0)$. \section{Real time Green's functions} We define the contour-ordered Green's function for the core-hole as \begin{eqnarray} G_{h}^{c}(t,t')=-i\langle\mathcal{T}_{c} \,h(t)h^{\dagger}(t')\rangle, \end{eqnarray} where the time ordering is taken along the Kadanoff-Baym-Keldysh contour shown in Fig.~\ref{fig:KeldyshContour} and $\langle\cdots\rangle$ corresponds to the trace weighted by the equilibrium density matrix in Eq.~(\ref{eq: density_matrix}). We also define the greater Green's function $G^{>}(t,t')=-i\langle h(t)h^{\dagger}(t')\rangle$ and lesser Green's function $G^{<}(t,t')=i\langle h^{\dagger}(t')h(t)\rangle$, which can all be expressed via \begin{eqnarray} G^{>}(t,t')=-\frac{i}{\mathcal{Z}}\sum_{m,n} e^{-\beta E_{m}}|\langle m|h|n\rangle|^{2} e^{i(E_{m}-E_{n})(t-t')}\\ G^{<}(t,t')=\frac{i}{\mathcal{Z}}\sum_{m,n} e^{-\beta E_{n}}|\langle n|h^{\dagger}|m\rangle|^{2} e^{i(E_{m}-E_{n})(t-t')}. \end{eqnarray} in the eigenbasis of the lattice Falicov-Kimball Hamiltonian with the additional core hole in Eq.~(\ref{eq:Hcore-hole}); the eigenstates satisfy $\mathcal{H}|n\rangle=E_n|n\rangle$. Note that we have suppressed the lattice site index in these equations, since the core-hole propagator is independent of the lattice site, but is always local, implying that the two hole creation and destruction operators must be from the same lattice site. Out of these two Green's functions we can construct retarded and advanced Green's functions, \begin{eqnarray} G_{h}^{r}(t,t') &=& -i\Theta(t-t')\langle\left[h(t),h^{\dagger}(t')\right]_{+}\rangle\\ &=& \Theta(t-t')\left[G_{h}^{>}(t,t')-G_{h}^{<}(t,t')\right],\nonumber\\ G_{h}^{a}(t,t') &=& i\Theta(t'-t)\langle\left[h(t),h^{\dagger}(t')\right]_{+}\rangle\\ &=& \Theta(t'-t)\left[G_{h}^{<}(t,t')-G_{h}^{>}(t,t')\right],\nonumber\\ \end{eqnarray} respectively. The symbol $\left[ A,B\right]_{+}=AB+BA$ represents the anticommutator. Equilibrium problems are time-translation invariant, because there is no preferred time. This is a property shared by the Green's functions, which follows by cyclic invariance of the trace and the fact that the lattice Hamiltonian commutes with itself. Hence, all of the Green's functions discussed here are functions only of $t-t'$. Furthermore, by relating the complex conjugate of a matrix element, to the Hermitian conjugate of the operators in the matrix element, we can also show that \begin{eqnarray} \left[G^{>}_{h}(t)\right]^{*}=-G^{>}_{h}(-t),\quad\left[G^{<}_{h}(t)\right]^{*}=-G^{<}_{h}(-t). \label{eq:conjgG} \end{eqnarray} The core-hole spectral function $A_{h}(\omega)$ is then determined from \begin{eqnarray} A_{h}(\omega)=-\frac{1}{\pi}\textrm{Im}\left[G_{h}^{r}(\omega+i0^+)\right]. \label{eq:Ahdefn} \end{eqnarray} In many cases, one can directly perform an analytic continuation from Matsubara frequencies to real frequencies, but there is no obvious way to do that here.\cite{BrandtZPB1992,ZlaticPhilMagB2001,FreericksPRB2005} Instead, one can always formulate the problem on the Kadanoff-Baym-Keldysh contour, and directly determine the Green's function as a function of time. It can then be Fourier transformed to frequency. This is the approach we adopt here. Furthermore, for most core level states involving atomic $1s$ and $2p$ orbitals the core-hole energy is large $E_{h} \gg 0$ ($E_{h} \sim 600\textrm{ eV}$). In this limit, the presence of the thermal factor given by $\exp[-\beta(E_{h}-\mu)]$, completely suppresses the lesser Green's function, which we can approximate by zero. Hence, we have that the greater Green's function is identical to the retarded Green's function in this limit, namely $G_{h}^{r}(t)=\Theta(t)G_{h}^{>}(t)$. So we only need to compute \begin{eqnarray} G_{h}^{>}(t) &=& -i\textrm{Tr}\biggl[\mathcal{T}_{c}\exp\left\{-i\!\int_{c}\!dt'\!\int_{c}\!dt'' d^{\dagger}(t')\lambda_{c}(t',t'')d(t'') \right\} \nonumber \\ && \times h(t)h^{\dagger}(0)\rho_{\textrm{loc}}\biggr], \label{eq:Ghgreater} \end{eqnarray} for $t\ge 0$. We begin by solving the equations of motion for the core-hole operators, given by \begin{eqnarray} \frac{dh(t)}{dt} = -i\left[Q_{d}n_{d}(t)+Q_{f}n_{f}(t)+E_{h}-\mu\right]h(t),\\ \frac{dh^{\dagger}(\bar{t})}{d\bar{t}} = i\left[Q_{d}n_{d}(\bar{t})+Q_{f}n_{f}(\bar{t})+E_{h}-\mu\right]h^{\dagger}(\bar{t}), \end{eqnarray} and substitute their solutions into Eq.~(\ref{eq:Ghgreater}), yielding \begin{equation} G^{>}_{h}(t)= -ie^{-i(E_{h}-\mu)t} \textrm{Tr}\left[e^{-\beta H_{0}}e^{-iQ_{f}n_{f}t} \;\mathcal{S}_{c}(t)h(0)h^{\dagger}(0)\right] \end{equation} where, \begin{eqnarray} \mathcal{S}_{c}(t)&=&\mathcal{T}_{c}\exp\left\{-i\int_{c}dt'\int_{c}dt'' d^{\dagger}(t')\lambda_c(t',t'')d(t'') \right. \nonumber \\ && \left. -i\int_{c} dt' Q_{c}(t,t')n_{d}(t')\right\}, \end{eqnarray} with $Q_{c}(t,t')=Q_{d}$ for $t\in[0,t]$ \textit{on the upper branch of the contour only} and zero otherwise. It is due to the lack of time translation invariance of the $Q_{c}$ field that we must use the Kadanoff-Baym-Keldysh formalism for the analytic continuation. Note, however, that the final Green's function will remain time-translation invariant. Since the core-hole occupation number $n_{h}=h^{\dagger}h$ is conserved, we have a projection onto states without a core-hole ($n_{h}=0$) only. Furthermore, since $n_f$ is also conserved, we add together the contributions for $n_f=0$ (top line) and $n_f=1$ (bottom line). This results in \begin{eqnarray} \label{eq:Ghgrt} &&{G}_{h}^{>}(t) = -\frac{i}{\mathcal{Z}}e^{-i(E_{h}-\mu)t}\textrm{Tr}\left[e^{\beta \mu n_{d}}\mathcal{S}_{c}(t)\right] \\ && -\frac{i}{\mathcal{Z}}e^{-i(E_{h}-\mu)t}e^{-\beta(E_{f}-\mu)}e^{-i Q_{f}t}\textrm{Tr}\left[e^{\beta(\mu-U)n_{d}}\mathcal{S}_{c}(t)\right],\nonumber \end{eqnarray} where the trace is now over the $d$-holes only. The evaluation of the remaining traces is straightforward, because the actions are quadratic in the $d$-electrons. But the steps one needs to follow are a bit involved. Following the methodology employed in the calculation of the $f$-particle propagator,\cite{ShvaikaCMP2008} we find \begin{eqnarray} \label{eq:Ggrtfinal} {G}_{h}^{>}(t)&=&-ie^{-i(E_{h}-\mu)t}\left[\frac{\mathcal{Z}_{00}}{\mathcal{Z}}\mbox{det}_{[0,t]} (\mathbb{I}-Q_{d}G_{00})\right . \nonumber \\ &+&\left .\frac{\mathcal{Z}_{01}}{\mathcal{Z}}e^{-iQ_{f}t}\mbox{det}_{[0,t]}(\mathbb{I}-Q_{d}G_{01})\right], \end{eqnarray} where the Green's functions in the determinants are \begin{eqnarray} G_{n_h,n_f}(\omega)=\frac{1}{\omega+i\delta - \epsilon_{n_h,n_f}-\lambda(\omega+i\delta)}, \end{eqnarray} in frequency space with $\epsilon_{n_{h}n_{f}}$ given by $\epsilon_{00}=-\mu$, $\epsilon_{01}=U-\mu$, $\epsilon_{10}=Q_{d}-\mu$, and $\epsilon_{11}=U+Q_{d}-\mu$. Note that the determinants in Eq.~(\ref{eq:Ggrtfinal}) are continuous matrix determinants over finite time intervals ranging from 0 to $t$. To determine the respective matrices in the time domain, we must recall that the identity matrix is given by a delta function and we must Fourier transform the real frequency Green's function back to the time representation. The continuous time determinants are in the Toeplitz form because the Green's function $G_{n_h,n_f}(t_1,t_2)=G_{n_h,n_f}(t_1-t_2)$ depends only on the difference of the two time arguments. Asymptotic limits ($t\rightarrow \infty$) of Toeplitz determinants can be easily calculated by using the Wiener-Hopf sum equation approach and Szeg\"{o}'s theorem~\cite{McCoyBook}. Two of us have also developed systematic finite-time corrections to these asymptotic forms.\cite{ShvaikaCMP2008} The finite time Toeplitz determinants can also be calculated through a discretization of the continuous matrix operators and a numerical integration over the Kadanoff-Baym-Keldysh contour. This latter method is found to be accurate in the small time region but becomes numerically intractable in the large time region because of the large matrices involved (due to the use of a fixed step size in time). We adopt a hybrid approach in which we use direct numerical evaluation of the Toeplitz determinants in the small time region and use Szeg\"{o}'s theorem and its finite time corrections to calculate the determinants in the large time region. This approach produces accurate real time Green's functions for all times. \section{Core-Hole Spectral function} We choose the familiar half-filling case which corresponds to $\langle n_{d}\rangle =\langle n_{f}\rangle=0.5$, $E_{f}=0$ and $\mu=U/2$, in the absence of the core-hole and as already mentioned we treat the creation of the core-hole under the sudden approximation; \textit{ i.e.} the creation of the core-hole does not modify the dynamics of the itinerant $d$-hole or static $f$-hole. We also choose hypercubic lattice, which in the limit of large dimensions ($D\rightarrow \infty$) has a Gaussian density of states \begin{eqnarray} D_{0}(\epsilon)=\frac{1}{\sqrt{\pi}}\exp{[-\epsilon^{2}]} \end{eqnarray} where we set $t^*=1$. In the absence of the core-hole, the Falicov-Kimball model has a Mott insulating ground state for $U > U_{c}=\sqrt{2}$, when spatial ordering is suppressed. The core-hole spectral function $A_{h}(\omega)$ is also the XPS response function in the deep core-hole limit. We study the evolution of $A_{h}(\omega)$ for various temperatures $T$, interaction strengths $U$, and core-hole potentials $Q_{d}$ and $Q_{f}$, keeping $Q_{d}=Q_{f}$ to reduce the number of parameters. \subsection{Weakly correlated metal} We first consider the case of a weakly correlated metal with $U=0.5$. As shown in Fig.~\ref{fig:SpectralFnU0.5} (a), the conduction electron spectral function $A_d(\omega)$ has a metallic density of states, with no gap. In Fig.~\ref{fig:SpectralFnU0.5} (b) and (c), we show the temperature evolution of the core-hole spectral function for small $Q_{d}=Q_{f}=1.0$ and large $Q_{d}=Q_{f}=5.0$ core-hole potentials. The term small and large is with respect to $U$. \begin{figure}[!htb] \begin{center} \includegraphics[scale=0.32,clip=]{PanelPlotU0_5muShiftInset.pdf} \caption{(Color on-line). Panel (a): Itinerant species spectral function, $A_{d}(\omega)$. Panel (b) and (c): Temperature dependence of the core-hole spectral function, $A_{h}(\omega)$, for small ($Q_{d}=Q_{f}=1.0$) and large ($Q_{d}=Q_{f}=5.0$) core-hole potentials. Inset Panel (c): Blown up region near the central peak. Axis labels are the same as in the main panel. Panel (d): Evolution of $A_{h}(\omega)$ for various core-hole potentials $Q_{d}=Q_{f}$ for a given temperature $T=0.1$. Parameters used for the calculations are all indicated in the figures. } \label{fig:SpectralFnU0.5} \end{center} \end{figure} $A_{h}(\omega)$ in Fig.~\ref{fig:SpectralFnU0.5}(b) shows two distinct peaks and a very broad hump whereas in Fig.~\ref{fig:SpectralFnU0.5}(c) we clearly see three distinct peaks. The peak structure can be easily understood from the atomic limit picture. Using the equation of motion, we can calculate the retarded core-hole Green's function as $\hat{G}_{h}^{r}(\omega)=\left(\omega+i\eta-E_{h}+\mu-Q_{d}\hat{n}_{d}-Q_{f}\hat{n}_{f}\right)^{-1}$, where one needs to insert the localized hole fillings for each sector. So, if we plot $A_{h}(\omega)$ as a function of $\omega-E_{h}+\mu$ then we will see two delta function peaks at $0$ and $Q_{d}$ for $n_{f}=0$ and two delta function peaks at $Q_{f}$ and $Q_{d}+Q_{f}$ for $n_{f}=1$. Because of the choice $Q_{d}=Q_{f}$ through out the calculation the two peak positions at $Q_{d}$ and $Q_{f}$ are degenerate. Note that the distance between two peaks in each of the conserved $n_{f}$ sectors is $Q_{d}$. Now once we couple the local Hamiltonian to the dynamical mean field, then each of the delta function peaks gets broadened due to finite lifetime of the atomic levels. Also, their peak position is shifted too. Most interestingly, the distance between the two peaks in each of the conserved $n_{f}$ sectors still remains equal to $\sim Q_{d}$. This is due to the fact that the core-hole--$d$-hole interaction shifts each of the $d$-hole levels by the same amount, namely $\sim Q_{d}$. In Fig.~\ref{fig:SpectralFnU0.5}(b), the peak near $\Omega\equiv\omega-E_{h}+\mu=0$ corresponds to the core-hole being created on a site not occupied by either a $d$- or $f$-hole. Whereas the peak at $\Omega \simeq 1.0$ corresponds to a nearly degenerate double peak, where the core-hole is created on a site either occupied by a $d$ or $f$ hole. The broad shoulder at $\Omega \simeq 2.0$ corresponds to the case where the core-hole is created on a site doubly occupied by both a $d$ and $f$-hole. With increasing core-hole potentials $Q_{d}=Q_{f}$, the doubly degenerate central peak gets split as shown in the inset of Fig.~\ref{fig:SpectralFnU0.5}(c). This is due to the fact that local $d$-holes directly hybridize with the bath which shifts its energy and width, whereas the $f$-hole only indirectly sees the fluctuating bath through its interaction with the local $d$-hole; therefore, it has different self-energy effects when compared to the $d$-hole. Thermal broadening again smears the two peaks and we obtain one broad central peak at high temperature ($T=0.3$). The integrated spectral weight under the central peak is much larger than that of the other two peaks. This corresponds to the fact that at half filling the excited core-hole would more probably be created at singly occupied sites rather than at unoccupied or doubly occupied sites. With increasing temperature the integrated weight under the two side peaks increases and that under the central peak decreases. This is because thermally excited sites create a pair of empty and doubly occupied sites at the expense of two singly occupied sites so the probability that the excited core-hole will be created at one of those sites increases with temperature. In Fig.~\ref{fig:SpectralFnU0.5}(d), we show the systematic evolution of $A_{h}(\omega)$ at a fixed temperature $T=0.1$ for various core-hole potentials. The main feature is that the peaks corresponding to the excitation of the core-hole onto empty or doubly occupied sites shifts farther and farther from the central peak. It also appears that peaks are losing intensity, but since the integrated spectral weight is always equal to one, this is just an illusion---the change in peak heights is compensated by a change in their width. One may ask, where is the edge singularity? We can see that the edge singularity clearly disappears at nonzero temperature. As the temperature is lowered, one of the peaks becomes very sharp with a high amplitude and eventually it gives rise to a divergent signal with the power-law divergence occurring at $T=0$.\cite{ShvaikaCMP2012} Our focus here is on how this behavior changes at higher temperatures, and we can see that the behavior dramatically changes. \subsection{Strongly correlated metal} Next, we consider the case of a strongly correlated metal. We choose $U=1.0$. The conduction-electron density of states $A_{d}(\omega)$, is shown in Fig.~\ref{fig:SpectralFnU1.0}(a), and illustrates a pseudogap forming near the chemical potential. \begin{figure}[!htb] \begin{center} \includegraphics[scale=0.32,clip=]{PanelPlotU1muShift.pdf} \caption{(Color on-line) Panel (a) Conduction-electron spectral function with its pseudogap structure. Panel (b) and (c) Temperature dependence of the core-hole spectral function for moderate ($Q_{d}=Q_{f}=1.5$) and large ($Q_{d}=Q_{f}=5.0$) core-hole potentials. Panel (d) : Evolution of the core-hole spectral function for various core-hole potentials $Q_{d}=Q_{f}$ at a fixed temperature $T=0.1$. The parameters used for the calculations are all indicated in the figures. } \label{fig:SpectralFnU1.0} \end{center} \end{figure} Figure~\ref{fig:SpectralFnU1.0} panel (b) and (c), plot the temperature evolution of the core-hole spectral function for moderately ($Q_{d}=Q_{f}=1.5$) and large ($Q_{d}=Q_{f}=5.0$) core-hole potentials, respectively. One of the main features we see is that the central peak is narrowing and concentrating more spectral weight, as the weight on the empty and doubly occupied sites goes down. As we increase the core-hole potentials to large values the intensity of the central peak increases while its width decreases. This is due to increased self-energy effects arising when we put a core-hole onto a site already occupied by a $d$ or $f$-hole. The side peaks are well separated from the central peak and their intensity and integrated spectral weight under these peaks are reduced compared to the weakly correlated case. \subsection{Small-gap Mott insulator} As we increase $U$ above $U_{c}=\sqrt{2}$ we get into the Mott insulating phase. We choose $U=2.0$ which gives an insulator with a small gap, $\Delta_{\textrm{gap}} \simeq 0.25$. In panel (a) of Fig.~\ref{fig:AhU2}, we show the spectral function of the $d$-hole which clearly shows two Hubbard bands centered around $\pm\frac{U}{2}$ and separated by the insulating gap, $\Delta_{\textrm{gap}}$. Of course, it is well known that for the $D=\infty$ hypercubic lattice the Mott insulating density of states never has a true ``gap'' as there are always exponentially small density of states inside the ``gap region.'' Figure~\ref{fig:AhU2} panels, (b) and (c), show the core-hole spectral function $A_{h}(\omega)$ for moderately large $Q_{d}=Q_{f}=2.5$ and large $Q_{d}=Q_{f}=5.0$ core-hole potentials. In the insulating state at zero temperature, a core-hole can only be created on a site which is occupied by either a $d$-hole or an $f$-hole. This gives rise to single peak in each of the two conserved sectors of $n_{f}=0$ and $n_{f}=1$. For $Q_{d}=Q_{f}=2.5$ we see a very sharp near $\delta$-function peak at $\Omega \sim Q_{f}$ on top of very broad asymmetrical spectral feature. The sharp peak corresponds to the creation of a core-hole on a site already occupied by an $f$-hole. The sharpness of the peak arises due to both the static nature of the $f$-hole and the lack of core-hole screening effects in the insulating state thereby making the core-hole state very long lived. The broad asymmetrical part of $A_{h}(\omega)$ corresponds to the creation of a core-hole on a site occupied by a $d$-hole. This part consists of a broad peak near $\Omega\sim Q_{d}$ on top of a broad background. As already mentioned, due to lack of screening effects in the insulating states and strong self-energy effects of the $d$-hole, the core-hole state is short lived. The width of the broad spectral feature is nearly equal to the width of the lower Hubbard band. At finite temperature, some of the sites become unoccupied while others becomes doubly occupied and creation of core-hole on either of these two sites gives rise to additional side band peaks. The peak corresponding to the creation of a core-hole on an empty site corresponds the peak at $\Omega \sim -0.75$ separated by a temperature dependent pseudo-gap of the size $\Delta_{\textrm{gap}}$. The peak corresponding to the creation of a core-hole on the doubly occupied site is extremely weak (nearly invisible on the scale of the plot) and has negligible spectral weight under it. With increasing core-hole potentials the peak corresponding to core-hole excitation into the $n_{f}=1$ manifold largely remains the same but the spectral features corresponding to a core-hole excitation onto the $n_{f}=0$ manifold shows qualitative changes as plotted in panels (c) and (d). With increasing $Q_{d}$, the broad peak at $\Omega \sim Q_{d}$ gets gradually pushed out to higher energy and gradually separates out of the broad background. Also, the core-hole lifetime increases, as is evident from the narrowing and diverging peak at $\Omega \sim Q_{d}$. This is mainly due to the fact that the excited core-hole goes into the upper Hubbard band and its decay rate decreases with increasing $Q_{d}$ as the $d$-hole density of states involved in the decay process decreases with increasing $Q_{d}$. Due to the same reason, the integrated spectral weight under the broad background also decreases, while its width remains nearly same. \begin{figure}[!htb] \begin{center} \includegraphics[scale=0.32,clip=]{PanelPlotU2muShift.pdf} \caption{(Color on-line) Panel (a) Conduction-electron spectral function, $A_{d}(\omega)$ in the Mott insulator phase. Panels (b) and (c) Core-hole spectral function, $A_{h}(\omega)$, for moderately large ($Q_{d}=Q_{f}=2.5$) and large ($Q_{d}=Q_{f}=5.0$) core-hole potentials. The peak corresponding to a core-hole excitation onto the doubly occupied manifold has a small spectral weight. Panel (d) Evolution of $A_{h}(\omega)$ for various core-hole potentials $Q_{d}=Q_{f}$ at fixed temperature $T=0.1$. } \label{fig:AhU2} \end{center} \end{figure} \subsection{Large gap Mott insulator} Finally we choose $U=4.0$ to simulate a strong Mott insulator. In panel (a) of Fig.~\ref{fig:AhU4}, we show the spectral function for the $d$-hole which clearly shows two Hubbard bands separated by a large insulating gap, $\Delta_{\textrm{gap}} \simeq 1.8$. In this case, the size of the insulating gap is much larger than the hopping. In Fig.~\ref{fig:AhU4} panels (b) and (c), we show the core-hole spectral function $A_{h}(\omega)$ for two core-hole potentials $Q_{d}=Q_{f}=5.0$ and $Q_{d}=Q_{f}=8.0$, respectively. Because of the presence of a large insulating gap in $d$-hole spectral function and strong correlation effects, the core-hole spectral functions shows negligible temperature dependence for $T \ll 1$. Therefore, we choose temperatures equal to or larger than 1. At the low temperature of $T = 0.3$, we see the two familiar spectral features corresponding to the core-hole being excited to two singly occupied manifolds. The peak at $\Omega \sim Q_{d}$ is much sharper and the broad spectral features have much less intensity compared to the case of small gap Mott insulator. This is mainly due to reduced density of states and increased correlation effects. For larger $Q_{d}=Q_{f}=8.0$, the broad spectral features have vanishingly small spectral intensity at $T=0.3$ as shown in panel (c). As we increase temperature equal to or larger than the hopping, the two nearly degenerate sharp peaks broaden and eventually merge into a single broad peak. Also, there is clear development of two additional spectral peaks at $\Omega \sim 0$ and $\Omega \sim Q_{d}+Q_{f}$, which corresponds again to the creation of the core-hole on a thermally excited empty or doubly occupied site. In panel (d), we show the evolution of $A_{h}(\omega)$ with various core-hole potentials $Q_{d}=Q_{f}$ for $T=1.0$. With increasing core-hole potentials the central peaks becomes narrower and gradually merge into a well defined Lorentzian peak which separates out of the broad background. The side peaks move outward, but their distance from the central peak remains the same ($\sim Q_{d}$), as expected. \begin{figure}[!htb] \begin{center} \includegraphics[scale=0.32,clip=]{PanelPlotU4muShift.pdf} \caption{(Color on-line) Panel (a) The $d$-hole spectral function $A_{d}(\omega)$ in a strong Mott insulator. Panel (b) and (c) Core-hole spectral function, $A_{h}(\omega)$, for large ($Q_{d}=Q_{f}=5.0$) and very large ($Q_{d}=Q_{f}=8.0$) core-hole potentials, respectively. For temperatures larger than 1, side peaks corresponding to core-hole excitations into empty and doubly occupied manifold are clearly visible. Panel (d) Evolution of $A_{h}(\omega)$ with core-hole potentials $Q_{d}=Q_{f}$ for fixed temperature $T=1.0$. } \label{fig:AhU4} \end{center} \end{figure} \section{Conclusions} In conclusion, we have calculated the finite temperature core-hole propagator (XPS spectrum) in the Falicov-Kimball model using the Weiner-Hopf sum equation approach. We have studied the core-hole spectral function, $A_{h}(\omega)$ for various interaction strengths $U$ and core-hole potentials $Q_{d}=Q_{f}$. While the features of the weakly correlated metal are what we would expect at nonzero temperature---they have the power-law singularity suppressed and the spectral features broadened, as we enter the Mott phase, the system continuously evolves into a different type of spectral function. This is because the Mott insulator strongly suppresses doubly occupied and empty sites, hence the peaks associated with hole creation on those sites is sharply reduced. We also do not see any clear indication that there is a singularity at $T=0$ anymore (but we did not study this point in detail). If we use these results to try to predict what the behavior of time-resolved XPS spectra would look like, we need to be aware of a few issues. First, we would expect the generic broadening of features and enhancement of the satellite peaks as the system absorbs more energy from the light pulse. Second, we also anticipate significant broadening of the sharp peaks in the spectra due to the probe pulse widths. Nevertheless, there are a number of interesting results one can predict could be extracted from such data. This includes the interaction energies $U$, $Q_d$, and $Q_f$, which can be extracted by examining the separations of different peaks. Since the spectral line shapes change so much with temperature, they might be able to be used as effective thermometers for the hot electron gases. Finally, an analysis of the weights in the satellite bands will yield information about the densities of empty and doubly occupied sites, which may be one of the more direct ways to measure doublon occupancy in the system. What implications does this work have for more general models like the Hubbard model? The metallic phases are difficult to compare when we are below the coherence temperature of the Hubbard model, because the Falicov-Kimball model is not a Fermi liquid. But at higher temperatures, or in the insulating phase, we expect the behavior to be more similar. We already know from Raman scattering studies that the charge dynamics in the insulators are similar.\cite{FreericksPRB2001,FreericksPRB2001s} The nearly delta function peak corresponding to the creation of a core-hole on a site occupied by a static $f$-hole will certainly be absent in the case of Hubbard model (instead it will be broadened like the $d$-hole contribution). So, we do expect that the temperature-dependent broad asymmetrical peak together with the small low energy peak corresponding to creation of a core-hole on a thermally excited empty site will survive in the Hubbard model. Also, the broad nature of this peak suggests that even without any additional broadening due to Auger-like nonradiative processes, the core-hole lifetime will be short. \section*{Acknowledgements} The work at Georgetown was supported by the Department of Energy, Office of Basic Energy Sciences, Division of Materials Sciences and Engineering (DMSE) under contract No. DE-FG02-08ER46542 (JKF and NP). NP also acknowledges financial support from IIT, Kharagpur where part of the manuscript was written. JKF also acknowledges support from the McDevitt Bequest at Georgetown. Fig.~\ref{fig:KeldyshContour} in this paper is created using open source software JAXODRAW and the original reference has been duly cited in Ref.~\onlinecite{Jaxodraw}.
\section{Introduction} The Chebyshev's inequality is a fundamental result in the field of probability theory and give probability bounds to a wide class of probability distributions. If $X$ is a random variable with finite mean $\mu$ and finite non-zero variance $\sigma^2$, the Chebyshev inequality is as follows.\\ For any $\epsilon> 0$, \begin{equation} \label{Chebyshev_inequaltiy} \mathrm{Pr}\biggl(\frac{(X-\mu)^2}{\sigma^2}\geq \epsilon^2\biggr)\leq \frac{1}{\epsilon^2}, \end{equation} where $\mathrm{Pr}$(A) is a probability on a set $A$. There are several extensions to improve the sharpness of bounds (see e.g. \cite{savage1961probability}). The well-known improved inequality is the one-sided (one-tailed) Chebyshev's inequality. \begin{align} \mathrm{Pr}\biggl(\frac{X-\mu}{\sigma}\geq \epsilon\biggr)\leq \frac{1}{1+\epsilon^2} \end{align} There are also several extensions to the multivariate case (see e.g. \cite{marshall1960multivariate} and references therein). Recently, Chen has proved the n-dimensional multivariate Chebyshev's inequality\cite{chen2007new,navarro2016very}. \begin{equation} \label{multi_Chebyshev_inequaltiy} \mathrm{Pr}((\bm{X}-\mu)^T\Sigma^{-1}(\bm{X}-\mu)\geq\epsilon^2)\leq\frac{n}{\epsilon^2}, \end{equation} where $\bm{x}^T$ denotes the transpose of $\bm{x}$ and $\Sigma$ denotes the covariance matrix. The classical and multivariate Chebyshev's inequality ((\ref{Chebyshev_inequaltiy}) and (\ref{multi_Chebyshev_inequaltiy})) give the probability bounds on the set $D_{\epsilon}\stackrel{\mathrm{def}}{=} \{\bm{X}\in\mathbb{R}^n | (\bm{X}-\mu)^T\Sigma^{-1}(\bm{X}-\mu)\geq \epsilon^2\}$. In this paper, we improve the Chebyshev's inequality for continuous random variable and give new bounds on probability when the supremum of the probability density function is known in $D_\epsilon$. The proof is based on the entropy upper bound with moment constraint\cite{conrad2004probability,marsiglietti2018lower}. Then, we apply this inequality to specific discrete probability distribution. \section{Main Results} \textbf{Notation.}\\ \begin{itemize} \item PDF: probability distribution function.\\ \item $E[\cdot]$: expected value.\\ \item$h(f)\stackrel{\mathrm{def}}{=} -\int_{\mathbb{R}^n} f(\bm{x})\ln f(\bm{x})\mathrm{d}^nx$: differential entropy of PDF $f$.\\ \item$\|f\|_{\infty, A}\stackrel{\mathrm{def}}{=} \esssup_{x\in A} f(x)$: uniform norm of PDF f on a set $A$.\\ If $A=\mathbb{R}^n$, we omit $A$ on LHS. \end{itemize} \subsection{1-dimensional improved Chebyshev's inequality} Before we derive new probability bounds, we show some lemmas. \begin{prop}(entropy upper bound with fixed variance)\\ \label{variance_maximum_entropy} Let $f$ be a PDF on $\mathbb{R}$ with variance $\sigma^2$. Then, the following inequality holds. \begin{align} h(f)\leq \frac{1}{2}(1+\ln(2\pi\sigma^2)) \end{align} Equality holds if and only if $f$ is normal distribution with variance $\sigma^2$. \end{prop} This Proposition is is shown as Theorem 3.2 in \cite{conrad2004probability}. \begin{prop}(entropy upper bound with fixed $E[|x|])$\\ \label{mean_maximum_entropy} Let $f$ be a PDF on $\mathbb{R}$ with fixed $\lambda=\int_{\mathbb{R}} |x|f(x)\mathrm{d}x$. Then, the following inequality holds. \begin{align} h(f)\leq 1+\ln(2\lambda) \end{align} Equality holds if and only if $f$ is Laplace distribution with mean $0$ and variance $2\lambda^2$. \end{prop} This inequality is shown in \cite{marsiglietti2018lower}, and we can also prove in the same way as Theorem 5.2 in \cite{conrad2004probability}. From Proposition \ref{variance_maximum_entropy} and \ref{mean_maximum_entropy}, we obtain the following lemma. \begin{lemma} \label{maxent_inequality} Let $f$ be a PDF on $\mathbb{R}$ with finite mean and variance. Then, the following inequalities hold. \begin{align} \label{x2_maxent} \int_{\mathbb{R}} x^2f(x)\mathrm{d}x \geq \frac{1}{2\pi e}\exp(2h(f)) \\ \label{x_maxent} \int_{\mathbb{R}} |x|f(x)\mathrm{d}x \geq \frac{1}{2e}\exp(h(f)) \end{align} \end{lemma} \noindent\textbf{Proof.} Let $\mu$ be a mean and $\sigma^2$ be a variance. By combining $\int_{\mathbb{R}} x^2f(x)\mathrm{d}x= \sigma^2 + \mu^2$ and Proposition \ref{variance_maximum_entropy}, we obtain (\ref{x2_maxent}). Inequality (\ref{x_maxent}) is trivial.\\ \begin{lemma}(inequality for the uniform norm)\\ \label{Renyi_inequality} Let $f$ be a PDF on $\mathbb{R}^n$. Then, the following inequality holds. \begin{align} \exp(h(f))\geq \frac{1}{\|f\|_{\infty}} \end{align} \end{lemma} \noindent\textbf{Proof.} From $\|f\|_{\infty}\geq f(\bm{x})$ for $\bm{x}\in\mathbb{R}^n \mathrm{a.s.}$, we obtain $h(f)\geq -\int_{\mathbb{R}^n} f(\bm{x})\ln f(\bm{x})\mathrm{d}^nx\geq -\ln\|f\|_{\infty}$. Exponentiating this inequality, we have the result. We can also obtain this result from the Renyi entropy inequality.\\ \begin{theorem}(1-dimensional improved Chebyshev's inequality)\\ \label{new_Chebyshev_inequality1} Let $X\in\mathbb{R}$ be a continuous random variable with finite mean $\mu$ and variance $\sigma^2>0$, and $f$ be a PDF of $X$. Let $D_{\epsilon}\stackrel{\mathrm{def}}{=} \{X\in\mathbb{R} |\frac{(X-\mu)^2}{\sigma^2}\geq \epsilon^2\}$ and $m_{\epsilon}\stackrel{\mathrm{def}}{=} \sigma\|f\|_{\infty,D_\epsilon}$.\\ For any $\epsilon>0$, the following inequality holds. \begin{align} \mathrm{Pr}(D_\epsilon)\leq \alpha m_\epsilon, \end{align} where $\alpha$ is a root of cubic equation $\frac{1}{2\pi e}x^3+\frac{\epsilon}{e}x^2+\epsilon^2 x-\frac{1}{m_\epsilon}=0$. \end{theorem} \noindent\textbf{Proof.} We change the variable as \begin{align} Y\stackrel{\mathrm{def}}{=} \frac{X-\mu}{\sigma}\\ \hat{f}(Y)\stackrel{\mathrm{def}}{=} \sigma f(X). \end{align} For a random variable $Y$, $D_\epsilon$ can be written as $D_{\epsilon}=\{Y\in\mathbb{R} | Y^2\geq \epsilon^2\}$. Then, we have \begin{align} 1&=\int_{\mathbb{R}} \frac{(x-\mu)^2}{\sigma^2} f(x)\mathrm{d}x=\int_{\mathbb{R}} y^2 \hat{f}(y)\mathrm{d}y\geq \int_{D_\epsilon} y^2\hat{f}(y)\mathrm{d}y. \end{align} Expanding $y^2=\epsilon^2+2\epsilon (|y|-\epsilon)+(|y|-\epsilon)^2$, we obtain \begin{align} \label{sigma_eval} \int_{D_\epsilon} y^2\hat{f}(y)\mathrm{d}y= \mathrm{Pr}(D_\epsilon)\epsilon^2+2\epsilon\int_{D_\epsilon} (|y|-\epsilon)\hat{f}(y)\mathrm{d}y+\int_{D_\epsilon} (|y|-\epsilon)^2\hat{f}(y) \mathrm{d}y \end{align} We define a new PDF as follows. \begin{subnumcases} {g(y)=} \frac{1}{\mathrm{Pr}(D_\epsilon)}\hat{f}(y+\epsilon) & ($y>0$) \\ 0 & ($y=0$) \\ \frac{1}{\mathrm{Pr}(D_\epsilon)}\hat{f}(y-\epsilon) & ($y<0)$ \end{subnumcases} From definition, $g(y)$ satisfies $\int_{\mathbb{R}} g(y) \mathrm{d}y=1$. By using $g(y)$, the equation (\ref{sigma_eval}) can be written as follows. \begin{align} 1\geq \mathrm{Pr}(D_\epsilon)\biggl(\epsilon^2+2\epsilon\int_{\mathbb{R}} |y|g(y)\mathrm{d}y+\int_{\mathbb{R}} y^2g(y)\mathrm{d}y\biggr) \end{align} From Lemma \ref{maxent_inequality} and \ref{Renyi_inequality} , we have \begin{align} 1\geq \mathrm{Pr}(D_\epsilon)\biggl(\epsilon^2+\frac{\epsilon}{e}\exp(h(g))+\frac{1}{2\pi e}\exp(2h(g))\biggr)\geq \mathrm{Pr}(D_\epsilon)\biggl(\epsilon^2+\frac{\epsilon}{e\|g\|_\infty}+\frac{1}{2\pi e\|g\|_\infty^2}\biggr) \end{align} From the definition of $g(y)$ and $\hat{f}$, the equation $\|g\|_\infty=\frac{1}{\mathrm{Pr}(D_\epsilon)}\|\hat{f}\|_{\infty, D_\epsilon}=\frac{\sigma}{\mathrm{Pr}(D_\epsilon)}\|f\|_{\infty,D_\epsilon}$ holds. Hence, we obtain \begin{align} \label{Pr_inequality} 1\geq \mathrm{Pr}(D_\epsilon)\epsilon^2+\frac{\epsilon\mathrm{Pr}(D_\epsilon)^2}{e\sigma\|f\|_{\infty,D_\epsilon}}+\frac{\mathrm{Pr}(D_\epsilon)^3}{2\pi e\sigma^2\|f\|_{\infty,D_\epsilon}^2} \end{align} By putting $m_\epsilon=\sigma\|f\|_{\infty,D_\epsilon}$, $t\stackrel{\mathrm{def}}{=} \frac{\mathrm{Pr}(D_\epsilon)}{m_\epsilon}$ satisfies \begin{align} \frac{1}{2\pi e}t^3+\frac{\epsilon}{e} t^2 + \epsilon^2 t - \frac{1}{m_\epsilon}\leq 0 \end{align} By putting $T(x)= \frac{1}{2\pi e}x^3+\frac{\epsilon}{e} x^2 + \epsilon^2 x - \frac{1}{m_\epsilon}$, we find $T(x)$ is a monotonically increasing function. Hence, we obtain $t\leq \alpha$, where $\alpha$ satisfies $T(\alpha)=0$. From the definition of $t$, we have the result. \begin{figure}[H] \begin{center} \includegraphics[width=100mm, height = 70mm]{Normal_distribution.pdf} \end{center} \caption{Plots of actual probability and probability bounds for normal distribution. } \label{fig:one} \end{figure} In Figure 1, ''Probability'' denotes actual probability on the set $D_{\epsilon}\stackrel{\mathrm{def}}{=} \{X\in\mathbb{R} |\frac{(X-\mu)^2}{\sigma^2}\geq \epsilon^2\}$, ''Chebyshev'' denotes the result of Chebyshev's inequality and ''New bound'' denotes the result of Theorem \ref{new_Chebyshev_inequality1}. \begin{corollary} \label{new_Chebyshev_inequality2} Let $X\in\mathbb{R}$ be a continuous random variable with finite mean $\mu$ and variance $\sigma^2$, and $f$ be a PDF of $X$.\\ Let $D_{\epsilon}\stackrel{\mathrm{def}}{=} \{X\in\mathbb{R} |\frac{(X-\mu)^2}{\sigma^2}\geq \epsilon^2\}$ and $m_{\epsilon}\stackrel{\mathrm{def}}{=} \sigma\|f\|_{\infty,D_\epsilon}$.\\ For any $\epsilon>0$, the following inequality holds. \begin{align} \mathrm{Pr}(D_\epsilon)\leq \min(\frac{1}{\epsilon^2}, {\bigl(\frac{e}{\epsilon}\bigr)}^{\frac{1}{2}}{m_\epsilon}^{\frac{1}{2}}, {(2\pi e)}^{\frac{1}{3}}{m_\epsilon}^{\frac{2}{3}}) \end{align} \end{corollary} This inequality includes the Chebyshev's inequality.\\ \noindent\textbf{Proof.} From (\ref{Pr_inequality}), we obtain \begin{align} \mathrm{Pr}(D_\epsilon)\epsilon^2\leq 1\\ \frac{\epsilon\mathrm{Pr}(D_\epsilon)^2}{em_\epsilon}\leq 1\\ \frac{\mathrm{Pr}(D_\epsilon)^3}{2\pi em_\epsilon^2}\leq 1. \end{align} From these inequalities, the result follows. \subsection{Multivariate improved Chebyshev's inequality} \begin{prop}(entropy upper bound with fixed covariance matrix)\\ \label{multivariate_variance_maximum_entropy} Let $\bm{X}\in\mathbb{R}^n$ be a continuous random vector with covariance matrix $\Sigma$, and $f$ be a PDF of $\bm{X}$.\\ Then, the following inequality holds. \begin{align} h(f)\leq \frac{1}{2}(n+\ln({(2\pi)}^n\det\Sigma)) \end{align} Equality holds if and only if $f$ is n-dimensional normal distribution with covariance matrix $\Sigma$. \end{prop} This Proposition is shown as Theorem 5.5 in \cite{conrad2004probability}. \begin{lemma} \label{multivariate_maxent_inequality2} Let $\bm{X}\in\mathbb{R}^n$ be a continuous random vector with covariance matrix $\Sigma$, and $f$ be a PDF of $\bm{X}$. Then, the following inequality holds. \begin{align} \frac{\mathrm{Tr}\Sigma}{n}\geq \frac{1}{2\pi e}\exp(\frac{2}{n}h(f)) \end{align} \end{lemma} By combining the positive definite matrix inequality (AM-GM inequality) $\frac{\mathrm{Tr}\Sigma}{n}\geq {(\det\Sigma)}^{\frac{1}{n}}$ and Proposition \ref{multivariate_variance_maximum_entropy}, we get the result. \begin{theorem}(Multivariate improved Chebyshev's inequality)\\ Let $\bm{X}\in\mathbb{R}^n$ be a continuous random vector with covariance matrix $\Sigma$, and $f$ be a PDF of $\bm{X}$.\\ Let $D_{\epsilon}\stackrel{\mathrm{def}}{=} \{\bm{X}\in\mathbb{R}^n | (\bm{X}-\mu)^T\Sigma^{-1}(\bm{X}-\mu)\geq \epsilon^2\}$ and $m_{\epsilon}\stackrel{\mathrm{def}}{=}{(\det\Sigma)}^{\frac{1}{2}}\|f\|_{\infty,D_\epsilon}$.\\ For any $\epsilon>0$, the following inequality holds. \begin{align} \mathrm{Pr}(D_\epsilon)\leq \min(\frac{n}{\epsilon^2}, {(2\pi e)}^{\frac{n}{n+2}}{m_\epsilon}^{\frac{2}{n+2}}) \end{align} \end{theorem} \noindent\textbf{Proof.} As Chen have shown the inequality $\mathrm{Pr}(D_\epsilon)\leq \frac{n}{\epsilon^2}$, we prove the inequality $\mathrm{Pr}(D_\epsilon)\leq {(2\pi e)}^{\frac{1}{n+2}}{m_\epsilon}^{\frac{2}{n+2}}$. We change the variable as \begin{align} \bm{Y}\stackrel{\mathrm{def}}{=} \Sigma^{-\frac{1}{2}}(\bm{X}-\mu)\\ \hat{f}(\bm{Y})\stackrel{\mathrm{def}}{=} {(\det\Sigma)}^{\frac{1}{2}} f(\bm{X}). \end{align} For random variable $\bm{Y}$, $D_\epsilon$ can be written as $D_{\epsilon}=\{\bm{Y}\in\mathbb{R}^n | \sum_{i=1}^ny_i^2\geq \epsilon^2\}$. We define a new PDF as \begin{subnumcases} {g(\bm{y})=} \frac{1}{\mathrm{Pr}(D_\epsilon)}\hat{f}(\bm{y}) & ($\bm{y}\in D_\epsilon$) \\ 0 & ($\bm{y}\notin D_\epsilon$) \end{subnumcases} \begin{align} n&=\int_{\mathbb{R}^n} (\bm{X}-\mu)^T\Sigma^{-1}(\bm{X}-\mu)\mathrm{d}^nx=\int_{\mathbb{R}^n} \sum_{i=1}^ny_i^2 \hat{f}(\bm{y})\mathrm{d}^ny\geq \int_{D_\epsilon} \sum_{i=1}^ny_i^2 \hat{f}(\bm{y})\mathrm{d}^ny \\ \nonumber &= \mathrm{Pr}(D_\epsilon)\int_{\mathbb{R}^n} \sum_{i=1}^ny_i^2 g(\bm{y})\mathrm{d}^ny\geq \mathrm{Pr}(D_\epsilon)\mathrm{Tr}\Sigma_g, \end{align} where $\Sigma_g$ is the covariance matrix of $g(\bm{y})$ and we use $E[y_i^2]\geq \Sigma_{g,ii}$. Combining this inequality, Lemma \ref{Renyi_inequality} and Lemma \ref{multivariate_maxent_inequality2}, we have \begin{align} \label{multivariate_inequality} 1\geq \frac{\mathrm{Pr}(D_\epsilon)}{2\pi e}\exp(\frac{2}{n}h(g)) \geq \frac{\mathrm{Pr}(D_\epsilon)}{2\pi e\|g\|_\infty^{\frac{2}{n}}} \end{align} From the definition of $g(\bm{y})$ and $\hat{f}(\bm{y})$, the equation $\|g\|_\infty=\frac{1}{\mathrm{Pr}(D_\epsilon)}\|\hat{f}\|_{\infty,D_\epsilon}=\frac{{(\det\Sigma)}^{\frac{1}{2}}}{\mathrm{Pr}(D_\epsilon)}\|f\|_{\infty,D_\epsilon}=\frac{m_\epsilon}{\mathrm{Pr}(D_\epsilon)}$ holds. Substituting this equation to (\ref{multivariate_inequality}), we obtain the result. \subsection{Application to specific discrete probability distributions} We show examples of application of Theorem \ref{new_Chebyshev_inequality1} to specific discrete distributions. \begin{theorem} \label{discrete_inequality} Let $Y\in\mathbb{Z}$ be a discrete random variable with finite mean $\mu$ and variance $\sigma^2$, and $p$ be a probability mass function.\\ Let $x_L\stackrel{\mathrm{def}}{=} \mu+\frac{1}{2}-\epsilon\sigma_f$, $x_R\stackrel{\mathrm{def}}{=} \mu+\frac{1}{2}+\epsilon\sigma_f$ and $\sigma_f^2\stackrel{\mathrm{def}}{=}\sigma^2+\frac{1}{12}$.\\ Let $D_{\epsilon}\stackrel{\mathrm{def}}{=} \{Y\in\mathbb{Z} |Y\leq\lfloor x_L\rfloor-1 \quad \mathrm{or} \quad Y\geq\lceil x_R\rceil\}$.\\ Let $M_{\epsilon}\stackrel{\mathrm{def}}{=} \{Y\in\mathbb{Z} |Y\leq\lfloor x_L\rfloor\ \quad \mathrm{or} \quad Y\geq\lfloor x_R\rfloor\}$ and $m_{\epsilon}\stackrel{\mathrm{def}}{=} \sigma_f\max_{k\in M_{\epsilon}} p(k)$.\\ For any $\epsilon > 0$, the following inequality holds. \begin{align} \mathrm{Pr}(D_\epsilon)\leq \alpha m_\epsilon, \end{align} where $\alpha$ is a root of cubic equation $\frac{1}{2\pi e}x^3+\frac{\epsilon}{e}x^2+\epsilon^2 x-\frac{1}{m_\epsilon}=0$. \end{theorem} \noindent\textbf{Proof.}\\ We define new PDF $f$ as follows. \begin{align} f(x)=p(\lfloor x\rfloor) \end{align} The mean and variance of $f$ are \begin{align} E[X]=\int_{\mathbb{R}} xf(x)\mathrm{d}x=\sum_kp(k)\int_{k}^{k+1}x\mathrm{d}x=\mu+\frac{1}{2}\\ E[(X-E[X])^2]=\int_{\mathbb{R}} x^2f(x)\mathrm{d}x-\mu_f^2=\sum_kp(k)\int_{k}^{k+1}x^2\mathrm{d}x-\mu_f^2\\ \nonumber =\sum_kk^2p(k)+\mu+\frac{1}{3}-\mu_f^2=\sigma^2+\frac{1}{12}=\sigma_f^2. \end{align} For the set $D^f_{\epsilon}\stackrel{\mathrm{def}}{=} \{X\in\mathbb{R} |\frac{(X-\mu-\frac{1}{2})^2}{\sigma_f^2}\geq \epsilon^2\}$, we have \begin{align} \mathrm{Pr}(D_\epsilon)=\sum_{k\in D_\epsilon} p(k)=\sum_{k=-\infty}^{\lfloor x_L\rfloor -1}\int_{k}^{k+1}f(x)\mathrm{d}x + \int_{\lfloor x_L\rfloor}^{x_L}f(x)\mathrm{d}x\\ \nonumber + \sum_{k=\lceil x_R\rceil}^{ \infty}\int_{k}^{k+1}f(x)\mathrm{d}x + \int_{x_R}^{\lceil x_R\rceil}f(x)\mathrm{d}x\\ \nonumber \leq \int_{D^f_\epsilon} f(x)\mathrm{d}x =\mathrm{Pr}_f(D^f_\epsilon), \end{align} where $\mathrm{Pr}_f$ denotes the probability of PDF $f$. From Theorem \ref{new_Chebyshev_inequality1}, we have \begin{align} \label{f_inequality} \mathrm{Pr}(D_\epsilon)\leq \mathrm{Pr}_f(D^f_\epsilon) \leq \alpha m^f_\epsilon \end{align} where $m^f_\epsilon=\sigma_f\|f\|_{D^f_\epsilon}$ and $\alpha$ is a root of cubic equation $\frac{1}{2\pi e}x^3+\frac{\epsilon}{e}x^2+\epsilon^2 x-\frac{1}{m^f_\epsilon}=0$. From the definition of $D^f_\epsilon$, we obtain $\|f\|_{D^f_\epsilon}=\max_{k\in M_{\epsilon}} p(k)$ and $m^f_\epsilon=m_\epsilon$. Substituting $m^f_\epsilon=m_\epsilon$ to (\ref{f_inequality}), the result follows. \begin{corollary} \label{discrete_improved_Chebyshev} Let $Y\in\mathbb{Z}$ be a discrete random variable with finite mean $\mu$ and variance $\sigma^2$, and $p$ be a probability mass function.\\ Let $x_L\stackrel{\mathrm{def}}{=} \mu+\frac{1}{2}-\epsilon\sigma_f$, $x_R\stackrel{\mathrm{def}}{=} \mu+\frac{1}{2}+\epsilon\sigma_f$ and $\sigma_f^2\stackrel{\mathrm{def}}{=}\sigma^2+\frac{1}{12}$.\\ Let $D_{\epsilon}\stackrel{\mathrm{def}}{=} \{Y\in\mathbb{Z} |\frac{(Y-\mu-\frac{1}{2})^2}{\sigma_f^2}\geq \epsilon^2\}$.\\ Let $M_{\epsilon}\stackrel{\mathrm{def}}{=} \{Y\in\mathbb{Z} |Y\leq\lfloor x_L\rfloor\ \quad \mathrm{or} \quad Y\geq\lfloor x_R\rfloor\}$ and $m_{\epsilon}\stackrel{\mathrm{def}}{=} \sigma_f\max_{k\in M_{\epsilon}} p(k)$.\\ For any $\epsilon > 0$, the following inequality holds. \begin{align} \mathrm{Pr}(D_\epsilon)\leq \alpha m_\epsilon+p(\lfloor x_L \rfloor), \end{align} where $\alpha$ is a root of cubic equation $\frac{1}{2\pi e}x^3+\frac{\epsilon}{e}x^2+\epsilon^2 x-\frac{1}{m_\epsilon}=0$. \end{corollary} \noindent\textbf{Proof.} Let $D'_{\epsilon}\stackrel{\mathrm{def}}{=} \{Y\in\mathbb{Z} | Y\leq\lfloor x_L\rfloor-1 \quad \mathrm{or} \quad Y\geq\lceil x_R\rceil\}$, we have \begin{align} \mathrm{Pr}(D_\epsilon)=\mathrm{Pr}(D'_\epsilon)+p(\lfloor x_L \rfloor) \end{align} From Theorem \ref{discrete_inequality}, the result follows. \begin{figure}[H] \includegraphics[width=100mm, height = 70mm]{Poisson_distribution.pdf} \caption{Plots of actual probability and probability bound for Poisson distribution ($p(k,\lambda)=\frac{\lambda^k\exp(-\lambda)}{k!}$ and $\lambda=4$).} \label{fig:two} \end{figure} In Figure 2, ''Probability'' denotes actual probability on the set $D_{\epsilon}\stackrel{\mathrm{def}}{=} \{Y\in\mathbb{Z} |\frac{(Y-\mu-\frac{1}{2})^2}{\sigma_f^2}\geq \epsilon^2\}$ and ''New bound'' denotes the result of Corollary \ref{discrete_improved_Chebyshev}. \section{Conclusion} If the supremum of the probability density function is known, we have improved the Chebyshev's inequality for 1-dimensional or multivariate continuous probability distributions. We have also derived the similar inequality for specific discrete distributions by using improved Chebyshev's inequality for continuous probability distributions. Future works include expansion to more general discrete distributions and derivation of tighter bounds.
\section{Introduction} Much recent computational and theoretical work has been devoted to the inverse problem of the estimation of unknown or optimal model parameters from finite observations of the model output \cite{kaipio2005statistical,dashti2017bayesian,hinze2009optimization,biegler2003large}. For example, recent works included reconstruction of a seismic wave speed field from waves recorded at a finite number of point receivers \cite{bui2013computational}, estimation of an ice sliding coefficient field from finite velocity observations \cite{petra2014computational}, and determination of the source of a chemical/biological attack from measurements of toxins \cite{boggs2006rapid}. Approaches to these inverse problems typically involve many evaluations of the model, also called the forward map. For example, each step of a Markov Chain Monte Carlo (MCMC) method \cite{brooks2011handbook} for Bayesian inference or iteration of a numerical optimization routine \cite{nocedal2006numerical} will require evaluation of the forward map. When that map includes observations of the solution of a partial differential equation (PDE), these methods in turn require many solutions of the PDE. In many applications, these PDE solves are computationally-intensive and dominate the overall time to solution. For applications where the observations are sparse, i.e., low-dimensional, solving the PDE can be wasteful in the sense that a high-dimensional quantity is computed only to take a low-dimensional projection of it. It is therefore desirable to identify methods that allow computation of the parameter-to-observation map directly, without a full PDE solve. In this work, we consider the problem of estimating the parameters of a driven diffusion (e.g., the background flow, diffusion coefficient, or sources) from point measurements of a passive scalar (e.g., the concentration of a contaminant). We present two numerical methods that can be used to compute observations for PDE-constrained inverse problems without computation of the full scalar field. These methods therefore bypass the need to approximate a high-dimensional PDE solution at each step of the inverse problem and instead replace the full PDE solve with an array of particle solutions that are much less computationally expensive. Moreover, since the particle simulations are decoupled, they can be parallelized in a straightforward manner on modern computational architectures. The result is a dramatic speedup, particularly for problems in which the dimension of the unknowns is significantly larger than the dimension of the observations. \section{Motivation} In this article, we consider two inverse problems: \begin{Prb}[Time-dependent Advection-Diffusion] Let $D$ be an open, bounded subset of $\R^n$. Let $\mathbf{\vfieldnobf}:D \to \R^n$, $\sigma:D \to \R^{n \times n}$, and $\theta_0:D \to \R$ be given functions. Assume that there exists a $\theta:\overline{D} \to \R$ satisfying \begin{equation} \frac{d\theta}{dt}(\mathbf{x}) = -\mathbf{\vfieldnobf}(\mathbf{x}) \cdot \nabla \theta(t,\mathbf{x}) + \frac{1}{2} \sum_{i,j} (\sigma\sigma^T)_{i,j}(\mathbf{x}) \frac{\partial^2}{\partial x_i \partial x_j} \theta(t,\mathbf{x}), \quad \theta(0,\mathbf{x})=\theta_0(\mathbf{x}). \label{eq:pde_diffusion} \end{equation} \textbf{Goal:} Estimate unknown $u$ (e.g., one or more of: advection field $\mathbf{\vfieldnobf}$, diffusion coefficients $\sigma$, or initial condition $\theta_0$) from finite, possibly noisy point observations $\theta(t_j,\mathbf{x}_j;u)$, $j=1,\dots,N$. \label{prob:ad} \end{Prb} \begin{Prb}[Boundary Value (Dirichlet) Problem] Let $D$ be an open, bounded subset of $\R^n$. Let $\mathbf{\vfieldnobf}:D \to \R^n$, $\sigma:D \to \R^{n \times n}$, $f:D \to \R$, and $\pdesol_{\partial\spatdom}:\partial D \to \R$ be given functions. Assume that there exists a $\theta:\overline{D} \to \R$ satisfying \begin{equation} \begin{aligned} -\mathbf{\vfieldnobf}(\mathbf{x}) \cdot \nabla \theta(\mathbf{x}) + \frac{1}{2} \sum_{i,j} (\sigma\sigma^T)_{i,j}(\mathbf{x}) \frac{\partial^2}{\partial x_i \partial x_j} \theta(\mathbf{x}) &= f(\mathbf{x}) && \mathbf{x} \in D \\ \theta(\mathbf{x}) &= \pdesol_{\partial\spatdom}(\mathbf{x}) && \mathbf{x}\in \partialD. \end{aligned} \label{eq:bvp} \end{equation} \textbf{Goal:} Estimate unknown $u$ (e.g., one or more of: advection field $\mathbf{\vfieldnobf}$, diffusion coefficients $\sigma$, forcing $f$, or boundary condition $\pdesol_{\partial\spatdom}$) from finite point observations $\theta(\mathbf{x}_j;u)$, $j=1,\dots,N$. \label{prob:bvp} \end{Prb} In each problem, the goal is to estimate the parameters of a driven diffusion from point measurements of the passive scalar $\theta$. Solving these inverse problems in practice will typically involve many computations of the forward map from a given parameter $u$ to its associated observations, which we denote by \begin{equation} \mathcal{G}(u)=\left\{ \mathcal{G}_j(u) \right\}_{j=1}^N,\text{ where } \begin{cases} \mathcal{G}_j(u) = \theta(t_j,\mathbf{x}_j,u) &\text{ for \cref{prob:ad}} \\ \mathcal{G}_j(u) = \theta(\mathbf{x}_j,u) &\text{ for \cref{prob:bvp}}. \end{cases} \label{eq:Gmap} \end{equation} $\mathcal{G}$ can be thought of as being composed of two operators \begin{equation} \mathcal{G}(u) = \mathcal{O} \circ \mathcal{S}(u) \end{equation} where \begin{itemize} \item The solution operator $\mathcal{S}:u \mapsto \theta$ requires solving the PDE \eqref{eq:pde_diffusion} or \eqref{eq:bvp} for parameter $u$ \item The observation operator $\mathcal{O}$ involves taking point observations from $\theta(u)$ \end{itemize} As such, $\mathcal{G}$ is typically evaluated in two steps: \begin{enumerate} \item Compute $\theta(u)$ via some numerical PDE solver \item Compute observations $\mathcal{G}(u)$ from $\theta(u)$ \end{enumerate} This natural approach has the benefit of allowing the application of third-party ``black-box'' PDE solvers to the inverse problem. However, computing $\mathcal{S}(u)$ involves approximating a solution that is infinite-dimensional, which can be very computationally expensive, requiring a discretization with many thousands or millions of degrees of freedom. By contrast, the evaluation of $\mathcal{O}$ then involves projecting that PDE solution into a finite-dimensional space. As a result, much of the work involved in approximating $\mathcal{S}$ is, in some sense, discarded in the application of $\mathcal{O}$. In the next section we present a numerical method for evaluation of $\mathcal{G}$ that breaks this two-step paradigm. \section{Methods} In this section, we present a particle method that will allow point evaluation of $\theta$ directly from the unknown $u$ without separate approximation of $\mathcal{S}$. The method will involve simulating an ensemble of particles (It\^{o}~ diffusions), which is a well-known method for approximating $\theta$; see, for example, \cite{chorin1973numerical}, \cite{degond1989weighted}, or \cite{majda2002vorticity} for details. However, to leverage the sparse nature of the observations, for this application we will simulate the particles \emph{backward in time} from their final condition to their initial condition. Doing so will allow us to avoid computing the entire field $\theta$ by computing it only where it is needed. \subsection{A Particle Method for \cref{prob:ad}}\label{sec:ad_method} In this section, we present a particle method for computing $\mathcal{G}(u)$ for the time-dependent problem \cref{prob:ad}. A key ingredient is Kolmogorov's Backward Equation, which is presented in \cref{thm:kolmogorov_backward}. See, for example, Section 8.1 of \cite{oksendal2013stochastic} for details. \begin{Thm}[Kolmogorov's Backward Equation] Suppose that for all $t>0$ and $\mathbf{x} \in D$, $\theta$ satisfies \eqref{eq:pde_diffusion} with $\theta_0 \in C^2(D)$ and $\mathbf{\vfieldnobf},\sigma \in C^1(D)$. Then $\theta(t,\mathbf{x})$ is given by \begin{equation} \theta(t,\mathbf{x})=\mathbb{E} \theta_0(\mathbf{X}_t) \label{eq:kolmogorov_backward} \end{equation} where $\mathbf{X}_t$ is the It\^{o}~ diffusion \begin{equation} d\mathbf{X}_t = -\mathbf{\vfieldnobf}(\mathbf{X}_t)dt + \sigma(\mathbf{X}_t) d\mathbf{W}_t, \quad \mathbf{X}_0=\mathbf{x}. \label{eq:ito_diffusion} \end{equation} \label{thm:kolmogorov_backward} \end{Thm} Kolmogorov's Backward Equation tells us that the value of $\theta$ at a particular time and location $(t,\mathbf{x})$ is given by the average value of the initial condition evaluated at the position of the It\^{o}~ diffusion \eqref{eq:ito_diffusion} at time $t$ when initialized at $\mathbf{x}$. This suggests a numerical method for evaluating $\mathcal{G}_j(u)=\theta(t_j,\mathbf{x}_j;u)$: (1) initialize a series of particles from $\mathbf{x}_j$; (2) simulate their movement to time $t_j$ according to \eqref{eq:ito_diffusion}; (3) evaluate $\theta_0$ at that location; and (4) take the average. See \cref{fig:particle_trace} for an illustration. \begin{figure}[htbp] \centering \includegraphics[width=0.4\textwidth]{figures/particle2d_00098.png} \caption{Traces of 5 simulated It\^{o}~ diffusions with the same final position.} \label{fig:particle_trace} \end{figure} Numerical integration of \eqref{eq:ito_diffusion} can be computed, for example, with an Euler-Maruyama approximation \cite{kloeden1999numerical,higham2001ain} \begin{equation} \mathbf{X}_{i+1} = \mathbf{X}_i - \mathbf{\vfieldnobf}(\mathbf{X}_i)\Delta t_{i} + \sigma(\mathbf{X}_i)\sqrt{\Delta t_{i}}\xi_i \label{eq:euler} \end{equation} or a Milstein approximation \begin{equation} \mathbf{X}_{i+1} = \mathbf{X}_i - \mathbf{\vfieldnobf}(\mathbf{X}_i)\Delta t_{i} + \sigma(\mathbf{X}_i)\sqrt{\Delta t_{i}}\xi_i + \frac{1}{2}\sigma(\mathbf{X}_i)\sigma'(\mathbf{X}_i)\left( \xi_i^2 - 1 \right)\Delta t_{i} \label{eq:millstein} \end{equation} where $\mathbf{X}_{i} = \mathbf{X}(t_i)$, $\Delta t_{i} = t_{i+1}-t_{i}$, and $\xi_i \sim N(0,1)$. The resulting algorithm is described in \cref{alg:ad_method}, where $N_{o}$ is the number of observations and $N_p$ is the number of particles used per observation. \begin{algorithm} \caption{Particle Method for Computing $\mathcal{G}_j(u)$.}\label{alg:ad_method} \begin{algorithmic}[1] \State Given $u$ (e.g., $\mathbf{\vfieldnobf}$, $\sigma$, and/or $\theta_0$) \For{$j=1 \dots N_o$} \For{$i=1 \dots N_p$} \State Set $\mathbf{X}_0^{(i)} = \mathbf{x}_j$ \State Simulate \eqref{eq:ito_diffusion} with \eqref{eq:euler} or \eqref{eq:millstein} to get $\mathbf{X}_{t_j}^{(i)}(u)$ \State Compute $g_j^{(i)}(u)=\theta_0\left(\mathbf{X}_{t_j}^{(i)}\right)$ \EndFor \State Compute $\mathcal{G}_j(u)=\theta(t_j,\mathbf{x}_j) \approx \frac{1}{N_p}\sum_{i} g_j^{(i)}$ \EndFor \end{algorithmic} \end{algorithm} \subsection{A Particle Method for \cref{prob:bvp}}\label{sec:bvp_method} In this section, we present a particle method for computing $\mathcal{G}(u)$ for the boundary value problem \cref{prob:bvp}. The key idea is in the following theorem, which identifies the solution to \eqref{eq:bvp} in terms of It\^{o}~ diffusions; see, e.g., Section 9.1 of \cite{oksendal2013stochastic} for details. \begin{Thm}[Particle Solution to \eqref{eq:bvp}] Let $f \in C(D)$, $\pdesol_{\partial\spatdom} \in C(\partial D)$, $\mathbf{\vfieldnobf} \in C^1(D)$, and $\sigma \in C^1(D)$. Suppose there exists $\theta \in C^2(D)$ satisfying \eqref{eq:bvp}. Then $\theta$ is given by \begin{equation} \theta(\mathbf{x}) = \mathbb{E} \left[ \pdesol_{\partial\spatdom}\left(\mathbf{X}_{\tau_{\spatdom}}\right) \chi_{\tau_{\spatdom} < \infty} \right] - \mathbb{E} \left[ \int_0^{\tau_{\spatdom}} f(\mathbf{X}_t) \,dt \right] \label{eq:bvp_solution} \end{equation} where, as in \eqref{eq:ito_diffusion}, $\mathbf{X}_t$ is the It\^{o}~ diffusion \begin{equation*} d\mathbf{X}_t = -\mathbf{\vfieldnobf}(\mathbf{X}_t)dt + \sigma(\mathbf{X}_t) d\mathbf{W}_t, \quad \mathbf{X}_0=\mathbf{x} \end{equation*} and $\tau_{\spatdom}$ denotes the first exit time from $D$. \end{Thm} As in \cref{sec:ad_method}, this theorem presents a natural numerical approach to evaluating $\mathcal{G}_j(u)=\theta(\mathbf{x}_j,u)$: (1) initialize a series of particles from $\mathbf{x}_j$; (2) simulate their movement according to \eqref{eq:ito_diffusion} until they exit $D$, integrating $f(\mathbf{X}_t) \,dt$ along the way; (3) evaluate $\pdesol_{\partial\spatdom}$ at the boundary location; (4) subtract the time integral of $f(\mathbf{X}_t)$; and (5) take the average. The resulting algorithm is described in \cref{alg:bvp_method}, where $N_{o}$ is the number of observations and $N_p$ is the number of particles used per observation. \begin{algorithm} \caption{Particle Method for Computing $\mathcal{G}_j(u)$ for \cref{prob:bvp}.}\label{alg:bvp_method} \begin{algorithmic}[1] \State Given $u$ (e.g., $\mathbf{\vfieldnobf}$, $\sigma$, $f$, $\pdesol_{\partial\spatdom}$) \For{$j=1 \dots N_o$} \For{$i=1 \dots N_p$} \State Set $\mathbf{X}_0^{(i)} = \mathbf{x}_j$ \While{$\mathbf{X}_t^{(i)} \in D$} \State Simulate particle position $\mathbf{X}_t^{(i)}$ with \eqref{eq:euler} or \eqref{eq:millstein} \EndWhile \State Compute $g_j^{(i)}(u)=\pdesol_{\partial\spatdom}\left(\mathbf{X}_{\tau_{\spatdom}^{(i)}}^{(i)}\right) - \int_0^{\tau_{\spatdom}^{(i)}} f(\mathbf{X}_t^{(i)}) \,dt$ \EndFor \State Compute $\mathcal{G}_j(u)=\theta(t_j,\mathbf{x}_j) \approx \frac{1}{N_p}\sum_{i} g_j^{(i)}$ \EndFor \end{algorithmic} \end{algorithm} \subsection{Parallelization}\label{sec:parallel} Note that for a given observation point, all but the final step of \cref{alg:ad_method} or \cref{alg:bvp_method} can be computed in parallel. In addition, the steps for separate observation points are entirely independent. As a result, the algorithms are embarrassingly parallel and can therefore be parallelized in a straightforward manner using any number of computational paradigms, such as message passing interface (MPI) processes or OpenMP threads, and naturally vectorize to leverage ``single instruction multiple data'' (SIMD) capabilities on modern CPUs or GPUs. For example, \cref{fig:cuda_thread_blocks}, from NVIDIA's documentation \cite{nvidia2018nvidia}, illustrates the layout of threads and blocks on an NVIDIA GPU. Each thread is a single execution unit that is grouped into a block and then run across one or more SIMD. \cref{alg:ad_method} or \cref{alg:bvp_method} can be ported to this architecture in a natural fashion: each observation can be assigned to a block or group of blocks, with each particle run in a separate thread. A single GPU can execute thousands of threads at a time, allowing thousands of particles to be simulated simultaneously on a single chip. Moreover, larger problems can be spread across multiple GPUs or multiple machines using MPI to gain even greater efficiency; the overhead is minimal as only the average value for each observation needs to be returned to the master process. \begin{figure}[htbp] \centering \includegraphics[width=0.3\textwidth]{figures/grid-of-thread-blocks.png} \caption{GPU thread blocks \cite{nvidia2018nvidia}.} \label{fig:cuda_thread_blocks} \end{figure} \subsection{Computational Complexity} In this section, we will compare the computational costs of \cref{alg:ad_method} to that of a reference Galerkin-based PDE solve. The analysis for \cref{alg:bvp_method} is similar and we summarize the results at the end of this section. Consider the case where $u$ is approximated by a basis expansion $u \approx \sum_{i=1}^{N_u} v_i \mathbf{e}_i$ and evaluation of each basis function $\mathbf{e}_i$ has computational cost $C_{b}$. We use the Euler-Maruyama approximation \eqref{eq:euler} and assume $N_t$ timesteps per observation. Further, we assume evaluating $\mathcal{G}$ requires $N_{o}$ observations and use $N_p$ particles per observation. Then the computational cost of \cref{alg:ad_method} for $P$ parallel processes/threads is given by \begin{equation} C_{particle} = O} %\newcommand{\bigO}{\mathcal{O} \left( \frac{1}{P} N_{o} N_{p} N_{t} N_{u} C_{b} \right). \label{eq:cost_particle} \end{equation} Since the observations and particle simulations are almost entirely independent, they can be executed in parallel (see \cref{sec:parallel}). So for large $P$ we have the limit \begin{equation} C_{particle} \to O} %\newcommand{\bigO}{\mathcal{O} \left( N_{t} N_{u} C_{b} \right). \label{eq:cost_particle_limit} \end{equation} A more traditional method of solving the PDE would be to use a Galerkin projection, which would involve projecting the PDE \eqref{eq:pde_diffusion} onto a set of basis functions $\{ \phi \}_{l=1}^{N_b}$ to get a system of ODEs for the coefficients of $\theta$: \begin{equation} \begin{aligned} M\dot{\Theta}%{\mathbf{\Theta}} &= A\Theta}%{\mathbf{\Theta} \\ M_{lm} &= \ip{\phi_l}{\phi_m} \\ A_{lm} &= \left\langle \phi_l,-\mathbf{\vfieldnobf}(\mathbf{x}) \cdot \nabla \phi_m + \frac{1}{2} \sum_{i,j} (\sigma\sigma^T)_{i,j}(\mathbf{x}) \frac{\partial^2}{\partial x_i \partial x_j} \phi_m \right\rangle. \\ \end{aligned} \label{eq:galerkin} \end{equation} The bases $\phi_{l}$ could, for example, be Fourier or finite element basis functions. The system \eqref{eq:galerkin} is then integrated by repeated iteration of some combination of $M,A$ (explicit, Runge-Kutta methods) and/or their inverses (implicit methods). \cref{alg:reference} outlines this algorithm for Explicit Euler time integration. \begin{algorithm} \caption{Reference Method for Computing $\mathcal{G}_j(u)$ (Galerkin, Explicit Euler).}\label{alg:reference} \begin{algorithmic}[1] \State Given $u$ (e.g., $\mathbf{\vfieldnobf}$, $\sigma$, and/or $\theta_0$) \State Project \eqref{eq:pde_diffusion} onto $\{ \phi \}_{l=1}^{N_b}$ to get system $M\dot{\Theta}%{\mathbf{\Theta}} = A\Theta}%{\mathbf{\Theta}$ \For{$i=1 \dots N_t$} \State Multiply $\Theta}%{\mathbf{\Theta}_{i} = \left( M + \Delta t_i A \right)\Theta}%{\mathbf{\Theta}_{i-1}$ \EndFor \For{$j=1 \dots N_o$} \State Compute $\mathcal{G}_j(u)=\sum_{l} \Theta}%{\mathbf{\Theta}_{l}(t_j)\phi_l(\mathbf{x}_j)$ \EndFor \end{algorithmic} \end{algorithm} The computational costs of assembling the matrix $A$ are heavily dependent on the choice of $\mathbf{\vfieldnobf}$ and $\{\phi\}$ and therefore difficult to characterize in general. The cost of computing the observations is typically small. Ignoring these two factors, the computational cost of \cref{alg:reference} is dominated by the time integration of the system, which is made up of a series of matrix-vector multiplications. In general, the cost of this computation for $N_b$ basis functions and $N_t$ time steps is \begin{equation} C_{reference} \to O} %\newcommand{\bigO}{\mathcal{O} \left( N_{t} N_{b}^2 \right). \label{eq:cost_reference} \end{equation} Note also that to model an unknown of dimension $N_{u}$ requires $N_b \ge N_{u}$. In practice, however, accurate modeling of $\theta$ may require $N_b \gg N_{u}$, particularly for small diffusion. Thus the ratio of the cost of the particle method \eqref{eq:cost_particle} to the reference method \eqref{eq:cost_reference} is \begin{equation} \frac{C_{particle}}{C_{reference}} = O} %\newcommand{\bigO}{\mathcal{O} \left( \frac{C_{b}N_{u}}{N_{b}^2} \right), \quad\text{so typically } \frac{C_{particle}}{C_{reference}} \ll O} %\newcommand{\bigO}{\mathcal{O} \left( \frac{C_{b}}{N_{b}} \right). \label{eq:cost_ratio} \end{equation} Thus for applications with a small enough number of observations or sufficient parallelism that a substantial proportion of the particles can be computed in parallel, the particle method should provide substantial speedup for large $N_{b}$ and in particular for problems with high-dimensional unknowns. We have of course, made some simplifications in this analysis: For some choices of $\{\phi\}$ (e.g., discontinuous Galerkin \cite{hesthaven2007nodal}), the matrix $A$ may be sparse or block diagonal, reducing the cost of the matrix multiply and increasing the effectiveness of parallelization. However, we have also ignored some of the costs of \cref{alg:reference} and most of the performance improvement comes from not computing the full field $\theta$, so the computational complexity for large $N_u$ or small $N_o$ should be as indicated here for a large class of reference algorithms. The analysis for the boundary value method, \cref{alg:bvp_method}, is similar. The computational cost for the method is similar to that of \cref{alg:ad_method}; the main difference is that the number of timesteps required to reach the boundary of $D$ is uncertain and so may be larger or smaller than the largest $t_j$ for the time dependent problem. A Galerkin approach to solving \eqref{eq:bvp}, meanwhile, would replace the time integration of the reference method \cref{alg:reference} with an iterative solver of a linear system $A \Theta}%{\mathbf{\Theta} = F$. Many efficient methods exist for solving these systems; however, because the number of basis functions required to represent $\theta$ would typically be much higher than the number of degrees of freedom in the parameter $u$, we still expect the particle method to yield significant efficiencies for applications with sparse observations (i.e., small $N_o$). \subsection{Limitations} For completeness, we identify two key limitations of using \cref{alg:ad_method} or \cref{alg:bvp_method} to compute $\mathcal{G}$: \begin{itemize} \item It is sometimes desirable to compute charateristics of $\theta$ beyond what is contained in $\mathcal{G}$. For example, \cite{borggaard2018bayesian} presents the statistics of the variance and variance dissipation of $\theta$ according to the Bayesian posterior on $\mathbf{\vfieldnobf}$. Of course, because these particle methods do not involve computing the full field $\theta$, we cannot compute characteristics of $\theta$ beyond the values contained in $\mathcal{G}$. However, we note that the proposed particle algorithm could be used to compute the solution to the inverse problem, e.g., the maximum a posteriori $u_{MAP}$. Then a single, computationally-expensive PDE solve could be used to compute the characteristics of that solution -- see, for example, the plot of $\theta(u_{MAP})$ in \cref{fig:ex3:map} or the plot of the optimal $\theta$ in \cref{fig:bvp:ex1:results}. \item Many approaches to inverse problems (e.g., Hamiltonian Monte Carlo \cite{bou2018geometric,neal2011mcmc} for Bayesian inverse problems or Newton's method for optimization \cite{nocedal2006numerical}) require computing the Fr\'echet~ derivative $D\mathcal{G}(u)$, which cannot be computed via the particle method in its current form. The gradient of $\mathcal{G}$ would therefore have to be approximated, e.g. via a finite-difference approximation involving multiple computations of $\mathcal{G}$. \end{itemize} \section{Numerical Examples}\label{sec:results} In this section, we provide examples demonstrating the applications and power of the particle methods \cref{alg:ad_method} and \cref{alg:bvp_method}. The examples were mostly written in the Julia numerical computing language \cite{bezanson2017julia}; the particle method was written in a combination of C and CUDA. The computations were run on the computational clusters at Virginia Tech,\footnote{\url{http://www.arc.vt.edu}} with each particle computation using a single NVIDIA P100 GPU. We note that a multi-GPU implementation should yield further speedup for larger problem sizes, with minimal overhead due to the embarrassingly parallel nature of the particle method. \subsection{Example: Bayesian Inference of Fluid Flows}\label{sec:results:bayes} In this section we present some numerical examples of the application of \cref{alg:ad_method} to the Bayesian inverse problem \cite{kaipio2005statistical,dashti2017bayesian} of estimating the background flow $\mathbf{\vfieldnobf}$ from noisy point observations of $\theta$ with a constant diffusion coefficient: \begin{equation} \frac{d\theta}{dt}(\mathbf{x}) = -\mathbf{\vfieldnobf}(\mathbf{x}) \cdot \nabla \theta(t,\mathbf{x}) + \kappa \Delta \theta(t,\mathbf{x}), \quad \nabla \cdot \mathbf{\vfieldnobf}=0, \quad \theta(0,\mathbf{x})=\theta_0(\mathbf{x}). \label{eq:adr} \end{equation} (In the notation of \eqref{eq:pde_diffusion}, $\sigma_{ij}(\mathbf{x})=\sqrt{2\kappa}\delta_{ij}$; note that since $\sigma$ is constant for this application, the Euler-Maruyama \eqref{eq:euler} and Milstein \eqref{eq:millstein} approximations are equivalent.) Accurate simulation of the low-$\kappa$ case is an active area of research \cite{stynes2013numerical,morton1996numerical,codina2000stabilized,hundsdorfer2013numerical,mudunuru2016enforcing}; in this case, the solution $\theta$ can become high-dimensional very quickly, making accurate PDE solves highly computationally expensive \cite{borggaard2018bayesian}. Thus the particle method will yield substantial benefit as the dimension of the background flow increases. We represent the background flow $\mathbf{\vfieldnobf}$ via a divergence-free Fourier expansion in terms of wave numbers $\mathbf{k} \in \Z^2$ \begin{equation} \mathbf{\vfieldnobf}(\mathbf{x}) = \sum_{\mathbf{k}} v_{\mathbf{k}} \frac{\mathbf{k}^\perp}{\norm{\mathbf{k}}} e^{2\pi i \mathbf{k} \cdot \mathbf{x}} \label{eq:v_expand} \end{equation} where $\mathbf{k}^\perp = [-k_y, k_x]$ so that $\mathbf{k} \cdot \mathbf{k}^\perp = 0$, and $v_{\mathbf{k}}$ obeys the reality condition $v_{\mathbf{k}}=-\overline{v_{-\mathbf{k}}}$. Thus, evaluating $\mathbf{\vfieldnobf}(\mathbf{x})$ involves computing a series of sines and cosines; this represents the dominant cost in the particle method. We will now compute the Bayesian posterior distribution for three example problems while using \cref{alg:ad_method} to compute the forward map $\mathcal{G}$. All results are computed using the preconditioned Crank-Nicholson Markov Chain Monte Carlo (MCMC) method. For the details of this particular application, we refer the reader to \cite{borggaard2018bayesian}. The first example will demonstrate consistency of the method with the traditional two-step method implemented in \cite{borggaard2018bayesian}. The second will demonstrate how the particle method allows extension of Example 1 to higher-dimensional vector fields. Finally, we conclude with an example where \cref{alg:ad_method} allows application to a problem where the true background flow contains many thousands of components. We note that for these Bayesian inference experiments, for simplicity we have used $N_{b}=N_{u}$ in the reference method; many applications would require $N_{b} \gg N_{u}$ (more basis functions to represent $\theta$ than $\mathbf{\vfieldnobf}$), increasing the cost of the reference method. \subsubsection{Example 1: Consistency} In \cite{borggaard2018bayesian}, the forward map $\mathcal{G}$ was computed with a two-step ``solve, then observe'' method: \eqref{eq:adr} was expanded in a Fourier basis, projected onto a system of ODEs, integrated in time, and then observed. In this section, we repeat the computations from Section 5.2 of that paper, in which $\mathbf{\vfieldnobf}$ was assumed to have dimension of less than or equal to $197$ and $\mathcal{G}$ involved 100 point observations of $\theta$ (i.e., $N_{u}=197$ and $N_o=100$). In this case, the dimension of $\mathbf{\vfieldnobf}$ is low relative to the number of observations; thus the value of the particle method is limited -- the PDE solves in \cite{borggaard2018bayesian} took approximately the same time as the GPU particle implementation. The results are shown simply to demonstrate that they are consistent for the two methods. \begin{figure}[!htbp] \centering \begin{minipage}[b]{0.49\textwidth} \includegraphics[width=\textwidth]{figures/ex1_true/v_hist.pdf} \end{minipage} \hfill \begin{minipage}[b]{0.49\textwidth} \includegraphics[width=\textwidth]{figures/ex1/v_hist.pdf} \end{minipage} \caption{\label{fig:ex1_prior_posterior} Posterior marginal distributions for the first eight components of $\mathbf{\vfieldnobf}$. Left: 25M samples, Traditional Method, see \cite{borggaard2018bayesian}. Right: 10M samples, Particle Method.} \end{figure} \cref{fig:ex1_prior_posterior} shows the computed posterior marginal histograms for the first eight Fourier components of the background flow $\mathbf{\vfieldnobf}$, for both the original computation from \cite{borggaard2018bayesian} and as computed via \cref{alg:ad_method}. The structure of the posterior distributions have largely the same structure; smaller differences result from the fact that the posterior for this problem is highly complex and very slow to converge. \cref{fig:ex1_hist2d} shows the analogous two-dimensional histograms, which again show similar structure. \begin{figure}[!htbp] \centering \begin{minipage}[b]{0.49\textwidth} \includegraphics[width=\textwidth]{figures/ex1_true/comp/hist_100_8x8.pdf} \end{minipage} \hfill \begin{minipage}[b]{0.49\textwidth} \includegraphics[width=\textwidth]{figures/ex1/comp/hist_100_8x8.pdf} \end{minipage} \caption{\label{fig:ex1_hist2d}Posterior two-dimensional histograms for the first eight components of $\mathbf{\vfieldnobf}$. Left: 25M samples, Traditional Method, see \cite{borggaard2018bayesian}. Right: 10M samples, Particle Method.} \end{figure} \subsubsection{Example 2: Extension to Higher-Dimensions} In this example, we relax the assumption from Example 1 that the background flow has wave numbers with $\norm{\mathbf{k}}_2 \le 8$ ($N_{u}=197$); here we allow $\norm{\mathbf{k}}_2 \le 32$ ($N_{u}=3,209$). When computed using the reference method, the $16$-fold increase in the dimension of $\mathbf{\vfieldnobf}$ yielded an increase of over $300$ in the computational cost of each sample, making it computationally intractable to generate enough samples to resolve the complex structure of the posterior distribution. By contrast, the computational cost of the GPU-based particle method only increased by a factor of $9$, as some of the linear computational cost \eqref{eq:cost_particle} was absorbed by the parallelism in the GPU. \begin{figure}[!htbp] \centering \begin{minipage}[c]{0.49\textwidth} \includegraphics[width=\textwidth]{figures/ex2/v_hist.pdf} \end{minipage} \hfill \begin{minipage}[c]{0.49\textwidth} \includegraphics[width=\textwidth]{figures/ex2/comp/hist_100_8x8.pdf} \end{minipage} \caption{\label{fig:ex2_posterior} Posterior marginal (left) and two-dimensional histograms for the first eight components of $\mathbf{\vfieldnobf}$.} \end{figure} To approximate the posterior, we generated 2.5 million samples via 100 separate 25,000-sample chains. \cref{fig:ex2_posterior} shows the resulting posterior marginal distributions (left) and two-dimensional posterior histograms (right). When compared with \cref{fig:ex1_prior_posterior} and \cref{fig:ex1_hist2d}, respectively, we see that the posterior shows additional regions of probability mass - see, for example, the peaks for $v_8 \approx \pm 1.5$. This indicates that the restriction of $\mathbf{\vfieldnobf}$ to Fourier modes with $\norm{\mathbf{k}}_2 \le 8$ caused some possible candidate vector fields to be missed or de-emphasized. \subsubsection{Example 3: Turbulent Background Flows} \label{sec:ex3:highd} We conclude the Bayesian examples by using the particle method to address a problem of much higher dimension than is considered in \cite{borggaard2018bayesian}. We again consider the Bayesian inverse problem of estimating $\mathbf{\vfieldnobf}$ from measurements of $\theta$ (see \eqref{eq:adr}). However, this time we consider $\mathbf{\vfieldnobf}$ made up of components of wave numbers with $\norm{\mathbf{k}}_2 \le 80$, a total of 20,081 components ($N_{u}=20,081$). We use the same initial condition $\theta_0$ and prior structure as in the previous two examples (though we allow the prior to extend to higher dimensions). In this example, we use $\kappa=3 \times 10^{-5}$ from \cite{chen1998simulations}, which is typical for diffusion in water. We generate data by drawing a velocity field from the prior and computing $\theta$ at 13 evenly-spaced times between 0 and 0.5 at each of two observation locations: $[0,0], [\frac{1}{2},\frac{1}{2}]$. Computing a Galerkin approximation of $\theta$ for this problem would require many matrix multiplications each of tens of thousands of rows and columns, making the computation of many thousands of samples, in general, computationally intractable. Using \cref{alg:ad_method} to compute the forward map $\mathcal{G}$, however, the computation scales roughly linearly with the number of unknowns, as shown in \cref{fig:gpu_time_compare}. \begin{figure}[h] \centering \includegraphics[width=0.7\textwidth]{figures/gpu_time_compare.pdf} \caption{\label{fig:gpu_time_compare} Time in seconds to compute $\mathcal{G}$ by dimension of unknown ($N_u$) for reference (Fourier) and particle methods.} \end{figure} \cref{fig:ex3:map} shows the vorticity and norm of the maximum a priori (MAP) point from 100,000 computed pCN MCMC samples; this can be thought of as the background flow that best matches both the prior measure and the observations for a given model of observational noise. The figures show the complexity of the background flows that could be considered in the inference by allowing the inclusion of tens of thousands of parameters. \begin{figure}[h] \centering \begin{minipage}[b]{0.49\textwidth} \includegraphics[width=\textwidth]{figures/ex3/map/map_vort.png} \end{minipage} \hfill \begin{minipage}[b]{0.49\textwidth} \includegraphics[width=\textwidth]{figures/ex3/map/map_vnorm.png} \end{minipage} \caption{\label{fig:ex3:map} Contour plots of vorticity (left) and norm (right) of $\mathbf{\vfieldnobf}_{MAP}$.} \end{figure} \subsection{Optimal Forcing for Boundary Value Problem} In this section, we provide an example application of boundary value method \cref{alg:bvp_method}. For this example, we consider a version of the boundary value problem \cref{prob:bvp} with laminar background flow, constant diffusion, known boundary conditions, but to-be-determined forcing: \begin{equation} \begin{aligned} -\left[ \begin{array}{c} 1 \\ 1 \end{array}\right] \cdot \nabla \theta(\mathbf{x}) + \kappa \Delta \theta(\mathbf{x}) &= \sum_{j=1}^3 f_j \exp \left( -4 \norm{\mathbf{x}-\mathbf{x}_{f}^{(j)}}_2^2 \right) && \quad \mathbf{x} \in D \coloneqq [0,1]^2 \\ \theta(\mathbf{x}) &= \frac{1}{2} \left[ \cos\left( \frac{\pi}{2} x \right) + \cos\left( \frac{\pi}{2} y \right) \right] && \quad \mathbf{x}\in \partialD. \end{aligned} \label{eq:bvp:ex1} \end{equation} The goal of the problem is to find the forcing coefficients $\mathbf{F}=\left[ f_1, f_2, f_3 \right]$ that produce the scalar field $\theta$ that best matches the target values $\mathcal{Y}$ at three observation locations $\left\{ \mathbf{x}_{obs}^{(i)} \right\}$. That is, we seek \begin{equation} \mathbf{F}^\star \coloneqq \argmin_{\mathbf{F}} \norm{ \mathcal{Y} - \mathcal{G}\left(\mathbf{F}\right) }, \quad \mathcal{G}\left(\mathbf{F}\right) = \left[ \theta\left( \mathbf{x}_{obs}^{(1)},\mathbf{F} \right), \theta\left( \mathbf{x}_{obs}^{(2)},\mathbf{F} \right), \theta\left( \mathbf{x}_{obs}^{(3)},\mathbf{F} \right) \right]. \label{eq:bvp:ex1:cost} \end{equation} The problem is thus an optimal control problem and can be interpreted as, e.g., \begin{itemize} \item Find the heat sources or sinks that produce the desired temperature at important locations in a room \item Find the forcing that minimizes the concentration of a chemical at key locations in a system (see, e.g., \cite{chang1992optimal,whiffen1993nonlinear} for examples with time-varying forcing) \end{itemize} The forcing locations $\left\{ \mathbf{x}_{f}^{(j)} \right\}$ and observation locations $\left\{ \mathbf{x}_{obs}^{(i)} \right\}$ used in this example are shown in \cref{fig:bvp:ex1:problem}. For this problem, we use diffusion coefficient $\kappa=0.282$, for water diffusing in air \cite{cussler2009diffusion}, and seek to match data $\mathcal{Y}=[0, 0, 0]$. \begin{figure}[h] \centering \includegraphics[width=0.4\textwidth]{figures/ex_bvp/problem.pdf} \caption{\label{fig:bvp:ex1:problem} Forcing locations, observation locations, and background flow.} \end{figure} Recall that the forward map $\mathcal{G}$ is sparse for this problem - we only need $\theta$ evaluated at three points. We can therefore leverage \cref{alg:bvp_method} to speed up the computations. We use a Nelder-Mead simplex method \cite{nelder1965simplex,lagarias1998convergence} as implemented in Julia's Optim package \cite{mogensen2018optim} to seek the optimal $\mathbf{F}$. The method required evaluating $\mathcal{G}$ for thousands of possible values of $\mathbf{F}$. The requirement of multiple evaluations of the forward map is typical of many approaches to PDE-constrained optimization problems \cite{hinze2009optimization}. The choice of Nelder-Mead is merely used to demonstrate the effectiveness of \cref{alg:bvp_method} within an optimization setting. \begin{figure}[h] \centering \begin{minipage}[b]{0.49\textwidth} \includegraphics[width=\textwidth]{figures/ex_bvp/fem_sol_wobs.pdf} \end{minipage} \hfill \begin{minipage}[b]{0.49\textwidth} \includegraphics[width=\textwidth]{figures/ex_bvp/fem_f.pdf} \end{minipage} \caption{\label{fig:bvp:ex1:results} Scalar field $\theta$ (left) and forcing function (right) for computed optimal coefficients $\mathbf{F}^\star$.} \end{figure} The results, $\theta$ and $f$, for the computed optimal forcing are shown in \cref{fig:bvp:ex1:results}; notice that the observation points lie along the contour $\theta=0$, indicating that we have found a set of parameters that are a good match for the data. (These plots, which required approximation of $\theta$ for the full domain, were generated via a finite element solver after $\mathbf{F}^\star$ was computed via the particle method; the plots required more work to generate than finding the optimal set of coefficients.) We note that other, similar optimization problems -- for example, fixing the forcing and instead seeking $\mathbf{\vfieldnobf}$, $\kappa$, and/or boundary conditions that produce $\theta$ best matching the data -- could be addressed via an analogous approach, again by leveraging \cref{alg:bvp_method} to compute $\theta$ at the observation points for each value of the parameter considered by the optimization algorithm. \section{Acknowledgments} This work was supported in part by the National Science Foundation under grants DMS-1313272, DMS-1522616, and DMS-1819110; the National Institute for Occupational Safety and Health under grant 200-2014-59669; and the Simons Foundation under grant 515990. We would also like to thank the Mathematical Sciences Research Institute, the Tulane University Math Department, and the International Centre for Mathematical Sciences (ICMS) where significant portions of this project were developed and carried out. The authors acknowledge Advanced Research Computing at Virginia Tech\footnote{\url{http://www.arc.vt.edu}} for providing computational resources and technical support that have contributed to the results reported within this paper. \addcontentsline{toc}{section}{References} \begin{footnotesize} \bibliographystyle{plain}
\section{Introduction} The \emph{bottleneck path} problem is a graph optimization problem finding a path between two vertices with the maximum flow, in which the flow of a path is defined as the minimum capacity of edges on that path. The bottleneck problem can be seen as a mathematical formulation of many network routing problems, e.g. finding the route with the maximum transmission speed between two nodes in a network, and it has many other applications such as digital compositing~\cite{Fernandez1998}. It is also the important building block of other algorithms, such as the improved Ford-Fulkerson algorithm~\cite{edmonds1972theoretical,fordf1956}, and k-splittable flow algorithm~\cite{baier2002k}. The minimax path problem which finds the path that minimizes the maximum weight on it is symmetric to the bottleneck path problem, thus has the same time complexity. \subsection{Our Results} In a directed graph $G=(V,E)$ ($n=|V|,m=|E|$), we consider the single-source bottleneck path (SSBP) problem, which finds the bottleneck paths from a given source node $s$ to all other vertices. In the comparison-based model, the previous best time bound for SSBP is the traditional Dijkstra's algorithm~\cite{dijkstra1959note} with Fibonacci heap~\cite{fredman1987fibonacci}, which runs in $O(m + n\log n)$ time. Some progress has been made for slight variants of the SSBP problem: When the graph is undirected, SSBP is reducible to minimum spanning tree~\cite{Hu1961}, thus can be solved in randomized linear time \cite{karger1995randomized}; for the single-source single-destination bottleneck path ($s$-$t$ BP) problem in directed graphs, Gabow and Tarjan~\cite{gabow1988algorithms} showed that it can be solved in $O(m \log^* n)$ time, and this bound was subsequently improved by Chechik~et~al~\cite{chechik2016bottleneck} to $O(m\beta(m,n))$. However, until now no algorithm is known to be better than Dijkstra's algorithm for SSBP in directed graphs. And as noted in \cite{fredman1987fibonacci}, Dijkstra's algorithm can be used to sort $n$ numbers, so a ``sorting barrier'', $O(m + n \log n)$, prevents us from finding a more efficient implementation of Dijkstra's algorithm. In this paper, we present a breakthrough algorithm for SSBP that overcomes the sorting barrier. Our main result is shown in the following theorem: \begin{theorem} Let $G = (V, E)$ be a directed graph with edge weights $w: E \to \mathbb{R}$. In comparison-based model, SSBP can be solved in expected $O\left(m \sqrt{\log n}\right)$ time. \end{theorem} Our algorithm is inspired by previous works on the $s$-$t$ BP problem: the $O(m \log^* n)$-time algorithm by Gabow and Tarjan~\cite{gabow1988algorithms} and the $O(m \beta(m, n))$-time algorithm by Chechik~et~al~\cite{chechik2016bottleneck}. See Section~\ref{sec:intu} for our intuitions. \subsection{Related Works} A ``sorting barrier'' seemed to exist for the the Minimum Spanning Tree problem (MST) for many years \cite{Bor26,Jar30,Kru56}, but it was eventually broken by \cite{Yao75,CT76}. Fredman and Tarjan~\cite{fredman1987fibonacci} gave an $O(m\beta(m,n))$-time algorithm by introducing Fibonacci heap. The current best time bounds for MST include randomized linear time algorithm by Karger et al~\cite{karger1995randomized}, Chazelle's $O(m\alpha(m,n))$-time deterministic algorithm~\cite{Chaz00a} and Pettie and Ramachandran's optimal approach~\cite{PR02c}. The single-source single-destination version of the bottleneck path (s-t BP) problem is proved to be equivalent to the Bottleneck Spanning Tree (BST) problem (see~\cite{chechik2016bottleneck}). In the bottleneck spanning tree problem, we want to find a spanning tree rooted at source node $s$ minimizing the maximum edge weight in it. For undirected graph, the s-t BP can be reduced to the MST problem. For directed graph, Dijkstra's algorithm \cite{dijkstra1959note} gave an $O(n\log n+m)$-time solution using Fibonacci heap \cite{fredman1987fibonacci}. Then Gabow and Tarjan \cite{gabow1988algorithms} gave an $O(m\log^*n)$-time algorithm based on recursively splitting edges into levels. Recently, Chechik~et~al.~\cite{chechik2016bottleneck} improved the time complexity of BST and BP to randomized $O(m\beta(m,n))$ time, where $\beta(m,n)=\min\{k\geq 1: \log^{(k)}n\leq\frac{m}{n}\}$. All these algorithms are under comparison-based model. For word RAM model, an $O(m)$-time algorithm has been found by Chechik et al.~\cite{chechik2016bottleneck}. For the all-pairs version of the bottleneck path (APBP) problem, we can sort all the edges and use Dijkstra search to obtain an $O(mn)$ time bound. For dense graphs, it has been shown that APBP can be solved in truly subcubic time. Shapira et al.~\cite{shapira2007all} gave an $O(n^{2.575})$-time APBP algorithm on vertex-weighted graphs. Then Vassilevska et al.~\cite{vassilevska2007all} showed that APBP for edge-weighted graphs can be solved in $O(n^{2+\omega/3})=O(n^{2.791})$ time based on computing $(\max, \min)$-product of real matrices, which was then improved by Duan and Pettie~\cite{duan2009fast} to $O(n^{(3+\omega)/2})=O(n^{2.686})$. Here $\omega<2.373$ is the exponent of time bound for fast matrix multiplication~\cite{Coppersmith1990, Williams:2012}. \section{Preliminaries} For a directed graph $G$, we denote $w(u, v)$ to be the edge weight of $(u, v) \in E$. Without additional explanation, we use the symbol $n$ to denote the number of nodes and $m$ to denote the number of edges in $G$. \subsection{Bottleneck Path Problems} \label{sec:def-bp} The \textit{capacity} of a path is defined to be the minimum weight among traversed edges, i.e., if a path traverses $e_1, \dots, e_l \in E$, then the capacity of the path is $\min_{i = 1}^{l} w(e_i)$. For any $u, v \in V$, a path from $u$ to $v$ with maximum capacity is called a \textit{bottleneck path} \textit{from} $u$ \textit{to} $v$, and we denote this maximum capacity by $b(u, v)$. \begin{definition} The \textit{Single-Source Bottleneck Path} (SSBP) problem is: Given a directed graph $G = (V, E)$ with weight function $w : E \to \mathbb{R}$ and a source $s \in V$, output $b(s, t)$ for every $t \in V$, which is the maximum path capacity among all the paths from $s$ to $t$. \end{definition} We use the triple $(G, w, s)$ to denote a SSBP instance with graph $G$, weight function $w(\cdot)$ and source node $s$. It is more convenient to present our algorithm on a slight variant of the SSBP problem. We shall call it \textit{\ModSSBPlong} (\ModSSBPshort) problem. We assume that the edge weight $w(e)$ of an edge $e \in E$ is either a real number or infinitely large ($+\infty$). We say an edge $e$ is \textit{unrestricted} if $w(e) = +\infty$; otherwise we say the edge $e$ is \textit{restricted}. In the \ModSSBPshort problem, an \textit{\initcapa} $h(v)$ is given for every node $v \in V$, and the \textit{capacity} of a path is redefined to be the minimum between the \initcapa of the starting node and the minimum edge weights in the path, i.e., if the path starts with the node $v \in V$ and traverses $e_1, \dots, e_l$, then its capacity is $\min\left(\{h(v)\} \cup \{w(e_i)\}_{i = 1}^{l}\right)$. For any $v \in V$, a path ended with $v$ with maximum capacity is called a \textit{bottleneck path ended with} $v$, and we denote this maximum capacity as $d(v)$. \begin{definition} The \textit{\ModSSBPlong} (\ModSSBPshort) problem is: Given a directed graph $G = (V, E)$ with weight function $w : E \to \mathbb{R} \cup \{+\infty\}$ and \initcapa function $h: V \to \mathbb{R} \cup \{\pm \infty\}$, output $d(v)$ for every $v \in V$, which is the maximum path capacity among all the paths ended with $v$. \end{definition} We use the triple $(G, w, h)$ to denote an \ModSSBPshort instance with graph $G$, weight function $w(\cdot)$, and inital capacity function $h(\cdot)$. Note that \ModSSBPshort and SSBP are equivalent under linear-time reductions. Given an \ModSSBPshort instance, we construct a new graph $G'$ from $G$ by adding a new node $s$ which has outgoing edges with weight $h(v)$ to all the nodes $v \in V$ having $h(v) > -\infty$, then it suffices to find bottleneck paths from $s$ to all other nodes in $G'$. On the other hand, a SSBP instance $(G, w, s)$ can be easily reduced to the \ModSSBPshort instance $(G, w, h)$, where $h(s) = \max_{e\in E}\{w(e)\}$ and $h(v) = -\infty$ for all $v \neq s$. \subsection{Dijkstra's Algorithm for SSBP and \ModSSBPshort} \label{sec:dijk} SSBP can be easily solved using a variant of Dijkstra's algorithm~\cite{dijkstra1959note}. In this algorithm, each node is in one of the three status: \textit{unsearched}, \textit{\statuslabeled}, or \textit{scanned}. We associate each node $v \in V$ with a \textit{label} $d'(v)$, which is the maximum path capacity among all the paths from $s$ to $v$ that only traverse scanned nodes or $v$. Initially, all the nodes are unsearched except $s$ is \statuslabeled, and we set $d'(s) = +\infty$ and $d'(v) = -\infty$ for all $v \neq s$. We repeat the following step, which we call the \textit{Dijkstra step}, until none of nodes is \statuslabeled: \begin{itemize} \item Select an \statuslabeled node $u$ with maximum label and mark $u$ as scanned. For every outgoing edge $(u, v)$ of $u$, update the label of $v$ by \begin{equation} \label{eq:dijkupd} d'(v) \gets \max\{d'(v), \min\{d'(u), w(u, v)\}\}, \end{equation} and mark $v$ as \statuslabeled if $v$ is unsearched. \end{itemize} We use priority queue to maintain the order of labels for \statuslabeled nodes. This algorithm runs in $O(m + n \log n)$ time when Fibonacci heap \cite{fredman1987fibonacci} is used. The algorithm we introduced above can also be adapted for solving \ModSSBPshort. The only thing we need to change is that in the initial stage all nodes are \statuslabeled and $d'(v) = h(v)$ for every $v \in V$. The resulting algorithm again runs in $O(m + n \log n)$ time. We shall call these two algorithms as \textit{Dijkstra's algorithm for SSBP} and \textit{Dijkstra's algorithm for \ModSSBPshort}, or simply call any of them \textit{Dijkstra's algorithm} when no confusion can arise. \subsection{Weak and Strong Connectivity in Directed Graph} We also need some definitions about connectivity in graph theory in this paper. A directed graph is said to be \textit{weakly-connected} if it turns to be a connected undirected graph when changing all of its directed edges to undirected edges. A directed graph is said to be \textit{strongly-connected} if every pair of nodes can be reached from each other. A \textit{weakly-} (or \textit{strongly-}) \textit{connected components} is defined to be a maximal weakly- (or strongly-) connected subgraph. \section{Intuitions for SSBP} \label{sec:intu} If all the edge weights are integers and are restricted in $\{1, \dots, c\}$, then SSBP can be solved in $O(m + c)$ time using Dijkstra's algorithm with bucket queue. If the edge weights are not necessarily small integers but all the edges given to us are already sorted by weights, then we can replace the edge weights by their ranks and use Dijkstra's algorithm with bucket queue to solve the problem in $O(m)$ time. However, edges are not sorted in general. If we sort the edges directly, then a cost of $\Omega(m \log m)$ time is unavoidable in a comparison-based model, which is more expensive than the $O(m + n \log n)$ running time of Dijkstra's algorithm. Our algorithm is inspired by previous works on the single-source single-destination bottleneck path problem ($s$-$t$ BP): the $O(m \log^* n)$-time algorithm by Gabow and Tarjan~\cite{gabow1988algorithms} and the $O(m \beta(m, n))$-time algorithm by Chechik~et~al~\cite{chechik2016bottleneck}. Gabow and Tarjan's algorithm for $s$-$t$ BP consists of several stages. Let $b(s, t)$ be the capacity of a bottleneck path from $s$ to $t$. Initially, we know that $b(s, t)$ is in the interval $(-\infty, +\infty)$. In each stage, we narrow the interval of possible values of $b(s, t)$. Assume that $b(s, t)$ is known to be in the range $(l, r)$. Let $m_{(l,r)}$ be the the number of edges with weights in the range $(l, r)$ and $k$ be a parameter. By applying the median-finding algorithm \cite{blum1973time} repeatedly, we choose $k$ thresholds $\lambda_1, \cdots, \lambda_k$ to split $(l, r)$ into $k + 1$ subintervals $(l, \lambda_1), [\lambda_1, \lambda_2), [\lambda_2, \lambda_3), \dots, [\lambda_{k-1}, \lambda_k), [\lambda_k, r)$ such that for each subinterval, there are $O(m_{(l,r)} / k)$ edges of weight in it. Gabow and Tarjan then show that \textit{locating} which subinterval contains $b(s, t)$ can be done in $O(m_{(l,r)})$ time by incremental search. Finally, the $O(m \log^* n)$ running time bound is achieved by setting $k$ appropriately at each stage. The algorithm by Chechik~et~al.~is based on the framework of Gabow and Tarjan's algorithm, but instead of selecting the thresholds $\lambda_1, \dots, \lambda_k$ by median-finding repeatedly in $O(m_{(l, r)} \log k)$ time, in this algorithm we select the $k$ thresholds by randomly sampling in edge weights, and sort them in $O(k \log k)$ time. These thresholds partition the edges evenly with high probability, but it requires $\Omega(m \log k)$ time to compute the partition explicitly. Then they show that actually we can locate which subinterval contains $b(s, t)$ in $O(m_{(l, r)} + nk)$ (or $O(m_{(l, r)} + n \log k)$) time, without computing the explicit partition. The time bound for the overall algorithm is again obtained by setting $k$ appropriately at each stage. We adapt Chechik~et~al.'s framework for the $s$-$t$ BP problem to the SSBP problem. Our SSBP algorithm actually works on an equvialent problem called \ModSSBPshort. In \ModSSBPshort, there is no fixed source but every node has an \initcapa, and for all destination $t \in V$ we need to compute the capacity $d(t)$ of a bottleneck path ended with $t$ (See Section \ref{sec:def-bp} for details). Instead of locating the subinterval for a single destination $t$, our algorithm locates the subintervals for all destinations $t \in V$. Thus we adopt a divide-and-conquer methodology. At each recursion, we follow the idea from Chechik~et~al.~\cite{chechik2016bottleneck} to randomly sample $k$ thresholds. Then we \textit{split} the nodes into $k + 1$ levels $V_0, \dots, V_k$, where the $i$-th level contains the nodes $t$ that have $d(t)$ in the $i$-th subinterval ($0 \le i \le k$). For each level $V_i$ of nodes, we compute $d(t)$ for every $t \in V_i$ by reducing to solve the SSBP on a subgraph consisting of all the nodes in $V_i$ and some of the edges connecting them. We set $k$ to be fixed in all recursive calls, and the maximum recursion depth is $O(\log n / \log k)$ with high probability. The split algorithm becomes the key part of our algorithm. Note that at each recursion, we should reduce or avoid the use of operations that cost time $O(\log k)$ per node or per edge (e.g., binary searching for the subinterval containing a particular edge weight). This is because that, for example, if we execute an $O(\log k)$-time operation for each edge at each recursion, then the overall time cost is $O(m \log k) \cdot O(\log n / \log k) = O(m \log n)$, which means no improvement comparing with the previous $O(m + n \log n)$-time Dijkstra's algorithm. Surprisingly, we can design an algorithm such that whenever we execute an $O(\log k)$-time operation, we can always find one edge that does not appear in any subsequent recursive calls. Thus total time complexity for such operations is $O(m \log k)$, which gives us some room to obtain a better time complexity by adjusting the parameter~$k$. \section{Our Algorithm} Our algorithm for SSBP is as follows: Given a SSBP instance $(G, w, s)$, we first reduce the SSBP problem to an \ModSSBPshort instance $(G, w, h)$, and then use a recursive algorithm (Figure \ref{fig:algomain}) to solve the \ModSSBPshort problem. The reduction is done by setting $h(s) = \max_{e\in E}\{w(e)\}$ and $h(v) = -\infty$ for all $v \neq s$ as described in the preliminaries. For convenience, we assume that in the original graph, all edge weights are distinct. This assumption can be easily removed. A high-level description of our recursive algorithm for \ModSSBPshort is shown in Figure \ref{fig:algomain}. For two set $A$ and $B$, $A \uplus B$ stands for the union of $A$ and $B$ with the assumption that $A \cap B = \varnothing$. We use $E^{(r)}$ to denote the set of restricted edges in $G$, and similarly we use $E^{(r)}_i$ to denote the set of restricted edges in $G_i$ for each \ModSSBPshort instance $(G_i, w_i, h_i)$. When the thresholds $\lambda_0, \dots, \lambda_{k+1}$ are presence, we define the \textit{index} of $x$ for every $x \in \mathbb{R}$ to be the unique index $i$ such that $\lambda_i \le x < \lambda_{i+1}$, and we denote it as $I(x)$. For $x = \pm \infty$, we define $I(-\infty) = 0, I(+\infty) = l$. Note that all the subgraphs $G_i$ at Line \ref{algo:line:red} are disjoint. We denote $r = \lvert E \rvert - \sum_{i=0}^{l} \lvert E_i \rvert$ to be the total number of edges in $E$ that do not appear in any recursive calls of $(G_i, w_i, h_i)$. For an edge $(u, v) \in E$, if $u$ and $v$ belong to different levels, then we say that $(u, v)$ is \textit{cross-level}. If $u$ and $v$ belong to the same level $V_i$ and $w(u, v) < \lambda_i$, then we say that $(u, v)$ is \textit{below-level}; conversely, if $w(u, v) \ge \lambda_{i+1}$ then we say that $(u, v)$ is \textit{above-level}. \begin{figure}[htbp] \begin{algorithmic}[1] \Require Directed graph $G=(V,E)$, weight function $w(\cdot)$, \initcapa function $h(\cdot)$; Parameter $k \ge 1$. \Ensure For each $v \in V$, output $d(v)$, the capacity of a bottleneck path ended with $v$. \If {$G$ is not weakly-connected} \label{algo:line:weak1} \State Compute $\{d(v)\}_{v \in V}$ in each weakly-connected component recursively. \label{algo:line:weak2} \EndIf \State Let $E^{(r)} = \{ e \in E \mid w(e) < +\infty\}$ be the set of restricted edges. \If {$\lvert E^{(r)} \rvert \le 1$} \State Compute $\{d(v)\}_{v \in V}$ in linear time and exit. \label{algo:line:restr1} \Comment{Section \ref{sec:restr1}} \EndIf \State Sample $l = \min\{k, \lvert E^{(r)} \rvert\}$ distinct edges from $E^{(r)}$ uniformly randomly. \State Sort the sampled edges by weights, and let $\lambda_1 < \cdots < \lambda_l$ be their weights. \label{algo:line:sort} \State Let $\lambda_0 = -\infty, \lambda_{l + 1} = +\infty$. \State Split $V$ into $l+1$ levels: $V_0 \uplus V_1 \uplus \cdots \uplus V_l$, where $V_i = \{v \in V \mid \lambda_i \le d(v) < \lambda_{i+1} \}$ \label{algo:line:spl}. \Comment{Section \ref{sec:spl}} \State For every level $V_i$, reduce the computation of $\{d(v)\}_{v \in V_i}$ to a new \ModSSBPshort instance $(G_i, w_i, h_i)$, where $G_i = (V_i, E_i)$ is a subgraph of $G$ consisting of all the nodes in $V_i$ and some of edges that connect them. Solve each $(G_i, w_i, h_i)$ instance recursively. \label{algo:line:red} \end{algorithmic} \caption{Main Algorithm} \label{fig:algomain} \end{figure} Besides the problem instance $(G, w, h)$ of \ModSSBPshort, our algorithm requires an additional integral parameter $k$. We set the parameter $k = 2^{\Theta\left(\sqrt{\log n}\right)}$ throughout our algorithm. The value of the parameter $k$ does not affect the correctness of our algorithm, but it controls the number of recursive calls at each recursion. At each recursion, our algorithm first checks if $G$ contains only one weakly-connected component. If not, then our algorithm calls itself to compute $d$ in each weakly-connected component recursively. Now we can assume that $G$ is weakly-connected (so $n \le m$). If the number of restricted edges is no more than $1$, we claim that we can compute $d(v)$ for all~$v$ in linear time. The specific algorithm will be introduced in Section \ref{sec:restr1}. \begin{lemma} \label{lam:restr1} \ModSSBPshort can be solved in $O(m)$ time if there is at most one restricted edge. \end{lemma} If the number of restricted edges is more than $1$, then our algorithm first sample $l = \min\{k, \lvert E^{(r)} \rvert\}$ distinct edges from $E^{(r)}$ uniformly randomly and sort them by weights, that is, if the number of restricted edges is more than $k$, then we sample $k$ distinct restricted edges and sort them; otherwise we just sort all the restricted edges. Let $\lambda_i$ be the weight of the edge with rank $i$ ($1 \le i \le l$) and $\lambda_0 = -\infty$, $\lambda_{l + 1} = +\infty$. Next, we split $V$ into $l + 1$ levels of nodes $V = V_0 \uplus V_1 \uplus \cdots V_l$, where the $i$-th level of nodes is $V_i = \{v \in V \mid I(d(v)) = i \} = \{v \in V \mid \lambda_i \le d(v) < \lambda_{i + 1}\}$. The basic idea of the split algorithm is: we run Dijkstra's algorithm for \ModSSBPshort on the graph produced by mapping every edge weight $w(e)$ and initial capacity $h(v)$ in $G$ to their indices $I(w(e))$ and $I(h(v))$, and we obtain the final label value $d'(v)$ for each node $v \in V$ (Remember that $d'(v)$ is the label of $v$ in Dijkstra's algorithm). It is easy to show that the final label value $d'(v)$ equals $I(d(v))$, so the nodes can be easily split into levels according to their final labels. The specific split algorithm will be introduced in Section \ref{sec:spl}. The time complexity for a single splitting is given below. In Theorem \ref{thm:overall-k} we show that this implies that the total time cost for splitting is $O(m \log n / \log k + m \log k)$. \begin{lemma} \label{lam:spl} Splitting $V$ into levels at Line \ref{algo:line:spl} can be done in $O(m + r \log k)$ (Recall that $r$ is the number of edges that do not appear in any subsequent recursive calls). \end{lemma} Finally, for every level $V_i$, we compute $d(\cdot)$ for nodes in this level by reducing to a new \ModSSBPshort instance $(G_i, w_i, h_i)$, where $G_i$ is a subgraph of $G$ consisting of all the nodes in $V_i$ and some of edges that connect them. We solve each new instance by a recursive call. The construction of $(G_i, w_i, h_i)$ is as follows: \begin{itemize} \item $G_i = (V_i, E_i)$, where $V_i$ is the nodes at level $i$ in $G$, and $E_i$ is the set of edges which connect two nodes at level $i$ and are not below-level, i.e., $E_i = \{ (u, v) \in E \mid u, v \in V_i, w(u, v) \ge \lambda_i \}$; \item For any $e \in E_i$, $w_i(e) = +\infty$ if $e$ is above-level; otherwise $w_i(e) = w(e)$; \item For any $v \in V_i$, $h_i(v) = \max\left( \{h(v)\} \cup \left\{ w(u, v) \in E \mid u \in V_{i+1} \uplus \cdots \uplus V_l \right\} \right)$. \end{itemize} \begin{lemma} \label{lam:red} We can construct all the new \ModSSBPshort instances $(G_0, w_0, h_0), \dots, (G_l, w_l, h_l)$ in $O(m)$ time. For $v \in V_i$, the value of $d(v)$ in the instance $(G_i, w_i, h_i)$ exactly equals to the value of $d(v)$ in the instance $(G, w, h)$. \end{lemma} \begin{proof} We can construct all these instances $(G_i, w_i, h_i)$ for all $0 \le i \le l$ by linearly scanning all the nodes and edges, which runs in $O(m)$ time. We prove the correctness by transforming $(G, w, h)$ to $(G_i, w_i, h_i)$ step by step, while preserving the values of $d(v)$ for all $v \in V_i$. By definition, $\lambda_i \le d(v) < \lambda_{i+1}$ for all $v \in V_i$. We can delete all the nodes at level less than $i$ and delete all the edges with weight less than $\lambda_i$, since no bottleneck path ended with a node in $V_i$ can traverse them. Also, for every edge $e$ with weight $w(e) \ge \lambda_{i+1}$, we can replace the edge weight with $+\infty$ since $w(e)$ is certainly not the minimum in any path ended with a node in $V_i$. For every edge $e = (u, v)$ where $u \in V_{i+1} \uplus \cdots \uplus V_l$ and $v \in V_i$, the edge weight $w(e)$ must be less than $\lambda_{i+1}$, otherwise $d(v) \ge \min\{d(u), w(u, v)\} \ge \lambda_{i+1}$ leads to a contradiction. Thus contracting all the nodes in $V_{i+1} \uplus \cdots \uplus V_l$ to a single node $v_0$ with infinite initial capacity is a transformation preserving the values of $d(v)$ for all $v \in V_i$. Finally, our construction follows by taking $h_i(v)$ to be the maximum between the weight of incoming edges from $v_0$ and the initial capacity $h(v)$ for every $v \in V_i$. \end{proof} \begin{remark} In any subsequent recursive calls of $(G_i, w_i, h_i)$, neither cross-level nor below-level edges will appear, and all the above-level edges will become unrestricted. Also, it is easy to see that $r$ is just the total number of cross-level and below-level edges (Recall that $r$ is the number of edges that do not appear in any subsequent recursive calls). \end{remark} \subsection{Running Time} First we analyze the maximum recursion depth. The following lemma shows that randomly sampled thresholds evenly partition the restricted edges with high probability. \begin{lemma} \label{lam:samplee} Let $E^{(r)} = \left\{e_1, \dots, e_q\right\}$ be $q$ restricted edges sorted by their weights in $E$. Let $f_1, \dots, f_k$ be $k \ge 2$ random edges sampled from $E^{(r)}$ such that $w(f_1) < w(f_2) < \cdots < w(f_k)$. Let $\lambda_i = w(f_i)$ for $i = 1, \dots, k$, and $\lambda_0 = -\infty$, $\lambda_{k + 1} = +\infty$. Let $F_i = \{ e \in E \mid \lambda_i \le w(e) < \lambda_{i+1} \}$. Then for every $t > 0$, $\max_{0 \le i \le k} \{\lvert F_i \rvert\} < t q \log k / k$ holds with probability $1 - k^{-\Omega(t)}$. \end{lemma} \begin{proof} Let $M = tq\log k / k$. If $\max_{0 \le i \le k} \{\lvert F_i \rvert\} \ge M$, then there exists an edge $e_p$ such that $e_p$ is chosen but for any $p + 1 \le j < p + M$, $e_j$ is not chosen. Note that when $p$ is given, this event happens with probability $\le k \cdot (1/q) \cdot \prod_{i=1}^{k-1} ((q-M-i)/(q-i)) \le (k/q) \cdot (1 - M/q)^{k-1}$. By the union bound for all possible $p$, we have \begin{equation*} \Pr\left[\max_{0 \le i \le k} \{\lvert F_i \rvert\} \ge t q \log k/k\right] \le k (1 - t \log k / k)^{k-1} \le k^{-\Omega(t)}, \end{equation*} which completes the proof. \end{proof} For our purposes it is enough to analyze the case that $k = 2^{\Omega\left(\sqrt{\log n}\right)}$. The following lemma gives a bound for the maximum recursion depth using Lemma \ref{lam:samplee}. \begin{lemma} For $k = 2^{\Omega\left(\sqrt{\log n}\right)}$ where $n$ is the number of nodes at the top level of recursion, the maximum recursion depth is $O(\log n / \log k)$ with probability $1 - n^{-\omega(1)}$. \end{lemma} \begin{proof} It is not hard to see that the total number of recursive calls of our main algorithm is $O(m)$. Applying Lemma \ref{lam:samplee} with $t = \Theta(\log n)$ and the union bound for all recursive calls, we know that with probability at least $1 - k^{-\Omega(t)} \cdot O(m) = 1 - n^{-\Omega(\log n)^{3/2}}$, after every split with $\lvert E^{(r)} \rvert > k$, the number of restricted edges in $G_i$ is less than $(t \log k / k) \cdot \lvert E^{(r)} \rvert$ for every $(G_i, w_i, h_i)$. Thus after $O(\log m / \log (k/(t \log k))) = O(\log n / \log k)$ levels of recursion, every \ModSSBPshort instance $(G, w, h)$ has $\lvert E^{(r)}\rvert \le k$, and this means that in any recursive call of $(G_i, w_i, h_i)$, the graph $G_i$ has at most one restricted edge, which will be directly solved at Line~\ref{algo:line:restr1}. \end{proof} The overall time complexity of our algorithm is given by the following theorem: \begin{theorem} \label{thm:overall-k} For $k = 2^{\Omega\left(\sqrt{\log n}\right)}$, with probability $1 - n^{-\omega(1)}$, our main algorithm shown in Figure \ref{fig:algomain} runs in $O(m \log n / \log k + m \log k)$ time. \end{theorem} \begin{proof} Let $r = \lvert E \rvert - \sum_{i=0}^{l} \lvert E_i \rvert$, $r' = \lvert E^{(r)} \rvert - \sum_{i=0}^{l} \lvert E_i^{(r)} \rvert$. First we show that the running time in each recursive call is $O(m + (r + r') \log k)$. In each recursive call of our algorithm, the time cost for sorting at Line \ref{algo:line:sort} is $O(l \log l)$. For the sample edge $e_i$ with rank $i$, either $V_i$ is not empty, or this edge is cross-level, below-level, or above-level. Let $l_1$ be the number of edges in the former case, and $l_2$ be the number of edges in the latter case. For the former case, note that we only run the split algorithm for weakly-connected graphs, so there are at least $l_1 - 1$ cross-level edges, which implies $l_1 \le r + 1$. For the latter case, $e_i$ becomes unrestricted or does not appear for every $G_i$, so $l_2 \le r'$. Thus $l = l_1 + l_2 \le r + r' + 1$ and the time cost for sorting is $O((r + r') \log k)$. By Lemma \ref{lam:spl}, the split algorithm runs in $O(m + r \log k)$ time in each recursive call. All other parts of our algorithm run in linear time. Thus the running time for each recursion is $O(m + (r + r') \log k)$. Note that the recursion depth is $O(\log n / \log k)$ with probability $1 - n^{\omega(1)}$. We can complete the proof by adding the time cost for all the $O(m)$ recursive calls together. \end{proof} Finally, we can get our main result by setting $k = 2^{\Theta\left(\sqrt{\log n}\right)}$. \begin{theorem} SSBP can be solved in $O(m \sqrt{\log n})$ time with high probability. \end{theorem} \begin{remark} The above time bound is also true for expected running time. It can be easily derived from the fact that the worst-case running time is at most $n^{O(1)}$. \end{remark} In the rest of this section, we introduce the algorithm for \ModSSBPshort with at most one restricted edge and the split algorithm. \subsection{Algorithm for the Graph with at most One Restricted Edge} \label{sec:restr1} We introduce our algorithm for the graph with at most one restricted edge in the following two lemmas. \begin{lemma} \label{thm:zero-res} For a given \ModSSBPshort instance $(G, w, h)$, if there is no restricted edge in $G$, then the values of $d(v)$ for all $v \in V$ can be computed in linear time. \end{lemma} \begin{proof} $G$ contains only unrestricted edges, so for every $v \in V$, $d(v)$ is just equal to the maximum value of $h(u)$ among all the nodes $u$ that can reach $v$. If $v_1$ and $v_2$ are in the same strongly-connected component, then $d(v_1) = d(v_2)$. Thus we can use Tarjan's algorithm~\cite{tarjan1972depth} to contract every strongly-connected component to a node. The initial capacity of a node is the maximum $h(u)$ for all $u$ in the component, and the capacity of an edge between nodes is the maximum among edges connecting components. Then Dijkstra approach on DAG takes linear time. \end{proof} \begin{lemma} For a given \ModSSBPshort instance $(G, w, h)$, if there is exactly one restricted edge in $G$, then the values of $d(v)$ for all $v \in V$ can be computed in linear time. \end{lemma} \begin{proof} Let $e_0 = (u_0, v_0)$ be the only restricted edge in $G$. There are two kinds of paths in $G$: \begin{enumerate} \item Paths that do not traverse $e$. We remove $e$ from $G$ and use the algorithm in Lemma \ref{thm:zero-res} to get $d(v)$ for every node $v \in V$. \item Paths that traverse $e$. Note that $d(u_0)$ got in the previous step is the maximum capacity to $u_0$ through only unrestricted edges. Then we update $d(v)$ by $\max\{d(v), \min\{d(u_0), w(u_0, v_0)\}\}$ for every node $v$ that can be reached from $v_0$. \end{enumerate} We output the values of $d(\cdot)$ after these two kinds of updates, then all the paths should have been taken into account. \end{proof} \subsection{Split} \label{sec:spl} Now we introduce the split algorithm at Line \ref{algo:line:spl} in our main algorithm. As before, we use the notation $I(x)$ for the index of a value $x$ and $d'(v)$ is the label of $v$ in Dijkstra's algorithm. The goal of this procedure is to split $V$ into $l + 1$ levels, $V = V_0 \uplus V_1 \uplus \cdots \uplus V_l$, where $V_i = \{v \in V \mid I(d(v)) = i\}$. We need to show that this can be done in $O(m + r \log k)$ time, where $r = \lvert E \rvert - \sum_{i=0}^{l} \lvert E_i \rvert$ is the total number of edges in $E$ that do not appear in any $(G_i, w_i, h_i)$. A straightforward approach to achieve this goal is to use Dijkstra's algorithm as described in Section \ref{sec:dijk}. We map all the edge weights and \initcapam to their indices using binary searches, and run Dijkstra's algorithm for \ModSSBPshort. The output should be exactly $d'(v) = I(d(v))$ for every $v$. However, this approach is rather inefficient. Evaluating the index $I(x)$ for a given $x$ requires $\Omega(\log l)$ time in a comparison-based model, thus in total, this algorithm needs $\Omega(n \log l)$ time to compute indices, and this does not meet our requirement for the running time. The major bottleneck of the above algorithm is the inefficient index evaluations. Our algorithm overcomes this bottleneck by reducing the number of index evaluations for both edge weights and \initcapam to be at most $O(r + n / \log l)$. \subsubsection{Index Evaluation for Edge Weights} \label{sec:indedge} First we introduce our idea to reduce the number of index evaluations for edge weights. Recall that in Dijkstra's algorithm for \ModSSBPshort we maintain a label $d'(v)$ for every $v \in V$. In every Dijkstra step, we extract an \statuslabeled node $u$ with the maximum label, and for all edges $(u, v) \in E$ we compute $\min\{d'(u), I(w(u, v))\}$ to update $d'(v)$. In the straightforward approach we evaluate every $I(w(u, v))$ using binary search, but actually this is a big waste: \begin{enumerate} \item If $w(u, v) \ge \lambda_{d'(u)}$, then $\min\{d'(u), I(w(u, v))\} = d'(u)$, so there is no need to evaluate $I(w(u, v))$. \item If $w(u, v) < \lambda_{d'(u)}$, then $\min\{d'(u), I(w(u, v))\} = I(w(u, v))$, so we do need to evaluate $I(w(u, v))$. However, it can be shown that $(u, v)$ is either a cross-level edge or a below-level edge, so $(u, v)$ will not appear in any subsequent recursive calls of $(G_i, w_i, h_i)$. \end{enumerate} Using the method discussed above, we can reduce the number of index evaluations for edge weights to be at most $r = \lvert E \rvert - \sum_{i=0}^{l} \lvert E_i \rvert$ in Dijkstra's algorithm. Lemma \ref{lam:qe} gives a formal proof for this. \subsubsection{Index Evaluation for \initcapamBig} Now we introduce our idea to reduce the number of index evaluations for \initcapam. Recall that in Dijkstra's algorithm, we need to initialize the label $d'(v)$ to be $I(h(v))$ for each $v \in V$, and maintain a priority queue for the labels of all \statuslabeled nodes. If we evaluate every $I(h(v))$ directly, we have to pay a time cost of $\Omega(n \log l)$. In our split algorithm, we first find a spanning tree $T$ of $G$ after replacing all the edges with undirected edges. Then we partition the tree $T$ into $b = O(n/s)$ edge-disjoint (but not necessarily node-disjoint) subtrees, $T_1, \dots, T_b$, each of size $O(s)$. Theorem~\ref{thm:partition} shows that this partition can be found in $O(n)$ time, and the proof is given in Appendix~\ref{app:partition}. \begin{theorem} \label{thm:partition} Given a tree $T = (V, E)$ with $n$ nodes and given an integer $1 \le s \le n$, there exists a linear time algorithm that can partition $T$ into edge-disjoint subtrees, $T_1, \dots, T_b$, such that the number of nodes in each subtree is in the range $[s, 3s)$. \end{theorem} We form $b$ groups of nodes, $U_1, \dots, U_b$, where $U_i$ is the group of nodes that are in the $i$-th subtree $T_i$. In the running of Dijkstra's algorithm, we divide the \statuslabeled nodes in $V$ into two kinds: \begin{enumerate} \item \textbf{Updated node}. This is the kind of node $v$ that has $d'(v)$ already been updated by Dijkstra's update rule \eqref{eq:dijkupd}, which means $d'(v) = \min\{d'(u), I(w(u, v))\} \geq I(h(v))$ for some $u$ after a previous update. The value of $\min\{d'(u), I(w(u, v))\}$ is evaluated according to Section \ref{sec:indedge}, so the value of $d'(v)$ can be easily known. We can store such nodes in buckets to maintain the order of their labels. \item \textbf{Initializing node}. This is the kind of node $v$ whose $d'(v)$ has not been updated by Dijkstra's update rule \eqref{eq:dijkupd}, so $d'(v) = I(h(v))$. However, we do not store the value of $I(h(v))$ explicitly. For each group $U_i$, we maintain the set of initializing nodes in $U_i$. We only compute the value of $I(h(v))$ when $v$ is the maximum in its group, and use buckets to maintain the maximum values from all groups. If each group has size $s=O(\log k)$, the maximum can be found in $O(\log k)$ time by brute-force search. \end{enumerate} At each iteration in Dijkstra's algorithm, we extract the active node with the maximum label among the updated nodes and initializing nodes and mark it as scanned. For the case that the maximum node $v \in U_j$ is an initializing node, we remove $v$ from $U_j$, and compute $d'(u) = I(h(u))$ for the new maximum node $u$. However, if we compute this value directly using an index evaluation for $h(u)$, then we will suffer a total cost $\Omega(n \log l)$, which is rather inefficient. The idea to speed up is to check whether $d'(u) = d'(v)$ before performing an index evaluation. This can be done in $O(1)$ time since we can know the corresponding interval of $h(u)$ from the value of $d'(v)$ if $I(h(u)) = d'(v)$. We only actually evaluate $I(h(u))$ if $d'(u) \neq d'(v)$ after the Dijkstra step scans all nodes with level $d'(v)$. In this way, we can always ensure that the number of index evaluations in a group never exceeds the number of different final label values $d'(\cdot)$ in this group. Indeed, it can be shown that if there are $c$ different final label values $d'(\cdot)$ in a group $U_i$, then there must be at least $c - 1$ cross-level edges in $T_i$, which implies that the number of index evaluations for \initcapam should be no greater than $r + b$. (Remember $b$ is the number of groups in the partition.) Lemma \ref{lam:diffdp} gives a formal proof for this. \subsubsection{The $O(m + r \log k )$-time Split Algorithm} \begin{figure}[htb] \begin{algorithmic}[1] \Require Directed graph $G=(V,E)$, weight function $w(\cdot)$, \initcapa function $h(\cdot)$ , $l + 2$ thresholds $-\infty = \lambda_0 < \lambda_1 < \cdots < \lambda_{l} < \lambda_{l + 1} = +\infty$ \Ensure Split $V$ into $V_0 \uplus V_1 \uplus \cdots \uplus V_l$ where $V_i = \{v \in V \mid \lambda_i \le d(v) < \lambda_{i+1} \}$. \State Let $s = \min\{\lceil \log l \rceil, n\}$. Find a spanning tree $T$ of $G$ after replacing all the edges with undirected edges and partition $T$ into $b = O(n / s)$ edge-disjoint subtrees $T_1, \dots, T_b$, each of size $O(s)$. \State Form $b$ groups of nodes, $U_1, \dots, U_b$, where $U_i$ is the group of nodes that are in the $i$-th subtree~$T_i$. \State For each group $U_i$, find the maximum node $v$ and evaluate $I(h(v))$. Initialize $l + 1$ buckets $B_0, \dots, B_l$ which store the groups according to the index of $h(\cdot)$ of their maximum nodes. \State Initialize $l+1$ buckets $C_0, \dots, C_l \gets \varnothing$ which store the \statuslabeled nodes according to $d'(\cdot)$. \For{$i \gets l, l-1, \dots, 1, 0$} \ForAll{$U\in B_i$} \ForAll{$u \in U$ with $h(u) \ge \lambda_i$} \State Delete $u$ from $U$ and put $u$ into $C_i$ \State $d'(u)\gets i$ \EndFor \EndFor \While{$C_i \neq \varnothing$} \State Extract a node $u$ from $C_i$ \ForAll{$(u, v) \in E$} \State $\bar{w} \gets \min\{d'(u), I(w(u, v))\}$. (Evaluate $I(w(u, v))$ only if $w(u, v) < \lambda_{d'(u)}$) \If{$\lambda_{\bar{w}} > h(v)$} \If{$d'(v)$ does not exist \textbf{or} $\bar{w}>d'(v)$} \State Delete $v$ from $C_{d'(v)}$ \State Delete $v$ from the group $U$ containing it (if any) and put $v$ into $C_{\bar{w}}$ \State $d'(v)\gets \bar{w}$ \EndIf \EndIf \EndFor \EndWhile \While{$B_i$ contains at least one non-empty group} \State Extract an non-empty group $U$ from $B_i$ \State Find the maximum node $u$ in $U$, evaluate $I(h(u))$, and put $U$ into $B_{I(h(u))}$ \EndWhile \EndFor \State Split $V$ according to $d'$ and return \end{algorithmic} \caption{Split Algorithm} \label{fig:algosplit} \end{figure} Now we are ready to introduce our split algorithm in full details. A pseudocode is shown in Figure~\ref{fig:algosplit}. During the search at Line 5 - 21, $B_i$ may contain groups with maximum nodes not at the $i$-th level, e.g., when the maximum node in a group $U$ is deleted at Line 17 and $I(h(u))$ of the new maximum node $u$ in $U$ has not been evaluated yet. We have the following observations: \begin{itemize} \item For all $v \in V$, $d'(v)$ is non-decreasing, and at the end we have $d'(v) = I(d(v))$. \item Only at Line 3, 13 and 21 we need to evaluate the index of $h(\cdot)$ of a node or the index of an edge. Each index evaluation costs $O(\log l)$ time. \item The numbers of executions of the while loops at Line 10 - 18, Line 19 - 21 are bounded by $O(n)$. \item The number of times entering the for loop at Line 7 - 9 can be bounded by the number of index evaluations at Line 3 and 21. Each loop costs $O(\log l)$ time. \end{itemize} Our algorithm is an implementation of Dijkstra's algorithm, so the correctness is obvious. The running time analysis is based on the following lemmas: \begin{lemma} \label{lam:qe} If we evaluate $I(w(u,v))$ at Line 13, then the edge $(u,v)$ will not be in any recursive calls of $(G_i, w_i, h_i)$. \end{lemma} \begin{proof} We evaluate $I(w(u,v))$ only if $w(u, v) < \lambda_{d'(u)}$, so $\bar{w} = I(w(u, v))$ right after Line 13. Since $u$ has already been scanned, $d'(u)$ here is just its final value $I(d(u))$. Note that $I(d(v)) \ge \min\{I(d(u)), I(w(u, v))\} = I(w(u, v))$. If finally $I(d(v)) > I(w(u,v))$, then $I(w(u,v))$ is smaller than both $I(d(u))$ and $I(d(v))$, thus $(u,v)$ is a below-level edge or cross-level edge. If $I(d(v))=I(w(u,v))$, then $I(d(v)) < I(d(u))$ and $(u, v)$ is a cross-level edge. \end{proof} \begin{lemma} \label{lam:diffdp} At Line 3 and 21, if we evaluate $I(h(u))$ for $c$ nodes $u$ in some group $U_i$, then the number of different final label values $d'(\cdot)$ in $U_i$ is at least $c$. Thus, the number of edges in the subtree $T_i$ corresponding to $U_i$ that do not appear in any recursive calls of $(G_i, w_i, h_i)$ is at least $c - 1$. \end{lemma} \begin{proof} At line 21, $I(d(u))$ must be less than $i$; otherwise, $u$ should have been extracted at Line 11 before extracting $u$ at Line 20, which is impossible. Also note that $d(u) \ge h(u)$, so $I(h(u))\leq I(d(u))$ for all $u \in V$. Thus, if $u_1 \in U_i$ is evaluated at Line 3 and there are $c - 1$ nodes $u_2, \dots, u_c$ extracted from $U_i$ at Line 21, then $I(d(u_1)), I(d(u_2)), \dots, I(d(u_c))$ should be in $c$ distinct ranges: $[I(h(u_1)), +\infty), [I(h(u_2)), I(h(u_1))), \dots, [I(h(u_c)), I(h(u_{c-1})))$, which implies that the number of different final values of $d'(u)$ in $U_i$ is at least $c$. Suppose we remove all the cross-level edges in $T_i$, i.e., remove all the edges $(u, v)$ in $T_i$ whose final values of $d'(u)$ and $d'(v)$ differ. Then the tree should be decomposed into at least $c$ components since there are at least $c$ different final values of $d'(u)$ in $U_i$. Thus there are at least $c - 1$ cross-level edges in $T_i$. \end{proof} Finally, we can derive the $O(m + r \log k)$ time bound for our split algorithm. \begin{proof}[Proof for Lemma \ref{lam:spl}] By Lemma \ref{lam:qe}, the number of index evaluations at Line 13 is at most $r$. Let $c_i$ be the number of index evaluations at Line 3 and 21 for nodes in the group $U_i$. Then by Lemma \ref{lam:diffdp}, $\sum_{i = 1}^{b} c_i \le r + b$. Thus the total number of index evaluations in our split algorithm can be bounded by $2r + b \le O(r + n / \log l)$, which costs $O(r \log l + n)$ time. At Line 3, Line 7-9, Line 21, we need to do a brute-force search in a given group, and each search costs $O(s) \le O(\log l)$ time. Note that the number of the brute-force searches can be bounded by twice the number of index evaluations at Line 3 and 21, so the total time cost for brute-force search is $O(r \log l + n)$. It can be easily seen that all other parts of our split algorithm runs in linear time, so the overall time complexity is $O(m + r \log l) \le O(m + r \log k)$. \end{proof} \section{Discussion} We give an improved algorithm for solving SSBP in $O(m\sqrt{\log n})$ time which is faster than sorting for sparse graphs. This algorithm is a breakthrough compared to traditional Dijkstra's algorithm using Fibonacci heap. There are some open questions remained to be solved. Can our algorithm for SSBP be further improved to $O(m \beta(m, n))$, which is the time complexity for the currently best algorithm for $s$-$t$ BP? Can we use our idea to obtain an algorithm for SSBP that runs faster than Dijkstra in word RAM model? \bibliographystyle{alpha}
\section{Introduction}\label{intro} The recent direct detection of gravitational waves (GWs) by using LIGO and VIRGO interferometer observatories, consistent with the merger of binary black hole (BH) systems~\cite{GW150914,GW151226,GW170104,GW170608,GW170814}, has opened a new era of gravitational wave (GW) astronomy leading to unprecedented discoveries. More recently, the GW corresponding to the coalescence of a binary composed by neutron stars (NSs) has also been observed~\cite{PhysRevLett.119.161101,2017ApJ...848L..12A}. This signal was followed by a plethora of electromagnetic (EM) counterparts, including a gamma-ray burst~\cite{GWGR} and a thermal infrared/optical spectra consistent with a kilonova~\cite{Kila}, starting a fruitful era of multi-messenger astronomy. These EM and GW observations, which will be soon routinely detected, are inevitably leading to breakthroughs in our understanding of some of the most exciting objects and phenomena in the Universe, as well as providing clues to fundamental physics, such as the properties of matter at nuclear densities and stringent tests of general relativity (GR) (see for instance~\cite{Yunes:2016jcc,2016ApJ...818L..22A}). Nowadays, the only known astrophysical compact objects able to source strong gravitational waves are BHs and NSs~\cite{roadmap}. Nevertheless, there might be other non-standard low-brightness stars, known generically as exotic compact objects (ECOs) (see~\cite{Cardoso:2017cqb} for a review), too dim to be observed by current EM telescopes. However, if they are massive and compact enough, it might be possible to detect them trough the GWs radiated during their coalescence. Among the zoo of ECOs, one of the most plausible are boson stars (BSs). BSs are solutions of Einstein equations coupled to a complex scalar field that represent a self-gravitating Bose-Einstein condensate. This family of solutions yields to useful models of dark matter, BH mimickers and simple generic compact objects (see~\cite{schumie,liebpa} for a review). Interestingly, some families of BSs can reach a compactness $C\equiv M/R$ comparable to NSs. There are two theoretical arguments that supports the possibility of self-gravitating objects made by bosonic particles in the Universe. First, the discovery of Higgs boson~\cite{Chatrchyan:2012xdj,Aad:2012tfa} confirmed the existence of scalar fields in nature. Second, the existence of a formation mechanism, dubbed as gravitational cooling~\cite{seidel}, to produce BSs from a generic scalar field configuration. Formation of BS has been considered also in the Newtonian limit~\cite{guzman} and much more recently for vector fields~\cite{giov}. The merger of binary BSs has already been studied in several works: head-on and orbital collisions of mini-BSs~\cite{pale1,pale2}, head-on collision of oscillatons (a solution of BS with real scalar field)~\cite{brito,helfer}, head-on collision of Proca stars (a solution modeled by a massive complex vector field)~\cite{sanchis} and orbital collision of solitonic BSs~\cite{bezpalen,palenpani}. All these studies have in common that both stars are represented by the same complex scalar field, a feature typical for classical fluid stars. However, it might not be the most realistic model to describe unconnected Bose-Einstein condensates, where the complex scalar field could represent distinct quantized wave functions. Therefore, here we are interested in a different scenario where each star is described instead by an independent complex scalar field. This model generically represents Dark Stars (DS), which can be defined as any self-gravitating astrophysical compact objects which only interact through gravity with other stars. Notice that these regular objects behave as black holes, in the sense that they also interact only gravitationally, but present a wider range of possible compactness~\cite{Cardoso:2017njb}. Although DSs are modeled here with BSs, almost any kind of matter, i.e., either fermionic or bosonic, can be used to construct these objects, as far as the stars are represented with different matter species~\cite{Maselli2017}. It is important to stress that any binary formed by stars made with different non-interacting species would behave as Dark Stars --objects that only interact gravitationally--, like for instance the collisions of neutron and axion stars studied recently~\cite{2018arXiv180804668C}. Only the tidal properties of DSs might depend strongly on its composition. In the present work, we aim to study the dynamics and the gravitational radiation produced during the coalescence of two DSs made by bosonic fields. These binary Dark Boson Stars (DBSs) consist on two BSs described by two different complex scalar fields, one for each star, satisfying the Einstein-Klein-Gordon (EKG) equations. Since the scalar fields of each star are different and there are no potential coupling them, there are only gravitational interactions between both DBSs. Our simulations reveal not only the GW signature produced during the merger of DBS binaries as a function of the star's compactness, but also that the final remnant is always either a non-rotating superposition of independent BS (i.e., a multi-state BS~\cite{bernal}) or a spinning BH. Our results allow to extend our knowledge of BH waveforms to a wider range of compactnesses. They will also allow us to compare with standard binary BS~\cite{bezpalen,palenpani}, where there exists interaction between the stars both through gravity and matter. For our comparison purposes, we employ the potential and the same configurations used in previous works~\cite{bezpalen,palenpani} for non-topological solitonic BS~\cite{frie,1992PhR...221..251L}, to construct our DBSs. This work is organized as follows. In Sec.~\ref{model} the model for DBSs binaries is introduced, describing equations of motion, numerical implementation, analysis quantities and the construction of initial data for both isolated and binary DBSs. In Sec.~\ref{coales} we study numerically the coalescence of binary DBSs for different compactness, focusing on the dynamics and the gravitational radiation. Particular attention is paid to the comparison between DBSs and BSs binaries. In Sec.~\ref{conclu}, we summarize our results and present our conclusions. We have chosen geometric units such that $G=c=1$ and we adopt the convention where roman indices $a,b,c,\dots$ denote spacetime components (i.e., from $0$ to $3$), while $i,j,k,\ldots$ denote spatial ones (i.e., from $1$ to $3$). \section{Model for Dark Boson Stars binaries }\label{model} Our approach to model Dark Star binaries considers two independent complex scalar fields, interacting only through gravity, which are governed by Einstein-Klein-Gordon theory. Furthermore, a short description of the numerical implementation and analysis quantities is provided, together with a summary on the procedure to construct binary DBS initial data. \subsection{Equations of Motion} An arbitrary number of DBSs can be modeled by using a collection of $N$ complex scalar field (i.e., one for each star) interacting only through gravity. The dynamics of such a system can be described by the following action~\footnote{Notice that, although the context is different, this action is the same that describes multi-state BS~\cite{bernal}, where the super-index $(i)$ would denote each state of the scalar field.} \begin{eqnarray} S = \int d^{4}x\sqrt{-g}\left(\frac{R}{16\,\pi} - \sum_{i=1}^{N}\left[g^{ab}\nabla_{a}\bar{\Phi}^{(i)}\nabla_{b}\Phi^{(i)} \right. \right.\nonumber \\ \left. \left. -\,\, V^{(i)}(|\Phi^{(i)}|^{2})\right] \frac{}{} \right)~~, \label{actionMSBS} \end{eqnarray} where $R$ is the Ricci scalar associated to the metric $g_{ab}$ with determinant $g$. There are $N$ minimally coupled complex scalar fields $\Phi^{(i)}$, being $\bar{\Phi}^{(i)}$ their complex conjugate and $V^{(i)}(|\Phi^{(i)}|^2)$ the scalar field potential. We shall consider $N=2$ in order to study binary systems. The Einstein-Klein-Gordon evolution equations are obtained by taking the variation of the action~\eqref{actionMSBS} with respect to the metric $g_{ab}$ and each scalar field $\Phi^{(i)}$, namely \begin{eqnarray} R_{ab} - \frac{1}{2}g_{ab} R &=& 8\pi \, T_{ab} ~,\label{EKG1} \\ g^{ab} \nabla_a \nabla_b \Phi^{(i)} &=& \frac{dV^{(i)}}{d \left|\Phi^{(i)}\right|^2} \Phi^{(i)}~,\label{EKG2} \label{EKG3} \end{eqnarray} where $T_{ab}$ is the total scalar stress-energy tensor, given by the sum of the stress-energy tensors associated to each scalar field, \begin{eqnarray} T_{ab} &=& T^{(1)}_{ab} + T^{(2)}_{ab}~~, \\ T^{(i)}_{ab} &=& \nabla_a \Phi^{(i)} \nabla_b \bar{\Phi}^{(i)} + \nabla_a \bar{\Phi}^{(i)} \nabla_b \Phi^{(i)} \nonumber \\ &-& g_{ab} \left[ \nabla^c \Phi^{(i)} \nabla_c \bar{\Phi}^{(i)} + V^{(i)}\left(\left|\Phi^{(i)}\right|^2\right) \right]. \end{eqnarray} Henceforward, we will consider a self-potential for each scalar field given by \begin{equation} V^{(i)}(|\Phi^{(i)}|^2)=m_b^{2}\left|\Phi^{(i)}\right|^2\left(1 - \frac{2\left|\Phi^{(i)}\right|^{2}}{\sigma_{0}^{2}}\right)^2~, \end{equation} where $m_{b}$ is related to the scalar field mass and $\sigma_{0}$ is a constant setting the compactness of the star. This kind of potential yields to non-topological solitonic boson stars~\cite{frie,1992PhR...221..251L}, which might have a compactness comparable or even higher than neutron stars~\cite{palenpani}. Notice that, with this choice for the potential, each scalar field is explicitly decoupled from the others. Therefore, the scalar field corresponding to each star interacts only with itself through its Klein-Gordon equations~\eqref{EKG2}, and with all the others through gravity by means of the spacetime metric described by Einstein equations~\eqref{EKG1}. This class of astrophysical compact objects behaves as stars made of dark matter (whence the name of Dark Boson Stars), in the sense that they interact only gravitationally with other compact objects~\cite{Maselli2017}. \subsection{Numerical implementation} Einstein Equations can be written as a time evolution system by using the covariant conformal Z4 formulation (CCZ4)~\cite{alic,bezpalen}, which is the one considered here. The numerical discretization of these equations is performed by using the Method of Lines (MoL), which allows to separate time from spatial discretization. We use fourth-order accurate finite-difference operators for the spatial derivatives, together with a fourth order accurate Runge-Kutta time integrator. A sixth-order Kreiss-Oliguer dissipation is also included to eliminate unphysical high-frequency modes from our grid. The explicit form of the EKG evolution system and the discrete operators employed, together with numerical evolutions of binary BSs, can be found in Ref.~\cite{bezpalen,palenpani}. These equations have been introduced in the platform {\it Simflowny}~\cite{simflowny_webpage,Arbona:2013,simf2,simf3} to automatically generate parallel code for the SAMRAI infrastructure~\cite{Hornung:2002,Gunney:2016,samrai_webpage}. SAMRAI provides parallelization and Adaptive Mesh Refinement (AMR), which are crucial to obtain accurate solutions in an efficient manner by adding more resolution only where it is required (i.e., in the regions encompassing each BSs). We have also implemented, through {\it Simflowny}, an improved treatment of artificial AMR boundaries when there is sub-cycling in time~\cite{McCorquodale:2011,Mongwane:2015}. Further details of the numerical implementation and convergence tests performed with this new platform can be found in Ref.~\cite{simf3}. Our simulations use Courant factors $\lambda_{c}\in \{0.357,0.15\},$ such that $\Delta t_{l} = \lambda_c \, \Delta x_{l}$ on each refinement level $l$ to guarantee that the Courant-Friedrichs-Levy condition is satisfied. We use a domain $[-280,280]^3$ with 7 levels of refinement, each one with twice the resolution of the previous one, such that $\Delta x_{0}=4$ on the coarsest grid and $\Delta x_{6}=0.0625$ on the finest one. \subsection{Analysis quantities} Several quantities have been computed in order to analyze the dynamics of binary DBSs during their coalescence. One of them is the Noether charge, which is the analogous of the baryonic density in a fluid. For each scalar field, as a result of $U(1)$ invariance of the action~\eqref{actionMSBS}, there exists a Noether charge current defined by: \begin{equation} J^{(i)\,a} = i g^{ab} (\bar{\Phi}^{(i)}\,\nabla_{b}\Phi^{(i)} - \Phi^{(i)}\,\nabla_{b} \bar{\Phi}^{(i)}), \end{equation} which implies a conserved quantity given by \begin{equation} N^{(i)} = \int d^{3}x\sqrt{-g}\,J^{(i)\,0}. \label{noech} \end{equation} Notice that the conserved Noether charge $N^{(i)}$ can be interpreted as the number of bosonic particles in each star~\cite{liebpa}. Therefore, the total Noether charge of the system is given by the sum of the Noether charges of each star. The gravitational radiation can be described in terms of the Newman-Penrose scalar $\Psi_{4}$, which can be expanded in terms of spin-weighted $s=-2$ spherical harmonics~\cite{rezbish,brugman}, namely \begin{equation} r \Psi_4 (t,r,\theta,\phi) = \sum_{l,m} \Psi_4^{l,m} (t,r) \, {}^{-2}Y_{l,m} (\theta,\phi). \label{eq:psi4} \end{equation} The instantaneous angular frequency of the gravitational wave can now be calculated easily from : \begin{eqnarray} f_{GW} = \frac{\omega_{GW}}{2\pi}~,~~~ \omega_{GW} = -\frac{1}{2}\Im\left(\frac{\dot{\Psi}_4^{l,m}}{\Psi_4^{l,m}}\right). \end{eqnarray} A more direct quantity, related directly to the response of the detector, is the strain defined as $h(t)=h_{+}(t) - i\,h_{\times}(t),$ where $(h_{+},h_{\times})$ are the plus and cross modes of gravitational waves. The Newman-Penrose scalar $\Psi_{4}$ is related to the strain via: \begin{equation} \Psi_{4} = \ddot{h}_{+} - i\,\ddot{h}_{\times}, \end{equation} The components of the strain in the time domain can be calculated by performing the inverse Fourier transform of the strain in the frequency domain, $h^{l,m}(t) \equiv {\cal F}^{-1} [{\tilde h}^{l,m}(f)]$, which can be calculated as~\cite{2011CQGra..28s5015R} \begin{equation} {\tilde h^{l,m}(f)} = \begin{cases} \displaystyle - \frac{{\cal F} [{\Psi_4}^{l,m}(t)]}{f_{0}^2} ~, & f < f_{0}\\\\ \displaystyle - \frac{{\cal F} [{\Psi_4}^{l,m}(t)]}{f^2} ~, & f\geq f_{0} \end{cases}\, , \end{equation} where $f_{0}$ is the initial orbital frequency. During the evolution we compute also other global quantities integrated over a spherical surface, like the Arnowitt-Deser-Misner (ADM) mass and the angular momentum. These global quantities, together with $\Psi_4$, are calculated in spherical surfaces at different extraction radii, although we only show the results obtained at $R_{ext}=50$. \subsection{Initial data} {\bf Single Dark BS.} Initial data for isolated DBSs is exactly the same as for BSs. The method to construct these solutions can be summarized as follows: \begin{itemize} \item consider a spherically symmetric static spacetime in Schwarzschild-like coordinates $\tilde{r}$, together with a complex scalar field with an harmonic ansatz, namely: \begin{eqnarray}\label{idbs_metric} ds^{2} &=& -\alpha^{2}(\tilde{r})dt^{2}+a^{2}(\tilde{r})d\tilde{r}^{2}+\tilde{r}^{2}d\Omega^{2}, \\ \label{idbs_sf} \Phi(t,\tilde{r}) &=& \phi(\tilde{r})\,e^{-i\omega\,t}, \end{eqnarray} \item the EKG system~\eqref{EKG1}-\eqref{EKG3}, with the previous assumptions ~\eqref{idbs_metric}-\eqref{idbs_sf}, reduces to a set of ordinary differential equations (ODE). These ODEs can be integrated by imposing suitable boundary conditions (i.e., regularity at the origin and an asymptotic flatness at infinity). \item transform the solution from Schwarzschild-like coordinates into isotropic coordinates $r$, \begin{eqnarray} ds^{2} = -\alpha^{2}(r) + \psi^{4}(r)(dr^{2} + r^{2}d\Omega^{2}), \end{eqnarray} by performing a numerical integration. The transformation from these coordinates to Cartesian ones is trivial. Further details of this procedure can be found in Ref.~\cite{2004PhDT.......230L}. \end{itemize} The solution is a Boson Star, a regular self-gravitating compact object made of a complex scalar field. In contrast to NSs, BSs does not present a hard surface that woud allow to define unambiguously their size. Nevertheless, one can define the radius containing $99\%$ of the ADM mass (or the Noether charge), denoted as $R_{M}$ (or $R_{N}$). Notice that, in these spherically symmetric solutions, the ADM mass can be easily computed as: \begin{equation} M_{ADM} = \lim\limits_{r\to\infty}\frac{r}{2}\left(1 - \frac{1}{\alpha(r)^{2}}\right). \end{equation} This way, one can define the compactness of a BS as $C=M_{ADM}/R_{M}$. Notice that this quantity ranges between $C\approx 0.1-0.25$ for NSs and between $C=0.5-1$ for BHs (non-rotating and with extremal spin, respectively). In the present work, we consider the same configurations investigated in~\cite{palenpani}. Therefore, we restrict ourselves to the choice $\sigma_{0}=0.05$, which lead to highly compact BS, and construct four stars with compactness $C=\{0.06,0.12,0.18,0.22\}$ belonging to the stable branch (i.e., equilibrium configurations which are stable under small perturbations). The radial profile of the scalar field for each compactness is displayed in Fig.~\ref{profiles}. As it is shown in Fig.~\ref{compvsphi}, all these initial configurations are well inside the stable branch, which is the curve on the left of the maximum compactness $C_{max}=0.33$. Each star has been rescaled, by a suitable choice of $m_b$, such that $M_{ADM}=0.5$. In Table~\ref{isolateddbs} can be found all the characteristics of our isolated BSs models: central value of the scalar field $\phi_c$, bare mass of the boson $m_b$, Noether charge $N$, radius of the star $R_M$ and $R_N$, angular frequency of the phase of $\phi$ in the complex plane $\omega$ and dimensionless tidal Love number $k_{tidal}$~\cite{2017arXiv170101116C,Sennett:2017etc}. As a reference, notice that $k_{\rm tidal}\approx 200$ for a neutron star with a typical equation of state, while that $k_{\rm tidal}=0$ for BHs. \begin{table} \begin{ruledtabular} \begin{tabular}{c||cc|ccc|c} $C$ & $\phi_c/\sigma_0$ & $m_b$ & ${N}$ & $(R_M,R_N)$ & ${\omega}$ & $k_{\rm tidal}$ \\ \hline\hline 0.06 & 1.045 & 0.9880 & 0.9867 & (8.21,\,7.38) & 0.3828 & 8420\\ 0.12 & 1.030 & 2.9124 & 0.4785 & (4.22,\,3.88) & 0.7787 & 332 \\ 0.18 & 1.025 & 6.2514 & 0.2929 & (2.71,\,2.54) & 1.2386 & 41 \\ 0.22 & 1.025 & 8.5663 & 0.2417 & (2.31,\,2.19) & 1.4725 & 20 \end{tabular} \caption{{\em Characteristics of isolated BSs models with $\sigma_0=0.05$.} The table shows, in units such that $M_{ADM}=0.5$, the following quantities: compactness, central value of the scalar field, bare mass, Noether charge, radius of the star (i.e, containing $99\%$ of either the mass, $R_M$, or the Noether charge, $R_N$), angular frequency of the phase of $\phi$ in the complex plane and dimensionless tidal Love number ($k_{\rm tidal}$). }\label{isolateddbs} \end{ruledtabular} \end{table} \begin{figure} \centering \includegraphics[width=0.485\textwidth]{phi.pdf} \caption{{\em Initial data of DBS}. Radial profile of the scalar field $\phi(r)$ for each compactness. Notice that it is nearly constant in the interior and then falls off exponentially at the surface of the star. This fall off is steeper as the compactness increases.} \label{profiles} \end{figure} \begin{figure} \centering \includegraphics[width=0.48\textwidth]{phi_C.pdf} \caption{ {\em Initial data of DBS}. Compactness as a function of the central value of the scalar field $\phi_{c}$ with $\sigma_0=0.05$. Circular markers refer to the \emph{initial} equilibrium configurations considered both here and in previous work~\cite{palenpani} to construct initial data for binaries.} \label{compvsphi} \end{figure} {\bf Binary Dark BS.} Initial data for binary BS can be constructed by using a superposition of two boosted isolated BS solutions. Since we are interested on modeling DBS binary systems, which only interact through gravity, we proceed as follows: \begin{itemize} \item the solution of each BS, calculated as described in the previous subsection, is extended to Cartesian coordinates $\{g^{(i)}_{ab}(x,y,z),\Phi^{(i)}(t,x,y,z)\}$. \item the spacetime of binary DBS is obtained by a superposition of the isolated spacetimes of two BSs, centered at positions $(0,\pm y_{c},0)$ and with a boost $\pm v_x$ along the $x$-direction. The scalar field of each boosted star is not modified by the other star. The full solution can be expressed then as: \begin{eqnarray} g_{ab} &=& g^{(1)}_{ab}(x,y-y_{c},z;+v_{x})\nonumber \\ & & +\,\, g^{(2)}_{ab}(x,y+y_{c},z;-v_{x}) - \eta_{ab},\\ \Phi^{(1)} &=& \Phi^{(1)}(x,y-y_{c},z;+v_{x}),\\ \Phi^{(2)} &=& \Phi^{(2)}(x,y+y_{c},z;-v_{x}), \end{eqnarray} where $\eta_{ab}$ is the Minkowski metric in Cartesian coordinates. \end{itemize} Notice that a fine-tuning of the initial orbital velocity is required to set the binary in a quasi-circular orbit. It is also worthwhile to emphasize that this superposition does not satisfy the energy and momentum constraints due to the non-linear character of Einstein's equations. However, our evolution formalism enforces dynamically an exponential decay of these constraint violations (for instance, see Fig.\,10 in Ref.~\cite{bezpalen}). Nonetheless, convergence tests performed on the most stringent case indicates that our initial data is accurate enough to allow us investigate the problem at hand. \section{Coalescence of Dark Boson Stars }\label{coales} The coalescence of binary identical DBSs obtained from numerical simulations is analyzed in detailed, focusing on the dynamics and the gravitational radiation produced with different star's compactness. Furthermore, in order to infer the effect of matter interactions, these results for dark BS binaries (i.e., only gravity interactions) are contrasted with those for standard BS binaries (i.e., both gravity and matter interactions). Since the individual mass of each star in isolation is $M=0.5$, the binary has approximately a total initial mass $M_0\approx 1$. \subsection{Dynamics} First of all, let us mention that the initial boost velocities, required to set the binary system roughly in a quasi-circular orbit, are different for each case due to several reasons. The largest difference appears for the case with $C=0.06$ because the radius of the stars (i.e., and, consequently, their initial separation) is significantly larger than in the other cases, implying a lower boost velocity. Since the separation in all the other binary configurations is the same, discrepancies on the boost velocities arise from slight differences on the star's compactness and total mass of the system. More detailed information regarding the initial parameters is available in Table~\ref{table2}, together with the main properties of each binary DBS and its final remnant. \begin{figure*} \centering \includegraphics[width=17cm, height=15cm]{coalesdark3} \caption{{\em Dynamics of DBS coalescence}. Noether charge densities, corresponding to the individual stars, in the equatorial plane at several illustrative times. Each row corresponds to a different star's compactness (from top to bottom, $0.06$, $0.12$, $0.18$, and $0.22$). First column illustrates a time in the early inspiral, the second one is roughly at contact time, the third one is during the merger stage and the fourth one at the end of our simulation. Notice that the final remnant for $C \lesssim 0.12$ is composed by two rotating co-existing DBS, while that for $C \gtrsim 0.18$ is a rotating BH (i.e., the black sphere at late times represents the apparent horizon).} \label{noethers} \end{figure*} Some snapshots of the Noether charge density for each case, at different representative times of the coalescence, are displayed in Fig.~\ref{noethers}. The conformal factor of the metric used in the CCZ4 formalism, which represents roughly the gravitational potential, is displayed in Fig~\ref{chi} at the same times. As stated above, the interaction between DBSs takes place only through gravity, even when there exists an overlap between the stars, as shown in Fig.~\ref{noethers}. Therefore, the first feature that one can observe is that the transition between inspiral and merger stages depends on the star's compactness. For low compact stars $C \lesssim 0.12$, the inspiral phase does not finish suddenly at the contact time $t_{c}$ (i.e., defined as the time at which the individual Noether charge densities make contact for the first time) but smoothly continues to the merger phase. The final remnant is a superposition of two coexisting orbiting DBSs that, at late times, are expected to settle down into a stationary spherically-symmetric configuration equivalent to a multi-state BSs~\cite{bernal}. For high compact stars $C \gtrsim 0.18$, the transition is quite abrupt and clearly distinguishable. The final remnant is too compact and inevitably collapses to a rotating BH. Therefore, the final object also depends on the initial compactness of the identical stars. We can identify a critical transition compactness $C_{T}$ such that below that value the remnant relaxes to a multi-state BS and above it collapses to a BH. From our simulations we can infer that $0.12 < C_{T} < 0.18.$ \begin{figure*} \centering \includegraphics[width=17cm, height=15cm]{coalesdark4} \caption{{\em Dynamics of DBS coalescence}. Conformal factor, which gives a rough description of the gravitational potential, in the equatorial plane at the same time snapshots as in Fig.~\ref{noethers}. Each row corresponds to a different compactness (from top to bottom, $0.06$, $0.12$, $0.18$, and $0.22$). } \label{chi} \end{figure*} As discussed before, the most compact cases lead to the formation of a rotating BH, a process that is common to other binary mergers. Then, we shall focus our analysis to the more peculiar and distinctive scenario where the merger does not produce a BH. Instead, the two stars keep rotating around each other while emitting GWs, despite a significant overlap between the individual Noether charge densities. In contrast to the inspiral phase, after the contact time the two stars can not be modeled as point sources, since the distance between their centers of mass is comparable or smaller than their radius. The evolution of angular momentum is displayed in Fig.~\ref{analysis} for these low-compact cases. Angular momentum is radiated slowly during the coalescence through gravitational waves, increasing rapidly its emission rate after the contact time. Meanwhile, the mass only decreases by roughly $10\%$ at most, which means that the final multi-state BS has approximately the total initial mass of the binary system. For comparison purposes, the angular momentum evolution of the corresponding binary BSs have been added to the same plot. The behavior of BS after the contact time is clearly different, showing a sharp decay due to the interaction between the scalar fields modeling each star. A deeper discussion of the differences between DBS and BS will be given in Section~\ref{comp}. \begin{figure} \centering \includegraphics[width=1.0\linewidth]{J_DS} \caption{ {\em Dynamics of DBS coalescence}. Angular momentum $J_{z}$ as a function of time for DBS with initial compactness $C=0.06$ and $C=0.12$. This quantity, for the remnants of DBS mergers, decays to zero in a much longer timescale than those of BS mergers, especially for the lowest compactness $C=0.06$. Notice that the sudden decay of the binary BS case with $C=012$ was enhanced by the ejection of two blobs of scalar field during the merger~\cite{palenpani}.} \label{analysis} \end{figure} \begin{table*} \begin{ruledtabular} \begin{tabular}{c||cccc|c|ccc|ccc} $C$ & $y_c^{(i)}$ & $v_x^{(i)}$ & $M_0$ & $J_0$ & $t_\mathrm{c}$ & remnant & $E^{DBS}_\mathrm{rad}/M_0$ & ${\cal E}^{DBS}_\mathrm{rad}/M_0$ & remnant & $E^{BS}_\mathrm{rad}/M_0$ & ${\cal E}^{BS}_\mathrm{rad}/M_0$\\ \hline\hline 0.06 & $\pm 8$ & $\pm 0.142$ & 1.07 & 1.16 & 1200 & BS+BS & 0.068 & 0.06 & BS & 0.075 & 0.029\\ 0.12 & $\pm 5$ & $\pm 0.210$ & 1.18 & 1.24 & 471 & BS+BS & 0.127 & 0.12 & BS & 0.085 & 0.057\\ 0.18 & $\pm 5$ & $\pm 0.214$ & 1.29 & 1.40 & 335 & BH & 0.014 & 0.18 & BS & 0.120 & 0.086 \\ 0.22 & $\pm 5$ & $\pm 0.220$ & 1.46 & 1.65 & 218 & BH & 0.030 & 0.22 & BH & 0.030 & 0.1 \end{tabular} \caption{ {\em Characteristics of binary of DBS models.} The entries of the table are, respectively: the compactness $C$ of the individual DBSs in the binary, the initial positions $y_c^{(i)}$, the initial velocities of the boost $v_x^{(i)}$, the initial total ADM mass $M_0$, the initial total orbital angular momentum $J_0$ of the system, the time of contact of the two stars $t_c$, the final remnant, the total radiated energy in gravitational waves for each simulation $E_\mathrm{rad}$ (i.e., integrated from the beginning and extrapolated to large times after the contact time) and the one estimated analytically ${\cal E}_\mathrm{rad}$ as described in Appendix~\ref{appA}. We also included previous results corresponding to binary BSs for comparison purposes. } \label{table2} \end{ruledtabular} \end{table*} \subsection{Gravitational Radiation} The main mode $l=|m|=2$ of the Newman-Penrose scalar $\Psi_{4}$, encoding the gravitational radiation produced during the coalescence, is displayed in Fig.~\ref{psi4}. Furthermore, the same mode of the strain, near the contact time, is shown in Fig.~\ref{gwstrain}. Notice that time has been rescaled with the initial total mass $M_0$ of each binary, and shifted such that contact time occurs at $t=0$. Let us start with the less compact cases, $C \lesssim 0.12$, whose merger leads to a superposition of two co-existing BSs as a final state. As it might be expected, gravitational radiation produced during the early inspiral is weak, since the stars have large radii and therefore collide at a low frequency. After making contact, the binary enters smoothly to the merger stage, with both stars orbiting around each other for a long time and yielding to stronger gravitational waves than during the inspiral. Losses of energy and angular momentum occur mainly during this stage, while the remnant formed by the two coexisting stars rotates at a faster frequency, radiating more intense GWs. Although the cases with $C \gtrsim 0.18$ share the same behavior in the early inspiral, soon after the contact time the remnant becomes unstable and collapses to a rotating BH. The exponential decay of the gravitational wave signal observed for these cases in Fig.~\ref{psi4} and Fig.~\ref{gwstrain} is a clear evidence on this final BH state. Furthermore, we have included the comparison with an effective-one-body (EOB) approximation that describes the adiabatic coalescence of quasi-circular binary BHs ~\cite{2017PhRvD..95d4028B}. Interestingly, although the signals show a good agreement during the inspiral phase, they are quite different as they get closer to the contact time: analogous to NSs, binaries composed by DBSs are strongly affected by tidal interacting forces only when they are in a close orbit. This means that, even though DBSs only suffer gravitational interactions, they behave yet rather different than BHs. The most compact case, $C=0.22$ shows that even when the final fate of the remnant is a BH, DBSs and BHs are still different in the late inspiral and merger. An accurate quantitative comparison of our simulations with the EOB approximation would require initial data for DBS binaries in quasi-circular orbits with much smaller constraint violation, which is not yet available. \begin{figure} \centering \includegraphics[width=1.0\linewidth]{gw_ampl2_ds} \caption{ {\em Gravitational waves}. The real part of the main $l=m=2$ mode of $\Psi_4$ describing the gravitational emission produced by DBS and BSs binaries as a function of time.} \label{psi4} \end{figure} \begin{figure*} \centering \includegraphics[width=1.0\linewidth]{gwstrain5_ds} \caption{ {\em Gravitational waves}. Main mode of the strain for DBS binaries with different compactness near the contact time. All cases are compared to the EOB approximation of a quasi-circular binary BH coalescence~\cite{2017PhRvD..95d4028B} by matching the waveforms at early inspiral.} \label{gwstrain} \end{figure*} It is also illustrative to analyze the instantaneous GW frequencies $f_{GW}$ of DBS binaries and compared them to: (i) BS binaries, (ii) a Post-Newtonian (PN) T4 approximation for point particles(i.e., BHs)~\cite{T4}, and (iii) a T4 approximation including also the lowest order tidal effects~\cite{T4tidal1,T4tidal2}, whose strength can be measured by the tidal Love number~\cite{2017arXiv170101116C,Sennett:2017etc}. Fig.~\ref{PPcomp} displays these four models (i.e., DBS, BS and T4 with and without tidal effects) for each compactness. Again, all models behave similarly during the inspiral, with differences arising near the contact time. While the DBS binary with $C \lesssim 0.12$ exhibits a smooth and soft increase on the frequency, the corresponding BS binary shows an abrupt rise as a consequence of the stronger dynamics of the remnant, induced by scalar field interactions. The PN-T4 approximation, either with or without tidal effects, leads to different frequencies than the DBS binary after the contact time, such that $f_{GW}$ of DBS is somewhere in between these two approximations. This means that, although including tidal effects at the lowest order might be acceptable during the inspiral phase, it is not accurate enough after the contact time when the effects of extended bodies become important. Notice also that the frequencies calculated from T4-PN are closer to those of the BS binary when tidal effects are activated, probably because both matter interactions and tidal effects accelerate the dynamics of the system. The post-merger frequency of DBS and BS reach roughly the same value in the case $C=0.12$. We presume that in the case $C=0.06$ both models will also reach the same frequency at the end state, although the time scales for the remnant to settle down are much longer than considered on this work. In the most compact cases, $C= 0.22$, there are no significant differences between BS and DBS frequencies, as we have seen in the waveform as well. These high-compact cases are noticeably different than the T4 approximations (i.e., with and without tidal effects), showing again that such merger is still different from the one of a binary BH. Notice that the case $C=0.18$ is not directly comparable since the remnants of binary DBS and BS are different. \begin{figure*} \centering \includegraphics[width=1.0\linewidth]{orbital_c006_12_22_tc} \caption{ {\em Gravitational waves}. GW wave frequency $f_{GW}=\omega_{GW}/2\pi$ as a function of time, where $\omega_{GW}$ is the instantaneous GW angular frequency from the main $l=m=2$ mode. The frequencies calculated numerically for DBS and BS are displayed in thick solid and dashed lines, respectively, while that frequencies calculated by Taylor T4 approximation with and without tidal effects are plotted in thin solid lines. Notice that significant differences arise just after contact time.} \label{PPcomp} \end{figure*} Finally, the luminosity and total radiated energy produced by the main gravitational wave modes $l=2$ are displayed in Figs.~\ref{lum2} and \ref{lum5}, with the specific values listed in Table~\ref{table2}. The total energy obtained disclose that the cases $C \lesssim 0.12$ are {\em super-emiters}~\cite{Hanna:2016uhs}, since the system emits more than the analogous binary BH system (i.e., about $5\%$ of its initial total mass). Following~\cite{palenpani,Hanna:2016uhs}, we can estimate the amount of energy radiated by DBS binaries as \begin{eqnarray} {\cal E}^{ac}_{{\rm rad}} \approx M_0 C, \end{eqnarray} which is roughly in agreement with the results of our simulations for the low compact cases (i.e., not collapsing to a BH). The detailed calculation can be found in Appendix~\ref{appA}. \begin{figure} \centering \includegraphics[width=1.0\linewidth]{lum_gw2} \caption{ {\em Gravitational waves}. Luminosity of gravitational waves radiated during the coalescence of DBS and BS binaries.} \label{lum2} \end{figure} \begin{figure} \centering \includegraphics[width=1.0\linewidth]{energy_int} \caption{ {\em Gravitational waves}. Total GW energy radiated during the coalescence, calculated by integrating in time the quantities displayed in Fig.~\ref{lum2}} \label{lum5} \end{figure} \subsection{DBS versus BSs}\label{comp} In order to analyze the effect of scalar field interactions, most of the previous plots included not only the analysis of our binary DBS simulations, but also previous binary BS results~\cite{palenpani}. Let us here stress some of the most significant differences which have not been discussed yet. An unexpected behavior was recognized in the binary BSs case with compactness $C=0.12$: the formation of two scalar field blobs which were ejected during the merger, carrying away little mass but an important amount of angular momentum. However, none of the DBS binaries show any evidence of such scalar field blobs. A snapshot at $t=t_c + 60$ of the Noether charge density for DBS and BS binaries with $C=0.12$ is displayed in Fig.~\ref{comp_blobs} to illustrate the different dynamical behavior. The evolution of angular momentum in Fig.~\ref{analysis} also shows considerable losses in the BS case (i.e., resulting into a sudden decrease after the contact time) as a result of the matter ejection. It is also quite interesting that, in the BS binary with compactness $C=0.18$ the remnant settles down to a non-rotating BS, while that the remnant of the corresponding DBS binary collapses to a rotating BH. Therefore, one of the effects of matter interactions is to induce an additional pressure that supports the collapse to a BH, increasing effectively the critical transition compactness $C_T$. Consequently, the range of $0.12 < C_{T}\leq 0.18$ valid for DBS is increased to $0.18 < C_{T}\leq 0.22$ for BS. The gravitational radiation also show interesting differences. During the inspiral phase, the gravitational radiation of DBS and BS binaries are exactly the same, as it is expected. The main difference appears near the contact time. On one hand, binary BS coalescence is governed by scalar field and gravitational forces, which accelerates the dynamics of the system and reduces the time for the remnant to settle down. In this case, after the contact time the two boson stars merge into a rotating BSs which radiate stronger GWs and at a higher frequency than during the inspiral phase. On the other hand, binary DBSs dynamics is driven only by gravitational interactions and there is a smooth slow transition from inspiral to merger, which can also be appreciated on the GW frequency displayed in Fig~\ref{PPcomp}. \begin{figure} \centering \includegraphics[width=0.9\linewidth]{comp} \caption{ {\em Comparison of DBS vs BSs}. Noether charge densities of DBS and BS binaries, roughly at time $t=t_c + 60$, for the stars with compactness $C=0.12$. Notice that there are two scalar blobs in the BS merger which do not form in DBS collisions.} \label{comp_blobs} \end{figure} \section{Conclusions}\label{conclu} In this paper we have studied, through full numerical simulations, the dynamics and the gravitational radiation produced during the coalescence of binary DBSs $-$ self-gravitating compact objects composed by bosonic matter that can only interact through gravity $-$. We have considered four initial compactness, given by $C = \{0.06,0.12,0.18,0.22\}$, of the identical stars forming the binary. For the less compact cases, $C \lesssim 0.12$, the dynamics showed a smooth transition from inspiral to merger, leading to a superposition of two close-orbiting DBSs. Gravitational radiation emitted on these cases is quite weak during the inspiral phase, although it increases considerably after the contact time. For the highest compactness cases $C\gtrsim 0.18$, the transition from inspiral to merger is quite abrupt. After the merger, the remnant is excessively compact and it inevitably collapses to a BH. GWs on this post-merger stage are given by the classical BH ring-down. Therefore, our research reveals that binaries composed by these dark bosonic objects form either; (i) a multi-state BSs for $C < C_{T}$, which emits GW continuously for a long time, or (ii) a rotating BH for $C > C_{T}$ with its typical ring-down signal after the collapse. We have also compared these DBS mergers with previous simulations of BS collisions~\cite{palenpani}, where the scalar field behaves as a fluid (i.e., there exists interaction between the stars through both gravity and the scalar field), leading to important differences. Despite presenting the same dynamics during the inspiral phase, scalar field interactions precipitate the plunge of the stars after the contact time and accelerates the dynamics of the remnant. For the DBS binary with compactness $C=0.12$, there is no ejection of blobs, contrary to what happened in the BSs case. Finally, DBS with a compactness $C=0.18$ collapses to a rotating BH after the merger, while the corresponding binary BSs case settles down to a non-rotating BS. Finally, the comparison of the instantaneous GW frequencies of DBSs binaries with standard BS binaries and the PN-T4 approximation reveals, in the cases when the remnant is not a BH, a very particular and distinguishable signature of these compact objects made of dark matter. All these results indicates that there is a new kind of objects, the Dark Stars, with dynamics and gravitational waveforms different and clearly distinguishable from other astrophysical objects like BHs, NSs or even BSs. These distinctive waveforms could be interesting to contrast future observations of aLIGO/aVIRGO. \vspace{-1pt} \subsection*{Acknowledgments} It is a pleasure to thank Steve Liebling for helpful comments and discussions on the manuscript, as well as Toni Arbona and Carles Bona for useful observations. CP and MB acknowledge support from the Spanish Ministry of Economy and Competitiveness grants FPA2013-41042-P and AYA2016-80289-P (AEI/FEDER, UE). CP also acknowledges support from the Spanish Ministry of Education and Science through a Ramon y Cajal grant. MB would like to thank CONICYT Becas Chile (Concurso Becas de Doctorado en el Extranjero) for financial support. We acknowledge networking support from COST Action CA16104 ``GWverse'', supported by COST (European Cooperation in Science and Technology). We thankfully acknowledge the computer resources at MareNostrum and the technical support provided by Barcelona Supercomputing Center (AECT-2018-1-0003).
\section{Introduction} \label{introduction} With the increasing availability of radioactive ion beams, the study of structure and reactions of exotic nuclei is one of the most fascinating research areas in nuclear physics~\cite{Balantekin2014_MPLA29-1430010}. The exotic nuclei display distinct features from those seen in typical stable nuclei, which is attributed partly to the unique characteristics of the nucleon-nucleon interaction. The tensor interaction between nucleons is one such characteristic and is well known to be important in nuclear structure properties~\cite{Lesinski2007_PRC76-014312}, e.g., the shell evolution of exotic nuclei~\cite{Otsuka2006_PRL97-162501}, spin-orbit splitting~\cite{Colo2007_PLB646-227}, and Gamow-Teller and charge exchange spin-dipole excitations~\cite{Bai2010_PRL105-072501}. However, its role in low-energy nuclear reactions is poorly understood as the tensor force has been neglected in most reaction dynamics calculations. In particular, regarding nuclear dynamics, the tensor force changes not only the spin-orbit splitting but also the intrinsic excitations which may give rise to dynamical effects which are more complicated than those arising from simple shell evolution. The study of the effects of the tensor force on heavy-ion fusion dynamics will lead to a better understanding of the effective nucleon-nucleon interaction and of the correlations present in these many-body systems. The study of heavy-ion interaction potentials is of fundamental importance for above barrier and sub-barrier fusion reactions~\cite{Back2014_RMP86-317}. In general, two categories of theoretical approaches are used for calculating ion-ion potentials. In the first category, phenomenological models such as the Bass model~\cite{Bass1974_NPA231-45}, the proximity potential~\cite{Randrup1978_PLB77-170,Seiwert1984_PRC29-477}, the double-folding potential~\cite{Satchler1979_PR55-183,Rhoades-Brown1983_PRL50-1435}, and driven potential from dinuclear system model~\cite{Adamian2004_PRC69-044601, Wang2012_PRC85-041601,Zhu2016_PRC93-064610,Bao2016_PRC93-044615,Feng2018_PRC95-024615} could be mentioned. Although these methods have been successful in explaining particular aspects of reaction data~\cite{Randrup1978_NPA307-319,Fazio2004_EPJA19-89}, the uncertainty of macroscopic parameters and the lack of microscopic origins restrict their predictive power and may obscure the underlying physical processes. Second category contains the semi- and fully microscopic approaches to obtain potentials by including the interactions of the constituents~\cite{Moller2004_PRL92-072501,Guo2004_NPA740-59,Guo2005_PRC71-024315,Guo2007_PRC76-034317,Lu2014_PRC89-014323}. One common assumption used in many of the semi-microscopic calculations is that of the frozen density or sudden approximation~\cite{Brueckner1968_PR173-944}, in which the nuclear densities are unchanged during the computation of the nucleus-nucleus potential as a function of internuclear distance. This approximation may result in an unphysical potential at deep sub-barrier energies, where the inner turning point of the interaction potential corresponds to large nuclear overlap. Various remedies have been developed to address this issue within the confines of the coupled-channels approach~\cite{Misicu2006_PRL96-112701,Ichikawa2007_PRC75-057603}. In other microscopic approaches, such as the constrained mean-field methods, although the nuclear densities are allowed for the rearrangement, the potential energy path is obtained by the static adiabatic approximation, thus ignoring the dynamical effects. In recent years we have developed the density-constrained time-dependent Hartree-Fock (DC-TDHF) approach for calculating heavy-ion interaction potentials, which naturally incorporate all of the dynamical effects included in the time-dependent Hartree-Fock (TDHF) description of the collision process~\cite{Umar2006_PRC74-021601}. These effects include nucleon transfer, couplings between the collective motion and intrinsic degrees of freedom, neck formation, internal excitations, and deformation effects to all orders. The method is based on the TDHF evolution of the nuclear dynamics coupled with density-constrained (DC) Hartree-Fock (HF) calculations to obtain the ion-ion potential. In contrast to other mean-field based microscopic methods, the DC-TDHF approach doesn't need to introduce external constraining operators which assume that the collective motion is confined to the constrained phase space. That means that the many-body system selects its evolutionary path by itself following the microscopic dynamics. We have applied this method for a wide range of reactions ~\cite{Umar2006_PRC74-024606,Umar2006_PRC74-061601,Umar2008_PRC77-064605,Umar2008_EPJA37-245, Umar2009_PRC80-041601,Oberacker2010_PRC82-034603,Keser2012_PRC85-044606,Umar2012_PRC85-055801, Umar2014_PRC89-034611,Godbey2017_PRC95-011601} and found reasonable agreement between the measured fusion cross sections and the DC-TDHF results. To our knowledge, neither the phenomenological nor microscopic methods for calculating ion-ion potential include the tensor force between nucleons, which is an important component of the nuclear force. Our work is the first attempt to investigate the effect induced by the tensor force on heavy-ion interaction potentials. The TDHF approach is a well-defined framework and provides a useful foundation for a fully microscopic many-body theory. Quantum effects are considered, which is essential for the manifestation of shell effects during the collision dynamics. Recently, the effect of the tensor force in heavy-ion collisions has been studied using direct TDHF calculations~\cite{Fracasso2012_PRC86-044303,Dai2014_SciChinaPMA57-1618,Stevenson2016_PRC93-054617,Shi2017_NPR34-41,Guo2018_PLB782-401}. Furthermore, the TDHF approach provides a deeper understanding of nuclear dynamics, as seen in recent applications to fusion~\cite{Simenel2004_PRL93-102701,Umar2009_PRC80-041601,Oberacker2010_PRC82-034603,Guo2012_EPJWoC38-09003, Keser2012_PRC85-044606,Umar2012_PRC85-055801,Simenel2013_PRC88-024617, Umar2014_PRC89-034611,Washiyama2015_PRC91-064607,Tohyama2016_PRC93-034607,Godbey2017_PRC95-011601,Simenel2017_PRC95-031601}, quasifission~\cite{Golabek2009_PRL103-042701,Oberacker2014_PRC90-054605,Umar2015_PRC92-024621,Umar2016_PRC94-024605,Yu2017_SciChinaPMA60-092011}, transfer reactions~\cite{Washiyama2009_PRC80-031602,Simenel2010_PRL105-192701,Simenel2011_PRL106-112502,Scamps2013_PRC87-014605,Sekizawa2013_PRC88-014614, Wang2016_PLB760-236,Sekizawa2016_PRC93-054616,Sekizawa2017_PRC96-041601}, fission~\cite{Simenel2014_PRC89-031601,Scamps2015_PRC92-011602,Goddard2015_PRC92-054610,Goddard2016_PRC93-014620,Bulgac2016_PRL116-122504,Tanimura2017_PRL118-152501}, and deep inelastic collisions~\cite{Maruhn2006_PRC74-027601,Guo2007_PRC76-014601,Guo2008_PRC77-041301,Iwata2011_PRC84-014616,Dai2014_PRC90-044609,Dai2014_SciChinaPMA57-1618, Stevenson2016_PRC93-054617,Guo2017_EPJWoC163-00021,Shi2017_NPR34-41,Umar2017_PRC96-024625}. For recent reviews see Refs.~\cite{Simenel2012_EPJA48-152,Nakatsukasa2016_RMP88-045004,Simenel2018_PPNP}. This article is organized as follows. In Sec.~\ref{theory}, we summarize the theoretical formalism of Skyrme energy functional with the tensor force included and the TDHF and DC-TDHF approaches. Section~\ref{discuss} presents the systematic analysis of the impact of the tensor force on heavy-ion interaction potentials. A summary is given in Sec.~\ref{summary}. \section{Theoretical framework} \label{theory} Despite the wide application of the TDHF approach, various assumptions and approximations that may affect the TDHF results have been employed in the past. This led to an occasional imperfect or even incorrect reproduction of experimental data. To remedy these problems a considerable theoretical and computational effort has been undertaken for increased numerical accuracy and improved effective interactions. For instance, the inclusion of the spin-orbit interaction solved an early conflict between TDHF predictions and experimental observations~\cite{Umar1986_PRL56-2793,Umar1989_PRC40-706} and turned out to play an important role in fusion and dissipation dynamics~\cite{Maruhn2006_PRC74-027601,Dai2014_PRC90-044609}. In recent years it has become feasible to perform TDHF calculations on a three-dimensional Cartesian grid without any symmetry restrictions and with accurate numerical methods. In addition, the quality of energy density functional (EDF) has been substantially improved. The time-odd terms in particular have shown to be non-negligible in heavy-ion collisions~\cite{Umar2006_PRC73-054607}. However, there are still important components of the basic theory that have not yet been fully implemented, such as the tensor force between nucleons. In order to study the role of tensor force in heavy-ion interaction potential, we incorporate the full tensor force into the microscopic TDHF and DC-TDHF approaches. \subsection{Full Skyrme energy functional} Most TDHF calculations employ the Skyrme effective interaction~\cite{Skyrme1956_PM1-1043}, in which the two-body tensor force was proposed in its original form as \begin{align} \begin{split} v_T&=\dfrac{t_\mathrm{e}}{2}\bigg\{\big[3({\sigma}_\mathrm{1}\cdot\mathbf{k}')({\sigma}_\mathrm{2}\cdot\mathbf{k}')-({\sigma}_\mathrm{1}\cdot{\sigma}_\mathrm{2})\mathbf{k}'^{\mathrm{2}}\big]\delta(\mathbf{r}_\mathrm{1}-\mathbf{r}_\mathrm{2})\\ &+\delta(\mathbf{r}_\mathrm{1}-\mathbf{r}_\mathrm{2})\big[3({\sigma}_\mathrm{1}\cdot\mathbf{k})({\sigma}_\mathrm{2}\cdot\mathbf{k})-({\sigma}_\mathrm{1}\cdot{\sigma}_\mathrm{2})\mathbf{k}^\mathrm{2}\big]\bigg\}\\ &+t_\mathrm{o}\bigg\{3({\sigma}_\mathrm{1}\cdot\mathbf{k}')\delta(\mathbf{r}_\mathrm{1}-\mathbf{r}_\mathrm{2})({\sigma}_\mathrm{2}\cdot\mathbf{k})-({\sigma}_\mathrm{1}\cdot{\sigma}_\mathrm{2})\mathbf{k}' \delta(\mathbf{r}_\mathrm{1}-\mathbf{r}_\mathrm{2})\mathbf{k}\bigg\}. \end{split} \end{align} The coupling constants $t_\textrm{e}$ and $t_\textrm{o}$ represent the strengths of triplet-even and triplet-odd tensor interactions, respectively. The operator $\mathbf{k}=\frac{1}{2i}(\nabla_1-\nabla_2)$ acts on the right and $\mathbf{k}'=-\frac{1}{2i}(\nabla'_1-\nabla'_2)$ acts on the left. It is natural to represent the total energy of the system \begin{equation} E=\int d^3r {\cal H}(\rho, \tau, {\mathbf{j}}, {\textbf{s}}, {\textbf{T}}, {\textbf{F}}, J_{\mu\nu}; {\mathbf{r}}) \label{Energy} \end{equation} in terms of the energy functional. The functional is composed by the number density $\rho$, kinetic density $\tau$, current density ${\mathbf{j}}$, spin density ${\mathbf{s}}$, spin-kinetic density ${\mathbf{T}}$, the tensor-kinetic density {\textbf{F}}, and spin-current pseudotensor density $J$~\cite{Stevenson2016_PRC93-054617}. The full version of Skyrme EDF is expressed as \begin{align} \label{EDFH} \begin{split} \mathcal{H}&=\mathcal{H}_0+\sum_{\rm{t=0,1}}\Big\{A_{\rm{t}}^{\rm{s}}\mathbf{s}_{\rm{t}}^2+(A_{\rm{t}}^{\Delta{s}}+B_{\rm{t}}^{\Delta{s}}) \mathbf{s}_{\rm{t}}\cdot\Delta\mathbf{s}_{\rm{t}}+B_{\rm{t}}^{\nabla s}(\nabla\cdot \mathbf{s}_{\rm{t}})^2 \\ &+B_{\rm{t}}^{F}\big(\mathbf{s}_{\rm{t}}\cdot \mathbf {F}_{\rm{t}}-\frac{1}{2}\big(\sum_{\mu=x}^{z}J_{\rm{t}, \mu\mu}\big)^2-\frac{1}{2}\sum_{\mu, \nu=x}^{z}J_{\rm{t}, \mu\nu}J_{\rm{t}, \nu \mu}\big)\\ &+(A_{\rm{t}}^{\rm{T}}+B_{\rm{t}}^{\rm{T}})\big(\mathbf{s}_{\rm{t}}\cdot\mathbf{T}_{\rm{t}}- \sum_{\mu,\nu=x}^{z}J_{\rm{t},\mu\nu}J_{\rm{t},\mu\nu}\big)\Big\}, \end{split} \end{align} where $\mathcal{H}_0$ is the simplified functional used in the Sky3D TDHF code~\cite{Maruhn2014_CPC185-2195} and most TDHF calculations. The terms containing the coupling constants $A$ arise from the Skyrme central force and those with $B$ from the tensor force. The definitions of both $A$ and $B$ can be found in Refs.~\cite{Lesinski2007_PRC76-014312,Davesne2009_PRC80-024314}. All the time-even and time-odd terms in Eq.~(\ref{EDFH}) have been implemented numerically in the mean-field Hamiltonians of the HF, TDHF and DC-TDHF approaches. As pointed out in Refs.~\cite{Lesinski2007_PRC76-014312,Stevenson2016_PRC93-054617}, the terms containing the gradient of spin density may cause spin instability in both nuclear structure and reaction studies, hence the terms of $\mathbf{s}_{\rm{t}}\cdot\Delta\mathbf{s}_{\rm{t}}$ and $(\nabla\cdot \mathbf{s}_{\rm{t}})^2$ have been turned off in all calculations. \subsection{TDHF approach} Given a many-body Hamiltonian, the action can be constructed as \begin{equation} S=\int_{t_1}^{t_2} dt \langle \Phi(\textbf{r}, t)|H-i\hbar \partial_t|\Phi(\textbf{r}, t)\rangle , \end{equation} where $\Phi$ is the time-dependent many-body wave function. In TDHF approach the many-body wave function $\Phi(\mathbf{r}, t)$ is approximated as a single time-dependent Slater determinant composed of an antisymmetrized product of the single particle states $\phi_{\rm{\lambda}}(\mathbf{r}, t)$ \begin{equation} \Phi(\mathbf{r}, t)=\frac{1}{\sqrt{N!}}\textrm{det}\{\phi_{\rm{\lambda}}(\mathbf{r}, t)\}, \end{equation} and this form is kept at all times in the dynamical evolution. By taking the variation of the action with respect to the single-particle wave functions, the set of nonlinear coupled TDHF equations in the multidimensional space-time phase space \begin{equation} i\hbar \frac{\partial}{\partial_t}\phi_{\rm{\lambda}}(\mathbf{r}, t)=h\phi_{\rm{\lambda}}(\mathbf{r}, t) \end{equation} yields the most probable time-dependent mean-field path, where $h$ is the HF single-particle Hamiltonian. The set of nonlinear TDHF equations has been solved on three-dimensional coordinate space without any symmetry restrictions and with modern, accurate numerical methods~\cite{Umar2006_PRC73-054607,Maruhn2014_CPC185-2195}. \subsection{Dynamical potential from DC-TDHF approach} Since TDHF theory describes the collective motion of fusion dynamics in terms of semi-classical trajectories, the sub-barrier quantum tunneling of the many-body wave function can not be included. Consequently, direct TDHF calculations can not be used to describe sub-barrier fusion. At present, all sub-barrier fusion calculations assume that there exists an ion-ion potential which depends on the internuclear distance. The microscopic DC-TDHF approach~\cite{Umar2006_PRC74-021601} is employed to extract the nucleus-nucleus potential from the TDHF time evolution of the dinuclear system. In this approach, at certain time during the evolution, the instantaneous TDHF density is used to perform a static HF energy minimization \begin{equation} \delta \langle \Psi_{\rm DC}|H-\int d^3r \lambda(\textbf{r})\rho(\textbf{r})|\Psi_{\rm DC}\rangle=0, \end{equation} by constraining the proton and neutron densities to be equal to the instantaneous TDHF densities. Since we are constraining the total density, all moments are simultaneously constrained. DC-TDHF calculations give the adiabatic reference state for a given TDHF state, which is the Slater determinant with the lowest energy for a given density. The minimized energy \begin{equation} E_{\rm {DC}}(\textbf R)=\langle \Psi_{\rm DC}|H|\Psi_{\rm DC}\rangle \end{equation} is the density-constrained energy. Since this density-constrained potential still contains the binding energies of individual nuclei which should be subtracted out, the heavy-ion interaction potential is deduced as \begin{equation} V(\textbf R)=E_{\rm {DC}}(\textbf R)-E_{\rm {A1}}-E_{\rm {A2}}, \label{VB} \end{equation} where $E_{\rm {A1}}$ and $E_{\rm {A2}}$ are the binding energies of the two individual nuclei. One should note that this procedure does not affect the TDHF time evolution and contains no free parameters or normalization. \subsection{Bare potential from FHF approach} In previous subsection, the DC-TDHF technique has been introduced to compute the nucleus-nucleus potential in a dynamical microscopic way. All of the dynamical effects included in TDHF is then directly incorporated in the potential. Here we look for a different approach to produce a bare potential which does not include any dynamical contribution, since we aim to disentangle the static and dynamical effects of the tensor force. The bare nucleus-nucleus potential is defined as the interaction potential between the nuclei in their ground states. In addition, to preserve the consistency with microscopic calculations, it is necessary to compute the potential from the same EDF used in HF, TDHF, and DC-TDHF calculations. This is possible using the frozen Hartree-Fock (FHF) technique~\cite{Simenel2013_PRC88-064604}, assuming that the densities of the target and projectile remain constant and equal to their respective ground state densities. The potential can then be expressed as \begin{align} \label{eq:FD} V_\mathrm{FD}(\textbf R)=E[\rho_\mathrm{1}+\rho_\mathrm{2}](\textbf R)-E[\rho_\mathrm{1}]-E[\rho_\mathrm{2}], \end{align} where $\rho_\mathrm{1}$ and $\rho_\mathrm{2}$ are HF ground state densities of the fragments, and $E[\rho_\mathrm{1}+\rho_\mathrm{2}]$ is the same Skyrme EDF as defined in Eqs.~(\ref{Energy}) and (\ref{EDFH}). In the FHF approach, the Pauli principle between pairs of nucleons belonging to different collision partners has been neglected. When the overlap between the density distributions is small, the barrier is almost unaffected by the inclusion of the Pauli principle. However, at larger overlaps of the densities where the Pauli principle is expected to play a more important role, the FHF approximation may not properly account for the potential, particularly the inner part~\cite{Simenel2017_PRC95-031601}. \section{results} \label{discuss} The concept of using density as a constraint for calculating collective states from TDHF time evolution was first introduced in the mid 1980s~\cite{Cusson1985_ZPA320-475}, and was used for the microscopic description of nuclear molecular resonances~\cite{Umar1985_PRC32-172}. In recent years, the DC-TDHF approach has demonstrated its feasibility and success in explaining sub-barrier fusion dynamics for a wide range of reactions. This is rather remarkable given the fact that the only input in DC-TDHF is the Skyrme effective interaction, and there are no adjustable parameters. In the present work, we focus on how the tensor force affect the nucleus-nucleus potential which is vital for the theoretical analysis of sub-barrier fusion dynamics. We have thus chosen ten representative reactions with proton and neutron numbers of reaction partners corresponding to the magic numbers 8, 20, 28, 50, and 82, in which the spin-saturated shells are 8 and 20. In the numerical simulation the static HF ground state for the reaction partner has been calculated on the symmetry-unrestricted three-dimensional grid. The resulting Slater determinants for each nucleus comprise the larger Slater determinant describing the colliding system during the dynamical evolution. The TDHF time propagation is performed using a Taylor-series expansion up to the sixth order of the unitary boost operator with a time step of $0.2 ~\mathrm {fm}/c$. For the dynamical evolution, we use a numerical box of 48 fm along the collision axis and 24 fm in the other two directions and a grid spacing of 1.0~fm. The initial separation between the two nuclei is 20~fm. The choice of these parameters assures good numerical accuracy in the unrestricted TDHF evolution. We have simultaneously performed the density constraint calculations utilizing the DC-TDHF method at every 10-20 time steps (corresponding to 2-4~$\mathrm {fm}/c$ interval). The convergence property in DC-TDHF calculations is as good if not better than in the traditional constrained HF with a constraint on a single collective degree of freedom. We employ the Skyrme interaction in the calculations, in which the tensor force has been constructed in two ways. One is to add the force perturbatively to the existing standard interactions, for instance, the existing Skyrme parameter SLy5~\cite{Chabanat1998_NPA635-231} plus tensor force, denoted as SLy5t~\cite{Colo2007_PLB646-227}. The comparison between calculations with SLy5 and SLy5t addresses the question on how much of the changes is caused by tensor force itself. Another approach is to readjust the full set of Skyrme parameters self-consistently. This strategy has been adopted in Ref.~\cite{Lesinski2007_PRC76-014312} and led to the set of T$IJ$ parametrizations with a wide range of isoscalar and isovector tensor couplings. Due to its fitting strategy, the contributions from the tensor force and the rearrangement of all other terms could be physically entangled. \begin{figure} \includegraphics[width=8.6cm]{V1.pdf} \caption{(Color online) Internuclear potential obtained from DC-TDHF approach shown for the evolution of the systems (a) $^{12}\mathrm{C}+\mathrm{^{12}C}$ at $E_{\mathrm{c.m.}}=8$ MeV and (b) $^{16}\mathrm{O}+\mathrm{^{16}O}$ at $E_{\mathrm{c.m.}}=12$ MeV with SLy5 (open circle) and SLy5t (solid circle) forces. \label{Fig:light}} \end{figure} For light systems, we choose the spin-unsaturated $^{12}\mathrm{C}+\mathrm{^{12}C}$ and spin-saturated $^{16}\mathrm{O}+\mathrm{^{16}O}$ reactions for comparison. As we have reported in Ref.~\cite{Umar2014_PRC89-034611}, the potential barriers are sensitive to the colliding energy. Hence, the same initial energy, close to the Coulomb barrier, is used for the reaction with and without tensor forces. In Fig.~\ref{Fig:light}, we plot the ion-ion potentials obtained from Eq.~(\ref{VB}) using the DC-TDHF approach for (a) $^{12}\mathrm{C}+\mathrm{^{12}C}$ at $E_{\mathrm{c.m.}}=8$ MeV and (b) $^{16}\mathrm{O}+\mathrm{^{16}O}$ at $E_{\mathrm{c.m.}}=12$ MeV with SLy5 (open circle) and SLy5t (solid circle) forces. Both nuclei, $^{12}\mathrm{C}$ and $\mathrm{^{16}O}$, show spherical ground states with tensor (SLy5t) and without tensor (SLy5) forces, which are in agreement with experimental data and other calculations. The correct description of the initial shape of target and projectile nucleus is important for the dynamical evolution of heavy-ion collisions. We see that for the spin-unsaturated system $^{12}\mathrm{C}+\mathrm{^{12}C}$, the potential with the tensor force included has an overall higher interaction barrier than without the tensor force, although the difference of the potential barrier peak is small at roughly 0.07~MeV. For the spin-saturated system $^{16}\mathrm{O}+\mathrm{^{16}O}$, the internuclear potential is close with and without tensor force, having a barrier height of 10.02~MeV and a peak location of 8.66~fm. This indicates that the tensor force has negligible effect on the near-barrier fusion for the spin-saturated system $^{16}\mathrm{O}+\mathrm{^{16}O}$, which is consistent with the findings in Ref.~\cite{Stevenson2016_PRC93-054617}. For these light systems the tensor force shows a small effect on the interaction potential. \begin{figure*} \includegraphics[width=15.7cm]{V3_ppt.pdf} \caption{(Color online) Internuclear potential obtained from FHF and DC-TDHF approaches for the Ca+Ca, Ca+Ni, and Ni+Ni reactions with tensor (SLy5t) and without tensor (SLy5) forces. \label{Fig:medium}} \end{figure*} For reactions involving two medium mass nuclei, we have chosen five representative reactions $^{40}\mathrm{Ca}+\mathrm{^{40}Ca}$, $^{40}\mathrm{Ca}+\mathrm{^{48}Ca}$, $^{48}\mathrm{Ca}+\mathrm{^{48}Ca}$, $^{48}\mathrm{Ca}+\mathrm{^{56}Ni}$, and $^{56}\mathrm{Ni}+\mathrm{^{56}Ni}$, which vary by the total number of spin-unsaturated magic numbers in target and projectile by 0, 1, 2, 3, and 4. In these collisions, the reaction partners are closed-shell corresponding to 20 (spin-saturated) and 28 (spin-unsaturated) neutron or proton magic numbers. To disentangle the static (e.g. modification of ground-state density) and dynamical (e.g. modification of couplings, dissipation, and transfer) origins of the tensor force, the nucleus-nucleus potentials obtained both from FHF and DC-TDHF calculations are shown in Fig.~\ref{Fig:medium} for all Ca and Ni reactions. In the initial state of the collision dynamics, the deviation of the static FHF potential from the dynamical DC-TDHF result is the order of smaller than 10 keV. For all the Ca and Ni reactions, we observe that the nucleus-nucleus potentials are considerably different for the static FHF and dynamical DC-TDHF results. The static potentials are systematically higher than the dynamical results, and the barrier peaks are located at smaller relative distance with FHF. In particular, the inner part of the potential, having strong effect on the sub-barrier fusion, presents more significant difference for FHF and DC-TDHF results. This behavior is well understood and is a consequence of the absence of Pauli principle and excitations for the frozen density overlaps in FHF potentials~\cite{Simenel2013_PRC88-064604,Guo2018_PLB782-401,Simenel2017_PRC95-031601}, thus the difference between FHF and DC-TDHF is due to dynamical effects. Another interesting observation is that the variation of dynamical barriers due to tensor force is systematically greater than the ones for the static barriers. This indicates that the tensor force influences not only the ground-state single-particle levels, but also the dynamical effects including nucleon transfer, the couplings to low-lying states, and intrinsic excitations. In Ref.~\cite{Guo2018_PLB782-401}, how these dynamical effects affect the fusion barriers heights, computed directly from TDHF, have been investigated to study the role of tensor force on above-barrier fusion dynamics. We note that in Ref.~\cite{Guo2018_PLB782-401}, for the $^{48}\mathrm{Ca}+\mathrm{^{56}Ni}$ system, the tensor force was observed to decrease the barrier height in direct TDHF calculations, which is the opposite of the trend observed here. This difference might arise from the dynamical energy-dependent effects introduced by the tensor force that are not captured by the DC-TDHF potential. \begin{figure}[t] \includegraphics[width=8.6cm]{V5_Ca48Ca48.pdf} \caption{(Color online) Internuclear potential obtained from DC-TDHF approach for the reaction $^{48}\mathrm{Ca}+\mathrm{^{48}Ca}$ with SLy5, SLy5t, T22, T26, T44, and T62 forces. \label{Fig:TIJ}} \end{figure} For the spin-saturated reaction $^{40}\mathrm{Ca}+\mathrm{^{40}Ca}$, the interaction potential remains nearly unchanged by the inclusion of tensor force for both static and dynamical cases, indicating that the tensor force has almost no impact on the dynamical evolution for spin-saturated systems, since the contribution of tensor force is expected to be nearly zero for the ground state of spin-saturated nuclei. For the spin-unsaturated reactions, the barriers with tensor force SLy5t are systematically higher than those without the tensor force SLy5. This indicates a fusion hindrance effect due to the tensor force in this mass region. Empirically, 1 MeV larger in the inner part of the potential barrier can cause one order lower in the fusion cross section at sub-barrier energies. From the comparison of dynamical potentials for SLy5 and SLy5t, the potential barrier increases from a fraction up to a few MeV due to tensor force, which may results in changes of the sub-barrier fusion cross sections by a few orders of magnitude. For the medium mass systems with proton or neutron magic shells 20 and 28, the tensor force has a significant effect on the nucleus-nucleus potential, particularly in the inner region. Until now, the studies have utilized the tensor force SLy5t. To obtain a comprehensive and rigorous understanding of the effects of the tensor force in heavy-ion collisions, we now proceed to a comparison among the results of various forces, for which the coupling constants are listed in Tab.~\ref{tab:CC}. Taking the reaction $^{48}\mathrm{Ca}+\mathrm{^{48}Ca}$ as an example, \begin{table}[!hbt] \caption{Isoscalar and isovector spin-current coupling constants in units of MeV~fm$^5$.} \label{tab:CC} \begin{ruledtabular} \begin{tabular}{c c c} Force & $\mathrm{C}^\mathrm{J}_0$ & $\mathrm{C}^\mathrm{J}_1$ \\ \hline T22 & 0 & 0 \\ T26 & 120 & 120 \\ T44 & 120 & 0 \\ T62 & 120 & -120 \\ SLy5 & 15.65 & 64.55 \\ SLy5t & -19.35 & -70.45 \end{tabular} \end{ruledtabular} \end{table} we show the nucleus-nucleus potential with the six forces SLy5, SLy5t T22, T26, T44, and T62 in Fig.~\ref{Fig:TIJ}. For T$22$ and T$44$ the potentials are close to each other, indicating the isoscalar tensor coupling has negligible effect in this reaction. By comparing the results with T$26$, T$44$, and T$62$, the potential increases as the isovector tensor coupling decreases. This clear dependence of isoscalar and isovector tensor coupling may be due to the interplay between tensor terms and rearrangement of mean-field. The effect of the isoscalar tensor with the proton and neutron single particle spectrum moving in the same way seems to be canceled by the refitting of the parameters. However, the refitting does not incorporate the effect of isovector tensor in the same way. Detailed discussions on this can be found in Ref.~\cite{Guo2018_PLB782-401}. The T$62$ (T$26$) interaction also leads to similar potentials as SLy5t (SLy5), even though they have quite different tensor coupling constants, because the rearrangement of the mean-field for T$62$ (T$26$) produce additional effects which cancel part of the tensor force in SLy5t (SLy5). \begin{figure}[t] \includegraphics[width=8.6cm]{V4_ppt.pdf} \caption{(Color online) Internuclear potential obtained from DC-TDHF approach for the Ca+Sn systems with SLy5 (open circle) and SLy5t (solid circle) forces. \label{Fig:heavy}} \end{figure} To gain a better insight into the tensor force, the dynamical potential is shown in Fig.~\ref{Fig:heavy} for various Ca+Sn systems which involve one medium and one heavy reaction partner. For $^{48}\mathrm{Ca}$, $^{100}\mathrm{Sn}$, and $^{120}\mathrm{Sn}$, the ground states are found to be spherical for both SLy5 and SLy5t. However, the $^{116}\mathrm{Sn}$ nucleus exhibits small quadrupole deformation $\beta_2$ of 0.077 and 0.026 for SLy5 and SLy5t, respectively, for which the deformation difference arises from the tensor force. Since the outcome of collision dynamics strongly depends on the deformation orientation of colliding partners, the deformed nucleus $^{116}$Sn is initially set as the tip orientation in both SLy5 and SLy5t with the symmetry axis of $^{116}$Sn parallel to the internuclear axis. We find that, for the Ca+Sn systems, the effects of the tensor force show similar trends as in the spin-unsaturated Ca+Ca, Ca+Ni, and Ni+Ni systems presented in Fig.~\ref{Fig:medium}. The tensor force has the largest effect on the reaction $^{48}\mathrm{Ca}$+$^{116}\mathrm{Sn}$ as compared to the reactions with $^{48}\mathrm{Ca}$ colliding $^{100}\mathrm{Sn}$ and $^{120}\mathrm{Sn}$ isotopes, which may be due to the strong effect of the tensor force on the energy difference of single-proton states $1\mathrm{h}_{11/2}$ and $1\mathrm{g}_{9/2}$ along the Z=50 isotopes for $^{116}\mathrm{Sn}$, as shown in Ref.~\cite{Colo2007_PLB646-227}. Another suspected cause for this large effect arising from the tensor force in the $^{48}\mathrm{Ca}$+$^{116}\mathrm{Sn}$ reaction is the static deformation effects leading to a vastly different dynamical path for the system. \section{Summary} We incorporate the full tensor force into the FHF and DC-TDHF approaches to investigate the impact of the tensor force on heavy-ion internuclear potentials for ten representative systems in different mass regimes. As expected we find that static potentials are systematically higher than the dynamical results, however, the variation of dynamical potential barriers induced by tensor force is larger than those of the static case, which are attributed to the microscopic dynamical effects included in TDHF. For light systems, the tensor force is found to have small effects on the nucleus-nucleus potential, with the barrier height and inner part of the barrier changing by a fraction of an MeV. Even this small change may lead to large effects in cross sections when considering deep sub-barrier collisions at energy scales common in astrophysical systems. For medium and heavy spin-unsaturated reactions the effect is much more pronounced, with changes from a fraction of an MeV to almost 2~MeV for the barrier height. These differences indicate an important impact on sub-barrier fusion dynamics and a substantial fusion hindrance effect arising from the tensor force. The fully microscopic TDHF theory has shown itself to be rich in nuclear phenomena and continues to stimulate our understanding of nuclear dynamics. The time-dependent mean-field studies seem to show that the dynamic evolution builds up correlations that are not present in the static theory. While modern Skyrme forces provide a much better description of static nuclear properties in comparison to the earlier parametrizations, there is a need to obtain even better parametrizations that incorporate deformation and reaction data into the fit process. The tensor force should be a part of these investigations. \label{summary} \section{Acknowledgments} This work is partly supported by NSF of China (Grants No. 11175252 and 11575189), NSFC-JSPS International Cooperation Program (Grant No. 11711540016), and Presidential Fund of UCAS, and by the U.S. Department of Energy under grant No. DE-SC0013847. The computations in present work have been performed on the High-performance Computing Clusters of SKLTP/ITP-CAS and Tianhe-1A supercomputer located in the Chinese National Supercomputer Center in Tianjin.
\section{Cosmological motivations for high-resolution observation of high-$z$ clusters} Galaxy clusters represent a powerful probe for cosmology. As the largest gravitationally bound objects that the hierarchical structure growth have formed, they enclose information on initial conditions, contents and expansion history of the Universe. Their number as a function of mass and redshift and their spatial distribution are used in complement of other observables of the primordial Universe to constrain the parameters of the standard cosmological model, in which the present-day density is dominated by a cosmological constant $\Lambda$ and the cold dark matter (CDM), as well as any extensions to this base flat $\Lambda$CDM model that impact the growth of structures. Galaxy clusters are efficiently detected via the thermal Sunyaev-Zel'dovich (SZ) effect up to high-redshifts. The thermal SZ effect~\cite{Sunyaev:1972}$^,$~\cite{Sunyaev:1980vz}$^,$~\cite{Birkinshaw:1998qp} is the inverse Compton scattering of the CMB photons on the hot dense ionised gas, the Intra-Cluster Medium (ICM), which accounts for most of the baryonic matter content of the cluster. It has a unique signature on the CMB black-body spectrum, decreasing the CMB intensity at frequencies below $217$~GHz at the benefit of the higher frequencies. As a spectral distortion, the SZ effect is independent of the redshift and thus well-suited for observation of high-redshift clusters. The amplitude of the effect, the Compton parameter $y$, directly depends on the line-of-sight integral of the electronic pressure within the cluster. The Compton parameter is thus a tracer of the pressure within the ICM, which in turn depends on the total mass of the cluster. The relation between the SZ observable and the total mass needs to be calibrated. This can be achieved using total mass measurements obtained from X-ray observations (assuming clusters are in hydrostatic equilibrium), galaxy velocities, caustics, or from weak lensing. CMB experiments such as \emph{Planck}~\cite{Ade:2013skr}$^,$~\cite{Ade:2015gva}, the South Pole Telescope~\cite{Bleem:2014iim} (SPT) or the Atacama Cosmology Telescope~\cite{Hasselfield:2013wf} (ACT) have recently delivered the community with catalogs of about 2000 clusters detected via the thermal SZ effect. In parallel, strong experimental efforts are deployed to reach higher angular resolution for the cluster observation, NIKA2~\cite{Calvo16}$^,$~\cite{NIKA2-Adam}, MUSTANG2~\cite{Mustang2_instru}, ALMA~\cite{alma_sz} amongst others. Cosmological constraints have been derived from the SZ-detected cluster number counts by \emph{Planck}~\cite{Ade:2013lmv}$^,$~\cite{Ade:2015fva}, SPT~\cite{Bleem:2014iim} and ACT~\cite{Hasselfield:2013wf}, as well as from the power spectrum and higher-order statistics within the \emph{Planck} all-sky map of Comptom parameter~\cite{Planckymap}$^,$~\cite{PlancktSZspec}$^,$~\cite{Bolliet2018}. Notably, the \emph{Planck} Collaboration reported a mild tension between the cosmological parameters measured from the CMB primary anisotropies and from the SZ-selected clusters, which is also found using other SZ experiment data (SPT, ACT) or other cluster probes. This can be an evidence of a new physical effect that impacts the growth of structures (e.g. non-minimal neutrino masses, non-unity dark energy equation of state, modified gravity), or this can be an impact of the complex cluster physics on the total mass estimation (deviation from self-similar scenario, non-thermal pressure, redshift evolution, etc.). In particular, in \emph{Planck} study, the pressure profile and mass-observable scaling relation have been calibrated from tSZ and X-rays low-redshift clusters, whereas a redshift evolution effect is not excluded. Thus, accurate cosmology with galaxy clusters and tests for deviations from the standard ($\Lambda$CDM) cosmological model demand a more robust calibration of the mass-observable relation against the redshift and the cluster internal matter distribution. To that aim, high angular resolution observations of high redshift clusters are required. This is one of the main objectives of the NIKA2 experiment.\\ \section{NIKA2 Instrument and Performance} \label{Sect:perf} NIKA2 is a ground-based millimetric experiment installed at the 30-meter telescope of the \emph{Institut de RadioAstronomie Millim\'etrique} (IRAM), situated at Pico Veleta (2800 meters) in the Spanish Sierra Nevada. The NIKA2 Collaboration involves 150 people in 18 institutes (the NIKA2 consortium$\&$IRAM), with scientific objectives that cover large domains of astrophysics and cosmology. \subsection{Instrument} \begin{figure} \centering \includegraphics[width=0.53\textwidth]{Figures/NIKA2_optics.pdf} \includegraphics[trim=2cm 14cm 4cm 4cm, clip=true,width=0.45\textwidth]{Figures/A3_fwhm_color_count.pdf} \caption{Left: Cross-section of the NIKA2 instrument illustrating the cold optics. Right: Footprint of the detector positions in the field of view for one of the 260~GHz arrays, colour-coded as a function of the number of times they met the selection criteria (from red = valid for all selections to green = valid in one selection). These figures are extracted from Adam et al. (2018)$^{9}$. } \label{fig:instru} \end{figure} The NIKA2 instrument consists of a multi-thousand supraconductor detector (Kinetic Inductance Detectors) camera, observing in two frequency bands at 150 and 260 GHz with an angular resolution below 20 arcsec and a large (6.5 arcmin) field of view. After a first light in October 2015, it underwent an extensive commissioning phase including an upgrade in September 2016 and a science verification phase in April 2017. NIKA2 is now open for science operation since October 2017 and will be a resident instrument at the 30-meter telescope of IRAM for the next decade. Its novel technology and instrumental design were sucessfully tested with the NIKA experiment~\cite{Monfardini11}$^,$~\cite{Bourrion12}$^,$~\cite{Calvo13}, which is a NIKA2 pathfinder down-scaled by about a factor ten, operated at the IRAM 30-m telescope as an open instrument during the winter 2014. The light collected by the 30-m telescope primary mirror reaches NIKA2 focal plane through a dedicated warm optics (inside the receiver cabin), which comprizes four mirrors, and a dedicated cold optics (inside the cryostat), which is illustrated in Fig.~\ref{fig:instru}. The light enters the side of the cryostat (about 30~K), is directed toward the coldest part by M7 and M8 mirrors. Within the 150~mK stage, a dichroic splits the beam in two frequency bands, the 150-GHz band in reflection and the 260-GHz band in transmission. The flatness of this 30-cm diameter dichroic submitted to extreme temperature is ensured by the used of a novel air-gap filled technology and a reinforced support. The 260~GHz beam is further splits in two polarisation components by a grid polariser. At 150 and 260~GHz, angular resolutions below $20~\rm{arcsec}$ can be reached given the 30-meter telescope aperture. In order to fully exploit the 30-meter telescope capabilities, that is filling the $6.5~\rm{arcmin}$ field of view without degrading the angular resolution, arrays of thousands detectors are needed at the focal plane. For NIKA2, the choice has been made to use Kinetic Inductance Detectors (KIDs) which offers the required multiplexing capabilities. KIDs are superconducting RLC resonators, operated at 150~mK, well-below their critical temperature. Incoming radiation changes the kinetic-component of the inductance (by Cooper pair breaking), so that the signal varies proportionally with the resonance frequency. Raw data are thus variations of the resonance frequency of each KID. Moreover, KIDs are naturally multiplexable in frequency: they can be connected to a unique feed-line that carries up to 200 frequency tones. NIKA2 comprizes two arrays of 1140 KIDs connected by eight feed-lines in the 260~GHz channel and an array of 616 KIDs connected by four feed-lines at 150~GHz~\cite{Calvo16}$^,$~\cite{NIKA2-Adam}. Each feed-line is monitored a dedicated readout electronic board, as part of the NIKEL electronics~\cite{Bourrion12}. \subsection{Calibration and Performance} \begin{table*}[t] \centering \caption[]{Summary of the principle characteristics and performance of the NIKA2 instrument. \label{sumperf}} \begin{tabular}{|c|c|c|c|c|} \hline & \multicolumn{3}{|c|}{ } & \\ Channel & \multicolumn{3}{|c|}{260 GHz} & 150 GHz \\ & \multicolumn{3}{|c|}{1.15 mm} & 2 mm \\ \hline Arrays & A1 & A3 & A1\&3 & A2 \\ \hline Number of designed detectors & 1140 & 1140 & & 616 \\ Number of valid detectors $^{1}$ & 952 & 961 & & 553 \\ \hline FOV diameter [arcmin] & 6.5 & 6.5 & 6.5 & 6.5 \\ FWHM [arcsec] & $11.3 \pm 0.2$ & $11.2 \pm 0.2$ & $11.2 \pm 0.1$ & $17.7 \pm 0.1$ \\ Beam efficiency $^{2}$ [\% ] & $55 \pm 5$ & $53 \pm 5$ & $60 \pm 6$ & $75 \pm 5$ \\ \hline rms calibration error [\%] & \multicolumn{3}{|c|}{7.5} & 3 \\ \hline Model absolute calibration uncertainty [\%] & \multicolumn{4}{|c|}{5} \\ \hline NEFD $^{3}$ [mJy.s$^{1/2}$] & & & 33$\pm$2 & 8$\pm$1 \\ Mapping speed $^{4}$ [arcmin$^2$/h/mJy$^2$] & & & 67 - 78 & 1288 - 1440 \\ & & & & \\ \hline \multicolumn{5}{l}{ \begin{minipage}{6in} \small{$(1)$ Number of detectors that are valid at least for two different beam map scans. $(2)$ Ratio between the main beam power and the total beam power up to a radius of 250$^{\prime \prime}$. $(3)$ Average NEFD during the February 2017 observation campaign, extrapolated at $\tau = 0$. $(4)$ Average mapping speed during the February 2017 observation campaign, extrapolated at $\tau = 0$.} \end{minipage} } \\ \end{tabular} \end{table*} The first step of any KID-based data analysis consists in the field-of-view (FoV) reconstruction that is, matching the KID frequency tones to positions on the sky. We use deep integration scans of about 20 minutes toward bright point sources, the so-called beam-map scans, to perform individual maps per KID. From these maps, we derive i) KID positions on the FoV, ii) beam properties, iii) detector inter-calibration. Beam-map scans are also used to perform a KID selection from a series of quality criteria. Although all the (2,900) built KID are responsive, some of them are affected by cross-talk or their frequency tuning can be lost during a given scan. In the right panel of Fig.~\ref{fig:instru}, we present the KID positions in the FoV colour-coded as a function of the number of times they met the selection criteria. We find a fraction of valid KIDs, which is defined as the selected detectors in at least two beam-map scans, of $84\%$ at 260~GHz and $90\%$ at 150~GHz. In combining the signal of all selected detectors of an array, we probe the full beam pattern. The main beam is well-modeled by a 2D Gaussian of FWHM of $11.2 \pm 0.1$~arcsec at 260~GHz and of $17.7 \pm 0.1$ at 150~GHz. The beam efficiency, which is evaluated as the ratio of the main beam to the error beam solid angle integrated up to 250 arcmin, is $55\%$ at 260~GHz and $75\%$ at 150~GHz, in agreement with expectations for an instrument without any dedicated optical coupling (no feed horns). Regarding the noise properties, the dominant noise component is the atmospheric fluctuations, which induce strong 1/f noise spectrum. However, this noise is seen by all the detectors while the signal depends on the detector positions in the FoV. Thus atmospheric noise can be decorrelated. After decorrelation, sub-dominant correlated noise residuals from the atmosphere and the electronics are left in the maps, but do not affect the noise scaling down with integration time: we checked that the flux uncertainties reduce as expected as the inverse of the square root of the integration time. The absolute calibration relies on flux density expectation for planets~\cite{Bendo2013}. We check the stability of the photometry using secondary calibrators monitored at Plateau de Bure. We evaluate our calibration uncertainties as the relative rms of the measured-to-expected flux ratio for secondary calibrators including data from three observation campaigns. We found uncertainties of $8\%$ at 260 GHz and $3\%$ at 150 GHz, which improve or match the level of accuracy of other recent ground-based expirements observing in comparable frequency bands (such as SCUBA2~\cite{Dempsey2013}). We primary assess the sensitivity by evaluating the noise equivalent flux density (NEFD), defined as the flux uncertainties obtained at the center of the FoV after one second of integration. This quantity is needed to predict the required observation time to reach a given SNR at the center of the map. We find NEFD extrapolated at zero atmospheric opacity of $33 \pm 2\, \rm{mJy} \cdot \sqrt{s}$ at 260 GHz and $8 \pm 1\, \rm{mJy} \cdot \sqrt{s}$ at 150 GHz. However, we also evaluate the mapping speed, defined as the sky area that is covered in one hour of observation with a SNR of unity, which is a better estimator of the mapping capabilities. We find mapping speeds of $75 \pm 5 \, \rm{arcmin}^2/h/\rm{mJy}^2$ at 260 GHz and $1350 \pm 75 \, \rm{arcmin}^2/h/\rm{mJy}^2$ at 150 GHz. Moreover, we directly verified using observation of Pluto that mJy sources can be detected in less than one hour of integration time. The main characteristics and performance of NIKA2 are summarized in Table 1. NIKA2 has thus demonstrated high sensitivity and state-of-the art mapping capabilities of the diffuse emission. It has two observation channels, the 150 GHz band, for which the thermal SZ is negative, and the 260 GHz band, for which the SZ signal is slightly positive, and a large 6.5~arcmin FoV enclosing the \emph{Planck} satellite beam, while its angular resolution is 17 times better. NIKA2 has thus well-adapted instrumental design and performance for high-resolution SZ observation of intermediate and high redshift clusters. \section{NIKA2 Cosmology program with galaxy clusters and First results} \begin{figure} \centering \includegraphics[width=0.49\textwidth]{Figures/MACSJ0717_kSZ_map.pdf} \hspace{4mm} \includegraphics[width=0.44\textwidth, clip=true, trim=0cm -0.7cm 0cm 0cm]{Figures/LPSZ_M_z_grid.pdf} \caption{Left: Map of the kinetic SZ effect toward \mbox{MACS~J0717.5+3745} using NIKA pathfinder data, as discussed in Adam et al. (2017)$^{31}$. Right: NIKA2 Guaranteed-time cosmology program sample of galaxy clusters} \label{fig:nikanika2} \end{figure} \subsection{NIKA Pathfinder SZ pilot studies} High-resolution SZ mapping capabilities using KID-based experiments have been demonstrated with NIKA, the NIKA2 pathfinder, through a series of pilot studies. The first SZ observation ever obtained with KIDs is the NIKA SZ map of the galaxy cluster RX J1347.5-1145, a well-known massive intermediate redshift galaxy cluster~\cite{Adam:2013ufa}. NIKA also paves the way for NIKA2 SZ analysis, by proposing several novel analysis methods: a multi-probe approach combining X-ray and SZ observations for high-redshift cluster thermodynamics~\cite{Adam:2014wxa}, point source removal~\cite{Adam:2015bba}, a non-parametric method to measure the pressure profile~\cite{Ruppin:2016rnt}$^,$~\cite{Romero:2017xri}, a detection method of substructures in clusters~\cite{Adamsubstruct}. Moreover, breakthrough results have been obtained, including the first map of the gas temperature in galaxy clusters using SZ~\cite{Adam:2017mlj} and the first map of the kinetic SZ in a galaxy cluster~\cite{Adam:2016abn}. The kinetic SZ, which is due to the bulk velocity of the ICM, has a spectral signature on the CMB spectrum that differs from the thermal SZ one. By combining maps observed in different channels, both SZ components can be in principle separated. This has been achieved for the first time by combining NIKA 150 GHz and 260 GHz maps toward a multiple merger cluster the inner substructures of which reach extreme velocities, that is the well-known MACS J0717.5+3745. The NIKA kinetic SZ map toward MACS J0717.5+3745 at $z= 0.55$ is presented in the left panel of Fig.~\ref{fig:nikanika2}. The data set comprizes about 13h of observation using NIKA during Winter 2015 in good weather conditions. This kSZ map was used in combination to X-ray observation from XMM-Newton to derive the first resolved map of the gas velocity under the assumption of a gas model~\cite{Adam:2017mlj}. \subsection{NIKA2 Guaranteed time SZ Large Program} Cosmology with galaxy clusters observed via SZ is a major scientific goal of NIKA2. It is supported by the guaranteed time SZ Large program (LP-SZ), dedicated to the high-resolution mapping of a large sample of high-redshift clusters. The LP-SZ targets a representative sample of 50 galaxy clusters at intermediate and high-redshifts ($0.5 \le z \le 0.9$), selected from the \emph{Planck} and ACT cluster catalogs and complemented with X-ray follow-up using XMM-Newton and Chandra. The distribution of the LP-SZ sample as a fonction of the mass and the redshift is presented in the right panel of Fig.~\ref{fig:nikanika2}. The main objectives of LP-SZ encompass the in-depth study of ICM thermodynamic properties (pressure, density, temperature, mass profiles) and accurate measure of the mass-SZ observable scaling relation. It will be a key program to constrain the redshift evolution of the scaling relation and the pressure profile, as well as for testing the variation of cluster properties with morphology (departure from sphericity) or dynamical state (impact of mergers). This will have important implications for cosmology, such as improving the accuracy of cosmological constraints drawn from SZ-selected clusters. \subsection{First SZ results and perspectives} \begin{figure} \centering \includegraphics[width=0.49\textwidth]{Figures/Paper_NIKA2_Data.pdf} \includegraphics[width=0.49\textwidth]{Figures/Fig_PSZ2_G144_Scaling_relation.pdf} \caption{First SZ results with NIKA2. Left: The NIKA2 SZ map toward the galaxy cluster PSZ2-G0144.83+25.11. The high-resolution (20~arcsec) high-accuracy ($13.5\sigma $ measurement at peak) map covers the cluster from the core to the outskirts and reveals its morphology. An excess SZ signal is observed in the South-West region, indicating an overpressure within the intracluster medium (ICM). Right: Illustration of the impact of the ICM dynamics on the inner scatter of the SZ mass-observable relation. NIKA2 $Y_{500}$ estimates from the analysis with and without masking the over-pressure of PSZ2-G0144.83+25.11 are shown as a function of $M_{500}$, along with the cluster sample and the $Y_{500}-M_{500}$ scaling relation used in \emph{Planck} SZ-selected cluster count based cosmology analysis$^{13}$. These figures are extracted from Ruppin {\it et al.} (2018)$^{34}$. } \label{fig:nika2-sz} \end{figure} We report the first high-resolution thermal SZ mapping of a galaxy cluster with NIKA2~\cite{Ruppin2018}. As part of NIKA2 Science Verification Phase, the chosen target is PSZ2-G0144.83+25.11, a well-know cluster at intermediate redshift ($z=0.58$) and high mass ($M = 7.8 \times 10^{14} M_{\odot}$) from the second \emph{Planck} SZ catalog. The data set consists of 11 hours of integration time on source in poor weather conditions (opacity of 0.3 at 150GHz) during the April 2017 campaign. We obtained a high-resolution ($20$~arcsec) Compton parameter ($y$) map toward PSZ2-G0144.83+25.11 with high-accuracy: we report a $13.5~\sigma$ measurement at peak and a detection up to 1.5 arcmin (about $600~\rm{kpc}$). NIKA2 $y$-map thus well covers this cluster from the core to the outskirts and reveals its morphology, as shown in the left panel of Fig.~\ref{fig:nika2-sz}. Notably, we measure an excess of SZ signal in the South-West region, which indicates an over-pressure within the ICM. Other $y$-maps for this cluster are also available: the BOLOCAM~\cite{Sayers2013} arcminute angular resolution $y$-map that covers the cluster up to the outskirts and the MUSTANG~\cite{Young2014} high-resolution ($9$~arcsec) $y$-map of the center of the cluster, which both complement NIKA2 $y$-map. We combined NIKA2, BOLOCAM and MUSTANG $y$-maps and the integrated SZ signal from \emph{Planck} to measure the electronic pressure profile using a non-parametric deprojection~\cite{Ruppin:2016rnt}. When masking the over-pressure extension of the cluster in the combined $y$-map, we find a pressure profile compatible with the so-called universal pressure profile~\cite{A10}, which is derived from X-ray measurements, but not compatible with the pressure profile derived from the combination of BOLOCAM and MUSTANG (non-masked) $y$-maps~\cite{Young2014}. We report a significant discrepancy between the pressure profiles obtained with or without masking the over-pressure region. This discrepancy has in turn a sizable impact on $R_{500}$, the characteristic radius of the cluster, $Y_{500}$ the integrated Compton parameter up to $R_{500}$ and $M_{500}$, the mass enclosed within $R_{500}$, which are measured integrated quantity used for calibrating the mass-observable scaling law. In the right panel of Fig.~\ref{fig:nika2-sz}, NIKA2 $Y_{500}$ estimates for the cases with and without masking the over-pressure of PSZ2-G0144.83+25.11 are shown as a function of $M_{500}$, and compared to the $Y_{500}-M_{500}$ scaling relation used in \emph{Planck} SZ-selected cluster count based cosmology analysis~\cite{Ade:2015fva}. This illustrates the possible impact of the cluster ICM dynamics on the dispersion of the mass-observable scaling relation, the precise measure of which is required for accurate cosmology with clusters. NIKA2 will be a unique opportunity for a precise measurement of the mass-observable scaling relation for high-redshift clusters. \section*{Acknowledgments} We would like to thank the IRAM staff for their support during the campaigns. The NIKA dilution cryostat has been designed and built at the Institut N\'eel. In particular, we acknowledge the crucial contribution of the Cryogenics Group, and in particular Gregory Garde, Henri Rodenas, Jean Paul Leggeri, Philippe Camus. This work has been partially funded by the Foundation Nanoscience Grenoble, the LabEx FOCUS ANR-11-LABX-0013 and the ANR under the contracts "MKIDS", "NIKA" and ANR-15-CE31-0017. This work has benefited from the support of the European Research Council Advanced Grant ORISTARS under the European Union's Seventh Framework Programme (Grant Agreement no. 291294). We acknowledge fundings from the ENIGMASS French LabEx (R. A. and F. R.), the CNES post-doctoral fellowship program (R. A.), the CNES doctoral fellowship program (A. R.) and the FOCUS French LabEx doctoral fellowship program (A. R.). R.A. acknowledges support from Spanish Ministerio de Econom\'ia and Competitividad (MINECO) through grant number AYA2015-66211-C2-2. \section*{References}
\section{Introduction}\label{introduction} Pattern matching is an important feature of programming languages featuring data abstraction mechanisms. Data abstraction serves users with a simple method for handling data structures that contain plenty of complex information. Using pattern matching, programs using data abstraction become concise, human-readable, and maintainable. Most of the recent practical programming languages allow users to extend data abstraction e.g.\, by defining new types or classes, or by introducing new abstract interfaces. Therefore, a good programming language with pattern matching should allow users to extend its pattern-matching facility akin to the extensibility of data abstraction. Earlier, pattern-matching systems used to assume one-to-one correspondence between patterns and data constructors. However, this assumption became problematic when one handles data types whose data have multiple representations. To overcome this problem, Wadler proposed the pattern-matching system views~\cite{wadler1987views} that broke the symmetry between patterns and data constructors. Views enabled users to pattern-match against data represented in many ways. For example, a complex number may be represented either in polar or Cartesian form, and they are convertible to each other. Using views, one can pattern-match a complex number internally represented in polar form with a pattern written in Cartesian form, and vice versa, provided that mutual transformation functions are properly defined. Similarly, one can use the \texttt{Cons} pattern to perform pattern matching on lists with joins, where a list \texttt{[1,2]} can be either \texttt{(Cons 1 (Cons 2 Nil))} or \texttt{(Join (Cons 1 Nil) (Cons 2 Nil))}, if one defines a normalization function of lists with join into a sequence of \texttt{Cons}. However, views require data types to have a distinguished canonical form among many possible forms. In the case of lists with join, one can pattern-match with \texttt{Cons} because any list with join is canonically reducible to a list with join with the \texttt{Cons} constructor at the head. On the other hand, for any list with join, there is no such canonical form that has \texttt{Join} at the head. For example, the list \texttt{[1,2]} may be decomposed with \texttt{Join} into three pairs: \texttt{[]} and \texttt{[1,2]}, \texttt{[1]} and \texttt{[2]}, and \texttt{[1,2]} and \texttt{[]}. For that reason, views do not support pattern matching of lists with join using the \texttt{Join} pattern. Generally, data types without canonical forms are called \emph{non-free data types}. Mathematically speaking, a non-free data type can be regarded as a quotient on a free data type over an equivalence. An example of non-free data types is, of course, list with join: it may be viewed as a non-free data type composed of a (free) binary tree equipped with an equivalence between trees with the same leaf nodes enumerated from left to right, such as \texttt{(Join Nil (Cons 1 (Cons 2 Nil)))} $=$ \texttt{(Join (Cons 1 Nil) (Cons 2 Nil))}. Other typical examples include sets and multisets, as they are (free) lists with obvious identifications. Generally, as shown for lists with join, pattern matching on non-free data types yields multiple results.\footnote{In fact, this phenomenon that ``pattern matching against a single value yields multiple results'' does not occur for free data types. This is the unique characteristic of non-free data types.} For example, multiset \texttt{\{1,2,3\}} has three decompositions by the \texttt{insert} pattern: \verb|insert(1,{2,3})|, \verb|insert(2,{1,3})|, and \verb|insert(3,{1,2})|. Therefore, how to handle multiple pattern-matching results is an extremely important issue when we design a programming language that supports pattern matching for non-free data types. On the other hand, \emph{pattern guard} is a commonly used technique for filtering such multiple results from pattern matching. Basically, pattern guards are applied after enumerating all pattern-matching results. Therefore, substantial unnecessary enumerations often occur before the application of pattern guards. One simple solution is to break a large pattern into nested patterns to apply pattern guards as early as possible. However, this solution complicates the program and makes it hard to maintain. It is also possible to statically transform the program in the similar manner at the compile time. However, it makes the compiler implementation very complex. \emph{Non-linear pattern} is an alternative method for pattern guard. Non-linear patterns are patterns that allow multiple occurrences of same variables in a pattern. Compared to pattern guards, they are not only syntactically beautiful but also compiler-friendly. Non-linear patterns are easier to analyze and hence can be implemented efficiently (Section~\ref{motivation-non-linear} and~\ref{egison-non-linear}). However, it is not obvious how to extend a non-linear pattern-matching system to allow users to define an algorithm to decompose non-free data types. In this paper, we introduce \emph{extensible pattern matching} to remedy this issue (Section~\ref{motivation-user-defined},~\ref{egison-extensible}, and~\ref{matcher}). Extensibility of pattern matching also enables us to define \emph{predicate patterns}, which are typically implemented as a built-in feature (e.g.\,pattern guards) in most pattern-matching systems. Additionally, we improve the usability of pattern matching for non-free data types by introducing a syntactic generalization for the \texttt{match} expression, called \emph{polymorphic patterns} (Section~\ref{motivation-polymorphism} and~\ref{egison-polymorphism}). We also present a non-linear pattern-matching algorithm specialized for backtracking on infinite search trees and supports pattern matching with infinitely many results in addition to keeping efficiency (Section~\ref{algorithm}). This paper aims to design a programming language that is oriented toward pattern matching for non-free data types. We summarize the above argument in the form of three criteria that must be fulfilled by a language in order to be used in practice: \begin{enumerate} \item Efficiency of the backtracking algorithm for non-linear patterns, \item Extensibility of pattern matching, and \item Polymorphism in patterns. \end{enumerate} We believe that the above requirements, called together \emph{criteria of practical pattern matching}, are fundamental for languages with pattern matching. However, none of the existing languages and studies \cite{viewsWeb,erwig1996active,tullsen2000first,antoy2010functional} fulfill all of them. In the rest of the paper, we present a language which satisfies the criteria, together with comparisons with other languages, several working examples, and formal semantics. We emphasize that our proposal has been already implemented in Haskell as the \emph{Egison} programming language, and is open-sourced~\cite{egison}. Since we set our focus in this paper on the design of the programming language, detailed discussion on the implementation of Egison is left for future work. \section{Related Work}\label{related} In this section, we compare our study with the prior work. First, we review previous studies on pattern matching in functional programming languages. Our proposal can be considered as an extension of these studies. The first non-linear pattern-matching system was the symbol manipulation system proposed by McBride~\cite{mcbride1969symbol}. This system was developed for Lisp. Their paper demonstrates some examples that process symbolic mathematical expressions to show the expressive power of non-linear patterns. However, this approach does not support pattern matching with multiple results, and only supports pattern matching against a list as a collection. Miranda laws~\cite{turner1985miranda,thompson1986laws,thompson1990lawful} and Wadler's views~\cite{wadler1987views,okasaki1998views} are seminal work. These proposals provide methods to decompose data with multiple representations by explicitly declaring transformations between each representation. These are the earliest studies that allow users to customize the execution process of pattern matching. However, the pattern-matching systems in these proposals treat neither multiple pattern matching results nor non-linear patterns. Also, these studies demand a canonical form for each representation. Active patterns~\cite{erwig1996active,syme2007extensible} provides a method to decompose non-free data. In active patterns, users define a \textit{match function} for each pattern to specify how to decompose non-free data. For example, \texttt{insert} for multisets is defined as a match function in \cite{erwig1996active}. An example of pattern matching against graphs using matching function is also shown in \cite{erwig1997functional}. One limitation of active patterns is that it does not support backtracking in the pattern matching process. In active patterns, the values bound to pattern variables are fixed in order from the left to right of a pattern. Therefore, we cannot write non-linear patterns that requires backtracking such as a pattern that matches with a collection (like sets or multisets) that contains two identical elements. (The pattern matching fails if we unfortunately pick an element that appears more than twice at the first choice.) First-class patterns~\cite{tullsen2000first} is a sophisticated system that treats patterns as first-class objects. The essence of this study is a \textit{pattern function} that defines how to decompose data with each data constructor. First-class patterns can deal with pattern matching that generates multiple results. To generate multiple results, a pattern function returns a list. A critical limitation of this proposal is that first-class patterns do not support non-linear pattern matching. Next, we explain the relation with logic programming. We have mentioned that non-linear patterns and backtracking are important features to extend the efficiency and expressive power of pattern matching especially on non-free data types. Unification of logic programming has both features. However, how to integrate non-determinism of logic programming and pattern matching is not obvious~\cite{hanus2007multi}. For example, the pattern-matching facility of Prolog is specialized only for algebraic data types. Functional logic programming~\cite{antoy2010functional} is an approach towards this integration. It allows both of non-linear patterns and multiple pattern-matching results. The key difference between the functional logic programming and our approach is in the method for defining pattern-matching algorithms. In functional logic programming, we describe the pattern-matching algorithm for each pattern in the logic-programming style. A function that describes such an algorithm is called a \emph{pattern constructor}. A pattern constructor takes decomposed values as its arguments and returns the target data. On the other hand, in our proposal, pattern constructors are defined in the functional-programming style: pattern constructors take a target datum as an argument and returns the decomposed values. This enables direct description of algorithms. \section{Motivation}\label{motivation} In this section, we discuss the requirements for programming languages to establish practical pattern matching for non-free data types. \subsection{Pattern Guards vs. Non-linear Patterns}\label{motivation-non-linear} Compared to pattern guards, non-linear patterns are a compiler-friendly method for filtering multiple matching results efficiently. However, non-linear pattern matching is typically implemented by converting them to pattern guards. For example, some implementations of functional logic programming languages convert non-linear patterns to pattern guards \cite{antoy2010programming,antoy2001constructor,hanus2007multi}. This method is inefficient because it leads to enumerating unnecessary candidates. In the following program in Curry, \texttt{seqN} returns \verb|"Matched"| if the argument list has a sequential \texttt{N}-tuple. Otherwise it returns \verb|"Not matched"|. \texttt{insert} is used as a pattern constructor for decomposing data into an element and the rest ignoring the order of elements. \begin{lstlisting}[language=haskell] insert x [] = [x] insert x (y:ys) = x:y:ys ? y:(insert x ys) seq2 (insert x (insert (x+1) _)) = "Matched" seq2 _ = "Not matched" seq3 (insert x (insert (x+1) (insert (x+2) _))) = "Matched" seq3 _ = "Not matched" seq4 (insert x (insert (x+1) (insert (x+2) (insert (x+3) _)))) = "Matched" seq4 _ = "Not matched" seq2 (take 10 (repeat 0)) -- returns "Not matched" in O(n^2) time seq3 (take 10 (repeat 0)) -- returns "Not matched" in O(n^3) time seq4 (take 10 (repeat 0)) -- returns "Not matched" in O(n^4) time \end{lstlisting} When we use a Curry compiler such as PAKCS~\cite{pakcs} and KiCS2~\cite{brassel2011kics2}, we see that ``\verb|seq4 (take n (repeat 0))|'' takes more time than ``\verb|seq3 (take n (repeat 0))|'' because \verb|seq3| is compiled to \verb|seq3'| as follows. Therefore, \verb|seq4| enumerates $\binom{n}{4}$ candidates, whereas \verb|seq3| enumerates $\binom{n}{3}$ candidates before filtering the results. If the program uses non-linear patterns as in \verb|seq3|, we easily find that we can check no sequential triples or quadruples exist simply by checking $\binom{n}{2}$ pairs. However, such information is discarded during the program transformation into pattern guards. \begin{lstlisting} seq3' (insert x (insert y (insert z _))) | y==x+1 && z==x+2 = "Matched" seq3' _ = "Not matched" \end{lstlisting} One way to make this program efficient in Curry is to stop using non-linear patterns and instead use a predicate explicitly in pattern guards. The following illustrates such a program. \begin{lstlisting} isSeq2 (x:y:rs) = y == x+1 isSeq3 (x:rs) = isSeq2 (x:rs) && isSeq2 rs perm [] = [] perm (x:xs) = insert x (perm xs) seq3 xs | isSeq3 ys = "Matched" where ys = perm xs seq3 _ = "Not matched" seq3 (take 10 (repeat 0)) -- returns "Not matched" in O(n^2) time \end{lstlisting} In the program, because of the laziness, only the head part of the list is evaluated. In addition, because of \emph{sharing}~\cite{fischer2009purely}, the common head part of the list is pattern-matched only once. Using this call-by-need-like strategy enables efficient pattern matching on sequential n-tuples. However, this strategy sacrifices readability of programs and makes the program obviously redundant. In this paper, instead, we base our work on non-linear patterns and attempt to improve its usability keeping it compiler-friendly and syntactically clean. \subsection{Extensible Pattern Matching}\label{motivation-user-defined} As a program gets more complicated, data structures involved in the program get complicated as well. A pattern-matching facility for such data structures (e.g.\, graphs and mathematical expressions) should be extensible and customizable by users because it is impractical to provide the data structures for these data types as built-in data types in general-purpose languages. In the studies of computer algebra systems, efficient non-linear pattern-matching algorithms for mathematical expressions that avoid such unnecessary search have already been proposed~\cite{wolframPatternTutorial,krebber2017non}. Generally, users of such computer algebra systems control the pattern-matching method for mathematical expressions by specifying attributes for each operator. For example, the \texttt{Orderless} attribute of the Wolfram language indicates that the order of the arguments of the operator is ignored~\cite{wolframOrderless}. However, the set of attributes available is fixed and cannot be changed~\cite{wolframAttributes}. This means that the pattern-matching algorithms in such computer algebra systems are specialized only for some specific data types such as multisets. However, there are a number of data types we want to pattern-match other than mathematical expressions, like unordered pairs, trees, and graphs. Thus, extensible pattern matching for non-free data types is necessary for handling complicated data types such as mathematical expressions. This paper designs a language that allows users to implement efficient backtracking algorithms for general non-free data types by themselves. It provides users with the equivalent power to adding new attributes freely by themselves. We discuss this topic again in Section~\ref{egison-extensible} \subsection{Monomorphic Patterns vs Polymorphic Patterns}\label{motivation-polymorphism} Polymorphism of patterns is useful for reducing the number of names used as pattern constructors. If patterns are monomorphic, we need to use different names for pattern constructors with similar meanings. As such, monomorphic patterns are error-prone. For example, the pattern constructor that decomposes a collection into an element and the rest ignoring the order of the elements is bound to the name \texttt{insert} in the sample code of Curry \cite{antoy2010programming} as in Section~\ref{motivation-non-linear}. The same pattern constructor's name is \texttt{Add'} in the sample program of Active Patterns \cite{erwig1996active}. However, these can be considered as a generalized \texttt{cons} pattern constructor for lists to multisets, because they are same at the point that both of them are a pattern constructor that decomposes a collection into an element and the rest. Polymorphism is important, especially for value patterns. A value pattern is a pattern that matches when the value in the pattern is equal to the target. It is an important pattern construct for expressing non-linear patterns. If patterns are monomorphic, we need to prepare different notations for value patterns of different data types. For example, we need to have different notations for value patterns for lists and multisets. This is because equivalence of objects as lists and multisets are not equal although both lists and multisets are represented as a list. \begin{lstlisting}[language=egison] pairsAsLists (insert x (insert x _)) = "Matched" pairsAsLists _ = "Not matched" pairsAsMultisets (insert x (insert y _)) | (multisetEq x y) = "Matched" pairsAsMultisets _ = "Not matched" pairsAsLists [[1,2],[2,1]] -- returns "Not matched" pairsAsMultisets [[1,2],[2,1]] -- returns "Matched" \end{lstlisting} \section{Proposal} In this section, we introduce our pattern-matching system, which satisfies all requirements shown in Section~\ref{motivation}. Our language has Scheme-like syntax. It is dynamically typed, and as well as Curry, based on lazy evaluation. \subsection{The \texttt{match-all} and \texttt{match} expressions}\label{egison-expr} We explain the \texttt{match-all} expression. It is a primitive syntax of our language. It supports pattern matching with multiple results. We show a sample program using \texttt{match-all} in the following. In this paper, we show the evaluation result of a program in the comment that follows the program. ``\texttt{;}'' is the inline comment delimiter of the proposed language. \begin{lstlisting}[language=egison] (match-all {1 2 3} (list integer) [<join $xs $ys> [xs ys]]) ; {[{} {1 2 3}] [{1} {2 3}] [{1 2} {3}] [{1 2 3} {}]} \end{lstlisting} Our language uses three kinds of parenthesis in addition to ``\texttt{(}'' and ``\texttt{)}'', which denote function applications. ``\texttt{<}'' and ``\texttt{>}'' are used to apply pattern and data constructors. In our language, the name of a data constructor starts with uppercase, whereas the name of a pattern constructor starts with lowercase. ``\texttt{[}'' and ``\texttt{]}'' are used to build a tuple. ``\verb|{|'' and ``\verb|}|'' are used to denote a \emph{collection}. In our implementation, the collection type is a built-in data type implemented as a lazy 2-3 finger tree~\cite{hinze2006finger}. This reason is that we thought data structures that support a wider range of operations for decomposition are more suitable for our pattern-matching system. (2-3 finger trees support efficient extraction of the last element.) \texttt{match-all} is composed of an expression called \textit{target}, \textit{matcher}, and \textit{match clause}, which consists of a \textit{pattern} and \textit{body expression}. The \texttt{match-all} expression evaluates the body of the match clause for each pattern-matching result and returns a (lazy) collection that contains all results. In the above code, we pattern-match the target \verb|{1 2 3}| as a list of integers using the pattern \texttt{<join \$xs \$ys>}. \texttt{(list integer)} is a matcher to pattern-match the pattern and target as a list of integer. The pattern is constructed using the \texttt{join} pattern constructor. \texttt{\$xs} and \texttt{\$ys} are called \textit{pattern variables}. We can use the result of pattern matching referring to them. A \texttt{match-all} expression first consults the matcher on how to pattern-match the given target and the given pattern. Matchers know how to decompose the target following the given pattern and enumerate the results, and \texttt{match-all} then collects the results returned by the matcher. In the sample program, given a \texttt{join} pattern, \texttt{(list integer)} tries to divide a collection into two collections. The collection \verb|{1 2 3}| is thus divided into two collections by four ways. \texttt{match-all} can handle pattern matching that may yield infinitely many results. For example, the following program extracts all twin primes from the infinite list of prime numbers\footnote{We will explain the meaning of the value pattern \texttt{,(+ p 2)} and the \texttt{cons} pattern constructor in Section~\ref{egison-non-linear} and~\ref{egison-polymorphism}, respectively.}. We will discuss this mechanism in Section~\ref{mechanismInf}. \begin{lstlisting}[language=egison] (define $twin-primes (match-all primes (list integer) [<join _ <cons $p <cons ,(+ p 2) _>>> [p (+ p 2)]])) (take 6 twin-primes) ; {[3 5] [5 7] [11 13] [17 19] [29 31] [41 43]} \end{lstlisting} There is another primitive syntax called \texttt{match} expression. While \texttt{match-all} returns a collection of all matched results, \texttt{match} short-circuits the pattern matching process and immediately returns if any result is found. Another difference from \texttt{match-all} is that it can take multiple match clauses. It tries pattern matching starting from the head of the match clauses, and tries the next clause if it fails. Therefore, \texttt{match} is useful when we write conditional branching. However, \texttt{match} is inessential for our language. It is implementable in terms of the \texttt{match-all} expression and macros. The reason is because the \texttt{match-all} expression is evaluated lazily, and, therefore, we can extract the first pattern-matching result from \texttt{match-all} without calculating other pattern-matching results simply by using \texttt{car}. We can implement \texttt{match} by combining the \texttt{match-all} and \texttt{if} expressions using macros. Furthermore, \texttt{if} is also implementable in terms of the \texttt{match-all} and \texttt{matcher} expression as follows. We will explain the \texttt{matcher} expression in Section~\ref{matcher}. For that reason, we only discuss the \texttt{match-all} expression in the rest of the paper. \begin{lstlisting}[language=egison] (define $if (macro [$b $e1 $e2] (car (match-all b (matcher {[$ something {[<True> {e1}] [<False> {e2}]}]}) [$x x])))) \end{lstlisting} \subsection{Efficient Non-linear Pattern Matching with Backtracking}\label{egison-non-linear} Our language can handle non-linear patterns efficiently. For example, the calculation time of the following code does not depend on the pattern length. Both of the following examples take $O(n^2)$ time to return the result. \begin{lstlisting}[language=egison] (match-all (take n (repeat 0)) (multiset integer) [<insert $x <insert ,(+ x 1) _>> x]) ; returns {} in O(n^2) time (match-all (take n (repeat 0)) (multiset integer) [<insert $x <insert ,(+ x 1) <insert ,(+ x 2) _>>> x]) ; returns {} in O(n^2) time \end{lstlisting} In our proposal, a pattern is examined from left to right in order, and the binding to a pattern variable can be referred to in its right side of the pattern. In the above examples, the pattern variable \texttt{\$x} is bound to any element of the collection since the pattern constructor is \texttt{insert}. After that, the patterns ``\texttt{,(+ x 1)}'' and ``\texttt{,(+ x 2)}'' are examined. A pattern that begins with ``\texttt{,}'' is called a \textit{value pattern}. The expression following ``\texttt{,}'' can be any kind of expressions. The value patterns match with the target data if the target is equal to the content of the pattern. Therefore, after successful pattern matching, \texttt{\$x} is bound to an element that appears multiple times. We can more elaborately discuss the difference of efficiency of non-linear patterns and pattern guards in general cases. The time complexity involved in pattern guards is $O(n^{p+v})$ when the pattern matching fails, whereas the time complexity involved in non-linear patterns is $O(n^{p+min(1,v)})$, where $n$ is the size of the target object\footnote{Here, we suppose that the number of decompositions by each pattern constructor can be approximated by the size of the target object.}, $p$ is the number of pattern variables, and $v$ is the number of value patterns. The difference between $v$ and $min(1,v)$ comes from the mechanism of non-linear pattern matching that backtracks at the first mismatch of the value pattern. \begin{table}[htbp] \begin{tabular}{llll} \begin{tabular}{|l||l|l|l|l|l|} \hline Curry & n=15 & n=25 & n=30 & n=50 & n=100 \\ \hhline{|=#=|=|=|=|=|} \texttt{seq2} & 1.18s & 1.20s & 1.29s & 1.53s & 2.54s \\ \hline \texttt{seq3} & 1.42s & 2.10s & 2.54s & 7.40s & 50.66s \\ \hline \texttt{seq4} & 3.37s & 16.42s & 34.19s & 229.51s & 3667.49s \\ \hline \end{tabular} & & & \begin{tabular}{|l||l|l|l|l|l|} \hline Egison & n=15 & n=25 & n=30 & n=50 & n=100 \\ \hhline{|=#=|=|=|=|=|} \texttt{seq2} & 0.26s & 0.34s & 0.43s & 0.84s & 2.72s \\ \hline \texttt{seq3} & 0.25s & 0.34s & 0.46s & 0.82s & 2.66s \\ \hline \texttt{seq4} & 0.25s & 0.34s & 0.42s & 0.78s & 2.47s \\ \hline \end{tabular} \end{tabular} \caption{Benchmarks of Curry (PAKCS version 2.0.1 and Curry2Prolog(swi 7.6) compiler environment) and Egison (version 3.7.12)} \label{table:benchmark} \end{table} Table~\ref{table:benchmark} shows micro benchmark results of non-linear pattern matching for Curry and Egison. The table shows execution times of the Curry program presented in Section~\ref{motivation-non-linear} and the corresponding Egison program as shown above. The environment we used was Ubuntu on VirtualBox with 2 processors and 8GB memory hosted on MacBook Pro (2017) with 2.3 GHz Intel Core i5 processor. We can see that the execution times in two implementations follow the theoretical computational complexities discussed above. We emphasize that this benchmark results do not mean Curry is slower than Egison. We can write the efficient programs for the same purpose in Curry if we do not persist in using non-linear patterns. Let us also note that the current implementation of Egison is not tuned up and comparing constant times in two implementations is nonsense. Value patterns are not only efficient but also easy to read once we are used to them because it enables us to read patterns in the same order the execution process of pattern matching goes. It also reduces the number of new variables introduced in a pattern. We explain the mechanism how the proposed system executes the above pattern matching efficiently in Section~\ref{algorithm}. \subsection{Polymorphic Patterns}\label{egison-polymorphism} The characteristic of the proposed pattern-matching expression is that they take a matcher. This ingredient allows us to use the same pattern constructors for different data types. For example, one may want to pattern-match a collection \verb|{1 2 3}| sometimes as a list and other times as a multiset or a set. For these three types, we can naturally define similar pattern-matching operations. One example is the \texttt{cons} pattern, which is also called \texttt{insert} in Section~\ref{motivation-non-linear} and \ref{egison-non-linear}. Given a collection, pattern \texttt{<cons \$x \$rs>} divides it into the ``head'' element and the rest. When we use the \texttt{cons} pattern for lists, it either yields the result which is uniquely determined by the constructor, or just fails when the list is empty. On the other hand, for multisets, it non-deterministically chooses an element from the given collection and yields many results. By explicitly specifying which matcher is used in match expressions, we can uniformly write such programs in our language: \begin{lstlisting}[language=egison] (match-all {1 2 3} (list integer) [<cons $x $rs> [x rs]]) ; {[1 {2 3}]} (match-all {1 2 3} (multiset integer) [<cons $x $rs> [x rs]]) ; {[1 {2 3}] [2 {1 3}] [3 {1 2}]} (match-all {1 2 3} (set integer) [<cons $x $rs> [x rs]]) ; {[1 {1 2 3}] [2 {1 2 3}] [3 {1 2 3}]} \end{lstlisting} In the case of lists, the head element \texttt{\$x} is simply bound to the first element of the collection. On the other hand, in the case of multisets or sets, the head element can be any element of the collection because we ignore the order of elements. In the case of lists or multisets, the rest elements \texttt{\$rs} are the collection that is made by removing the ``head'' element from the original collection. However, in the case of sets, the rest elements are the same as the original collection because we ignore the redundant elements. If we interpret a set as a collection that contains infinitely many copies of an each element, this specification of \texttt{cons} for sets is natural. This specification is useful, for example, when we pattern-match a graph as a set of edges and enumerate all paths with some fixed length including cycles without redundancy. Polymorphic patterns are useful especially when we use value patterns. As well as other patterns, the behavior of value patterns is dependent on matchers. For example, an equality \texttt{\{1 2 3\} = \{2 1 3\}} between collections is false if we regard them as mere lists but true if we regard them as multisets. Still, thanks to polymorphism of patterns, we can use the same syntax for both of them. This greatly improves the readability of the program and makes programming with non-free data types easy. \begin{lstlisting}[language=egison] (match-all {1 2 3} (list integer) [,{2 1 3} "Matched"]) ; {} (match-all {1 2 3} (multiset integer) [,{2 1 3} "Matched"]) ; {"Matched"} \end{lstlisting} We can pass matchers to a function because matchers are first-class objects. It enables us to utilize polymorphic patterns for defining function. The following is an example utilizing polymorphism of value patterns. \begin{lstlisting}[language=egison] (define $member?/m (lambda [$m $x $xs] (match xs (list m) {[<join _ <cons ,x _>> #t] [_ #f]}))) \end{lstlisting} \subsection{Extensible Pattern Matching}\label{egison-extensible} In the proposed language, users can describe methods for interpreting patterns in the definition of matchers. Matchers appeared up to here are defined in our language. We show an example of a matcher definition. We will explain the details of this definition in Section~\ref{unordered-pair}. \begin{lstlisting}[language=egison] (define $unordered-pair (lambda [$a] (matcher {[<pair $ $> [a a] {[<Pair $x $y> {[x y] [y x]}]}] [$ [something] {[$tgt {tgt}]}]}))) \end{lstlisting} An \emph{unordered pair} is a pair ignoring the order of the elements. For example, \texttt{<Pair 2 5>} is equivalent to \texttt{<Pair 5 2>}, if we regard them as unordered pairs. Therefore, datum \texttt{<Pair 2 5>} is successfully pattern-matched with pattern \texttt{<pair ,5 \$x>}. \begin{lstlisting}[language=egison] (match-all <Pair 2 5> (unordered-pair integer) [<pair ,5 $x> x]) ; {2} \end{lstlisting} We can define matchers for more complicated data types. For example, Egi constructed a matcher for mathematical expressions for building a computer algebra system on our language~\cite{egisonMath,egi2017scalar,egi2018scalar}. His computer algebra system is implemented as an application of the proposed pattern-matching system. The matcher for mathematical expressions is used for implementing simplification algorithms of mathematical expressions. A program that converts a mathematical expression object $n\cos^2(\theta) + n\sin^2(\theta)$ to $n$ can be implemented as follows. (Here, we introduced the \texttt{math-expr} matcher and some syntactic sugar for patterns.) \begin{lstlisting}[language=egison] (define $rewrite-rule-for-cos-and-sin-poly (lambda [$poly] (match poly math-expr {[<+ <* $n <,cos $x>^,2 $y> <* ,n <,sin ,x>^,2 ,y> $r> (rewrite-rule-for-cos-and-sin-poly <+' r <*' n y>>)] [_ poly]}))) \end{lstlisting} \section{Algorithm}\label{algorithm} This section explains the pattern-matching algorithm of the proposed system. The formal definition of the algorithm is given in Section~\ref{formal-semantics}. The method for defining matchers explained in Section~\ref{matcher} is deeply related to the algorithm. \subsection{Execution Process of Non-linear Pattern Matching} Let us show what happens when the system evaluates the following pattern-matching expression. \begin{lstlisting}[language=egison] (match-all {2 8 2} (multiset integer) [<cons $m <cons ,m _>> m]) ; {2 2} \end{lstlisting} Figure~\ref{fig:reductionPath} shows one of the execution paths that reaches a matching result. First, the initial \emph{matching state} is generated (step 1). A matching state is a datum that represents an intermediate state of pattern matching. A matching state is a compound type consisting of a stack of \emph{matching atoms}, an environment, and intermediate results of the pattern matching. A matching atom is a tuple of a pattern, a matcher, and an expression called \emph{target}. \texttt{MState} denotes the data constructor for matching states. \texttt{env} is the environment when the evaluation enters the \texttt{match-all} expression. A stack of matching atoms contains a single matching atom whose pattern, target and matcher are the arguments of the \texttt{match-all} expression. \begin{figure}[t] \centering \begin{tabular}{m{0.3cm} m{11.8cm}}\ 1 & {\footnotesize \begin{verbatim}MState {[<cons $m <cons ,m _>> (multiset integer) {2 8 2}]} env {}\end{verbatim}} \\[-0.7cm] \\\hline \\[-0.7cm] 2 & {\footnotesize \begin{verbatim} MState {[$m integer 2] [<cons ,m _> (multiset integer) {8 2}]} env {} MState {[$m integer 8] [<cons ,m _> (multiset integer) {2 2}]} env {} MState {[$m integer 2] [<cons ,m _> (multiset integer) {2 8}]} env {} \end{verbatim}} \\[-0.7cm] \\\hline \\[-0.7cm] 3 & {\footnotesize \begin{verbatim} MState {[$m something 2] [<cons ,m _> (multiset integer) {8 2}]} env {} \end{verbatim}} \\[-0.7cm] \\\hline \\[-0.7cm] 4 & {\footnotesize \begin{verbatim} MState {[<cons ,m _> (multiset integer) {8 2}]} env {[m 2]} \end{verbatim}} \\[-0.7cm] \\\hline \\[-0.7cm] 5 & {\footnotesize \begin{verbatim} MState {[,m integer 8] [_ (multiset integer) {2}]} env {[m 2]} MState {[,m integer 2] [_ (multiset integer) {8}]} env {[m 2]} \end{verbatim}} \\[-0.7cm] \\\hline \\[-0.7cm] 6 & {\footnotesize \begin{verbatim} MState {[_ (multiset integer) {8}]} env {[m 2]} \end{verbatim}} \\[-0.7cm] \\\hline \\[-0.7cm] 7 & {\footnotesize \begin{verbatim} MState {[_ something {8}]} env {[m 2]} \end{verbatim}} \\[-0.7cm] \\\hline \\[-0.7cm] 8 & {\footnotesize \begin{verbatim} MState {} env {[m 2]} \end{verbatim}} \end{tabular} \caption{Reduction path of matching states} \label{fig:reductionPath} \end{figure} In our proposal, pattern matching is implemented as reductions of matching states. In a reduction step, the top matching atom in the stack of matching atoms is popped out. This matching atom is passed to the procedure called \emph{matching function}. The matching function is a function that takes a matching atom and returns a list of lists of matching atoms. The behavior of the matching function is controlled by the matcher of the argument matching atom. We can control the behavior of the matching function by defining matchers properly. For example, we obtain the following results by passing the matching atom of the initial matching state to the matching function. \begin{lstlisting}[language=egison] matchFunction [<cons $m <cons ,m _>> (multiset integer) {2 8 2}] = { {[$m integer 2] [<cons ,m _> (multiset integer) {8 2}]} {[$m integer 8] [<cons ,m _> (multiset integer) {2 2}]} {[$m integer 2] [<cons ,m _> (multiset integer) {2 8}]} } \end{lstlisting} \noindent Each list of matching atoms is prepended to the stack of the matching atoms. As a result, the number of matching states increases to three (step 2). Our pattern-matching system repeats this step until all the matching states vanish. For simplicity, in the following, we only examine the reduction of the first matching state in step 2. This matching state is reduced to the matching state shown in step 3. The matcher in the top matching atom in the stack is changed to \texttt{something} from \texttt{integer}, by definition of \texttt{integer} matcher. \texttt{something} is the only built-in matcher of our pattern-matching system. \texttt{something} can handle only wildcards or pattern variables, and is used to bind a value to a pattern variable. This matching state is then reduced to the matching state shown in step 4. The top matching atom in the stack is popped out, and a new binding \texttt{[m 2]} is added to the collection of intermediate results. Only \texttt{something} can append a new binding to the result of pattern matching. Similarly to the preceding steps, the matching state is then reduced as shown in step 5, and the number of matching states increases to 2. ``\texttt{,m}'' is pattern-matched with \texttt{8} and \texttt{2} by \texttt{integer} matcher in the next step. When we pattern-match with a value pattern, the intermediate results of the pattern matching is used as an environment to evaluate it. In this way, ``\texttt{m}'' is evaluated to \texttt{2}. Therefore, the first matching state fails to pattern-match and vanishes. The second matching state succeeds in pattern matching and is reduced to the matching state shown in step 6. In step 7, the matcher is simply converted from \texttt{(multiset integer)} to \texttt{something}, by definition of \texttt{(multiset integer)}. Finally, the matching state is reduced to the empty collection (step 8). No new binding is added because the pattern is a wildcard. When the stack of matching atoms is empty, reduction finishes and the matching patching succeeds for this reduction path. The matching result \verb|{[m 2]}| is added to the entire result of pattern matching. We can check the pattern matching for sequential triples and quadruples are also efficiently executed in this algorithm. \subsection{Pattern Matching with Infinitely Many Results}\label{mechanismInf} The proposed pattern-matching system can eventually enumerate all successful matching results when matching results are infinitely many. It is performed by reducing the matching states in a proper order. Suppose the following program: \begin{lstlisting}[language=egison] (take 8 (match-all nats (set integer) [<cons $m <cons $n _>> [m n]])) ; {[1 1] [1 2] [2 1] [1 3] [2 2] [3 1] [1 4] [2 3]} \end{lstlisting} \noindent Figure~\ref{fig:reduction-tree-1} shows the search tree of matching states when the system executes the above pattern matching expression. Rectangles represent matching states, and circles represent final matching states of successful pattern matching. The rectangle at the upper left is the initial matching state. The rectangles in the second row are the matching states generated from the initial matching state one step. Circles o8, r9, and s9 correspond to pattern-matching results \verb|{[m 1] [n 1]}|, \verb|{[m 1] [n 2]}|, and \verb|{[m 2] [n 1]}|, respectively. One issue on naively searching this search tree is that we cannot enumerate all matching states either in depth-first or breadth-first manners. The reason is that widths and depths of the search tree can be infinite. Widths can be infinite because a matching state may generate infinitely many matching states (e.g., the width of the second row is infinite), and depths can be infinite when we extend the language with a notion such as recursively defined patterns~\cite{egi2014non}. To resolve this issue, we reshape the search tree into a \emph{reduction tree} as presented in Figure~\ref{fig:reduction-tree-2}. A node of a reduction tree is a list of matching states, and a node has at most two child nodes, left of which is the matching states generated from the head matching state of the parent, and right of which is a copy of the tail part of the parent matching states. At each reduction step, the system has a list of nodes. Each row in Figure~\ref{fig:reduction-tree-2} denotes such a list. One reduction step in our system proceeds in the following two steps. First, for each node, it generates a node from the head matching state. Then, it constructs the nodes for the next step by collecting the generated nodes and the copies of the tail parts of the nodes. The index of each node denotes the depth in the tree the node is checked at. Since widths of the tree are at most $2^n$ for some $n$ at any depth, all nodes can be assigned some finite number, which means all nodes in the tree are eventually checked after a finite number of reduction steps. \begin{figure}[t] \begin{tabular}{cc} \begin{minipage}[t]{0.45\hsize} \centering \includegraphics[width=4.2cm]{reduction-tree-1.png} \caption{Search tree} \label{fig:reduction-tree-1} \end{minipage} & \begin{minipage}[t]{0.45\hsize} \centering \includegraphics[width=6.5cm]{reduction-tree-2.png} \caption{Binary reduction tree} \label{fig:reduction-tree-2} \end{minipage} \end{tabular} \end{figure} We adopt breadth-first search strategy as the default traverse method because there are cases that breadth-first traverse can successfully enumerate all pattern-matching results while depth-first traverse fails to do so when we handle pattern matching with infinitely many results. However, of course, when the size of the reduction tree is finite, the space complexity for depth-first traverse is less expensive. Furthermore, there are cases that the time complexity for depth-first traverse is also less expensive when we extract only the first several successful matches. Therefore, to extend the range of algorithms we can express concisely with pattern matching keeping efficiency, providing users with a method for switching search strategy of reduction trees is important. We leave further investigation of this direction as as interesting future work. \section{User Defined Matchers}\label{matcher} This section explains how to define matchers. \subsection{Matcher for Unordered Pairs}\label{unordered-pair} We explain how the \texttt{unordered-pair} matcher shown in Section~\ref{egison-extensible} works. \texttt{unordered-pair} is defined as a function that takes and returns a matcher to specify how to pattern-match against the elements of a pair. \texttt{matcher} takes matcher clauses. A matcher clause is a triple of a primitive-pattern pattern, next-matcher expressions, and primitive-data-match clauses. The formal syntax of the \texttt{matcher} expression is found in Figure~\ref{fig:syntax} in Section~\ref{formal-semantics}. \texttt{unordered-pair} has two matcher clauses. The primitive-pattern pattern of the first matcher clause is \verb|<pair $ $>|. This matcher clause defines the interpretation of \texttt{pair} pattern. \texttt{pair} takes two pattern holes \verb|$|. It means that it interprets the first and second arguments of \texttt{pair} pattern by the matchers specified by the next-matcher expression. In this example, since the next-matcher expression is \verb|[a a]|, both of the arguments of \texttt{pair} are pattern-matched using the matcher given by \verb|a|. The primitive-data-match clause of the first matcher clause is \verb|{[<Pair $x $y> {[x y] [y x]}]}|. \texttt{<Pair \$x \$y>} is pattern-matched with the target datum such as \texttt{<Pair 2 5>}, and \texttt{\$x} and \texttt{\$y} is matched with \texttt{2} and \texttt{5}, respectively. The primitive-data-match clause returns \verb|{[2 5] [5 2]}|. A primitive-data-match clause returns a collection of \textit{next-targets}. This means the patterns ``\texttt{,5}'' and \texttt{\$x} are matched with the targets \texttt{2} and \texttt{5}, or \texttt{5} and \texttt{2} using the \texttt{integer} matcher in the next step, respectively. Pattern matching of primitive-data-patterns is similar to pattern matching against algebraic data types in ordinary functional programming languages. As a result, the first matcher clause works in the matching function as follows. \begin{lstlisting}[language=egison] matchFunction [<pair $x $y> (unordered-pair integer) <Pair 2 5>] = { {[$x integer 2] [$y integer 5]} {[$x integer 5] [$y integer 2]} } \end{lstlisting} The second matcher clause is rather simple; this matcher clause simply converts the matcher of the matching atom to the \verb|something| matcher. \subsection{Case Study: Matcher for Multisets}\label{multiset-matcher} As an example of how we can implement matchers for user-defined non-free data types, we show the definition of \texttt{multiset} matcher. We can define it simply by using the \texttt{list} matcher. \texttt{multiset} is defined as a function that takes and returns a matcher. \begin{lstlisting}[language=egison] (define $multiset (lambda [$a] (matcher {[<nil> [] {[{} {[]}] [_ {}]}] [<cons $ $> [a (multiset a)] {[$tgt (match-all tgt (list a) [<join $hs <cons $x $ts>> [x (append hs ts)]])]}] [,$val [] {[$tgt (match [val tgt] [(list a) (multiset a)] {[[<nil> <nil>] {[]}] [[<cons $x $xs> <cons ,x ,xs>] {[]}] [[_ _] {}]})]}] [$ [something] {[$tgt {tgt}]}]}))) \end{lstlisting} The \texttt{multiset} matcher has four matcher clauses. The first matcher clause handles the \texttt{nil} pattern, and it checks if the target is an empty collection. The second matcher clause handles the \texttt{cons} pattern. The \texttt{match-all} expression is effectively used to destruct a collection in the primitive-data-match clause. Because the \texttt{join} pattern in the \texttt{list} matcher enumerates all possible splitting pairs of the given list, \texttt{match-all} lists up all possible consing pairs of the target expression. The third matcher clause handles value patterns. ``\verb|,$val|'' is a value-pattern pattern that matches with a value pattern. This matcher clause checks if the content of a value pattern (bound to \texttt{val}) is equal to the target (bound to \texttt{tgt}) as multisets. Note that the definition involves recursions on the \texttt{multiset} matcher itself. The fourth matcher clause is completely identical to \texttt{unordered-pair} and \texttt{integer}. \subsection{Value-pattern Patterns and Predicate Patterns}\label{integer} We explain the generality of our extensible pattern-matching framework taking examples from the \texttt{integer} matcher. How to implement value patterns and predicate patterns in our language is shown. \begin{lstlisting}[language=egison] (define $integer (matcher {[,$n [] {[$tgt (if (eq? tgt n) {[]} {})]}] [<lt ,$n> [] {[$tgt (if (lt? tgt n) {[]} {})]}] [$ [something] {[$tgt {tgt}]}]})) \end{lstlisting} Value patterns are patterns that successfully match if the target expression is equal to some fixed value. For example, \verb|,5| only matches with \verb|5| if we use \texttt{integer} matcher. The first matcher clause in the above definition exists to implement this. The primitive-pattern pattern of this clause is \verb|,$n|, which is a value-pattern pattern that matches with value patterns. The next-matcher expression is an empty tuple because no pattern hole \verb|$| is contained. If the target expression \texttt{tgt} and the content of the value pattern \texttt{n} are equal, the primitive-data-match clause returns a collection consisting of an empty tuple, which denotes success. Otherwise, it returns an empty collection, which denotes failure. Predicate patterns are patterns that succeed if the target expression satisfies some fixed predicate. Predicate patterns are usually implemented as a built-in feature, such as pattern guards, in ordinary programming languages. Interestingly, we can implement this on top of our pattern-matching framework. The second matcher clause defines a predicate pattern which succeeds if the target integer is less than the content of the value pattern \verb|n|. A technique similar to the first clause is used. \section{Formal Semantics}\label{formal-semantics} \begin{figure}[!t] \scriptsize \begin{multicols}{2} \noindent \begin{align*} M &::= x \mid c \mid \texttt{(lambda [\$$x$ $\cdots$] $M$)} \mid \texttt{($M$ $M$ $\cdots$)} \\ &\mid [M \cdots] \mid \{M \cdots\} \mid \texttt{<$C$ $M$ $\cdots$>} \\ &\mid \texttt{(match-all $M$ $M$ [$p$ $M$])} \\ &\mid \texttt{(match $M$ $M$ \{[$p$ $M$] $\cdots$\})} \\ &\mid \texttt{something} \mid \texttt{(matcher \{$\phi$ $\cdots$\})} \end{align*} \columnbreak \begin{align*} p &::= \texttt{_} \mid \texttt{\$$x$} \mid \texttt{,$M$} \mid \texttt{<$C$ $p$ $\cdots$>} \\ \phi &::= \texttt{[$pp$ $M$ \{[$dp$ $M$] $\cdots$\}]} \\ pp &::= \texttt{\$} \mid \texttt{,\$$x$} \mid \texttt{<$C$ $pp$ $\cdots$>} \\ dp &::= \texttt{\$$x$} \mid \texttt{<$C$ $dp$ $\cdots$>} \end{align*} \end{multicols} \caption{Syntax of our language} \label{fig:syntax} \end{figure} In this section, we present the syntax and big-step semantics of our language (Fig.~\ref{fig:syntax} and~\ref{fig:formal-semantics}). We use metavariables $x,y,z,\ldots$, $M,N,L,\ldots$, $v,\ldots$, and $p,\ldots$ for variables, expressions, values, and patterns respectively. In Fig.~\ref{fig:syntax}, $c$ denotes a constant expression and $C$ denotes a data constructor name. $X \cdots$ in Fig.~\ref{fig:syntax} means a finite list of $X$. The syntax of our language is similar to that of the Lisp language. As explained in Section~\ref{egison-expr}, \texttt{[$M$ $\cdots$]}, \texttt{\{$M$ $\cdots$\}}, and \texttt{<$C$ $M$ $\cdots$>} denote tuples, collections, and data constructions. All formal arguments are decorated with the dollar mark. $\phi$, $pp$ and $dp$ are called matcher clauses, primitive-pattern patterns and primitive-data patterns respectively. \begin{figure}[!t] \scriptsize \begin{gather*} \intertext{Evaluation of \texttt{matcher} and \texttt{match-all}:} \AXC{} \UIC{$\ev{\Gamma}{\texttt{(matcher $\texttt{[$pp_i$ $M_i$ $\texttt{[$dp_{ij}$ $N_{ij}$]}_j$]}_i$)}} ([pp_i, M_i, [dp_{ij}, N_{ij}]_j]_i,\Gamma)$} \DP \\ \AXC{$\ev{\Gamma}{M} v$} \AXC{$\ev{\Gamma}{N} m$} \AXC{$[[[\matom{p}{m}{v}],\Gamma,\emptyset]] \Rrightarrow [\Delta_i]_i $} \AXC{$\ev{\Gamma \cup \Delta_i}{L} v_i \quad (\forall i)$} \QIC{$\ev{\Gamma}{\texttt{(match-all $M$ $N$ [$p$ $L$])}} [v_i]_i$} \DP \intertext{Matching states:} \AXC{} \UIC{$\epsilon \rightarrow \mathord{\texttt{none}}, \mathord{\texttt{none}}, \mathord{\texttt{none}}$} \DP \quad \AXC{} \UIC{$(\epsilon, \Gamma, \Delta):\vec{s} \rightarrow (\mathop{\texttt{some}} \Delta), \mathord{\texttt{none}}, (\mathop{\texttt{some}} \vec{s})$} \DP \\ \AXC{$\mfun{p}{\Gamma \cup \Delta}{m}{v} [\vec{a}_i]_i, \Delta'$} \UIC{$((\matom{p}{m}{v}) : \vec{a}, \Gamma, \Delta):\vec{s} \rightarrow \mathord{\texttt{none}}, (\mathop{\texttt{some}} [\vec{a}_i + \vec{a}, \Gamma, \Delta \cup \Delta']_i), (\mathop{\texttt{some}} \vec{s})$} \DP \\ \AXC{$\vec{s}_i \rightarrow \mathop{\texttt{opt}} \Gamma_i, \mathop{\texttt{opt}} \vec{s'}_i, \mathop{\texttt{opt}} \vec{s''}_i \quad (\forall i)$} \UIC{$[\vec{s}_i]_i \Rightarrow \sum_i (\mathop{\texttt{opt}} \Gamma_i), \sum_i (\mathop{\texttt{opt}} \vec{s'}_i) + \sum_i (\mathop{\texttt{opt}} \vec{s''}_i)$} \DP \qquad \AXC{$\mathstrut$} \UIC{$\epsilon \Rrightarrow \epsilon$} \DP \quad \AXC{$\vec{\vec{s}} \Rightarrow \vec{\Gamma}, \vec{\vec{s'}}$} \AXC{$\vec{\vec{s'}} \Rrightarrow \vec{\Delta}$} \BIC{$\vec{\vec{s}} \Rrightarrow \vec{\Gamma} + \vec{\Delta}$} \DP \intertext{Matching atoms:} \AXC{$\mathstrut$} \UIC{$\mfun{\texttt{\$x}}{\Gamma}{\texttt{something}}{v} [\epsilon], \set{x \mapsto v}$} \DP \quad \AXC{$\ppm{pp}{\Gamma}{p} \textbf{fail}$} \AXC{$\mfun{p}{\Gamma}{(\vec{\phi},\Delta)}{v} \vec{\vec{a}}, \Gamma'$} \BIC{$\mfun{p}{\Gamma}{((pp,M,\vec{\sigma}) : \vec{\phi},\Delta)}{v} \vec{\vec{a}}, \Gamma'$} \DP \\ \AXC{$\ppm{pp}{\Gamma}{p} [p'_i]_i, \Delta'$} \AXC{$\pdm{dp}{v} \textbf{fail}$} \AXC{$\mfun{p}{\Gamma}{((pp,M,\vec{\sigma}) : \vec{\phi},\Delta)}{v} \vec{\vec{a}}, \Gamma'$} \TIC{$\mfun{p}{\Gamma}{((pp,M,(dp,N) : \vec{\sigma}) : \vec{\phi},\Delta)}{v} \vec{\vec{a}}, \Gamma'$} \DP \\ \AXC{$\ppm{pp}{\Gamma}{p} [p'_j]_j, \Delta'$} \AXC{$\pdm{dp}{v} \Delta''$} \AXC{$\ev{\Delta \cup \Delta' \cup \Delta''}{N} [[v'_{ij}]_j]_i$} \AXC{$\ev{\Delta}{M} [m'_j]_j$} \QIC{$\mfun{p}{\Gamma}{((pp,M,(dp,N) : \vec{\sigma}) : \vec{\phi},\Delta)}{v} [[\matom{p'_j}{m'_j}{v'_{ij}}]_j]_i, \emptyset$} \DP \intertext{Pattern matching on patterns:} \AXC{$\mathstrut$} \UIC{$\ppm{\texttt{\$}}{\Gamma}{p} [p], \emptyset$} \DP \quad \AXC{$\ev{\Gamma}{M} v$} \UIC{$\ppm{\texttt{,\$y}}{\Gamma}{\texttt{,$M$}} \epsilon, \set{y \mapsto v}$} \DP \quad \AXC{$\ppm{pp_i}{\Gamma}{p_i} \vec{p}_i, \Gamma_i \quad (\forall i)$} \UIC{$\ppm{\texttt{<C $pp_1 \ldots pp_n$>}}{\Gamma}{\texttt{<C $p_1 \ldots p_n$>}} \sum_i \vec{p}_i, \bigcup_i \Gamma_i$} \DP \intertext{Pattern matching on data:} \AXC{$\mathstrut$} \UIC{$\pdm{\texttt{\$z}}{v} \set{z \mapsto v}$} \DP \qquad \AXC{$\pdm{dp_i}{v_i} \Gamma_i \quad (\forall i)$} \UIC{$\pdm{\texttt{<C $dp_1 \ldots dp_n$>}}{\texttt{<C $v_1 \ldots v_n$>}} \bigcup_i \Gamma_i$} \DP \end{gather*} \caption{Formal semantics of our language} \label{fig:formal-semantics} \end{figure} In Fig.~\ref{fig:formal-semantics}, the following notations are used. We write $[a_i]_i$ to mean a list $[a_1, a_2, \ldots]$. Similarly, $[[a_{ij}]_j]_i$ denotes $[[a_{11},a_{12},\ldots],[a_{21},a_{22},\ldots],\ldots]$, but each list in the list may have different length. List of tuples $[(a_1,b_1),(a_2,b_2),\ldots]$ may be often written as $[a_i,b_i]_i$ instead of $[(a_i,b_i)]_i$ for short. Concatenation of lists $l_1,l_2$ are denoted by $l_1 + l_2$, and $a : l$ denotes $[a] + l$ (adding at the front). $\epsilon$ denotes the empty list. In general, $\vec{x}$ for some metavariable $x$ is a metavariable denoting a list of what $x$ denotes. However, we do \emph{not} mean by $\vec{x}_i$ the $i$-th element of $\vec{x}$; if we write $[\vec{x}_i]_i$, we mean a list of a list of $x$. $\Gamma, \Delta, \ldots$ denote variable assignments, i.e., partial functions from variables to values. Our language has some special primitive types: matching atoms $a, \ldots$, matching states $s,\ldots$, primitive-data-match clauses $\sigma, \ldots$, and matchers $m,\ldots$. A matching atom consists of a pattern $p$, a matcher $m$, and a value $v$, and written as $\matom{p}{m}{v}$. A matching state is a tuple of a list of matching atoms and two variable assignments. A primitive-data-match clause is a tuple of a primitive-data pattern and an expression, and a matcher clause is a tuple of a primitive-pattern pattern, an expression, and a list of data-pattern clauses. A matcher is a pair containing a list of matcher clauses and a variable assignment. Note that matchers, matching states, etc.\, are all values. Evaluation results of expressions are specified by the judgment $\ev{\Gamma}{e} \vec{v}$, which denotes given a variable assignment $\Gamma$ and an expression $e$ one gets a list of values $\vec{v}$. In the figure, we only show the definition of evaluation of \texttt{matcher} and \texttt{match-all} expressions (other cases are inductively defined as usual). The definition of \texttt{match-all} relies on another type of judgment $\vec{\vec{s}} \Rrightarrow \vec{\Gamma}$, which defines how the search space is examined. $\Rrightarrow$ is inductively defined using $\vec{\vec{s}} \Rightarrow \vec{\Gamma}, \vec{\vec{s'}}$, which is again defined using $\vec{s} \rightarrow \mathop{\texttt{opt}} \Gamma, \mathop{\texttt{opt}} \vec{s'}, \mathop{\texttt{opt}} \vec{s''}$. In their definitions, we introduced notations for (meta-level) option types. $\mathord{\texttt{none}}$ and $\mathop{\texttt{some}}{x}$ are the constructors of the option type, and $\mathop{\texttt{opt}} x$ is a metavariable for an optional value (possibly) containing what the metavariable $x$ denotes. $\sum_i (\mathop{\texttt{opt}} x_i)$ creates a list by collecting all the valid (non-$\mathord{\texttt{none}}$) $x_i$ preserving the order. $\mfun{p}{\Gamma}{m}{v} \vec{\vec{a}},\Delta$ is a 6-ary relation. One reads it ``performing pattern matching on $v$ against $p$ using the matcher $m$ under the variable assignment $\Gamma$ yields the result $\Delta$ and continuation $\vec{\vec{a}}$.'' The result is a variable assignment because it is a result of unifications. $\vec{\vec{a}}$ being empty means the pattern matching failed. If $[\epsilon]$ is returned as $\vec{\vec{a}}$, it means the pattern matching succeeded and no further search is necessary. As explained in Section~\ref{matcher}, one needs to pattern-match patterns and data to define user-defined matchers. Their formal definitions are given by judgments $\ppm{pp}{\Gamma}{p} \vec{p'}, \Delta$ and $\pdm{dp}{v} \Gamma$. \section{Conclusion}\label{conclusion} We designed a user-customizable efficient non-linear pattern-matching system by regarding pattern matching as reduction of matching states that have a stack of matching atoms and intermediate results of pattern matching. This system enables us to concisely describe a wide range of programs, especially when non-free data types are involved. For example, our pattern matching architecture is useful to implement a computer algebra system because it enables us to directly pattern-match mathematical expressions and rewrite them. The major significance of our pattern matching system is that it greatly improves the expressivity of the programming language by allowing programmers to freely extend the process of pattern matching by themselves. Furthermore, in the general cases, use of the \texttt{match} expression will be as readable as that in other general-purpose programming languages. Although we consider that the current syntax of matcher definition is already clean enough, we leave further refinement of the syntax of our surface language as future work. We believe the direct and concise representation of algorithms enables us to implement really new things that go beyond what was considered practical before. We hope our work will lead to breakthroughs in various fields. \section*{Acknowledgments} We thank Ryo Tanaka, Takahisa Watanabe, Kentaro Honda, Takuya Kuwahara, Mayuko Kori, and Akira Kawata for their important contributions to implement the interpreter. We thank Michal J. Gajda, Yi Dai, Hiromi Hirano, Kimio Kuramitsu, and Pierre Imai for their helpful feedback on the earlier versions of the paper. We thank Masami Hagiya, Yoshihiko Kakutani, Yoichi Hirai, Ibuki Kawamata, Takahiro Kubota, Takasuke Nakamura, Yasunori Harada, Ikuo Takeuchi, Yukihiro Matsumoto, Hidehiko Masuhara, and Yasuhiro Yamada for constructive discussion and their continuing encouragement. \bibliographystyle{splncs04}
\section{Introduction} Identification of the discount factor in dynamic discrete choice models is crucial for their application to the evaluation of agents' responses to dynamic interventions. It is, however, well known that the discount factor is not identified from choice data without further restrictions (\citealp{nh94:rust}, Lemma 3.3, and \citealp{ecta02:magnacthesmar}, Proposition 2). Consequently, empirical researchers usually fix the discount factor at some a priori plausible value, e.g. 0.95, or impose ad hoc functional form assumptions that allow it to be identified and estimated. These approaches solve the identification problem, but often lack economic justification. Inferring the time preferences in the specific context of an application is important as discount factors have been estimated to vary substantially across choice contexts and populations \citep{fredericketal02}.\footnote{\citeauthor{fredericketal02} also showed that geometric discounting is often rejected in data in favor of present biased time preferences. We study the identification and estimation of hyperbolic discount functions in \cite{abbringdaljordiskhakov18}.} In this paper, we explore identification from observed choice responses to variation that shifts expected discounted future utilities, but not current utilities. Such variation is commonly cited in applications as an intuitive source of information on time preferences. For example, in studies of green technology adoption, \cite{bollinger15} and \cite{aer19:degrooteverboven} argued that firms' and households' current choice responses to regulation that shifts their future expenses, but not their current expenses, are informative about discount factors. In a study of demand for game consoles, \cite{Lee2013} assumed that the discount factor is identified from variation in the expected quality of future releases, which shifts future values without affecting current payoffs. In an application to cellphone plan choice, \cite{yaoetal12} argues informally that utilities can be identified in a terminal period when the choice problem is static. The discount factor can subsequently be identified from choices in the next to last period. \cite{chungetal14} appeals to \cite{yaoetal12}'s idea in a study of salesforce compensation plans. We give further examples from the literature in Section \ref{s:examples}. In Section \ref{s:new}, we formalize the intuition in these studies as an exclusion restriction on primitive utilities. We first consider a stationary model with infinite horizon (introduced in Section \ref{s:model}). We prove that, in contrast to common intuition, an exclusion restriction on primitive utilities does not generally point identify the discount factor. It does however narrow the identified set--- the set of observationally equivalent discount factors--- to a discrete and, if we exclude values near one, finite set. This set contains the solutions to a moment condition that only involves the discount factor and that has a straightforward interpretation in terms of choice responses to variation in expected discounted future utilities. The moment condition can be used directly in estimation, independently of the rest of the model parameters. We subsequently provide a finite upper bound on the number of discount factors in the identified set for the case in which the states display finite dependence, as defined by \cite{arcidiaconomiller11, arcidiaconomillerlongshort}. Examples include optimal stopping and renewal problems, which we show to be point identified. We extend our analysis to nonstationary models with finite horizons, which are commonly used in labor applications (\citealp{res89:ecksteinwolpin} and \citealp{jpe97:keanewolpin} are early examples). We show that, with exclusion restrictions, the discount factor is generally identified up to a finite set in these models. In Section \ref{s:empiricalcontent}, we explore the empirical content of exclusion restrictions. \citeauthor{ecta02:magnacthesmar}'s Proposition 2 implies that dynamic discrete choice models without exclusion restrictions cannot be falsified with data on choices and states. In that sense, the models have no empirical content. We show that exclusion restrictions impose nontrivial restrictions on the data, which can be tested. Finally, in Section \ref{s:multiple}, we argue that common intuition often supports {\em multiple} exclusion restrictions, which imply multiple moment conditions. These moment conditions share the true discount factor (if one exists that rationalizes the data) as one solution, but may have individually more solutions. We discuss how standard (set) estimators can be applied to this case. This paper's main contribution is to provide a simple and intuitively appealing analysis of identification of the discount factor in dynamic discrete choice models under economically motivated exclusion restrictions. Our analysis complements a substantial literature in econometrics (see \citealp{nh94:rust} and \citealp{are10:abbring}, for reviews). \citeauthor{ecta02:magnacthesmar}'s Proposition 4 established point identification based on a different type of exclusion restriction than ours: the existence of a pair of states that affects, in some specific way, expected discounted future utilities, but not the ``current value,'' which is a difference in expected discounted utilities between two particular choice sequences. This is a high level exclusion restriction that is difficult to interpret and hard to verify in applications. In particular, unlike our exclusion restriction, it does not formalize the common intuition that is given in applications like those discussed above. Empirical applications often incorrectly cite \citeauthor{ecta02:magnacthesmar}'s result as one for an exclusion restriction on primitive utility. For example, in a study of housing location choice, \citet[][p. 921]{ecta16:bayeretal} wrote \begin{quote} Magnac and Thesmar (2002) \ldots showed that dynamic models are identified with an appropriate exclusion restriction--- in particular, a variable that shifts expectations but not current utility. In the context of our framework, lagged amenities provide exactly this sort of exclusion restriction: while current utility depends on the current level of the amenities provided in a neighborhood, lagged amenity levels help predict how amenities will evolve going forward and thus contribute to expectations about the future utility associated with that choice of neighborhood. \end{quote} We show how \citeauthor{ecta16:bayeretal}'s exclusion restriction can be used to set identify and estimate the discount factor, even if it is insufficient for point identification.\footnote{We thank John Rust for this example.} \citeauthor{ecta02:magnacthesmar}'s identification result relies on a rank condition that ensures sufficient variation in expected discounted future utilities. This rank condition does not suffice for point identification with our exclusion restriction on primitive utilities. We do however use natural extensions of this condition to ensure local identification of myopic preferences, which is needed for our discrete set identification result. \citeauthor{ecta02:magnacthesmar}'s Proposition 2 implies that, without further restrictions, not only the discount factor, but also the utility of one reference choice can be normalized without restricting the observed choice and transition probabilities. Intuitively, discrete choices only identify utility contrasts, not levels. However, {\em counterfactual} choice probabilities, which are often the objects of interest in dynamic discrete choice analysis, are generally not invariant to the choice of reference utility \citep{res14:noretstang,kalouptsidietal16}. This suggests that we do not only treat the discount factor, but also the utility of the reference choice as a free parameter that should be determined from data. Indeed, we view the identification of the reference utility as an important, but separate problem from the identification of the discount factor. For expositional convenience, we derive our main results under the normalization that the reference utility equals zero. In the appendix, we show that our results straightforwardly extend to the case in which the reference utility is known up to a constant shift. We emphasize that the idea of using exclusion restrictions to identify time preferences in choice models is not ours, but has circulated in the literature for a while. One early example is \cite{chevaliergoolsbee09}, which studied demand for textbooks. Its choice model implicitly excluded the expected future resale price of a textbook from the current period pay-off to identify a discount factor. \cite{ier15:fangwang} explicitly proposed the use of exclusion restrictions similar to ours to identify a dynamic discrete choice model with partially naive hyperbolic time preferences. In \citet{fw19:abbringdaljord}, we argue that \citeauthor{ier15:fangwang}'s main generic identification result has no implications for the identification of the model with hyperbolic discounting or its special case with geometric discounting, which we study. In any case, our approach is different: We isolate the specific empirical implications of the exclusion restrictions, whereas \citeauthor{ier15:fangwang} studied their model as a general system of nonlinear equations, using results from differential topology. \cite{qe18:komarovaetal} showed point identification of the discount factor under parametric assumptions on the utility function in a model like ours, but without exclusion restrictions. \citeauthor{res14:noretstang} demonstrated that in a model with parametric utility, point identification is lost to set identification when the distribution of unobservables is allowed to deviate from a known one, such as the type-1 extreme value specification that underlies logit choice probabilities. Without any restrictions on the distribution of unobservables beyond conditional independence and absolute continuity, all identification of the discount factor is lost, i.e. the identified set of discount factors is the unit interval. We instead focus on identification for a nonparametric utility function under economically motivated exclusion restrictions. We map each exclusion restriction to an easily interpretable and computable moment condition that directly informs the identification and estimation of the discount factor, and the model's empirical content. \section{Model} \label{s:model} Consider a stationary dynamic discrete choice model \citep[e.g.][]{nh94:rust}. Time is discrete with an infinite horizon.\footnote{Section \ref{ss:finitehorizon} considers an extension to a nonstationary model with a finite horizon.} In each period, agents first observe state variables $x$ and $\varepsilon$, where $x$ takes discrete values in ${\cal X}=\{x_1,\ldots,x_J\}$ and $\varepsilon=\{\varepsilon_1,\ldots,\varepsilon_K\}$ is continuously distributed on $\mathbb{R}^K$; for $J,K\geq 2$. Then, they choose $d$ from the set of alternatives ${\cal D}=\{1,2,\ldots,K\}$ and collect utility $u_d(x,\varepsilon)=u_d^*(x)+\varepsilon_d$. Finally, they move to the next period with new state variables $x'$ and $\varepsilon'$ drawn from a Markov transition distribution controlled by $d$. We assume that a version of \cites{ecta87:rust} conditional independence assumption holds. Specifically, $x'$ is drawn independently of $\varepsilon$ from the transition distribution $Q_k\left(\cdot|x\right)$ for any choice $k \in {\cal D}$; and $\varepsilon_1,\ldots,\varepsilon_K$ are independently drawn from mean zero type-1 extreme value distributions.\footnote{\citeauthor{ecta02:magnacthesmar} showed that the distribution of $\varepsilon$ cannot be identified and took it to be known. Our type-1 extreme value assumption leads to the canonical multinomial logit case. Our results extend directly to any other known, continuous distribution on $\mathbb{R}^K$.} Agents maximize the rationally expected utility flow discounted with factor $\beta\in[0,1)$. Each choice $d$ equals the option $k$ that maximizes the choice-specific expected discounted utility (or, simply, ``value'') $v_k(x,\varepsilon)$. The additive separability of $u_k(x,\varepsilon)$ and conditional independence imply that $v_k(x,\varepsilon)=v^*_k(x)+\varepsilon_k$, with $v^*_k$ the unique solution to \begin{equation} \label{eq:bellman} \begin{split} v^*_k(x)&=u^*_k(x) +\beta \mathbb{E}\left[\max_{{k'}\in{\cal D}}\{v^*_{k'}(x')+\varepsilon'_{k'}\} \;\vline\; d=k,x\right]\\ &=u^*_k(x) + \beta\int \mathbb{E}\left[\max_{{k'}\in{\cal D}}\{v^*_{k'}( \tilde x)+\varepsilon'_{k'}\}\right]dQ_k(\tilde x|x) \end{split} \end{equation} for all $k\in {\cal D}$. Here, for each given $\tilde{x}\in {\cal X}$, \begin{equation} \label{eq:McFadden} \mathbb{E}\left[\max_{{k'}\in{\cal D}}\{v^*_{k'}(\tilde{x})+\varepsilon'_{k'}\}\right]=\ln\left(\sum_{k'\in{\cal D}} \exp\left(v^*_{k'}(\tilde{x})\right)\right) \end{equation} is the McFadden surplus for the choice among $k'\in{\cal D}$ with utilities $v^*_{k'}(\tilde{x})+\varepsilon'_{k'}$. Suppose we have data on choices $d$ and state variables $x$ that allow us to determine $Q_k(\cdot|\tilde{x})$ and the choice probabilities $p_k(\tilde{x})=\Pr(d=k | x=\tilde{x})$ for all $k\in{\cal D}$ and $\tilde{x}\in{\cal X}$. The model is point identified if and only if we can uniquely determine its primitives from these data. As we discuss in Section \ref{s:empiricalcontent}, a version of \citeauthor{ecta02:magnacthesmar}'s Proposition 2 holds: There exist unique (up to a standard utility normalization) values of the primitives that rationalize the data for any given discount factor $\beta\in[0,1)$. We therefore focus our identification analysis on $\beta$. The choice probabilities are fully determined by \begin{equation} \label{eq:choiceprobinversion} \ln\left(p_k(\tilde{x}) \right) - \ln\left(p_K(\tilde{x})\right)=v^*_k(\tilde{x})- v^*_K(\tilde{x}),~~~~~~k\in{\cal D}/\{K\},~\tilde{x}\in{\cal X}. \end{equation} The transition probabilities $Q_k(\cdot|\tilde{x})$, the value contrasts $v^*_k(\tilde{x})- v^*_K(\tilde{x})$ for $k\in{\cal D}/\{K\}$ and $\tilde{x}\in{\cal X}$ therefore capture all the model's implications for the data. \citet{res93:hotzmiller} pointed out that \eqref{eq:choiceprobinversion} can be inverted to identify the value contrasts from the choice probabilities. To use this, we first rewrite (\ref{eq:bellman}) as \begin{equation} \label{eq:bellmanprobs} v^*_k(x)=u^*_k(x)+\beta\int \left(m(\tilde x)+v^*_K(\tilde x)\right) dQ_k(\tilde x|x), \end{equation} where, for given $\tilde{x}\in{\cal X}$, $m(\tilde{x})=\mathbb{E}\left[\max_{{k'}\in{\cal D}}\{v^*_{k'}(\tilde{x})-v^*_{K}(\tilde{x})+\varepsilon'_{k'}\}\right]$ is the ``excess surplus'' (over $v^*_K(\tilde{x})$), the McFadden surplus for the choice among $k'\in{\cal D}$ with utilities $v^*_{k'}(\tilde{x})-v^*_{K}(\tilde{x})+\varepsilon'_{k'}$. By \eqref{eq:McFadden}  and \eqref{eq:choiceprobinversion}, it follows that $m(\tilde{x})=-\ln \left(p_K(\tilde{x})\right)$. \section{Identification} \label{s:new} Let $\mathbf{v}_k$, $\mathbf{p}_k$, $\mathbf{u}_k$, and $\mathbf{m}$ be $J\times 1$ vectors with $j$-th elements $v^*_k(x_j)$, $p_k(x_j)$, $u^*_k(x_j)$, and $m(x_j)$, respectively. Let $\mathbf{Q}_k$ be the $J\times J$ matrix with $(j,j')$-th entry $Q_k(x_{j'}|x_j)$ and $\mathbf{I}$ be a $J\times J$ identity matrix. Note that the $J\times 1$ vector $\mathbf{m}  + \mathbf{v}_K$ stacks the McFadden surpluses in \eqref{eq:McFadden}. In this notation, the data are $\{\mathbf{p}_k,\mathbf{Q}_k; k\in{\cal D}\}$ and directly identify $\mathbf{m}=-\ln\mathbf p_K$ \citep[][Lemma 1 and Section 3.3]{arcidiaconomiller11}. \subsection{Magnac and Thesmar's result} \label{ss:magnacthesmar} We can rewrite (\ref{eq:bellmanprobs}) as $v^*_k(x)=u^*_k(x)+\beta\mathbf{Q}_k(x)\left[\mathbf{m}+\mathbf{v}_K\right]$, where $\mathbf{Q}_k(x_j)$ is the $j$-th row of $\mathbf{Q}_k$. Subtracting the same expression for $v^*_K(x)$, rearranging, and substituting (\ref{eq:choiceprobinversion}), we get \begin{equation} \label{eq:uMT} \ln (p_k(x))-\ln(p_K(x))=\beta\left[\mathbf{Q}_k(x)-\mathbf{Q}_K(x)\right]\mathbf{m}+ U_k(x), \end{equation} where $U_k(x)=u^*_k(x) -u_K^*(x) + \beta\left[\mathbf{Q}_k(x)-\mathbf{Q}_K(x)\right]\mathbf{v}_K$ is \citeauthor{ecta02:magnacthesmar}'s ``current value" of choice $k$ in state $x$. Its Proposition 4 assumes the existence of a known option $k\in{\cal D}/\{K\}$ and a known pair of states $\tilde x_1,\tilde x_2\in {\cal X}$ such that $\tilde{x}_1\not =\tilde{x}_2$ and $U_k(\tilde x_1)=U_k(\tilde x_2)$. Under this exclusion restriction, differencing (\ref{eq:uMT}) evaluated at $\tilde x_1$ and $\tilde x_2$ yields \begin{equation} \label{eq:diffMT} \begin{split} \ln\left(p_k(\tilde x_1)/p_K(\tilde x_1)\right) - \ln\left(p_k(\tilde x_2)/p_K(\tilde x_2)\right)&\\ &\hspace*{-14em}= \beta\left[\mathbf{Q}_k(\tilde x_1)-\mathbf{Q}_K(\tilde x_1)- \mathbf{Q}_k(\tilde x_2)+\mathbf{Q}_K(\tilde x_2)\right]\mathbf{m}. \end{split} \end{equation} Given the choice and transition probabilities, the left hand side of \eqref{eq:diffMT} is a known scalar and its right hand side is a known linear function of $\beta$. Therefore, provided that \citeauthor{ecta02:magnacthesmar}'s rank condition \begin{equation} \label{eq:rankMT} \left[\mathbf{Q}_k(\tilde x_1)-\mathbf{Q}_K(\tilde x_1)- \mathbf{Q}_k(\tilde x_2)+\mathbf{Q}_K(\tilde x_2)\right]\mathbf{m}\not = 0 \end{equation} holds, moment condition \eqref{eq:diffMT} uniquely determines $\beta$ in terms of the choice data. This identification argument can be interpreted in terms of an experiment that shifts the expected excess surplus contrast $\left[\mathbf{Q}_k(x) - \mathbf{Q}_K(x)\right]\mathbf{m}$ by changing the state $x$ from $\tilde{x}_2$ to $\tilde{x}_1$, while keeping the current value $U_k(\tilde{x}_1)=U_k(\tilde{x}_2)$ constant. The discount factor is the per unit effect of that observed shift on the observed log choice probability ratio $\ln\left(p_k(x)/p_K(x)\right)$. A shift in the expectation contrast $\mathbf{Q}_k(x) - \mathbf{Q}_K(x)$ does not suffice for identification. For example, suppose that the exclusion restriction holds for some $\tilde{x}_1, \tilde{x}_2\in {\cal X}$, but that the excess surplus $m(x_1) = \cdots=m(x_J)$ is constant, so that the expected excess surplus contrast $\left[\mathbf{Q}_k(x) - \mathbf{Q}_K(x)\right]\mathbf{m}=0$. Then, a shift in the expectation contrast does not shift the expected excess surplus contrast and hence does not change the decision problem. Consequently, this shift is not informative on $\beta$ and \citeauthor{ecta02:magnacthesmar}'s rank condition \eqref{eq:rankMT} fails. Rank condition \eqref{eq:rankMT} has a meaningful interpretation and is verifiable in data. The exclusion restriction $U_k(\tilde x_1)=U_k(\tilde x_2)$, however, is more problematic, because it imposes opaque conditions on the primitives that are hard to verify in applications. The current values depend on both current utilities and discounted expected future values. Specifically, they involve elements of $\mathbf{v}_K$, which by (\ref{eq:bellmanprobs}) equals \begin{equation}\label{eq:vK} \mathbf{v}_K=\left[\mathbf{I}-\beta \mathbf{Q}_K\right]^{-1}\left[\mathbf{u}_K+\beta\mathbf{Q}_K\mathbf{m}\right]. \end{equation} The current value is in fact a value contrast between two sequences of choices: choose $k$ now, $K$ in the next period, and choose optimally ever after, relative to choose $K$ now, $K$ in the next period, and choose optimally ever after. Because this particular value contrast does not correspond to common economic choice sequences, the applied value of \citeauthor{ecta02:magnacthesmar}'s restriction is limited. It is hard to think of naturally occurring experiments that shift the expected contrasts in excess surplus, i.e. satisfy the rank condition, without also shifting the current value and consequently violating the exclusion restriction, except for special cases. Indeed, the intuitive identification arguments in the introduction's empirical examples do not involve current values, but exclusion restrictions on primitive utility. \subsection{An exclusion restriction on primitive utility} Like \citeauthor{ecta02:magnacthesmar}, we start with (\ref{eq:uMT}) or, equivalently, \begin{equation} \label{eq:uMTnew} \ln \mathbf{p}_k - \ln \mathbf{p}_K = \beta\left[\mathbf{Q}_k-\mathbf{Q}_K\right]\left[\mathbf{m}+\mathbf{v}_K\right] + \mathbf{u}_k -\mathbf{u}_K. \end{equation} Instead of controlling the contribution of $\mathbf{v}_K$ to the right hand side with an exclusion restriction on the current value, we exploit that it can be expressed in terms of the model primitives. Substituting (\ref{eq:vK}) in (\ref{eq:uMTnew}) and rearranging gives \begin{equation} \label{eq:u} \ln \mathbf{p}_k - \ln \mathbf{p}_K = \beta\left[\mathbf{Q}_k-\mathbf{Q}_K\right]\left[\mathbf{I}-\beta \mathbf{Q}_K\right]^{-1}\left[\mathbf{m}+\mathbf{u}_K\right] + \mathbf{u}_k-\mathbf{u}_K. \end{equation} Intuition from static discrete choice analysis and \citeauthor{ecta02:magnacthesmar}'s results for dynamic models suggest that, for identification, we need to fix utility in one reference alternative, say $\mathbf{u}_K$. Intuitively, choices only depend on, and thus inform about, utility contrasts. Thus, following e.g. \citeauthor{ier15:fangwang} and \citet{nber15:bajarietal}, we set $\mathbf{u}_K=\mathbf{0}$.\footnote{Note that this normalization does not collapse \citeauthor{ecta02:magnacthesmar}'s exclusion restriction on current values to an easily interpretable restriction on primitives.} This normalization cannot be refuted by data without further restrictions (see Section \ref{s:empiricalcontent}). Despite this lack of empirical content, it is not completely innocuous, as it may affect the model's counterfactual predictions (see e.g. \citeauthor{res14:noretstang}, Lemma 2, and \citeauthor{kalouptsidietal16}). In the appendix, we demonstrate that our analysis applies without change to the case in which $u^*_K(x)$ is constant, but not necessarily zero, and can straightforwardly be extended to the case in which $u^*_K(x)$ is known up to a constant shift, but not necessarily constant. Thus, our analysis of the identification of the discount factor complements identification results for the reference utility $u^*_K$.\footnote{\citet{usc15:chou} recently provided identification results for dynamic discrete choice models without a normalization of $u^*_K$. \citeauthor{usc15:chou}'s results for the stationary model that we study here take the discount factor to be known. \citeauthor{usc15:chou}'s Propositions 3, 7, and 8 for a nonstationary model like the one we study in Section \ref{ss:finitehorizon} provide high-level sufficient conditions for point identification, whereas we focus on set identification under intuitive conditions. A general difference is that we emphasize the economic interpretation of the identifying conditions and that we provide results on their empirical content.} Now suppose that we know the value of $u_k^*(\tilde x_1)-u_l^*(\tilde x_2)$ for some known choices $k\in{\cal D}/\{K\}$ and $l \in {\cal D}$ and known states $\tilde x_1 \in {\cal X}$ and $\tilde x_2\in{\cal X}$; with either $k\neq l$, $\tilde{x}_1\not =\tilde{x}_2$, or both. For expositional convenience only (see the appendix for the general case), we take this known value to be zero, and simply focus on the exclusion restriction \begin{align}\label{eq:exclusionrestriction} u_k^*(\tilde x_1)=u_l^*(\tilde x_2). \end{align} An advantage of this exclusion restriction over \citeauthor{ecta02:magnacthesmar}'s current value restriction is that it is a direct constraint on primitive utility with a clear economic interpretation. It also extends \citeauthor{ecta02:magnacthesmar} by allowing for restrictions on primitive utilities across combinations of choices and states. \subsection{The identified set} Under exclusion restriction \eqref{eq:exclusionrestriction}, we can difference \eqref{eq:u} to implicitly relate $\beta$ to the choice data (the choice and transition probabilities), without reference to any other unknown parameters (the utilities): \begin{equation} \label{eq:diffAD} \begin{split} \ln\left(p_k(\tilde x_1)/p_K(\tilde x_1)\right) - \ln\left(p_l(\tilde x_2)/p_K(\tilde x_2)\right)&\\ &\hspace*{-12em}= \beta\left[\mathbf{Q}_k(\tilde x_1)-\mathbf{Q}_K(\tilde x_1)- \mathbf{Q}_l(\tilde x_2)+\mathbf{Q}_K(\tilde x_2)\right] \left[\mathbf{I}-\beta \mathbf{Q}_K\right]^{-1}\mathbf{m}, \end{split} \end{equation} For any discount factor that solves \eqref{eq:diffAD}, unique primitive utilities can be found that rationalize the choice data, and these utilities satisfy exclusion restriction \eqref{eq:exclusionrestriction}.\footnote{The argument in Section \ref{s:empiricalcontent}, which establishes a version of \citeauthor{ecta02:magnacthesmar}'s Proposition 2, implies that the utilities that rationalize the choice data for a given discount factor solve \eqref{eq:u} for $\mathbf{u}_k$. It follows straightforwardly that they satisfy \eqref{eq:exclusionrestriction} whenever \eqref{eq:diffAD} holds.} So, without further assumptions or data, moment condition \eqref{eq:diffAD} contains all the information about the discount factor in the choice data under exclusion restriction \eqref{eq:exclusionrestriction} and can be used directly for its identification and estimation.\footnote{Additional exclusion restrictions (as in Section \ref{s:multiple}) and functional form assumptions on the utility functions may provide further information on the discount factor. After all, the utilities that rationalize the choice data for a discount factor that solves \eqref{eq:diffAD} may not satisfy these additional constraints.}$^\text{,}$\footnote{Similarly, moment condition \eqref{eq:diffMT} contains all the information about the discount factor under \citeauthor{ecta02:magnacthesmar}'s exclusion restriction on current values.} Unlike the right hand side of (\ref{eq:diffMT}), the right hand side of (\ref{eq:diffAD}) is not linear in $\beta$. Nevertheless, given data on transition and choice probabilities, it is a well-behaved, known function of $\beta$. It is therefore easy to characterize the identified set ${\cal B}$ of values of $\beta\in[0,1)$ that equate it to the known left hand side of (\ref{eq:diffAD}). \begin{theorem} \label{th:ident} Suppose that the exclusion restriction in \eqref{eq:exclusionrestriction} holds for some $k\in{\cal D}/\{K\}$, $l \in {\cal D}$, $\tilde x_1 \in {\cal X}$, and $\tilde x_2\in{\cal X}$; with either $k \neq l$, $\tilde{x}_1\not =\tilde{x}_2$, or both. Moreover, suppose that either the left hand side of (\ref{eq:diffAD}) is nonzero (that is, $p_k(\tilde x_1)/p_K(\tilde x_1)\neq p_l(\tilde x_2)/p_K(\tilde x_2)$) or a generalization of \citeauthor{ecta02:magnacthesmar}'s rank condition \eqref{eq:rankMT} holds: \begin{equation} \label{eq:rank} \left[\mathbf{Q}_k(\tilde x_1)-\mathbf{Q}_K(\tilde x_1)- \mathbf{Q}_l(\tilde x_2)+\mathbf{Q}_K(\tilde x_2)\right]\mathbf{m}\not = 0. \end{equation} Then, the identified set ${\cal B}$ is a closed discrete subset of $[0,1)$. \end{theorem} \begin{proof} We need to show that, under the stated conditions, ${\cal B}\subseteq[0,1)$ has no limit points in $[0,1)$. First note that $\left[\mathbf{I}-\beta \mathbf{Q}_K\right]^{-1}$ exists for $\beta\in(-1,1)$ and equals \begin{equation} \label{eq:series} \mathbf{I}+\beta\mathbf{Q}_K+\beta^2 \mathbf{Q}_K^2+\cdots. \end{equation} This is trivial for $\beta=0$. If $|\beta|\in(0,1)$, it follows from the facts that $|\beta^{-1}|>1$ and that $\mathbf{Q}_K$ is a Markov transition matrix, with eigenvalues no larger than 1 in absolute value. Consequently, the determinant of $\mathbf{Q}_K-\beta^{-1}\mathbf{I}$ is nonzero, so that $\mathbf{I}-\beta \mathbf{Q}_K$ is invertible and the power series in \eqref{eq:series} converges. It follows that, for given choice and transition probabilities, the right hand side of \eqref{eq:diffAD} minus its left hand side is a real-valued power series in $\beta$ that converges on $(-1,1)$. Denote the function of $\beta$ this defines with $f:(-1,1)\rightarrow\mathbb{R}$. Corollary 1.2.4 in \citet{birk02:krantzparks} ensures that $f$ is real analytic. Denote ${\cal B}^*=\{\beta\in (-1,1)\; |\; f(\beta)=0\}$. Note that ${\cal B}={\cal B}^*\cap[0,1)$. First, suppose that $f$ has no zeros (${\cal B}^*=\emptyset$). Then, ${\cal B}=\emptyset$ has no limit point in $[0,1)$. Finally, suppose that $f$ has at least one zero (${\cal B}^*\neq\emptyset$). Then, $f$ cannot be constant (and thus equal zero) under the stated conditions: If the left hand side of \eqref{eq:diffAD} is nonzero then, because its right hand side equals zero at $\beta=0$, $f(0)$ is nonzero; if rank condition \eqref{eq:rank} holds, then the derivative of the right hand side of \eqref{eq:diffAD} at $\beta=0$, and therefore of $f$ at $0$, is nonzero. Because $f$ is a nonconstant real-analytic function, its zero set ${\cal B}^*$ has no limit point in $(-1,1)$ (\citeauthor{birk02:krantzparks}, Corollary 1.2.7). Because ${\cal B}={\cal B}^*\cap[0,1)$, this implies that ${\cal B}$ has no limit point in $[0,1)$. \end{proof} Under the conditions of Theorem \ref{th:ident}, each $\beta\in[0,1)$ that is consistent with (\ref{eq:diffAD}) is an isolated point in $[0,1)$ and thus locally identified. Note that $\beta=1$ is excluded from the model to ensure convergence of the discounted utility flows. Theorem \ref{th:ident} does not exclude that $1$ is a limit point of the identified set. So, the identified set may contain countably many discount factors near $1$. However, because a closed discrete set is finite on compact subsets, only finitely many discount factors in the identified set lie outside a neighborhood of $1$. \begin{corollary} \label{cor:finite} Under the conditions of Theorem \ref{th:ident}, ${\cal B}\cap[0,1-\epsilon]$ is finite for $0<\epsilon<1$. \end{corollary} \noindent In many applications, one may be able to argue against discount factors that are arbitrarily close to $1$. Corollary \ref{cor:finite} shows that, in such applications, it suffices to search for the finite number of discount factors in a compact set $[0,1-\epsilon]$ that solve (\ref{eq:diffAD}), which is computationally easy. The right hand side of \eqref{eq:diffAD} is the log choice probability difference implied by the model with an exclusion restriction across choices $k$ and $l$ and states $\tilde x_1$ and $\tilde x_2$. From the proof of Theorem \ref{th:ident}, we know it equals the discount factor $\beta$, which represents how much the agent cares about the next period, multiplied by the sum of two terms that capture how much relevant variation in next period's expected discounted utility there is for the agent to care about: \begin{equation} \label{eq:firstterm} \left[\mathbf{Q}_k(\tilde x_1)-\mathbf{Q}_K(\tilde x_1)- \mathbf{Q}_l(\tilde x_2)+\mathbf{Q}_K(\tilde x_2)\right] \mathbf{m} \end{equation} and \begin{equation} \label{eq:secondterm} \begin{split} &\left[\mathbf{Q}_k(\tilde x_1)-\mathbf{Q}_K(\tilde x_1)- \mathbf{Q}_l(\tilde x_2)+\mathbf{Q}_K(\tilde x_2)\right] \mathbf{v}_K=\\ &\left[\mathbf{Q}_k(\tilde x_1)-\mathbf{Q}_K(\tilde x_1)- \mathbf{Q}_l(\tilde x_2)+\mathbf{Q}_K(\tilde x_2)\right] \left[\beta \mathbf{Q}_K+ \beta^2 \mathbf{Q}_K^2+\cdots\right]\mathbf{m}. \end{split} \end{equation} The first term \eqref{eq:firstterm} does not depend on $\beta$. It is nonzero if the generalized rank condition \eqref{eq:rank} holds. It corresponds to the leading, linear term in the right hand side of \eqref{eq:diffAD}, which extends the right hand side of \citeauthor{ecta02:magnacthesmar}'s \eqref{eq:diffMT} to the possibility of comparing across distinct choices $k$ and $l$. The next section gives conditions under which the second term \eqref{eq:secondterm} vanishes. Section \ref{s:examples} gives economic examples in which these conditions hold. If they hold, the right hand side of \eqref{eq:diffAD} is linear in $\beta$, so that \eqref{eq:diffAD} uniquely determines $\beta$ under the generalized rank condition \eqref{eq:rank}. In general, the second term \eqref{eq:secondterm} does not vanish and depends on $\beta$. Then, the right hand side of \eqref{eq:diffAD} is not linear in $\beta$, but its derivative at $\beta=0$ still equals the first term \eqref{eq:firstterm}.\footnote{The derivative corresponding to the second term \eqref{eq:secondterm} vanishes because choice $K$ has zero value if the agent is myopic.} Therefore, if the generalized rank condition \eqref{eq:rank} holds, this derivative is nonzero and myopic preferences ($\beta=0$) are locally identified.\footnote{Here, $\beta$ is locally identified at some $\beta_0$ if $\beta=\beta_0$ uniquely solves \eqref{eq:diffAD} in a neighborhood of $\beta_0$. Rank condition \eqref{eq:rank} is not {\em necessary} for local identification of $\beta$ at zero; for that, higher order variation of the right hand side of \eqref{eq:diffAD} in $\beta$ at zero would suffice \citep{ecta83:sargan}.} In economic terms, the rank condition ensures that there is variation in next period's expected discounted utility for a myopic agent to care about, so that only myopic preferences can explain a lack of choice response. In Theorem \ref{th:ident}, the rank condition excludes the trivial case that a zero choice response is observed and the right hand side of \eqref{eq:diffAD} equals zero for all $\beta$. In the case that a zero choice response is observed, local identification of myopic preferences does not rule out that the data are also consistent with some positive discount factors, as there may be $\beta\in(0,1)$ such that the sum of \eqref{eq:firstterm} and \eqref{eq:secondterm} is zero (that is, there is no variation in next period's expected discounted utility for the agent to care about). These discount factors, if any, can easily be found by searching for the solutions of \eqref{eq:diffAD}. In particular, if the sum of \eqref{eq:firstterm} and \eqref{eq:secondterm} is nonzero for all $\beta\in(0,1)$, only myopic preferences can explain the lack of choice response. More generally, rank condition \eqref{eq:rank} does not suffice for point identification of $\beta$. As the next example demonstrates, the same observed choice response may arise from a combination of a low $\beta$ (little care about the next period) and a large absolute sum of \eqref{eq:firstterm} and \eqref{eq:secondterm} (lots of variation in the next period to care about) and from a combination of a high $\beta$ and a small absolute sum of \eqref{eq:firstterm} and \eqref{eq:secondterm}. \begin{figure}[t] \caption{Example in Which the Rank Condition Holds, but Identification Fails\label{fig:identificationFails}} \centering \medskip \begin{tikzpicture} \begin{axis}[width=12cm,height=7.5cm, name=llherr, xlabel={$\beta$}, axis x line=bottom, every outer x axis line/.append style={-,color=gray,line width=0.75pt}, axis y line=left, every outer y axis line/.append style={-,color=gray,line width=0.75pt}, xtick={0, 0.34, 0.95}, xticklabels={$0$,$ 0.34$,$ 0.95$}, ytick={0,0.0400}, yticklabels={$0$,$0.0400$}, every tick/.append style={line width=0.75pt}, xmin=0, xmax=1, ymin=0, scaled ticks=false, /pgf/number format/precision=2, /pgf/number format/set thousands separator={}] \draw[color=black!75,line width=0.75pt,solid] (axis cs:0,0.0400) -- (axis cs:1,0.0400); \addplot[color=blue!75,smooth,mark=,line width=0.75pt] table[x=beta,y=rhs,col sep=comma]{matlab/data/identificationFails.csv} ; \draw[color=blue!75,line width=0.75pt,dotted] (axis cs: 0.34,0) -- (axis cs: 0.34,0.0400); \draw[color=blue!75,line width=0.75pt,dotted] (axis cs: 0.95,0) -- (axis cs: 0.95,0.0400); \addplot[color=red!75,dashed,mark=,line width=0.75pt] table[x=beta,y=rhsMT,col sep=comma]{matlab/data/identificationFails.csv} ; \draw[color=red!75,line width=0.75pt,dotted] (axis cs: 0.31,0) -- (axis cs: 0.31,0.0400); \end{axis} \end{tikzpicture} \medskip \begin{minipage}{12cm} {\scriptsize Note: For $J= 3$ states, $K= 2$ choices, $k=l=1$, $\tilde{x}_1=x_1$, and $\tilde{x}_2=x_2$, this graph plots the left hand side of (\ref{eq:diffMT}) and (\ref{eq:diffAD}) (solid black horizontal line) and the right hand sides of (\ref{eq:diffMT}) (dashed red line), and (\ref{eq:diffAD}) (solid blue curve) as functions of $\beta$. The data are $\mathbf{Q}_1(x_1)=\left[\begin{array}{ccc} 0.25& 0.25& 0.50\end{array}\right]$, $\mathbf{Q}_1(x_2)=\left[\begin{array}{ccc} 0.00& 0.25& 0.75\end{array}\right]$,} {\scriptsize \vspace*{-3ex} \[\mathbf{Q}_K=\left[\begin{array}{ccc} 0.90& 0.00& 0.10\\ 0.00& 0.90& 0.10\\ 0.00& 1.00& 0.00\end{array}\right]\text{, }\mathbf{p}_1=\left[\begin{array}{ccc} 0.50\\ 0.49\\ 0.10\end{array}\right]\text{, and }\mathbf{p}_K=\left[\begin{array}{ccc} 0.50\\ 0.51\\ 0.90\end{array}\right].\] Consequently, the left hand side of (\ref{eq:diffMT}) and (\ref{eq:diffAD}) equals $\ln\left(p_1(x_1)/p_K(x_1)\right) - \ln\left(p_1(x_2)/p_K(x_2)\right)= 0.0400$. Moreover, $\mathbf{m}'=\left[\begin{array}{ccc} 0.69& 0.67& 0.11\end{array}\right]$ and $\mathbf{Q}_1(x_1)-\mathbf{Q}_K(x_1)- \mathbf{Q}_1(x_2)+\mathbf{Q}_K(x_2)=\left[\begin{array}{ccc} -0.65& 0.90& -0.25\end{array}\right]$, so that the slope of the dashed red line equals $\left[\mathbf{Q}_1(x_1)-\mathbf{Q}_K(x_1)- \mathbf{Q}_1(x_2)+\mathbf{Q}_K(x_2)\right] \mathbf{m}=0.1291$. A unique value of $\beta$, $ 0.31$, solves (\ref{eq:diffMT}), but two values of $\beta$ solve (\ref{eq:diffAD}): $ 0.34$ and $ 0.95$.} \end{minipage} \end{figure} \begin{example} \label{ex:identificationFails} Figure \ref{fig:identificationFails} plots the left hand side of \eqref{eq:diffMT} and \eqref{eq:diffAD} (solid black line) and the right hand sides of \eqref{eq:diffMT} (dashed red line) and \eqref{eq:diffAD} (solid blue curve) for a specific example with $K=2$ choices, $k=l=1$, and $J=3$ states. The example's data satisfy the rank condition in \eqref{eq:rank}. Under the current value restriction, there is a unique discount factor that rationalizes the data (the intersection of the black and the dashed red curve). Under the primitive utility restriction, there are two discount factors that rationalize the same data (the intersections of the black and the solid blue curve). \end{example} \begin{figure}[t] \caption{Example in Which the Rank Condition Fails, but the Discount Factor is Identified\label{fig:needNoMT}} \centering \medskip \begin{tikzpicture} \begin{axis}[width=12cm,height=7.5cm, name=llherr, xlabel={$\beta$}, axis x line=bottom, every outer x axis line/.append style={-,color=gray,line width=0.75pt}, axis y line=left, every outer y axis line/.append style={-,color=gray,line width=0.75pt}, xtick={0, 0.90}, xticklabels={$0$,$ 0.90$}, ytick={0,0.0800}, yticklabels={$0$,$0.0800$}, every tick/.append style={line width=0.75pt}, xmin=0, xmax=1, ymin=0, ymax=0.1, scaled ticks=false, /pgf/number format/precision=2, /pgf/number format/set thousands separator={}] \draw[color=black!75,line width=0.75pt,solid] (axis cs:0,0.0800) -- (axis cs:1,0.0800); \draw[color=blue!75,line width=0.75pt,dotted] (axis cs: 0.90,0) -- (axis cs: 0.90,0.0800); \addplot[color=blue!75,smooth,mark=,line width=0.75pt] table[x=beta,y=rhs,col sep=comma]{matlab/data/needNoMT.csv}; \addplot[color=red!75,dashed,mark=,line width=2pt] table[x=beta,y=rhsMT,col sep=comma]{matlab/data/needNoMT.csv}; \end{axis} \end{tikzpicture} \medskip \begin{minipage}{12cm} {\scriptsize Note: For $J= 3$ states, $K= 2$ choices, $k=l=1$, $\tilde{x}_1=x_1$, and $\tilde{x}_2=x_2$, this graph plots the left hand side of (\ref{eq:diffMT}) and (\ref{eq:diffAD}) (solid black horizontal line) and the right hand sides of (\ref{eq:diffMT}) (dashed red line) and (\ref{eq:diffAD}) (solid blue curve) as functions of $\beta$. The data are $\mathbf{Q}_1(x_1)=\left[\begin{array}{ccc} 0.00& 0.25& 0.75\end{array}\right]$, $\mathbf{Q}_1(x_2)=\left[\begin{array}{ccc} 0.25& 0.25& 0.50\end{array}\right]$,} {\scriptsize \vspace*{-3ex} \[\mathbf{Q}_K=\left[\begin{array}{ccc} 0.00& 1.00& 0.00\\ 0.00& 1.00& 0.00\\ 0.00& 0.00& 1.00\end{array}\right]\text{, }\mathbf{p}_1=\left[\begin{array}{ccc} 0.50\\ 0.48\\ 0.50\end{array}\right] \text{, and }\mathbf{p}_K=\left[\begin{array}{ccc} 0.50\\ 0.52\\ 0.50\end{array}\right].\] Consequently, the left hand side of (\ref{eq:diffMT}) and (\ref{eq:diffAD}) equals $\ln\left(p_1(x_1)/p_K(x_1)\right) - \ln\left(p_1(x_2)/p_K(x_2)\right)= 0.0800$. Moreover, $\mathbf{m}'=\left[\begin{array}{ccc} 0.69& 0.65& 0.69\end{array}\right]$ and $\mathbf{Q}_1(x_1)-\mathbf{Q}_K(x_1)- \mathbf{Q}_1(x_2)+\mathbf{Q}_K(x_2)=\left[\begin{array}{ccc} -0.25& 0.00& 0.25\end{array}\right]$, so that the slope of the dashed red line equals $\left[\mathbf{Q}_1(x_1)-\mathbf{Q}_K(x_1)- \mathbf{Q}_1(x_2)+\mathbf{Q}_K(x_2)\right] \mathbf{m}=0.0000$. A unique value of $\beta$, $ 0.90$, solves (\ref{eq:diffAD}), but (\ref{eq:diffMT}) has no solution.} \end{minipage} \end{figure} Our next example shows that the rank condition in \eqref{eq:rank} is not necessary for point identification either. \begin{example} \label{ex:needNoMT} Figure \ref{fig:needNoMT} presents an example in which \eqref{eq:firstterm} equals zero, so that the right hand side of \eqref{eq:diffMT} and the first (excess surplus) term in the right hand side of \eqref{eq:diffAD} are zero, but the second (value of choice $K$) term in the right hand side of \eqref{eq:diffAD} is positive and increasing with $\beta$. There exists exactly one $\beta\in[0,1)$ that solves \eqref{eq:diffAD}, despite the violation of the rank condition. Also note that there is no value of $\beta$ that satisfies \eqref{eq:diffMT}. Even though the data can be rationalized by some specification of the model, they are not consistent with the current value restriction. In other words, this restriction has empirical content. We return to this point in Section \ref{s:empiricalcontent}. \end{example} \subsection{Finite dependence} \label{ss:finitedep} Some of the examples in the next subsection display a variant of \cites{arcidiaconomiller11} ``finite dependence''. Finite dependence is a property of dynamic discrete choice models that can considerably simplify estimation and is widely used in applications \cite[see][for references]{arcidiaconomillerfinitedependence15}. In our context, finite dependence implies that the moment condition is of finite and known polynomial order. This order provides an upper bound on the number of solutions for the discount factor in $\mathbb{R}$, and therefore in $[0,1)$. For example, in the case with $k\neq l=K$, \eqref{eq:secondterm} reduces to \begin{equation} \label{eq:secondtermfindep} \left[\mathbf{Q}_k(\tilde x_1)-\mathbf{Q}_K(\tilde x_1)\right] \mathbf{v}_K=\left[\mathbf{Q}_k(\tilde x_1)-\mathbf{Q}_K(\tilde x_1)\right] \left[\beta \mathbf{Q}_K+ \beta^2 \mathbf{Q}_K^2+\cdots\right]\mathbf{m}. \end{equation} Suppose that $\mathbf{Q}_k(\tilde x_1)\mathbf{Q}_K^\rho=\mathbf{Q}_K(\tilde x_1)\mathbf{Q}_K^\rho$ for some $\rho\in\{1,2,\ldots\}$. That is, the distribution of the state $\rho+1$ periods from now does not depend on whether the agent chooses $k$ or $K$ now, provided that she follows up in both cases by choosing $K$ in the next $\rho$ periods (independently of whether this is optimal or not). Under this ``single action ($K$) $\rho$-period dependence'' \citep{arcidiaconomillerlongshort} on choices $k$ and $K$ in state $\tilde x_1$, $\mathbf{Q}_k(\tilde x_1)\mathbf{Q}_K^r=\mathbf{Q}_K(\tilde x_1)\mathbf{Q}_K^r$ for all $r\in\{\rho,\rho+1,\ldots\}$.\footnote{Throughout, we focus on this special case of \cites{arcidiaconomiller11} finite dependence, which turns out to be particularly powerful in our specific context.} Now assume that Theorem \ref{th:ident}'s conditions hold. If $\rho=1$, the right hand side of \eqref{eq:secondtermfindep} equals zero, the current value \[ U_k(\tilde x_1)=u^*_k(\tilde x_1) + \beta\left[\mathbf{Q}_k(\tilde x_1)-\mathbf{Q}_K(\tilde x_1)\right]\mathbf{v}_K=u^*_k(\tilde x_1), \] the right hand side of \eqref{eq:diffAD} is linear in $\beta$, and $\beta$ is point identified. If instead $\rho\geq 2$, then the right hand side of \eqref{eq:secondtermfindep} equals \begin{equation*} \left[\mathbf{Q}_k(\tilde x_1)-\mathbf{Q}_K(\tilde x_1)\right] \left[\beta \mathbf{Q}_K+ \cdots +\beta^{\rho-1} \mathbf{Q}_K^{\rho-1}\right]\mathbf{m}, \end{equation*} the right hand side of \eqref{eq:diffAD} is a $\rho$-th order polynomial in $\beta$, and the identified set ${\cal B}$ holds no more than $\rho$ discount factors. This example straightforwardly extends to the general exclusion restriction in \eqref{eq:exclusionrestriction}, which we state without further proof. \begin{theorem}\label{th:finitedependence} Suppose that the conditions of Theorem \ref{th:ident} hold and that $\{\mathbf{Q}_k; k\in{\cal D}\}$ satisfies single action ($K$) $\rho$-period dependence on choices $k$ and $K$ in state ${\tilde x}_1$, \[ \mathbf{Q}_k(\tilde x_1)\mathbf{Q}_K^\rho=\mathbf{Q}_K(\tilde x_1)\mathbf{Q}_K^\rho, \] and single action ($K$) $\rho$-period dependence on choices $l$ and $K$ in state ${\tilde x}_2$, \[ \mathbf{Q}_l(\tilde x_2)\mathbf{Q}_K^\rho=\mathbf{Q}_K(\tilde x_2)\mathbf{Q}_K^\rho, \] for some $\rho\in\{1,2,\ldots\}$. Then there are no more than $\rho$ points in the identified set ${\cal B}$. \end{theorem} Theorem \ref{th:finitedependence} applies finite dependence to cancel differences in expected discounted utilities across pairs of choices twice, once for each of the two states that appear in the exclusion restriction. In the special case that the exclusion restriction concerns a comparison across states $\tilde x_1$ and $\tilde x_2$ for a given choice $k=l$, the right hand side of \eqref{eq:secondterm} reduces to \begin{equation} \label{eq:secondtermStates} \left[\mathbf{Q}_k(\tilde x_1)-\mathbf{Q}_K(\tilde x_1)- \mathbf{Q}_k(\tilde x_2)+\mathbf{Q}_K(\tilde x_2)\right] \left[\beta \mathbf{Q}_K+ \beta^2 \mathbf{Q}_K^2+\cdots\right]\mathbf{m}. \end{equation} By Theorem \ref{th:finitedependence}, single action ($K$) $\rho$-period dependence on choices $k$ and $K$ in states ${\tilde x}_1$ and ${\tilde x}_2$ implies that the identified set contains at most $\rho$ discount factors. If $\rho=1$, then both $U_k(\tilde x_1)=u^*(\tilde x_1)$ and $U_k(\tilde x_2)=u^*(\tilde x_2)$, \eqref{eq:secondtermStates} equals $0$, and the discount factor is point identified. In this case with $k=l$, the consequent of Theorem \ref{th:finitedependence} would also hold if, alternatively, \[ \mathbf{Q}_k(\tilde x_1)\mathbf{Q}_K^\rho=\mathbf{Q}_k(\tilde x_2)\mathbf{Q}_K^\rho ~~~\text{and}~~~ \mathbf{Q}_K(\tilde x_1)\mathbf{Q}_K^\rho=\mathbf{Q}_K(\tilde x_2)\mathbf{Q}_K^\rho, \] for some $\rho\in\{1,2,\ldots\}$. This is a form of single action ($K$) $\rho$-period dependence on the initial state (instead of the initial choice) under, respectively, choices $k$ and $K$. Under one-period dependence on initial states $\tilde x_1$ and $\tilde x_2$, current values do not necessarily reduce to primitive utilities, but it is still true that $U_k(\tilde x_1)-U_k(\tilde x_2)=u^*_k(\tilde x_1)-u^*_k(\tilde x_2)$, \eqref{eq:secondtermStates} equals $0$, and the discount factor is point identified. \subsection{Examples}\label{s:examples} Theorem \ref{th:ident} shows that the identified set of discount factors is discrete and, away from one, finite, but does not establish point identification. Indeed, Example \ref{ex:identificationFails} demonstrated that point identification may fail, even if rank condition \eqref{eq:rank} holds. Our first two examples below (Examples \ref{ex:medicare} and \ref{ex:loyaltyprogram}) illustrate applications from the literature in which the exclusion restriction is plausibly met, but the discount factor is not necessarily point identified. We then give two examples (Examples \ref{ex:zurcher} and \ref{ex:dixit}) of optimal stopping problems with single action one-period dependence, which are point identified by Theorem \ref{th:finitedependence}. Finally, Example \ref{ex:experience} demonstrates that single action one-period dependence is not necessary for point identification. It is a labor supply model that does not exhibit such one-period dependence, but in which monotonicity of the moment condition in the discount factor gives point identification. A number of empirical studies of demand for health care insured under Medicare Part D base their identification on nonlinearities in the price schedules. Our first example describes an empirical strategy from this literature in which the primitive utility exclusion restriction seems plausibly met. \begin{example}\label{ex:medicare} As part of an informal identification argument, \cite{einavetal15} observed that changes in purchase behaviour around kinks in the price of insurance are informative on time preferences. In the data, insurees pay 25\% of additional expenditures out of pocket as long as their total yearly expenditures range between \$275 and \$2510, but contribute 100\% to all expenditures between \$2510 and \$5726. A myopic insuree would change her spending only after her total spending hits $\$2510$ and her out-of-pocket contributions increase. In contrast, a forward looking insuree who is close to the kink late in the year would limit her spending before hitting the increase in contributions. Changes in the propensity to spend towards the end of the year for those close to the kink are therefore taken to be informative on the discount factor. This argument can be represented as an exclusion restriction. Let $x$ be the yearly expenditure, a state controlled by the choice of filling prescriptions. The utility $u_k(x)$ of a particular drug purchase $k$ is assumed constant for two expenditure levels $\tilde x_1 < \tilde x_2$ in $[275, 2510)$. Along with variation in expected future expenses because of the kinked price schedule, the exclusion restriction gives set identification by Theorem \ref{th:ident}.\footnote{\cite{gowrisankarantown15} used a similar argument to identify salience and myopia in a dynamic discrete choice model with parametric utility applied to Medicare Part D data.} \end{example} The next example is from \cite{rossi18} which studied the effect of reward programs on gasoline sales using a dynamic discrete choice model. \begin{example}\label{ex:loyaltyprogram} In each period, a consumer can choose to buy gasoline ($k = 1$), or not ($k = K$). Consumers accumulate reward points $x$ by registering their gasoline purchases. The accumulated points can be traded against nonpecuniary rewards at various point thresholds $\underline x$. \citeauthor{rossi18} observed that the purchase frequency is accelerating in the accumulated points. By assuming that the current period payoff of a gasoline purchase at any price $\tilde y$ is independent of the accumulated points, i.e. that $u_k(\tilde y,\tilde x_1) = u_k(\tilde y, \tilde x_2)$ for all $\tilde y$ and $\tilde x_1, \tilde x_2 \in [0,\underline x)$, the purchase acceleration is informative on the discount factor. The closer the consumer is to qualify for a given reward, the less the future reward is discounted. This makes a current purchase more attractive and predicts a purchase frequency that is increasing in the reward points. \end{example} We next turn to optimal stopping problems. The first example is the bus engine replacement problem of \citet{ecta87:rust}. Though the plausibility of the exclusion restriction is questionable in this particular application, it illustrates how one-period dependence gives point identification in a well-known application of an optimal stopping model. \begin{example}\label{ex:zurcher} \citet{ecta87:rust} studied Harold Zurcher's management of a fleet of (independent) buses. In each period, Zurcher can either operate a bus as usual ($d=1$) or renew its engine ($d=K=2$). The payoff from operating the bus as usual depend on its mileage $x$ since last renewal, which both Zurcher and \citeauthor{ecta87:rust} observe, and an additive and independent shock. Renewal incurs a cost that is independent of mileage and resets mileage to $x_1=0$: \[ \mathbf{Q}_K=\left[\begin{array}{cccc} 1&\cdots&0&0\\ \vdots&&\vdots&\vdots\\ 1&\cdots&0&0 \end{array}\right]. \] In terms of Section \ref{ss:finitedep}'s finite dependence, mileage is single action ($K$) one-period dependent on both initial mileage and the initial renewal choice. Consequently, Zurcher's expected discounted payoffs from renewal do not depend on mileage. In particular, with our normalization $\mathbf{u}_K=\mathbf{0}$, $v^*_K(\tilde{x})=\beta \left(m(x_1) + v^*_K(x_1)\right)$ for all $\tilde{x}\in{\cal X}$. Since $v^*_K(\tilde{x})$ does not vary with $\tilde x$, $[\mathbf{Q}_1-\mathbf{Q}_K]\mathbf{v}_K=\mathbf{0}$, and $U_1(\tilde x) = u_1^*(\tilde x)$. Therefore, if we assume $u^*_1(\tilde x_1)=u^*_1(\tilde x_2)$, which may be questionable in this application, \citeauthor{ecta02:magnacthesmar}'s exclusion restriction holds and its identification result applies.\footnote{Since mileage is the only observed state variable in this application, $u^*_1(\tilde x_1)=u^*_1(\tilde x_2)$ requires that the current payoffs from operating a bus are the same at $\tilde x_1$ and $\tilde x_2$ miles, for example because $\tilde x_1$ and $\tilde x_2$ lie on a known flat segment of Harold Zurcher's cost curve.} Its rank condition (\ref{eq:rankMT}) simplifies to \[ \left[\mathbf{Q}_1(\tilde x_1)- \mathbf{Q}_1(\tilde x_2)\right]\mathbf{m}\neq 0. \] That is, it simply requires that the expected next period's excess surplus differs between states $\tilde x_1$ and $\tilde x_2$ under continued operation of the bus (choice 1). \end{example} Example \ref{ex:zurcher}'s analysis of optimal renewal extends to optimal stopping problems in which stopping ends the decision problem. For example, in \cites{ecta92:hopenhayn} model of firm dynamics with free entry, active firms solve optimal stopping problems in which they value exit $K$ at $\mathbf{v}_K=\mathbf{0}$. As in Example \ref{ex:zurcher}, the fact that $v^*_K(\tilde x)$ is constant in $\tilde x$ ensures that the expectation contrast $[\mathbf{Q}_1-\mathbf{Q}_K]\mathbf{v}_K=\mathbf{0}$, so that $U_1(\tilde x) = u_1^*(\tilde x)$. Of course, $[\mathbf{Q}_1-\mathbf{Q}_K]\mathbf{v}_K$ may equal zero even if $v^*_K(\tilde x)$ varies with $\tilde x$, in particular if the state is single action ($K$) one-period dependent on choices $1$ and $K$. \begin{example} \label{ex:dixit} Consider a discrete time, econometric implementation of \cites{jpe89:dixit} model of firm entry and exit.\footnote{\cite{ddc15:abbringklein} presented this example's model with state independent entry costs, code for its estimation, and exercises that can be used in teaching dynamic discrete choice models.} In each period, a firm chooses to either serve the market ($d=1$) or not ($d=K=2$). Its payoffs from serving the market depend on $x=(y,d_{-1})$, where $y$ is a profit shifter that follows an exogenous Markov process (that is, $y$ may affect choices but is not controlled by them) and $d_{-1}$ is the firm's choice in the previous period. The entry costs in profit state $\tilde y$ equal the difference between an incumbent's profit from serving the market and a new entrant's profit from doing so, $u^*_1(\tilde y,1)-u^*_1(\tilde y,K)$, which we assume to be nonnegative. As before, we set $\mathbf{u}_K=\mathbf{0}$, so that the exit costs $u^*_K(\tilde y,K)-u^*_K(\tilde y,1)$ are zero. The firm's value $v^*_K(y',k)$ from choosing inactivity ($K$) next period after choosing $d=k$ now may vary with next period's profit state $y'$, because the firm will have the option to reenter the market and this option's value may depend on $y'$. However, because exit costs are zero, this value does not depend on the current choice $k$: $v^*_K(y',1)=v^*_K(y',K)$. Moreover, by the assumption that $y$ follows an exogenous Markov process, the distribution of $y'$ given $(y,d_{-1},d=k)$ is independent of the current choice $k$ and the past choice $d_{-1}$, so that \begin{equation} \label{eq:QvDixit} \mathbf{Q}_1(\tilde x)\mathbf{v}_K=\mathbb{E}\left[v^*_K(y',1) \;\vline\; y=\tilde y\right] =\mathbb{E}\left[v^*_K(y',K) \;\vline\; y=\tilde y\right]=\mathbf{Q}_K(\tilde x)\mathbf{v}_K \end{equation} \noindent for all $\tilde x=(\tilde y,\tilde d_{-1})\in{\cal X}$. Consequently, as in Example \ref{ex:zurcher}, $[\mathbf{Q}_1(\tilde x)-\mathbf{Q}_K(\tilde x)]\mathbf{v}_K=0$ and $U_1(\tilde x) = u_1^*(\tilde x)$. Note that, in this case, the state $x=(y,d_{-1})$ is single action ($K$) one-period dependent on choices $1$ and $K$ (but generally not on initial states). An exclusion restriction $u_1^*(\tilde x_1)=u_1^*(\tilde x_2)$ implies \eqref{eq:diffMT} and, under rank condition \eqref{eq:rankMT}, point identification of $\beta$. Because $y$ evolves independently of current and past choices, \begin{equation} \label{eq:QmDixit} \mathbf{Q}_k(\tilde x)\mathbf{m}=\mathbb{E}\left[m(y',k) \;\vline\; y=\tilde y\right]. \end{equation} \noindent Thus, the rank condition is equivalent to \begin{equation} \label{eq:rankDixit} \mathbb{E}\left[m(y',1)-m(y',K)\;\vline\; y=\tilde y_1\right]\not=\mathbb{E}\left[m(y',1)-m(y',K)\;\vline\; y=\tilde y_2\right]. \end{equation} \noindent It immediately follows that identification requires that $\tilde y_1\not =\tilde y_2$ in this case. A difference in lagged choices alone would not suffice, because these do not help predict next period's profit state $y'$ given the current profit state $y$ and choice $d=k$ nor directly affect next period's excess surplus. Moreover, identification fails if entry costs are zero; that is, if $u_1^*(\tilde y,1)=u_1^*(\tilde y,K)$. In this case, payoffs do not depend on past choices and, more specifically, $m(y',1)=m(y',K)$. Intuitively, without entry and exit costs, firms can ignore past and future when deciding on entry and exit and simply maximize the current profits in each period. Consequently, their entry and exit choices carry no information on their discount factor. As an aside, note that the entry costs are directly identified from \[ \ln\left(p_1(\tilde x_1)/p_K(\tilde x_1)\right) - \ln\left(p_1(\tilde x_2)/p_K(\tilde x_2)\right)= u_1^*(\tilde y,1)- u_1^*(\tilde y,K) \] \noindent for $\tilde x_1=(\tilde y,1)$ and $\tilde x_2=(\tilde y,K)$. Intuitively, for given profit state $\tilde y$, lagged choices only affect current payoffs through the entry costs and have no effect on expected future payoffs, as is clear from \eqref{eq:QvDixit} and \eqref{eq:QmDixit}. Finally, if both $\tilde y_1\not =\tilde y_2$ and entry costs are strictly positive, \eqref{eq:rankDixit} will generally be satisfied. In specific applications, we can verify \eqref{eq:rankDixit} using that both the distribution of $y'$ conditional on $y$ and $m(y',k)=-\ln\left(p_K(y',k)\right)$ can directly be estimated from choice and profit state transition data. As in Zurcher's problem, profit states are typically ordered, so that an exclusion restriction like $u_1^*(\tilde x_1)=u_1^*(\tilde x_2)$ may be justified as a local shape restriction on the firm's utility function. Alternatively, because the firm's utility is a cardinal payoff, we may be able to exploit that $u^*_1(\tilde x)$ is known in some state $\tilde x$. For example, if $u_1^*(\tilde x)=0$, then \eqref{eq:diffAD} holds with $k=1$, $l=K$, and $\tilde x_1=\tilde x_2=\tilde x=(\tilde y,\tilde d_{-1})$ and reduces to \[ \ln\left(p_1(\tilde x)\right)-\ln\left(p_K(\tilde x)\right)=\beta\mathbb{E}\left[m(y',1)-m(y',K)\;\vline\; y=\tilde y\right], \] \noindent so that $\beta$ is identified if $\mathbb{E}\left[m(y',1)-m(y',K)\;\vline\; y=\tilde y\right]\not=0$. This rank condition is generally satisfied if entry costs are positive. \end{example} In Examples \ref{ex:zurcher} and \ref{ex:dixit}, the rank condition ensures that the shift in expected surplus contrasts that multiplies $\beta$ in the right hand side of \eqref{eq:diffAD} is nonzero. Because these examples satisfy one-period dependence, this shift does not depend on $\beta$ itself, and this suffices for point identification. More generally, even if the state is not one-period dependent, strict monotonicity of the right hand side of (\ref{eq:diffAD}), as in Example \ref{ex:needNoMT}, suffices for point identification (that is, ensures that a solution is unique if it exists). It is easy to derive conditions that imply such strict monotonicity, and thus point identification, and that do not involve $\beta$. Without loss of generality--- we can freely interchange states $\tilde x_1$ and $\tilde x_2$ and switch choices $k$ and $l$--- we focus on conditions under which it is strictly increasing or, equivalently, its derivative with respect to $\beta$ is positive:\footnote{Denoting $\Delta^2\mathbf{Q}\equiv \mathbf{Q}_k(\tilde x_1)-\mathbf{Q}_K(\tilde x_1)- \mathbf{Q}_l(\tilde x_2)+\mathbf{Q}_K(\tilde x_2)$, we have that \begin{align*} \frac{\partial}{\partial\beta} \beta\Delta^2\mathbf{Q}\left[\mathbf{I}-\beta \mathbf{Q}_K\right]^{-1}\mathbf{m} & = \Delta^2 \mathbf{Q} [\mathbf{I} - \beta \mathbf{Q}_K]^{-1}\mathbf{m} + \beta \Delta^2 \mathbf{Q} \frac{\partial [\mathbf{I} - \beta \mathbf{Q}_K]^{-1}}{\partial \beta} \mathbf{m} \\ & = \Delta^2 \mathbf{Q} [\mathbf{I} - \beta \mathbf{Q}_K]^{-1}\mathbf{m} + \beta \Delta^2 \mathbf{Q} [\mathbf{I} - \beta \mathbf{Q}_K]^{-1}\mathbf{Q}_K [\mathbf{I} - \beta \mathbf{Q}_K]^{-1}\mathbf{m} \\ & = \Delta^2 \mathbf{Q}[\mathbf{I} + (\mathbf{I} - \beta \mathbf{Q}_K)^{-1}\beta\mathbf{Q}_K][\mathbf{I} - \beta \mathbf{Q}_K]^{-1}\mathbf{m} = \Delta^2 \mathbf{Q}[\mathbf{I}- \beta \mathbf{Q}_K]^{-2}\mathbf{m}. \end{align*} } \[ \left[\mathbf{Q}_k(\tilde x_1)-\mathbf{Q}_K(\tilde x_1)- \mathbf{Q}_l(\tilde x_2)+\mathbf{Q}_K(\tilde x_2)\right] \left[\mathbf{I}-\beta \mathbf{Q}_K\right]^{-2}\mathbf{m}>0. \] For this, it suffices that \begin{equation}\label{eq:rankmonotone} \left[\mathbf{Q}_k(\tilde x_1)-\mathbf{Q}_K(\tilde x_1)- \mathbf{Q}_l(\tilde x_2)+\mathbf{Q}_K(\tilde x_2)\right] \mathbf{Q}_K^r\mathbf{m}\geq 0\text{ for all }r\in\{0,1,2,\ldots\}, \end{equation} with the inequality strict for at least one $r$. Like \citeauthor{ecta02:magnacthesmar}'s rank condition (\ref{eq:rankMT}), these conditions do not depend on $\beta$. It is easy to verify that they hold in Example \ref{ex:needNoMT} (which is specified in the Note to Figure \ref{fig:needNoMT}). \begin{figure}[t] \caption{Example of a Dynamic Labor Supply Model that Gives a Monotone Moment Condition\label{fig:experience}} \centering \medskip \begin{tikzpicture} \begin{axis}[width=12cm,height=7.5cm, name=llherr, xlabel={$\beta$}, axis x line=bottom, every outer x axis line/.append style={-,color=gray,line width=0.75pt}, axis y line=left, every outer y axis line/.append style={-,color=gray,line width=0.75pt}, xtick={0, 0.80}, xticklabels={$0$,$ 0.80$}, ytick={0,0.4918}, yticklabels={$0$,$0.4918$}, every tick/.append style={line width=0.75pt}, xmin=0, xmax=1, ymin=0, ymax=1, scaled ticks=false, /pgf/number format/precision=2, /pgf/number format/set thousands separator={}] \draw[color=black!75,line width=0.75pt,solid] (axis cs:0,0.4918) -- (axis cs:1,0.4918); \draw[color=blue!75,line width=0.75pt,dotted] (axis cs: 0.80,0) -- (axis cs: 0.80,0.4918); \addplot[color=blue!75,smooth,mark=,line width=0.75pt] table[x=beta,y=rhs,col sep=comma]{matlab/data/experience.csv}; \addplot[color=red!75,dashed,mark=,line width=0.75pt] table[x=beta,y=rhsMT,col sep=comma]{matlab/data/experience.csv}; \end{axis} \end{tikzpicture} \medskip \begin{minipage}{12cm} {\scriptsize Note: For $J= 3$ states, $K= 2$ choices, $k=l=1$, $\tilde{x}_1=x_2$, and $\tilde{x}_2=x_1$, this graph plots the left hand side of (\ref{eq:diffMT}) and (\ref{eq:diffAD}) (solid black horizontal line) and the right hand sides of (\ref{eq:diffMT}) (dashed red line) and (\ref{eq:diffAD}) (solid blue curve) as functions of $\beta$ (we switched the roles of $x_1$ and $x_2$ to ensure a positive choice response and visually line up this example with the others). The data are generated from Example \ref{ex:experience}'s stylized dynamic labor supply model, which gives $\mathbf{Q}_1(x_2)=\left[\begin{array}{ccc} 0.00& 0.25& 0.75\end{array}\right]$, $\mathbf{Q}_1(x_1)=\left[\begin{array}{ccc} 0.25& 0.75& 0.00\end{array}\right]$,} {\scriptsize \vspace*{-3ex} \[\mathbf{Q}_K=\left[\begin{array}{ccc} 1.00& 0.00& 0.00\\ 0.50& 0.50& 0.00\\ 0.00& 0.50& 0.50\end{array}\right]\text{, }\mathbf{p}_1=\left[\begin{array}{ccc} 0.44\\ 0.56\\ 0.71\end{array}\right] \text{, and }\mathbf{p}_K=\left[\begin{array}{ccc} 0.56\\ 0.44\\ 0.29\end{array}\right].\] Consequently, the left hand side of (\ref{eq:diffMT}) and (\ref{eq:diffAD}) equals $\ln\left(p_1(x_2)/p_K(x_2)\right) - \ln\left(p_1(x_1)/p_K(x_1)\right)= 0.4918$. Moreover, $\mathbf{m}'=\left[\begin{array}{ccc} 0.57& 0.82& 1.23\end{array}\right]$ and $\mathbf{Q}_1(x_2)-\mathbf{Q}_K(x_2)- \mathbf{Q}_1(x_1)+\mathbf{Q}_K(x_1)=\left[\begin{array}{ccc} 0.25& -1.00& 0.75\end{array}\right]$, so that the slope of the dashed red line equals $\left[\mathbf{Q}_1(x_2)-\mathbf{Q}_K(x_2)- \mathbf{Q}_1(x_1)+\mathbf{Q}_K(x_1)\right] \mathbf{m}=0.2465$. A unique value of $\beta$, $ 0.80$, solves (\ref{eq:diffAD}), but (\ref{eq:diffMT}) has no solution.} \end{minipage} \end{figure} The final example relies on a type of payoff monotonicity that is common in models with ordered states. \begin{example}\label{ex:experience} In \citeauthor{res89:ecksteinwolpin}'s dynamic model of female labor force participation, women work both to directly earn wages and to invest in work experience that pays off later. Consider a highly stylized and stationary variant of this model. Each period, a woman either works ($d=1$) or shirks ($d=2=K$). Work experience takes three levels, ``novice'' ($x_1$), ``learning'' ($x_2$), and ``seasoned'' ($x_3$). If a woman works and is not yet seasoned, her experience increases one level with probability $ 0.75$ and stays the same with the complementary probability. If instead she shirks, and is not a novice, she falls back one level of experience with probability $ 0.50$ and keeps her experience otherwise. Work gives utility $u_1(x_1)=u_1(x_2)=-0.50$ if novice or learning and $u_1(x_3)=0.50$ if seasoned. Women maximize their flow of expected utility, discounted with a factor $ 0.80$. Figure \ref{fig:experience} gives the data implied by this example and plots the moment condition corresponding to the constraint that $u_1(x_1)=u_1(x_2)$. This constraint implies that novices and learning workers earn the same current utility. Nevertheless, work is more attractive to a learning woman, because she has a good shot at earning the higher wage for seasoned workers next period if she works now; moreover, unlike a novice, she may lose experience if she shirks. Seasoned workers, despite the fact that they cannot further increase their experience, are sufficiently motivated by the higher earnings and the risk that their human capital depreciates to work even more. Consequently, $p_K(x_1)>p_K(x_2)>p_K(x_3)$, so that $m(x_1)<m(x_2)<m(x_3)$. More generally, because $\mathbf{Q}_K$ is increasing, the expected excess surplus after $r$ rounds of shirking and human capital depreciation, $\mathbf{Q}_K^r\mathbf{m}$, is increasing in initial experience. In this example, the dependence of (the distribution of) a worker's experience on initial choices and experience levels does not disappear in a finite number of periods of, e.g., shirking.\footnote{In a similar context, \citet{res98:altugmiller} impose such finite dependence by assuming that wages and the utility cost from work only depend on a finite employment history. Our example would display single action ($K$) one-period dependence on initial choices in state $x_1$ and two-period dependence in state $x_2$ if shirking women would for sure see their experience drop by one level. Note that this would still not suffice to reduce the moment condition to \citeauthor{ecta02:magnacthesmar}'s linear moment condition.} In particular, experience is not single action ($K$) one-period dependent on initial choices in states $x_1$ and $x_2$ and \citeauthor{ecta02:magnacthesmar}'s current value restriction and linear moment condition do not hold. Nevertheless, this example's monotonicity ensures that the discount factor is point identified. Because working, compared to shirking, affects the experience of a learning worker more than that of a novice with nothing to lose ($[\mathbf{Q}_1(x_2)-\mathbf{Q}_K(x_2)- \mathbf{Q}_1(x_1)+\mathbf{Q}_K(x_1)]=$ $[0.25$~$-1.00$~$0.75$]) and $\mathbf{Q}_K^r\mathbf{m}$ is increasing for all $r$, \eqref{eq:rankmonotone} holds. Consequently, the moment condition is monotone in $\beta$ and has only one solution, $ 0.80$. \end{example} \subsection{Extension to nonstationary models} \label{ss:finitehorizon} Our analysis extends to nonstationary models, such as that in \citeauthor{jpe97:keanewolpin}, with minor modifications. In fact, nonstationary models offer useful identification strategies that are not available for stationary models. Unlike in stationary models, an assumption of stationary utilities has identifying power in nonstationary models. A common version of this argument is that the utilities can be identified in the last period, say $T$, so that the discount factor is subsequently identified in the next to last period \citep[e.g.][]{yaoetal12}. This argument assumes stationary utilities, which can be cast as an exclusion restriction on time as a state variable, i.e. $u_{i,T-1}(\tilde x) = u_{i, T}(\tilde x)$, where time shifts the continuation values without shifting the primitive utilities. \cite{qme2016:bajarietal} used the assumption of stationary utilities to formally establish identification in a finite-horizon optimal stopping model. Theorem \ref{th:finitehorizon} below extends \citeauthor{qme2016:bajarietal}'s result beyond optimal stopping problems and also allows for identification of models with nonstationary utilities.\footnote{\citeauthor{yaoetal12} showed identification of the discount factor in a dynamic model with continuous controls under the assumption of stationary utilities and conjectured a similar result for discrete controls. Theorem \ref{th:finitehorizon} proves its conjecture.} Denote time by $t\in\{1,2,\ldots,T\}$, with terminal period $T<\infty$, and index $u^*_{k,t}$, $\mathbf{u}_{k,t}$, $\mathbf{m}_t$, and $\mathbf{v}_{k,t}$ by time. For ease of exposition, we maintain the assumption of stationary Markov transition matrices $\mathbf{Q}_k$, but the results extend to nonstationary distributions. The choice-$k$ specific values now satisfy \begin{align} \label{eq:vkt} \mathbf{v}_{k,t}& = \mathbf{u}_{k,t} + \beta \mathbf{Q}_k \left[\mathbf{m}_{t+1}+\mathbf{v}_{K,t+1}\right] \end{align} for $t=1,\ldots,T-1$; with terminal condition $\mathbf{v}_{k,T}=\mathbf{u}_{k,T}$. With the normalization $\mathbf{u}_{K,t}=\mathbf{0}$ for all $t$, this gives \begin{align}\label{eq:FHreducedform} \ln \left(p_{k,t}(\tilde{x})\right)-\ln \left(p_{K,t}(\tilde{x})\right) & = u^*_{k,t}(\tilde x) + \beta[\mathbf{Q}_k(\tilde x)- \mathbf{Q}_K(\tilde x)][\mathbf{m}_{t+1} + \mathbf{v}_{K,t+1}] \end{align} for all $k\in {\cal D}\backslash\{K\}$ and $\tilde x \in {\cal X}$. Finally, using \eqref{eq:vkt} and the normalization $\mathbf{u}_{K,t}=\mathbf{0}$ for all $t$, we can write the value of the reference choice $K$ as \begin{align} \label{eq:vcapKt} \mathbf{v}_{K,t} = \sum^{T}_{\tau = t+1} (\beta \mathbf{Q}_K)^{\tau- t}\mathbf{m}_{\tau}, \end{align} \noindent where we use the convention that $\sum_{\tau=T+1}^T\cdot=0$ (so that indeed $\mathbf{v}_{K,T}=\mathbf{u}_{K,T}=0$). \begin{theorem}\label{th:finitehorizon} Suppose that \begin{align}\label{eq:FHexclusionrestriction} u^*_{k,t}(\tilde x_1) & = u^*_{l,t'}(\tilde x_2) \end{align} for $k\in{\cal D}/\{K\}$, $l \in {\cal D}$, $\tilde x_1 \in {\cal X}$, $\tilde x_2\in{\cal X}$, $1\leq t'<T$, and $t'\leq t\leq T$; with either $k \neq l$, or $\tilde x_1 \neq \tilde x_2$, or $t' < t$, or a combination of the three. If either $p_{k,t}(\tilde x_1)/p_{K,t}(\tilde x_1) \not= p_{l,t'}(\tilde{x}_2)/p_{K,t'}(\tilde x_2)$ or \begin{align}\label{eq:FHregularitycondition} [\mathbf{Q}_k(\tilde x_1)- \mathbf{Q}_K(\tilde x_1)]\mathbf{m}_{t+1} - [\mathbf{Q}_l(\tilde x_2) - \mathbf{Q}_K(\tilde x_2)]\mathbf{m}_{t'+1} \neq 0, \end{align} then there are no more than $T-t'$ points in the identified set. \end{theorem} \begin{proof} Differencing \eqref{eq:FHreducedform} corresponding to \eqref{eq:FHexclusionrestriction} and substituting in \eqref{eq:vcapKt} gives \begin{align}\label{eq:timehomogeneity} \ln \left(p_{k,t}(\tilde x_1)/p_{K,t}(\tilde x_1)\right) &- \ln \left(p_{l,t'}(\tilde{x}_2)/p_{K,t'}(\tilde x_2)\right) = \\ \beta \Bigg(&\left[\mathbf{Q}_k(\tilde x_1)- \mathbf{Q}_K(\tilde x_1)\right]\Big[\sum^{T}_{\tau = t+1} (\beta \mathbf{Q}_K)^{\tau- t-1}\mathbf{m}_{\tau} \Big] - \nonumber\\ &\left[\mathbf{Q}_l(\tilde x_2) - \mathbf{Q}_K(\tilde x_2)\right] \Big[ \sum^{T}_{\tau = t'+1} (\beta \mathbf{Q}_K)^{\tau- t'-1}\mathbf{m}_{\tau}\Big]\Bigg). \nonumber \end{align} For given choice and transition probabilities, the right hand side of \eqref{eq:timehomogeneity} minus its left hand side is a polynomial of order $T-t'$ in $\beta$. If this polynomial is nonconstant, then by the fundamental theorem of algebra, it has has up to $T-t'$ real roots, which is an upper bound on the number of points in the identified set. To show that \eqref{eq:timehomogeneity} is nonconstant under the stated assumptions, note first that the right hand side of \eqref{eq:timehomogeneity} is zero at $\beta = 0$. If the left hand side is nonzero, the polynomial is nonconstant. If the left hand side is zero, then the rank condition \eqref{eq:FHregularitycondition} ensures that the derivative of the right hand side is nonzero at $\beta=0$, so that the right hand side, and thus the polynomial, is nonconstant. \end{proof} Rank condition \eqref{eq:FHregularitycondition} adapts \eqref{eq:rank} to the nonstationary case. Unlike the stationary dynamic choice problem, the nonstationary problem does not require that the discount factor lies in $[0,1)$. We leave the definition of the domain of the discount factor to the reader. In a study of identification in nonstationary models, \cite{arcidiaconomillerlongshort} distinguished between identification in long panels, which include the terminal period, and short panels, which do not. In general, Theorem \ref{th:finitehorizon} requires long panels. However, for models with $\rho$-period dependence, it also applies to short panels that extend to at least period $t+\rho$. For instance, in Zurcher's renewal problem with a finite horizon, mileage is still single action ($K$) one-period dependent, so that the discount factor can be point identified in short panels until period $t+1$. \section{Empirical content}\label{s:empiricalcontent} The previous section focused on identification and gave conditions under which the primitives can be recovered from the data. In applications, we need to entertain the possibility that the model is misspecified and did not generate the data to begin with. It is well known that the unrestricted model has no empirical content: It can rationalize any choice data $\{\mathbf{p}_k,\mathbf{Q}_k;k\in{\cal D}\}$. This section shows that the model under exclusion restrictions can be rejected by data. The standard result for the unrestricted stationary model follows from a version of \citeauthor{ecta02:magnacthesmar}'s Proposition 2: For any given data $\{\mathbf{p}_k,\mathbf{Q}_k;k\in{\cal D}\}$, $\mathbf{u}_K=\mathbf{0}$, and $\beta\in[0,1)$, there exists a unique set of primitive utilities $\{\mathbf{u}_k,k\in{\cal D}/\{K\}\}$ that rationalizes the data. Specifically, $\mathbf{m}=-\ln\mathbf{p}_K$. Then, $\mathbf{v}_K$ follows from $\mathbf{u}_K=\mathbf{0}$ and \eqref{eq:vK}. Next, by \eqref{eq:choiceprobinversion}, $\mathbf{v}_k=\mathbf{v}_K+\ln\mathbf{p}_k-\ln\mathbf{p}_K$ for $k\in{\cal D}/\{K\}$ ensures that the value functions are compatible with the choice probability data. In turn, by \eqref{eq:bellmanprobs}, these value functions are uniquely generated by the primitive utilities $\mathbf{u}_k=\mathbf{v}_k-\beta \mathbf{Q}_k\left[\mathbf{m}+\mathbf{v}_K\right]$ for $k\in{\cal D}/\{K\}$ (note that $\mathbf{v}_K$ was already set to be consistent with $\mathbf{u}_K=\mathbf{0}$). This result justifies our focus on the identification of the discount factor $\beta$ in the previous section: Once the discount factor is identified, we can find unique primitive utilities that rationalize the data. The empirical consequences of a violation of the assumed exclusion restriction can manifest themselves in two distinct ways. First, in some cases, it may be possible to find primitives that satisfy the false exclusion restriction. If so, these primitives will in general not equal the true primitives. Because we can find primitive utilities that rationalize the data for any discount factor, the data can be of no help in determining the right restriction in this case. Instead, we need to argue for the identifying assumption on other grounds. Second, there may not exist discount factors in their domain that are compatible with the data under the assumed exclusion restriction. The subset of the possible data that can be rationalized under an exclusion restriction can be very small. For instance, in a binary choice model with $J = 2$ and $u^*_1(x_1) = u^*_1(x_2)$, the model cannot generate any state-dependent value contrasts. It follows that this model cannot rationalize any state-dependent choice data. In empirical practice, this may force parameter estimates to lie outside their theoretical domains. In turn, this may lead researchers to statistically reject the model and conclude that at least one of its assumptions is violated. While some solution methods, such as typical nested fixed point algorithms, impose the restriction that $\beta \in [0,1)$, it is easy to use the moment conditions in \eqref{eq:diffAD} for model testing as their computation do not restrict the values $\beta$ can take. The empirical content of the identified model also gives some scope to test nonnested identifying assumptions against each other. For example, the data in Example \ref{ex:needNoMT} cannot be rationalized under \citeauthor{ecta02:magnacthesmar}'s current value restriction, but are consistent with an exclusion restriction on primitive utility. Conversely, it is easy to construct data that are inconsistent with the primitive utility restriction, yet can be rationalized by primitives that satisfy the current value restriction. \begin{example} \label{ex:moreEmpiricalContent} Figure \ref{fig:moreEmpiricalContent} displays the left and right hand sides of \citeauthor{ecta02:magnacthesmar}'s moment condition in \eqref{eq:diffMT} and ours in \eqref{eq:diffAD}. There is a $\beta\in[0,1)$ that solves \eqref{eq:diffMT}, but the moment condition in \eqref{eq:diffAD} cannot be met. Intuitively, the increasingly negative contribution of the second (value of choice $K$) term in the right hand side of \eqref{eq:diffAD} limits the possible log choice probability ratio response to the change in states to a level below the observed response. \end{example} \begin{figure}[t] \caption{Example of Data that are Consistent with an Exclusion Restriction on Current Values but Not with One on Primitive Utility\label{fig:moreEmpiricalContent}} \medskip \centering \begin{tikzpicture} \begin{axis}[width=12cm,height=7.5cm, name=llherr, xlabel={$\beta$}, axis x line=bottom, every outer x axis line/.append style={-,color=gray,line width=0.75pt}, axis y line=left, every outer y axis line/.append style={-,color=gray,line width=0.75pt}, xtick={0, 0.72}, xticklabels={$0$,$ 0.72$}, ytick={0,0.0800}, yticklabels={$0$,$0.0800$}, every tick/.append style={line width=0.75pt}, xmin=0, xmax=1, ymin=-0.1278, scaled ticks=false, /pgf/number format/precision=2, /pgf/number format/set thousands separator={}] \draw[color=black!75,line width=0.75pt,solid] (axis cs:0,0.0800) -- (axis cs:1,0.0800); \draw[color=black!75,line width=0.75pt,dashed] (axis cs:0,0) -- (axis cs:1,0); \addplot[color=blue!75,smooth,mark=,line width=0.75pt] table[x=beta,y=rhs,col sep=comma]{matlab/data/moreEmpiricalContent.csv} ; \addplot[color=red!75,dashed,mark=,line width=0.75pt] table[x=beta,y=rhsMT,col sep=comma]{matlab/data/moreEmpiricalContent.csv} ; \draw[color=red!75,line width=0.75pt,dotted] (axis cs: 0.72,-0.1278) -- (axis cs: 0.72,0.0800); \end{axis} \end{tikzpicture} \medskip \begin{minipage}{12cm} {\scriptsize Note: For $J= 3$ states, $K= 2$ choices, $k=l=1$, $\tilde{x}_1=x_1$, and $\tilde{x}_2=x_2$, this graph plots the left hand side of (\ref{eq:diffMT}) and (\ref{eq:diffAD}) (solid black horizontal line) and the right hand sides of (\ref{eq:diffMT}) (dashed red line) and (\ref{eq:diffAD}) (solid blue curve) as functions of $\beta$. The data are $\mathbf{Q}_1(\tilde{x}_1)=\left[\begin{array}{ccc} 0.25& 0.25& 0.50\end{array}\right]$, $\mathbf{Q}_1(\tilde{x}_2)=\left[\begin{array}{ccc} 0.00& 0.25& 0.75\end{array}\right]$,} {\scriptsize \vspace*{-3ex} \[\mathbf{Q}_K=\left[\begin{array}{ccc} 0.90& 0.00& 0.10\\ 0.00& 0.90& 0.10\\ 0.00& 1.00& 0.00\end{array}\right]\text{, }\mathbf{p}_1=\left[\begin{array}{ccc} 0.50\\ 0.48\\ 0.10\end{array}\right]\text{, and }\mathbf{p}_K=\left[\begin{array}{ccc} 0.50\\ 0.52\\ 0.90\end{array}\right].\] Consequently, the left hand side of (\ref{eq:diffMT}) and (\ref{eq:diffAD}) equals $\ln\left(p_1(x_1)/p_K(x_1)\right) - \ln\left(p_1(x_2)/p_K(x_2)\right)= 0.0800$. Moreover, $\mathbf{m}'=\left[\begin{array}{ccc} 0.69& 0.65& 0.11\end{array}\right]$ and $\mathbf{Q}_1(x_1)-\mathbf{Q}_K(x_1)- \mathbf{Q}_1(x_2)+\mathbf{Q}_K(x_2)=\left[\begin{array}{ccc} -0.65& 0.90& -0.25\end{array}\right]$, so that the slope of the dashed red line equals $\left[\mathbf{Q}_1(x_1)-\mathbf{Q}_K(x_1)- \mathbf{Q}_1(x_2)+\mathbf{Q}_K(x_2)\right] \mathbf{m}=0.1116$. A unique value of $\beta$, $ 0.72$, solves (\ref{eq:diffMT}), but (\ref{eq:diffAD}) has no solution.} \end{minipage} \end{figure} \noindent In practice, we can easily establish whether given data are consistent with one exclusion restriction or the other by verifying whether the corresponding moment condition, \eqref{eq:diffMT} or \eqref{eq:diffAD}, or its empirical analog has a solution $\beta\in[0,1)$. We can formally test either exclusion restriction with a test of the null hypothesis that $\beta \in[0,1)$. Finally, the empirical content of the nonstationary model depends on the chosen domain of the discount factor. Therefore, we limit our discussion of this model's empirical content to noting that Theorem \ref{th:finitehorizon} does not guarantee a real root (and less so one in a specified domain for $\beta$) for general choice and state probabilities. \section{Multiple exclusion restrictions and inference} \label{s:multiple} \begin{figure}[t] \caption{Example with Two Moment Conditions of Which One Identifies the Discount Factor\label{fig:oneRedundant}} \centering \medskip \begin{tikzpicture} \begin{axis}[width=12cm,height=7.5cm, name=llherr, xlabel={$\beta$}, axis x line=bottom, every outer x axis line/.append style={-,color=gray,line width=0.75pt}, axis y line=left, every outer y axis line/.append style={-,color=gray,line width=0.75pt}, xtick={0, 0.30, 0.65}, xticklabels={$0$,$ 0.30$,$ 0.65$}, ytick={0,0.0187,0.0045}, yticklabels={$0$,$0.0187$,$0.0045$}, every tick/.append style={line width=0.75pt}, xmin=0, xmax=1, ymin=0, ymax=0.04, scaled ticks=false, /pgf/number format/precision=2, /pgf/number format/set thousands separator={}] \draw[color=red!75,line width=0.75pt,dashed] (axis cs:0,0.0187) -- (axis cs:1,0.0187); \draw[color=blue!75,line width=0.75pt,solid] (axis cs:0,0.0045) -- (axis cs:1,0.0045); \draw[color=black!75,line width=0.75pt,dotted] (axis cs: 0.30,0) -- (axis cs: 0.30,0.0187); \draw[color=blue!75,line width=0.75pt,dotted] (axis cs: 0.65,0) -- (axis cs: 0.65,0.0045); \addplot[color=red!75,smooth,mark=,line width=0.75pt,dashed] table[x=beta,y=oneRhs,col sep=comma]{matlab/data/oneRedundant.csv}; \addplot[color=blue!75,smooth,mark=,line width=0.75pt,solid] table[x=beta,y=twoRhs,col sep=comma]{matlab/data/oneRedundant.csv}; \end{axis} \end{tikzpicture} \medskip \begin{minipage}{12cm} {\scriptsize Note: For $J= 4$ states, $K= 2$ choices, and $k=l=1$, this graph plots the left (horizontal lines) and right hand sides (curves) of (\ref{eq:diffAD}) as functions of $\beta$, for $\tilde x_1=x_1$ and $\tilde x_2=x_2$ (corresponding to $u_1(x_1) = u_1(x_2)$; dashed red) and $\tilde x_1=x_3$ and $\tilde x_2=x_4$ (corresponding to $u_1(x_3) = u_1(x_4)$; solid blue). The data are} {\scriptsize \vspace*{-3ex} \[\mathbf{Q}_1 = \left[\begin{array}{cccc} 0.40& 0.26& 0.18& 0.18\\ 0.33& 0.29& 0.36& 0.27\\ 0.19& 0.26& 0.18& 0.45\\ 0.08& 0.18& 0.29& 0.09\end{array}\right], \mathbf{Q}_K=\left[\begin{array}{cccc} 0.17& 0.26& 0.13& 0.43\\ 0.13& 0.07& 0.20& 0.60\\ 0.20& 0.30& 0.10& 0.40\\ 0.25& 0.15& 0.50& 0.10\end{array}\right]\text{, }\] \[\mathbf{p}_1^\prime=\left[\begin{array}{cccc} 0.60& 0.59& 0.88& 0.88\end{array}\right] \text{, and }\mathbf{p}_K^\prime=\left[\begin{array}{cccc} 0.40& 0.41& 0.12& 0.12\end{array}\right].\] Consequently, the left hand sides of (\ref{eq:diffAD}) equal $\ln\left(p_1(x_1)/p_K(x_1)\right) - \ln\left(p_1(x_2)/p_K(x_2)\right)= 0.0187$ and $\ln\left(p_1(x_3)/p_K(x_3)\right) - \ln\left(p_1(x_4)/p_K(x_4)\right)= 0.0045$. A unique value of $\beta$, $ 0.30$, solves (\ref{eq:diffAD}) for $\tilde x_1=x_1$ and $\tilde x_2=x_2$ (dashed red). Two values of $\beta$ solve (\ref{eq:diffAD}) for $\tilde x_1=x_3$ and $\tilde x_2=x_4$ (solid blue), of which one coincides with the solution to the first moment condition.} \end{minipage} \end{figure} Often, more than one exclusion restriction is available. In particular, economic intuition for an exclusion restriction across states typically suggests the exclusion of a state {\em variable} from the utility function. For example, the state variable $x$ can be partitioned as $(y,z)$, where $z$ does not affect utilities: $u_k(\tilde y,\tilde z_1)=u_k(\tilde y,\tilde z_2)$ for all $k\in{\cal D}/\{K\}$, $\tilde y$, $\tilde z_1$, and $\tilde z_2>\tilde z_1$.\footnote{We provide a more formal statement of the exclusion of state variables in our discussion of \citeauthor{ier15:fangwang} in \citet{fw19:abbringdaljord}.} This typically gives multiple exclusion restrictions like \eqref{eq:exclusionrestriction}. For example, if choices, $y$, and $z$ are all binary, we have two exclusion restrictions, one for each possible value of $y$. With multiple exclusion restrictions, point identification can be obtained even if each individual moment condition set identifies $\beta$. We give two examples of identification with two exclusion restrictions. \begin{example} \label{ex:oneRedundant} In Figure \ref{fig:oneRedundant}, the moment condition represented by the solid blue line and curve and the one in red dashes have two and one solutions, respectively. Both moment conditions are consistent with a discount factor of $ 0.30$, while the solid moment condition is also consistent with a discount factor of $ 0.65$. The dashed moment condition by itself point identifies the discount factor, while the solid moment condition only set identifies it. In this case, the solid moment condition is redundant for point identification. \end{example} \begin{example} \label{ex:twiceTwo} In Figure \ref{fig:twiceTwo}, the dashed red moment condition holds for discount factors $ 0.17$ and $ 0.90$, while the solid blue moment condition is solved by discount factors $ 0.07$ and $ 0.90$. Each individual moment condition is consistent with two discount factors, but only one discount factor solves both moment conditions. \end{example} With choice and transition probabilities generated from a model that satisfies two (or more) exclusion restrictions, the implied two (or more) moment conditions will always share one solution, the discount factor that was used to generate the data. We conjecture that, generically, the moments will not share any further solutions, because different choice and transition probabilities, which vary freely with the primitive utilities, enter the various moment conditions. Generic point identification is of limited practical value in our context. First, we are not able to a priori characterize the subset of the model space on which point identification fails in terms of economic concepts. Though this subset is small, it may, for all we know, contain economically important models.\footnote{For example, \cites{jpe04:ekelandetal} generic identification result for the hedonic model is particularly instructive because it shows that identification fails exactly for the linear-quadratic special case that is at the center of most applied work.} \begin{figure}[t] \caption{Example with Two Moment Conditions that Jointly Identify the Discount Factor but Individually Do Not\label{fig:twiceTwo}} \centering \medskip \begin{tikzpicture} \begin{axis}[width=12cm,height=7.5cm, name=mom, xlabel={$\beta$}, axis x line=bottom, every outer x axis line/.append style={-,color=gray,line width=0.75pt}, axis y line=left, every outer y axis line/.append style={-,color=gray,line width=0.75pt}, xtick={0, 0.17, 0.90, 0.07}, xticklabels={$0$,$ 0.17$,$ 0.90$,$ 0.07$}, ytick={0,0.0068,0.0019}, yticklabels={$0$,$0.0068$,$0.0019$}, every tick/.append style={line width=0.75pt}, xmin=0, xmax=1, ymin=0, ymax=0.015, scaled ticks=false, /pgf/number format/precision=2, /pgf/number format/set thousands separator={}] \draw[color=red!75,line width=0.75pt,dashed] (axis cs:0,0.0068) -- (axis cs:1,0.0068); \draw[color=blue!75,line width=0.75pt,solid] (axis cs:0,0.0019) -- (axis cs:1,0.0019); \draw[color=black!75,line width=0.75pt,dotted] (axis cs: 0.90,0) -- (axis cs: 0.90,0.0068); \draw[color=red!75,line width=0.75pt,dotted] (axis cs: 0.17,0) -- (axis cs: 0.17,0.0068); \draw[color=blue!75,line width=0.75pt,dotted] (axis cs: 0.07,0) -- (axis cs: 0.07,0.0019); \addplot[color=red!75,smooth,mark=,line width=0.75pt,dashed] table[x=beta,y=oneRhs,col sep=comma]{matlab/data/twiceTwo.csv}; \addplot[color=blue!75,smooth,mark=,line width=0.75pt,solid] table[x=beta,y=twoRhs,col sep=comma]{matlab/data/twiceTwo.csv}; \end{axis} \path(mom.origin) ++(0,-2.7in) coordinate (crit plot position); \begin{axis}[width=12cm,height=7.5cm, name=crit, at = {(crit plot position)}, xlabel={$\beta$}, axis x line=bottom, every outer x axis line/.append style={-,color=gray,line width=0.75pt}, axis y line=left, every outer y axis line/.append style={-,color=gray,line width=0.75pt}, xtick={0, 0.90}, xticklabels={$0$,$ 0.90$}, ytick={0,0.5}, yticklabels={$0$,$0.50$}, every tick/.append style={line width=0.75pt}, xmin=0, xmax=1, ymin=0, ymax=0.74, scaled ticks=false, /pgf/number format/precision=2, /pgf/number format/set thousands separator={}] \addplot[color=black!75,smooth,mark=,line width=0.75pt,solid] table[x=beta,y=quadDist,col sep=comma]{matlab/data/twiceTwo.csv}; \end{axis} \end{tikzpicture} \medskip \begin{minipage}{12cm} {\scriptsize Note: For $J= 4$ states, $K= 2$ choices, and $k=l=1$, the graph in the top panel plots the left (horizontal lines) and right hand sides (curves) of (\ref{eq:diffAD}) as functions of $\beta$, for $\tilde x_1=x_1$ and $\tilde x_2=x_2$ (corresponding to $u_1(x_1) = u_1(x_2)$; dashed red) and $\tilde x_1=x_3$ and $\tilde x_2=x_4$ (corresponding to $u_1(x_3) = u_1(x_4)$; solid blue). The graph in the bottom panel plots the corresponding squared Euclidian distance between the left and right hand sides of (\ref{eq:diffAD}) as a function of $\beta$ (in multiples of $10^{- 4}$). The data are} {\scriptsize \vspace*{-3ex} \[\mathbf{Q}_1 = \left[\begin{array}{cccc} 0.43& 0.26& 0.18& 0.18\\ 0.33& 0.29& 0.36& 0.27\\ 0.19& 0.26& 0.18& 0.45\\ 0.05& 0.18& 0.29& 0.09\end{array}\right],~ \mathbf{Q}_K=\left[\begin{array}{cccc} 0.17& 0.26& 0.13& 0.43\\ 0.13& 0.07& 0.20& 0.60\\ 0.20& 0.30& 0.10& 0.40\\ 0.25& 0.15& 0.50& 0.10\end{array}\right],\] \[\mathbf{p}_1^\prime=\left[\begin{array}{cccc} 0.92& 0.92& 0.63& 0.63\end{array}\right]\text{, and }\mathbf{p}_K^\prime=\left[\begin{array}{cccc} 0.08& 0.08& 0.37& 0.37\end{array}\right].\] Consequently, the left hand sides of (\ref{eq:diffAD}) equal $\ln\left(p_1(x_1)/p_K(x_1)\right) - \ln\left(p_1(x_2)/p_K(x_2)\right)= 0.0068$ and $\ln\left(p_1(x_3)/p_K(x_3)\right) - \ln\left(p_1(x_4)/p_K(x_4)\right)= 0.0019$. A unique value of $\beta$, $ 0.90$, solves (\ref{eq:diffAD}) for both $\tilde x_1=x_1$ and $\tilde x_2=x_2$ (dashed red) and $\tilde x_1=x_3$ and $\tilde x_2=x_4$ (solid blue). In addition, each of these two moment conditions has one other solution.} \end{minipage} \end{figure} Second, we may not learn whether the discount factor is point or set identified in finite samples. While finding the shared solutions to multiple moment conditions is easy if we know the population choice and transition probabilities, locating the shared solutions in finite samples can be difficult due to sampling variation. This suggests that we do not insist on point identification, but accept set identification and use a consistent estimator of the identified set, which may contain one or more points. Set estimators are easy to implement for single parameter problems. We give one example. \begin{example} Suppose the population moment conditions are as given in Figure \ref{fig:twiceTwo}. Though each individual moment condition is equally consistent with one small discount factor, at $ 0.07$ and $ 0.17$, respectively, and one large discount factor at the true value of $ 0.90$, only the latter is a common solution to both moment conditions. The discount factor is therefore point identified in this population. \begin{figure}[t] \caption{Example with Two Moment Conditions that Jointly Identify the Discount Factor but Individually Do Not, Using Noisy Estimates of the Choice Probabilities\label{fig:twiceTwoNoise}} \centering \medskip \begin{tikzpicture} \begin{axis}[width=12cm,height=7.5cm, name=noisyMom, xlabel={$\beta$}, axis x line=bottom, every outer x axis line/.append style={-,color=gray,line width=0.75pt}, axis y line=left, every outer y axis line/.append style={-,color=gray,line width=0.75pt}, xtick={0, 0.16, 0.91, 0.25, 0.68}, xticklabels={$0$,$ 0.16$,$ 0.91$,$ 0.25$,$ 0.68$}, ytick={0,0.0066,0.0050}, yticklabels={$0$,$0.0066$,$0.0050$}, every tick/.append style={line width=0.75pt}, xmin=0, xmax=1, ymin=0, ymax=0.015, scaled ticks=false, /pgf/number format/precision=2, /pgf/number format/set thousands separator={}] \draw[color=red!75,line width=0.75pt,dashed] (axis cs:0,0.0066) -- (axis cs:1,0.0066); \draw[color=blue!75,line width=0.75pt,solid] (axis cs:0,0.0050) -- (axis cs:1,0.0050); \draw[color=red!75,line width=0.75pt,dotted] (axis cs: 0.16,0) -- (axis cs: 0.16,0.0066); \draw[color=red!75,line width=0.75pt,dotted] (axis cs: 0.91,0) -- (axis cs: 0.91,0.0066); \draw[color=blue!75,line width=0.75pt,dotted] (axis cs: 0.25,0) -- (axis cs: 0.25,0.0050); \draw[color=blue!75,line width=0.75pt,dotted] (axis cs: 0.68,0) -- (axis cs: 0.68,0.0050); \addplot[color=red!75,smooth,mark=,line width=0.75pt,dashed] table[x=beta,y=oneRhs,col sep=comma]{matlab/data/twiceTwoNoise.csv}; \addplot[color=blue!75,smooth,mark=,line width=0.75pt,solid] table[x=beta,y=twoRhs,col sep=comma]{matlab/data/twiceTwoNoise.csv}; \end{axis} \path(noisyMom.origin) ++(0,-2.7in) coordinate (noisyCrit plot position); \begin{axis}[width=12cm,height=7.5cm, name=noisyCrit, at = {(noisyCrit plot position)}, xlabel={$\beta$}, axis x line=bottom, every outer x axis line/.append style={-,color=gray,line width=0.75pt}, axis y line=left, every outer y axis line/.append style={-,color=gray,line width=0.75pt}, xtick={0, 0.10, 0.28, 0.79, 0.91}, xticklabels={$0$,$ 0.10$,$ 0.28$,$ 0.79$,$ 0.91$}, ytick={0,0.1000,0.5}, yticklabels={$0$,$s_n$,$0.50$}, every tick/.append style={line width=0.75pt}, xmin=0, xmax=1, ymin=0, ymax=0.74, scaled ticks=false, /pgf/number format/precision=2, /pgf/number format/set thousands separator={}] \draw[color=black!75,line width=0.75pt,solid] (axis cs:0,0.1000) -- (axis cs:1,0.1000); \addplot[color=black!75,smooth,mark=,line width=0.75pt,solid] table[x=beta,y=quadDist,col sep=comma]{matlab/data/twiceTwoNoise.csv}; \addplot [line width=0.75pt,color=green!75,mark=,fill=green, fill opacity=0.05]coordinates { ( 0.10, 0) ( 0.28, 0) ( 0.28,0.1000) ( 0.10,0.1000) ( 0.10, 0) }; \addplot [line width=0.75pt,color=green!75,mark=,fill=green, fill opacity=0.05]coordinates { ( 0.79, 0) ( 0.91, 0) ( 0.91,0.1000) ( 0.79,0.1000) ( 0.79, 0) }; \end{axis} \end{tikzpicture} \medskip \begin{minipage}{12cm} {\scriptsize Note: This figure redraws Figure \ref{fig:twiceTwo} for the same values of $\mathbf{Q}_1$ and $\mathbf{Q}_K$, but randomly perturbed values of its choice probabilities $\mathbf{p}_1$ and $\mathbf{p}_K$. Rounded to two digits, the perturbed choice probabilities equal those reported below Figure \ref{fig:twiceTwo}. Consequently, the perturbation to $\mathbf{m}=-\ln\mathbf{p}_K$ is very small too, so that the right hand sides of (\ref{eq:diffAD}) are very close to those plotted in Figure \ref{fig:twiceTwo}. The left hand sides of (\ref{eq:diffAD}), however, now equal $\ln\left(p_1(x_1)/p_K(x_1)\right) - \ln\left(p_1(x_2)/p_K(x_2)\right)=0.0066$ (instead of $0.0068$) and $\ln\left(p_1(x_3)/p_K(x_3)\right) - \ln\left(p_1(x_4)/p_K(x_4)\right)= 0.0050$ (instead of $0.0019$). The resulting moment conditions again have two solutions. However, they no longer share a common solution and the squared Euclidian distance in the bottom panel never attains zero. The green shaded areas highlight the intervals $[ 0.10, 0.28]$ and $[ 0.79, 0.91]$ of values of $\beta$ at which the distance is below some critical level $s_n$ (which is taken to be $ 0.10\times 10^{- 4}$ in this example).} \end{minipage} \end{figure} In the top panel of Figure \ref{fig:twiceTwoNoise}, the same two moment conditions are plotted with sampling variation in the choice data. One sample moment condition is solved by discount factors $ 0.16$ and $ 0.91$ and the other by discount factors $ 0.25$ and $ 0.68$. The data do not clearly reveal that the point-identified true discount factor is $ 0.90$. If anything, the data suggest point identification in the lower region. Even if point identification cannot be determined a priori without further assumptions, the discount factor is still set identified and we can use consistent set estimators. Following \cite{chernozhukov2007estimation} and \cite{romanoshaikh10}, suppose that the identified set ${\cal B}=\{\beta\in[0,1):S(\beta)=0\}$ for some population criterion function $S:[0,1)\rightarrow[0,\infty)$. Note that we can alternatively write ${\cal B} = \arg \min_{\beta \in [0,1)} S(\beta)$. This suggests that we estimate ${\cal B}$ by a random contour set ${\cal C}_n(s)= \{\beta \in [0,1): a_n S_n(\beta) \leq s\}$ for some level $s>0$ and normalizing sequence $\{a_n\}$, where $S_n(\beta)$ is the sample equivalent of $S(\beta)$ and $n$ is the sample size. For a given confidence level $\alpha\in(0,1)$, $s$ is set to equal a consistent estimator $s_n$ of the $\alpha$-quantile of $\sup_{\beta \in {\cal B}} a_n S_n(\beta)$, so that the estimator ${\cal C}_n(s_n)$ asymptotically contains the identified set with probability $\alpha$: \[ \lim_{n \rightarrow \infty} \Pr\{{\cal B} \subseteq {\cal C}_n(s_n)\} = \alpha. \] The bottom panel of Figure \ref{fig:twiceTwoNoise} illustrates one such estimator. The criterion $S_n(\beta)$ is here a quadratic form in the difference between the left and right hand sides of \eqref{eq:diffAD} evaluated at consistent estimators of the choice and transition probabilities using equal weights. The critical value $s_n$ is given as the horizontal line. The estimated set is ${\cal C}_n(s_n) = [ 0.10, 0.28] \cup[ 0.79, 0.91]$. The data are equally consistent with a range of small discount factors and a range of large discount factors, but an intermediate range $( 0.28, 0.79)$ is rejected at the $\alpha$-level, along with discount factors smaller than $ 0.10$ and larger than $ 0.91$. Under some regularity conditions, the set estimator converges to the identified set as the sample size grows. Since the identified set is a point in this example, in the limit, the subset of ${\cal C}_n(s_n)$ with small discount factors vanishes and its subset with large discount factors degenerates to the population discount factor $ 0.90$. While these set estimators are computationally demanding for parameter spaces with even just a handful of dimensions, they are easy to implement in a one-dimensional case such as ours. \end{example} \section{Practical considerations} We conclude with some considerations relevant to applications. If the discount factor is point identified, utilities are as well, and $\beta$ and $\textbf{u}$ can be estimated jointly by standard methods, e.g. maximum likelihood, with the exclusion restriction on $\textbf{u}$ imposed. Standard inference for extremum estimators applies \citep[e.g.][]{nh94:neweymcfadden}. Typical implementations of such joint estimators will impose functional form assumptions on the utility function that have identifying power on their own (\citeauthor{qe18:komarovaetal}). Then, it is unclear how much information about the discount factor is carried by the exclusion restrictions, which are economically motivated, and how much is carried by the functional forms, which are typically more arbitrary. An alternative approach is to use that, by a version of \citeauthor{ecta02:magnacthesmar}'s Proposition 2 (see Section \ref{s:empiricalcontent}), there exist unique utilities that rationalize the data for any given discount factor. This suggests a two-step estimation procedure. In the first step, $\beta$ can be recovered from the moment condition in \eqref{eq:diffAD}. In the second step, the utilities are estimated using the moment conditions in \eqref{eq:u}, taking the discount factor recovered in the first step as given. This way, estimation of the discount factor is robust to misspecification of the utility function. See \citet{daljordetal19} for an application of this approach. If the discount factor is not known to be point identified, one may construct the sample analogues to \eqref{eq:diffAD} and plot the criterion function, as in the bottom panel of Figure \ref{fig:twiceTwoNoise}. If the criterion function is close to quadratic around a unique minimum on the domain of $\beta$, one may proceed as if the model is point identified. If the criterion function is decidedly nonquadratic, as in Figure \ref{fig:twiceTwoNoise}, then the discount factor can be estimated in a first step using a set estimator of the kind described in Section \ref{s:multiple}. These estimates are a set of possibly intersecting subintervals of $[0,1)$. In a second step, utilities and counterfactual choice probabilities can be computed for each $\beta$ in the identified set. \clearpage
\section{Introduction} \nocite{NMFS18a} \nocite{Newman12_406690} Galaxy scale outflows are expected to play a major role in regulating the star formation and chemical enrichment histories of galaxies \citep[e.g.][]{Dave12, Hopkins12, Vogelsberger13, Hirschmann13, Chisholm17}, mediating the co-evolution of galaxies and their central supermassive black holes \citep[e.g.][]{Silk98, Fabian12, King15}, and setting the sizes of galaxy disks \citep[e.g.][]{Okamoto05, Sales10}. Powerful winds driven by star formation and AGN activity transfer large amounts of mass and energy from galaxies to the surrounding circumgalactic medium \citep[e.g.][]{Peeples14, Tumlinson17}, depleting the supply of cold gas available for star formation within galaxies and preventing the circumgalactic gas from cooling and falling back onto galaxies \citep[e.g.][]{DiMatteo05, Springel05, Croton06, Hopkins06, Somerville08, Erb15, Beckmann17}. Outflows are therefore thought to play an important role in driving the low baryon fractions of galactic disks \citep{Dekel86, Efstathiou2000, Sales10}. The cosmic stellar mass density peaks at $\sim$20\% of the cosmic baryon density for a stellar mass of $\log(M_*/M_\odot$)~$\sim$~10.5, and drops to \mbox{$\sim$5-10\%} towards higher stellar masses (where black hole accretion feedback is most efficient) and lower stellar masses (where star formation feedback is most efficient) \citep[e.g.][]{Baldry08, Moster13, Moustakas13, Behroozi13}. Star formation driven outflows are expected to have the biggest impact on galaxies at $z\sim$~1~--~3, during the peak epoch of star formation \citep[see][and references therein]{Madau14}. Blueshifted absorption components are ubiquitous in the rest-frame UV spectra of $z~\sim$~2 star forming galaxies, revealing extended (tens of kiloparsec) reservoirs of diffuse outflowing material expelled from galaxies over long periods of time \citep[e.g.][]{Shapley03, Weiner09, Rubin10, Steidel10, Erb12, Kornei12, Bordoloi14}. Broad high velocity components in the rest-frame optical emission line spectra of star forming galaxies trace denser outflowing material within a few kiloparsecs of the launching points of the outflows. These emission components provide an instantaneous snapshot of the current outflow activity and are seen in $\sim$~10-30\% of star forming galaxies at $z~\sim$~2 \citep[when AGN host galaxies are explicitly excluded;][]{Genzel11, Newman12_global, Freeman17, NMFS18b}. Despite the prevalence of star formation driven outflows at high redshift, there are few quantitative constraints on their physical properties. Many studies have reported trends between the velocities of star formation driven outflows and the global $M_*$, SFR and/or $\Sigma_{\rm SFR}$\ of their host galaxies \citep[e.g.][]{Rupke05, Martin05, Weiner09, Rubin10, Steidel10, Erb12, Kornei12, Newman12_global, Talia12, Arribas14, Bordoloi14, Rubin14, Chisholm16, Heckman16, Sugahara17, NMFS18b}. Correlations between the outflow velocity $v_{\rm out}$\ and star formation properties arise naturally because the level of star formation activity determines the amount of energy injected into the ISM by supernovae, stellar winds and radiation pressure from massive stars \citep[e.g.][]{Chevalier85, Strickland04, Murray11}. The stellar feedback combines with the turbulence driven by disk instabilities to counteract the disk gravity and launch outflows \citep[see e.g.][]{Ostriker11, Krumholz18}. The galaxy stellar mass drives the depth of the local potential which decelerates the outflowing material, but is also positively correlated with the SFR \citep[e.g.][]{Brinchmann04, Elbaz07, Noeske07, Peng10, Whitaker14} which determines the amount of energy available to accelerate the outflowing material. It is important to accurately characterise the SFR-$v_{\rm out}$\ and $\Sigma_{\rm SFR}$-$v_{\rm out}$\ relationships, because their scalings provide constraints on the primary outflow driving mechanism(s). If the outflows are driven by mechanical energy from supernovae and stellar winds, the outflow velocity is predicted to be weakly dependent on the level of star formation activity ($v_{\rm out}$~$\propto$~$\Sigma_{\rm SFR}$$^{0.1}$; \citealt{Strickland04, Chen10}, $v_{\rm out}$~$\propto$~SFR$^{0.2-0.25}$; \citealt{Ferrara06, Heckman00}). On the other hand, if the outflows are radiatively driven, the outflow velocity is predicted to scale strongly with the level of star formation ($v_{\rm out}$~$\propto$~$\Sigma_{\rm SFR}$$^2$; \citealt{Murray11, Kornei12}, $v_{\rm out}$~$\propto$~SFR; \citealt{Sharma12}). If the dominant outflow driving mechanism varies within individual galaxies, the power law scaling will be intermediate between the energy and momentum driven cases. The slopes of the $\Sigma_{\rm SFR}$-$v_{\rm out}$\ and SFR-$v_{\rm out}$\ relations remain a matter of debate. Some studies report relatively flat power law scalings with indices of 0.1-0.15 \citep[e.g.][]{Chen10, Arribas14, Chisholm16}, while other studies report somewhat steeper scalings with power law indices of 0.25-0.35 \citep[e.g.][]{Martin05, Weiner09, Heckman16, Sugahara17}. The discrepancies between different scalings reported in the literature are likely to originate from differences in the observed outflow tracers, adopted definitions of $v_{\rm out}$, and range of probed outflow velocities (see discussions in e.g. \citealt{Kornei12, Heckman17}). The relationship between the level of star formation activity and the incidence and properties of outflows has, for the most part, only been investigated using galaxy integrated values. However, high spatial resolution observations of high SFR galaxies (both at $z~\sim$~2 and in the local universe) indicate that star formation driven outflows are launched from small ($\sim$~1~kpc) regions coincident with the most intense star formation events \citep{Shopbell98, Genzel11, Newman12_406690, Bolatto13}. Therefore, it may not be the global level of star formation which is most relevant for shaping the outflow properties, but the \textit{local} level of star formation. \citet{Bordoloi16} found that the properties of the outflowing material along different lines of sight to a lensed galaxy at $z~\sim$~1.7 are correlated with the properties of the nearest star forming region, suggesting that the outflows are indeed `locally sourced'. On the other hand, \citet{James18} found that the strongest outflow in a lensed galaxy at $z~\sim$~2.38 is associated with the most diffuse star forming region, suggesting that the outflow is `globally sourced'. Systematic studies of larger galaxy samples are required to conclusively determine whether the properties of star formation driven outflows are more strongly dependent on global or local galaxy properties. In this paper, we investigate the relationship between resolved $\sim$1-2~kpc scale (0.15-0.25'') star formation activity and the incidence and properties of outflows in a sample of 28 star forming galaxies at $z\sim$~2.3 from the SINS/zC-SINF AO Survey \citep{NMFS18a}. We build on the work of \citet{Newman12_global}, who explored the relationship between \textit{global} galaxy properties and the incidence and velocity of outflows in a similar sample of galaxies to the one used in this paper, and the work of \citet{Genzel11} and \citet{Newman12_406690}, who performed detailed analyses of the star formation and outflow properties of individual star forming clumps in 5 SINS/zC-SINF AO galaxies, of which 3 are included in our sample. Here we extend these analyses to study outflow properties as a function of resolved physical properties across 28 galaxies, considering not only the highly star forming clump regions but also the less active inter-clump regions. The outline of the paper is as follows. We probe the star formation and outflow properties on $\sim$0.17'' scales using adaptive optics assisted integral field observations of the H$\alpha$\ emission line (described in Section \ref{sec:sample}). We stack the spectra of individual spaxels of the integral field datacubes to create high signal-to-noise (S/N) spectra in bins of resolved physical properties, and perform single and multi-component emission line fitting to analyse the properties of the outflow component in individual stacks (described in Section \ref{sec:sins_method}). We explore which physical properties are most closely linked to the presence of outflows in Section \ref{sec:broad_emission}, and present more detailed results on the relationship between the local $\Sigma_{\rm SFR}$\ and the incidence and properties of outflows in Section \ref{subsec:outflow_properties}. The implications of our findings are discussed in Section \ref{sec:discussion} and our conclusions are presented in Section \ref{sec:conc}. Throughout this work we assume a flat $\Lambda$CDM cosmology with \mbox{H$_{0}$ = 70 \mbox{km s$^{-1}$}\ Mpc$^{-1}$} and \mbox{$\Omega_0$ = 0.3}. \section{Data} \label{sec:sample} \subsection{Sample Overview} In order to investigate the kiloparsec scale properties of star formation and outflows in galaxies at $z\sim$~2.3, we utilise deep adaptive optics assisted near infrared integral field observations from the SINS/zC-SINF AO Survey \citep{NMFS18a}. All of our targets were observed in the K band (1.95-2.45$\mu$m) with the Spectrograph for INtegral Field Observations in the Near Infrared (SINFONI; \citealt{Eisenhauer03, Bonnet04}) on the Very Large Telescope (VLT). The K band observations span a rest-frame wavelength range of at least 6450-6950\AA\ across the full redshift range of our sample. We use the H$\alpha$\ emission line at 6563\AA as a tracer of both star formation and ionized gas outflows (see Sections \ref{subsec:sinfoni_fitting} and \ref{sec:broad_emission}). In this section we present an overview of the SINS/zC-SINF AO sample, and refer the reader to the indicated survey papers for further information. The SINS/zC-SINF AO Survey targeted 36 star forming galaxies at \mbox{$z\sim$~1.5~--~2.5} with SINFONI. The 36 galaxies were drawn from the Spectroscopic Imaging survey in the Near-infrared with SINFONI \citep[SINS;][]{NMFS09} and the zCOSMOS-SINFONI survey \citep[zC-SINF;][]{Mancini11}, which together provided seeing limited (0.5-0.6'' resolution) H$\alpha$\ observations for 110 star forming galaxies with stellar masses in the range \mbox{2$\times$10$^9$-2$\times$10$^{11}$ M$_\odot$}. The SINS and \mbox{zC-SINF} parent samples were selected from spectroscopically confirmed subsets of several imaging surveys, using a range of criteria to probe different star forming populations at high redshift (K band and 4.5$\mu$m flux selection, sBzK color selection, and the optical BX/BM criteria). The final targets were required to have a secure optical spectroscopic redshift, with the H$\alpha$\ line falling in a region of the SINFONI H or K band filter relatively free of contamination from OH lines. 17 SINS galaxies and 19 zC-SINF galaxies with suitable AO reference stars were chosen for AO follow up, with some preference given to brighter targets (integrated H$\alpha$\ flux \mbox{$\gtrsim$ 10$^{-16}$ erg s$^{-1}$ cm$^{-2}$}). The full width at half maximum (FWHM) of the point spread function (PSF) for the AO observations ranges from \mbox{0.15-0.25''} (median 0.17'', or $\sim$1.4 kpc physical size), and the pixel scale in the final datacubes is 0.05''. The spectral resolution of the observations, measured from sky lines in the unsubtracted data cubes, is R~=~3530 (FWHM~=~85~\mbox{km s$^{-1}$}; see Appendix B of \citealt{NMFS18a}). \begin{figure} \centering \includegraphics[scale=0.7, clip = True, trim = 0 0 0 0]{sinszc_AO_sample.pdf} \caption{Distribution of the SINS/zC-SINF AO sample in the M$_*$-SFR plane. Galaxies at $z>$~2 and $z<$~2 are indicated by circles and squares, respectively. Markers with red centers indicate the subset of galaxies used in this paper (galaxies at $z>$~2 with no evidence for AGN activity). The green contours trace the density distribution of star forming galaxies in the COSMOS field which lie in the redshift range 1.4~$<z<$~2.6 and have K$_{S, AB}$~$<$~23 and inverse specific SFR lower than the Hubble time at the redshift of each object \citep{Ilbert09, Wuyts11}. The solid line indicates the main sequence of star forming galaxies at $z\sim$~2.3 from \citet{Whitaker14}, and the dashed and dotted lines indicate SFRs offset from the main sequence by factors of 4 and 10, respectively. \label{fig:sins_selection}} \end{figure} The AO sample is representative of the no-AO SINS~+~zC/SINF parent sample, and covers well the bulk of the $z\sim$~2 star forming galaxy population in the M$_*$-SFR and M$_*$-R$_e$ planes, over 2 orders of magnitude in M$_*$. Figure \ref{fig:sins_selection} shows the M$_*$-SFR distribution of the AO sample (circles and squares), compared to the underlying star forming galaxy population at 1.4~$<~z~<$~2.6 (green contours) and the main sequence of star forming galaxies at $z\sim$~2.3 (\citealt{Whitaker14}, black solid line). Due to the requirement for a pre-existing spectroscopic redshift, redder galaxies are underrepresented and there is some bias towards higher SFRs at low M$_*$. There is no particular size bias in the sample. More detailed discussions of the sample properties can be found in \citet{NMFS18a} and \citet{Tacchella15b}. \begin{sloppypar} In this work, we focus on the K band subset of the SINS/zC-SINF AO Survey (33 galaxies at \mbox{z = 2-2.5}). The high resolution AO observations are key for analysing the relationship between star formation properties and outflow properties on kiloparsec scales. Five galaxies were removed from the sample because of evidence for AGN activity (based on mid infrared, X-ray, radio and/or optical emission line indicators) which could significantly contaminate the H$\alpha$\ SFRs. Our final sample consists of 28 galaxies (indicated by the markers with red centers in Figure \ref{fig:sins_selection}) which span 1.4 dex in stellar mass (\mbox{9.4 $\leq$ log(M$_*$/M$_\odot$) $\leq$ 10.8}, median \mbox{log(M$_*$/M$_\odot$) = 10.1}) and 1.8 dex in main sequence offset (\mbox{-0.8 $\leq$ log(SFR/SFR$_{MS}$) $\leq$ 1.0}, median log(SFR/SFR$_{MS}$)~=~0.3). \end{sloppypar} \subsection{Global Galaxy Properties}\label{subsec:global_properties} The global stellar masses, SFRs and visual extinctions ($A_V$) towards all the galaxies in our sample were calculated using standard Spectral Energy Distribution (SED) fitting procedures, described in \citet{NMFS09} and \citet{Mancini11}. In brief, the optical-to-NIR broad-band SEDs (plus the mid-IR 3-8$\mu$m photometry when available) were fit with \citet{BC03} stellar population models, assuming the \citet{Chabrier03} IMF, solar metallicity, the \citet{Calzetti00} reddening law, and constant or expontentially declining star formation histories. The galaxy ages were restricted to be between 50~Myr and the age of the universe at the redshift of each object. The SINS/zC-SINF targets were drawn from several fields with varying photometric coverage, ranging from four to ten optical-to-NIR bands, supplemented with four-band IRAC \mbox{3-8$\mu$m} data when available (as summarised by \citealt{NMFS09, NMFS11, Mancini11}). More specifically, the SED modelling for the zCOSMOS targets (16/28 galaxies) was based on 10 band optical-to-NIR photometry from Subaru and CFHT \citep{Capak07, McCracken10} and IRAC 3-8$\mu$m photometry \citep{Ilbert09}. For the BX targets (7/28 galaxies) we used the ground based \textit{$U_n$GRJ$K_S$} photometry presented in \citet{Erb06}, supplemented with HST $H_{160}$ measurements from \citet{NMFS11} for three of these objects. One BX target lacked NIR ground-based data but was among the sources imaged in H-band with HST. The SED modelling for the GMASS targets (2/28 galaxies) was based on photometry from HST ( \textit{BVIZ}), VLT (\textit{JH$K_S$}) and IRAC (\mbox{3-8$\mu$m}) \citep{Kurk13}. For the K20 targets (2/28 galaxies) we used the $B$-8$\mu$m photometry from the FIREWORKS catalogue \citep{Wuyts08}, and for the one GDDS target we used the 7 band \mbox{$B$-$K_S$} photometry from the Las Campanas Infrared Survey \citep{Chen02, Abraham04}. The effective radii, axis ratios and position angles of the galaxies in our sample were derived by fitting a single Sersic component to either the HST F160W (H band) light distribution (when available; see \citealt{Tacchella15b}) or the H$\alpha$\ flux distribution (see Section \ref{subsubsec:linemaps} and \citealt{NMFS18a}). The galaxy inclinations ($i$) were calculated directly from the axis ratios ($q$), using $i$~=~cos$^{-1}$($q$). \section{Method} \label{sec:sins_method} The emission line spectra of galaxies are superpositions of emission associated with different gas components. In normal star forming galaxies at $z\sim$~2, the H$\alpha$\ emission primarily traces star formation in the disk of the galaxy. In integral field data, the centroid of the emission line varies spatially, tracing the underlying orbital motions of the ionized gas. If the galaxy has an outflow, a broader (sometimes blue-shifted) H$\alpha$\ emission component will be superimposed on the emission from the star forming disk. The width and velocity offset of the outflow component are tracers of the outflow velocity \citep[e.g.][]{Rupke05, Veilleux05, Genzel11}, while the total flux in the outflow component is a tracer of the outflowing mass \citep[e.g.][]{Genzel11, Newman12_406690}. A first order estimate of the strength and width of the outflow component can be obtained by fitting a single Gaussian component. If there is no outflow component, the measured $\sigma$ will be defined by the core of the line profile, but if there is significant flux in the wings of the emission lines, the best fit Gaussian will broaden to include some of this flux \citep[see also][]{NMFS18a}. Not all of the flux in the wings will be captured by a single Gaussian fit, and therefore the measured $\sigma$ will provide a lower limit on the velocity dispersion of the outflow component ($\sigma_b$). More accurate measurements of the flux and kinematics of the outflow component can be obtained by fitting the H$\alpha$\ line profile as a superposition of two Gaussian components \citep[e.g.][]{Shapiro09, Genzel11, Newman12_global, Newman12_406690, NMFS14, Freeman17, Leung17, NMFS18b}. We characterise the variation in outflow properties as a function of local physical properties across the SINS/zC-SINF AO galaxies by shifting the spectra of individual spaxels to remove large scale velocity gradients across the galaxies, splitting the spectra into bins in a range of physical properties (SFR, $\Sigma_{\rm SFR}$, $\Sigma_*$, $\Sigma_{\rm SFR}$/$\Sigma_*$, $A_V$, and R/R$_e$), and creating high S/N stacks of the spectra in each bin. We use single component Gaussian fits to investigate the relationships between these six physical quantities and the presence of outflows. We find that the line width is primarily determined by the level of star formation (probed by the SFR and $\Sigma_{\rm SFR}$), but that $\Sigma_*$\ may also play an important role in modulating the presence and properties of outflows. We focus our more detailed investigation on $\Sigma_{\rm SFR}$, because it is directly linked to the star formation processes which provide the energy to drive the outflows, and because it is normalised by area, making it easier to consistently compare with measurements at different spatial scales than the SFR. We use two component Gaussian fitting to quantify the relationships between $\Sigma_{\rm SFR}$\ and the incidence, velocity and mass loading factor of outflows. The assumption that the star formation and outflow components are well represented by Gaussian profiles is justified by the central limit theorem, because the star formation component is an average over many \mbox{H II}\ region spectra, and the outflow component is an average over many outflow spectra \citep[see also][]{NMFS18b}. The validity of the assumption is also confirmed empirically - we find that the emission line profiles of stacks with no evidence for broad emission are well fit by a single Gaussian component \citep[see also][]{Genzel11}, and the line profiles of stacks with clear broad wings are well fit by two Gaussian components, with no evidence for strong asymmetries or blueshifts in the outflow components (see Section \ref{subsec:sigma_fbroad}). \subsection{Mapping Physical Properties Across Galaxies} \label{subsec:maps} \begin{figure*} \centering \includegraphics[clip = True, trim = 5 67 8 45, scale = 0.8]{zc405501_maps.pdf} \caption{Maps of the H$\alpha$\ flux, $A_V$, $\Sigma_{\rm SFR}$\ and $\Sigma_*$\ for ZC405501, at the 0.05'' pixel scale of the reduced data. ZC405501 is at a redshift of $z$~=~2.154, and has a stellar mass of log(M$_*$/M$_\odot$) = 9.9 and a SFR of 85~M$_\odot$~yr$^{-1}$. \label{fig:zc405501_maps}} \end{figure*} \subsubsection{H$\alpha$\ Flux Maps}\label{subsubsec:linemaps} H$\alpha$\ flux, velocity and velocity dispersion ($\sigma$) maps for all of the galaxies in our sample are presented in \citet{NMFS18a}, and the details of the line fitting are described in that paper. Briefly, the H$\alpha$\ line profiles were fit using the IDL emission line fitting code \textsc{linefit} \citep{NMFS09, Davies11}. Before fitting, the datacubes were lightly smoothed by median filtering, both spectrally (over 3 spectral channels) and spatially (over boxes of \mbox{3 $\times$ 3} spatial pixels for 26/28 of the galaxies, and \mbox{5 $\times$ 5} spatial pixels for two large low surface brightness galaxies), to increase the S/N per spaxel. For each spaxel, the continuum was modelled as a straight line through spectral regions adjacent to the line region and free from skyline contamination. The H$\alpha$\ line was modelled as a single Gaussian convolved with the line spread function of SINFONI at the observed wavelength of the line. The spectral channels were inverse variance weighted to prevent strong sky residuals from biasing the fits. The errors on the fit kinematics and H$\alpha$\ flux were calculated from 100 Monte Carlo simulations, where the value of the spectrum at each wavelength was perturbed assuming a Gaussian distribution with a standard deviation given by the input error cube. Spaxels with \mbox{H$\alpha$\ flux/error $<$ 5} are masked in the final maps. Panel a) of Figure \ref{fig:zc405501_maps} shows the H$\alpha$\ flux map for the galaxy ZC405501, at the 0.05'' pixel scale of the reduced data. \subsubsection{Galactocentric Distance Maps} The deprojected radial distance of each spaxel from the kinematic center of each galaxy is calculated using the galaxy position angle and axis ratio. We normalise the deprojected distance maps to the effective radii of the galaxies. We also create maps of the circularized distance of each spaxel from the centre of each galaxy. The circularized radius r$_{circ}$ is defined as the radius of the circle whose area equals the area of the ellipse with major axis radius $r$ and minor axis radius $r~\times$~$q$ (where $q$ is the axis ratio of the galaxy). The major axis radius is the same as the deprojected radius by definition, and therefore \mbox{r$_{circ}$ = $r_{deproj} \sqrt{q}$}. \subsubsection{$A_V$ and $A_{H\alpha}$ Maps} At $z~\sim$~2, the observed \mbox{HST F438W (B)} - \mbox{F814W (I)} color is a proxy for the rest frame FUV-NUV color, which probes the slope of the ultraviolet continuum and is therefore a good tracer of the dust attenuation. \citet{Tacchella18} investigated the relationship between the FUV-NUV color and the $A_V$, using a grid of model SEDs from \citet{BC03}. The model SEDs cover six different metallicities \mbox{(Z~=~0.0001-0.05)}, three different star formation histories (exponentially increasing, constant, and expontentially declining), and a range of attenuations \mbox{($A_V$~=~0-6)} and redshifts \mbox{($z$~=~2-2.5)}. They considered galaxy ages between 10~Myr and 3.5~Gyr (the age of the universe at $z~\sim$~2) and adopted the \citet{Calzetti00} reddening law. \citet{Tacchella18} showed that there is a tight, redshift-dependent correlation between the FUV-NUV color and the $A_V$, and used this correlation to create $A_V$ maps for the 10 SINS/zC-SINF AO galaxies with available HST F438W and F814W imaging. 6/10 of these galaxies are included in our sample. The HST maps have similar angular resolution to the AO H$\alpha$\ maps, and were resampled to the same pixel grid. The $A_V$ map for ZC405501 is shown in panel b) of Figure \ref{fig:zc405501_maps}. For the 22/28 galaxies without available HST F438W and F814W imaging, it is not possible to directly measure the $A_V$ towards each spaxel. Instead, we combine the average radial $A_V$ profiles derived by \citet{Tacchella18} with the global $A_V$ values measured from the SED fitting (described in Section \ref{subsec:global_properties}) to estimate the $A_V$ towards each spaxel. \citet{Tacchella18} used their 10 $A_V$ maps to create average $A_V$ profiles (in terms of the absolute circularized radius $r_{circ,kpc}$), in two bins of stellar mass. The lower mass (\mbox{log(M$_*$/M$_\odot$) $<$ 11}) bin is comprised entirely of the six galaxies from our sample with $A_V$ maps. For each of the 22 galaxies in our sample without $A_V$ maps, we adopt the average $A_V$ profile of the \mbox{log(M$_*$/M$_\odot$) $<$ 11} galaxies from \citet{Tacchella18}, and scale the profile by a constant factor so that the $A_V$ averaged across the individual spaxels matches the global $A_V$ measured for the galaxy. There is growing evidence that high redshift star forming galaxies display negative radial attenuation gradients \citep[see also e.g.][]{Wuyts12, Hemmati15, Nelson16, Liu17}. Therefore, the radial dust corrections that we have applied should produce more accurate H$\alpha$\ luminosities than global dust corrections. However, a radial attenuation profile cannot account for azimuthal $A_V$ variations driven by the clumpy distribution of star formation in high redshift galaxies. Furthermore, high mass galaxies are observed to have steeper $A_V$ gradients than low mass galaxies. The six galaxies from which the average profile is constructed are biased towards the high mass end of our sample (\mbox{10.0 $\leq$ log(M$_*$/M$_\odot$) $\leq$ 10.7}), and therefore the average $A_V$ profile is likely to be steeper than the intrinsic $A_V$ profiles of the lower mass galaxies. Better constraints on the $A_V$ towards individual spaxels of our galaxies will be crucial for obtaining more accurate H$\alpha$\ luminosities in the future. The spaxel $A_V$ values were converted to $A_{H\alpha}$ values using Equation 5 of \citet{Tacchella18}, which assumes that the stellar extinction follows the \citet{Calzetti00} curve and that the nebular extinction follows the \citet{Cardelli89} curve. We assume that the ratio of the E(B-V) for the stellar continuum to the E(B-V) for the nebular emission lines ($f_{\rm */neb}$) is 0.7 (rather than $f_{\rm */neb}$~=~0.44 which is adopted in the local universe; \citealt{Calzetti00}). This choice is motivated by the results of \citet{Tacchella18}, who showed that adopting $f_{\rm */neb}$~=~0.7 produces better agreement between the UV and H$\alpha$\ SFRs than $f_{\rm */neb}$~=~0.44, and \citet{Kashino13}, who measured $f_{\rm */neb}$~=~0.7-0.8 for star forming galaxies at 1.4~$<z<$~1.7 in COSMOS. However, our main conclusions do not change if we adopt $f_{\rm */neb}$~=~0.44. \subsubsection{SFR and $\Sigma_{\rm SFR}$\ Maps}\label{subsubsec:sfr_maps} \begin{sloppypar} The SFR and $\Sigma_{\rm SFR}$\ maps were derived from the H$\alpha$\ flux maps as follows. The H$\alpha$\ fluxes were corrected for extinction using the calculated $A_{H\alpha}$ values, and converted to luminosities using the galaxy redshifts. The spaxel H$\alpha$\ luminosities were converted to SFRs using the \citet{Kennicutt98} calibration, adjusted to the \citet{Chabrier03} initial mass function (\mbox{SFR [M$_\odot$ yr$^{-1}$] = $L_{\rm H\alpha}$/[2.1$\times$10$^{41}$ erg s$^{-1}$}]). Finally, the SFRs were divided by the deprojected area of each pixel on the sky (accounting for galaxy inclination) to obtain $\Sigma_{\rm SFR}$\ in units of M$_\odot$~yr$^{-1}$~kpc$^{-2}$. The $\Sigma_{\rm SFR}$\ map for ZC405501 is shown in panel c) of Figure \ref{fig:zc405501_maps}. \end{sloppypar} \subsubsection{$\Sigma_*$\ Maps} \citet{Tacchella15} presented resolved stellar mass maps for 24/28 of the galaxies in our sample. They used HST \mbox{F110W (J) - F160W (H)} color maps to derive pixel mass to light ratios, assuming the \citet{Chabrier03} initial mass function, and multiplied the derived mass to light ratios by the pixel H band luminosities to obtain the stellar mass in each pixel. The stellar mass maps can be directly converted to $\Sigma_*$\ maps by dividing by the deprojected area of each pixel on the sky. The $\Sigma_*$\ map for ZC405501 is shown in panel d) of Figure \ref{fig:zc405501_maps}. The remaining 4/28 galaxies lack the F110W and/or F160W imaging required to calculate pixel mass to light ratios, and are not used in any analysis requiring $\Sigma_*$\ estimates. These four galaxies have intermediate stellar masses (\mbox{10.0 $\leq$ log(M$_*$/M$_\odot$) $\leq$ 10.4}) and a range of SFRs (\mbox{10-620~M$_\odot$ yr$^{-1}$}), and we show that the missing resolved stellar mass information is unlikely to bias our results (see Section \ref{sec:broad_emission}). \subsection{Stacking}\label{subsec:sinfoni_stack_creation} \subsubsection{Creating Stacks} We stack the spectra of individual spaxels from the original (unsmoothed) datacubes in bins of the physical properties described above to create high S/N \mbox{(H$\alpha$\ S/N~=~60-170)} stacks which can be used to study the relationships between those physical properties and outflow properties. Our datacubes contain a total of 9510 spaxels which have robustly measured kinematics and are therefore suitable for this analysis (see Section \ref{subsubsec:linemaps}). The spectrum of each spaxel is shifted and re-sampled so that the centroid of the H$\alpha$\ line is at zero velocity and the spectral channels have a width of 30~\mbox{km s$^{-1}$}\ (which is close to the initial velocity sampling of \mbox{$\sim$30-40~\mbox{km s$^{-1}$}}). The spaxels are divided into bins based on the physical property of interest. Each spaxel is assigned a single weight which is applied to all spectral channels. The weight is given by the inverse of the root mean square (rms) value of the line free channels (more than 40\AA\ from the center of the H$\alpha$\ line and more than 30\AA\ from the center of the \mbox{[S II]}$\lambda \lambda$6716,6731 doublet). From the spaxels in each bin, a stack is created by computing the weighted average of the spectra, subtracting a constant continuum value (given by the median value of the line free channels), and normalizing to a maximum value of 1. We also create `unweighted' stacks (where all spaxels are given a weighting of 1), but find that the choice of weighting scheme does not impact our main conclusions. The errors on the stacked spectra are calculated using bootstrapping. For each bin, we randomly draw half of the spaxels and stack them, and repeat the process 100 times so that we have 100 bootstrap stacks. The error on each spectral channel of the final stack is then given by the standard deviation of the values of the 100 bootstrap stacks for that channel. \subsubsection{Quantifying Outflow Properties}\label{subsec:sinfoni_fitting} We quantify the strength and properties of the outflow component in each stack by fitting each of the H$\alpha$\ and \mbox{[N II]}\ lines with either one Gaussian component, or a superposition of two Gaussian components - a narrow component tracing the gas in the star forming regions, and a broader component tracing the outflows. We stress that although we sometimes refer to the outflow component as the `broad' component, the velocity dispersion of this component is $\lesssim$~300~\mbox{km s$^{-1}$}\ and it is therefore much narrower than the broad components associated with e.g. AGN driven outflows or broad line regions. When an outflow component is present, the base of the H$\alpha$\ line can become blended with the bases of the \mbox{[N II]}$\lambda$6548 and \mbox{[N II]}$\lambda$6584 lines which lie at separations of \mbox{-670 \mbox{km s$^{-1}$}} and \mbox{+940 \mbox{km s$^{-1}$}}, respectively. It is therefore necessary to fit the two \mbox{[N II]}\ lines simultaneously with H$\alpha$. In our fitting, we assume that all three lines have the same kinematics; i.e. for each Gaussian component all lines have a common velocity shift and velocity dispersion. The emission line fitting is performed using the Python module \textsc{emcee} \citep{ForemanMackey13}, an Affine Invariant Markov Chain Monte Carlo (MCMC) Ensemble Sampler. The MCMC provides the posterior probability distribution for each of the parameters, as well as the joint posterior probability distribution for each pair of parameters, allowing us to ensure that the parameters of interest (namely the H$\alpha$\ amplitude(s) and the velocity dispersion(s)) are well constrained and not degenerate with each other or other parameters in the fit. This is particularly important when fitting two kinematic components as multiple solutions may be possible (see also discussion in \citealt{Freeman17}). We adopt uniform priors on all model parameters, limiting them to ranges which are physically reasonable. Specifically, the parameters are limited to the following ranges: velocity shifts \mbox{$\abs{\Delta v}$ $<$ 200 \mbox{km s$^{-1}$}}, velocity dispersion of the narrow component ($\sigma_n$) greater than 36~\mbox{km s$^{-1}$}\ (the spectral resolution of the data), velocity dispersion of the outflow component ($\sigma_b$) greater than 150~\mbox{km s$^{-1}$}\ (to minimise contamination from beam smearing; see Appendix \ref{sec:beam_smearing}), and line amplitudes greater than zero. The ratio of the amplitudes of the two \mbox{[N II]}\ lines (\mbox{[N II]}$\lambda$6584/\mbox{[N II]}$\lambda$6548) in each component is fixed to 3 (the theoretical value set by quantum mechanics), but the \NII/H$\alpha$\ ratio is left as a free parameter. We run the MCMC with 400 walkers, 400 burn-in steps and 1200 run steps, based on the calculated auto-correlation times for the fit parameters (110-120 steps). For each parameter, the best fit value is defined as the peak of the posterior probability distribution, and the 68 per cent confidence interval is defined as the smallest interval containing 68 per cent of the probability. \begin{figure*} \centering \includegraphics[scale=1.07, clip = True, trim = 20 65 20 10]{half_sample_spectra.pdf} \caption{Spectra stacked in 2 bins of SFR (panel a), $\Sigma_{\rm SFR}$\ (b), $\Sigma_*$\ (c), $\Sigma_{\rm SFR}$/$\Sigma_*$\ (d), $A_V$ (e) and R/$R_e$ (f). The bins are divided by the median value of each property, listed in Table \ref{tab:sample_halves}. All stacks are normalised to the same H$\alpha$\ amplitude. The filled regions represent the 1$\sigma$ errors derived using bootstrapping. We fit a single Gaussian to the H$\alpha$\ and \mbox{[N II]}\ lines in each stack, and find that the line widths are primarily driven by the level of star formation (probed by the SFR and $\Sigma_{\rm SFR}$), although $\Sigma_*$\ may also play a significant role.}\label{fig:sample_halves} \end{figure*} \subsubsection{Calculating the Average $\Sigma_{\rm SFR}$\ for Each Stack}\label{subsubsec:broad_contam_correction} To first order, the average $\Sigma_{\rm SFR}$\ for each stack is simply given by the average of the $\Sigma_{\rm SFR}$\ values of the spaxels that went into the stack. However, the $\Sigma_{\rm SFR}$\ values measured for individual spaxels are somewhat biased. For the vast majority of spaxels it is not possible to robustly separate the star formation and outflow components, even when \mbox{S/N(H$\alpha$)~$>$~5}. Therefore, we calculate $\Sigma_{\rm SFR}$\ using the single Gaussian H$\alpha$\ flux, which is robust and independent of S/N for S/N(H$\alpha$)~$>$~5, regardless of the strength and width of the outflow component. However, in spaxels with significant outflow components, the single Gaussian H$\alpha$\ flux will be contaminated by emission from the outflow component and therefore $\Sigma_{\rm SFR}$\ will be over-estimated relative to other spaxels (assuming that the dust extinction is not preferentially underestimated in regions with outflows). We account for the contribution of the outflow component a-posteriori by calculating how much (on average) the measured $\Sigma_{\rm SFR}$\ values of the spaxels in each stack are over-estimated. For each stack, we fit the H$\alpha$\ and \mbox{[N II]}\ lines with one Gaussian component and then with two Gaussian components. We calculate a `correction factor', H$\alpha$(narrow)/H$\alpha$(1~comp). The denominator is the H$\alpha$\ flux from the single component fit, which is the biased value that was used to estimate $\Sigma_{\rm SFR}$\ in Section \ref{subsubsec:sfr_maps}. The numerator is the H$\alpha$\ flux of the narrow (star formation) component from the two component fit, which is the value that should be used to calculate the true $\Sigma_{\rm SFR}$. The intrinsic average $\Sigma_{\rm SFR}$\ for spaxels in each bin can therefore be calculated from the measured average $\Sigma_{\rm SFR}$\ and the correction factor as follows: \begin{equation} \Sigma_{\rm SFR} ({\rm intrinsic}) = \Sigma_{\rm SFR} ({\rm measured}) \times \frac{\rm{H}\alpha~({\rm narrow})}{\rm{H}\alpha~({\rm 1~comp})} \label{eqn:sfrsd_correction} \end{equation} The correction factors for our stacks range from \mbox{1.1-1.9}. In the following sections, all quoted $\Sigma_{\rm SFR}$\ values have been corrected using Equation \ref{eqn:sfrsd_correction}. \section{Dependence of Line Width on Resolved Physical Properties} \label{sec:broad_emission} We begin by investigating how the strength of the broad component relates to different physical properties. We consider four properties which are thought to be linked to star formation driven outflows (SFR in the spaxel, $\Sigma_{\rm SFR}$, $\Sigma_*$\ and $\Sigma_{\rm SFR}$/$\Sigma_*$), and two properties related to processes which could be potential sources of contaminating broad emission ($A_V$ and galactocentric distance). The $A_V$ probes the amount of dust along the line of sight. If there is a large amount of dust present, some of the H$\alpha$\ light may be scattered to different frequencies, inducing artificial broadening of the emission line (see e.g. \citealt{Scarrott91}). The H$\alpha$\ line could also be artificially broadened by unresolved orbital motions (beam smearing). This effect is particularly prominent in the centers of massive galaxies where velocity gradients are the largest \citep[e.g.][]{Epinat10, Davies11, Newman13}. Figure \ref{fig:sample_halves} shows how the shape of the H$\alpha$\ line varies as a function of SFR, $\Sigma_{\rm SFR}$, $\Sigma_*$, $\Sigma_{\rm SFR}$/$\Sigma_*$, $A_V$ and R/R$_e$. These properties are known to correlate with one another, so we look for the property which shows the most pronounced correlation with the strength of the broad component. For each property, the spaxels are divided into two bins (above and below the median value listed in Table \ref{tab:sample_halves}), and a stack is created for each bin as described in Section \ref{subsec:sinfoni_stack_creation}. In each panel, the stack of spaxels above the median is shown in red, and the stack of spaxels below the median is shown in black. For each stack, the filled region indicates the 1$\sigma$ error region. We fit each of the H$\alpha$\ and \mbox{[N II]}\ lines in each stack with a single Gaussian, as described in Section \ref{subsec:sinfoni_fitting}. The velocity dispersions of the best fit Gaussians for all the stacks are listed in Figure \ref{fig:sample_halves}. The differences between the $\sigma$ values measured for the above and below median stacks for each property are listed in Table \ref{tab:sample_halves}. All velocity dispersions quoted in this paper have been corrected for the spectral resolution (FWHM~=~85~\mbox{km s$^{-1}$}). The formal uncertainties on the fit $\sigma$ values are very small ($\sim$~1~\mbox{km s$^{-1}$}), but do not account for the fact that a single component Gaussian model is sometimes not a good representation of the data (see also discussion at the beginning of Section \ref{sec:sins_method}), and therefore the uncertainties are not very meaninfgul. \begin{table}[] \centering \begin{tabular}{c|c|c} Property & Median Value & $\Delta \sigma$ (\mbox{km s$^{-1}$}) \\ \hline SFR & 0.08 M$_\odot$ yr$^{-1}$ & 31 \\ $\Sigma_{SFR}$ & 0.19 M$_\odot$~yr$^{-1}$~kpc$^{-2}$ & 27 \\ $\Sigma_*$ & 10$^{7.78}$ M$_\odot$ kpc$^{-2}$ & 15 \\ $\Sigma_{SFR}/\Sigma_*$ & 10$^{-8.4}$ yr$^{-1}$ & 4 \\ $A_V$ & 0.93 mag & 6 \\ R/$R_e$ & 1.22 & -3 \\ \hline \end{tabular} \caption{Quantities related to the pairs of stacked spectra in Figure \ref{fig:sample_halves}. The spaxels were divided into two bins for each of the properties in column 1, with one bin above and one bin below the median values in column 2. Column 3 lists the difference between the single component velocity dispersions fit to the above and below median stacks for each property.} \label{tab:sample_halves} \end{table} Figure \ref{fig:sample_halves} shows that the shape of the emission line profiles is most strongly dependent on the level of star formation, probed by the SFR and $\Sigma_{\rm SFR}$\ (panels a and b). The high SFR stack shows a clear excess of flux at high velocities with respect to the low SFR stack, and the same is true for the $\Sigma_{\rm SFR}$\ stacks. The measured velocity dispersions for the above and below median SFR stacks are $\sigma$~=~109~\mbox{km s$^{-1}$}\ and 78~\mbox{km s$^{-1}$}, respectively, corresponding to $\Delta \sigma$~=~31~\mbox{km s$^{-1}$}. Similarly, the measured velocity dispersions for the above and below median $\Sigma_{\rm SFR}$\ stacks are $\sigma$ = 108~\mbox{km s$^{-1}$}\ and 81~\mbox{km s$^{-1}$}, respectively, corresponding to $\Delta \sigma$~=~27~\mbox{km s$^{-1}$}. The distribution of spaxels between the above and below median bins does not change significantly when dividing based on SFR or $\Sigma_{\rm SFR}$, because the SFRs of the spaxels in our sample vary by a factor of 50, but the deprojected areas of the pixels on the sky only vary by a factor of four. The $\Delta \sigma$ values measured for the SFR and $\Sigma_{\rm SFR}$\ stacks are significantly larger than the $\Delta \sigma$ values measured for the $\Sigma_*$, $\Sigma_{\rm SFR}$/$\Sigma_*$, $A_V$ and R/R$_e$ stacks, suggesting that there is a direct link between the level of star formation activity and the strength of the broad emission component. This is consistent with predictions that the incidence and velocity of star formation driven outflows should increase with $\Sigma_{\rm SFR}$\ \citep[e.g.][]{Thompson05, Ostriker11, Faucher13, Hayward17}. The shape of the emission line profiles also varies with $\Sigma_*$\ (panel c of Figure \ref{fig:sample_halves}). The high $\Sigma_*$\ stack shows an excess of flux at high velocities compared to the low $\Sigma_*$\ stack, and we measure $\Delta \sigma$~=~15~\mbox{km s$^{-1}$}\ (48 per cent of the $\Delta \sigma$ between the SFR stacks). In contrast, we do not observe any significant trends in emission line width as a function of $\Sigma_{\rm SFR}$/$\Sigma_*$, $A_V$ or R/R$_e$ (panels d, e and f of Figure \ref{fig:sample_halves}), and the measured $\Delta \sigma$ values are low (4, 6 and -3 \mbox{km s$^{-1}$}, respectively). The absence of a strong correlation between $A_V$ and $\sigma$ indicates that scattered light cannot be the dominant source of broad emission in our sample. The absence of a strong correlation between galactocentric distance and $\sigma$ indicates both that the broad component cannot originate primarily from beam smearing, and that the outflows are launched from a range of radii and are therefore unlikely to be AGN driven (as expected, because AGN hosts were explicity excluded from the sample). The impact of beam smearing on our results is further explored with the aid of dynamical models in Appendix \ref{sec:beam_smearing}. We note that the $\Sigma_*$\ and $\Sigma_{\rm SFR}$/$\Sigma_*$\ stacks include spectra from the 24/28 galaxies which have HST F110W and F160W imaging, whereas the SFR, $\Sigma_{\rm SFR}$, A$_V$ and R/R$_e$ stacks contain spectra from all 28 galaxies. To assess whether our results are biased by using different sets of galaxies in different stacks, we create SFR, $\Sigma_{\rm SFR}$, A$_V$ and R/R$_e$ stacks using the same 24/28 galaxies included in the $\Sigma_*$\ stacks, and repeat the single component Gaussian fits. The fit $\sigma$ values change by a maximum of 3~\mbox{km s$^{-1}$}, indicating that our results are unlikely to be biased by the missing $\Sigma_*$\ measurements. This analysis assumes that any variation in the measured $\sigma$ is primarily attributable to variations in the strength and/or width of the outflow component, and is not driven by changes in the velocity dispersion of the narrow component, $\sigma_n$. The $\sigma_n$ may be correlated with the level of star formation because energy injection from stellar feedback may contribute to increasing the turbulent pressure in the disk. Furthermore, $\Sigma_*$\ may be correlated with the gas surface density $\Sigma_g$, which regulates $\sigma_n$ through the Toomre $Q$ parameter \citep[e.g.][]{NMFS06, Genzel11, Krumholz18}. However, the pairs of stacks with the largest $\Delta \sigma$ values in Table \ref{tab:sample_halves} also have the most clearly visible differences in the strength of the broad wings in Figure \ref{fig:sample_halves}, which verifies that the $\Delta \sigma$ is tracing real differences in the strength and width of the broad component, with only a minor secondary dependence on $\sigma_n$ variations. We conclude that the line width is primarily driven by the level of star formation (probed by the SFR and $\Sigma_{\rm SFR}$), but that $\Sigma_*$\ may also play a significant role in modulating the shapes of the line profiles (consistent with the results of \citealt{Newman12_global}). In this paper we choose to focus on $\Sigma_{\rm SFR}$, because it is directly linked to the star formation processes which provide the energy to drive the outflows, and because it is normalised by area, making it easier to consistently compare with measurements at different spatial scales than the SFR. \begin{figure*} \centering \includegraphics[scale=0.6, clip = True, trim = 25 80 30 0]{low_sfrsd_linefit.pdf}\includegraphics[scale=0.6, clip = True, trim = 25 80 30 0]{high_sfrsd_linefit.pdf} \\ \includegraphics[scale=0.58, clip = True, trim = 20 0 10 0]{posterior_low_sfrsd.pdf}\includegraphics[scale=0.58, clip = True, trim = 20 0 10 0]{posterior_high_sfrsd.pdf} \caption{Two component Gaussian fits to the above and below median $\Sigma_{\rm SFR}$\ stacks (top), and corresponding posterior and joint posterior distributions for the H$\alpha$\ broad-to-narrow flux ratio and the velocity dispersion of the broad component $\sigma_b$ (bottom). In the top panels the stack spectra are shown in black, the best fit narrow components are shown in blue, the residuals after subtracting the fit narrow components from the stack spectra are shown by the pale red shaded regions, and the best fit outflow components are shown with red solid curves. The overall fit residuals are shown in grey and the 1$\sigma$ error regions are shown in purple, and both are artificially offset below zero for clarity.} \label{fig:sample_halves_fits} \end{figure*} \section{Outflow Properties as a Function of $\Sigma_{\rm SFR}$}\label{subsec:outflow_properties} We further quantify the difference between the line profiles of the low and high $\Sigma_{\rm SFR}$\ stacks by fitting the \mbox{[N II]}\ and H$\alpha$\ lines as superpositions of two Gaussian components (as described in Section \ref{subsec:sinfoni_fitting}) and comparing the fit parameters. In particular, we focus on parameters which are used to calculate the outflow velocity and mass loading factor (see Sections \ref{subsec:vout} and \ref{subsec:mass_loading}): the ratio of the H$\alpha$\ flux in the broad component to the H$\alpha$\ flux in the narrow component (H$\alpha$\ broad flux ratio or BFR), and the velocity dispersion of the broad component ($\sigma_b$). \begin{table*}[] \centering \begin{tabular}{c|c|c|c|c|c|c|c} 1) & 2) & 3) & 4) & 5) & 6) & 7) & 8) \\ $\Sigma_{SFR}~(M_\odot~\rm{yr}^{-1}~\rm{kpc}^{-2})$ & BFR & $\sigma_b$ (\mbox{km s$^{-1}$}) & $\Delta v$ (\mbox{km s$^{-1}$}) & $v_{\rm out}$\ & $\eta$ & $\dot{E}_{out}/(10^{-3}~L_{bol})$ & $\dot{p}_{out}/(L_{bol}/c)$ \\ \hline \multicolumn{8}{c}{Above and below median stacks} \\ \hline 0.11$\pm$0.07 & 0.14$^{+0.10}_{-0.07}$ & 153$^{+26}_{-3}$ & 9$^{+7}_{-14}$ & 296$^{+54}_{-15}$ & 0.05$\pm$0.03 & 0.05$\pm$0.03 & 0.09$\pm$0.04 \\ 0.41$^{+0.20}_{-0.23}$ & 0.68$\pm$0.09 & 199$^{+9}_{-8}$ & -20$\pm$6 & 418$^{+21}_{-15}$ & 0.31$\pm$0.03 & 0.46$\pm$0.03 & 0.64$\pm$0.04 \\ \hline \multicolumn{8}{c}{5 bin stacks} \\ \hline 0.25$\pm$0.04 & 0.31$^{+0.18}_{-0.09}$ & 180$^{+40}_{-15}$ & -13$\pm$17 & 373$^{+82}_{-35}$ & 0.13$^{+0.05}_{-0.03}$ & 0.18$\pm$0.05 & 0.28$^{+0.05}_{-0.07}$ \\ 0.31$\pm$0.06 & 0.73$^{+0.33}_{-0.16}$ & 166$^{+21}_{-7}$ & -22$^{+8}_{-10}$ & 355$^{+43}_{-18}$ & 0.29$^{+0.09}_{-0.05}$ & 0.35$\pm$0.05 & 0.54$^{+0.10}_{-0.07}$ \\ 0.45$\pm$0.07 & 0.92$^{+0.28}_{-0.11}$ & 183$^{+13}_{-8}$ & -16$\pm$8 & 384$^{+27}_{-18}$ & 0.40$^{+0.07}_{-0.05}$ & 0.51$\pm$0.06 & 0.77$\pm$0.09 \\ 0.80$\pm$0.09 & 0.62$^{+0.18}_{-0.12}$ & 240$^{+27}_{-18}$ & -24$^{+13}_{-15}$ & 504$^{+56}_{-39}$ & 0.33$^{+0.07}_{-0.04}$ & 0.71$^{+0.15}_{-0.07}$ & 0.85$\pm$0.10 \\ 1.44$^{+0.12}_{-0.52}$ & 0.79$^{+0.16}_{-0.11}$ & 263$^{+20}_{-12}$ & -67$^{+13}_{-16}$ & 595$^{+42}_{-30}$ & 0.51$^{+0.07}_{-0.05}$ & 1.51$^{+0.20}_{-0.12}$ & 1.51$\pm$0.13 \\ \hline \end{tabular} \caption{Weighted average $\Sigma_{\rm SFR}$, fit parameters and derived outflow properties for each of the $\Sigma_{\rm SFR}$\ stacks. \mbox{1) Weighted} average $\Sigma_{\rm SFR}$\ of the spaxels in the stack, corrected for broad emission contamination using Equation \ref{eqn:sfrsd_correction}. 2) H$\alpha$\ broad-to-narrow flux ratio. 3) Velocity dispersion of the broad component. \mbox{4) Velocity} offset between the centroids of the broad and narrow components. 5) Outflow velocity, calculated using \mbox{$v_{\rm out}$\ = $\Delta$v - 2$\sigma_b$}. \mbox{6) Mass} loading factor ($\dot{M}_{\rm out}$/SFR), assuming $n_e$~=~380~cm$^{-3}$ and $R_{\rm out}$~=~1.7~kpc. 7) Ratio of the measured energy outflow rate to the predicted energy outflow rate for winds driven by energy from supernova explosions. 8) Ratio of the measured momentum outflow rate to the predicted momentum outflow rate for winds driven by radiation pressure from massive stars.} \label{tab:plot_values} \end{table*} Figure \ref{fig:sample_halves_fits} shows the two component fits to the above and below median $\Sigma_{\rm SFR}$\ stacks (top panels), and the corresponding posterior and joint posterior distributions for the BFR and $\sigma_b$ (bottom panels). It is clear that both stacks are well fit by a two component Gaussian. The fit residuals (grey) are generally smaller than the 1$\sigma$ bootstrap errors on the spectra (purple shaded regions). The red shaded outflow components do not exhibit significant asymmetries and are not significantly offset in velocity space from the best fit narrow components, supporting our assumption that both the narrow and broad components are approximately Gaussian in shape. The high $\Sigma_{\rm SFR}$\ stack has a strong outflow component, with \mbox{BFR~=~0.68~$\pm$~0.09} and \mbox{$\sigma_b$~=~199$^{+9}_{-8}$~\mbox{km s$^{-1}$}}. The outflow parameters are well constrained and have approximately Gaussian posterior distributions. In contrast, the MCMC posteriors for the low $\Sigma_{\rm SFR}$\ stack reveal that the outflow component contains a small fraction of the total H$\alpha$\ flux and is only marginally detected above the beam smearing limit of 150~\mbox{km s$^{-1}$}. The best fit parameters are \mbox{$\sigma_b$~=~153$^{+26}_{-3}$} \mbox{km s$^{-1}$}\ and BFR~=~0.14$^{+0.10}_{-0.07}$. To further investigate how the properties of the outflow component vary as a function of $\Sigma_{\rm SFR}$, we split the above median $\Sigma_{\rm SFR}$\ bin into 5 smaller bins and perform two component Gaussian fitting on each of the resulting stacks. These 5 bins do not have equal numbers of spaxels - rather, they were chosen to span the range of observed $\Sigma_{\rm SFR}$\ values with approximately even logarithmic spacing. The weighted average $\Sigma_{\rm SFR}$, fit parameters and derived outflow parameters for all stacks are listed in Table \ref{tab:plot_values}. In the following sections we explore trends between $\Sigma_{\rm SFR}$\ and outflow properties. \begin{figure*} \centering \includegraphics[scale=0.7, clip = True, trim = 10 10 10 10]{sfrsd_bfr.pdf} \caption{Ratio of the H$\alpha$\ flux in the broad component to the H$\alpha$\ flux in the narrow component as a function of $\Sigma_{\rm SFR}$. Red symbols represent stacks of spaxels above and below the median $\Sigma_{\rm SFR}$, and blue symbols represent stacks of spaxels in five bins of $\Sigma_{\rm SFR}$. The error bars on the $\Sigma_{\rm SFR}$\ values represent the 16th-84th percentile range of $\Sigma_{\rm SFR}$\ values for the spaxels included in each stack, and the error bars on the BFR values represent the 68 per cent confidence interval from the MCMC fitting. The broad component accounts for an average of $\sim$10\% of the total H$\alpha$\ flux at $\Sigma_{\rm SFR}$~$<$~0.2~M$_\odot$~yr$^{-1}$~kpc$^{-2}$, but increases to $\sim$45\% of the H$\alpha$\ flux at $\Sigma_{\rm SFR}$~$>$~0.3~M$_\odot$~yr$^{-1}$~kpc$^{-2}$.} \label{fig:sfrsd_fbroad} \end{figure*} \subsection{H$\alpha$\ Broad-to-Narrow Flux Ratio (BFR)} Figure \ref{fig:sfrsd_fbroad} shows the broad flux ratios measured for the above and below median $\Sigma_{\rm SFR}$\ stacks (red circles) and for the five new $\Sigma_{\rm SFR}$\ stacks (blue circles). The errors on the $\Sigma_{\rm SFR}$\ values represent the 16th-84th percentile range of $\Sigma_{\rm SFR}$\ values for the spaxels included in each stack, and the error bars on the BFR values represent the 68 per cent confidence intervals from the MCMC fitting. \begin{sloppypar} The BFR increases from $\sim$0.15 at \mbox{$\Sigma_{\rm SFR}$~$<$~0.2~M$_\odot$~yr$^{-1}$~kpc$^{-2}$} to $\sim$0.75 at \mbox{$\Sigma_{\rm SFR}$~$>$~0.3~M$_\odot$~yr$^{-1}$~kpc$^{-2}$}. The factor of 5 increase in the BFR over a small range in $\Sigma_{\rm SFR}$\ suggests that outflows are only launched from regions with sufficiently high local $\Sigma_{\rm SFR}$. \end{sloppypar} \begin{figure*} \centering \includegraphics[scale=0.7, clip = True, trim = 10 10 10 10]{sfrsd_sigma.pdf} \caption{Velocity dispersion of the broad component as a function of $\Sigma_{\rm SFR}$. The purple line indicates the best fit power law relation between $\Sigma_{\rm SFR}$\ and $\sigma_b$ for our data, and the filled purple region indicates the 1$\sigma$ error around the best fit. The red shading indicates the region at $\sigma_b <$~150~\mbox{km s$^{-1}$}\ which was excluded from our analysis because broad emission components in this region could be dominated by beam smearing and/or stacking artefacts.} \label{fig:sfrsd_sig} \end{figure*} \citet{Newman12_global} analysed the integrated spectra of many of the galaxies in our sample and found that outflows are only driven from galaxies with global $\Sigma_{\rm SFR}$\ exceeding 1~M$_\odot$~yr$^{-1}$~kpc$^{-2}$\ -- a factor of 3-4 higher than the threshold local $\Sigma_{\rm SFR}$\ suggested by our data. If outflows arise from the regions with the highest $\Sigma_{\rm SFR}$, then the average $\Sigma_{\rm SFR}$\ across a galaxy with outflows should be lower than the $\Sigma_{\rm SFR}$\ of the regions actually driving the outflows. The majority of the discrepancy can be explained by the difference between the extinction prescriptions adopted in \citet{Newman12_global} and in this work. In this work, we follow the methodology of \citet{Tacchella18} who assume that the stellar extinction follows the \citet{Calzetti00} curve and the nebular extinction follows the \citet{Cardelli89} curve. We adopt \mbox{$f_{\rm */neb}$~=~0.7}, from which it follows that \mbox{$A_{H\alpha}$ = 0.83 $A_V$}. \citet{Newman12_global} assume that both the stellar and the nebular extinction follow the \citet{Calzetti00} curve, and they adopt \mbox{$f_{\rm */neb}$~=~0.44}, from which it follows that \mbox{$A_{H\alpha}$ = 1.86 $A_V$}. If we adopt the same extinction prescription as \citet{Newman12_global}, the median $\Sigma_{\rm SFR}$\ of the spaxels in our sample increases by a factor of 2.2. Another source of difference is the fact that \citet{Newman12_global} do not account for the contribution of the broad component to the measured H$\alpha$\ fluxes. If we did not apply the correction described in Section \ref{subsubsec:broad_contam_correction}, our $\Sigma_{\rm SFR}$\ values would be a factor of 1.5 higher. Therefore, the offset between our local $\Sigma_{\rm SFR}$\ threshold and the global $\Sigma_{\rm SFR}$\ threshold reported by \citet{Newman12_global} can be fully explained by differences in the adopted extinction prescription, and by the fact that they do not account for the contribution of the broad emission to the measured H$\alpha$\ fluxes. \subsection{Velocity Dispersion of the Broad Component ($\sigma_b$)}\label{subsec:sigma_fbroad} Figure \ref{fig:sfrsd_sig} shows how the velocity dispersion of the broad component varies as a function of $\Sigma_{\rm SFR}$. The red shading at the bottom of the plot indicates the region at \mbox{$\sigma_b <$~150~\mbox{km s$^{-1}$}} which was excluded from our analysis because broad emission components in this region could be dominated by beam smearing and/or stacking artefacts (see Sections \ref{subsec:sinfoni_fitting} and \ref{sec:beam_smearing}). There is a clear positive correlation between $\Sigma_{\rm SFR}$\ and $\sigma_b$, which can be well described by a power law (\mbox{$\sigma_b$ = $c_1~\Sigma_{SFR}^{c_2}$}). We fit only the 5 bin stacks and use orthogonal distance regression to account for both the spread in $\Sigma_{\rm SFR}$\ values within each bin and the errors on the $\sigma_b$ measurements. The best fit power law is shown by the purple line and filled error region in Figure \ref{fig:sfrsd_sig}, and is given by \begin{equation} \sigma_b~=~({241\pm 23}~\rm{km~s}^{-1})~\left(\frac{\Sigma_{SFR}}{\rm{M}_{\odot}~\rm{yr}^{-1}~\rm{kpc}^{-2}}\right)^{{0.30\pm 0.11}} \label{eqn:sfrsd_sig_eqn} \end{equation} The errors on the best fit parameters and the error region around the best fit curve were calculated using bootstrapping. We randomly perturbed the location of each stack in the $\Sigma_{\rm SFR}$-$\sigma_b$ plane according a 2D Gaussian distribution with dispersion in the two dimensions given by the errors on $\Sigma_{\rm SFR}$\ and $\sigma_b$, and then re-fit the \mbox{$\Sigma_{\rm SFR}$-$\sigma_b$} relation using the perturbed values. This process was repeated 100 times. The quoted errors on the normalisation and power law index represent the 1$\sigma$ ranges in the parameters obtained from the 100 bootstraps, and the purple shaded region in Figure \ref{fig:sfrsd_sig} indicates the 16th-84th percentile range of the 100 best fit curves at each $\Sigma_{\rm SFR}$\ value. We confirm that the $\Sigma_{\rm SFR}$-$\sigma_b$ correlation is not an artefact of beam smearing (which artificially increases the $\sigma_b$ in the central regions of galaxies where $\Sigma_{\rm SFR}$\ is often also the highest) by constructing and fitting another set of stacks, excluding nuclear spaxels (with galactocentric radius less than 3 kpc). Because the number of available spaxels is reduced, we also reduce the number of bins to four. The outflow component is not detected in the lowest $\Sigma_{\rm SFR}$\ stack, but the $\sigma_b$ values measured for the remaining 3 stacks are consistent (within the 1$\sigma$ errors) with the $\Sigma_{\rm SFR}$-$\sigma_b$ relation measured from the full set of spaxels. It is important to consider the fact that separating the star formation and outflow components becomes more difficult as the $\sigma_b$ and/or BFR decrease. We employ a forward modelling technique (described in Appendix \ref{sec:forward_modelling}) to investigate how robustly we can recover the intrinsic parameters of the outflow component in different regions of parameter space. In summary, we find that the true BFR for the below median stack could be a factor of $\sim$2 higher than measured, but is at least a factor of 2 lower than the BFRs of the high $\Sigma_{\rm SFR}$\ stacks. Our modelling also indicates that the true $\sigma_b$ for the below median $\Sigma_{\rm SFR}$\ stack may be as high as $\sim$180~\mbox{km s$^{-1}$}, which is comparable to the $\sigma_b$ values measured for the three stacks at \mbox{0.25 -- 0.45~M$_\odot$~yr$^{-1}$~kpc$^{-2}$}, and suggests that the \mbox{$\sigma_b$-$\Sigma_{\rm SFR}$} relation may flatten at low $\Sigma_{\rm SFR}$. \begin{figure*} \centering \includegraphics[scale=0.7, clip = True, trim = 10 10 10 10]{sfrsd_vout.pdf} \caption{Estimated outflow velocity $v_{\rm out}$\ as a function of $\Sigma_{\rm SFR}$. The dotted and dashed lines show the predicted scalings between $\Sigma_{\rm SFR}$\ and $v_{\rm out}$\ for energy driven and momentum driven outflow models, respectively. The scaling for our data lies between the two predictions, suggesting that the outflows may be driven by a combination of mechanical energy and momentum transport. \label{fig:sfrsd_vout}} \end{figure*} \subsection{Outflow Velocity}\label{subsec:vout} We use the measured outflow component kinematics to investigate how the outflow velocity varies with $\Sigma_{\rm SFR}$. \citet{Heckman00} reported that if gas is deposited into an outflow at approximately zero velocity and is then accelerated outwards, the maximum (terminal) velocity of the outflow is roughly \mbox{$\Delta v - \textrm{FWHM}_{broad}$/2} \citep[see also][]{Rupke05, Veilleux05}. \citet{Genzel11} adopted a slightly different definition for the outflow velocity \mbox{($v_{\rm out}$~$\sim \Delta v - 2 \sigma_b$)}, which brings the outflow velocities they measure from emission line spectra into better agreement with outflow velocities measured from absorption line spectra, for galaxies with similar stellar masses and SFRs. We adopt the \citet{Genzel11} definition for $v_{\rm out}$, but find that the slope of the $\Sigma_{\rm SFR}$-$v_{\rm out}$\ relation is independent of the chosen prescription for $v_{\rm out}$\ (see discussion below). The velocity shift of the outflow component relative to the star formation component is always $<$~70~\mbox{km s$^{-1}$}\ (see e.g. Figure \ref{fig:sample_halves_fits}), and therefore the outflow velocity is almost proportional to $\sigma_b$. Consequently $v_{\rm out}$, like $\sigma_b$, is positively correlated with $\Sigma_{\rm SFR}$\ (shown in Figure \ref{fig:sfrsd_vout}). We fit a power law relation to the $\Sigma_{\rm SFR}$\ and $v_{\rm out}$\ values of the 5 bin stacks, and obtain \begin{equation} v_{\rm out}~=~({524\pm 43}~\rm{km~s}^{-1})~\left(\frac{\Sigma_{SFR}}{\rm{M}_{\odot}~\rm{yr}^{-1}~\rm{kpc}^{-2}}\right)^{{0.34\pm 0.10}} \label{eqn:sfrsd_vout_eqn} \end{equation} \begin{sloppypar} The outflow velocities for the stacks at \mbox{$\Sigma_{\rm SFR}$~$>$~0.2~M$_\odot$~yr$^{-1}$~kpc$^{-2}$} range from \mbox{350-600~\mbox{km s$^{-1}$}}; in good agreement with the results of \citet{NMFS18b} who stacked global emission line spectra of galaxies with star formation driven outflows at 0.6~$<~z~<$~2.7 and found a typical outflow velocity of 450~\mbox{km s$^{-1}$}. Our outflow velocities are also similar to outflow velocities measured for galaxies with similar SFRs in various absorption line studies \citep[e.g.][]{Weiner09, Martin12, Kornei12, Heckman16}. \end{sloppypar} If we apply the $v_{\rm out}$\ definition adopted by \citet{Heckman00}, \citet{Rupke05} and \citet{Veilleux05}, the normalisation in Equation \ref{eqn:sfrsd_vout_eqn} changes to 325~$\pm$~38~\mbox{km s$^{-1}$}\ -- a factor of 1.6 lower than derived using the \citet{Genzel11} definition. The best fit power law index is the same regardless of the adopted definition for $v_{\rm out}$, and is in excellent agreement with many studies reporting similar power law scalings between $v_{\rm out}$\ and either $\Sigma_{\rm SFR}$\ or SFR, across a range of redshifts \citep[e.g.][]{Martin05, Weiner09, Martin12, Kornei12, Heckman15, Heckman16}. In Figure \ref{fig:sfrsd_vout} we also compare our derived $v_{\rm out}$-$\Sigma_{\rm SFR}$\ scaling to predictions from different star formation driven outflow models. The dotted line shows the best fit to our data for a scaling of \mbox{$v_{\rm out}$~$\propto$ $\Sigma_{\rm SFR}$$^{0.1}$}, which is predicted for outflows driven by energy from supernova explosions \citep[e.g.][]{Strickland04, Chen10}, and the dashed line shows the best fit to our data for a scaling of \mbox{$v_{\rm out}$~$\propto$ $\Sigma_{\rm SFR}$$^2$}, which is predicted for outflows driven by momentum transport through radiation pressure \citep[e.g.][]{Murray11, Kornei12}. The observed relationship between $v_{\rm out}$\ and $\Sigma_{\rm SFR}$\ for our stacks lies between the two model predictions, suggesting that the outflows in the SINS/zC-SINF AO star forming galaxies may be driven by a combination of energy from supernova explosions and radiation pressure from massive stars. \subsection{Mass Loading Factor $\eta$}\label{subsec:mass_loading} The mass loading factor $\eta$ is defined as the ratio of the mass outflow rate to the star formation rate, and is an important parameter governing the strength of feedback in cosmological simulations (see further discussion in Section \ref{subsec:mass_budget}). $\eta$ can be estimated from the outflow velocity and the H$\alpha$\ broad-to-narrow ratio, following the method described in \citet{Genzel11} and \citet{Newman12_406690}. The model assumes that the outflow velocity and mass outflow rate are constant. The narrow component of the line emission is assumed to be associated with photoionized \mbox{H II}\ region gas, while the broad component is assumed to be associated with photoionized gas in the outflow. Under these conditions (following \citealt{Newman12_global}), the mass outflow rate $\dot{M}_{\rm out}$ can be derived as follows: \begin{align} \dot{M}_{\rm out}~(\textrm{g~s}^{-1}) &= \frac{1.36 m_H}{\gamma_{\rm H\alpha} n_e} \left(\frac{v_{\rm out}}{R_{\rm out}} \right) L_{\rm H\alpha, broad} \label{eqn:mdot_out} \end{align} \noindent where 1.36$m_H$ is the effective nucleon mass for a 10 per cent helium fraction, $\gamma_{\rm H\alpha}$~=~3.56~$\times$~10$^{-25}$~erg~cm$^3$~s$^{-1}$ is the H$\alpha$\ emissitivity at \mbox{T = 10$^4$K}, $n_e$ is the local electron density in the outflow, $R_{\rm out}$\ is the maximum (deprojected) radial extent of the outflow, and $L_{\rm H\alpha, broad}$ is the H$\alpha$\ luminosity of the outflow component. The SFR is given by \begin{align} \textrm{SFR~(g~s}^{-1}) &= \frac{1.99\times 10^{33}}{3.15 \times 10^7}\left(\frac{L_{\rm H\alpha, narrow}}{2.1 \times 10^{41}} \right) \label{eqn:sfr_eqn} \end{align} \noindent where $L_{\rm H\alpha, narrow}$ is the H$\alpha$\ luminosity of the narrow component. The first term of Equation \ref{eqn:sfr_eqn} is the number of grams per solar mass divided by the number of seconds per year, and converts the SFR from units of $M_\odot$~yr$^{-1}$ to g~s$^{-1}$. Equations \ref{eqn:mdot_out} and \ref{eqn:sfr_eqn} can be combined to calculate the mass loading factor as follows: \begin{align} \eta &= \left( \frac{3.15 \times 2.1 \times 10^{48}}{1.99 \times 10^{33}} \right) \frac{1.36 m_H}{\gamma_{\rm H\alpha} n_e} \left( \frac{H\alpha_{\rm broad}}{H\alpha_{\rm narrow}} \right) \frac{v_{\rm out}}{R_{\rm out}} \end{align} In the following sub-sections we discuss the assumption that the outflowing gas is photoionized (Section \ref{subsubsec:ionization}), motivate our choice of electron density and outflow extent (Sections \ref{subsubsec:electron_density} and \ref{subsubsec:outflow_extent}), and analyse the variation in $\eta$ as a function of $\Sigma_{\rm SFR}$\ (Section \ref{subsubsec:eta_sfrsd}). \subsubsection{Ionization Mechanisms}\label{subsubsec:ionization} The assumption that both components are primarily photoionized is justified by the measured emission line ratios (\mbox{\NII/H$\alpha$\ = 0.12$\pm$0.02} for the narrow component and \mbox{\NII/H$\alpha$\ = 0.27$\pm$0.04} for the broad component of the above median $\Sigma_{\rm SFR}$\ stack), which are consistent with stellar photoionization \citep{Baldwin81, Ke01a}. The low \NII/H$\alpha$\ ratio of the outflow component is surprising, because star-formation driven outflows in the local universe often show signatures of strong shocks \citep[e.g.][]{Sharp10, Rich11, Soto12b, Ho14}. In our z$\sim$2 star forming galaxies, the \NII/H$\alpha$\ ratio of the outflow component is enhanced by 0.35 dex compared to the narrow component, which can be explained by a 30-40\% contribution from shock excitation \citep[see e.g.][]{Rich11, Yuan12}. \citet{Sharp10} argue that the shock-like line ratios in local star formation driven outflows are the result of bursty star formation. By the time the energy from supernova explosions is able to dislodge gas from the disk and launch winds, most of the massive stars have died. It is possible that our $z\sim$~2 galaxies are experiencing extended periods of star formation, so that stellar photoionization dominates over shock excitation even after winds have been launched. However, a more likely explanation for the low shock fraction is that we are simply probing material close to the galaxy disks where the large scale stellar radiation field is strong. Low shock fractions are observed close to the disks of several prototypical starburst driven superwind galaxies including M82, NGC~1482 and NGC~253 \citep{Shopbell98, Veilleux02, Westmoquette11}. \subsubsection{Electron Density}\label{subsubsec:electron_density} The electron density determines the constant of proportionality between the broad H$\alpha$\ luminosity and the outflow mass in Equation \ref{eqn:mdot_out}, but is notoriously difficult to measure. In principle, the electron density in the outflow can be calculated from the ratio of the broad component amplitudes of the \mbox{[S II]}\ doublet lines (\mbox{[S II]}$\lambda$6716/\mbox{[S II]}$\lambda$6731; \citealt{Osterbrock06}). However, the \mbox{[S II]}\ line emission in our stacks is not strong enough to independently constrain the amplitudes of the narrow and broad components. Previous studies have faced similar issues, leading to large uncertainties on the electron densities and the resulting mass loading factors. For example, \citet{Newman12_global} measured an electron density of \mbox{10$^{+590}_{-10}$ cm$^{-3}$} in the broad component for a stack of 14 galaxies with star formation driven outflows from the SINS/zC-SINF survey. Other recent studies of outflows at high redshift by \citet{Freeman17} and \citet{Leung17} were unable to constrain the electron density and adopted the \citet{Newman12_global} value. Important progress was made by \citet{NMFS18b}, who performed the most accurate measurement to date of the electron density in star formation driven ionized gas outflows at high redshift. They started with a sample of 599 galaxies from the \mbox{SINS/zC-SINF} and KMOS$^{\rm{3D}}$\ surveys, which includes many of our galaxies and covers the main sequence of star forming galaxies at \mbox{0.6 $<~z~<$ 2.7} over a stellar mass range of \mbox{9.0 $<$ log(M$_*$/M$_\odot$) $<$ 11.7}. They stacked the spectra of 33 galaxies with individual high S/N detections of star formation driven outflows, and fit two components to each of the \mbox{[S II]}\ lines in the stacked spectrum. They measured electron densities of \mbox{76$^{+24}_{-23}$ cm$^{-3}$} and \mbox{380$^{+249}_{-167}$ cm$^{-3}$} for the narrow and outflow components, respectively. The outflow component is denser than the star formation component, providing further evidence to suggest that the outflowing material may be shocked. The \citet{NMFS18b} results are consistent with several other studies of ionized gas outflows that have also found the outflowing gas to be denser than the \mbox{H II}\ region gas \citep[e.g.][]{Arribas14, Ho14, Perna17, Kakkad18}. We therefore adopt an outflow electron density of 380~cm$^{-3}$. There are no observational constraints on how the electron density in the outflow varies as a function of $\Sigma_{\rm SFR}$, so we assume that it is constant. \begin{figure*} \centering \includegraphics[scale=0.7, clip = True, trim = 10 15 10 10]{sfrsd_mass_loading.pdf} \caption{Estimated mass loading factor $\eta$ as a function of $\Sigma_{\rm SFR}$. $\eta$ is inversely proportional to the electron density in the outflow component, which we assume here to be 380~cm$^{-3}$. The derived $\eta$ values are significantly lower than what is typically assumed for stellar feedback in cosmological simulations, suggesting that a significant fraction of the outflowing mass must be in other gas phases. \label{fig:sfrsd_eta}} \end{figure*} \subsubsection{Radial Extent of the Outflow}\label{subsubsec:outflow_extent} The $v_{\rm out}$/$R_{\rm out}$\ term in Equation \ref{eqn:mdot_out} is the inverse of the dynamical time of the outflow (see e.g. \citealt{Veilleux05}), and $R_{\rm out}$\ is the radial extent of the outflow from the point of launch. For the stacking analysis presented in this paper, the correct choice of $R_{\rm out}$\ is not clear, because the stacks combine many spectra which trace outflows at different distances from their point of launch. Therefore, we explore two extreme cases to obtain upper and lower limits on $R_{\rm out}$, and adopt an intermediate value in our subsequent calculations. To obtain a lower limit on $R_{\rm out}$, we assume that the outflowing material is always observed close to where it was launched. We take the minimum $R_{\rm out}$\ to be the typical half width at half maximum of the PSF, which for our sample is 0.7~kpc \citep[see also][]{Newman12_406690}. To obtain an upper limit on $R_{\rm out}$, we assume that the outflowing material could have been launched from anywhere within the galaxies. The maximum galactocentric radius to which broad emission is observed in the SINS/zC-SINF AO galaxies is 2.6 kpc \citep{Newman12_global}, so we take that as the upper limit on $R_{\rm out}$. For our subsequent analysis we adopt the average of the lower and upper limits: $R_{\rm out}$~=~1.7~kpc. As for $n_e$, we assume that $R_{\rm out}$\ is independent of $\Sigma_{\rm SFR}$. \subsubsection{Trends with $\Sigma_{\rm SFR}$}\label{subsubsec:eta_sfrsd} Figure \ref{fig:sfrsd_eta} shows the $\eta$ values calculated for our stacks. The mass loading factor scales linearly with both BFR and $v_{\rm out}$\, and consequently shows a clear positive correlation with $\Sigma_{\rm SFR}$. The positive correlation between $\Sigma_{\rm SFR}$\ and $\eta$ is in agreement with results from other studies of neutral and ionized gas outflows \citep[e.g.][]{Chen10, Newman12_global, Arribas14}, but is in tension with models which predict that $\eta$ should be inversely correlated with $\Sigma_{\rm SFR}$\ \citep[e.g][]{Hopkins12, Creasey13, Lagos13, Li17}. The errors on the $\eta$ values shown in Figure \ref{fig:sfrsd_eta} do not include the $\sim$~50\% errors on $R_{\rm out}$\ and $n_e$, which would translate to a $\sim$~70\% uncertainty on $\eta$. If $R_{\rm out}$\ and $n_e$ are independent of $\Sigma_{\rm SFR}$\ (as we have assumed), then the \textit{shape} of the \mbox{$\Sigma_{\rm SFR}$-$\eta$} relationship is independent of the chosen $R_{\rm out}$\ and $n_e$ values, but there is a $\sim$~70\% error on the normalisation of the relationship (the average $\eta$). However, if $R_{\rm out}$\ and $n_e$ vary as a function of $\Sigma_{\rm SFR}$, then the true shape of the relationship between $\Sigma_{\rm SFR}$\ and $\eta$ may be different. We note that even at \mbox{$\Sigma_{\rm SFR}$\ $>$ 0.3~M$_\odot$~yr$^{-1}$~kpc$^{-2}$}, the $\eta$ values are relatively low \mbox{($\eta\ \sim$~0.3-0.5)}, suggesting that the ionized gas outflow rates are considerably smaller than the SFRs of the clumps driving the outflows. \citet{NMFS18b} found similarly low galaxy-integrated mass loading factors for star formation driven outflows at \mbox{0.6 $<$ z $<$ 2.7} in the KMOS$^{\rm{3D}}$\ survey. \citet{Freeman17} found higher mass loading factors of \mbox{0.64-1.4} for star formation driven outflows in galaxies with similar stellar masses and redshifts to the galaxies in our sample (\mbox{9.8 $<$ log(M$_*$/M$_\odot$) $<$ 10.7} at \mbox{1.37 $<$ z $<$ 2.61}), but this difference is due to the fact that they assumed an electron density of 50~cm$^{-3}$. If we re-calculate the mass loading factors for their sample assuming $n_e$~=~380~cm$^{-3}$, the mass loading factors decrease to $\eta$~=~0.08-0.18. Likewise, \citet{Newman12_global} found $\eta \sim$~2 for a very similar sample of galaxies to the one used in this paper, assuming $n_e$~=~50~cm$^{-2}$. If we re-scale this $\eta$ value for $n_e$~=~380~cm$^{-3}$, we obtain $\eta \sim$~0.26. \begin{figure*} \centering \includegraphics[scale=0.59, clip = True, trim = 10 10 0 0]{sfrsd_eratio.pdf}\includegraphics[scale=0.59, clip = True, trim = 10 10 10 0]{sfrsd_pratio.pdf} \caption{Panel a): Measured energy outflow rate $\dot{E}_{\rm out}$ as a fraction of the energy outflow rate predicted by \citet{Murray05} for energy driven winds (10$^{-3}$L$_{\rm bol}$). Panel b): Measured momentum outflow rate $\dot{p}_{\rm out}$ as a fraction of the predicted momentum outflow rate for momentum driven winds (L$_{\rm bol}$/c). \label{fig:sinfoni_outflow_energetics}} \end{figure*} We emphasise that the normalisation of the mass loading factor is impacted by uncertainties on the electron density and the radial extent of the outflow. However, if the ionized gas mass loading factors are indeed so low, the outflows would not appear to be able to remove enough gas to explain the low baryon fractions of low mass halos \citep[e.g.][]{Baldry08, Moster13, Moustakas13, Behroozi13}. We have measured only the warm ionized gas phase of the outflows, and the overall mass loading factors could be higher if most of the outflowing mass is in other gas phases (see also discussion in \citealt{NMFS18b}). This will be discussed further in Section \ref{subsec:mass_budget}. \subsection{Outflow Energetics} In the absence of an AGN, galaxy scale outflows are generally thought to be driven by either the energy released through supernova explosions and radiation from young stars, or by the transport of momentum by means of radiation pressure, supernovae and stellar winds. Assuming that 1 per cent of the bolometric luminosity of the stars is released as energy in supernova explosions, and that 10 per cent of this energy is able to couple to the ISM, \citet{Murray05} predict that for an energy driven wind, the energy outflow rate should be $\dot{E}_{\rm out} \sim$~10$^{-3}$~L$_{\rm bol}$, whereas for a momentum driven wind, the momentum outflow rate should be $\dot{p}_{\rm out} \sim$~L$_{\rm bol}$/c. We assume that \mbox{$L_{\rm bol}$ $\sim$ SFR~$\times$~10$^{10}$~L$_\odot$} \citep{Kennicutt98}. The energy and momentum outflow rates for each of the stacks can be calculated as follows: \begin{eqnarray} \dot{E}_{\rm out} &=& \frac{1}{2} \dot{M} v_{\rm out}^2 = \frac{1}{2} \eta \times \textrm{SFR} \times v_{\rm out}^2 \\ \dot{p}_{\rm out} &=& \dot{M} v_{\rm out} = \eta \times\ \mathrm{SFR} \times v_{\rm out} \end{eqnarray} Figure \ref{fig:sinfoni_outflow_energetics} shows the ratios of the calculated energy and momentum outflow rates for each of the stacks to the predicted energy and momentum outflow rates from \citet{Murray05}. For the stacks with \mbox{$\Sigma_{\rm SFR}$\ $<$ 1.0~M$_\odot$~yr$^{-1}$~kpc$^{-2}$}, the ratios are in the following ranges: \begin{eqnarray} \frac{\dot{E}_{\rm out}}{10^{-3}{\rm L}_{\rm bol}} &=& 0.05-0.71~\times~\frac{380~{\rm cm}^{-3}}{{\rm n}_e} \frac{1.7~{\rm kpc}}{{\rm R}_{\rm out}} \\ \frac{\dot{p}_{\rm out}}{{\rm L}_{\rm bol}/{\rm c}} &=& 0.09-0.85~\times~\frac{380~{\rm cm}^{-3}}{{\rm n}_e} \frac{1.7~{\rm kpc}}{{\rm R}_{\rm out}} \end{eqnarray} The ratios do not exceed 1, suggesting that the current star formation activity is sufficient to power the observed outflows and that no additional energy source is required. However, the ratios show a strong correlation with $\Sigma_{\rm SFR}$\ which is not explained by the \citet{Murray05} models. For the highest $\Sigma_{\rm SFR}$\ stack, the energy and momentum outflow rates exceed the predicted rates by a factor of 1.5. There are several possible explanations for this discrepancy. A significant amount of the energy or momentum driving the outflows may come from source(s) which are not accounted for in the \citet{Murray05} model, such as cosmic rays \citep[see e.g.][]{Ruszkowski17, Girichidis18}. The SFR measured from the narrow component of the H$\alpha$\ emission may not be representative of the SFR at the time and point of launch of the outflows, either because the SFR has changed over time, or because the outflows have propagated away from their launch points (which is the case for one of the outflows in ZC406690; \citealt{Newman12_406690}). Alternatively, one or more of the assumptions made in our calculations may be incorrect: the adopted electron density or extent of the outflow may be too low, the majority of the outflowing gas may be collisionally excited rather than photoionized (which would change the coefficients in the outflow mass calculation and reduce $\eta$ by a factor of $\sim$2; \citealt{Genzel11}), or the emission lines may be partially broadened by mechanisms other than outflows (such as shocks or turbulent mixing layers; see further discussion in Section \ref{subsec:shocks_mixing}). \section{Discussion}\label{sec:discussion} \subsection{Escape Fraction and Mass Budget}\label{subsec:mass_budget} In order to gauge the impact of the star formation driven outflows on the stellar mass growth and structural evolution of their host galaxies, we investigate whether any of the outflowing material is travelling fast enough to escape the galaxy halos. The halo escape velocity is approximately three times the galaxy circular velocity \citep[e.g.][]{Weiner09}. We calculate the `characteristic' circular velocity for each $\Sigma_{\rm SFR}$\ bin by assigning each spaxel the circular velocity of its host galaxy (given in \citealt{NMFS18a}), and then averaging the circular velocities assigned to all the spaxels in the relevant bin. The characteristic circular velocities (halo escape velocities) decrease from $\sim$230~\mbox{km s$^{-1}$}\ (690~\mbox{km s$^{-1}$}) at the lowest $\Sigma_{\rm SFR}$\ to $\sim$180~\mbox{km s$^{-1}$}\ (540~\mbox{km s$^{-1}$}) at the highest $\Sigma_{\rm SFR}$. The highest $\Sigma_{\rm SFR}$\ bin is the only one for which the outflow velocity (595~\mbox{km s$^{-1}$}) exceeds the characteristic halo escape velocity. Therefore, if the outflows are spherically symmetric, very little of the outflowing material is likely to escape from the galaxy halos. If the outflows are biconical and perpendicular to the galaxy disks \citep[as suggested by observations of higher outflow velocities in face on galaxies than edge on galaxies; e.g.][]{Heckman00, Chen10, Kornei12, Newman12_global, Bordoloi14}, the outflow velocities will be under-estimated by a factor of 1/cos(\textit{i}), which is equivalent to the inverse of the typical galaxy axis ratio. We calculate characteristic axis ratios for each of our stacks using the same method applied to calculate the characteristic circular velocities. We find that if the outflows are biconical, the outflowing material in the two highest $\Sigma_{\rm SFR}$\ bins would have sufficient velocity to escape the galaxy halos. We note that if the outflowing material is still being accelerated, the terminal velocities will be higher than the measured outflow velocities and more material will be able to escape from the halos. On the other hand, if the outflows are ballistic, the outflow velocity will decrease over time and less material will be able to escape. Better observational constraints on the geometry and velocity structure of star formation driven outflows are required to more accurately determine the fate of the outflowing material. We conclude that the majority of the ionized gas in the outflows is likely to decelerate and be re-accreted onto the galaxy disks. The re-accretion of gas launched in outflows is important for the chemical evolution of galaxies because outflows carry significant amounts of heavy metals \citep[e.g.][]{Larson74, Tremonti04, Finlator08, Peeples14, Zahid14}. Galaxy formation simulations with star formation feedback suggest that the timescale for re-accretion of the outflowing material is approximately 1-2 Gyr \citep[e.g.][]{Oppenheimer10, Brook14}. The mass loading factors derived in this paper are quite low; \mbox{$\eta$ $\sim$ (0.3 - 0.5)~$\times$~380~cm$^{-3}$/$n_e$}. $\eta$ is proportional to $v_{\rm out}$, so if the outflows are biconical the maximum $\eta$ could increase to $\sim$~0.7, but this would only partially resolve the tension with cosmological simulations which typically require $\eta \ga$~1 to reproduce the low baryon fractions of low mass halos \citep[e.g.][]{Finlator08, Dave11, Hopkins12, Vogelsberger14, Muratov15}. The discrepancy between the predicted and measured mass loading factors can potentially be resolved by considering the mass contained in other phases of the outflows. Multi-wavelength observations of star formation and AGN driven outflows, both locally and at high redshift, suggest that the ionized gas phase accounts for only a small fraction of the total mass and energy expelled in outflows. The ionized gas outflow in M82 contains only $\sim$1-2\% of the mass carried in the neutral and molecular phases of the outflow \citep{Shopbell98, Walter02, Contursi13, Leroy15}. Similary, in the local starburst/quasar ultra-luminous infrared galaxy Mrk~231, the ionized gas outflow rate is $\sim$4000 times lower than the molecular and neutral gas outflow rates \citep[e.g.][]{Cicone14}. In general, AGN driven outflows appear to carry more mass and energy in the neutral and molecular gas phases than in the ionized gas phase \citep[e.g.][]{Rupke13, Carniani17, Fluetsch18, HerreraCamus19}. There is some evidence that in local star forming galaxies the ionized gas outflow rate may be comparable to the neutral and molecular gas outflow rates \citep[e.g.][]{Fluetsch18}, but larger samples of galaxies with observations in multiple outflow tracers are required to overcome the large uncertainties on the mass outflow rates. It is also important to consider the contribution of the hot X-ray emitting gas. This phase is very difficult to observe, but multi-phase simulations of star formation driven outflows predict that at distances of $\gtrsim$~1~kpc from the disk, the majority of the outflowing mass and energy will be carried by the hot phase \citep[e.g.][]{Li17, Fielding18, Kim18}. It is clear that the total mass outflow rates and gas recycling rates are strongly dependent on the multi-phase mass budget, geometry and velocity structure of the outflows (see also discussion in \citealt{NMFS18b}). Better constraints on these properties are therefore key to improving our understanding of the impact of star formation feedback on the growth and evolution of $z\sim$~2 star forming galaxies. \subsection{Alternative Sources of Broad Emission}\label{subsec:shocks_mixing} Throughout this paper we have assumed that the broad component of the H$\alpha$\ line emission traces the bulk motion of ionized gas entrained in star formation driven outflows, and therefore that the velocity dispersion of the broad component is a direct tracer of the outflow velocity. In Section \ref{sec:broad_emission} we showed that the H$\alpha$\ line width is strongly correlated with $\Sigma_{\rm SFR}$, indicating that the broad emission is related to star formation. On the other hand, the shape of the H$\alpha$\ line is not correlated with either the $A_V$ or the galactocentric distance, indicating that scattered light and beam smearing are unlikely to be significant sources of broad emission in our galaxies (see also discussion in Appendix \ref{sec:beam_smearing}). Absorption line studies indicate that outflows are ubiquitous in star forming galaxies at z$\sim$2 \citep[e.g.][]{Shapley03, Weiner09, Rubin10, Steidel10, Erb12, Kornei12, Bordoloi14}. It is therefore not surprising that we observe broad H$\alpha$\ emission associated with the ionized phase of these outflows. However, it is important to consider the possibility that the kinematics of the outflowing gas may include significant contributions from turbulent motions as well as bulk flows. The outflowing gas may collide with material in the ISM of the galaxies and trigger shocks. The broad component of the above median $\Sigma_{\rm SFR}$\ stack has an \NII/H$\alpha$\ ratio of 0.27$\pm$0.04, which is significantly lower than would be expected for purely shock-excited gas \citep[e.g.][]{Allen08, Rich11}, but significantly higher than the 0.12$\pm$0.02 measured for the narrow component. This suggests that up to 30-40\% of the H$\alpha$\ emission could be shock excited, with the remaining gas photoionized by young stars in the galaxy disks (see discussion in Section \ref{subsubsec:ionization}). \citet{NMFS18b} found that the material emitting the broad H$\alpha$\ is denser than the \mbox{H II}\ region gas, suggesting that the broad component may trace compressed clumps of ionized gas entrained within the wind fluid. If the outflowing gas is shock excited, the width of the broad component would reflect the shock velocity, but the shock velocity is expected to be similar to the outflow velocity \citep[see e.g.][]{Soto12b, Ho14, McElroy15}. Broad emission could also arise from turbulent mixing layers at the interface between cold gas in the disk and hot wind fluid \citep[e.g.][]{Slavin93, Esquivel06, Westmoquette07, Westmoquette09, Westmoquette11, Wood15}. In this scenario, the width of the broad component would reflect the turbulent velocity rather than the outflow velocity. We cannot rule out the possibility that the outflow components in our stacks are broadened by turbulent mixing layers in the ISM. However, the $\Sigma_{\rm SFR}$-$v_{\rm out}$\ scaling we measure in Section \ref{subsec:vout} is consistent with results from absorption line studies of star-formation driven outflows at low and high redshift \cite[e.g.][]{Martin05, Weiner09, Heckman16, Sugahara17}, which suggests that the kinematics of the outflowing gas are likely to be dominated by bulk flows, with only a minor contribution from turbulent motions. \section{Summary and Conclusions} \label{sec:conc} We investigated the relationship between star formation activity and the incidence and properties of outflows on scales of 1-2 kpc in a sample of 28 star forming galaxies at $z\sim$~2~--~2.6 from the SINS/zC-SINF AO Survey. This work builds on previous studies of the relationship between \textit{global} galaxy properties and outflow properties in the SINS/zC-SINF AO sample \citep{Newman12_global}, and the relationship between the \textit{resolved} star formation and outflow properties of star forming clumps in 5 SINS/zC-SINF AO galaxies \citep{Genzel11, Newman12_406690}. With the aid of stacking we are able to probe not only the actively star forming clump regions which have been studied previously, but also the fainter inter-clump regions, spanning a factor of $\sim$50 in $\Sigma_{\rm SFR}$. We divided the spaxels from the 28 datacubes into bins of different physical properties (SFR, $\Sigma_{\rm SFR}$, stellar mass surface density $\Sigma_*$, $\Sigma_{\rm SFR}$/$\Sigma_*$, $A_V$ and galactocentric distance), and stacked the spectra of the spaxels in each bin to obtain high signal to noise H$\alpha$\ line profiles. The H$\alpha$\ profiles were used to simultaneously probe the star formation (from the narrow component of the line) and the outflows (which, when present, produce an additional broader line emission component). The width of the outflow component is a tracer of the outflow velocity, and the flux of the outflow component is a tracer of the mass in the outflow. Our main results are as follows: \begin{enumerate} \item The width of the H$\alpha$\ line is most strongly dependent on the level of star formation (probed by the SFR and $\Sigma_{\rm SFR}$), supporting the notion that the observed broad emission is associated with star formation driven outflows. $\Sigma_*$\ may also play a role in governing the incidence and properties of the outflows. \item The outflow component contains an average of $\sim$45\% of the H$\alpha$\ flux emitted from the highest $\Sigma_{\rm SFR}$\ regions, but is less prominent at lower $\Sigma_{\rm SFR}$. \item The outflow velocity scales as \mbox{$v_{\rm out}$~$\propto$~$\Sigma_{\rm SFR}$$^{0.34 \pm\ 0.10}$}. This scaling is shallower than the predicted \mbox{$\Sigma_{\rm SFR}$$^2$} dependence for outflows driven by momentum transport through radiation pressure, but steeper than the predicted \mbox{$\Sigma_{\rm SFR}$$^{0.1}$} dependence for outflows driven by kinetic energy from supernovae and stellar winds, suggesting that the observed outflows may be driven by a combination of these mechanisms. \item The outflow velocity is lower than the halo escape velocity in all but the highest $\Sigma_{\rm SFR}$\ regions, indicating that the majority of the outflowing material will not be expelled but will decelerate and fall back onto the galaxy disks. Simulations suggest that this material will likely be re-accreted after 1-2 Gyr, contributing to the chemical enrichment of the galaxies. \item The mass loading factor $\eta$ increases with $\Sigma_{\rm SFR}$. The normalisation of $\eta$ is uncertain due to the large uncertainties on the radial extent and electron density of the outflowing material, but we find \mbox{$\eta~\sim$ 0.4 $\times$ (380~cm$^{-3}$/n$_e$) $\times$} \mbox{(1.7~kpc/R$_{\rm out}$)}. This may be in tension with cosmological simulations (which typically require $\eta~\ga$~1 to explain the low efficiency of formation of low mass galaxies), unless a significant fraction of the outflowing mass is in other gas phases and is able to escape the galaxy halos. \item In 6/7 stacks the current star formation activity is powerful enough to drive the observed outflows. The energy and momentum outflow rates for the highest $\Sigma_{\rm SFR}$\ stack exceed the predicted rates for star formation driven outflows by a factor of 1.5. This may indicate that other energy sources (such as cosmic rays) contribute significantly to driving the outflows, that the SFR has changed since the outflows were launched, that the outflows have propagated away from their point of launch, that the adopted electron density or extent of the outflow is too low, and/or that the emission lines are partially broadened by mechanisms other than outflows (such as shocks or turbulent mixing layers). \end{enumerate} Our results confirm that $\Sigma_{\rm SFR}$\ is closely related to the incidence and properties of outflows on 1-2~kpc scales. In this paper we have only explored the average incidence and properties of outflows as a function of $\Sigma_{\rm SFR}$, which makes it difficult to draw strong conclusions on the relative importance of global and local galaxy properties in determining the properties of the outflows. In the future it will be important to investigate how much the outflow velocity and H$\alpha$\ broad flux ratio vary at fixed local $\Sigma_{\rm SFR}$, and determine which local and/or global properties are responsible for driving these variations. \acknowledgements We thank the referee for their detailed feedback and useful suggestions which improved the clarity of this paper. RLD would like to thank Alice Shapley and Sylvain Veilleux for insightful discussions about this work. ST is supported by the Smithsonian Astrophysical Observatory through the CfA Fellowship. ESW acknowledges support by the Australian Research Council Centre of Excellence for All Sky Astrophysics in 3 Dimensions (ASTRO 3D), through project number CE170100013. This research made use of \textsc{Astropy}, a community-developed core Python package for Astronomy \citep{Astropy13, Astropy18}, \textsc{Matplotlib} \citep{Hunter07}, and \textsc{Statsmodels} \citep{Seabold10}.
\section{Introduction} Reinforcement learning is a type of machine learning in which an agent learns from its experience in an environment to maximize some cumulative reward \cite{sutton1998reinforcement,mnih2015human}. The environment is a crucial part of any reinforcement learning setting, as the environment defines the dynamics of the world in which the agent is embedded and hence it determines (possibly stochastically) the feedback to the agent's actions. This feedback includes the next observation state for the agent and its external rewards. Large part of creating a reinforcement learning task consists of programming the environment or world in which the agent will be immersed and interacting with other elements. This includes the properties of all possible items in the environment, their positioning, the set of events triggering rewards and punishments, and the computation of the next observation state. The latter can be complicated by the perceptual properties with which we would like to endow our agent. In particular, more realistic agents typically do not observe directly the environment state but just a function or partial state of it. For example, simulating the finite field of vision of an agent in an environment with occluders is a common situation leading to such partial observations of states. In this work we present \texttt{APES} (Artificial Primate Environment Simulator), a Python tool to create 2D grid-world environments for reinforcement learning tasks. The name derives from the use of our environment for simulating real experiments with real apes competing for a reward in a controlled environment \cite{hare2000chimpanzees}. \texttt{APES} allows the user to quickly build 2D environments for reinforcement learning problems by allowing the user to add layers of different types of pre-defined or new items, set any rewarding scheme, and interface an agent with the environment (i.e. compute the agent's next observation state and perform the agent's action). Moreover, the agent can be equipped with different types of vision with customizable parameters. Importantly, \texttt{APES} also supports the interaction of multiple agents in the same environment, and hence could be used to train and test multiagent reinforcement learning algorithms \cite{busoniu2008comprehensive,schwartz2014multi,tampuu2017multiagent,foerster2016learning}. The full code can be found at \url{https://github.com/aqeel13932/APES}. In the next section we describe some alternative software solutions. The rest of the paper is the core of this contribution and it explains the organization and capabilities of \texttt{APES} as well as an example of its use to simulate a simple reinforcement task. \subsection{Related Work} There are other solutions to simulate simple environments for reinforcement learning tasks. Here, we focus on \texttt{MazeBase}, \texttt{OpenAI gym}, and \texttt{VGDL} and note their main differences with \texttt{APES}. \texttt{MazeBase} \cite{DBLP:journals/corr/SukhbaatarSSCF15} is a 2D grid-world environment to create simple games programmable by the user. \texttt{MazeBase} can also have a non-visual world representation. Although \texttt{MazeBase} offers a variety of types and co-existing elements on same grid cell, the agents have limited vision options. The wrapper \texttt{OpenAI gym} \cite{DBLP:journals/corr/BrockmanCPSSTZ16} offers numerous games but lacks the option to customize the environment, and most games are fully observed environments. \texttt{VGDL}\cite{schaul2013pyvgdl} allows to define different kinds of games in declarative language, yet it lacks the control of some vision properties such as partial observability in 2D. \section{Environment} \texttt{APES} is organized around two basic structures: the World and the agents' interface with the world. The first defines the characteristics and dynamics of the environment, while the second describes the interaction of one or multiple agents with the environment. Each agent can be controlled with any algorithm external to \texttt{APES} (say your favourite implementation of deep reinforcement learning) and the agent solely interacts with \texttt{APES} by receiving an observation state and reward, and sending an action to be performed in the world. See Figure \ref{fig.env} for a diagram illustrating the APES environment within the framework of reinforcement learning. Next we describe the elements of these structures. We begin with the world. \begin{figure}[t] \begin{center} \includegraphics[scale=0.5]{Images/rl_env.png} \caption{\texttt{APES} environment and its relation to the framework of reinforcement learning. \texttt{APES} handles the world environment and its interface with a number of agents controlled by external algorithms.} \label{fig.env} \end{center} \end{figure} \subsection{World} The world arena is a 2D grid where all elements are located and interact. In Figure \ref{example} we illustrate a snapshot of a simple environment created with \texttt{APES}. To define the properties of the environment and the elements therein the user can specify each of the following features: \begin{itemize} \item \textbf{World size:} dimensions of the 2D grid defining the arena. Current version supports only square-shaped environments. \item \textbf{End of episode:} the world has the attribute \texttt{Terminated} to identify when an episode ends. The user can specify an episode to end in any of these cases (or whichever occurs first): \begin{itemize} \item the maximum number of time steps has been reached (specified by \textbf{Maximum steps}). \item all rewards have been consumed. \end{itemize} After the flag \texttt{Terminated} has being raised the environment will be regenerated. \begin{figure}[t] \centering \includegraphics[scale=0.4,trim={13mm 8mm 0mm 0mm},clip]{Images/example.png} \caption{Example of a simple grid world environment populated by two agents, an elongated vertical wall and a food item.} \label{example} \end{figure} \item \textbf{Items:} elements to be located at the cells of the 2D grid. There are different types of pre-defined items: \begin{itemize} \item \textbf{Food:} item reachable by agents. Agents can occupy the same cell as the food item and collect it, making it disappear from the environment. Although typically associated with a positive reward, it can be associated with any type or reward or punishment according to the Rewarding scheme defined by the user \item \textbf{Obstacles:} items responsible for stopping agents from moving freely in the World. An obstacle element can be chosen from the following list. \begin{itemize} \item \textbf{Wall:} obstacles that cannot be traversed and impede visibility through them. \item \textbf{Water:} obstacles that cannot be traversed but they allow visibility through them. \end{itemize} Each obstacle can be associated with a \textbf{Shape} matrix determining the geometric shape of the obstacle. For example, adding a "T"-shaped obstacle can be done by passing 3$\times$3 array with first row and middle column as ones and the rest as zeros. \item \textbf{Agent:} interactive elements in the environment which are controlled by external algorithms. They interact with the items in the World by executing actions and receiving observation states and rewards. Each agent can be associated a \textbf{Power} level to define the interaction with other agents. For example, in case of collision, agents of lower level can be set to receive some punishment. Each agent also has an attribute \textbf{Transparency} to make the agent act as a vision barrier or as a transparent element for other agents' vision. \newcommand\x{0.21} \begin{figure*} \includegraphics[scale=\x]{Images/agent_1.png} \includegraphics[scale=\x]{Images/agent_2.png} \includegraphics[scale=\x]{Images/block.png} \includegraphics[scale=\x]{Images/food.png} \includegraphics[scale=\x]{Images/probabilities.png}\\ \caption{Example of probability distribution matrices for different elements in the environment. Each episode is regenerated by sampling each element's location from their associated probability distribution.} \label{fig.prob} \end{figure*} \end{itemize} \item \textbf{Probability Distribution Matrix (PDM):} matrix of same size as the world grid used to distribute elements across it. The matrix contains the probability of an element to be located at each position at the start of each episode. Figure \ref{fig.prob} illustrates a graphical representation of PDMs used to distribute several elements randomly within some defined locations. PDM values will be automatically normalized and multiple elements can have the same PDM. If no PDM is given, elements are placed randomly across the entire grid by default. When two elements spawn in the same position the placing priority is: 1) agent, 2) food, and 3) obstacle. For obstacles with more than one block, only the center is guaranteed to appear. Extensions from the center of the obstacle will be overruled by other elements if such conflict occurred. \item \textbf{Block size:} size of the images of each element. This feature is used only for visualization of the environment as pictures or video. \end{itemize} \subsection{Agents' Interface} The agents' interface defines the information communicated between the environment and each agent. It consists of the observation state and reward received by the agent at every time step, as well as the execution of the action chosen. Next we describe the content of each of these streams per agent and how they are computed. \medskip \textbf{Observation:} determines what the agent obtains as observation depending on the environment state and vision algorithm. At each time step the observation fed back to the agent contains: \begin{itemize} \item \textbf{Observability:} a binary 2D array of same size as the world with each cell marked as $1$ if the corresponding cell location is observable by the agent. \item \textbf {Food:} a binary 2D array of the same size as the world with each cell marked as $1$ if a food item is observed at the corresponding cell location. \item \textbf{Agent position:} a binary 2D array of same size as the world size with a $1$ in the cell currently occupied by the focal agent. \item \textbf{Agent orientation:} one hot vector of size 4 (North, South, East, West) with a $1$ indicating the current orientation of the focal agent. \item \textbf {Other agent's position:} a binary 2D array per agent (other than the focal agent) of same size as the world and with a $1$ in the cell currently occupied the agent. If the agent is not currently observed by the focal agent the array will be all zeros. \item \textbf{Other agent's orientations:} one hot vector of size 4 (North, South, East, West) per agent (other than the focal agent) with a $1$ indicating the current orientation of the agent. If the agent is not currently observed by the focal agent the array will be all zeros. \end{itemize} \medskip \textbf{Agent Vision:} it determines how and which parts of the environment state are transformed to produce an observation state for the agent. APES simulates two modes of agent's vision. \begin{figure*}[ht!] \centering \includegraphics[scale=0.45,trim={10mm 6mm 280mm 4mm},clip]{Images/centric.png} \hspace{10px} \includegraphics[scale=0.45,trim={150mm 6mm 140mm 4mm},clip]{Images/centric.png} \caption{The left panel shows the field of vision of an agent (red) with allocentric vision with 180{$^\circ$} vision angle and unlimited vision range. The right panel illustrates the totality of the world environment.} \label{centric} \end{figure*} \begin{figure*} \centering \includegraphics[scale=0.45,trim={150mm 6mm 140mm 4mm},clip]{Images/egocentric.png} \hspace{10px} \includegraphics[scale=0.45,trim={288mm 6mm 0mm 4mm},clip]{Images/egocentric.png} \caption{The left panel shows the field of vision of an agent (green) with egocentric vision with 180{$^\circ$} vision angle and unlimited vision range. The right panel illustrates the totality of the world environment.} \label{egocentric} \end{figure*} \begin{itemize} \item \textbf{Allocentric:}\label{agnt:cent} the agent receives a bird's eye view of the environment. As the agent executes actions and moves across the environment the agent's position in the visual field will change depending on its location as shown in Figure \ref{centric} where the black area represents the unobserved area. \item \textbf{Egocentric:}\label{agnt:alter} provides a more natural type of vision in which the field of view is centered at agent's location. Hence the agent will always be in the center of the view and the surrounding will change depending on its location and direction. Figure \ref{egocentric} illustrates the environment state from this point of view. \end{itemize} For both modes APES uses a shadow-casting algorithm to determine the agent's field of vision based on the elements populating the 2D grid \cite{fov}. Each of the two modes of vision can be tuned by parameters such as: \begin{itemize} \item \textbf{Vision Angle:}\label{agnt:va} the angle spanning the agent's field of view. The value should be between 0 to 360. Left panel in Figure\ref{visionangle_limit} shows the effect of the vision angle on an agent's field of view. \item \textbf{Vision Limit:}\label{agnt:vl} extent of the agent's field of view. It is the maximum distance the agent can observe. If set to value -1 the agent obtains an infinite vision limit. Right panel in Figure\ref{visionangle_limit} shows the effect of the vision range on an agent's field of view. \end{itemize} \begin{figure*} \centering \includegraphics[scale=0.45,trim={10mm 6mm 280mm 4mm},clip]{Images/visionangle.png} \hspace{10px} \includegraphics[scale=0.45,trim={150mm 6mm 140mm 4mm},clip]{Images/visionlimit.png} \caption{Left panel shows an agent (red) with 90{$^\circ$} vision angle with unlimited range. Right panel shows an agent (green) with a vision range of one unit and vision angle of 180{$^\circ$}.} \label{visionangle_limit} \end{figure*} \medskip \textbf{Reward:} provides feedback to agent's actions by specifying the rewards and punishments obtained in case of different events occurring in the environment. The default option is a rewarding scheme given the vector [-10, 10, -0.1] indicating a value of -10 for the event of colliding with another agent, +10 for finding food item, and -0.1 for every time step. Any rewarding scheme can be specified for any set of events defined by the user by passing a new reward function to \texttt{World class} instance. \medskip \textbf{Actions:} defines how the agent interacts and influences the environment, including other agents. The actions are selected according to the agent's controller which is usually an algorithm external to APES (although see the section on Autopilots for some automated agents provided by \texttt{APES}). The space of actions supported by \texttt{APES} and their ordering is given as follows: \begin{itemize} \item \textbf{Set of actions:} there are two sets of primitive actions for each agent, 4 actions for looking in different directions (North, South, East, West) and another 4 actions for moving. Lastly, there is a no-operation action to complete a set of 9 primitive actions. These primitives can be concatenated to create different single complex actions, for example "Look left, Move Left" as one action which can be executed in one time step. \item \textbf{Actions Order:} actions of different agents are executed in temporal order according to an ordered array of the agents' identifiers. \end{itemize} \begin{figure} \centering \includegraphics[scale = 0.3]{Images/aa.png} \caption{The elementary actions available for the agent are: moving (north, south, east, west), look (north, south, east, west), and no operation.}\label{AgentAction} \end{figure} \subsection{Autopilots} The design of the agents' controllers is a task separated from the \texttt{APES} environment. Any agent controller can interface with \texttt{APES} environment by reading the next observation state and reward and outputting an action within the space of actions described above. How the controllers make use of the environment state and reward to select the next action is upon the user's preferred reinforcement learning algorithm. However, to ease the interaction with some simple behaving agents \texttt{APES} includes the following autopilots: \begin{itemize} \item \textbf{Random Walker:} this autopilot randomly assigns actions to the agent regardless of its position or vision. For example, it can select the action "Move Left" although there is a wall on the left. \item \textbf{Algorithmic Agent:} this autopilot has two properties: it has incremental vision (retains within its field of view all elements once seen) and navigates with a smart pathfinding algorithm. In particular, this agent randomly explores the unobserved area but once a food item is spotted the agent takes the shortest path to it according to the A* pathfinding algorithm \cite{hart1968formal}. \end{itemize} \subsection{Performance} The performance in executing updates of the environment is a crucial issue since if not properly optimized this time can become a bottleneck in the training and testing of reinforcement learning algorithms. The speed depends on the number of the agents and the size of the world. For two agents and a world of size 11$\times$11 it can perform around 450 steps per second in a Intel Core i5-5200U CPU. \section {Example} Here we illustrate how \texttt{APES} can be set up to define and simulate a simple reinforcement learning task. Figure \ref{code} shows the code used to define and update the environment illustrated in Fig.\ref{example}. In this case at the beginning of each episode several elements (obstacles, agents, food) will be located randomly within some range of cells of the 2D-grid given by the probability distribution matrices. Given the rewarding scheme used in the example code the two agents (red and green) will compete for the food reward and will be punished every time step with a small penalty. Executing "world.Step()" after assigning each agent an action will update the environment for one time step. The regeneration of the environment (new episode) after the termination of the current episode is achieved by executing "Generate World". \begin{comment} \begin{lstlisting}[language=Python] # Add pictures for items Settings.AddImage('Wall','APES/Pics/wall.jpg') Settings.AddImage('Food','APES/Pics/food.jpg') # Create Probabilities distribution matrices (PDMs) obs_pdm = np.zeros(Settings.WorldSize) agnts_pdm = np.zeros(Settings.WorldSize) food_pdm = np.zeros(Settings.WorldSize) # Obstacles can appear from 3rd to 7th row and 5th column obs_pdm[3:8,5] = 1 agnts_pdm[2,[0,10]] = 1 food_pdm[:,4:7] = 1 # Add PDMs to Settings Settings.AddProbabilityDistribution('Obs_pdm',obs_pdm) Settings.AddProbabilityDistribution('agnts_pdm',agnts_pdm) Settings.AddProbabilityDistribution('food_pdm',food_pdm) # Create World Elements #Create vertical obastacle with length 4 obshape = np.ones((4,1)) obs = Obstacles('Wall',Shape=obshape,PdstName='Obs_pdm') # Create two agents ragnt = Agent(Fname='APES/Pics/red.jpg',PdstName='agnts_pdm') bagnt = Agent(Fname='APES/Pics/blue.jpg',PdstName='agnts_pdm') food = Foods('Food',PdstName='food_pdm') # Reward food by 10, time step by -0.1 game = World(RewardsScheme=[0,10,-0.1]) # Adding Agents in Order of Following the action game.AddAgents([ragnt,bagnt]) game.AddObstacles([obs]) game.AddFoods([food]) # Execute at the beginning of every episode game.GenerateWorld() game.Step() # Execute every time step while not game.Terminated[0]: bagnt.DetectAndAstar() ragnt.DetectAndAstar() game.Step() \end{lstlisting} \end{comment} \begin{figure}[b] \centering \includegraphics[scale=0.5,trim={0mm 0mm 0mm 0mm},clip]{Images/code_1.png} \caption{The code to generate the environment illustrated in Figure \ref{example} and to set up a competition task between agent red and green.} \label{code} \end{figure} \section{Conclusions} In this article we presented the most important features in \textit{APES} to design and simulate reinforcement learning tasks in 2D grid-worlds. In particular, \textit{APES} handles the properties of the 2D arena and the elements therein. \textit{APES} also provides the feedback for the agents and executing their actions in the environment. Importantly, \textit{APES} supports different vision algorithms and multiple agents, which can make it attractive for studying multiagent reinforcement learning problems with partial observability. It is our hope that \textit{APES} can ease the creation and simulation of simple environments so that users can focus on the design and testing of better reinforcement learning algorithms. \begin{acks} A.L. was funded by the European Regional Development Fund and IT Academy. All authors thank the financial support from the Estonian Research Council through the personal research grant PUT1476. This work was also supported by the Estonian Centre of Excellence in IT (EXCITE), funded by the European Regional Development Fund. The authors are also indebted to Daniel Majoral and Axel Harpe for taking time in working with the environment and reporting bugs. \end{acks} \bibliographystyle{ACM-Reference-Format}
\section{Introduction} \label{sec:Intro} Principal component analysis (PCA) is one of the oldest and most widely known approaches for dimension reduction. It has been used in many applications, including exploratory data analysis, regression, time series analysis, image processing, and functional data analysis. The most common solution of the PCA is to find a linear projection that transforms the set of original correlated variables onto a projected space of new uncorrelated variables by maximizing the variation of the projected space \citep{jolliffe2011principal}. This solution, despite its wide use in practice, lacks a probabilistic description of the data. A probabilistic formulation of the PCA was first introduced by \cite{tipping1999probabilistic}, where the authors considered a Gaussian latent factor model, and then obtained the PCA (principal axes) as the solution of a maximum marginal likelihood problem, where the latent factors were marginalized out. This approach, known as the probabilistic principal component analysis (PPCA), assumes that the latent factors are independently distributed following a standard normal distribution. However, the independence assumption of the factors is usually too restrictive for many applications, where the variables of interest are correlated between different inputs, e.g. times series, images, and spatially correlated data. The latent factor model was extended to incorporate the dependent structure in previous studies. For example, the linear model of coregionalization (LMC) was studied in modeling multivariate outputs of spatially correlated data \citep{gelfand2004nonstationary,gelfand2010handbook}, where each factor is modeled by a Gaussian process (GP) to account for the spatial correlation in the data. When the factor loading matrix is shared, the LMC becomes a semiparameteric latent factor model, introduced in machine learning literature \citep{seeger2005semiparametric,alvarez2011kernels}, and was widely applied in emulating computationally expensive computer models with multivariate outputs \citep{higdon2008computer,fricker2013multivariate}, where each factor is modeled by a GP over a set of inputs, such as the physical parameters of the partial differential equations. However, the PCA solution is no longer the maximum marginal likelihood estimator of the factor loading matrix when the factors at two inputs are correlated. In this work, we propose a new approach called generalized probabilistic principal component analysis (GPPCA), as an extension of the PPCA for the correlated output data. We assume each column of the factor loading matrix is orthonormal for the identifiability purpose. Based on this assumption, we obtain a closed-form solution for the maximum marginal likelihood estimation of the factor loading matrix when the covariance function of the factor processes is shared. This result is an extension of the PPCA for the correlated factors, and the connection between these two approaches is studied. When the covariance functions of the factor processes are different, the maximum marginal likelihood estimation of the factor loading matrix is equivalent to an optimization problem with orthogonal constraints, sometimes referred as the Stiefel manifold. A fast numerical search algorithm on the Stiefel manifold is introduced by \cite{wen2013feasible} for the optimization problem. There are several approaches for estimating the factor loading matrix for the latent factor model and semiparameteric latent factor model in the Frequentist and Bayesian literature. One of the most popular approaches for estimating the factor loading matrix is PCA (see e.g., \cite{bai2002determining,bai2003inferential,higdon2008computer}). Under the orthonormality assumption for the factor loading vectors, the PCA can be obtained from the maximum likelihood estimator of the factor loading matrix. However, the correlation structure of each factor is not incorporated for the estimation. In \cite{lam2011estimation} and \cite{lam2012factor}, the authors considered estimating the factor loading matrix based on the sample covariance of the output data at the first several time lags when modeling high-dimensional time series. We will numerically compare our approach to the aforementioned Frequentist approaches. Bayesian approaches have also been widely studied for factor loading matrix estimation. \cite{west2003bayes7} points out the connection between PCA and a class of generalized singular g-priors, and introduces a spike-and-slab prior that induces the sparse factors in the latent factor model assuming the factors are independently distributed. When modeling spatially correlated data, priors are also discussed for the spatially varying factor loading matrices \citep{gelfand2004nonstationary} in LMC. The closed-form marginal likelihood obtained in this work is more computationally feasible than the previous results, as the inverse of the covariance matrix is shown to have an explicit form. Our proposed method is also connected to the popular kernel approach, which has been used for nonlinear component analysis \citep{scholkopf1998nonlinear} by mapping the output data to a high-dimensional feature space through a kernel function. This method, known as the kernel PCA, is widely applied in various problems, such as the image analysis \citep{mika1999kernel} and novelty detection \citep{hoffmann2007kernel}. However, the main focus of our method is to apply the kernel function for capturing the correlation of the outputs at different inputs (e.g. the time point, the location of image pixels or the physical parameters in the PDEs). We highlight a few contributions of this paper. First of all, we derive the closed-form maximum marginal likelihood estimator (MMLE) of the factor loading matrix, when the factors are modeled by GPs. Note our expression of the marginal likelihood (after integrating out the factor processes) is more computationally feasible than the previous result, because the inverse of the covariance matrix is shown to have an explicit form, which makes the computational complexity linear to the number of output variables. Based on this closed-form marginal likelihood, we are able to obtain the MMLE of the other parameters, such as the variance of the noise and kernel parameters, and the predictive distribution of the outcomes. Our second contribution is that we provide a fully probabilistic analysis of the mean and other regression parameters, when some covariates are included in the mean structure of the factor model. The empirical mean of data was often subtracted before applying PPCA and LMC \citep{tipping1999probabilistic,higdon2008computer}, which does not quantify the uncertainty when the output is linearly dependent on some covariates. Here we manage to marginalize out the regression parameters in the mean structure explicitly without increasing the computational complexity. Our real data application examples demonstrate the improvements in out-of-sample prediction when the mean structure is incorporated in the data analysis. Lastly, the proposed estimator of the factor loading matrix in GPPCA are closely connected to the PCA and PPCA, and we will discuss how the correlation in the factors affects the estimators of the factor loading matrix and predictive distributions. Both the simulated and real examples show the improved accuracy in estimation and prediction, when the output data are correlated. The rest of the paper is organized as follows. The main results of the closed-form marginal likelihood and the maximum marginal likelihood estimator of the factor loading matrix are introduced in Section \ref{subsec:GPPCA}. In Section \ref{subsec:par_est}, we provide the maximum marginal likelihood estimator for the noise parameter and kernel parameters, after marginalizing out the factor processes. Section \ref{subsec:mean_structure} discusses the estimators of the factor loading matrix and other parameters when some covariates are included in the model. The comparison between our approach and other approaches in estimating the factor loading matrix is studied in Section \ref{sec:comparison}, with a focus on the connection between GPPCA and PPCA. Simulation results are provided in Section \ref{sec:numerical_results}, for both the correctly specified and mis-specified models with unknown noise and covariance parameters. Two real data examples are shown in Section \ref{sec:real_eg} and we conclude this work with discussion on several potential extensions in Section \ref{sec:conclusion}. \section{Main results} \label{sec:main_results} We state our main results in this section. In section \ref{subsec:GPPCA}, we derive a computationally feasible expression of the marginal distribution for the latent factor model after marginalizing out the factor processes, based on which we show the maximum marginal likelihood estimator of the factor loading matrix. In Section \ref{subsec:par_est}, we discuss the parameter estimation and predictive distribution. We extend our method to study the factor model by allowing the intercept and additional covariates in the mean structure in Section \ref{subsec:mean_structure}. \subsection{Generalized probabilistic principal component analysis} \label{subsec:GPPCA} To begin with, let $\mathbf y(\mathbf x)= (y_1(\mathbf x),...,y_k(\mathbf x))^T$ be a $k$-dimensional real-valued output vector at a $p$-dimensional input vector $\mathbf x$. Let $\mathbf Y=[\mathbf y(\mathbf x_1),..., \mathbf y(\mathbf x_n)]$ be a $k\times n$ matrix of the observations at inputs $\{\mathbf x_1,...,\mathbf x_n\}$. In this subsection and the next subsection, we assume that each row of the $\mathbf Y$ is centered at zero. Consider the following latent factor model \begin{equation} \mathbf y(\mathbf x)= \mathbf A \mathbf z(\mathbf x) + \bm \epsilon, \label{equ:model_1} \end{equation} where $\bm \epsilon \sim N(0, \sigma^2_0 \mathbf I_k)$ is a vector of independent Gaussian noises, with $\mathbf I_k$ being the $k\times k$ identity matrix. The $k\times d$ factor loading matrix $\mathbf A=[\mathbf a_1,...,\mathbf a_d]$ relates the $k$-dimensional output to $d$-dimensional factor processes $\mathbf z(\mathbf x)=(z_1(\mathbf x),...,z_d(\mathbf x))^T$, where $d \leq k$. In many applications, each output is correlated. For example, model (\ref{equ:model_1}) is widely used in analyzing multiple time series, where $y_l(x)$'s are correlated across different time points for every $l=1,...,k$. Model (\ref{equ:model_1}) was also used for multivariate spatially correlated outputs, often referred as the linear model of coregionalization (LMC) \citep{gelfand2010handbook}. In these studies, each factor is modeled by a zero-mean Gaussian process (GP), meaning that for any set of inputs $\{\mathbf x_1,...,\mathbf x_n \}$, $\mathbf Z_l=(z_l(\mathbf x_1),...,z_l(\mathbf x_n))$ follows a multivariate normal distribution \begin{equation} \mathbf Z^T_l \sim \MN(\mathbf 0, \bm \Sigma_l), \end{equation} where the $(i,\, j)$ entry of $\bm \Sigma_l$ is parameterized by a covariance function $\sigma^2_l K_l(\mathbf x_i, \mathbf x_j)$ for $l=1,...,d$ and $1\leq i,j\leq n$. We defer the discussion of the kernel in the Section~\ref{subsec:par_est}. Note that the model (\ref{equ:model_1}) is unchanged if one replaces the pair $(\mathbf A, \mathbf z(\mathbf x))$ by $(\mathbf A \mathbf E, \mathbf E^{-1} \mathbf z(\mathbf x))$ for any invertible matrix $\mathbf E$. As pointed out in \cite{lam2011estimation}, only the $d$-dimensional linear subspace of $\mathbf A$, denoted as $\mathcal M(\mathbf A)$, can be uniquely identified, since $\mathcal M(\mathbf A)=\mathcal M(\mathbf A \mathbf E)$ for any invertible matrix $\mathbf E$. Due to this reason, we assume the columns of $\mathbf A$ in model (\ref{equ:model_1}) are orthonormal for identifiablity purpose \citep{lam2011estimation,lam2012factor}. \begin{assumption} \begin{equation} \mathbf A^T \mathbf A=\mathbf I_d. \label{equ:A} \end{equation} \label{assumption:A} \end{assumption} Note the Assumption \ref{assumption:A} can be relaxed by assuming $ \mathbf A^T \mathbf A=c\mathbf I_d$ where $c$ is a positive constant which can potentially depend on $k$, e.g. $c=k$. As each factor process has the variance $\sigma^2_l$, typically estimated from the data, we thus derive the results based on Assumption \ref{assumption:A} herein. Denote the vectorization of the output $\mathbf Y_v=\mathrm{vec}(\mathbf Y)$ and the $d\times n $ latent factor matrix $\mathbf Z=(\mathbf z(\mathbf x_1),...,\mathbf z(\mathbf x_n))$ at inputs $\{\mathbf x_1,...,\mathbf x_n\}$. We first give the marginal distribution of $\mathbf Y_v$ (after marginalizing out $\mathbf Z$) with an explicit inverse of the covariance matrix in Lemma \ref{lemma:Y_v_inv_cov}. \begin{lemma} Under Assumption \ref{assumption:A}, the marginal distribution of $\mathbf Y_v$ in model (\ref{equ:model_1}) is the multivariate normal distribution as follows, \begin{align} \mathbf Y_v \mid \mathbf A, \sigma^2_0, \bm \Sigma_{1},..., \bm \Sigma_{d} & \sim \MN\left(\mathbf 0, \, \sum^d_{l=1} \bm \Sigma_l \otimes (\mathbf a_l \mathbf a^T_l)+ \sigma^2_0 \mathbf I_{nk} \right) \label{equ:Y_v_cov} \\ & \sim \MN\left(\mathbf 0, \, \sigma^2_0 \left(\mathbf I_{nk}- \sum^d_{l=1} (\sigma^2_0 \bm \Sigma_l^{-1}+\mathbf I_n )^{-1} \otimes (\mathbf a_l \mathbf a^T_l) \right)^{-1} \right). \label{equ:Y_v_inv_cov} \end{align} \label{lemma:Y_v_inv_cov} \end{lemma} The form in (\ref{equ:Y_v_cov}) appeared in the previous literature (e.g. \cite{gelfand2004nonstationary}) and its derivation is given in Appendix B. However, directly computing the marginal likelihood by expression (\ref{equ:Y_v_cov}) may be expensive, as the covariance matrix is $nk\times nk$. Our expression (\ref{equ:Y_v_inv_cov}) of the marginal likelihood is computationally more feasible than the expression (\ref{equ:Y_v_cov}), as the inverse of the covariance matrix of $\mathbf Y_v$ is derived explicitly in (\ref{equ:Y_v_inv_cov}). Based on the marginal likelihood in (\ref{equ:Y_v_inv_cov}), we derive the maximum marginal estimation of $\mathbf A$ where the covariance matrix for each latent factor is assumed to be the same as in Theorem \ref{thm:est_A_shared_cov} below. \begin{theorem} For model (\ref{equ:model_1}), assume $\bm \Sigma_1=...=\bm \Sigma_d=\bm \Sigma$. Under Assumption \ref{assumption:A}, after marginalizing out $\mathbf Z$, the likelihood function is maximized when \begin{equation} \hat {\mathbf A}=\mathbf U \mathbf R, \label{equ:A_est_shared_cov} \end{equation} where $\mathbf U$ is a $k \times d$ matrix of the first $d$ principal eigenvectors of $ \mathbf G={\mathbf Y (\sigma^2_0 \bm \Sigma^{-1}+ \mathbf I_n )^{-1} \mathbf Y^T}$, and $\mathbf R$ is an arbitrary $d \times d$ orthogonal rotation matrix. \label{thm:est_A_shared_cov} \end{theorem} By Theorem~\ref{thm:est_A_shared_cov}, the solution $\mathbf {\hat A}$ is not unique because of the arbitrary rotation matrix. However, the linear subspace of the column space of the estimated factor loading matrix, denoted by $\mathcal M(\mathbf {\hat A})$, is uniquely determined by (\ref{equ:A_est_shared_cov}). In general, the covariance function of each factor can be different. We are able to express the maximum marginal likelihood estimator as the solution to an optimization problem with the orthogonal constraints, stated in Theorem \ref{thm:est_A_diff_cov}. \begin{theorem} Under Assumption \ref{assumption:A}, after marginalizing out $\mathbf Z$, the maximum marginal likelihood estimator of $\mathbf A$ in model (\ref{equ:model_1}) is \begin{equation} \mathbf {\hat A}= \argmax_{\mathbf A} \sum^d_{l=1} {\mathbf a^T_l \mathbf G_l \mathbf a_l}, \quad \text{s.t.} \quad \mathbf A^T \mathbf A=\mathbf I_d, \label{equ:A_est_diff_cov} \end{equation} where $\mathbf G_l= { \mathbf Y (\sigma^2_0 \bm \Sigma^{-1}_l+\mathbf I_n )^{-1}\mathbf Y^T}$. \label{thm:est_A_diff_cov} \end{theorem} The subset of matrices $\mathbf A$ that satisfies the orthogonal constraint $\mathbf A^T \mathbf A=\mathbf I_d$ is often referred as the \textit{Stiefel manifold}. Unlike the case where the covariance of each factor processes is shared, no closed-form solution of the optimization problem in (\ref{thm:est_A_diff_cov}) has been found. A numerical optimization algorithm that preserves the orthogonal constraints in (\ref{equ:A_est_diff_cov}) is introduced in \cite{wen2013feasible}. The main idea of their algorithm is to find the gradient of the objective function in the tangent space at the current step, and iterates by a curve along the projected negative descent on the manifold. The curvilinear search is applied to find the appropriate step size that guarantees the convergence to a stationary point. We implement this approach to numerically optimize the marginal likelihood to obtain the estimated factor loading matrix in Theorem \ref{thm:est_A_diff_cov}. We call the method of estimating $\mathbf A$ in Theorem \ref{thm:est_A_shared_cov} and Theorem \ref{thm:est_A_diff_cov} the generalized probabilistic principal component analysis (GPPCA) of correlated data, which is a direct extension of the PPCA in \cite{tipping1999probabilistic}. Although both approaches obtain the maximum marginal likelihood estimator of the factor loading matrix, after integrating out the latent factors, the key difference is that in GPPCA, the latent factors at different inputs are allowed to be correlated, whereas the latent factors in PPCA are assumed to be independent. A detailed numerical comparison between our method and other approaches including the PPCA will be given in Section~\ref{sec:comparison}. Another nice feature of the proposed GPPCA method is that the estimation of the factor loading matrix can be applied to any covariance structure of the factor processes. In this paper, we use kernels to parameterize the covariance matrix as an illustrative example. There are many other ways to specify the covariance matrix or the inverse of the covariance matrix, such as the Markov random field and the dynamic linear model, and these approaches are readily applicable in our latent factor model (\ref{equ:model_1}). For a function with a $p$-dimensional input, we use a product kernel to model the covariance for demonstration purposes \citep{sacks1989design}, meaning that for the $l$th factor, \begin{equation} \sigma^2_l K_l(\mathbf x_a, \mathbf x_b)=\sigma^2_l \prod^p_{m=1} K_{lm}( x_{am}, x_{bm}), \label{equ:K_l} \end{equation} for any input $\mathbf x_a=(x_{a1},...,x_{ap})$ and $\mathbf x_a=(x_{b1},...,x_{bp})$, where $K_{lm}(\cdot, \cdot)$ is a one-dimensional kernel function of the $l$th factor that models the correlation of the $m$th coordinate of any two inputs. Some widely used one-dimensional kernel functions include the power exponential kernel and the Mat{\'e}rn kernel. For any two inputs $\mathbf x_a, \mathbf x_b\in \mathcal X$, the Mat{\'e}rn kernel is \begin{equation} K_{lm}(x_{am}, x_{bm})=\frac{1}{2^{\nu_{lm}-1}\Gamma(\nu_{lm})}\left(\frac{|x_{am}- x_{bm}|}{\gamma_{lm}} \right)^{\nu_{lm}} \mathcal K_{\nu_{lm}} \left(\frac{|x_{am}- x_{bm}|}{\gamma_{lm}} \right), \label{equ:matern} \end{equation} where $\Gamma(\cdot)$ is the gamma function and $\mathcal{K}_{\nu_{lm}}(\cdot)$ is the modified Bessel function of the second kind with a positive roughness parameter $\nu_{lm}$ and a nonnegative range parameter $\gamma_{lm}$ for $l=1,...,d$ and $m=1,...,p$. The Mat{\'e}rn kernel contains a wide range of different kernel functions. In particular, when $\nu_{lm}=1/2$, the Mat{\'e}rn kernel becomes the exponential kernel, $K_l(x_{am}, x_{bm})=\exp(-|x_{am}- x_{bm}|/\gamma_{lm})$, and the corresponding factor process is the Ornstein-Uhlenbeck process, which is a continuous autoregressive process with order 1. When $\nu_{lm} \to \infty$, the Mat{\'e}rn kernel becomes the Gaussian kernel, i.e., $K_l(x_{am}, x_{bm})=\exp(-|x_{am}- x_{bm}|^2/\gamma^2_{lm})$, where the factor process is infinitely differentiable. The Mat{\'e}rn kernel has a closed-form expression when $(2\nu_{lm}+1)/2 \in \mathbb N$. For example, the Mat{\'e}rn kernel with $\nu_{lm}=5/2$ has the following form \begin{equation} K_{lm}(x_{am}, x_{bm})=\left(1+\frac{\sqrt{5}|x_{am}-x_{bm}|}{\gamma_{lm}}+\frac{5|x_{am}-x_{bm}|^2}{3\gamma_{lm}^2}\right)\exp\left(-\frac{\sqrt{5}|x_{am}-x_{bm}|}{\gamma_{lm}}\right) \,, \label{equ:matern_5_2} \end{equation} for any inputs $\mathbf x_a$ and $\mathbf x_b$ with $l=1,...,d$ and $m=1,...,p$. In this work, we use the Mat{\'e}rn kernel in (\ref{equ:matern_5_2}) for the simulation and real data analysis for demonstration purposes. Specifying a sensible kernel function depends on real applications and our results in this work apply to all commonly used kernel functions. We will also numerically compare different approaches when the kernel function is misspecified in Appendix C. \subsection{Parameter estimation and predictive distribution} \label{subsec:par_est} The probabilistic estimation of the factor loading matrix depends on the variance of the noise and the covariances of the factor processes. We discuss the estimation of these parameters by assuming that the covariances of the factors are parameterized by a product of the kernel functions for demonstration purposes. We also obtain the predictive distribution of the data in this subsection. The probabilistic estimation of the factor loading matrix in the GPPCA can be also applied when the covariances of the factors are specified or estimated in other ways. We denote $\tau_l:=\frac{\sigma^2_l}{\sigma^2_0}$ as the signal's variance to noise ratio (SNR) for the $l$th factor process, as a transformation of $\sigma^2_{l}$ in (\ref{equ:K_l}). The maximum likelihood estimator of $\sigma^2_0$ has a closed form expression using this parameterization. Furthermore, let the correlation matrix of the $k$th factor process be $\mathbf K_l$ with the $(i, j)$th term being $K_l(\mathbf x_i, \mathbf x_j)$. After this transformation, the estimator of $\mathbf A$ in Theorems \ref{thm:est_A_shared_cov} and \ref{thm:est_A_diff_cov} becomes a function of the parameters $\bm \tau=(\tau_1,...,\tau_d)$ and $\bm \gamma=(\bm \gamma_1,...,\bm \gamma_d)$. Under Assumption \ref{assumption:A}, after marginalizing out $\mathbf Z$, the maximum likelihood estimator of $\sigma^2_0$ becomes a function of $\mathbf A$, $\bm \tau$ and $\bm \gamma$ as \begin{align} \hat \sigma^2_0&= \frac{\hat S^2}{nk}, \label{equ:hat_sigma_2_0} \end{align} where $\hat S^2 =\mathrm{tr}( \mathbf {Y}^T \mathbf {Y} )-\sum^d_{l=1} \mathbf {a}^T_l \mathbf {Y} (\tau^{-1}_l \mathbf {K}^{-1}_l +\mathbf I_n )^{-1} \mathbf {Y} ^T \mathbf {a}_l$. Ignoring the constants, the likelihood of $\bm \tau$ and $\bm \gamma$ by plugging $\mathbf {\hat A}$ and $\hat \sigma^2_0$ satisfies \begin{equation} L(\bm \tau, \bm \gamma \mid \mathbf Y, \mathbf {\hat A}, \hat \sigma^2_0 )\propto \left\{ \prod^d_{l=1} | \tau_l \mathbf {K}_l +\mathbf I_n |^{-1/2} \right\}|\hat S^2|^{-nk/2}. \label{equ:profile_lik} \end{equation} A derivation of Equation (\ref{equ:profile_lik}) is given in the Appendix. Since there is no closed-form expression for the parameter estimates in the kernels, one often numerically maximizes the Equation (\ref{equ:profile_lik}) to estimate these parameters \begin{equation} ( \bm {\hat \tau}, \bm {\hat \gamma}):=\argmax_{(\bm \tau, \bm \gamma)} L(\bm \tau, \bm \gamma \mid \mathbf Y, \mathbf {\hat A}, \hat \sigma^2_0 ). \label{equ:tau_gamma_est} \end{equation} After obtaining $\hat \sigma^2_0$ and $\bm {\hat \tau}$ from (\ref{equ:hat_sigma_2_0}) and (\ref{equ:tau_gamma_est}), respectively, we transform the expressions back to get the estimator of $\sigma^2_l$ as \[\hat \sigma^2_l= \hat \tau_l\hat \sigma^2_0,\] for $l=1,...,d$. Since both the estimator of $\hat \sigma^2_0$ and $\mathbf {\hat A}$ in Theorem \ref{thm:est_A_shared_cov} and \ref{thm:est_A_diff_cov} can be expressed as a function of $(\bm \tau, \bm \gamma)$, in each iteration, one can use the Newton's method \citep{nocedal1980updating} to find $(\bm \tau, \bm \gamma)$ based on the likelihood in (\ref{equ:profile_lik}), after plugging the estimator of $\hat \sigma^2_0$ and $\mathbf {\hat A}$. We have a few remarks regarding the expressions in (\ref{equ:hat_sigma_2_0}) and (\ref{equ:tau_gamma_est}). First, under Assumption \ref{assumption:A}, the likelihood of $(\bm \tau, \bm \gamma)$ in (\ref{equ:profile_lik}) can also be obtained by marginalizing out $\sigma^2_0$ using the objective prior $\pi(\sigma^2_0)\propto 1/\sigma^2_0$, instead of maximizing over $\sigma^2_0$. Second, consider the first term at the right hand side of (\ref{equ:hat_sigma_2_0}). As each row of $\mathbf Y$ has a zero mean, let $\mathbf S_0:={\mathbf Y\mathbf Y^T}/{n}={\sum^n_{i=1}\mathbf y(\mathbf x_i) \mathbf y(\mathbf x_i)^T}/{n},$ be the sample covariance matrix for $\mathbf y(\mathbf x_i)$. One has $\mathrm{tr}(\mathbf Y \mathbf Y^T)=n\sum^k_{i=1}\lambda_{0i}$, where $\lambda_{0i}$ is the $i$th eigenvalue of $\mathbf S_0$. The second term at the right hand side of (\ref{equ:hat_sigma_2_0}) is the variance explained by the projection. In particular, when the conditions in Theorem~\ref{thm:est_A_shared_cov} hold, i.e. $\bm \Sigma_1=...=\bm \Sigma_d$, one has $\sum^d_{l=1} \mathbf {\hat a}^T_l \mathbf {Y} (\tau^{-1}_l \mathbf {K}^{-1}_l +\mathbf I_n )^{-1} \mathbf {Y} ^T \mathbf {\hat a}_l =n\sum^d_{l=1}\hat \lambda_l$, where $\hat \lambda_l$ is the $l$th largest eigenvalues of $\mathbf Y(\sigma^2_0\bm \Sigma^{-1}+\mathbf I_n )^{-1} \mathbf Y^T/n$. The estimation of the noise is then the average variance being lost in the projection. Note that the projection in the GPPCA takes into account the correlation of the factor processes, whereas the projection in the PPCA assumes the independent factors. This difference makes the GPPCA more accurate in estimating the subspace of the factor loading matrix when the factors are correlated, as shown in various numerical examples in Section \ref{sec:numerical_results}. Thirdly, although the model in (\ref{equ:model_1}) is regarded as a nonseparable model \citep{fricker2013multivariate}, the computational complexity of our algorithm is the same with that for the separable model \citep{Gu2016PPGaSP,conti2010bayesian}. Instead of inverting an $nk \times nk$ covariance matrix, the expression of the likelihood in (\ref{equ:profile_lik}) allows us to proceed in the same way when the covariance matrix for each factor has a size of $n\times n$. The number of computational operations of the likelihood is at most $\max(O(dn^3), O(kn^2))$, which is much smaller than the $O(n^3k^3)$ for inverting an $nk \times nk$ covariance matrix, because one often has $d \ll k$. When the input is one-dimensional and the Mat{\'e}rn kernel in (\ref{equ:matern}) is used, the computational operations are only $O(dkn)$ for computing the likelihood in (\ref{equ:profile_lik}) without any approximation (see e.g. \cite{hartikainen2010kalman}). We implement this algorithm in the ${\tt FastGaSP}$ package available on CRAN. Note that the estimator in (\ref{equ:profile_lik}) is known as the Type II maximum likelihood estimator, which is widely used in estimating the kernel parameters. When the number of the observations is small, the estimator in (\ref{equ:profile_lik}) is not robust, in the sense that the estimated range parameters can be very small or very large, which makes the covariance matrix either a diagonal matrix or a singular matrix. This might be unsatisfactory in certain applications, such as emulating computationally expensive computer models \citep{oakley1999bayesian}. An alternative way is to use the maximum marginal posterior estimation that prevents the two unsatisfying scenarios of the estimated covariance matrix. We refer to \cite{Gu2018robustness} and \cite{gu2018jointly} for the theoretical properties of the maximum marginal posterior estimation and an ${\sf R}$ package is available on CRAN (\cite{gu2018robustgasp}). Given the parameter estimates, we can also obtain the predictive distribution for the outputs. Let $\hat K_l(\cdot, \cdot)$ be the $l$th kernel function after plugging the estimates $\bm{\hat \gamma}_l$ and let $\bm {\hat \Sigma}_l$ be the estimator of the covariance matrix for the $l$th factor, where the $(i,j)$ element of $\bm {\hat \Sigma}_l$ is $ \hat \sigma^2_l \hat K_l(\mathbf x_i, \mathbf x_j)$, with $1\leq i,j\leq n$ and $l=1,...,d$. We have the following predictive distribution for the output at any given input. \begin{theorem} Under the Assumption \ref{assumption:A}, for any $\mathbf x^*$, one has \[\mathbf Y(\mathbf x^*) \mid \mathbf Y, \mathbf {\hat A}, \bm {\hat \gamma}, \bm {\hat \sigma}^2, { \hat \sigma}^2_0 \sim \MN \left(\bm {\hat \mu}^*(\mathbf x^*), \bm {\hat \Sigma}^*(\mathbf x^*) \right),\] where \begin{equation} \bm {\hat \mu}^*(\mathbf x^*)=\mathbf {\hat A} \mathbf {\hat z}(\mathbf x^*), \label{equ:hat_mu} \end{equation} with $\mathbf {\hat z}(\mathbf x^*)=( {\hat z}_1(\mathbf x^*),...,{\hat z}_d(\mathbf x^*) )^T $, with ${\hat z}_l(\mathbf x^*)=\bm {\hat \Sigma}^T_l(\mathbf x^*) ({\bm {\hat \Sigma}_l+\hat \sigma^2_0 \mathbf I_n })^{-1}\mathbf Y^T \mathbf {\hat a}_l$, $\bm {\hat \Sigma}_l(\mathbf x^*)=\hat \sigma^2_l(\hat K_l(\mathbf x_1, \mathbf x^*),...,\hat K_l(\mathbf x_n, \mathbf x^*))^T$ for $l=1,...,d$, and \begin{equation} \bm {\hat \Sigma}^*(\mathbf x^*)= \mathbf {\hat A} \mathbf {\hat D}(\mathbf x^*) \mathbf {\hat A}^T+ \hat \sigma^2_0(\mathbf I_k - \mathbf {\hat A} \mathbf {\hat A}^T), \label{equ:hat_Sigma} \end{equation} with $\mathbf {\hat D}(\mathbf x^*) $ being a diagonal matrix, and its $l$th diagonal term, denoted as ${\hat D}_l(\mathbf x^*) $, has the following expression \[{\hat D}_l(\mathbf x^*)= \hat\sigma^2_l \hat K_l(\mathbf x^*,\, \mathbf x^*) + \hat \sigma^2_0 - \bm {\hat \Sigma}^T_l(\mathbf x^*) \left({\bm {\hat \Sigma}_l+\hat \sigma^2_0 \mathbf I_n }\right)^{-1} \bm {\hat \Sigma}_l(\mathbf x^*), \] for $l=1,...,d$. \label{thm:prediction} \end{theorem} Next we give the posterior distribution of $\mathbf A \mathbf Z$ in Corollary \ref{cor:posterior_AZ}. \begin{corollary}[Posterior distribution of $\mathbf A \mathbf Z$] Under the Assumption (\ref{assumption:A}), the posterior distribution of $ \mathbf A \mathbf Z$ is \[ (\mathbf A \mathbf Z \mid \mathbf Y, \mathbf {\hat A}, \bm {\hat \gamma}, \bm {\hat \sigma}^2, { \hat \sigma}^2_0) \sim \MN\left( \mathbf {\hat A} \mathbf {\hat Z}, \hat \sigma^2_0\sum^d_{l=1} \mathbf {\hat D}_l \otimes \mathbf {\hat a}_l \mathbf {\hat a}^T_l\right),\] where $ \mathbf {\hat Z}=(\mathbf {\hat Z}^T_1,...,\mathbf {\hat Z}^T_d)^T $, $\mathbf {\hat Z}^T_l= \bm {\hat \Sigma}_l ( \bm {\hat \Sigma}_l+ \hat \sigma^2_0 \mathbf I_n)^{-1} \mathbf Y^T\mathbf {\hat a}_l$, and $\mathbf {\hat D}_l=\left(\sigma^2_0 \bm {\hat \Sigma}^{-1}_l+{\mathbf I_n}\right)^{-1} $, for $l=1,...,d$. \label{cor:posterior_AZ} \end{corollary} The Corollary \ref{cor:posterior_AZ} is a direct consequence of Theorem \ref{thm:prediction}, so the proof is omitted. Note that the uncertainty of the parameters and the factor loading matrix are not taken into consideration for predictive distribution of $\mathbf Y(\mathbf x^*)$ in Theorem \ref{thm:prediction} and the posterior distribution of $\mathbf A \mathbf Z$ in Corollary \ref{cor:posterior_AZ}, because of the use of the plug-in estimator for $(\mathbf A,\sigma^2_0, \bm \sigma^2, \bm \gamma)$. The resulting posterior credible interval may be narrower than it should be when the sample size is small to moderate. The uncertainty in $\mathbf A$ and other model parameters could be obtained by Bayesian analysis with a prior placed on these parameters for these scenarios. \subsection{Mean structure} \label{subsec:mean_structure} In many applications, the outputs are not centered at zero. For instance, \cite{Bayarri09} and \cite{Gu2016PPGaSP} studied emulating the height of the pyroclastic flow generated from TITAN2D computer model, where the flow volume in the chamber is positively correlated to height of the flow at each spatial coordinate. Thus, modeling the flow volume as a covariate in the mean function typically improves the accuracy of the emulator. When $\mathbf Y$ is not centered around zero, one often subtracts the mean of each row of $\mathbf Y$ before the inference \citep{higdon2008computer,paulo2012calibration}. The full Bayesian analysis of the regression parameters are discussed in coregionalization models of multivariate spatially correlated data (see e.g. \cite{gelfand2004nonstationary}) using the Markov Chain Monte Carlo (MCMC) algorithm, but the computation may be too complex to implement in many studies. Consider the latent factor model with a mean structure for a $k$-dimensional output vector at the input $\mathbf x$, \begin{equation} \mathbf y(\mathbf x)= (\mathbf h(\mathbf x) \mathbf B)^T+ \mathbf A \mathbf z(\mathbf x) + \bm \epsilon, \label{equ:model_with_mean} \end{equation} where $\mathbf h(\mathbf x):=( h_1(\mathbf x),..., h_q(\mathbf x) )$ is $1\times q$ known mean basis function related to input $\mathbf x$ and possibly other covariates, $\mathbf B=(\bm \beta_1,...,\bm \beta_k)$ is a $q \times k$ matrix of the regression parameters. The regression parameters could be different for each row of the outcomes, and $\bm \epsilon \sim N(0, \sigma^2_0 \mathbf I_k)$ is a vector of the independent Gaussian noises, with $\mathbf I_k$ being the $k\times k$ identity matrix. For any set of inputs $\{\mathbf x_1,...,\mathbf x_n \}$, we assume $\mathbf Z_l=(z_l(\mathbf x_1),...,z_l(\mathbf x_n))$ follows a multivariate normal distribution \begin{equation} \mathbf Z^T_l \sim \MN(\mathbf 0, \bm \Sigma_l), \end{equation} d where the $(i,\, j)$ entry of $\bm \Sigma_l$ is parameterized by $K_l(\mathbf x_i, \mathbf x_j)$ for $l=1,...,d$ and $1\leq i,j\leq n$. Denote $\mathbf H$ the $n\times q$ matrix with $(i,j)$th term being $h_j(\mathbf x_i)$ for $1\leq i\leq n$ and $q<n$. We let $n>q$ and assume $\mathbf H$ is a full rank matrix. Further denote $\mathbf M= \mathbf I- \mathbf H (\mathbf H^T\mathbf H)^{-1}\mathbf H^T$. We apply a Bayesian approach for the regression parameters by assuming the objective prior $\pi(\mathbf B)\propto 1$ \cite{berger2001objective,berger2009formal}. We first marginalize out $\mathbf B$ and then marginalize out $\mathbf Z$ to obtain the marginal likelihood for estimating the other parameters . \begin{lemma} Let the prior of the regression parameters be $\pi(\mathbf B)\propto 1$. Under Assumption \ref{assumption:A}, after marginalizing out $\mathbf B$ and $\mathbf Z$, the maximum likelihood estimator for $\sigma^2_0$ is \begin{equation} \hat \sigma^2_0=\frac{S^2_M}{k(n-q)}, \label{equ:sigma_2_0_with_mean} \end{equation} where $S^2_M= \mathrm{tr}(\mathbf Y {\mathbf M} \mathbf Y^T)-\sum^d_{l=1} \mathbf a^T_l \mathbf Y {\mathbf M} ({\mathbf M}+ \tau^{-1}_l \mathbf K^{-1}_l )^{-1} {\mathbf M} \mathbf Y^T \mathbf a_l$. Moreover, the marginal density of the data satisfies \begin{align} p( \mathbf Y \mid \mathbf A, \bm { \tau}, \bm { \gamma}, { \hat \sigma}^2_0 ) &\propto \left\{\prod^d\limits_{l=1} \left|\tau_l \mathbf K_l +\mathbf I_n \right|^{-1/2} \left| \mathbf H^T (\tau_l \mathbf K_l+\mathbf I_n)^{-1} \mathbf H \right|^{-\frac{1}{2}}\right\} \left| S^2_M \right|^{- \left(\frac{k(n-q)}{2}\right) }. \label{equ:marginal_with_mean} \end{align} \label{lemma:Y_mean_structure} \end{lemma} \begin{remark} Under Assumption \ref{assumption:A}, the likelihood for $(\bm \tau, \bm \gamma)$ in (\ref{equ:marginal_with_mean}) are equivalent to the maximum marginal likelihood estimator by marginalizing out both $\mathbf B$ and $\sigma^2_0$ using the objective prior $\pi(\mathbf B, \sigma^2_0)\propto 1/\sigma^2_0$, instead of maximizing over $\sigma^2_0$. \end{remark} Since there is no closed-form expression for the parameters $(\bm \tau, \bm \gamma)$ in the kernels, one can numerically maximize the Equation (\ref{equ:marginal_with_mean}) to estimate $\mathbf A$ and other parameters. \begin{align} \mathbf {\hat A}&= \argmax_{\mathbf A} \sum^d_{l=1} \mathbf a^T_l \mathbf G_{l,M} \mathbf a_l, \quad \text{s.t.} \quad \mathbf A^T \mathbf A=\mathbf I_d, \label{equ:est_A_with_mean} \\ ( \bm {\hat \tau}, \bm {\hat \gamma})&=\argmax_{(\bm \tau, \bm \gamma)} p( \mathbf Y \mid \mathbf {\hat A}, \bm { \tau}, \bm { \gamma} ). \label{equ:est_tau_gamma_with_mean} \end{align} When $ {\bm \Sigma}_1=...= {\bm \Sigma}_d$, the closed-form expression of $\mathbf {\hat A}$ can be obtained similarly in Theorem \ref{thm:est_A_shared_cov}. In general, we can use the approach in \cite{wen2013feasible} for solving the optimization problem in (\ref{equ:est_A_with_mean}). After obtaining $\bm {\hat \tau}$ and $\hat \sigma^2_0$, we transform them to get $\hat {\sigma}^2_l=\hat \tau_l \hat \sigma^2_0$ for $l=1,...,d$. Let $\bm {\hat \Sigma}_l$ be a matrix with the $(i,j)$-term as $\hat \sigma^2_l \hat K_l(\mathbf x_i, \mathbf x_j)$, where $\hat K_l(\mathbf x_i, \mathbf x_j)$ is the kernel function after plugging the estimator $ {\hat \gamma}_l$ for $1\leq l\leq d$. We first marginalize out $\mathbf B$ and then marginalize out $\mathbf Z$. The rest of the parameters are estimated by the maximum marginal likelihood estimator by (\ref{equ:sigma_2_0_with_mean}), (\ref{equ:est_A_with_mean}) and (\ref{equ:est_tau_gamma_with_mean}) in the predictive distribution given below. \begin{theorem} Under the Assumption \ref{assumption:A} and assume the objective prior $\pi(\mathbf B)\propto 1$. After marginalizing out $\mathbf B$, $\mathbf Z$, and plugging in the maximum marginal likelihood estimator of $(\mathbf {A}, \bm {\gamma},\bm \sigma^2, \sigma^2_0)$, the predictive distribution of model (\ref{equ:model_with_mean}) for any $\mathbf x^*$ is \[\mathbf Y(\mathbf x^*) \mid \mathbf Y, \mathbf {\hat A}, \bm {\hat \gamma}, \bm \hat {\bm \sigma}^2, { \hat \sigma}^2_0 \sim \MN \left(\bm {\hat \mu}_M^*(\mathbf x^*), \bm {\hat \Sigma}_M^*(\mathbf x^*) \right).\] Here \begin{align} \bm {\hat \mu}_M^*(\mathbf x^*)&= ( \mathbf h(\mathbf x^*){ \hat {\mathbf B} })^T + \mathbf {\hat A} \mathbf {\hat z}_M(\mathbf x^*), \label{equ:hat_mu} \\ \bm {\hat \Sigma}^*_M(\mathbf x^*)&= \mathbf {\hat A} \mathbf {\hat D}_M(\mathbf x^*) \mathbf {\hat A}^T +\hat \sigma^2_0(1+ \mathbf h(\mathbf x^*)(\mathbf H^T\mathbf H)^{-1}\mathbf h^T(\mathbf x^*)) (\mathbf I_k-\mathbf {\hat A} \mathbf {\hat A}^T), \label{equ:hat_Sigma} \end{align} where $\mathbf{\hat B}=(\mathbf H^T \mathbf H)^{-1}\mathbf{H}^T (\mathbf Y -\mathbf {\hat A} \mathbf {\hat Z}_M)^T $, $\mathbf {\hat Z}_M= (\mathbf {\hat Z}^T_{1,M},...,\mathbf {\hat Z}^T_{d,M})^T$ with $\mathbf {\hat Z}_{l,M}=\mathbf a^T_l \mathbf Y \mathbf M ( \hat{\bm \Sigma}_l \mathbf M+ \hat \sigma^2_0 \mathbf I_n )^{-1} \hat {\bm \Sigma}_l $, $\mathbf {\hat z}_M(\mathbf x^*)=( {\hat z}_{1,M}(\mathbf x^*),...,{\hat z}_{d,M}(\mathbf x^*) )^T$ with $ {\hat z}_{l,M}(\mathbf x^*)=\hat{\bm \Sigma}^T_l(\mathbf x^*) ( \hat{\bm \Sigma}_l\mathbf M+ \hat \sigma^2_0 \mathbf I_n )^{-1} \mathbf M \mathbf Y \mathbf a_l$, for $l=1,...,d$, and $\mathbf {\hat D}_M(\mathbf x^*) $ is a diagonal matrix with the $l$th term: \begin{align*} {\hat D}_{l,M}(\mathbf x^*)&=\hat \sigma^2_l \hat K_l(\mathbf x^*,\, \mathbf x^*) +\hat \sigma^2_0- \bm {\hat \Sigma}^T_l(\mathbf x^*) \tilde {\bm \Sigma}_l^{-1} \bm {\hat \Sigma}_l(\mathbf x^*) \\ &\quad \quad +(\mathbf h^T(\mathbf x^*)- \mathbf H^T \tilde {\bm \Sigma}^{-1}_l \mathbf {\hat \Sigma}_l(\mathbf x^*) )^T (\mathbf H^{T} \tilde {\bm \Sigma}^{-1}_l \mathbf H )^{-1} (\mathbf h^T(\mathbf x^*)- \mathbf H^T \tilde {\bm \Sigma}^{-1}_l \mathbf {\hat \Sigma}_l(\mathbf x^*) ), \end{align*} with $\tilde {\bm \Sigma}_l={\bm {\hat \Sigma}_l+\hat \sigma^2_0 \mathbf I_n }$ for $l=1,...,d$. \label{thm:prediction_with_mean} \end{theorem} In Theorem \ref{thm:prediction_with_mean}, the estimated mean parameters are $\mathbf {\hat B}=\E[\mathbf B \mid \mathbf Y, \mathbf {\hat A}, \bm {\hat \gamma}, \bm \hat {\bm \sigma}^2, { \hat \sigma}^2_0]$, which could be used for inferring the trend of some given covariates (e.g. the gridded temperature example in Section \ref{subsec:gridded_temperature}). Denote $\mathbf Y(\mathbf x^*)=(\mathbf Y^T_1(\mathbf x^*), \, \mathbf Y^T_2(\mathbf x^*))^T$ where $\mathbf Y_1(\mathbf x^*)$ and $\mathbf Y_2(\mathbf x^*)$ are two vectors of dimensions $k_1$ and $k_2$ ($k_1+k_2=k$), respectively. Assuming the same conditions in Theorem \ref{thm:prediction_with_mean} hold, if one observes both $\mathbf Y_1(\mathbf x^*)$ and $\mathbf Y$, the predictive distribution of $\mathbf Y_2(\mathbf x^*)$ follows \begin{equation} \mathbf Y_2(\mathbf x^*) \mid \mathbf Y_1(\mathbf x^*), \mathbf Y, \mathbf {\hat A}, \bm {\hat \gamma}, \bm {\hat \sigma}^2, { \hat \sigma}^2_0 \sim \MN \left(\bm {\hat \mu}_{M,2|1}^*(\mathbf x^*), \bm {\hat \Sigma}_{M,2|1}^*(\mathbf x^*) \right). \label{equ:cond_pred_with_mean} \end{equation} where $\bm {\hat \mu}_{M,2|1}^*(\mathbf x^*)= \bm {\hat \mu}_{M,2}^*(\mathbf x^*)+\bm {\hat \Sigma}_{M,12}^*(\mathbf x^*)^T\bm {\hat \Sigma}_{M,11}^*(\mathbf x^*)^{-1}(\mathbf Y_1(\mathbf x^*)- \bm {\hat \mu}_{M,1}^*(\mathbf x^*)) $ with ${\hat \mu}_{M,1}^*(\mathbf x^*)$ and ${\hat \mu}_{M,2}^*(\mathbf x^*)$ being the first $k_1$ and last $k_2$ entries of ${\hat \mu}_{M}^*(\mathbf x^*)$; $\bm {\hat \Sigma}_{M,2|1}^*(\mathbf x^*)= \bm {\hat \Sigma}_{M,22}^*(\mathbf x^*)-\bm {\hat \Sigma}_{M,12}^*(\mathbf x^*)^T\bm {\hat \Sigma}_{M,11}^*(\mathbf x^*)^{-1}\bm {\hat \Sigma}_{M,12}^*$ with $\bm {\hat \Sigma}_{M,11}$, $\bm {\hat \Sigma}_{M,22}$ and $\bm {\hat \Sigma}_{M,12}$ being the first $k_1 \times k_1$, last $k_2\times k_2$ entries in the diagonals and $k_1\times k_2$ entries in the off-diagonals of $\bm {\hat \Sigma}_{M}^*$, respectively. \section{Comparison to other approaches} \label{sec:comparison} In this section, we compare our method to various other frequently used approaches and discuss their connections and differences using examples. First of all, note that the maximum likelihood estimator (MLE) of the factor loading matrix $\mathbf A$ under the Assumption \ref{assumption:A} is $\mathbf U_0 \mathbf R$ (without marginalizing out $\mathbf Z$), where $\mathbf U_0$ is the first $d$ ordered eigenvectors of $\mathbf Y \mathbf Y^T$ and $\mathbf R$ is an arbitrary orthogonal rotation matrix. This corresponds to the solution of principal component analysis, which is widely used in the literature for the inference of the latent factor model. For example, \citet{bai2002determining} and \citet{bai2003inferential} assume that $\mathbf A^T \mathbf A = k \mathbf I_d$ and estimate $\mathbf A$ by $\sqrt{k} \mathbf U_0$ in modeling high-dimensional time series. The estimation of factor loading matrix by the PCA is also applied in emulating multivariate outputs from a computer model \citep{higdon2008computer}, where the factor loading matrix is estimated by the singular value decomposition of the standardized output matrix. The principal axes of the PCA are the same with those obtained from the PPCA, in which the factor loading matrix is estimated by the maximum marginal likelihood, after marginalizing out the independent and normally distributed factors \citep{tipping1999probabilistic}. The estimator of the factor loadings is found to be the first $d$ columns of $\mathbf {\tilde U}_0 (\mathbf {\tilde D}_0-\sigma^2_0 \mathbf I_d) \mathbf R$, where $\mathbf {\tilde D}_0$ is a diagonal matrix whose $l$th diagonal term is the $l$th largest eigenvalues of $\mathbf Y \mathbf Y^T/n$ and $\mathbf R$ is an arbitrary $d\times d$ orthogonal rotation matrix. The PPCA gives a probabilistic model of the PCA by modeling $\mathbf Z$ via independent normal distributions. However, when outputs are correlated across different inputs, modeling the factor processes as independent normal distributions may not sensible in some applications. In comparison, the factors are allowed to be correlated in GPPCA; and we marginalize the factors out to estimate $\mathbf A$ to account for the uncertainty. This is why our approach can be viewed as a generalized approach of the PPCA for the correlated data. The second observation is that the estimation of the factor loading matrix in the PCA or PPCA typically assumes the data are standardized. However, the standardization process could cause a loss of information and the uncertainty in the standardization is typically not considered. This problem is also resolved by GPPCA, where the intercept and other covariates can be included in the model and the mean parameters can be marginalized out in estimating the factor loading matrix, as discussed in Section \ref{subsec:mean_structure}. Next we illustrate the difference between the GPPCA and PCA using Example \ref{eg:demonstration}. \begin{example} The data is sampled from the model (\ref{equ:model_1}) with the shared covariance matrix $\bm \Sigma_1=\bm \Sigma_2=\bm \Sigma$, where $x$ is equally spaced from $1$ to $n$ and the kernel function is assumed to follow (\ref{equ:matern_5_2}) with $\gamma=100$ and $\sigma^2=1$. We choose $k=2$, $d=1$ and $n=100$. Two scenarios are implemented with $\sigma^2_0=0.01$ and $\sigma^2_0=1$, respectively. The parameters $(\sigma^2_0, \sigma^2, \gamma)$ are assumed to be unknown and estimated from the data. \label{eg:demonstration} \end{example} \begin{figure}[t] \centering \begin{tabular}{c} \includegraphics[width=1\textwidth,height=.3\textwidth]{demonstration_sigma_0_0_1.pdf}\vspace{-.15in}\\ \includegraphics[width=1\textwidth,height=.3\textwidth]{demonstration_sigma_0_1.pdf} \end{tabular} \caption{Estimation of the factor loading matrix by the PCA and GPPCA for Example \ref{eg:demonstration} with the variance noise being $\sigma^2_0=0.01$ and $\sigma^2_0=1$, graphed in the upper panels and lower panels, respectively. The circles and dots are the first and second rows of $\mathbf Y$ in the left panel, and of the transformed output $\mathbf {\tilde Y}=\mathbf Y \mathbf L$ in the middle panels, where $\mathbf L=\mathbf U \mathbf D^{1/2}$ with $\mathbf U$ being the eigenvectors and the diagonals of $\mathbf D$ being the eigenvalues of the eigendecomposition of $(\hat \sigma^2_0\bm{ \hat \Sigma}^{-1}+\mathbf I_n )^{-1}$, where the $(i,j)$-term of $\bm{ \hat \Sigma}$ is $\hat \sigma^2 \hat K(\mathbf x_i, \mathbf x_j)$ by plugging the estimated range parameter $\hat \gamma$. The circles and dots in the middle panels almost overlap when $x$ is slightly larger than 0. In the right panels, the black solid lines, red dotted lines and blue dash lines are the subspace of $\mathbf A$, the first eigenvector of $\mathbf U_0$ and the first eigenvector of $\mathbf G$ in Theorem~\ref{thm:est_A_shared_cov}, respectively, with the black triangles being the outputs. The black, blue and red lines almost overlap in the upper right panel. } \label{fig:demonstration} \end{figure} Note the linear subspace spanned from the column space of estimated loading matrix by the PCA or PPCA is the same, which is $\mathcal M(\mathbf U_0)$. Thus we only compare the GPPCA to the PCA in Figure \ref{fig:demonstration} where $\mathbf A$ is a two-dimensional vector generated from a uniform distribution on the Stiefel manifold \citep{hoff2013bayesian}. The signal to noise ratio (SNR) is $\tau=10^2$ and $\tau=1$ for the upper and lower panels in Figure \ref{fig:demonstration}, respectively. From Figure \ref{fig:demonstration}, we observe that when the SNR is large, two rows of the outputs are strongly correlated, as shown in the upper left panel, with the empirical correlation being around $-0.83$ between two rows of the output $\mathbf Y$. The estimated subspaces by the PCA and GPPCA both match the true $\mathbf A$ equally well in this scenario, shown in the upper right panel. When the variance of the noise gets large, the outputs are no longer very correlated. For example, the empirical correlation between two simulated output variables is only around $-0.18$. As a result, the angle between the estimated subspace and the column space of $\mathbf A$ by the PCA is large, as shown in the right lower panel. The GPPCA by Theorem \ref{thm:est_A_shared_cov} essentially transforms the output by $\mathbf {\tilde Y}=\mathbf Y \mathbf L$, graphed in the middle panels, where $\mathbf L=\mathbf U \mathbf D^{1/2}$ with $\mathbf U$ and $\mathbf D$ being a matrix of eigenvectors and a diagonal matrix of the eigenvalues from the eigendecomposition of $(\hat \sigma^2_0\bm {\hat \Sigma}^{-1}+\mathbf I_n )^{-1}$, respectively, where variance parameter and kernel parameter are estimated by the MMLE discussed in Section \ref{subsec:par_est}. The two rows of the transformed outputs are strongly correlated, shown in the middle panels. The empirical correlation between two rows of the transformed outputs graphed in the lower panel is about $-0.99$, even though the variance of the noise is as large as the variance of the signal. The subspace by the GPPCA is equivalent to the first eigenvector of the transformed output for this example, and it is graphed as the blue dashed curves in the right panels. The estimated subspace by the GPPCA is close to the truth in both scenarios, even when the variance of the noise is large in the second scenario. \begin{figure}[t] \centering \begin{tabular}{c} \includegraphics[width=1\textwidth,height=.35\textwidth]{demonstration_est_AZ_sigma_0_0_1.pdf}\vspace{-.5in} \\ \includegraphics[width=1\textwidth,height=.35\textwidth]{demonstration_est_AZ_sigma_0_1.pdf} \end{tabular} \vspace{-.3in} \caption{Estimation of the mean of the output $\mathbf Y$ for Example \ref{eg:demonstration} with the variance of the noise being $\sigma^2_0=0.01$ and $\sigma^2_0=1$, graphed in the upper panels and lower panels, respectively. The first row and second row of $\mathbf Y$ are graphed as the black curves in the left panels and right panels, respectively. The red dotted curves and the blue dashed curves are the prediction by the PCA and GPPCA, respectively. The grey region is the $95\%$ posterior credible interval from GPPCA. The black curves, blue curves and grey regions almost overlap in the upper panels. } \label{fig:demonstration_AZ} \end{figure} For PCA, the mean of the outputs is typically estimated by the maximum likelihood estimator $\mathbf {\hat A}_{pca} \mathbf {\hat A}^T_{pca}\mathbf Y$, where $\mathbf {\hat A}_{pca}=\mathbf U_0$ \citep{bai2002determining}. In Figure \ref{fig:demonstration_AZ}, the PCA estimation of the mean for Example \ref{eg:demonstration} is graphed as the red curves and the posterior mean of the output in the GPPCA in Corollary \ref{cor:posterior_AZ} is graphed as the blue curves. The PCA underestimates the variance of the noise and hence has a large estimation error. In comparison, the estimated mean of the output by the GPPCA is more accurate, as the correlation in each output variable is properly modeled through the GPs of the latent factors. Note that we restrict $\mathbf A$ to satisfy $\mathbf A^T \mathbf A=\mathbf I_d$ when simulating data examples in Figure \ref{fig:demonstration}. In practice, we find this constraint only affects the estimation of the variance parameter $\sigma^2_l$ in the kernel, $l=1,...,d$, because the meaning of this parameter changes. There are some other estimators of the factor loading matrix in modeling high-dimensional time series. For example, \cite{lam2011estimation,lam2012factor} estimate the factor loading matrix of model (\ref{equ:model_1}) by $\hat {\mathbf A}_{LY}:=\sum^{q_0}_{q=1}\bm {\hat \Sigma}_y(q) \bm {\hat \Sigma}^T_y(q)$, where $\bm {\hat \Sigma}_y(q)$ is the $k\times k$ sample covariance at lag $q$ of the output and $q_0$ is fixed to be a small positive integer. This approach is sensible, because $\mathcal M(\mathbf A)$ is shown to be spanned from $\sum^{q_0}_{q=1}\bm { \Sigma}_y(q) \bm { \Sigma}^T_y(q)$ under some reasonable assumptions, where $\bm {\Sigma}_y(q)$ is the underlying lag-$q$ covariance of the outputs. It is also suggested in \cite{lam2012factor} to estimate the latent factor by $\mathbf {\hat Z}_{LY}=\hat {\mathbf A}^T_{LY}\mathbf Y$, meaning that the mean of the output is estimated by $ \hat {\mathbf A}_{LY} \mathbf {\hat Z}_{LY}=\hat {\mathbf A}_{LY} \hat {\mathbf A}^T_{LY}\mathbf Y$. This estimator and the PCA are both included for comparison in Section \ref{sec:numerical_results}.. \section{Simulated examples} \label{sec:numerical_results} In this section, we numerically compare different approaches studied before. We use several criteria to examine the estimation. The first criterion is the largest principal angle between the estimated subspace $\mathcal M(\mathbf{\hat A})$ and the true subspace $\mathcal M({\mathbf A})$. Let $0\leq \phi_1\leq...\leq \phi_d\leq \pi/2$ be the principal angles between $\mathcal M({\mathbf A})$ and $\mathcal M({\mathbf {\hat A}})$, recursively defined by \begin{equation*} \phi_i=\mbox{arccos} \left( \max_{\mathbf a \in \mathcal M(\mathbf A), \mathbf {\hat a} \in \mathcal M(\mathbf {\hat A}) } |\mathbf a^T \mathbf {\hat a}| \right)=\mbox{arccos}(|\mathbf a^T_i \mathbf {\hat a}_i| ), \end{equation*} subject to \[ ||\mathbf a||=||\mathbf {\hat a}||=1, \, \mathbf a^T \mathbf a_i=0,\,\mathbf {\hat a}^T \mathbf {\hat a}_i=0,\, i=1,...,d-1, \] where $||\cdot||$ denotes the $L_2$ norm. The largest principal angle is $\phi_d$, which quantifies how close two linear subspaces are. When two subspaces are identical, all principal angles are zero. When the columns of the $\mathbf A$ and $\mathbf {\hat A}$ form orthogonal bases of the $\mathcal M(\mathbf A)$ and $\mathcal M(\mathbf {\hat A})$, the cosine of the largest principal angle is equal to the smallest singular value of $\mathbf A^T \mathbf {\hat A}$ \citep{bjorck1973numerical,absil2006largest}. Thus the largest principal angle can be calculated efficiently through the singular value decomposition of $\mathbf {A}^T \mathbf {\hat A}$. We numerically compare four approaches for estimating $\mathbf A$. The first approach is the PCA, which estimates $\mathbf A$ by $\mathbf U_0$, where $\mathbf U_0$ is the first $d$ eigenvectors of $\mathbf Y \mathbf Y^T/n$. Note the other version of the PCA and the PPCA have the same largest principal angle between the estimated subspace of $\mathbf A$ and the true subspace of $\mathbf A$, so the results are omitted. The GPPCA is the second approach. When the covariance of the factor processes is the same, the closed-form expression of the estimator of the factor loading matrix is given in Theorem \ref{thm:est_A_shared_cov}. When the covariance of the factor processes is different, we implement the optimization algorithm in \cite{wen2013feasible} that preserves the orthogonal constraints to obtain the maximum marginal likelihood estimation of the factor loading matrix in Theorem \ref{thm:est_A_diff_cov}. In both cases, the estimator $\mathbf {\hat A}$ can be written as a function of $(\bm \gamma,\bm \tau, \sigma^2_0)$ which are estimated by maximizing the marginal likelihood after integrating out $\mathbf Z$ and plugging $\mathbf {\hat A}$. The third approach, denoted as LY1, estimates $\mathbf A$ by $\bm {\hat \Sigma}_y(1) \bm {\hat \Sigma}^T_y(1)$, where $\bm {\hat \Sigma}_y(1)$ is the sample covariance of the output at lag $1$ and the fourth approach, denoted as LY5, estimates $\mathbf A$ by $\sum^{q_0}_{q=1}\bm {\hat \Sigma}_y(q) \bm {\hat \Sigma}^T_y(q)$ with $q_0=5$, used in \cite{lam2012factor} and \cite{lam2011estimation}, respectively. We also compare the performance of different approaches by the average mean squared errors (AvgMSE) in predicting the mean of the output over $N$ experiments as follows \begin{equation} \mbox{AvgMSE}= \sum^N_{l=1} \sum^k_{j=1} \sum^n_{i=1} \frac{( \hat Y^{(l)}_{j,i}- \E[Y^{(l)}_{j,i}])^2 }{knN}, \label{eg:avgmse} \end{equation} where $\E[Y^{(l)}_{j,i}]$ is the $(j,i)$ element of the mean of the output matrix at the $l$th experiment, and $\hat Y^{(l)}_{j,i}$ is the estimation. As discussed in Section \ref{sec:numerical_results}, the estimated mean of the output matrix by the PCA, LY1 and LY5 is $\mathbf {\hat A} \mathbf {\hat A}^T\mathbf Y$, where $\mathbf {\hat A}$ is the estimated factor loading matrix in each approach (\cite{bai2002determining,lam2011estimation,lam2012factor}). In GPPCA, we use the posterior mean of $\mathbf A \mathbf Z$ in Corollary \ref{cor:posterior_AZ} to estimate mean of the output matrix. The cases of the shared covariance and the different covariances of the factor processes are studied in Example \ref{eg:shared_cov} and Example \ref{eg:diff_cov}, respectively. we assume that $\mathbf A$ is sampled from the uniform distribution on the Stiefel manifold \citep{hoff2013bayesian}, and the kernels are correctly specified with unknown parameters in these examples. In Appendix C, we compare different approaches when the factor loading matrix, kernel functions or the factors are misspecified. \begin{figure}[t] \centering \begin{tabular}{cccc} \includegraphics[width=.25\textwidth,height=.35\textwidth]{simulation_shared_cov_1_sigma_0_0_1.pdf} \includegraphics[width=.25\textwidth,height=.35\textwidth]{simulation_shared_cov_2_sigma_0_0_1.pdf} \includegraphics[width=.25\textwidth,height=.35\textwidth]{simulation_shared_cov_3_sigma_0_0_1.pdf} \includegraphics[width=.25\textwidth,height=.35\textwidth]{simulation_shared_cov_4_sigma_0_0_1.pdf}\vspace{-.1in}\\ \includegraphics[width=.25\textwidth,height=.35\textwidth]{simulation_shared_cov_1_sigma_0_0_5.pdf} \includegraphics[width=.25\textwidth,height=.35\textwidth]{simulation_shared_cov_2_sigma_0_0_5.pdf} \includegraphics[width=.25\textwidth,height=.35\textwidth]{simulation_shared_cov_3_sigma_0_0_5.pdf} \includegraphics[width=.25\textwidth,height=.35\textwidth]{simulation_shared_cov_4_sigma_0_0_5.pdf} \end{tabular} \vspace{-.1in} \caption{The largest principal angle between the true subspace of the factor loading matrix and the estimation from the four approaches for Example \ref{eg:shared_cov} (ranging from $[0,\pi/2]$, the smaller the better). In the first row, the number of the observations of each output variable is assumed to be $n=200$ and $n=400$ for the left four boxplots and right four boxplots in each panel, respectively. In the second row, the number of observations is assumed to be $n=500$ and $n=1000$ for the left four boxplots and right four boxplots in each panel, respectively. } \label{fig:simulation_shared_cov_angles} \end{figure} \begin{example}[Factors with the same covariance matrix] The data are sampled from model (\ref{equ:model_1}) with $\bm \Sigma_1=...=\bm \Sigma_d=\bm \Sigma$, where $x_i=i$ for $1\leq i\leq n$, and the kernel function in (\ref{equ:matern_5_2}) is used with $\gamma=100$ and $\sigma^2=1$. In each scenario, we simulate the data from $16$ different combinations of $\sigma^2_0$, $k$, $d$ and $n$. We repeat $N=100$ times for each scenario. The parameters $(\sigma^2_0, \sigma^2, \gamma)$ are treated as unknown and estimated from the data. \label{eg:shared_cov} \end{example} In Figure \ref{fig:simulation_shared_cov_angles}, we present the largest principal angle between the true subspace $\mathcal M(\mathbf A)$ and estimated subspace $\mathcal M(\mathbf {\hat A})$ at different settings of Example 1. The red, blue, yellow and green boxplots are the results from the PCA, GPPCA, LY1 and LY5. In each panel, the sample size gets doubled from the left four boxplots to the right four. The SNR $\tau =\sigma^2/\sigma^2_0$ is assumed to be $100$ and $4$ in the upper panels and lower panels, respectively. \begin{table}[t] \begin{center} \begin{tabular}{lcccc} \hline $d=4$ and $\tau=100$ & \multicolumn{2}{c}{k=8} & \multicolumn{2}{c}{k=40}\\ & $n=200$ & $n=400$ & $n=200$ & $n=400$ \\ \hline PCA &$5.3\times 10^{-3}$& $5.1\times 10^{-3}$ &$1.4\times 10^{-3}$& $1.1\times 10^{-3}$ \\ GPPCA &$\bf 3.3\times 10^{-4}$ & $\bf 2.6\times 10^{-4}$ &$\bf 2.2\times 10^{-4}$ & $\bf 1.3\times 10^{-4}$ \\ LY1 & $4.6\times 10^{-2}$ & $5.8 \times 10^{-3}$ &$1.5\times 10^{-2}$ &$2.1\times 10^{-3}$ \\ LY5 & $3.2\times 10^{-2}$ & $5.5\times 10^{-3}$ & $1.1\times 10^{-2}$&$1.8\times 10^{-3}$\\ \hline $d=8$ and $\tau=100$ & \multicolumn{2}{c}{k=16} & \multicolumn{2}{c}{k=80}\\ & $n=500$ & $n=1000$ & $n=500$ & $n=1000$ \\ \hline PCA &$5.2\times 10^{-3}$& $5.0\times 10^{-3}$ &$1.3\times 10^{-3}$& $1.1\times 10^{-3}$ \\ GPPCA &$\bf 2.9\times 10^{-4}$ & $\bf 2.4\times 10^{-4}$ &$\bf 1.9\times 10^{-4}$ & $\bf 1.1\times 10^{-4}$ \\ LY1 & $1.4\times 10^{-2}$ & $5.1 \times 10^{-3}$ &$5.4\times 10^{-3}$ &$1.2\times 10^{-3}$ \\ LY5 & $8.8\times 10^{-3}$ & $5.1\times 10^{-3}$ & $3.9\times 10^{-3}$&$1.2\times 10^{-3}$\\ \hline $d=4$ and $\tau=4$ & \multicolumn{2}{c}{k=8} & \multicolumn{2}{c}{k=40}\\ & $n=200$ & $n=400$ & $n=200$ & $n=400$ \\ \hline PCA &$1.4\times 10^{-1}$& $1.3\times 10^{-1}$ &$4.2\times 10^{-2}$& $3.4\times 10^{-2}$ \\ GPPCA &$\bf 5.8\times 10^{-3}$ & $\bf 4.4\times 10^{-3}$ &$\bf 5.3\times 10^{-3}$ & $\bf 3.0\times 10^{-3}$ \\ LY1 & $2.2\times 10^{-1}$ & $1.7 \times 10^{-1}$ &$7.2\times 10^{-2}$ &$6.4\times 10^{-2}$ \\ LY5 & $2.2\times 10^{-1}$ & $1.5\times 10^{-1}$ & $4.8\times 10^{-2}$&$4.1\times 10^{-2}$\\ \hline $d=8$ and $\tau=4$ & \multicolumn{2}{c}{k=16} & \multicolumn{2}{c}{k=80}\\ & $n=500$ & $n=1000$ & $n=500$ & $n=1000$ \\ \hline PCA &$1.4\times 10^{-1}$& $1.3\times 10^{-1}$ &$3.9\times 10^{-2}$& $3.2\times 10^{-2}$ \\ GPPCA & $\bf 5.1\times 10^{-3}$ & $\bf 3.9\times 10^{-3}$ &$\bf 4.3\times 10^{-3}$ & $\bf 2.4\times 10^{-3}$ \\ LY1 & $1.8\times 10^{-1}$ & $1.4 \times 10^{-1}$ &$5.1\times 10^{-2}$ &$3.4\times 10^{-2}$ \\ LY5 & $1.7\times 10^{-1}$ & $1.3\times 10^{-1}$ & $4.6\times 10^{-2}$&$3.1\times 10^{-2}$\\ \hline \end{tabular} \end{center} \caption{AvgMSE for Example \ref{eg:shared_cov}.} \label{tab:AvgMSE_shared_cov} \end{table} Since the covariance of the factor processes is the same in Example \ref{eg:shared_cov}, the estimated $\mathbf A$ by the GPPCA has a closed-form solution given in Theorem \ref{thm:est_A_shared_cov}. For all 16 different scenarios, the GPPCA outperforms the other three methods in terms of having the smallest largest principal angle between $\mathcal M(\mathbf A)$ and $\mathcal M(\mathbf {\hat A})$. Both PCA and GPPCA can be viewed as maximum likelihood type of approaches under the orthonormality assumption of the factor loading matrix. The difference is that the estimator of $\mathbf A$ by the GPPCA maximizes the marginal likelihood after integrating out the factor processes, whereas the PCA maximizes the likelihood without modeling the factor processes. The principal axes by the PCA are the same as the PPCA which assumes the factors are independently distributed. As discussed before, the model with independent factors, however, is not a sensible sampling model for the correlated data, such as the multiple time series or multivariate spatial processes. The performance of all methods improves when the sample size increases or when the SNR increases, shown in Figure \ref{fig:simulation_shared_cov_angles}. The LY5 estimator \citep{lam2011estimation} seems to perform slightly better than the PCA when the SNR is smaller. This method is sensible because the factor loading space $\mathcal M(\mathbf A)$ is spanned by the eigenvectors of $\mathbf M:=\sum^{q_0}_{i=1}\bm {\Sigma}_y(q) \bm {\Sigma}^T_y(q)$ under some conditions. However, this may not be the unique way to represent the subspace of the factor loading matrix. Thus the estimator based on this argument may not be as efficient as the maximum marginal likelihood approach by the GPPCA, shown in Figure \ref{fig:simulation_shared_cov_angles}. \begin{figure}[t] \centering \begin{tabular}{c} \includegraphics[width=1\textwidth,height=.4\textwidth]{shared_cov_1_est_AZ_sigma_0_0_5.pdf} \end{tabular} \vspace{-.2in} \caption{Prediction of the mean of the first two output variables in one experiment with $k=8$, $d=4$, $n=400$ and $\tau=4$. The observations are plotted as black circles and the truth is graphed as the black curves. The estimation by the PCA and GPPCA is graphed as the red dotted curves and blue dashed curves, respectively. The shaded area is the 95\% posterior credible interval by the GPPCA. } \label{fig:shared_cov_pred_mean} \end{figure} The AvgMSE of the different approaches for Example \ref{eg:shared_cov} is shown in Table \ref{tab:AvgMSE_shared_cov}. The mean squared error of the estimation by the GPPCA is typically a digit or two smaller than the ones by the other approaches. This is because the correlation of the factor processes in the GPPCA is properly modeled, and the kernel parameters are estimated based on the maximum marginal likelihood estimation. We plot the first two rows of the estimated mean of the output in one experiment from the Example \ref{eg:shared_cov} in Figure \ref{fig:shared_cov_pred_mean}. The estimation of the GPPCA approach is graphed as the blue dashed curves, which is very close to the truth, graphed as the black curves, wheares the estimation by the PCA is graphed as the red dotted curves, which are less smooth and less accurate in predicting the mean of the outputs, because of the noise in the data. The estimators by LY1 and LY5 are similar to those of PCA so we omit them in Figure \ref{fig:shared_cov_pred_mean}. The problem of the PCA (and PPCA) is that the estimation assumes that the factors are independently distributed, which makes the likelihood too concentrated. Hence the variance of the noise is underestimated as indicated by the red curves in Figure \ref{fig:shared_cov_pred_mean}. In comparison, the variance of the noise estimated by the GPPCA is more accurate, which makes predictions by the GPPCA closer to the truth. \begin{example}[Factors with different covariance matrices] The data are sampled from model (\ref{equ:model_1}) where $x_i=i$ for $1\leq i\leq n$. The variance of the noise is $\sigma^2_0=0.25$ and the kernel function is assumed to follow from (\ref{equ:matern_5_2}) with $\sigma^2=1$. The range parameter $\gamma$ of each factor is uniformly sampled from $[10,10^3]$ in each experiment. We simulate the data from $8$ different combinations of $k$, $d$ and $n$. In each scenario, we repeat $N=100$ times. The parameters in the kernels and the variance of the noise are all estimated from the data. \label{eg:diff_cov} \end{example} \begin{figure}[t] \centering \begin{tabular}{cccc} \includegraphics[width=.245\textwidth,height=.35\textwidth]{simulation_diff_cov_1_sigma_0_0_5.pdf} \includegraphics[width=.245\textwidth,height=.35\textwidth]{simulation_diff_cov_2_sigma_0_0_5.pdf} \includegraphics[width=.245\textwidth,height=.35\textwidth]{simulation_diff_cov_3_sigma_0_0_5.pdf} \includegraphics[width=.245\textwidth,height=.35\textwidth]{simulation_diff_cov_4_sigma_0_0_5.pdf} \end{tabular} \vspace{-.1in} \caption{The largest principal angle between the true subspace and the estimated subspace of the four approaches for Example \ref{eg:diff_cov}. The number of observations of each output variable is $n=200$ and $n=400$ for left 4 boxplots and right 4 boxplots in 2 left panels, respectively. The number of observations is $n=500$ and $n=1000$ for left 4 boxplots and right 4 boxplots in 2 right panels, respectively. } \label{fig:simulation_diff_cov_angles} \end{figure} \begin{table}[t] \begin{center} \begin{tabular}{lcccc} \hline $d=4$ and $\tau=4$ & \multicolumn{2}{c}{k=8} & \multicolumn{2}{c}{k=40}\\ & $n=200$ & $n=400$ & $n=200$ & $n=400$ \\ \hline PCA &$1.3\times 10^{-1}$& $1.3\times 10^{-1}$ &$3.8\times 10^{-2}$& $3.0\times 10^{-2}$ \\ GPPCA &$\bf 1.4\times 10^{-2}$ & $\bf 4.0\times 10^{-2}$ &$\bf 7.1\times 10^{-3}$ & $\bf 1.1\times 10^{-2}$ \\ LY1 & $1.6\times 10^{-1}$ & $1.4 \times 10^{-1}$ &$4.9\times 10^{-2}$ &$3.4\times 10^{-2}$ \\ LY5 & $1.5\times 10^{-1}$ & $1.3\times 10^{-1}$ & $4.4\times 10^{-2}$&$3.2\times 10^{-2}$\\ \hline $d=8$ and $\tau=4$ & \multicolumn{2}{c}{k=16} & \multicolumn{2}{c}{k=80}\\ & $n=500$ & $n=1000$ & $n=500$ & $n=1000$ \\ \hline PCA &$1.3\times 10^{-1}$& $1.3\times 10^{-1}$ &$3.5\times 10^{-2}$& $2.9\times 10^{-2}$ \\ GPPCA & $\bf 1.3\times 10^{-2}$ & $\bf 3.3\times 10^{-2}$ &$\bf 6.0\times 10^{-3}$ & $\bf 8.0\times 10^{-3}$ \\ LY1 & $1.4\times 10^{-1}$ & $1.3 \times 10^{-1}$ &$3.7\times 10^{-2}$ &$2.9\times 10^{-2}$ \\ LY5 & $1.4\times 10^{-1}$ & $1.3\times 10^{-1}$ & $3.4\times 10^{-2}$&$2.8\times 10^{-2}$\\ \hline \end{tabular} \end{center} \caption{AvgMSE for Example \ref{eg:diff_cov}.} \label{tab:AvgMSE_diff_cov} \end{table} Since the covariance matrices are different in Example \ref{eg:diff_cov}, we implement the numerical optimization algrithm on the Stiefel manifold \citep{wen2013feasible} to estimate $\mathbf A$ in Theorem \ref{thm:est_A_diff_cov}. The largest principal angle between $\mathcal M(\mathbf A)$ and $\mathcal M(\hat {\mathbf A})$ and the AvgMSE in estimating the mean of the output matrix by different approaches for Example \ref{eg:diff_cov} is given in Figure \ref{fig:simulation_diff_cov_angles} and Table \ref{tab:AvgMSE_diff_cov}, respectively. The estimation by the GPPCA outperforms the other methods based on both criteria. \section{Real Data Examples} \label{sec:real_eg} We apply the proposed GPPCA approach and compared its performance with other approaches on two real data applications in this section. \subsection{Emulating multivariate output of the computer models} We first apply GPPCA for emulating computer models with multivariate output. Computer models or simulators have been developed and used in various scientific, engineering and social applications. Some simulators are computationally expensive (as the numerical solution of a system of the partial different equations (PDEs) is often required and is slow), and some contain multivariate outputs at a set of the input parameters (see e.g. \cite{higdon2008computer,paulo2012calibration,fricker2013multivariate,Gu2016PPGaSP}). Thus, a statistical emulator is often required to approximate the behavior of the simulator. We consider the testbed called the `diplomatic and military operations in a non-warfighting domain' (DIAMOND) simulator \citep{taylor2004development}. The DIAMOND simulator models the number of casualties during the second day to sixth day after the earthquake and volcanic eruption in Giarre and Catania. The simulator has 13 input variables, such as the helicopter cruise speed, engineer ground speed, shelter and food supply capacity at the two places (see Table 1 in \cite{overstall2016multivariate} for a complete list of the input variables). We use the same $n=120$ training and $n^*=120$ test outputs in \cite{overstall2016multivariate} to compare different methods. We focus on the out-of-sample prediction criteria: \begin{eqnarray} \text{RMSE}&=&\sqrt{\frac{\sum^{k}_{j=1}\sum^{n^*}_{i=1}(\hat Y^*_j(\mathbf x^*_i )- Y^*_j(\mathbf x^*_i ))^2 }{kn^*}},\, \label{equ:RMSE} \\ {P_{CI}(95\%)} &=& \frac{1}{k{n^{*}}}\sum\limits_{j = 1}^{k} {\sum\limits_{i = 1}^{n^{*}} 1\{Y^*_j(\mathbf x^*_i )\in C{I_{ij}}(95\% )\}}\,,\label{equ:PCI} \\ {L_{CI}(95\%)} &=& \frac{1}{{k{n^{*}}}}\sum\limits_{j = 1}^{k} \sum\limits_{i = 1}^{{n^{*}}} {\Length\{C{I_{ij}}(95\% )\} } \,, \label{equ:LCI} \end{eqnarray} where $Y^*_j(\mathbf x^*_i)$ is the $j$th coordinate of the held-out test output vector at the $i$th test input $\mathbf x^*_i$ for $1\leq i\leq n^*$ and $1\leq j\leq k^*$. $C{I_{ij}}(95\% )$ is the $95\%$ predictive credible interval and $\Length\{C{I_{ij}}(95\% )\}$ is the length of the $95\%$ predictive credible interval of the $Y^*_j(\mathbf x^*_i)$. A method with a small out-of-sample RMSE, ${P_{CI}(95\%)}$ being close to nominal $95\%$ level, and a small $L_{CI}(95\%)$ is considered precise in prediction and uncertainty quantification. \begin{table}[t] \begin{center} \begin{tabular}{lcccccc} \hline Method & Mean function & Kernel & RMSE & ${P_{CI}(95\%)} $ & ${L_{CI}(95\%)} $ \\ \hline GPPCA & Intercept& Gaussian kernel &$3.33\times 10^{2}$& $0.948$ &$1.52\times 10^{3}$ \\ GPPCA &Selected covariates& Gaussian kernel &$3.18\times 10^{2}$& $0.957$ &$1.31\times 10^{3}$ \\ GPPCA &Intercept& Mat{\'e}rn kernel &$2.82\times 10^{2}$& $0.962$ &$1.22\times 10^{3}$ \\ GPPCA &Selected covariates& Mat{\'e}rn kernel &$2.74\times 10^{2}$& $0.957$ &$1.18\times 10^{3}$ \\ \hline Ind GP & Intercept& Gaussian kernel &$3.64\times 10^{2}$& $0.918$ &$1.18\times 10^{3}$ \\ Ind GP &Selected covariates& Gaussian kernel &$4.04\times 10^{2}$& $0.918$ &$1.17\times 10^{3}$ \\ Ind GP &Intercept& Mat{\'e}rn kernel &$3.40\times 10^{2}$& $0.930$ &$0.984\times 10^{3}$ \\ Ind GP &Selected covariates& Mat{\'e}rn kernel &$3.31\times 10^{2}$& $0.927$ &$0.967\times 10^{3}$ \\ \hline Multi GP & Intercept & Gaussian kernel &$3.63\times 10^{2}$& $0.975$ &$1.67\times 10^3$ \\ Multi GP & Selected covariates & Gaussian kernel &$3.34\times 10^{2}$& $0.963$ & $1.54 \times 10^3$ \\ Multi GP & Intercept & Mat{\'e}rn kernel &$3.01\times 10^{2}$& $0.962$ & $1.34 \times 10^3$ \\ Multi GP & Selected covariates & Mat{\'e}rn kernel &$3.05\times 10^{2}$& $0.970$ & $1.50 \times 10^3$ \\ \hline \end{tabular} \end{center} \caption{Emulation of the DIAMOND simulator by different models. The first four rows show the predictive performance by the GPPCA with different mean structure and kernels. The middle four rows give the predictive performance by Ind GP with the same mean structure and kernels, as used in the GPPCA. The 9th and 10th rows show the emulation result of two best models in \cite{overstall2016multivariate} using Gaussian kernel for the same held-out test output, whereas the last two rows give the result of the same model with the Mat{\'e}rn kernel in (\ref{equ:matern_5_2}). The RMSE is $1.08\times 10^5$ using the mean of the training output to predict. } \label{tab:humanity_model} \end{table} We compare the prediction performance of the GPPCA, the independent Gaussian processes (Ind GP) and multivariate Gaussian process (Multi GP) on the held-out test output. The Ind GP builds a GP to emulate each coordinate of the output vector separately. The Multi GP in \cite{overstall2016multivariate} proposes a separable model, where the covariance of the output is a Kronecker product of the covariance matrix of the output vector at the same input, and the correlation matrix of the any output variable at different inputs. The parameters of Multi GP are estimated by the MLE using the code provided in \cite{overstall2016multivariate} and the parameters in Ind GP are estimated by the posterior mode using ${\tt RobustGaSP}$ ${\sf R}$ package \citep{gu2018robustgasp}. We use a product kernel for all models where each kernel is assumed the same for each input dimension. The Gaussian kernel is assumed in \cite{overstall2016multivariate} and we also include results using the Mat{\'e}rn kernel in (\ref{equ:matern_5_2}) for comparison. In \cite{overstall2016multivariate}, the model with the least RMSE is the one using the Gaussian kernel and a set of selected covariates. We find the 11th input (food capacity in Catania) is positively correlated with the outputs. Thus for the GPPCA and Ind GP, we explore the predictive performance of the models with the mean basis function being $\mathbf h(\mathbf x)=(1, x_{11})$. For GPPCA, we assume the range parameters in the kernels are shared for the latent factor processes, while the variance parameters are allowed to be different. \begin{figure}[t] \centering \begin{tabular}{cc} \raisebox{5mm}[0pt][0pt]{ \includegraphics[width=.49\textwidth,height=.31\textwidth]{Cov_est_data.pdf} } \includegraphics[width=.49\textwidth,height=.4\textwidth]{pred_two_days.pdf} \end{tabular} \vspace{-.1in} \caption{The estimated covariance of the casualties at the different days after the catastrophe by the GPPCA is graphed in the left panel. The held-out test output, the prediction by the GPPCA and Independent GPs with the mean basis $\mathbf h(\mathbf x)=(1,x_{11} )$ and Mat{\'e}rn kernel for the fifth day and sixth day are graphed in the right panel. } \label{fig:humanity_model} \end{figure} The predictive RMSE of different models are shown in Table \ref{tab:humanity_model}. Overall, all three approaches are precise in prediction, as the predictive RMSE is less than $1\%$ of the RMSE using the mean to predict. Compared to the other two approaches, the GPPCA has the smallest out-of-sample RMSE on each combination of the kernel function and mean function among three approaches. The nominal $95\%$ predictive interval covers around $95\%$ of held-out test output with relatively short average length of the predictive interval. The predictive interval from Multi GP covers more than $95\%$ of the held-out test output, but the average length of the interval is the highest. The Ind GP has the shortest length of the predictive interval, but it covers less than $95\%$ of the held-out test output using any kernel or mean function. The held-out test output on the fifth and sixth day and the prediction by Ind PG and GPPCA are graphed in the right panel in Figure \ref{fig:humanity_model}, both of which seem to be accurate. In GPPCA, the estimated covariance matrix of the casualties at the different days is $\mathbf {\hat A} \bm {\hat \Lambda} \mathbf {\hat A} + \hat \sigma^2_0 \mathbf I_k $, where $\bm {\hat \Lambda}$ is a diagonal matrix where the $i$th term is $\hat \sigma^2_i$ (the estimated variance of the $i$th factor). This covariance matrix is shown in the left panel in Figure \ref{fig:humanity_model}. We found that the estimated covariance between any two days is positive. This is sensible as the short food capacity, for example, is associated with the high casualties for all following days after the catastrophe. We also noticed that the estimated correlation of the output at the two consecutive days is larger, though we do not enforce a time-dependent structure (such as the autoregressive model in \cite{liu2009dynamic,farah2014bayesian}). The GPPCA is a more general model as the output does not have to be time-dependent, and the estimated covariance between the output variables captures the time dependence in the example. \subsection{Gridded temperature} \label{subsec:gridded_temperature} In this subsection, we consider global gridded temperature anomalies from U.S. National Oceanic and Atmospheric Administration (NOAA), available at: \href{ftp://ftp.ncdc.noaa.gov/pub/data/noaaglobaltemp/operational}{ftp://ftp.ncdc.noaa.gov/pub/data/noaaglobaltemp/operational} \noindent This dataset records the global gridded monthly anomalies of the air and marine temperature from Jan 1880 to near present with $5^{\circ}\times 5^{\circ}$ latitude-longitude resolution \citep{SShen2017}. A proportion of the temperature measurements is missing in the data set, which is also a common scenario in other climate data set. As many scientific studies may rely on the full data set, we first compare different approaches on interpolation, using the monthly temperature anomalies at $k=1,639$ spatial grid boxes in the past 20 years. We hold out the $24,000$ randomly sampled measurements on $k^*=1,200$ spatial grid boxes in $n^*=20$ months as the test data set. The rest $15,336$ measurements are used as the training data. We evaluate the interpolation performance of different methods based on the RMSE, ${P_{CI}(95\%)} $, and ${L_{CI}(95\%)}$ on the test data set. \begin{table}[t] \begin{center} \begin{tabular}{lcccccc} \hline Method & measurement error & RMSE & ${P_{CI}(95\%)} $ & ${L_{CI}(95\%)} $ \\ \hline GPPCA, $d=50$ &estimated &$0.386$& $0.870$ &$1.02$ \\ GPPCA, $d=100$ & estimated &$0.320$& $0.772$ &$0.563$ \\ GPPCA, $d=50$ &fixed &$0.385$& $0.933$ &$1.33$ \\ GPPCA, $d=100$ & fixed &$0.314$& $0.977$ &$1.44$ \\ \hline PPCA, $d=50$ &estimated &$0.620$& $0.677$ &$1.08$ \\ PPCA, $d=100$ & estimated &$0.602$& $0.525$ &$0.803$ \\ PPCA, $d=50$ &fixed &$0.617$& $0.765$ &$1.32$ \\ PPCA, $d=100$ & fixed &$0.585$& $0.819$ &$1.400$ \\ \hline Temporal model &estimated &$0.937$& $0.944$ &$2.28$ \\ Spatial model &estimated &$0.560$& $0.942$ &$2.23$ \\ Spatio-temporal model & estimated &$0.492$ &$0.957$ & $2.10$ \\ \hline Temporal regression by RF &estimated &$0.441$ & /&/ \\ Spatial regression by RF &estimated &$0.391$& / & / \\ \hline \end{tabular} \end{center} \caption{Out of sample prediction of the temperature anomalies by different approaches. The first four rows give the predictive performance by the GPPCA with different latent factors, estimated and fixed variance of the measurement error, whereas the latter four rows record the results by the PPCA. The predictive performance by the temporal, spatial and spatio-temporal smoothing methods are given in the 9th and 10th rows. The last two rows give the predictive RMSE by regression using the random forest (RF) algorithm. } \label{tab:temperature} \end{table} The predictive performance by the GPPCA using the predictive distribution in (\ref{equ:cond_pred_with_mean}) is shown in the first four rows of Table \ref{tab:temperature}. Here the number of grid boxes is $k=1639$, and the temporal correlation of the temperature measurements at different months are parameterized by the Mat{\'e}rn kernel in (\ref{equ:matern_5_2}). We model the intercept and monthly change rate at each location by assuming the mean basis function $\mathbf h(x)=(1,x)$, where $x$ is an integer from $1$ to $240$ to denote the month of an observation. We explore the cases with $d=50$ and $d=100$ latent factor processes where the covariance in each latent process is assumed to be the same. In this dataset, the average recorded variance of the measurement error is around $0.1$. We implement the scenarios with an estimated variance or a fixed variance of the measurements. In the fifth to the eighth rows, we show the predictive performance of the PPCA with the same number of latent factors. In the ninth and tenth rows, we show the results by a spatial model and a temporal model both based on the Mat{\'e}rn kernel, separately for the observations in each spatial grid box and in each month, respectively. The ${\tt RobustGaSP}$ ${\sf R}$ package \citep{gu2018robustgasp} is used to fit the GP regression with the estimated nuggets, and the mean basis function is assumed to be $\mathbf h(x)=(1,x)$ when fitting GP regression for the monthly measurements. The predictive performance by a spatio-temporal model that use a product Mat{\'e}rn kernel function is shown in the eleventh row. In the last two rows in Table \ref{tab:temperature}, we consider two regression schemes based on the random forest algorithm (\cite{breiman2001random}). The first scheme treats the observations in each spatial grid box as independent measurements, whereas the second scheme treats the observations in each month as independent measurements. The modeling fitting details of these approaches are given in Appendix D. First, we find that GPPCA has the lowest out-of-sample RMSE among all the methods we considered. When the number of factors increases, both the PPCA and GPPCA seem to perform better in terms of RMSEs. However, the estimation by the GPPCA is more precise. This is because the temporal correlation and linear trend are modeled and estimated in the GPPCA, whereas the PPCA is a special case of GPPCA with the independent monthly measurements. This result is achieved with the simplest setting in GPPCA, that is when the covariance of the factor processes is assumed to be the same. In this case, the estimation of the factor loadings has a closed form expression. Assuming different parameters in the factor processes and use other kernel functions may further improve the precision in prediction. Furthermore, when the variance of the measurement error is estimated, the predictive credible interval by either the PPCA or GPPCA is too short, resulting in less than $95\%$ of the data covered by $95\%$ predictive interval. When the variance of the noise is fixed to be $0.1$ (the variance of the measurement error), around $95\%$ of the held-out data are covered in the nominal $95\%$ predictive interval in the GPPCA, but not in the PPCA. \begin{figure}[t] \centering \begin{tabular}{ccc} \includegraphics[width=.33\textwidth,height=.3\textwidth]{GPPCA_est_temp_2016_Nov.pdf} \includegraphics[width=.33\textwidth,height=.3\textwidth]{real_temp_2016_Nov.pdf} \includegraphics[width=.33\textwidth,height=.3\textwidth]{spatio_temporal_smoothing_temp_2016_Nov.pdf} \end{tabular} \vspace{-.1in} \caption{Interpolation of the temperature anomalies in November 2016. The real temperature anomalies in November 2016 is graphed in the middle panel. The interpolated temperature anomalies by the GPPCA and spatio-temporal model are graphed in the left and right panels, respectively. The number of training and test observations are 439 and 1200, respectively. The out-of-sample RMSE of the GPPCA and spatio-temporal model is $0.314$ and $0.747$, respectively. } \label{fig:temperature_2016_Nov_prection} \end{figure} The spatial smoothing approach by GP and spatial regression by RF have smaller predictive errors than its temporal counterparts, indicating the spatial correlation may be larger than the temporal correlation in the data. Combining both the spatial and temporal information seems to be more accurate than using only the spatial or temporal information. However, the spatio-temporal model is not as accurate as the GPPCA. We plot the interpolated temporal anomalies in November 2016 by the GPPCA (with the variance of the measurement error fixed to be 0.1) and the spatio-temporal model in the left and right panels in Figure \ref{fig:temperature_2016_Nov_prection}, respectively. Compared with the observed temperature anomalies shown in the middle panel, the GPPCA interpolation is more precise than the spatial smoothing method at the locations where the temperature anomalies changes rapidly, e.g. the region between the U.S. and Canada, and the east region in Russia. We should acknowledge that the implemented spatio-temporal model is not the only choice. Other spatio-temporal models may be applicable, yet fitting these models may be more computationally expensive. Note that the missing values are typically scattered in different rows and columns of the observation matrix in practice. One of the future directions is to extend the GPPCA to include the columns of the data matrix with missing values to improve the estimation of the factor loading matrix and the predictive distribution of the missing values, based on expectation-maximization algorithm, or the Markov chain Monte Carlo algorithm if one can specify the full posterior distributions of the factor loading matrix and the parameters. Besides, We should also emphasize that we do not utilize the spatial distance in the GPPCA. This makes the GPPCA suitable for other interpolation and matrix completion tasks when there is no distance information between the output variables. \begin{figure}[t] \centering \begin{tabular}{cc} \includegraphics[width=.48\textwidth,height=.43\textwidth]{estimated_theta_1.pdf} \includegraphics[width=.48\textwidth,height=.43\textwidth]{estimated_theta_2.pdf} \end{tabular} \vspace{-.1in} \caption{Estimated intercept and monthly change rate of the temperature anomalies by the GPPCA using the monthly temperature anomalies between January 1999 and December 2018. } \label{fig:temperature_April_theta_est} \end{figure} The estimated trend parameters $\bm {\hat \Theta}$ by the GPPCA are shown in Figure \ref{fig:temperature_April_theta_est}. Based on the last twenty years' data, the average annual increase of the temperature is at the rate of around $0.02 ~^o C$. The areas close to the north pole seems to have the most rapid increase rate. Among the rest of the areas, the south west part and the north east part of the U.S. also seem to increase slightly faster than the other areas. Note we only use the observations from the past 20 years for demonstration purpose. A study based on a longer history of measurements may give a clearer picture of the change in global temperature. \section{Concluding remarks} \label{sec:conclusion} In this paper, we have introduced the GPPCA, as an extension of the PPCA for the latent factor model with the correlated factors. By allowing data to infer the covariance structure of the factors, the estimation of the factor loading matrix and the predictive distribution of the output variables both become more accurate by the GPPCA, compared to the ones by the PCA and other approaches. This work also highlights the scalable computation achieved by a closed-form expression of the inverse covariance matrix in the marginal likelihood. In addition, we extend our approach to include additional covariates in the mean function and we manage to marginalize out the regression parameters to obtain a closed-form expression of the marginal likelihood when estimating the factor loading matrix. There are several future directions related to this work. First of all, the factor loading matrix, as well as other parameters in the kernel functions and the variance of the noise, is estimated by the maximum marginal likelihood estimator, where the uncertainty in the parameter estimation is not expressed in the predictive distribution of the output variables. A full Bayesian approach may provide a better way to quantify the uncertainty in the predictive distribution. Secondly, we assume the number of the latent factors is known in this work. A consistent way to identify the number of latent factors is often needed in practice. Thirdly, the convergence rate of the predictive distribution and the estimation of the subspace of the factor loading matrix of the GPPCA both need to be explored. The numerical results shown in this work seem to be encouraging towards this direction. Furthermore, when the covariances of the factor processes are not the same, the numerical optimization algorithm that preserves the orthogonal constraints \citep{wen2013feasible} is implemented for the marginal maximum likelihood estimator of the factor loading matrix. The convergence of this algorithm is an interesting direction to explore. A fast algorithm for the optimization problem in Theorem \ref{thm:est_A_diff_cov} will also be crucial for some computationally intensive applications. Finally, here we use kernels to parameterize the covariance of the factor processes for demonstrative purposes. The GPPCA automatically apply to many other models of the latent factors, as long as the likelihood of a factor follows a multivariate normal distribution. It is interesting to explore the GPPCA in other factor models and applications. \acks{The authors thank the editor and three anonymous referees for their comments that substantially improve this article. Shen's research is partially supported by the Simons Foundation Award 512620 and the National Science Foundation (NSF DMS 1509023).} \newpage
\section{Introduction} \IEEEPARstart{A}{ntenna} parameters such as gain, Q-factor, and efficiency are limited by the geometry made available for a given design. Given bounds on these parameters under certain constraints, a designer can rapidly assess the feasibility of design requirements. This feasibility assumes the existence of an \Quot{optimal antenna} design which approaches the bounds on certain specified parameters. Synthesis of an optimal antenna is not a trivial task, and it remains to be demonstrated how an antenna designed to be optimal in one parameter (\textit{e.g.}{}{}, radiation Q-factor) performs relative to bounds on other parameters (\textit{e.g.}{}{}, efficiency). The goal of this paper is to discuss the synthesis and analysis of optimal antennas starting from classical antenna topologies. Many strategies have been employed to optimize antennas. Heuristic optimization methods such as genetic algorithms~\cite{RahmatMichielssen_ElectromagneticOptimizationByGenetirAlgorithms,Haupt+Werner2007} and particle swarm optimization have the advantage of generating design geometries outside of the antenna designer's usual catalog \cite{RahmatSamii_Kovitz_Rajagopalan-NatureInspiredOptimizationTechniques, OnwuboluBabu_NewOptimizationTechniquesInEngineering, Deb_MultiOOusingEA}. Such techniques have been used to design optimal antennas with radiation Q-factors very close to the physical bounds~\cite{CismasuGustafsson_FBWbySimpleFreuqSimulation}, though the resulting designs are computationally expensive to produce and offer only rough insight into guidelines for designing optimal antennas in volumes with arbitrary shapes and electrical size. Conversely, canonical antenna designs were shown~\cite{GustafssonSohlKristensson_IllustrationsOfNewPhysicalBoundOnLinearlyPolAntennas, Best_ElectricallySmallResonantPlanarAntennas} to reach the lower bound on radiation Q-factor, but the question remains whether these designs represent optimal solutions over arbitrary electrical sizes and whether they are optimal in other parameters, \textit{e.g.}{}{}, radiation efficiency and input impedance. The cost of matching an optimal antenna design to arbitrary impedances is also unclear, regardless if matching is performed on the antenna itself or through external networks. In this paper we study whether there exists a simple \Quot{recipe} for an optimal planar antenna (Throughout this paper, the term planar means to lie in a plane.) with respect to radiation Q-factor and radiation efficiency. In doing so, we ask whether, when prescribed with some form factor and electrical size, a simple design can be readily employed to achieve an antenna whose properties are sufficiently close to their bounds. The strategy adopted here is to optimize parameterizations of canonical antenna geometries known for good behavior in certain parameters. The examples studied here give quantifiable results to this end, \textit{i.e.}{}{}, how to design certain kinds of optimal antennas. Along the way, we address the crossover of optimality of antennas across different performance parameters, \textit{e.g.}{}{}, do minimum radiation Q-factor antennas have inherently high radiation efficiency? Also discussed are the impacts of certain constraints, particularly those related to an antenna's input impedance, on optimized parameters. We stress out that this work differs significantly from other works on antenna optimization through parametric, heuristic, or metaheuristic means which typically involves the iterative evaluation and modification of designs until a local optimum or design goal is reached. Here, instead, we focus on designing antenna performance with respect to physical bounds, which provide an absolute measure in judging the quality of the synthesized design. \section{Minimum Radiation Q-factor of planar TM antennas} \label{sec:Q-optimization} We begin by studying the synthesis of electrically small dipole-like (TM) antennas with minimal radiation Q-factor~$\Qrad$~(see Box~\ref{B:Box1a} and Box~\ref{B:Box1b}). This leads to increased impedance bandwidth, however, the lower bound on radiation Q-factor increases rapidly as an antenna design region becomes smaller (see Box~\ref{B:Box1b}). Thus, obtaining low Q-factor~$\Qrad$ is a key objective and challenge in the design of electrically small antennas. \begin{boxexampl}[label={B:Box1a}]{{Q-factor}} The Q-factor of an antenna system tuned to resonance (equality of mean magnetic and mean electric energy) is defined as~\cite{IEEEStd_antennas} \begin{equation} Q = \frac{2\omega \Wsto}{\Prad + \Plost}, \label{eq:qdef_box1a} \end{equation} where~$\Wsto$ represents the cycle mean stored energy, while~$\Prad$ and~$\Plost$ denote cycle mean radiated and dissipated powers, respectively. In single-resonance systems, lower Q-factor implies larger fractional impedance bandwidth~$\BW$ by an inverse relationship~\cite{Chu_PhysicalLimitationsOfOmniDirectAntennas,Fante1969,YaghjianBest_ImpedanceBandwidthAndQOfAntennas} \begin{equation} \BW \sim Q^{-1}. \label{eq:b_q} \end{equation} Evaluated at a single frequency via~\eqref{eq:qdef_box1a}, Q-factor thus becomes a convenient measure of the frequency selectivity of a system~\cite{Chu_PhysicalLimitationsOfOmniDirectAntennas,Collin+Rothschild1964,Fante1969,Harrington+Mautz1972,Rhodes1976,Collin1998,YaghjianBest_ImpedanceBandwidthAndQOfAntennas,Vandenbosch_ReactiveEnergiesImpedanceAndQFactorOfRadiatingStructures,GustafssonCismasuJonsson_PhysicalBoundsAndOptimalCurrentsOnAntennas_TAP,Geyi2011,Gustafsson+Jonsson2015b,CapekGustafssonSchab_MinimizationOfAntennaQualityFactor,Gustafsson+Jonsson2015a}. Calculation of a system's Q-factor can be carried out by a variety of approaches, from impedance-based techniques~\cite{YaghjianBest_ImpedanceBandwidthAndQOfAntennas} to methods based on the evaluation of stored energy directly~\cite{Vandenbosch_ReactiveEnergiesImpedanceAndQFactorOfRadiatingStructures, CismasuGustafsson_FBWbySimpleFreuqSimulation}. All of these approaches generally agree for electrically small, narrow-band antennas, see~\cite{Schab+etal2018} for complete discussion and bibliography. \\ The radiation Q-factor~$\Qrad$, in which only radiated power is considered, can be expressed in terms of $Q$ in \eqref{eq:qdef_box1a} and radiation efficiency~$\eta$ (see Box~\ref{B:delta1}, \eqref{Box_eta}) as \begin{equation} \Qrad = Q / \eta \sim (\BW\eta)^{-1}. \label{eq:b_eta} \end{equation} \end{boxexampl} \begin{boxexampl}[label={B:Box1b}]{{Lower bounds on radiation Q-factor}} The approximate inverse proportionality between the \mbox{Q-factor} and the fractional bandwidth (see Box~\ref{B:Box1a}) induced considerable effort in lowering the Q-factor for spherical~\cite{Chu_PhysicalLimitationsOfOmniDirectAntennas,VolakisChenFujimoto_SmallAntennas,Thal2006,Collin+Rothschild1964,McLean1996,Kim2012} and arbitrarily shaped antennas~\cite{Wheeler1947,Gustafsson+etal2015b,Gustafsson+etal2007a,Yaghjian+etal2013,CapekJelinek_OptimalCompositionOfModalCurrentsQ,Sievenpiper+etal2012,Thal2012}. The sole focus on the radiation Q-factor~$\Qrad$ in these works avoids the undesired possibility of reducing Q-factor~$Q$ by degrading radiation efficiency.\\ For electrically small antennas, the lower bound on the~$\Qrad$, here denoted as~$\Qradmin$, is a combination of electric and magnetic dipoles~\cite{Chu_PhysicalLimitationsOfOmniDirectAntennas,McLean1996, Jonsson+Gustafsson2015,CapekJelinek_OptimalCompositionOfModalCurrentsQ,Best2005}. In general, it is challenging to excite such a current with a single feeding position see \cite[Sec.~IV]{JelinekCapek_OptimalCurrentsOnArbitrarilyShapedSurfaces} for related discussion. A constrained minimization which is more representative for single port antennas is to restrict the radiation to TM (electric dipole) modes, yielding the lower bound $\QradminTM$, see, \textit{e.g.}{}, \cite{GustafssonTayliEhrenborgEtAl_AntennaCurrentOptimizationUsingMatlabAndCVX}. The importance of Q-factor bounds arises from two key properties. First, the Q-factor bound represents the physical lower bound among all possible currents contained within the considered region. It thus presents an absolute measure against which to compare the performance of different antenna designs. Practical feasibility of designing antennas which reach various bounds remains an open question. Second, both $\Qradmin$ and $\QradminTM$ scale approximately as $(ka)^{-3}$ for electrically small antennas ($ka<1$), \textit{cf.}{}~\cite{Jonsson+Gustafsson2016}. Here $k$ is the free-space wavenumber and $a$ is the radius of the smallest circumscribing sphere. This $(ka)^{-3}$ scaling is the root cause of the limited bandwidth in electrically small antennas. The associated geometry coefficients for certain shapes are shown in Table~\ref{Tab:Bounds}, where $\ZVAC$ denotes free-space impedance and $R_\mathrm{s}$ denotes surface resistance. \end{boxexampl} \begin{table}[t] \centering \caption{Lower bounds on radiation Q-factors and efficiency in the limit of electrical size $ka \to 0$ for a sphere, a cylindrical tube, a rectangle, a thin strip dipole and a square loop.} \begin{tabular}{cccc} \rule{0pt}{3ex}\rule[-2ex]{0pt}{0pt} & $(ka)^3 \Qradmin$ & $(ka)^3 \QradminTM$ & $(ka)^4 \ZVAC/R_\mathrm{s} \delta$ \\ \toprule \noindent\parbox[c]{2cm}{\centering\includegraphics[scale=1.0]{Shape1_Sphere.pdf}} & 1 & $\displaystyle\frac{3}{2}$ & 3 \\ \midrule \noindent\parbox[c]{2cm}{\centering\includegraphics[scale=1.0]{Shape2_Cylinder.pdf}} & 4.5 & 4.6 & 59 \\ \midrule \noindent\parbox[c]{2cm}{\centering\includegraphics[scale=1.0]{Shape3_Rectangle.pdf}} & 4.3 & 5.2 & 42 \\ \midrule \noindent\parbox[c]{2cm}{\centering\includegraphics[scale=1.0]{Shape4_Dipole.pdf}} & 16 & 16 & 3400 \\ \midrule \noindent\parbox[c]{2cm}{\centering\includegraphics[scale=1.0]{Shape5_Loop.pdf}} & 5.3 & 7.4 & 130 \\ \bottomrule \end{tabular} \label{Tab:Bounds} \end{table} \subsection{Synthesis of meander line~antennas} Drawing from the prevalence of meander line~antennas in applications requiring electrically small planar antennas \cite{Fujimoto_Morishita_ModernSmallAntennas, VolakisChenFujimoto_SmallAntennas}, as well as previous work studying their optimality in radiation Q-factor~\cite{Best_ElectricallySmallResonantPlanarAntennas}, we focus on determining whether meander line s present a consistent, simple solution, to obtaining minimum radiation Q-factor at arbitrary frequencies within rectangular design regions. Here, and throughout Section~\ref{sec:Efficiency-optimization}, we specify a rectangular design region of fixed aspect ratio (\mbox{$L/W = 2$}). The impact of varying aspect ratios is demonstrated and discussed in Section~\ref{sec:q-aspect-ratios}. \begin{figure} \centering \includegraphics[scale=1]{Fig1_Meander_parametrization} \caption{Panel~(a) shows a parameterization of a meander line~antenna used in this work. The antenna is fed via delta gap source along a horizontal line cutting the center of the meander line. The feeding region contains a taper between the feeding strip of width~$d$ and the meander line~of width~$w$. The angle of the taper's cut is~$45\ensuremath{^\circ}$. Throughout the paper \mbox{$d=\mathrm{min} \left(w,L/40 \right)$} in order to keep the feeding region realistically narrow. Panel~(b) shows a meander line~antenna design \Quot{M1} from~\cite{Best_ElectricallySmallResonantPlanarAntennas} within the parametrization used in this paper.} \label{fig:meander-parameterization} \end{figure} From the many possible meander line~shapes (for example, rectangular, triangular, sinusoidal~\cite{Fujimoto_Morishita_ModernSmallAntennas}) we have chosen the simple parametrization from~Fig.~\ref{fig:meander-parameterization}. Thin wire versions of such antennas were previously shown to reach the lower bound on radiation Q-factor~$\Qrad$ for their corresponding rectangular design regions with electrical sizes near~\mbox{$ka = 0.3$}~\cite{Best_ElectricallySmallResonantPlanarAntennas}. Here, we use the parameterization in Fig.~\ref{fig:meander-parameterization} to optimize the meander line~antenna for resonance by requiring the magnitude of the normalized input reactance~\mbox{$\Xin/\Rin$} to be smaller than a specified tolerance, \mbox{$\left|\Xin/\Rin \right| < 10^{-3}$}. This procedure is repeated at many frequencies (electrical sizes, values of~$ka$) to obtain a set of antenna designs, each resonant at a specific frequency. The Q-factors~$\Qrad$ of the resulting designs were then calculated in AToM~\cite{atom} and compared to the bounds discussed in Box~\ref{B:Box1b}. The comparison is shown in Fig.~\ref{fig:meander-designs-vs-qbound}. Note that the value of Q-factor~$\Qrad$ is just weakly dependent on dissipation factor (see Box~\ref{B:delta1}) provided that dissipation is not exceedingly high. \begin{figure} \includegraphics[width=\figwidth]{Fig2_Normalized_Qfactor_dept_on_ka} \caption{Radiation Q-factors of self-resonant meander line~antennas simulated as made of PEC (markers) and the lower bound on radiation Q-factor (see Box~\ref{B:Box1a}) corresponding to a rectangular region bounding the meander line. All meander line s are designed using the parameterization in Fig.~\ref{fig:meander-parameterization} with \mbox{$w/s = 1$} and \mbox{$L/W=2$}. The defining parameters of all meandered dipoles are depicted in Fig.~\ref{fig:meander-designs}. A triangular marker with a corresponding error bar represents measured radiation Q-factor of selected meander line~design.} \label{fig:meander-designs-vs-qbound} \end{figure} \begin{figure} \includegraphics[width=\figwidth]{Fig3_Meander_defining_parameters} \caption{Design curves for the meander line~antennas from Fig.~\ref{fig:meander-parameterization}. The panels show consecutively total number of meanders~$N$, total length of the strip~$L_\mathrm{eff}$ normalized to free-space wavelength, and input resistance~$R_\mathrm{in}$ normalized to free-space impedance. In all cases~\mbox{$w/s = 1$}, \mbox{$L/W = 2$} and PEC are considered. One meander line~(\mbox{$N=1$}) consists of two horizontal strips and vertical connections, \textit{i.e.}{}{}, meander line~antennas in Fig.~\ref{fig:meander-parameterization} have 3~and 20~meanders, respectively.} \label{fig:meander-designs} \end{figure} In order to verify the computed data in Fig.~\ref{fig:meander-designs-vs-qbound}, an antenna design sample with~$ka = 0.42$ was scaled to~$1.4$\,GHz and fabricated on a $25\,\mu$m-thick Polyimide film with $17\,\mu$m-thick copper foil bonded by an $25\,\mu$m-thick acrylic adhesive ($\varepsilon_\mathrm{r} = 4$). Thanks to the very thin profile of the substrate as compared to wavelength, the effect of dielectric can be neglected for a radiation Q-factor evaluation. The input impedance of the prototype was measured using a differential technique~\cite{Meys_Diff_Method} and has been used to estimate the Q-factor via the~$Q_\mathrm{Z}$ formula~\cite{YaghjianBest_ImpedanceBandwidthAndQOfAntennas}. Radiation efficiency of the antenna was measured via a multiport near-field method~\cite{RazaYangHussain_MeasurementOfRadEff_2012} and was used to evaluate radiation Q-factor, and its confidence interval of width equal to two times the standard deviation, see triangular marker and corresponding error bar in Fig.~\ref{fig:meander-designs-vs-qbound}. Figure~\ref{fig:meander-designs-vs-qbound} illustrates that a simple parametrization, such as the one from Fig.~\ref{fig:meander-parameterization}, is able to closely approach the radiation Q-factor bound limited to TM radiation~$Q_\mathrm{rad}^\mathrm{lb,TM}$ (see Box~\ref{B:Box1b}) in the entire frequency range of electrically small antennas. From this, it is possible to conclude that a complex design (\textit{e.g.}{}{}, the parameterizations found in \cite{Pantoja_2003_PreFractal}) is not needed to reach the lower bound. The absolute lower bound for radiation Q-factor~$Q_\mathrm{rad}^\mathrm{lb}$ is unreachable by this meander line~antenna since its planar geometry and single feed scenario does not allow for an efficient excitation of combined TE and TM radiation. This contrasts to three-dimensional (\textit{e.g.}{}{}, spherical) geometries~\cite{Best2005,Thal2006}, where the dual mode behavior can be realized by a single feed network. Parameters of the self-resonant designs from Fig.~\ref{fig:meander-designs-vs-qbound} are shown in Fig.~\ref{fig:meander-designs}. Design curves are fitted to the optimized parameters using a polynomial fit with good agreement. While some of the curves from Fig.~\ref{fig:meander-designs} can be found in~\cite{Fujimoto_Morishita_ModernSmallAntennas} for several parametrization, here all the designing curves are related back to Fig.~\ref{fig:meander-designs-vs-qbound} in which the Q-factor~$\Qrad$ is minimized. The presented data series can therefore be used for designing meandered dipoles approaching lower bounds on radiation Q-factor for TM antennas. It should, however, be noted that design curves from Fig.~\ref{fig:meander-designs} depends on the used parametrization and are valid only for~\mbox{$L/W = 2$} and~\mbox{$w/s \approx 1$}. \subsection{Varying aspect ratios} \label{sec:q-aspect-ratios} Meander line antennas, introduced in the previous section, are now studied for various~$L/W$ and~$w/s$ aspect ratios and compared against the fundamental bounds calculated for each form factor. In all cases, the value of radiation Q-factor~$\Qrad$ is normalized with respect to the minimal TM radiation Q-factor. Generally, Fig.~\ref{fig:meander-LWratios} shows that the minimal values can closely be approached for various~$L/W$ aspect ratios. Slightly better performance is observed for higher~$L/W$ ratios, however, at the cost of higher absolute bound on radiation Q-factor see top panel of Fig.~\ref{fig:meander-LWratios}. With respect to the varying~$w/s$ ratio, slightly better performance is observed for higher values, \textit{i.e.}{}{}, wider metallic strips. The differences become negligible for small values of~$ka$, see Fig.~\ref{fig:meander-wsatios}. Notice, however, that this behavior is substantially changed when ohmic losses are introduced, mainly since the spatial proximity of out-of-phased currents degrades the radiation and enhance the ohmic losses~\cite{BestMorrow_OnTheSignificanceOfCurrentVectorAlignmentInEstablishingTheResonantFrequencyOfSmallSpaceFillingWireAntennas}. \begin{figure} \centering \includegraphics[width=\figwidth]{Fig13_Meander_QoverQTMlimits} \caption{Radiation Q-factor performance of PEC self-resonant meandered dipoles from Fig.~\ref{fig:meander-designs-vs-qbound} for various~$L/W$ aspect ratios. The radiation Q-factor is normalized to fundamental bound for a rectangular region which is shown in the top panel as a function of the aspect ratio. The minimum of the fundamental bound is found around ratio~\mbox{$L/W\approx 5/3$}. Generally, the higher the~$L/W$ ratio, the closer the meander line s are to the bound, however, at the cost of increasing absolute value of radiation Q-factor.} \label{fig:meander-LWratios} \end{figure} \begin{figure} \centering \includegraphics[width=\figwidth]{Fig14_Meander_ws_ka} \caption{The same study as in Fig.~\ref{fig:meander-LWratios} done for various ratios of meander line~width~$w$ to spacing~$s$.} \label{fig:meander-wsatios} \end{figure} \subsection{The impact of impedance matching on Q-factor~$\Qrad$} The designs obtained above are all self resonant ($\Xin \approx 0$), but no constraint was placed on the value of the input resistance~$\Rin$. In most practical cases, the objective antenna input resistance is not driven by any antenna consideration but is set by the radio frequency electronic equipment to be interfaced with a particular antenna. Transmission lines and active receivers based on Low Noise Amplifiers (LNA) often require matching to~$50\,\Ohm$. However, where devices with complex impedances are used, antenna resonance may not be ideal for conjugate matching and maximum power transfer. For example, a typical Power Amplifier (PA) output impedance is complex~\cite{Freescale1991}, with an input resistance lower than~$50\,\Ohm$ and an inductive (positive) reactive component. Similarly, passive RFID receivers based on Schottky diode rectifiers typically exhibit input resistances lower than~$50\,\Ohm$ and strong capacitive (negative) reactance~\cite{Marrocco_2008_ArtOfUHFRFID}. Examples of nominal impedances~$\Zmatch$ for these systems are listed in Table~\ref{tab:impedances}. \begin{table} \centering \caption{Three impedances of practical significance for antenna system design.} \begin{tabular}{cc} System & Input impedance $\Zmatch$ \\ \toprule Power amplifier (PA) & $15+\J 50\Ohm$ \\ RFID chip (passive RX) & $20-\J 200\Ohm$ \\ Low-noise amplifier (LNA) & $50\Ohm$ \\ \bottomrule \end{tabular} \label{tab:impedances} \end{table} Antennas may be designed to have input impedances which conjugate match a desired load. However, any of the designs shown in Fig.~\ref{fig:meander-designs-vs-qbound} can be conjugate matched to an arbitrary complex impedance~$\Zmatch$ through an L-network consisting of two reactive components~\cite{Pozar_MicrowaveEngineering}. In many instances, the stored energies within these reactances will raise the radiation Q-factor of the system. To assess the cost of this form of simple matching, we select the design in Fig.~\ref{fig:meander-designs-vs-qbound} corresponding to self resonance at $ka = 0.479$. A set of lossless networks was generated to conjugate match the antenna to arbitrary complex impedances and the matched radiation Q-factors were calculated. A typical frequency dependence of this cost is depicted in Fig.~\ref{fig:meander-matching-intro} while the dependence on matching impedance is depicted in Fig.~\ref{fig:meander-complex-matching}. We observe that it is generally possible to transform the resonant antenna impedance to an arbitrary real value with minimal increase in radiation Q-factor, except when small resistance and high reactance is required. As expected, adding a reactive component to the real-valued (resonant) antenna impedance necessarily increases radiation Q-factor, though this increase is on the order of $30\%$ for the most extreme of the three test impedances (RFID) examined here. Additionally, Fig.~\ref{fig:meander-matching-intro} shows that it is often possible to move slightly away from the self-resonant frequency and lower the overall radiation Q-factor by a small amount. Nonetheless, the minimum radiation Q-factor of the matched antenna is, for practical values of the matching impedance, within the vicinity of the self-resonance of the antenna. \begin{figure} \includegraphics[width=\figwidth]{Fig4_Meander_Cost_of_Matching} \caption{Matched radiation Q-factor of a selected meander line~antenna for several impedance matching scenarios listed in Table~\ref{tab:impedances}. Matching to each impedance is accomplished via a two-element reactive L-network, see inset in Fig.~\ref{fig:meander-complex-matching} for a schematic. In cases when several L-networks exist for a given matching impedance, the network with the lowest stored energy has been used. Abrupt jumps of the matched radiation \mbox{Q-factor} curves result from non-existence of matching by two inductances in certain frequency ranges. This double inductance matching is the most favorable scenario for a capacitive antenna.} \label{fig:meander-matching-intro} \end{figure} \begin{figure} \includegraphics[width=\figwidth]{Fig5_Meander_Cost_of_Matching_Contour} \caption{Matched radiation Q-factor of a selected meander line~antenna for varying complex matching impedance normalized to radiation Q-factor of bare antenna. For each complex impedance, the meander line~is conjugate matched at its self-resonance (circle mark in Fig.~\ref{fig:meander-matching-intro}, $ka \approx 0.479$) using the lossless {L-network} matching circuit with lowest {Q-factor}. The markers denote the three impedances from Fig.~\ref{fig:meander-matching-intro} and Table~\ref{tab:impedances}.} \label{fig:meander-complex-matching} \end{figure} The importance of Q-factor is its relation to fractional bandwidth which is predicated on simple, single resonance behavior~\cite{YaghjianBest_ImpedanceBandwidthAndQOfAntennas}. We demonstrate that the low variance in Q-factor corresponds to consistent realized bandwidth when L-networks are used to conjugate match an antenna to an arbitrary impedance. Figure~\ref{fig:meander-realized-bandwidths} shows the power delivered $P_\mathrm{del}$ to the meander line~antenna studied above using a matched source ($\Zmatch = \Rin$) as well as with L-networks designed to match the antenna to the three complex impedances of practical interest in Table~\ref{tab:impedances}. In each case, a network tunes the antenna to the desired (possibly complex) impedance at its natural resonant frequency. The frequency profile of the mismatch factor \cite{Pozar_MicrowaveEngineering,best2016optimizing} \begin{equation} \tau = \frac{P_\mathrm{del}}{P_\mathrm{cm}}=\frac{4R^\mathrm{m}_\mathrm{in}R_0}{|Z_\mathrm{in}^\mathrm{m}+\Zmatch|^2} \end{equation} is nearly identical in all four cases, in agreement with the predictions based on the relatively invariant Q-factor across these cases. Here, $Z_\mathrm{in}^\mathrm{m}$ is the antenna impedance including the tuning network, $P_\mathrm{del}$ is the power delivered to the antenna, and $P_\mathrm{cm}$ is the power delivered under a conjugate match condition. It is necessary to point out that we have assumed non-dispersive matching impedances, \textit{i.e.}{}{}, $\partial \Zmatch / \partial \omega = 0$. In practice, the matching impedance may be dispersive within the band of interest, in which case the relation between Q-factor and bandwidth described in \cite{YaghjianBest_ImpedanceBandwidthAndQOfAntennas} ceases to be valid. However, inclusion of a dispersive load impedance may not necessarily cause major changes to the realized bandwidth due to the already heavily frequency-dependent nature of the impedance of high Q-factor antennas. Despite this simplification, when generating Fig.~\ref{fig:meander-realized-bandwidths}, lumped inductors and capacitors in each tuning network are modeled as frequency dependent impedances. \begin{figure} \includegraphics[width=\figwidth]{Fig6_Meander_Delivered_power} \caption{Frequency dependence of normalized power delivered \mbox{$P_\mathrm{del}/P_\mathrm{cm}$} to the meander line~studied in Figs.~\ref{fig:meander-matching-intro} and~\ref{fig:meander-complex-matching}. The separate curves correspond to devices exhibiting the three practically relevant impedances from Table~\ref{tab:impedances} and to a device with impedance corresponding to that of the meander line~at its self-resonance (\Quot{Matched}). In each case, the antenna is conjugate matched using an L-network at its self resonant frequency, $ka\approx0.479$. The $-3~\mathrm{dB}$ bandwidths $50\%$ power delivered bandwidths $B_{-3~\mathrm{dB}}$ for each scenario are also listed.} \label{fig:meander-realized-bandwidths} \end{figure} The results in Figs.~\ref{fig:meander-complex-matching} and~\ref{fig:meander-realized-bandwidths} numerically suggest that there is little cost in bandwidth to match a self-resonant antenna to arbitrary impedances. However, further considerations reveal why it is of practical importance to design an antenna with a given impedance, rather than relying on this form of matching. First, the use of lumped components increases complexity and cost of an antenna system and the required component values for the L-networks described in this section may not be realizable. Second, lumped components made of any practical, lossy material (\textit{e.g.}{}{}, metallic inductors) increase the net loss in an antenna system while not adding any potential radiation mechanism. This guarantees a decrease in overall efficiency, particularly in high Q-factor antennas~\cite{Smith_1977_TAP}. Additionally, tunability or the use of broadband multiple resonance matching may benefit from the design of an antenna with specific impedance characteristics, \textit{e.g.}{}{}, to increase the radiation resistance \cite{best2008small,Best_ElectricallySmallResonantPlanarAntennas}. \section{Radiation efficiency of Q-optimal antennas} \label{sec:Efficiency-optimization} The previous section demonstrated that meander line~antennas are nearly optimal with respect to radiation Q-factor, including the cases when matching to realistic complex impedances is desired. This section studies how these antennas perform with respect to another critical antenna metric: radiation efficiency (see Box~\ref{B:delta1}). Specifically, we examine their performance with respect to radiation efficiency bounds (see Box~\ref{B:delta2}). Before presenting the radiation efficiency of matched meander line~antennas it is necessary to deal with losses in the matching circuit since, similarly to the case of Q-factor, any matching circuit with finite losses will worsen the overall efficiency of the antenna system. Throughout this section we will assume that all matching networks are composed of lossless capacitors and lossy inductors\footnote{Q-factors of lossy capacitors are typically much higher than those of lossy inductors.}. The inductors are further assumed to be planar, made of the same material (metallic sheet, surface resistivity~$\Rsurf$) as the antenna itself. Under such restrictions it is possible to estimate the loss added by a matching network quite precisely using data from Fig.~\ref{fig:QL}, which shows the normalized reactance, $\left(10^3/ka_L\right)\left(\Rsurf/\ZVAC \right) \left(\XL / \RL \right)$, of several spiral inductors as a function of their electrical size. Here $\ZVAC$ denotes the free space impedance. The normalized reactance in Fig.~\ref{fig:QL} is independent on surface resistance $R_s$ and, at small electrical size, just weakly dependent on number of turns and frequency, consistent with classical relations for helical air-core inductors~\cite{nagaoka1909inductance}. A conservative value $\left(10^3/ka_\mathrm{L}\right)\left(\Rsurf/\ZVAC \right) \left(\XL / \RL \right) = 66$ will be used in this section to determine losses of all inductors within the L-matching network, assuming further that inductors are always ten times smaller in electrical size than the antenna, \textit{i.e.}{}{}, \mbox{$a_L=a/10$}. This last assumption enforces the use of an electrically small, approximately lumped element, matching network. \begin{figure} \includegraphics[width=\figwidth]{Fig7_Inductor_QL} \caption{Normalized reactances of selected rectangular spiral inductors. The quantities $\XL$, $\RL$, and $\Rsurf$ denote input reactance, input resistance, and surface resistance, respectively. The radius $a_\mathrm{L}$ defines the smallest sphere circumscribing the inductor.} \label{fig:QL} \end{figure} Lossy elements with the above mentioned specifications are used to match the meander studied in Figs.~\ref{fig:meander-matching-intro}--\ref{fig:meander-realized-bandwidths} to impedance $\Zmatch = 50\Ohm$ over a band of interest near the meander line 's self-resonant frequency. The resulting radiation Q-factor and efficiency (here presented in the form of dissipation factor,~$\delta$) are depicted in Fig.~\ref{fig:efficiency_explanation_1} as functions of frequency (scaled as electrical size~$ka$). The figure reiterates the previously-observed near-optimal performance of meander line~antennas with respect to radiation Q-factor, but, surprisingly, shows a rather poor performance with respect to radiation efficiency. This metric is, at the self-resonance frequency of the antenna, almost one order of magnitude worse than the value of the physical bound (see Box~\ref{B:delta2}). Similarly to radiation Q-factor, dissipation factor reaches its minimum in the vicinity of the resonance frequency, at least in the case of realistic values of matching impedances used here. \begin{figure} \includegraphics[width=\figwidth]{Fig8_Meander_matched_Optimal_params} \caption{Normalized radiation Q-factor and normalized dissipation factor of a selected meander line~antenna matched to~$50\Ohm$ over a range of frequencies (scaled here as electrical size~$ka$). The self-resonance of the antenna (\mbox{$ka=0.47$}) is denoted on each trace with a circular marker while the minimum of each trace is also marked. The same data are also plotted as a curve parameterized by frequency in Fig.~\ref{fig:efficiency_explanation_2}.} \label{fig:efficiency_explanation_1} \end{figure} Within the used normalization of dissipation factor and radiation Q-factor, it is reasonable to represent the data from Fig.~\ref{fig:efficiency_explanation_1} as a two dimensional curve (radiation Q-factor vs. dissipation factor) parametrized by frequency, see Fig.~\ref{fig:efficiency_explanation_2}. The figure also shows the Pareto front (represented by the black line) evaluated by the method from \cite{GustafssonCapekSchab_Tradeoffs2017}, which demonstrates the optimal trade-off between radiation Q-factor and dissipation factor for the given design geometry and frequency. The Pareto front has been evaluated at \mbox{$ka=0.5$}, but, due to the used normalization, it is almost independent of electrical size. The Pareto front was evaluated for a combination of TM and TE modes which, as normalized to the TM bound $\QradminTM$, gives values lower than one. The reason for this particular normalization is that TM bounds represent meaningful limit of one-port planar antennas. \begin{figure} \includegraphics[width=\figwidth]{Fig9_Meander_Pareto_vs_Optimal_Pareto} \caption{A two-dimensional view of the lower bounds on dissipation factor and radiation Q-factor. A black solid curve denotes the Pareto front describing the trade-off between these quantities and the corresponding feasible region (shaded). The data from Fig.~\ref{fig:efficiency_explanation_1} are drawn as a curve parameterized by frequency, with the relevant points in Fig.~\ref{fig:efficiency_explanation_1} being similarly marked. The circle markers along the curve representing the simulated antenna show the electrical size $ka$.} \label{fig:efficiency_explanation_2} \end{figure} The two-dimensional plot in Fig.~\ref{fig:efficiency_explanation_2} represents a complete comparison of various antenna designs with respect to matched efficiency and matched radiation {Q-factor}. An example of such comparison is shown in Fig.~\ref{fig:pareto-trade-offs}, where the normalized and frequency-parameterized $Q$--$\delta$ curves are drawn for several small antenna designs within the same design specifications\footnote{The bounding geometry, material parameters, and restrictions on matching network topology and losses are all kept constant across each design.}. Figure~\ref{fig:pareto-trade-offs} clearly presents the superior performance in efficiency and {Q-factor} of simple meander line~antennas shown in Fig.~\ref{fig:meander-parameterization} with respect to other designs. It also shows that although there exist other meander line s which perform slightly better in radiation efficiency (Palmier pastry type,~\cite{Palmier}) this improvement costs much in the radiation {Q-factor}. In conclusion, simple meander line~antennas present the best trade-off between radiation Q-factor and dissipation factor from the depicted antennas when matching to real impedances is demanded. As in the previous section, we note that the use of more advanced matching topology (\textit{e.g.}{}{}, folding or impedance transformer) may benefit from alternative antenna designs. \begin{figure} \includegraphics[width=\figwidth]{Fig10_Pareto_Fronts_vs_Optimal_Pareto} \caption{Two dimensional frequency parametrized plot representing the physical bound and several antennas. The matching impedance equals to~$50\Ohm$. The tip of each curve lies in the vicinity of resonance or anti-resonance of the antenna. The electrical sizes at the resonance or anti-resonance frequency are: A ($ka=0.48$, res.), B ($ka=0.85$, res.), C ($ka=0.50$, res.), D ($ka=0.59$, anti-res.), E (no resonance).} \label{fig:pareto-trade-offs} \end{figure} Figures~\ref{fig:efficiency_explanation_2}~and~\ref{fig:pareto-trade-offs} show that the considered antenna structures, which are close to optimal in radiation {Q-factor}, are far away from the efficiency bounds. This is puzzling since resonant modes optimal in radiation {Q-factor} and efficiency are similar in nature. However, there are important differences. Radiation {Q-factor} restricted to TM modes is minimized by separation of charges and inducing dipole like currents~\cite{GustafssonTayliEhrenborgEtAl_AntennaCurrentOptimizationUsingMatlabAndCVX}. These modes can be tuned to resonance by inducing edge loops along the structure. TM efficiency, on the other hand, is minimized by inducing homogeneous currents \cite{2018_Shahpari_TAP}. These are similar in nature to the dipole like currents minimizing {Q-factor}, but the loop currents which minimize TE {Q-factor} and maximize TE efficiency are fundamentally different. Where low {Q-factor} loops tend to be confined towards the edges of the structure, high efficiency loops are spread across the whole area~\cite[Fig.~4]{GustafssonCapekSchab_Tradeoffs2017}. Such loop currents are naturally restricted as an original simply connected object fully filling a prescribed bounding box is perforated, forcing the current distribution into more inhomogeneous forms. Thus, low {Q-factor} loops are tolerant of alterations to a structure whereas high efficiency loops are harshly disrupted. In Fig.~\ref{fig:cut_metal}, the optimal resonant {Q-factor} and dissipation factor are plotted normalized to the corresponding bounds of a rectangular plate. Data for different shapes made by removing portions of the plate are shown. The currents on the structures in Fig.~\ref{fig:cut_metal} have been calculated with current optimization without physical feeding. It is clear that removing metal does not greatly affect the achievable radiation {Q-factor}, at worst reducing it to the TM-only bound. However, when metal is removed from the plate the loss factor is significantly increased, especially for small electrical sizes. Thus, while optimal radiation {Q-factor} and radiation efficiency modes are fairly similar, removing design space has a much greater effect on the loss factor than the {Q-factor} in relation to the physical bounds. This can be seen in Fig.~\ref{fig:cut_metal} where the loss factor of the optimal resonant currents is very high for the structures with slots in them. Consider the meander line~antenna which has significantly higher loss factor at electrical sizes~\mbox{$ka<0.4$}, here the loop modes are extremely disrupted, however, the Q-factor is hardly affected. The sharp change in the meander line 's loss at around~\mbox{$ka=0.6$} is due to its resonance, where it is possible to induce a resonant dipole mode on the structure. This example illustrates a fundamental challenge in designing efficient small resonant antennas: many of the strategies normally utilized to induce resonance, such as meandering, harshly limit the achievable efficiency. \begin{figure} \includegraphics[width=1\linewidth]{Fig15_CostForShapeModification} \caption{Illustration of how much different metrics deteriorate when a solid plate is permuted. The figure shows four generic shapes, a single slot, three slots, a meander line, and a loop. The ratio between optimal loss factor for different geometries and the optimal loss factor for the full plate are shown in solid lines. The ratio between the optimal mixed mode Q-factor for the same geometries and the optimal mixed mode Q-factor of the full plate are shown in dashed lines.} \label{fig:cut_metal} \end{figure} \begin{boxexampl}[label={B:delta1}]{Radiation efficiency} The radiation efficiency of an antenna is defined as \begin{equation} \label{Box_eta} \eta = \frac{\Prad}{\Prad + \Plost} = \frac{1}{1 + \DissipF}, \end{equation} where, as in~\eqref{eq:qdef_box1a}, $\Prad$ and $\Plost$ are radiated and ohmic dissipated power, respectively, and \mbox{$\delta = \Plost/ \Prad$} is the dissipation factor~\cite{Harrington_EffectsOfAntennaSizeOnGainBWandEfficiency}. Along with bandwidth radiation efficiency is a key antenna performance parameter, particularly in electrically small systems where it is known to decrease rapidly with antenna size.\\ For objects with homogeneous loss properties, \textit{e.g.}{}{}, uniform surface resistance or conductivity, the dissipation factor~$\delta$ is a linear function of those properties. As such, values of dissipation factor can be normalized by surface resistivity for ease of comparison. \end{boxexampl} \begin{boxexampl}[label={B:delta2}]{Lower bounds to dissipation factor} Two different paradigms for minimization of dissipation factor exist. The first assumes that tuning or general impedance matching of the antenna can be performed in a lossless manner. Under this assumption, the optimal current density minimizing dissipation factor is the result of a generalized eigenvalue problem \cite{UzsokySolymar_TheoryOfSuperDirectiveLinearArrays,Harrington_EffectsOfAntennaSizeOnGainBWandEfficiency,Harrington_AntennaExcitationForMaximumGain,2018_Shahpari_TAP}. Such lower bounds were shown to scale with electrical size as $(ka)^{-2}$ and are straightforward to calculate. Their major drawback, however, is that, by neglecting matching network losses, the resulting dissipation factors are overly optimistic and unachievable by realistic designs where some form of matching is required \cite{Smith_1977_TAP}.\\ One solution to the aforementioned drawback is a paradigm in which the optimal currents are calculated while taking into account the dissipation cost of achieving resonance or general matching \cite{Smith_1977_TAP, Jelinek2018TAPCost}. Dissipation factors coming from this second paradigm are generally closer to realistic designs and scale with electrical size as~$(ka)^{-4}$ \cite{Jelinek2018TAPCost,Pfeiffer_FundamentalEfficiencyLimtisForESA,Thal2018,GustafssonCapekSchab_Tradeoffs2017}. Lower bounds to tuned dissipation factor for several selected shapes are shown in Table~\ref{Tab:Bounds}. \end{boxexampl} \section{Antennas optimal in other parameters} Determining the best possible Q-factor can be formulated as a minimization problem. Therefore it is possible to add different or additional constraints to such an optimization. So far, in this paper, we have considered the constraints of efficiency and impedance matching. Another type of constraints are different kinds of field-shaping requirements of near and/or far-fields~\cite{Gustafsson+Nordebo2013,Jonsson+etal2017b}. For small antennas it is well known that the radiated far-field tends to resemble a dipole pattern, meander line antenna treated in this paper being no exception, see Fig.~\ref{fig:radPatMeanderline}. However, with these types of Q-factor optimization procedures it is possible to determine the Q-factor cost, to have the antenna radiating with a certain front-to-back ratio or (super-) directivity in a given direction. These classes of bounds indicate that for a limited bandwidth cost it is possible to extend, \textit{e.g.}{}{}, the directivity beyond the traditional dipole pattern, see ~\cite{Gustafsson+Nordebo2013,Jonsson+etal2017b,Ferrero+etal2017,Shi+etal2017,Yaghjian+etal2008,Pigeon+etal2014,Ziolkowski+etal2013,Kim+etal2012}. \begin{figure}[h] \centering \includegraphics[width=\figwidth]{Figure17b_RadiationPatterns_Meander} \caption{Directivity (in dB scale) with respect to an isotropic radiator of a meander line antenna depicted in Fig.~\ref{fig:meander-designs-vs-qbound} as the very right inset. Antenna is placed in $x$-$z$ plane, with a longer side aligned with $z$-direction.} \label{fig:radPatMeanderline} \end{figure} \begin{figure} \includegraphics[width=\figwidth]{Fig16_QvsD_Optimality} \caption{The cost in Q-factor for a desired directivity in a lossless 2:1 shaped antenna. The three line colors represent electrical sizes \mbox{$ka=\left\{0.2,0.5,0.8\right\}$} and the radiation patterns correspond to the $ka = 0.5$ case for the optimal current. All $Q$- vs~$D$-values for the meander line s of Fig.~\ref{fig:meander-designs-vs-qbound} are represented in purple, and the relevant region is zoomed in the right bottom inset. Dashed curves show the results for an array composed of a meander line~antenna element with one feed and a loop antenna element with two feeds.} \label{fig:QvsD} \end{figure} To illustrate bounds on superdirectivity, Q-factor optimization for a given directivity described in~\cite{Gustafsson+Nordebo2013,Jonsson+etal2017b}, was solved for a small antenna with length to width ratio of 2:1, infinitesimal thickness, and electrical sizes \mbox{$ka\in\left\{0.2,0.5,0.8\right\}$}. The bounds for low directivities are identical to the lower bound on the Q-factor, where the radiation pattern changes from that of an elliptically polarized dipole with $D\approx 1.5$ to that of a Huygens source with directivity just below $D=3$ and the main beam pointing in the direction of the longest side~\cite{CapekGustafssonSchab_MinimizationOfAntennaQualityFactor}. Higher directivities require quadrupole and higher order modes which increases the Q-factor rapidly~\cite{Chu_PhysicalLimitationsOfOmniDirectAntennas}. The direction of the main beam changes from the longest side of the antenna to an endfire pattern along the shortest side at $\Qrad/\QradminTM\approx 3$ as indicated by circles in Fig.~\ref{fig:QvsD}. Much like bounds on other parameters (\textit{e.g.}{}{}, efficiency), it is an open problem if the directivity-constrained limits are reachable for all sizes and desired directivity, even under idealized lossless conditions. As a demonstration of one possible high directivity, low Q-factor design, a three port array composed of a meander line~and a loop structure with optimized feeding is presented in relation to the bounds, see Fig.~\ref{fig:QvsD}. However, high directivity for single port antennas remains, as of yet, far from the bound and new designs ideas that allow a high directivity with larger bandwidth are desired. \section{Conclusion} The possibilities how to approach the fundamental bounds on selected antenna metrics were investigated. A planar region of rectangular form factor was considered. It was observed that the lower bound on Q-factor with radiation restricted to TM modes only is closely approached by a meander line{}~antenna for a broad range of electrical sizes. The optimal design parameters were depicted and various aspect ratios of the bounding rectangle were studied together with selected ratios of the strip and slot widths. The simulated results were verified by a measurement of a fabricated prototype. The impedance matching and its impact on the Q-factor of the antenna was studied, concluding that the effect of the impedance matching on radiation Q-factor is minor and, in some cases, that matching the antenna slightly away from its self-resonance can even decrease its Q-factor. Radiation efficiency of the meander line{}~antennas optimal in Q-factor was evaluated, taking into account ohmic losses dissipated in the matching circuit. It was observed that the radiation efficiency of the studied meander line{}~antennas is far from an upper bound of a rectangular patch. Several other planar antennas were similarly evaluated against fundamental bounds yielding consistent conclusions: synthesizing antenna designs which approach the upper bound on radiation efficiency is more difficult than designing those which reach the lower bound on Q-factor. The reason was identified in the high sensitivity of radiation efficiency to the perturbation of ideal constant current density. Namely, when an initial structure fully filling the prescribed bounding box is perforated (as is done in a practical synthesis procedure), the performance of maximum efficiency current distributions drops much faster than that of a minimum \mbox{Q-factor} distribution. Finally, a Pareto-type bound between \mbox{Q-factor} and directivity has been calculated and compared to meander line{}~antennas. An attempt has been made to find an antenna with reasonably low Q-factor and directivity higher than that of an electric dipole type antenna. Nevertheless, no planar antenna with one feed fulfilling these contradictory constraints was found. This task and its feasibility remains as a subject for ongoing research. The fundamental bounds, \textit{i.e.}{}{}, the lower bounds on Q-factor, the upper bounds on radiation efficiency, the Pareto-optimality between Q-factor and efficiency, or Q-factor and directivity, were demonstrated to be powerful tools for judging the performance of the radiating devices. If the realistic designs are compared to the fundamental bounds, designer can assess how far from the optima the design is, therefore, if further improvement is needed. Furthermore, incremental progress in design improvement can be put into context by considering the remaining distance between an antenna's realized performance and the fundamental bounds. It is the normalized ratio of the actual device's performance to the fundamental bounds what reveals the real quality of the design. \bibliographystyle{IEEEtran}
\section{INTRODUCTION} \label{sec:intro} Accurate information on the magnetic field, simultaneously at different heights in the solar atmosphere is required to understand many physical processes which take place on the Sun such as explosive events (flares and CMEs), chromospheric and coronal heating, solar wind acceleration and etc. Multi-line spectropolarimetry is a powerful observational tool in remote sensing the magnetic field through Zeeman or Hanle diagnostics for this purpose. Magnetic field measurements at the photosphere have become more or less routine but a similar level of maturity is yet to be achieved with respect to the measurements of the chromospheric magnetic fields\cite{lagg15}. Some of the reasons are the polarization signal in the spectral lines formed in the chromosphere is low (in the order of $10^{-3}$ or less) and interpreting the measurements is challenging as NLTE effects have to be taken into account while modeling the spectral lines\cite{delacruzrodriguez17}. In ground based observations seeing induced spurious polarization is a major obstacle in achieving high precision in polarization measurements. This also known as seeing induced cross-talk \cite{lites87} is caused when consecutive measurements are combined to get the Stokes parameters. A dual-beam setup, in which orthogonally polarized beams are recorded simultaneously on two different detectors or on two different pixels of the same detector, is widely being used for reducing the seeing induced cross-talk. However, dual-beam polarimetry suffers from differential gain effects which is limiting the polarimetric sensitivity to $\approx 10^{-3}$ \cite{snik14}. Moreover, dual-beam setup only helps in reducing the cross-talk from Stokes-$I$ to Stokes-$Q$, $U$ and $V$ and the cross-talk among Stokes~$Q$, $U$ and $V$ still remains. Another way of reducing seeing induced cross-talk is to carry out the measurements with fast modulation. Increase in modulation frequency systematically reduces seeing induced cross-talk \cite{lites87,krishnappa12}. Various modulators are being used such as Piezo-elastic modulators, Liquid Crystal Variable Retarders (LCVRs), Ferro-electric Liquid Crystals (FLCs) as well as rotating waveplate towards achieving fast modulation. Each of these modulators have their own pros and cons (see for e.g. \citenum{snik14}). \citenum{golovin03} and \citenum{Nie06} have shown that the Dual-Frequency Liquid Crystals (DFLCs) can be used as electrically switchable retarders by switching the LC drive frequency. We, in this paper explore DFLCs as potential fast modulators in the context of full Stokes polarimetry. Some of the properties of DFLCs' that motivated us to explore them as modulators are: 1. They switch faster than conventional LCVRs, 2. Unlike FLCs their apertures can be quite large. FLC sizes are limited because they are vulnerable to mechanical stresses which cause defects across the aperture of FLC. \section{Some of the relevent properties of DFLCs as polarization modulators} Dual-frequency liquid crystals are a type of nematic liquid crystals in which the dielectric anisotropy changes from positive to negative when the frequency of externally applied voltage pulses changes from $f<f_c$ to $f>f_c$\cite{schadt82}. The dielectric anisotropy is defined as the difference in permittivity ($\epsilon$) in parallel and perpendicular directions to the crystal director {$\boldsymbol n$}, i.e. ($\Delta\epsilon=\epsilon_{\parallel}-\epsilon_{\bot}$). The cross-over frequency '$f_c$' is the drive frequency of an externally applied voltage at which $\Delta\epsilon=0$. The crystal director '$\boldsymbol{n}$' aligns itself in the direction of the externally applied electric field when $\Delta\epsilon$ is positive (when $f<f_c$) and perpendicular to it when $\Delta\epsilon$ is negative (when $f>f_c$). This process of switching is demonstrated in a block diagram shown in Fig.~\ref{fig:LCcell}. For reference, a coordinate system is shown on the right side of the figure. The schematic shows that the LC material is sandwiched between two ITO coated glass plates and the rubbing on the glass plates is assumed to be in the X-direction so that the long axes of the LC molecules are in the X-direction. Here we don't assume any pre-tilt angle which is normally used for increasing the switching speed. The light propagation direction is assumed to be in the Z-direction which is same as the direction of externally applied electric field. The LC configuration in the top panel shows the condition in which the externally applied voltage has a frequency $f>f_c$ and the long axes of the molecules are arranged perpendicular to the externally applied electric field '$\boldsymbol{E}$'. The bottom cell shows the condition in which $f<f_c$ and the long axes of molecules are arranged parallel to ${\boldsymbol E}$. \begin{figure} [ht] \begin{center} \includegraphics[height=16cm,angle=-90]{DFLC_Cell_BlockDiag.pdf} \end{center} \caption[example] { \label{fig:LCcell} A block diagram showing LC crystal cells in which the LC molecules are arranged perpendicular to the externally applied electric field $\boldsymbol{E}$ when $f>f_c$ and parallel to it when $f<f_c$. For reference a cartesian coordinate system is shown on the right side of the figure. The externally applied voltage is in the Z-direction, which is same as the light propagation direction.} \end{figure} For the crystal configuration shown in Fig.~\ref{fig:LCcell} and the light propagating in the Z-direction, the crystal acts like a waveplate when $f>f_c$ and as a simple transparent glass plate when $f<f_c$. A finite phase delay between the X- and Y-components of the electric vector of the light beam is introduced in the former condition and no phase delay in the later condition. When the crystal molecules are aligned in the direction of light propagation direction, light sees azimuthally symmetric molecular structure hence there is no phase delay and the LC cell acts like a simple transparent medium. The case in which LC molecules are aligned perpendicular to the beam direction, there is a finite phase delay introduced between the X- and Y- components of the electric vector of the light beam as the molecules are aligned in the X-direction which causes azimuthal asymmetry. This property makes DFLC acts like a retarder when $f>f_c$. We would like to note here that in practical terms we will not achieve zero retardance when $f<f_c$ because not all the molecules will align in the direction of electric field. Because of strong surface anchoring the molecules close to the surface of the glass plates may not switch their direction. Apart from this LC molecules mayn't be fully azimuthally symmetric. However, in the following we assume ideal behaviour of DFLCs to design a modulator. \section{Polarization modulator based on DFLCs} As we have seen in the previous section that the DFLCs offer finite retardance in the off state ($f>f_c$) and no phase delay in the on state ($f<f_c$). For full Stokes polarimetry we require a minimum of two DFLCs, as in combination they provide four distinct states of modulation which enables us to obtain four independent intensity measurements. Minimum of four intensity measurements are required to derive four Stokes parameters. Since, DFLCs offer no retardance in their on states we are required to use additional waveplates in order to workout a balanced modulation scheme with a minimum number of modulation steps. The modulator we propose is based on two DFLCs interlaced between two static retarders. The static in the current context means the retardance of a given retarder is fixed. A schematic of the polarization modulator is shown in Fig.~\ref{fig:modsch}. In this setup we have chosen DFLC1 and DFLC2 as half-waveplates and SR1 and SR2 as quarter-waveplates. The position angles of SR1, DFLC1, SR2 and DFLC2 are 45, 45, 22.5 and 67.5 DEGREES, respectively. The position of DFLC1 and SR1 in the beam can be interchanged which doesn't make any difference to the modulation scheme. On the other hand the positions of the DFLC2 and SR2 can not be interchanged. \begin{figure} [ht] \begin{center} \includegraphics[height=17cm,angle=-90]{modulatorsetup.pdf} \end{center} \caption[example] { \label{fig:modsch} Schematic of a modulator based on two DFLCs and two static retarders followed by a polarization analyzer. SR1 and SR2 are the static retarders and P represent the polarization analyzer.} \end{figure} The modulation scheme for the modulator setup (shown in Fig.~\ref{fig:modsch}) is given in Table~\ref{tab:modsch}. In this scheme Stokes-$U$ and $V$ have same weightage and Stokes-$Q$ has slightly higher weightage. If we choose SR2 as half-waveplate instead of a quarter-waveplate then weights of $Q$ and $V$ will be interchanged. \begin{table}[ht] \begin{center} \begin{tabular}{|l|l|l|} \hline \rule[-1ex]{0pt}{3.5ex} DFLC1 & DFLC2 & Modulated Intensity \\ \hline \rule[-1ex]{0pt}{3.5ex}$f1<f_c$, $\delta=0$ & $f2>f_c$,$\delta=\pi$ & $I_1=I-0.7Q-0.5U+0.5V$ \\ \hline \rule[-1ex]{0pt}{3.5ex}$f1>f_c$, $\delta=\pi$ & $f2>f_c$,$\delta=\pi$ & $I_2=I+0.7Q-0.5U-0.5V$ \\ \hline \rule[-1ex]{0pt}{3.5ex}$f1>f_c$, $\delta=\pi$ & $f2<f_c$,$\delta=0$ & $I_1=I+0.7Q+0.5U+0.5V$ \\ \hline \rule[-1ex]{0pt}{3.5ex}$f1<f_c$, $\delta=0$ & $f2<f_c$,$\delta=0$ & $I_1=I-0.7Q+0.5U-0.5V$ \\ \hline \end{tabular} \caption{Table showing a modulation scheme based on switching the drive frequencies of the DFLCs. In the above setup we have chosen DFLC1 and DFLC2 as half-waveplates and SR1 and SR2 as quarter-waveplates. The position angles of SR1, DFLC1, SR2 and DFLC2 are 45, 45, 22.5 and 67.5 DEGREES, respectively. $f1$ and $f2$ are the drive frequencies and $f_c$ is a criticial frequency for a given DFLC. If we choose SR2 as half-waveplate instead of a quarter-waveplate then efficiencies of $Q$ and $V$ will be interchanged.} \label{tab:modsch} \end{center} \end{table} \subsection{Polarimetric efficiency} In Mueller matrix formalism, any polarization optics can be expressed as a $4\times4$ matrix. The modified Stokes vector can be written as \begin{equation} S_{out} = {\boldsymbol M} S_{in}, \end{equation} where, $S=[I,Q,U,V]^T$ is a Stokes vector with the subscript $_{in}$ and $_{out}$ representing the input and output beams and $\boldsymbol{M}$ is the Mueller matrix of the optical component. The optical detectors are sensitive only to the first element of $S_{out}$. Hence only the first row of the Mueller matrix $\boldsymbol{M}$ is relevant. In order to measure four Stokes parameters we need a minimum of four intensity measurements with different configurations of the modulator. The modulated intensities are related to the input Stokes vector through \cite{delToroIniesta03} \begin{equation} I' = {\boldsymbol O} S_{in}, \end{equation} where $I'=[I_1,I_2...I_m]^T$, with $^T$ representing transpose operation, are the modulated intensities corresponding to $m$ modulation steps. ${\boldsymbol O}$ is a $m\times4$ array called as modulation matrix. The optimal demodulation matrix is the Moore-Penrose pseudo-inverse of the modulation matrix ${\boldsymbol O}$\cite{delToroIniesta00}, \begin{eqnarray} S_{in} &=& {\boldsymbol D} ~I':\\\nonumber {\boldsymbol D} &=& \left({\boldsymbol O}^T {\boldsymbol O}\right)^{-1}{\boldsymbol O}^T. \end{eqnarray} The polarization efficiencies are defined as \begin{equation} \epsilon_k = \left(n \sum_{l=1}^n {\boldsymbol D}^2_{kl}\right)^{-1/2}. \end{equation} The efficiencies are such that \begin{equation} \epsilon_1\le 1, ~\sum_{k=2}^4 \epsilon_k^2 \le 1. \end{equation} The modulation matrix corresponding to the modulation scheme described in Table~\ref{tab:modsch} is given by \begin{equation} O= \begin{pmatrix} 1 & -0.7 & -0.5 & 0.5 \\ 1 & 0.7 & -0.5 & -0.5 \\ 1 & 0.7 & +0.5 & 0.5 \\ 1 & -0.7 & +0.5 & -0.5 \\ \end{pmatrix}. \end{equation} The corresponding efficiencies are $(\epsilon_{Q},\epsilon_U,\epsilon_V)=(0.7,0.5,0.5)$. The efficiencies of $Q$ and $V$ can be interchanged by choosing SR2 as a half-waveplate instead of a quarter-waveplate. \section{Polychromatic modulator} As we have seen in the previous section that the modulator efficiencies of Stokes-$Q$, $U$ and $V$ are not fully balanced. Apart from this, because of the chromatic nature of the modulator optics the polarimetric efficiencies are wavelength dependent. Plots of the efficiencies of Stokes parameters as a function of wavelength are shown in Fig.~\ref{fig:plotseff} for the modulator setup described in Fig.~\ref{fig:modsch} and Table~\ref{tab:modsch}. The design wavelength is at 700~nm. The dashed curves correspond to the efficiencies for the angles and the retardances of the modulator optics as given in Table~\ref{tab:modsch} at the design wavelength. The retardances at other wavelengths are calculated under the assumption that the retardance is inversely proportional to the wavelength (i.e. $\delta \propto 1/\lambda)$. \begin{figure} [ht] \begin{center} \includegraphics[height=16cm,angle=-90]{plots_DFLC_eff_600-900nm_comp.pdf} \end{center} \caption[example] { \label{fig:plotseff} Plots of polarimetric efficiencies of Stokes parameters as a function of wavelength in the range from 600-900~nm. The design wavelength is 700~nm. The dotted lines correspond to the efficiencies without optimisation. The solid curves correspond to the efficiencies with both position angles and the retardances of the modulator optics are optimized. The dotted curves correspond to the case for which only the position angles optimized.} \end{figure} It has been shown in the past for other modulators based on for e.g. FLCs \cite{gisler03,tomczyk10}, static retarders \cite{snik14} and others that the efficiencies can be achromatized by appropriately choosing the position angles and/or the retardances of the modulator optics. Finding optimum position angles and/or retardances is an optimization process. In this work we have also explored whether such a possibility exists for the modulator discussed in this paper or not. As a first step towards this optimization we tried to find optimum position angles which provide more or less uniform efficiencies in the wavelength range 600-900~nm. For finding the optimum position angles we adopted a direct search method. Which means we systematically searched for the combination of position angles of the four modulator optics in the range from $0-180^o$ in steps of $5^o$ using a computer program written in IDL. While searching we have used the constraints provided by two merit functions as defined below \cite{snik12}. \begin{equation} \label{eq:merita} \Delta\epsilon_a =\left< \sqrt{\left( \frac{1}{\sqrt{3}}-\epsilon_Q(\lambda) \right)^2 + \left(\frac{1}{\sqrt{3}}-\epsilon_Q(\lambda) \right)^2 + \left(\frac{1}{\sqrt{3}}-\epsilon_Q(\lambda) \right)^2 } \right>_{\lambda}, \end{equation} where $\left<...\right>_\lambda$ denotes spectral averaging and \begin{equation} \label{eq:meritb} \epsilon_b = \mathrm{max}\left(1-\sqrt(3) \mathrm{min}(\epsilon_Q(\lambda),\epsilon_U(\lambda),\epsilon_V(\lambda))\right). \end{equation} We have used the constraints that $\Delta\epsilon_a\le 0.1$ implying the variation in the efficiency of any of Stokes parameters does not exceed $10\%$ within the wavelength range considered and $\Delta\epsilon_a\le 0.3$ implying that the efficiency of each of the Stokes parameters is always $\ge 40\%$. In a similar way we searched simultaneously for optimum position angles and retardances using the above constraints. Plots of efficiencies as a function of wavelength when only the position angles are optimized as well as when both position angles and retardances are optimized are shown in Fig.~\ref{fig:plotseff}. The dotted curves correspond to the case for which only the angles are optimised and the solid curves correspond to the case for which both position angles-retardances are optimised. As we can see in these plots with optimization of angles and retardances the efficiencies approach achromaticity. This is quantified in the Table.~\ref{tab:meritfunct}. The variation in the efficiencies is less than 10\% and the efficiencies are always above 40\% when the position angles and retardances are optimized, where as the variation in efficiency is as large as 20\% and the efficiency drops below 30\% when there is no optimization. The case in which both position angles and retardances are optimized is not very different from when only the position angles are optmized. However, when we consider wider wavelength range we may see substantial difference. \begin{table}[ht] \begin{center} \begin{tabular}{|l|l|l|} \hline \rule[-1ex]{0pt}{3.5ex} Cases & $\Delta\epsilon_a$ & $\Delta\epsilon_b$ \\ \hline \rule[-1ex]{0pt}{3.5ex} 1 & 0.21 & 0.5 \\ \hline \rule[-1ex]{0pt}{3.5ex} 2 &0.08 & 0.29 \\ \hline \rule[-1ex]{0pt}{3.5ex} 3 &0.09 & 0.26 \\ \hline \end{tabular} \caption{Values of merit functions as described in Eqs.~\ref{eq:merita}-\ref{eq:meritb} for the cases when no optimization (Case 1), with angles only optimized (Case 2) and with both angles and retardances are optimized (Case 3).} \label{tab:meritfunct} \end{center} \end{table} \section{Conclusions} Keeping in view of the potential application of DFLCs in polarimetry as they switch faster than the conventional LCVRs and the apertures can be much larger than the FLCs, a full Stokes polarization modulator based on DFLCs has been worked out. The proposed modulator has two DFLCs interlaced between two static retarders. The modulation scheme presented in this paper is very close to a balanced scheme with 70\% efficiency for Stokes-$Q$ and 50\% efficiency for Stokes-$U$ and $V$. While working out a modulation scheme we have assumed that the retardance of a DFLC varies between 0 (for $f<f_c$) and a finite value ($\delta$: for $f>f_c$). In practice, the molecules close to the surface may not switch completely due to strong anchoring to the substrate plates because of which the retardance may not be completely zero. While designing a modulator this aspect has to be taken into account. A polychromatic design of the modulator based on DFLCs has been presented. It has been found that by optimizing the position angles and the retardances, it is possible to achieve a polychromatic modulator very similar to those based on FLCs \cite{gisler03,tomczyk10} or multiple waveplates \cite{snik12}. The optimization method, which is a direct search method, presented in this paper is very time consuming. We are in the process of adopting a more efficient method for finding the optimum position angles and the retardances of modulator optics.
\section{Introduction} Wave turbulence is a generic class of systems in which a large number of waves coupled through nonlinearity evolve into a complex statistical state. The most natural physical system in which wave turbulence occurs is that of water waves at the surface of the ocean: Waves are forced by the wind and once their amplitude is large enough they develop a wideband spectrum. Depending on the strength of nonlinearity, various scaling behaviors of the spectrum have been reported (see for instance recent field measurements in \cite{Leckler,Lenain}). In the limit of weak nonlinearity a statistical theory named Weak Turbulence Theory (WTT) has been developed by Hasselman~\cite{Hasselmann} that allows to predict the evolution equation of the wave spectrum and to exhibit its stationary solutions (following works of Zakharov in particular~\cite{R1,Nazarenko,newell_wave_2011}). The WTT has been applied to a large number of other systems such as inertial waves in astrophysical or geophysical flows, magnetized plasmas, optics in non linear media, superfluid turbulence, among others \cite{Galtier,Scott,R1,laurie2012one,R16}. In all these systems waves are dispersive which means that waves at different frequencies propagate at different velocities. As in the WTT the non linear coupling is assumed to occur through N-wave resonances ($N\geq 3$), the dispersive character of the waves enables non trivial solutions of the resonance equations such as \begin{equation} \omega_1=\omega_2+\omega_3, \quad \quad \mathbf k_1=\mathbf k_2+\mathbf k_3 \end{equation} in the case $N=3$ ($\omega_i$ are angular frequencies and $\mathbf k_i$ are wavevectors). The question of what may happen for non dispersive waves is largely open and depends most likely on the details of the nonlinear coupling. Indeed for non dispersive waves, the only resonant solutions for 3-wave coupling is through waves propagating in the same direction. Thus the waves may develop shocks by a cumulative effect of the nonlinearity as is the case for acoustic waves for instance \cite{aucoin,acustictur}. In the case of water waves at the surface of shallow water, when the waves are both weakly dispersive and weakly nonlinear, solitons can be observed rather than the interplay of free dispersive waves that is expected in the WTT. When reducing the depth of water, a transition from WTT to a solitonic regime could be observed experimentally~\cite{hassaini2017transition}. A question is whether a similar transition would occur for other systems. Weak turbulence was predicted for instance for gravitational waves in the early universe~\cite{Galtier:2017hi}. In that case waves are non dispersive and the coupling occurs through 4-wave interaction. A regime of weak turbulence is predicted nonetheless although no validation through numerical simulations (let alone experiments !) has been reported to our knowledge. Here we focus on a distinct physical system which provides a paradigm for studying the transition non dispersive wave turbulence by means of both experimental realizations and computational studies: the elastic plate under tension. The elastic plate is a rich physical system for wave turbulence which has been the object of a growing interest~\cite{during,Boudaoud,R19,Yokoyama1,Yokoyama2,Humbert,Ducceschi,platesPhysD,Mordant:2017bh,During:2018jc}. A shaken metal plate has been used for centuries to mimic the thunder noise in theaters~\cite{R17} and in the first half of the 20th century as a reverberator for analog signal processing~\cite{arcasICA07}. Beyond these somewhat specialized applications, the vibrating plate has become recently a privileged model for wave turbulence. Indeed, advanced measurement resolved in both space and time are possible experimentally~\cite{R19} and its 2D character facilitates long numerical simulations~\cite{during,miquel_role_2014,Ducceschi} (by contrast with substantially more challenging 3D fluid systems, for instance). It was used to validate numerically the WTT prediction~\cite{during,miquel_role_2014}, to investigate the effect of wideband dissipation~\cite{miquel_role_2014,Humbert}, the impact of finite size~\cite{epjb} or the strongly nonlinear regime~\cite{Yokoyama1,Yokoyama2,miquel2013transition,Mordant:2017bh}. Thereafter, we consider the addition of tension to elastic plates plate as a tuning parameter for the dispersive character of the waves. When tension is increased to the point that it dominates over bending stiffness as a restoring force for wave motions, the plate starts to behave like a membrane for which the waves are non dispersive. A thin elastic plate without tension can be modeled by the F\"oppl-von Karman equations \cite{foppl,vk,landau} for the amplitude of the deformation $\zeta(x,y,t)$ of the plate and for the Airy stress function $\chi(x,y,t)$: \begin{eqnarray} \rho\frac{\partial^2 \zeta}{\partial t^2} &=& - \frac{Eh^2}{12(1-\mu^2)}\Delta^2\zeta + \{\zeta,\chi\} ; \label{foppl0}\\ \Delta^2\chi &=&- \frac{E}{2}\{\zeta,\zeta\}, \label{foppl1} \end{eqnarray} where $h$ is the thickness of the elastic sheet. The material has a mass density $\rho$, a Young modulus $E$ and its Poisson ratio is $\mu$. $h$ is the thickness of the plate. $\Delta=\partial_{xx}+\partial_{yy}$ is the usual Laplacian and the bracket $\{\cdot,\cdot\}$ is defined by $\{f,g\}\equiv f_{xx}g_{yy}+f_{yy}g_{xx}-2f_{xy}g_{xy}$. Equation (\ref{foppl1}) for the Airy stress function $\chi(x,y,t)$ may be seen as the compatibility equation for the in--plane stress tensor: In the derivation the inertia of the in-plane modes of oscillations is neglected, or, in other words, it is assumed that the in-plane displacements are negligible, hence equation (\ref{foppl1}) follows the dynamics. An isotropic external tension can be added to the elastic plate considering an isotropic in plane stress given via a boundary condition for the Airy function $\chi(x,y) = \frac{T}{2h}(x^2+y^2),$ where $T$ is the tension per unit length at infinity ($T$ is applied at the boundaries in practice). Then the Airy function can be separated in two terms $\chi \rightarrow \frac{T}{2h}(x^2+y^2) +\chi(x,y) $ in which the first comes from the external tension while the second comes from the amplitude deformation. The F\"oppl--von K\'arm\'an equations (\ref{foppl0}) for a plate under tension then reads \begin{eqnarray} \rho\frac{\partial^2 \zeta}{\partial t^2} &=& - \frac{Eh^2}{12(1-\mu^2)}\Delta^2\zeta + \{\zeta,\chi\} + \frac{T}{h} \Delta \zeta , \label{fopplTension} \end{eqnarray} and equation (\ref{foppl1}) remains unchanged. In the linear limit, waves follow the dispersion relation \begin{equation} \omega_{\bf k} = \left( \frac{h^2E}{12(1-\mu^2)\rho} k^4 + \frac{T}{\rho h} k^2 \right)^{1/2}. \label{dispersion.tension} \end{equation} This reasoning can be generalized to the case of anisotropic tension, which we study experimentally. Denoting $T_x$ and $T_y$ the tension per unit length at infinity along the $x$ and $y$ direction, respectively, the governing equation (\ref{fopplTension}) yields: \begin{equation} \rho\frac{\partial^2 \zeta}{\partial t^2} = - \frac{Eh^2}{12(1-\mu^2)}\Delta^2\zeta + \{\zeta,\chi\} + \frac{1}{h}\left(T_x\partial_{xx}+T_y\partial_{yy}\right) \zeta \, , \label{fopplTensionAnisotropic} \end{equation} and the corresponding dispersion relation becomes: \begin{equation} \omega_{\bf k} = \left( \frac{h^2E}{12(1-\mu^2)\rho} k^4 + \frac{1}{\rho h} \left[T_xk_x^2 + T_yk_y^2\right]\right)^{1/2}. \label{dispersion.tensionAnisotropic} \end{equation} For zero tension ($T=0$), i.e. for pure bending, the dispersion relation simplifies into \begin{equation} \omega_{\bf k} = \sqrt{\frac{h^2E}{12(1-\mu^2)\rho}} k^2=Ck^2\, , \label{rdnotens} \end{equation} with $C^2=\frac{h^2E}{12(1-\mu^2)\rho}$. These waves are dispersive, thus the WTT formalism could be used and yielded predictions for the wave spectra~\cite{during}. These predictions have been verified numerically~\cite{during} but not experimentally due to the presence of wideband dissipation that alters the predicted scaling as dissipation is not taken into account in the theory~\cite{Boudaoud,R19,Humbert,miquel_role_2014}. In the opposite limit of no bending stiffness ($E=0$), and in the case of isotropic tension, the dispersion relation changes into \begin{equation} \omega_{\bf k} = \sqrt{\frac{T}{\rho h}} k \,. \end{equation} This dispersion relation is now non dispersive but the nonlinear term remains the same. Thus by tuning the value of the tension $T$ and/or the thickness $h$ one can change the system into pure flexion wave or into a membrane without rigidity as in drums and study the evolution of the statistical properties of this new system. The crossover between both extreme cases occurs when both contributions are equal, i.e. \begin{equation} k_c=\sqrt{\frac{12 T (1-\mu^2)}{h^3E}} \textrm{ or } \omega_c=\sqrt{\frac{24T^2(1-\mu^2)}{\rho h^4E}} \label{cross} \end{equation} This is somehow analogous to the transition between shallow to deep water regimes for water surface waves that occurs when $kd\approx 1$ ($d$ being the water depth)~\cite{Guyon}. Our goal is to investigate if the system remains into a regime of weak turbulence when increasing the effect of tension (i.e. when $k_c$ increases). Indeed, the waves being weakly non dispersive to non dispersive the system could evolve into a distinct state involving localized structures such as solitons (as for water waves) or shocks (as for acoustics). Note that we remain in a weakly nonlinear regime so that to avoid the creation of singular structures such as developable cones that have been reported in plates at strong level of nonlinearity~\cite{miquel2013transition,Mordant:2017bh}. Thus we try to answer the question of Newell and Rumpf\cite{newell_wave_2011}: by aiming towards a non dispersive system, will the non-linear interactions redistribute the energy isotropically or will it be focused in shock waves? In the next section we describe the experiment and the numerical simulations used in this article. In section~\ref{prestre} we first investigate the effect of adding a tension to a plate.As weak wave turbulence has been reported in a vibrating plate, thus we start from such a state and analyse the effect of increasing the tension in a plate either experimentally or numerically. In section~\ref{pure}, we report the application of WTT to the case of a pure membrane with strictly no bending stiffness and finally we use numerical simulations to compare the statistics of a vibrating membrane to the theoretical predictions. \section{Methods} \subsection{Description of the experiment} \begin{figure}[!htb] \includegraphics[clip,width=6cm]{thin_plate-eps-converted-to.pdf} \caption{Experimental set-up. A $1.9\times 1$~m$^2$, 0.5~mm-thick steel plate is stretched vertically. Vibrations are generated by an electromagnetic shaker at the bottom of the plate. The deformation is measured by the Fourier Transform Profilometry technique in which a pattern is projected on the plate and recorded by a high speed camera (see text for details).} \label{setup} \end{figure} The experimental set-up is composed of a $1\times1.9$~m$^2$ stainless steel plate, $h=0.5$~mm-thick. The physical parameters are $E\approx 2\, 10^{11}$~Pa, $\mu\approx0.3$, $\rho\approx7800$~kg/m$^3$. The plate is attached at its top to a rigid frame (fig.~\ref{setup}). Tension can be added by using left-right threaded studs at the bottom. The tension is thus only along the long axis of the plate for reasons of simplicity: in other words, we may vary the tension along the vertical direction $T_x$ while the transverse tension $T_y$ stays zero. The tension $T_x$ is tuned by first stretching the plate to some level given by two force gauges. A second set of studs is then tightened so that to vanish exactly the tension from the force gauges. The gauges are then uncoupled from the plate to preserve them from the strong vibrations of the plate during experiments. Vibrations are generated by an electromagnetic shaker oscillating sinusoidally at a 30~Hz frequency in the direction normal to the plate and bolted to the plate 30 cm above its bottom. Fourier transform profilometry is used to measure the deformation of the plate with both space and time resolution following the scheme developed by Cobelli et al.~\cite{cobelli_space-time_2009}. It consists in projecting a sinusoidal grayscale pattern with a video-projector on a $0.8\times1.40$~m$^2$ region centered in the plate (painted in white). When the waves propagate, the initial pattern is deformed. This distortion is recorded by a high speed camera at a frequency of 8000 frames/s and with a resolution of $704\times1024$ pixels$^{2}$. A geometrical analysis permits a phase inversion of the images and the reconstruction of the wave field~\cite{Cobelli1,R22}. The images are recorded once a statistically stationary regime is reached which takes only a few seconds. Experiments are repeated to increase the amount of data and to achieve a good convergence in the statistical properties measured. \subsection{Numerical simulations} \label{DNS} We complement the experimental measurements with numerical solutions to the augmented F\"oppl-Von Karman equations (aFVKE). We write down the projection of Eq.~(\ref{fopplTensionAnisotropic}) in Fourier space for a wave vector $\mathbf{k}$: \begin{equation} \partial_{tt}\zeta_{\mathbf k} = -C^{2}k^{4}\zeta_{\mathbf k} - (T_xk_x^2+T_yk_y^2)\zeta_{\mathbf k} + \frac{1}{\rho}\{\zeta,\chi\}_{\mathbf k} + \mathcal F_{\mathbf k} + \mathcal D_{\mathbf k} \label{FvK_fourier} \end{equation} where $\mathcal{F}_{\mathbf k}$ and $\mathcal{D}_{\mathbf k}$ are the forcing and dissipative terms in spectral space, respectively. We recall the reader that we allow for anisotropic tension ($T_x\neq T_y$) which pertains to the experimental setup. This equation is studied by means of two distinct pseudo-spectral algorithms, documented in this section, depending on the presence of rigidity (i.e., the case of stretched plates with finite $k_c$) or its absence (i.e., the case of membranes with $k_c\rightarrow\infty$). Both the Stretched Plate Code (\textsc{spc}~below) and the Membrane Code (\textsc{mc}~below) employ a Fourier decomposition of the variables $\zeta$ and $\chi$ and implement periodic boundary conditions, which differ from the experimental boundary conditions. However, the impact of boundary conditions on the wave state has been shown to be marginal~\cite{miquel_role_2014}, provided that the size of the domain is significantly larger than the forcing wavelength. We thus have confidence in the ability of the simulations reported thereafter to capture the meaningful statistical properties of the experimental wave field. Both codes evaluate the non linear terms in physical space, and fields are fully dealiased. We present below the particulars of the \textsc{spc}~and \textsc{mc}~codes which differ in their time-stepping method, and in the forcing and dissipation employed. \subsubsection{The Stretched Plate code} The Stretched Plate Code (\textsc{spc}) is an evolution of the code previously used in~\cite{miquel2013transition,miquel_role_2014,miquel_nonlinear_2011}. The timestepping of Eq.~\ref{FvK_fourier} is done by means of the second order exponential time-differencing ETD2RK scheme of Cox and Matthews \cite{cox2002exponential}. The code has been developed in view of providing a way to bridge the gap between imperfect experimental realizations of wave turbulence and the ideal hypotheses of the weak turbulence theory. For instance, the code implements the possibility to modify independently the tension along the two directions $T_x$ and $T_y$. This offers the possibility to reproduce the anisotropic tension present in the experiments where the transverse tension vanishes: $T_y=0$. A similar approach is adopted with dissipation. As reported by Miquel and Mordant~\cite{miquel_nonlinear_2011}, the experimental dissipation can be modelled with a linear damping $\mathcal D_{\mathbf k}=- \gamma_{k} \partial_t\zeta_{\mathbf k}$, where $\gamma_{k}$ has the analytic form: \begin{equation} \gamma_{k}^{exp} = \gamma_{1} + \gamma_{2}k^{2}\,. \label{eq:gamma_exp} \end{equation} In absence of tension, Miquel et al.~\cite{miquel_role_2014} reported that this expression of the dissipation, where the parameters $\gamma_{1}$ and $\gamma_{2}$ are obtained by fitting the experimental data, could reproduce qualitatively the experimental spectra of elastic wave turbulence. Thereafter, we refer to this case as the ``experimental dissipation". This dissipation is much different from the ideal dissipation considered in the weak turbulence theory, which assumes the existence of a transparency window of wave numbers where damping vanishes and, consequently, energy is conservatively transferred. Indeed, it has been shown in~\cite{miquel_role_2014} that the theoretical scaling predicted by the theory is recovered when the dissipation rate is set to zero within a wave number interval $[k_l,k_h]$. In the following, ``ideal dissipation'' refers to a damping coefficient following Eq.~\ref{eq:gamma_exp}, except between $k_{l} = 5$~m$^{-1}$ and $k_{h}=240$~m$^{-1}$ where it is set to zero. We adopt a forcing that differs from the spatially localized, harmonic, experimental forcing. We force resonantly a crown of modes $\mathbf{k}$ at their linear frequency $\omega_{k}$: \begin{equation} \mathcal F_{\mathbf k}(t) = F_{0}e^{-\frac{k-k_{0}}{2\nu_{k}^{2}}}e^{i\varphi_{k}}cos(\omega_{k}t + \phi_{k})\, . \end{equation} The crown of forced wave numbers is centered around $k_{0}=5\pi$~m$^{-1}$, with a width $\sigma_{k}=2\pi $~m$^{-1}$. Random phases $\phi_{k}$ and $\varphi_{k}$ are introduced to obtain a disordered forcing. The spatial resolution is moderate ($288^2$) so that the simulations can be run to obtain long time series, up to the equivalent of 300 seconds of experiments for the longest ones. As in experiments, the deformation and the vertical velocity are recorded in time for subsequent spectral analysis. \subsubsection{The Membrane code} We complement the previous numerical simulation with simulations at higher resolution from a second pseudo-spectral code, parallelized using GPU computing. We integrate the F\"oppl--von K\'arm\'an equations~(\ref{fopplTensionAnisotropic}) in their dimensionless form and in the limit of pure tension (E=0) which corresponds to a non dispersive membrane. By contrast with the Stretched Plane code described above, the Membrane code implements a random forcing and some hyperviscous dissipation. In Fourier space, Eq.~(\ref{FvK_fourier}) becomes: \begin{equation} \partial_{tt}\zeta_{\mathbf k} = - \frac{1}{4}k^2\zeta_{\mathbf k} + \frac{1}{\rho}\{\zeta,\chi\}_{\mathbf k} + \mathcal F_{\mathbf k} -\nu_0 k^\alpha \partial_t \zeta_\mathbf{k} \label{FvK_fourier_dimless} \end{equation} where $\nu_0$ and $\mathcal{F}_\mathbf{k}(t)$ are the rescaled damping coefficient and rescaled external forcing, respectively. We supply the system with periodic boundary conditions in a square domain of size $2\pi$. The forcing $\mathcal F_{\mathbf k}$ is white-noise in time of variance $f_0^2$ and its Fourier modes are non-zero only for wave-vectors $k_i<|{\bf k}|\le k_f$. A standard second-order Runge-Kutta time-stepping scheme is implemented. De-aliasing is made by using the standard $2/3$-rule \cite{gottlieb1977numerical}, that is applied after computing each quadratic term. The largest wavenumber is $k_{\rm max}=N/3$, where $N$ is the resolution. In numerics we set an hyperviscous dissipation with $\alpha=6$. Two resolutions were used; $N=1024^{2}$ and $N=512^{2}$. The main parameters of experiments and numerical simulations are given in table~\ref{tableau}. \begin{table*}[!htb] \center \begin{tabular}{c|c|c|c|c|c|c|c|m{1cm}} description & name & $C^2$ & $T$(kN/m) & $\omega_c$ & $k_c$ & $N$ & dissipation & forcing scale\\ \hline exp. stretched plate & E1 &$C^2_{exp}$ & $T_x=4$, $T_y=0$ & 290~Hz, $10\,\omega_f$ & $7k_f$ & & &large\\ exp. stretched plate & E2 &$C^2_{exp}$ & $T_x=10$, $T_y=0$ & 725~Hz, $25\,\omega_f$ & $17k_f$ & & &large\\ DNS stretched plate & N1 &$C^2_{exp}$ & $T_x=4$, $T_y=0$ & 290~Hz, $3.5\,\omega_f$ &$2.6k_f$ & $288^2$ & experimental & large\\ DNS stretched plate & N2 &$C^2_{exp}$ & 4 & $3.5\,\omega_f$ &$2.6k_f$ & $288^2$ & ideal & large\\ DNS stretched plate & N3 &$C^2_{exp}/2$ & 4 & $5\,\omega_f$ & $3.7k_f$& $288^2$ & ideal & large\\ DNS stretched plate & N4 &$C^2_{exp}/5$ & 4 & $8\,\omega_f$ & $5.8k_f$& $288^2$ & ideal & large\\ DNS stretched plate & N5 &$C^2_{exp}/10$ & 4 & $12\,\omega_f$ & $8.3k_f$ & $288^2$ & ideal & large\\ DNS stretched plate & N6 &$C^2_{exp}/100$ & 4 & $37\,\omega_f$ & $26k_f>k_d$& $288^2$ & ideal & large\\ DNS stretched plate & N7 &$C^2_{exp}/1000$ & 4 & $117\,\omega_f$ & $83k_f>k_d$&$288^2$ & ideal & large\\ DNS membrane & N8 &$0$ & & & & $288^2$ & ideal & large\\ DNS membrane & N9 &$0$ & & & & $1024^2$ & hypervisc. & small\\ DNS membrane & N10 &$0$ & & & & $512^2$ & hypervisc. & small\\ DNS membrane & N11 &$0$ & & & & $288^2$ & ideal & small\\ \end{tabular} \caption{Description of the various experiments (exp) and numerical simulations (DNS). $C^2$ is such that the dispersion relation is $\omega_{\bf k} = \left( C^2 k^4 + \frac{T}{\rho h} k^2 \right)^{1/2}$. It corresponds to the dispersive part. The experimental value has been estimated to be $C^2_{exp}=0.6084$ from the observed dispersion relation. $T$ is the tension per unit length (when not specified $T_x=T_y$). $\omega_c$ and $k_c$ are the crossover frequency and wavenumber between dispersive and non dispersive waves (eq.~(\ref{cross})). They are expressed as a function of the forcing frequency $\omega_f$ and forcing wavenumber $k_f=5\pi$~rad/m repectively. $N$ is the number of grid point in numerical simulations. ``dissipation'' is the dissipative scheme that is used in the DNS (see part \ref{DNS}). $k_d=240$~rad/m is the dissipative cutoff of the ``ideal'' dissipation scheme. ``forcing'' specifies whether the forcing acts at large scale to investigate the direct cascade or at small scale to study the inverse cascade.} \label{tableau} \end{table*} \section{Investigation of the stretched plate} \label{prestre} \subsection{Experimental results} \begin{figure*}[!htb] \includegraphics[clip,width=8cm]{ST_kx_poster-eps-converted-to.pdf}\hfill \includegraphics[clip,width=8cm]{ST_ky_poster-eps-converted-to.pdf} \includegraphics[clip,width=8cm]{ST_kx_10kN-eps-converted-to.pdf}\hfill \includegraphics[clip,width=8cm]{spectre_st_kx_V_poster-eps-converted-to.pdf} \caption{(a) normalized spatio-temporal spectrum $E^v(k_x,0,\omega)/E^v(k_{f},0,\omega_f)$ of the velocity field in the stretching direction for experiment E1 with $T_x=4$~kN/m and $T_y=0$. The crossover frequency $\omega_c/2\pi=290$~Hz is shown as a vertical dashed line. (b) same dataset but the spectrum $E^v(0,k_y,\omega)/E^v(0,k_{f},0,\omega_f)$ is shown. (c) $E^v(k_x,0,\omega)/E^v(k_{f},0,\omega_f)$ for experiment E2 with a larger value of the tension $T_x=10$~kN/m and the maximum amplitude forcing permitted by the electromagnetic shaker. The crossover frequency $\omega_c/2\pi=725$~Hz is shown as a vertical dashed line. (d) $E^v(k_x,0,\omega)/E^v(k_{f},0,\omega_f)$ for a numerical simulation N1 with $T_x=4$~kN/m and $C^{2}_{exp}$ indented to reproduce qualitatively the experiment E1. In all cases the black line corresponds to the dispersion relation taking into account the tension (\ref{dispersion.tension}) and the red line corresponds to the dispersion relation without tension ({rdnotens}).} \label{spectre_st_exp_num} \end{figure*} In this part, experiments were carried out with two values of the applied tension $T_x=4$~kN/m (E1) and $T_x=10$~kN/m (E2). These values of $T$ correspond to a crossover frequency $\omega_c/2\pi$ equal to 290~Hz and 725~Hz respectively. A numerical simulation (N1) was also performed using parameters close to the experiment E1 so that to permit a qualitative comparison between the two. In order to study the energy distribution in the media, a Fourier analysis is applied to the deformation and normal velocity ($v=\frac{\partial \zeta}{\partial t}$) of the waves in the $x-y$ space and in time. This yields a frequency-wavenumber spectra of the normal velocity noted $E^v(k_x,k_y,\omega)$. We use the spectrum of the normal velocity rather than the one of the deformation $E^\zeta$ for convenience. Indeed the decay of $E^v(k_x,k_y,\omega)$ with the frequency or wavenumber is slower than that of $E^\zeta$. The relation between the two spectra is simply $E^v(k_x,k_y,\omega)=\omega^2E^\zeta(k_x,k_y,\omega)$. In the following, we often show the spectrum summed over the direction of the wavevector $\mathbf k$ which is noted $E^v(k,\omega)$. Figure~\ref{spectre_st_exp_num}(a) shows the spectrum $E^v(k_x,0,\omega)$ of the wave propagating along the direction of stretching for experiment E1. Figure~\ref{spectre_st_exp_num}(b) shows the spectrum in the $y$ direction orthogonal to the stretching, along which no tension is applied. In both cases the energy is localized along a curved line. In (a) the energy is localized on the linear dispersion relation (\ref{dispersion.tension}) that takes into account the tension. By contrast in (b), the energy is localized on the dispersion relation without tension (\ref{rdnotens}). In fig.~\ref{spectre_st_exp_num}(c), we show the experiment E2 with a value of the tension which is $2.5$ times higher. Due to the increased tension, the energy falls on a dispersion relation that is more shifted from the one with $T=0$. No sign of a qualitative change of behavior can be seen. For instance in~\cite{hassaini2017transition} the change from weak turbulence to soliton was visible in the fact that the energy was lying on a straight line over the whole range of frequencies. Here the energy remains on the predicted dispersion relation which is now anisotropic due to the stretching which is applied only in the $x$ direction. The energy cascades to higher frequencies in a way consistent with the phenomenology of the WTT. For E2 (highest tension), the cascade seems to stop at lower frequencies. Due to the strong stretching the shaker cannot operate at large amplitude and it may affect the injection. It is also possible that dissipation is altered as well. The numerical simulation N1 shown in fig.~\ref{spectre_st_exp_num}(d) is also qualitatively consistent with the WTT picture. Note that the energy lies also on a line that is actually even below the linear dispersion relation with tension for intermediate values of the frequency (around 400~Hz). This extra shift is actually predicted by the WTT and was also observed in plates without tension~\cite{epjb}. In the simulation, the non linearity must be stronger than in the experiment, possibly due to distinct forcing and boundary conditions. The experimental and numerical results shown in this part do not show hints of any qualitative change of dynamics of the vibrations of the plate. The spectra remain qualitatively consistent with what is expected from the WTT. No hint of localized structures such as shocks or solitons can be observed. In comparison with the unstretched case, the only difference is the change of the dispersion relation due to the contribution of the tension in (\ref{dispersion.tensionAnisotropic}). In experiments, the only parameter that can be tuned is the strength of stretching $T$. In order to gradually evolve towards the pure membrane, we would rather change the $C^2$ parameter by changing the thickness of the plate. This cannot be achieved experimentally as no plate thinner than $0.5$~mm could be found when keeping the same size. Thus in next part we use numerical simulations to investigate the limit $C^2$ going to zero. \subsection{Numerical investigation of the transition to the pure membrane: $C^{2}\rightarrow 0$ } \begin{figure*}[!htb] \includegraphics[clip,width=8cm]{spectre_st_integre_v_c2exp-eps-converted-to.pdf}\hfill \includegraphics[clip,width=8cm]{spectre_st_integre_v_c2_div10-eps-converted-to.pdf} \includegraphics[clip,width=8cm]{spectre_st_integre_v_c2_div100-eps-converted-to.pdf}\hfill \includegraphics[clip,width=8cm]{spectre_st_integre_v_c2_div1000-eps-converted-to.pdf} \caption{Normalized spatio-temporal spectrum of the velocity field $E^v(k,\omega)/E^v(k_{f},\omega_f)$ for the DNS: (a) N2 with $C^{2}_{exp}$ (b) N5, $C^{2}_{exp}/10$ (c) N6, $C^{2}_{exp}/100$ ans (d) N7, $C^{2}_{exp}/1000$. In all cases the black line corresponds to the dispersion relation (\ref{dispersion.tension}) and the red line corresponds to the dispersion relation without tension (\ref{rdnotens}). In (a) and (b) the vertical dashed line shows the corssover frequency $\omega_c$ (which is not in the displayed range for (c) and (d)).} \label{spectre_st_c2} \end{figure*} We examine the effects of dispersion on wave turbulence by running numerical simulations with a constant tension and decreasing gradually the value of $C^{2}$ from the experimental value $C^{2}_{exp}=0.6084$ down to $C^{2}={C^{2}_{exp}}/{1000}$ (N2 to N7). The wavenumber of the forcing is kept constant so that in the range of resolved wavenumbers, the waves are less and less dispersive when $C^2$ is reduced. The amplitude of the forcing is kept constant and the resulting {\it rms} steepness of the plate is also almost constant close to the value $2.3 \pm0.3\%$. The tension is now applied isotropically in the $x$ and in the $y$ direction and we use the ``ideal dissipation" scheme in order to remove the impact of wideband dissipation in the inertial range and to be in the theoretical framework. We compare the spatio-temporal spectra $E^v(k,\omega)$ for the case of the experimental $C^{2}_{exp}$ down to $C_{exp}^{2}/1000$ in fig.~\ref{spectre_st_c2} (for a given value of the isotropic tension $T$). We observe that in all cases, the energy is concentrated around the dispersion relation taking into account the tension such as stated in (\ref{dispersion.tension}). This means that even though the media is being less and less dispersive, for all the values of $C^{2}$ tested, the vibration of the plates remains in a state of weak turbulence. \begin{figure*}[!htb] \includegraphics[clip,width=8cm]{surf_z_c2exp-eps-converted-to.pdf}\hfill \includegraphics[clip,width=8cm]{surf_z_c2_10-eps-converted-to.pdf} \includegraphics[clip,width=8cm]{surf_z_c2_100-eps-converted-to.pdf}\hfill \includegraphics[clip,width=8cm]{surf_z_c2_1000-eps-converted-to.pdf} \caption{Snapshots of the deformation of the plate for the DNS: (a) N2 with $C^{2}_{exp}$ (b) N5, $C^{2}_{exp}/10$ (c) N6, $C^{2}_{exp}/100$ ans (d) N7, $C^{2}_{exp}/1000$. } \label{surf_weak} \end{figure*} Snapshots of the surface elevation of the same numerical simulations shown in fig.~\ref{spectre_st_c2} are represented in fig.~\ref{surf_weak}. At all values of $C^2$, the snapshots show a random wave distribution and no extreme events seem to appear. \begin{figure}[!htb] \centering \includegraphics[width=9.5cm]{Ev_k_norm_V-eps-converted-to.pdf} \caption{$E^v(k)/E^v(k_f)$ for DNS N2 to N7 i.e. for $C^{2}$ decreasing from $C^{2}_{exp}$ to $C^{2}_{exp}/1000$ with a constant tension. The slope of the deformation is kept roughly constant equal to about 2\%. The circles correspond to the crossover wavenumber $k_c$ for the corresponding DNS (when it is small than the dissipative cutoff $k_d=15k_f$). The bottom dashed line shows the theoretical scaling predicted by WTT applied to the pure membrane ($C^2=0$) $E^v(k)\propto k^{-4/3}$. The top dashed line shows the theoretical shape $k\log^{1/2}(k_d/k)$ expected from the WTT applied to the plate~\cite{during}.} \label{E_k_v} \end{figure} In order to have a quantitative information of the decay of the spectrum with the wavenumber, we extract the wavenumber-only spectrum of the normal velocity $E^v(k)$ for the DNS N2 to N7 (fig.~\ref{E_k_v}). The spectrum is seen to steepen when $C^2$ is reduced. At the highest value of $C^2$ comparable to the one of the experimental steel plate, the spectrum is consistent at high wavenumber with the prediction of the WTT for a plate without tension. When decreasing $C^2$, the shape of the spectrum evolves by developing a steeper region at $k$ below $k_c$. In the three larger values of $C^2$ for which $k_c$ remains moderate, the spectrum at $k>k_c$ is qualitatively consistent with the prediction for the non-stretched plate. Indeed at $k>k_c$ the correction to the no-tension dispersion relation is negligible and this explains why the spectrum keeps a shape compatible with the theory without tension. At the lowest value of $C^2$ (lowest curve), the spectrum is significantly steeper compatible with a $k^{-4/3}$ decay at intermediate values of $k$. This scaling is actually consistent with the WTT prediction of the pure membrane with $C^2=0$ (see \ref{DCDNS} below). At high $k$ a departure from the $k^{-4/3}$ scaling is observed which is probably a reminiscent effect of dispersion as $k_c$ remains finite (although larger than the dissipative cutoff). Thus we have experimental and numerical support of the fact that a pure membrane with $C^2=0$ should still exhibit a regime of weak turbulence. These observations must be contrasted with the case of surface water waves for which a transition to a solitonic regime was observed when reducing the dispersion of the waves (by reducing the water depth)~\cite{hassaini2017transition}. In the next section, we focus on the asymptotic case of the pure membrane for which $C^2=0$. We first apply the WTT formalism to this case. Then we compare its predictions with numerical simulations. \section{The vibrating non linear elastic membrane} \label{pure} \subsection{Application of the WTT to the membrane} \subsubsection{Kinetic equation} From the modifed F\"oppl-von K\'arm\'an equations (\ref{foppl1}) and (\ref{fopplTension}), one notices that only the linear term differs from the well studied case of elastic plates without tension. Furthermore, one can show that the so-called kinetic equation (equation for the slow temporal evolution of the wave spectrum) obtained for elastic plates under tension only differs in the dispersion relation with the one obtained for $T=0$ in \cite{during}. We shall consider the Fourier transform $$\zeta({\bf r},t)=\frac{1}{2\pi}\int \zeta_{\bf k}e^{i{\bf k}\cdot{\bf r}}d{\bf k},$$ and the canonical transformation \begin{equation} \zeta_{\bf k}=\frac{X_k}{\sqrt{2}}(A_{\bf k}+A^*_{-\bf k}) \label{CT} \end{equation} with $X_k={1}/{\sqrt{\omega_k\rho h}}$. In the weakly non-linear limit, a kinetic equation for the evolution of the wave action spectrum $n_{\bf k}=\langle A_{\bf k} A^*_{\bf k}\rangle/L^2$ can be obtained. The mean value $\langle \,\cdot\,\rangle $ represents an ensemble average and $L$ is the size of the plate. Formally, the kinetic equation is given by (for a detailed derivation see \cite{platesPhysD}) \begin{multline} \frac{dn_{\bf p}}{dt}=12\pi \sum_{s_1s_2s_3=\pm1} \int |J_{-{\bf p} {\bf k}_1{\bf k}_2{\bf k}_3} |^2 n_{{\bf k}_1}n_{{\bf k}_2}n_{{\bf k}_3}n_{{\bf p}}\\ \times\left(\frac{1}{n_{\bf p}}-\frac{s_1}{n_{{\bf k}_1}}-\frac{s_2}{n_{{\bf k}_2}}-\frac{s_3}{n_{{\bf k}_3}}\right)\delta({\bf k}_1+{\bf k}_2+{\bf k}_3-{\bf p})\\ \times \delta(s_1\omega_{{\bf k}_1}+s_2\omega_{{\bf k}_2}+s_3\omega_{{\bf k}_3}-\omega_{\bf p}) d{\bf{k}}_{123}, \label{kinetic1} \end{multline} where the scattering matrix introduced in \cite{during} is given by \begin{multline} J_{{\bf p} {\bf k}_1{\bf k}_2{\bf k}_3} = \\\left(\frac{1}{|{\bf p}+{\bf k}_1|^4}+\frac{1}{|{\bf k}_2+{\bf k}_3|^4}\right)\frac{|{\bf p}\times {\bf k}_1|^2 |{\bf k}_2\times {\bf k}_3|^2}{48 \rho^2h^2\sqrt{\omega_{\bf p}\omega_{{\bf k}_1}\omega_{{\bf k}_2}\omega_{{\bf k}_3} }}\\+{\rm permutations\,of\,indices\,}1,2,3.\label{Eq:ScatMat} \end{multline} In order to derive the kinetic equation above, the existence of a resonant manifold is assumed. Namely, a manifold in wave-vector space that satisfies \begin{equation} h({\bf k}_1,{\bf k}_2,{\bf p})=s_1\omega({\bf k}_1)+s_2\omega({\bf k}_2)+s_3\omega({\bf k}_3)-\omega({\bf p})=0, \end{equation} with $s_1{\bf k}_1+s_2{\bf k}_2+s_3{\bf k}_3+{\bf p}=0$. In general, an extra technical condition needed to perform a saddle-point like approximation is required. It is assumed that gradients of $h({\bf k}_1,{\bf k}_2,{\bf p})$ have to be different from zero on the resonant manifold. Under these assumptions, the multi-scale asymptotic expansion used to derive the kinetic equation remains bounded \cite{Saffman, platesPhysD} (see Appendix \ref{Saddle-node}). The kinetic equation contains two different groups of terms depending on the type of resonance: the $2\leftrightarrow 2$ interaction (eg. $s_1=-1$ and $s_2=s_3=1$) and the $3\leftrightarrow 1$ interaction (eg. $s_1=s_2=s_3=1$). The $2\leftrightarrow 2$ interaction is common in systems that are phase invariant (e.g Non Linear Schr\"odinger equation) or have a non-decay dispersion relation ($\omega_k\sim k^\alpha$ with $\alpha<1$), such systems have an extra conserved quantity named the wave action $N=\int n_{\bf p}{\mathrm d}{\bf p}$. The $3\leftrightarrow 1$ type of interaction is less common, since require a decay dispersion relation $\alpha\geq1$ and the symmetry of the Hamiltonian under reflection $\zeta \rightarrow -\zeta$. Such interaction prevents the wave action conservation, thus {\it a priori} wave action is not conserved for the membrane. As it was first shown by Zakharov, stationary out-of-equilibrium solutions of the kinetic equation can be found~\cite{R1}. Whenever the dispersion relation and the scattering matrix are homogeneous functions, such solutions, known as Kolmogorov-Zakharov spectra, can be obtained analytically. The limit $T\to0$ (no tension) corresponds to the case of elastic plates, for which the kinetic equation with $\omega_{\bf k} = C k^2 $ was derived in \cite{during}. In the other limit, $h^3E\ll T$, that corresponds to a non-linear membrane, the linear term becomes non dispersive with $\omega_{\bf k} = \sqrt{ \frac{T}{\rho h}} k$. Special care needs to be taken in this limit as the gradient of $h({\bf k}_1,{\bf k}_2,{\bf p})$ can identically vanish on the resonant manifold for some type of interactions (see Appendix \ref{non-dispersive}). Such interactions seem to be the responsible for the growth of strong non-linearities that can lead to the formation of shock waves and the breakdown of the wave turbulence theory \cite{aucoin,acustictur}. It remains as an open question under which circumstance non dispersive non-linear wave systems either focalize energy into rays leading to shock wave formation, or redistribute angularly the energy through nonlinearity so that shock wave formation is suppressed. In general, a non dispersive system with a cubic non-linearity contains $2\leftrightarrow 2$ and $3\leftrightarrow 1$ wave interactions. We can show that for $2\leftrightarrow 2$ interactions, the resonant manifold contains collinear train waves (parallel or antiparallel waves) but also non-trivial solutions (see appendix \ref{non-dispersive} and Fig.\ref{cone}). In this case, the multi-scale expansion leading to the kinetic equation remains bounded and its derivation is justified. In the case of $3\leftrightarrow 1$ interactions, the resonant manifold only contains collinear solutions and special care is needed. The behavior of collinear interactions seems to be case dependent and will be addressed elsewhere. In the particular case of an elastic membrane, eventual divergences in the multi-scale expansion are healed by the scattering matrix \eqref{Eq:ScatMat}. Indeed, collinear interactions of waves are completely suppressed by the vector products in $J_{{\bf p} {\bf k}_1{\bf k}_2{\bf k}_3}$. It follows that only $2\leftrightarrow 2$ non-collinear interactions contribute to the kinetic equation (\ref{kinetic1}), what ensures its validity (see Appendix \ref{non-dispersive}). The kinetic equation then simplifies to: \begin{multline} \frac{dn_{\bf p}}{dt}=36\pi \int |J_{-{\bf p} {\bf k}_1{\bf k}_2{\bf k}_3} |^2 n_{{\bf k}_1}n_{{\bf k}_2}n_{{\bf k}_3}n_{{\bf p}}\\ \times\left(\frac{1}{n_{\bf p}}+\frac{1}{n_{{\bf k}_1}}-\frac{1}{n_{{\bf k}_2}}-\frac{1}{n_{{\bf k}_3}}\right)\delta({\bf k}_1+{\bf k}_2+{\bf k}_3-{\bf p})\\ \times \delta(\omega_{\bf p}+\omega_{{\bf k}_1}-\omega_{{\bf k}_2}-\omega_{{\bf k}_3}) d{\bf{k}}_{123}. \label{kinetic2} \end{multline} An important consequence of the fact that in (\ref{kinetic2}) only $2\leftrightarrow 2$ interactions are present, is the conservation of the wave action $N=\int n_{\bf p}{\mathrm d}{\bf p}$. Associated to this (weak) invariant, a new cascade is expected to emerge. Note that $N$ is not an invariant of the full F\"oppl--von K\'arm\'an equations (\ref{fopplTension}), and such a cascade can be expected only within the validity of the weak wave turbulence theory. \subsubsection{Stationary out-of-equilibrium spectra} Considering the standard Zakharov transformation two different out-of-equilibrium solutions can be found~\cite{R1,Nazarenko}. The first one corresponds to a constant energy flux $P$ and leads to a direct cascade. It reads $n(\mathbf k)=C_p P^{1/3}k^{-10/3}$ with $C_p$ a constant that could be in principle calculated numerically from the kinetic equation. In terms of the amplitude deformation spectrum, it becomes $\langle |\zeta_{\mathbf k}|^2 \rangle \sim P^{1/3} k^{-13/3}$. If one consider the sum over the angles, it becomes \begin{equation} E^\zeta(k)\sim \langle |\zeta_{\mathbf k}|^2 \rangle k\sim P^{1/3} k^{-10/3}\, . \end{equation} The second out of equilibrium solution corresponds to a constant flux of wave action $Q$. It leads to an inverse cascade and it reads $n(\mathbf k)=C_q Q^{1/3}k^{-3}$. $C_q$ is also a constant that can be calculated from the kinetic equation. Summing over the angles, we obtain for the spectrum of $\zeta$ \begin{equation} E^{\zeta}(k)\sim \langle |\zeta_{\mathbf k}|^2 \rangle k\sim Q^{1/3} k^{-3}\, . \end{equation} \subsubsection{Stationary equilibrium solutions} Let us also remind that another statistical steady state exists that corresponds to thermodynamic equilibrium (with no flux). The exact solution in thermodynamic equilibrium has two asymptotes : one corresponding to energy equipartition and the second one corresponding to wave action equipartition. The expected spectra for both cases are: \begin{eqnarray} E_{k}^{\xi} \propto &k^{-1}\quad&\textrm{for energy equipartition}\\ E_{k}^{\xi} \propto &k^{-2}\quad&\textrm{for wave action equipartition}. \label{equi_n_membrane} \end{eqnarray} \subsection{Direct energy cascade} \subsubsection{Results} \label{DCDNS} \begin{figure}[htb] \includegraphics[width=0.45\textwidth]{SpectraComp1024.pdf} \caption{Wavenumber spectrum of the deformation $E^{\zeta}(k)$ for the high resolution DNS N9 of the pure membrane. The spectrum has been compensated either by $k^{10/3}$, (which is the WTT prediction) or by $k^3$ (WTT prediction for a plate with $C^2>0$ and $T=0$, discarding the logarithmic corrections). Forcing acts in modes $k\in (1,4)$.} \label{k_weak} \end{figure} As shown in the previous section the WTT prediction for the spectrum of the direct energy cascade is $E^{\zeta}(k) \propto k^{-\frac{10}{3}}$ while the case of the tensionless plate is $E^{\zeta}(k) \propto k^{-3}\ln^{1/3}(k^\star/k)$. Discarding the logarithmic corrections, it means that the distinction between the two spectra is quite small. Figure~\ref{k_weak} shows the spectrum for the high resolution DNS N9 of the pure membrane. It is consistent with the $-10/3$ spectral exponent expected from the direct cascade in the membrane. The DNS shows unambiguously that the scaling is distinct from the plate one with spectral exponent $-3$. Figure~\ref{st_weak}(a) shows the wavenumber-frequency spectrum of the moderate resolution run N11. As expected in weak turbulence, the energy is localized around the linear dispersion relation. The snapshot of the deformation shows that the deformation is totally disordered with no visible localized singular structures. \begin{figure}[htb] \includegraphics[width=0.45\textwidth]{spectre_st_membrane-eps-converted-to.pdf} \includegraphics[width=8.5cm]{surf_z_membrane-eps-converted-to.pdf} \caption{(a) Wavenumber-frequency spectrum $E^{\zeta}$ spectrum of the height of the waves for the same moderate resolution simulation shown in fig.~\ref{k_weak}(a). The black line is the linear dispersion. (b) snapshot of the deformation of the membrane for the same simulation.} \label{st_weak} \end{figure} If the spectrum of the deformation is $E^{\zeta}(k) \propto k^{-\frac{10}{3}}$ and the frequency is linear in $k$ then, if the motion is made only of waves, the velocity spectrum should follow: $E^{v}(k)=\omega(k)^2E^{\zeta}(k) \propto k^{-\frac{4}{3}}$. This is the scaling observed in fig.~\ref{E_k_v} at the lowest value of $C^2$. \subsection{Inverse energy cascade} In an elastic plate the presence of $3\leftrightarrow1$ wave resonances prevents the conservation of wave action and thus that of a true inverse cascade~\cite{during}. Note that a seemingly inverse cascade was nonetheless reported in numerical simulations~\cite{During:2015gt} but its physical origin remains largely to be explained. For the membrane, as mentioned above, no such $3\leftrightarrow1$ interaction exists so that an inverse cascade related to the conservation of wave action is predicted corresponding to a deformation spectrum $E_{k}^{\xi} \propto k^{-3}$. \begin{figure}[!htb] \includegraphics[width=8cm]{SpectraInvBis.pdf} \includegraphics[clip,width=8.5cm]{spectre_st_integre_z_18-eps-converted-to.pdf} \caption{(a) DNS N10 forced at small scale. The dashed line shows the $k^{-3}$ scaling expected from the WTT predictions. (b) Wavenumber-frequency spectrum of the deformation for a moderate resolution simulation N11 forced at $k_f=200$~rad/m. The solid black line is the linear dispersion relation.} \label{st_inverse_membrane} \end{figure} To check the presence of an inverse cascade, we perform numerical simulations by forcing at high wavenumbers. As shown in fig.~\ref{st_inverse_membrane}(a) the high resolution DNS N10 shows the development of an inertial range at scales larger than the forcing one. The scaling observed in the inertial range is fully compatible with the WTT prediction for the inverse cascade of wave action. Figure~\ref{st_inverse_membrane}(b) shows the frequency-wavenumber spectrum of a moderate resolution DNS N11. Again, the energy is localized in the vicinity of the linear dispersion relation in agreement with the phenomenology of WTT. \subsection{Evolution of the non-linearity with the scale} \begin{figure}[!htb] \centering \includegraphics[width=7.5cm]{deltaw_w_k_membrane-eps-converted-to.pdf} \caption{Evolution of the normalized spectral widening $\delta \omega/\omega$ as a function of k for the pure membrane (DNS N8). The dashed line is the WTT prediction $\delta\omega/\omega\propto k^{-2/3}$.} \label{nonlinear} \end{figure} The hypothesis underlying the WTT is the scale separation between the slow nonlinear time scale $t_{NL}$ of the evolution of the wave spectrum and the fast oscillation of the linear time scale $t_L=2\pi/\omega_k$. Following Newell et al.~\cite{NNB}, in the framework of WTT, the ratio $t_{NL}/t_{L}$ is supposed to behave as $t_{NL}/t_{L}\propto P^{-2/3}k^{-2\gamma/3+2\alpha}$ where $\gamma$ is the degree of homogeneity in $k$ of the scattering matrix $J^{-1 s_1 s_2 s_3}_{-{\bf p} {\bf k}_1{\bf k}_2{\bf k}_3} $ and $\alpha$ is the degree of homogeneity of the dispersion relation. Here $\gamma=2$ and $\alpha=1$ for the membrane so that: \begin{eqnarray} t_{NL}/t_{L}\propto& \, P^{-2/3}k^{2/3} \end{eqnarray} It means that the nonlinearity is getting weaker with $k$. Thus no breakdown of the weak nonlinearity hypothesis should be expected at high $k$ if the nonlinearity is weak at low $k$. The nonlinear time scale appears as a widening $\delta \omega_{NL}\propto 1/t_{NL}$ of the energy concentration around the dispersion relation. Thus the ratio $\delta \omega_{NL}/\omega_k$ should behave as \begin{eqnarray} \delta \omega_{NL}/\omega_k\propto &\, P^{2/3}k^{-2/3} \end{eqnarray} The widening $\delta \omega$ can be extracted from the wavenumber-frequency spectrum $E(k,\omega)$. At a given value of $k$, a Gaussian profile in $\omega$ can be fitted to $E(k,\omega)$ (of fig.~\ref{st_weak}(b)) around the maximum of energy (which corresponds to the dispersion relation). The result is shown in fig.~\ref{nonlinear}. The observed decay for the spectral width of the membrane is indeed following the scaling $1/k^{2/3}$ which supports the fact that the observed turbulence in the membrane is consistent with the WTT. \section{Conclusion} In this article, we compared experimentally and numerically the statistical properties of wave turbulence in a vibrating membrane to that of weak turbulence in a vibrating plate that had been studied before. The fundamental difference between the membrane and the plate is that the waves are not dispersive in the membrane as opposed to the case of the plate. Other systems such as acoustics or shallow water surface waves show that weak turbulence is no longer present but coherent structures such as shocks or solitons are observed. Here no such structures are observed when evolving continuously from the plate to the membrane and a state of weak turbulence is observed numerically in the membrane. This comes from the fact that the nonlinear coupling vanishes for collinear waves so that to prevent a strong cumulative effect of nonlinearity along rays yielding shocks for instance. Here only $2\leftrightarrow2$ interactions are possible that cause an angular redistribution of energy so that the systems remains weakly turbulent. A difference between the membrane and the plate is thus the presence of an inverse cascade for the membrane that should not exist for the plate (which is actually the object of a controversy~\cite{During:2015gt}). Thus there is a class of such systems that can develop weak turbulence of non dispersive waves. The case of weak gravitational waves is similar, the nonlinear coupling also vanishes for $3\leftrightarrow1$ interactions~\cite{Galtier:2017hi} so that weak turbulence should also exist for such waves.
\section{Transitionally rough regime}\label{sec:introduction} Although one of the oldest problems in fluid mechanics, roughness in turbulent flows remains an active area of research. The seminal works by \citet{Nikuradse1933} and \citet{Colebrook1937}, offering a systematic study of rough surfaces, set the foundations for the field. Based upon Nikuradse's results on pipes roughened with sand of equal grain size, \citet{Schlichting1936} introduced the concept of equivalent sand grain size, \ks, in order to classify rough surfaces. Surfaces producing the same friction as a particular sand grain size would share the same \ks. However, there are two important shortcomings in this strategy. Firstly, as stated by \citet{Bradshaw2000}, it ``simply defines a useful common currency for roughness size---like paper money, valueless in itself but normally acceptable as a medium of exchange'', i.e. \ks\ is merely a classifier, an a posteriori parameter that is of limited use for prediction purposes. Furthermore, \citet{Colebrook1939} observed that, despite sharing the same value of \ks\ in the fully rough regime, different surfaces vary in how they depart from the hydraulically smooth regime. In figure~\ref{fig:transitional_roughness_adapted}, these differences are highlighted by using \ksip \citep{Jim2004}. In this figure, a roughness lengthscale \ksi\ is chosen so that in the fully rough regime the roughness function \DUp\ depends only on \ksip. The figure highlights that, while such lengthscale can collapse the results in the fully rough regime, differences can still be observed in the transitionally rough regime. It is also worth nothing that \ksi\ can only be obtained a posteriori from experimental or numerical results with varying \ksip. Many studies in the recent years have aimed to find a suitable combination of parameters to describe roughness surfaces and predict their friction. Some authors have explored the effective slope, the solidity, as well as different moments of the roughness height, mainly the mean, the standard deviation and the skewness \citep{Flack2010}. A universal governing parameter, however, has not been found, and the changes in the flow that lead to the increase in friction have not been fully understood. The approach taken in this work is to understand the modifications produced on the flow by the roughness texture. As stated by \citet{Marusic2010a}, ``without further theoretical advances, there is a risk of needing a catalogue of roughness results''. \begin{figure} \centering \includegraphics[width=70mm]{transitional_roughness_adapted_noribs_black} \mylab{-80.0mm}{43mm}{$\DUp$}% \mylab{-75.0mm}{53.4mm}{$10$}% \mylab{-74.0mm}{29.0mm}{$5$}% \mylab{-74.0mm}{ 4.5mm}{$0$}% \mylab{-42mm}{-8mm}{$\ksip$}% \mylab{-57.0mm}{-4mm}{$10^0$}% \mylab{-34.0mm}{-4mm}{$10^1$}% \mylab{-11.0mm}{-4mm}{$10^2$}% \vspace*{2.2em} \caption{Roughness function \DUp\ in the transitionally rough regime as a function of \ksip. \protect\emptyblackcircle, uniform sand \citep{Nikuradse1933}; \protect\emptyblacktri, uniform packed spheres \citep{Ligrani1986}; \dotted, galvanized iron; \dashed, tar-coated cast iron; \chndot, wrought-iron; \protect\blackline, interpolation \citep{Colebrook1939}. Adapted from \citet{Jim2004}.} \label{fig:transitional_roughness_adapted} \end{figure}% In the hydraulically smooth regime, roughness is of small size and has a negligible effect on the flow, causing no change in terms of wall friction. As a result, the flow is effectively equivalent to canonical smooth-wall turbulence. In the fully rough regime, on the other hand, roughness dominates. The friction coefficient becomes independent of viscosity and the roughness size determines the skin friction drag. Between these two regimes, in the so-called transitionally rough regime, both the viscous and the rough effects have comparable importance. \citet{Nikuradse1933} observed that sand grain roughness was hydraulically smooth for $\ksp < 5$, fully rough for $\ksp > 70$, and transitional between those extremes. However, \citet{Flack2010} compile experimental results for typologies of roughness other than sand grain roughness, finding that the limits vary considerably. In particular, the literature shows the transitionally rough regime spanning $1.4$--$15<\ksp<18$--$70$. The lower bound of this regime has classically been seen as a threshold below which the surface completely behaves as hydraulically smooth. However, \citet{Bradshaw2000} proposes a gradual transition between these regimes, without a defined, hard boundary. A recent work by \citet{Thakkar2018} also seems to point in this direction. The interest in transitional roughness resides in understanding the effects that small surface texture starts having on the flow; effects that, as size increases, will lead to the departure from its smooth-wall behaviour and eventually to the fully rough regime. This interest is also growing amongst the high-Reynolds-number community \citep{Marusic2010a}. Apparently, smooth surfaces, with a well-controlled micro-texture, may eventually enter the transitionally rough regime as viscous scales become sufficiently small for increasing Reynolds number. Far enough over conventionally rough walls, the mean velocity profile exhibits the same logarithmic region found over smooth walls. Effectively, roughness only modifies the intercept of the logarithmic velocity profile, while the K\'{a}rm\'{a}n constant, $\kappa$, and the wake function are unaffected \citep{Nikuradse1933,Clauser1956}. In the logarithmic layer, the mean velocity profile, $U$, can then be expressed as \begin{equation} U^+ = \kappa^{-1}\ln \left( y^+ \right) + B + \DUp = U^+_0 + \DUp, \label{eq:log_profile} \end{equation} where $B$ is the smooth-wall intercept of the logarithmic velocity profile. The roughness function, \DUp\ \citep{Hama1954}, depends on the roughness texture and its size. The subscript~${}_0$ denotes smooth-wall flow quantities. The superscript~${}^+$ indicates scaling in wall-units, with the friction velocity, \utau, and the kinematic viscosity, $\nu$. The change in friction coefficient, \DCf, can be directly related to \DUp. At the centreline of a channel or boundary layer thickness, denoted by the subscript $\delta$, equation~\eqref{eq:log_profile} becomes \begin{align} \left(2/C_f\right)^{1/2} = U^+_{\delta} = U^+_{\delta_0} + \DUp. \end{align} \begin{figure} \centering \vspace*{0.8cm} \includegraphics[width=1.0\textwidth]{sketch_roughness_geometries_3}% \mylab{-1.000\textwidth}{13.4cm}{\aaa)}% \mylab{-1.000\textwidth}{ 9.8cm}{\bbb)}% \mylab{-1.000\textwidth}{ 6.2cm}{\ccc)}% \mylab{-1.000\textwidth}{ 2.8cm}{\ddd)}% \mylab{-0.278\textwidth}{13.95cm}{\sx \mylab{-0.278\textwidth}{10.52cm}{\sx \mylab{-0.278\textwidth}{6.85cm}{\sx \mylab{-0.278\textwidth}{3.15cm}{\sx \mylab{-0.420\textwidth}{12.25cm}{\sz \mylab{-0.420\textwidth}{8.85cm}{\sz \mylab{-0.420\textwidth}{5.15cm}{\sz \mylab{-0.420\textwidth}{1.45cm}{\sz \mylab{-0.125\textwidth}{12.20cm}{\k \mylab{-0.125\textwidth}{9.58cm}{\k \mylab{-0.141\textwidth}{7.88cm}{$\tfrac{1}{2}$\k \mylab{-0.125\textwidth}{5.10cm}{\k \mylab{-0.125\textwidth}{1.38cm}{\k \mylab{-0.046\textwidth}{13.08cm}{\k \mylab{-0.046\textwidth}{10.46cm}{\k \mylab{-0.046\textwidth}{8.64cm}{\k \mylab{-0.046\textwidth}{6.00cm}{\k \mylab{-0.046\textwidth}{2.25cm}{\k \caption{Schematics of the roughness patterns studied. (\aaa) Collocated; (\bbb) Collocated with two heights; (\ccc) Spanwise-staggered and (\ddd) Streamwise-staggered. The mean flow is from bottom left to top right. Left panels, three-dimensional representation of the roughness surface; central panels, top view of a unit element of the pattern; right panels, side view of an isolated post.}% \label{fig:sketch_roughness_geometries} \end{figure} In this work we explore the transitionally rough regime. The ultimate goal is to understand and predict the effect of transitionally rough surfaces on the flow. The range of roughness sizes covered is therefore small, but of more general relevance as this regime marks the onset of the rough behaviour. To explore it, we conduct a campaign of direct numerical simulations (DNSs) of turbulent channels. The channels are symmetric, with roughness on both walls. Four different geometries are considered, as depicted in figure~\ref{fig:sketch_roughness_geometries}. To explore the behaviour of each geometry, direct numerical simulations are conducted for different values of \k, while their shape is kept fixed, also resulting in constant solidity and effective slope. These surfaces exhibit the classic k-roughness behaviour, which is characteristic of most three-dimensional rough surfaces \citep{Jim2004}. This paper is organised as follows. In \S\ref{sec:methodology} the details of the numerical method are presented. A novel decomposition of the flow is presented in \S\ref{sec:flow_decomp} and it is used in \S\ref{sec:rough_comp} and \S\ref{sec:the_turbulent_component} to study the two components of the velocity. In \S\ref{sec:kelvin_helmholtz} the appearance of a shear-flow instability is discussed, and the relationship between the roughness function and the virtual origin of turbulence is analysed in \S\ref{sec:stress_breakdown}. The key conclusions are discussed in \S\ref{sec:conclusions}. \section{Methodology}\label{sec:methodology} The numerical experiments are conducted in an incompressible, turbulent channel with roughness on the top and bottom walls. The domain is periodic in the wall-parallel directions. The channel half-height is $\delta$ measured from the roughness crests, and the length and width are $\Lx = 2\pi\delta$ and $\Lz = \pi\delta$, respectively. The streamwise, wall-normal and spanwise coordinates are $x$, $y$ and $z$, with $u$, $v$ and $w$ the corresponding components of the velocity $\boldsymbol{u}$. The numerical method is adapted from that of \citet{GarM2011} for riblet channels to simulate fully three-dimensional roughness and is briefly summarised here. The temporal integrator is a fractional-step method combined with a three--sub-step Runge-Kutta and with pressure correction at the final sub-step only \citep{Le1991,Perot1993}. The spatial discretisation is pseudo-spectral. The two periodic directions, $x$ and $z$, are discretised using Fourier series, while the wall-normal direction, $y$, is discretised using a second order finite difference scheme in a collocated grid. The chequerboard effect, typical of collocated grids \citep{Ferziger2002}, is addressed using a quasi-divergence-free formulation \citep{Nordstrom2007,GarM2011}. Near the walls, the high velocity gradients and the roughness texture require a high spatial resolution for the flow to be correctly resolved, while for the core of the channel, a coarser, less costly resolution would suffice. To alleviate the computational cost of the method while still resolving all scales, two strategies are implemented. Along the wall-normal direction the finite-difference discretisation allows for the grid to be stretched, with a higher density of points near the walls. Above the roughness, the wall-normal grid spacing is $\Delta y^+_\text{min} \approx 0.3$ at the roughness crests, and progressively grows to $\Delta y^+_\text{max} \approx 3.1$ at the centre of the channel. Within the roughness region, i.e.\ between roughness crests and troughs, the grid spacing is $\Delta y^+ \approx 0.3$. Additionally, to increase the $x$- and $z$-resolutions near the walls, the domain is vertically divided into three blocks. This multi-block technique allows a high number of grid points to be set near the walls, with a coarser resolution in the block resolving the core of the channel. In this latter region the resolution is set to resolve all turbulent scales. In the blocks containing the walls, it is also necessary to resolve the flow around the roughness elements, which requires a higher resolution for small \kp. The resolution in the central block is $\Delta_{x_c}^+ \approx 6$ and $\Delta_{z_c}^+ \approx 3$ along the $x$ and $z$ directions respectively, while in the two wall blocks a finer resolution is used to represent each roughness element, with at least 12 points along $x$ and $z$. The roughness elements are resolved using a direct-forcing immersed boundary method \citep{Mohd-Yusof1997,Fadlun2000,Iaccarino2003}. The unit element is a cube of side \k, repeated along $x$ and $z$ on both walls. These unit elements are described using $12\times12$ points for the cases with $\kp \lesssim 9$, $24\times24$ points for the cases with $12 \lesssim \kp \lesssim 25$, and $48\times48$ points for the case with $\kp \approx 36$. This choice results from the need to solve both the turbulent scales as well as the flow around the roughness elements while keeping a moderate computational cost. Note that, although the resolution for the smallest \kp\ values is marginal, the simulations carried out by \citet{Thakkar2018} on random roughness, performed using a 12 point-per-element discretisation, are in good agreement with experimental results. The simulations are conducted at constant mass flow rate, which is adjusted to achieve a friction Reynolds number $\Ret \approx 185$ for all simulations. \Ret\ is computed using $\delta' = \delta + \protu$, where \protu\ is the virtual origin of the mean velocity profile, i.e. where the mean velocity profile tends to zero when extrapolated from $y > 0$. The friction velocity $u_\tau$ is obtained by extrapolating the total shear stress to $\delta'$. Statistically converged initial conditions are obtained by simulating and discarding the flow during $10\, \delta/\utau$. Statistics are then collected over at least $15\, \delta/\utau$. Relevant parameters and results of the simulations are given in table~\ref{tab:simulations_data}. \begin{table} \centering \def~{\hphantom{0}} \begin{tabular}{@{\hspace{1em}}c@{\hspace{1em}}lccrrrrrrrrrr} & Case & $\sx/\k$ & $\sz/\k$ & $\delta/\k$ & \kp & \ksp & \DUp & \Retau & \Utipsp & \protup & \Dup & \Djp & \Duvp \\ \midrule Smooth Channel & SC & $-$ & $-$ & $ - $ & $ 0.0$ & $ 0.0$ & $0.0$ & $183.9$ & $0.0$ & $0.0$ & $0.0$ & $0.0$ & $0.0$ \\ \midrule \multirow{7}{*}{Collocated} & C06 & $2$ & $2$ & $30.6$ & $ 6.0$ & $ 9.6$ & $0.5$ & $183.9$ & $0.5$ & $0.5$ & $0.5$ & $0.6$ & $1.2$ \\ & C09 & $2$ & $2$ & $20.4$ & $ 8.8$ & $14.1$ & $0.7$ & $180.8$ & $0.7$ & $0.7$ & $0.7$ & $0.7$ & $1.5$ \\ & C12 & $2$ & $2$ & $15.4$ & $11.7$ & $18.7$ & $1.5$ & $180.0$ & $1.1$ & $1.2$ & $1.2$ & $1.2$ & $3.2$ \\ & C15 & $2$ & $2$ & $12.3$ & $14.4$ & $23.1$ & $2.4$ & $178.7$ & $1.3$ & $1.5$ & $1.6$ & $1.6$ & $4.5$ \\ & C18 & $2$ & $2$ & $10.3$ & $17.4$ & $27.8$ & $3.5$ & $179.0$ & $1.5$ & $1.9$ & $1.9$ & $2.3$ & $6.3$ \\ & C24 & $2$ & $2$ & $ 7.7$ & $22.5$ & $36.0$ & $4.7$ & $174.5$ & $1.6$ & $2.5$ & $2.6$ & $3.8$ & $8.4$ \\ & C36 & $2$ & $2$ & $ 5.2$ & $35.7$ & $57.2$ & $6.7$ & $186.7$ & $2.1$ & $4.4$ & $4.8$ & $8.8$ & $-$ \\ \midrule \multirow{5}{*}{\begin{tabular}[c]{@{}c@{}}Collocated \\two heights\end{tabular}} & CC06 & $4$ & $4$ & $30.7$ & $ 5.8$ & $-$ & $0.8$ & $178.7$ & $1.2$ & $1.2$ & $1.4$ & $1.3$ & $2.1$ \\ & CC09 & $4$ & $4$ & $20.6$ & $ 8.7$ & $-$ & $1.8$ & $179.8$ & $1.6$ & $1.7$ & $2.1$ & $1.7$ & $3.7$ \\ & CC12 & $4$ & $4$ & $15.5$ & $11.7$ & $-$ & $3.3$ & $182.6$ & $2.1$ & $2.7$ & $3.0$ & $2.6$ & $6.2$ \\ & CC15 & $4$ & $4$ & $11.7$ & $15.4$ & $-$ & $4.5$ & $180.1$ & $2.4$ & $3.6$ & $3.4$ & $3.5$ & $8.3$ \\ & CC18 & $4$ & $4$ & $10.4$ & $17.0$ & $-$ & $4.9$ & $176.7$ & $2.4$ & $3.9$ & $3.5$ & $4.0$ & $9.1$ \\ \midrule \multirow{4}{*}{\begin{tabular}[c]{@{}c@{}}Spanwise \\staggered\end{tabular}} & SZ06 & $2$ & $4$ & $30.6$ & $ 5.9$ & $-$ & $0.4$ & $183.0$ & $0.5$ & $0.5$ & $0.6$ & $0.6$ & $1.0$ \\ & SZ09 & $2$ & $4$ & $20.4$ & $ 8.9$ & $-$ & $0.9$ & $182.7$ & $0.7$ & $0.7$ & $0.8$ & $0.8$ & $1.7$ \\ & SZ12 & $2$ & $4$ & $15.4$ & $11.8$ & $-$ & $1.6$ & $181.8$ & $1.2$ & $1.3$ & $1.3$ & $1.3$ & $3.4$ \\ & SZ15 & $2$ & $4$ & $11.6$ & $16.2$ & $-$ & $3.2$ & $188.3$ & $1.4$ & $1.8$ & $1.8$ & $2.1$ & $6.0$ \\ \midrule \multirow{5}{*}{\begin{tabular}[c]{@{}c@{}}Streamwise \\staggered\end{tabular}} & SX06 & $4$ & $2$ & $30.6$ & $ 5.9$ & $-$ & $0.6$ & $181.6$ & $0.5$ & $0.5$ & $0.6$ & $0.5$ & $1.1$ \\ & SX09 & $4$ & $2$ & $20.4$ & $ 8.8$ & $-$ & $1.2$ & $179.5$ & $0.6$ & $0.6$ & $0.9$ & $0.7$ & $2.0$ \\ & SX12 & $4$ & $2$ & $15.4$ & $11.9$ & $-$ & $2.6$ & $183.1$ & $1.0$ & $1.1$ & $1.4$ & $1.2$ & $4.2$ \\ & SX15 & $4$ & $2$ & $11.5$ & $16.0$ & $-$ & $4.1$ & $185.3$ & $1.2$ & $1.4$ & $1.7$ & $1.6$ & $6.0$ \\ & SX18 & $4$ & $2$ & $10.3$ & $17.6$ & $-$ & $4.3$ & $180.6$ & $1.2$ & $1.5$ & $1.8$ & $1.8$ & $6.2$ \\ \midrule \end{tabular} \caption{Main characteristics of the simulations. The roughness-element width and maximum height is $k$, and the streamwise and spanwise pitches of the pattern are \sx\ and \sz. The half-height of the channel, measured from the roughness crests, is denoted by $\delta$. The mean velocity at the roughness crests is \Utips. $\ell^+$ denotes the depth of virtual origins, measured from the tips, as introduced in \S\ref{sec:the_turbulent_component}, where \protup\ refers to the virtual origin of the mean velocity profile; \Dup\ is the virtual origin of the streamwise rms fluctuations; \Djp\ is Jackson's displacement height \citep{Jackson1981}; and \Duvp\ refers to the virtual origin of the Reynolds shear stress.} \label{tab:simulations_data} \end{table} \section{Flow decomposition}\label{sec:flow_decomp} In the proximity of the wall, roughness induces fluctuations that alter, and even destroy, the near-wall cycle \citep{Jim2004}. The intensity of these fluctuations decreases exponentially away from the surface, and they are generally considered to be confined within a region near the wall of height $\sim 3k$, known as the roughness-sublayer \citep{Raupach1991,Flack2007}. In this region the fluctuations induced by roughness cannot be neglected and their effect is noticeable in the flow. These roughness-coherent fluctuations are of the same order of magnitude as the background turbulence fluctuations, leaving their footprint on the velocity field and the energy spectrum. \begin{figure} \centering \includegraphics[width=1.0\textwidth]{one_d_cut_phys_and_spect_u_h06_red_JFM}% \mylab{-0.965\textwidth}{7.60cm}{\aaa.1)}% \mylab{-0.450\textwidth}{7.60cm}{\aaa.2)}% \mylab{-0.965\textwidth}{5.18cm}{\bbb.1)}% \mylab{-0.450\textwidth}{5.18cm}{\bbb.2)}% \mylab{-0.965\textwidth}{2.75cm}{\ccc.1)}% \mylab{-0.450\textwidth}{2.75cm}{\ccc.2)}% \caption{Instantaneous realisation of the streamwise velocity, for case C06, at $y^+ = 0.3$, in a section of constant $z^+$ through the middle of a row of posts. (\aaa.1) and (\aaa.2) \protect\blackline, full signal; \protect\blacklinedash, background turbulent component; \protect\redline, ensemble average over time and over the relative position in the periodic unit of texture. (\bbb.1) and (\bbb.2) \protect\redline, full signal minus the ensemble average; \protect\blacklinedash, background turbulence. (\ccc.1) and (\ccc.2) \protect\blackline, low-pass filtered full signal; \protect\redline, difference of the latter with the full signal. The left panels represent the signals in physical space, and the right panels in Fourier space, where $\alpha$ is the wavenumber. }% \label{fig:one_d_cut_phys_and_spect_u_h06_bw_JFM} \end{figure} \begin{figure} \centering \includegraphics[width=0.5\textwidth]{snapshots_decomposition_u_h09_c}% \mylab{-0.550\textwidth}{9.80cm}{\aaa)}% \mylab{-0.550\textwidth}{6.60cm}{\bbb)}% \mylab{-0.550\textwidth}{3.45cm}{\ccc)}% \mylab{-0.540\textwidth}{8.50cm}{$L_z^+$}% \mylab{-0.540\textwidth}{5.30cm}{$L_z^+$}% \mylab{-0.540\textwidth}{2.15cm}{$L_z^+$}% \mylab{-0.250\textwidth}{-0.10cm}{$L_x^+$}% \caption{Instantaneous streamwise velocity at $y^+ \approx 0.3$, for case C09.(\aaa) Full signal. (\bbb) Turbulent contribution obtained using triple decomposition, $u - \meanU - \uRu$. (\ccc) Turbulent contribution obtained using equation~\eqref{eq:decomposition_first_step}.} \label{fig:snapshots_decomposition_u_h09_bw} \end{figure} In the roughness-sublayer the flow can be thought of as formed of a roughness-coherent component, which is coherent in time and space with the roughness surface, and a background-turbulent component of a chaotic nature. This is analogous to the decomposition from \citet{Rey1974} into a coherent and a turbulent component. To illustrate this concept, figure~\ref{fig:one_d_cut_phys_and_spect_u_h06_bw_JFM}(\aaa.1) displays an instantaneous realisation of the streamwise velocity close to the roughness crests. We observe two contributions. The first, with longer wavelengths, has a characteristic lengthscale of the order of turbulent eddies. The second, whose dominant wavelength is that of the roughness texture, smaller than the overlying eddies, can be obtained by ensemble averaging over time and over the relative position in the periodic unit of texture. If the roughness-coherent component is subtracted from the full velocity, as in figure~\ref{fig:one_d_cut_phys_and_spect_u_h06_bw_JFM}(\bbb.1), we observe that the footprint of the roughness elements does not completely disappear. The reason can be explained by means of their corresponding Fourier transform, shown in figures~\ref{fig:one_d_cut_phys_and_spect_u_h06_bw_JFM}(\aaa.2) and~\ref{fig:one_d_cut_phys_and_spect_u_h06_bw_JFM}(\bbb.2). The ensemble average is composed of the wavelength of the texture and its subharmonics. The full velocity exhibits these same wavelengths, induced by the texture; however, they are modulated in amplitude and thereby surrounded by energy in the neighbouring wavelengths. When the ensemble average is subtracted from the full velocity, the most energetic part, which corresponds to the wavelength of the texture and its subharmonics, is removed, but all the energy neighbouring these wavelengths is not, failing to remove the footprint as observed in figure~\ref{fig:one_d_cut_phys_and_spect_u_h06_bw_JFM}(\bbb.1). In figures~\ref{fig:one_d_cut_phys_and_spect_u_h06_bw_JFM}(\ccc.1) and~\ref{fig:one_d_cut_phys_and_spect_u_h06_bw_JFM}(\ccc.2) we set a threshold to identify what wavelengths correspond to background turbulence and thus what the remainder represents in physical space. The wavelengths are then divided into long and short ones. In figure~\ref{fig:one_d_cut_phys_and_spect_u_h06_bw_JFM}(\ccc.1), we observe that the contribution from long wavelengths closely resembles smooth-wall turbulence. Wavelengths shorter than those of turbulence are similar to the ensemble average, shown in figure~\ref{fig:one_d_cut_phys_and_spect_u_h06_bw_JFM}(\aaa.1), but they appear to be modulated in amplitude by the overlying, long-wavelength signal of the background turbulence. Following the above analysis, in \citet{Abderrahaman2016} we proposed that the flow over a roughness texture of small size is not simply the sum of the ensemble average plus a turbulent component. Instead, the roughness-coherent flow is modulated by the overlying turbulence. For a particular roughness size, inducing a coherent flow \uRu, and with a background turbulence \uT, the instantaneous velocity can intuitively be modelled as \begin{equation} u \approx \meanU + \uT + \frac{\meanU + \uT}{\meanU} \uRu , \label{eq:decomposition_first_step} \end{equation} where \meanU\ is the temporal and $x$-$z$-spatial averaged streamwise velocity. Equation~\eqref{eq:decomposition_first_step} can also be inferred by considering small roughness in the viscous limit. In the spirit of \citet{Luc1991}, the vanishingly small roughness limit reduces the problem to a shear driven, purely viscous flow, which results in a self-similar solution that scales with \k\ and with the overlying shear, proportional to $\meanU + \uT$. The triple decomposition proposed by \citet{Rey1974} is similar to equation~\eqref{eq:decomposition_first_step} except for the amplitude modulation by $\meanU + \uT$. The triple decomposition has been widely used to characterise the texture-coherent flow in turbulence over a variety of complex surfaces \citep{Choi1993,Jim2001,GarM2011,Jelly2014,Seo2015}. However, if we are to study the modifications in the background turbulence, the modulation of the roughness-coherent component needs to be accounted for. Figure~\ref{fig:snapshots_decomposition_u_h09_bw}(\aaa) shows the streamwise velocity within the roughness layer, where the coherent signal of the roughness elements is strong. If the ensemble average, the roughness-coherent contribution, is subtracted we observe in figure~\ref{fig:snapshots_decomposition_u_h09_bw}(\bbb) that, although reduced, the footprint of the surface texture remains. However, when we account for the modulation of the coherent flow, using equation \eqref{eq:decomposition_first_step}, the signature of the roughness-coherent flow on the background turbulence is substantially weaker, as shown in figure~\ref{fig:snapshots_decomposition_u_h09_bw}(\ccc) where it is negligible. The instantaneous overlying flow induces around roughness elements a velocity field with components in all three directions. At the same time, the background turbulent flow has components in all three directions, so for instance the spanwise background shear induces a texture-coherent cross-flow. Hence, the three velocity components have a roughness contribution induced by all components of the overlying flow. Let us take the streamwise velocity signal as an example. It would have contributions from the mean streamwise velocity, \meanU, the background-turbulent streamwise component, \uT, a roughness-coherent component, \uRu, driven and modulated by $\meanU + \uT$, and a roughness-coherent component, \uRw, driven and modulated by the background-turbulent spanwise component, \wT. The simplified model presented in equation~\eqref{eq:decomposition_first_step} can then be extended to all components of the full velocity, \begin{subequations} \begin{alignat}{5} u & \approx \meanU && + & \uT & + \frac{\meanU + \uT}{\meanU} \uRu && + \frac{\wT}{\tilW} \uRw && + \frac{\vT}{\tilV} \uRv, \label{eq:flow_decomposition_u}\\ w & \approx && & \wT & + \frac{\meanU + \uT}{\meanU} \wRu && + \frac{\wT}{\tilW} \wRw && + \frac{\vT}{\tilV} \wRv, \label{eq:flow_decomposition_w}\\ v & \approx && & \vT & + \frac{\meanU + \uT}{\meanU} \vRu && + \frac{\wT}{\tilW} \vRw && + \frac{\vT}{\tilV} \vRv,\label{eq:flow_decomposition_v}% \end{alignat}% \label{eq:flow_decomposition}% \end{subequations} where \uRw\ is the roughness-coherent streamwise velocity induced by the overlying, background spanwise shear of \wT, etcetera. Note that, while the modulating signal $\meanU + \uT$ is always positive, \wT\ and \vT\ can either be positive or negative, and due to symmetry, their mean values cancel out. To obtain a measure of the intensity of these components, \tilW\ and \tilV\ denote the conditional averages of $w$ and $v$, which account for their mean direction over individual roughness elements, such that they are only included into the average when they are positive \citep{GarM2011}. In the cube roughness geometries studied in this work we observe no significant flow induced by $v$ in the streamwise and spanwise directions, although the corresponding terms have been included in equations~\eqref{eq:flow_decomposition} for completeness. In textures with inclined planes, such as pyramids or cones, for instance, we would expect these contributions, \uRv\ and \wRv, to be relevant. Figures~\ref{fig:snapshots_decomposition_u_h09_bw} and~\ref{fig:snapshots_decomposition_h09_bw} show instances of all three velocity components and their corresponding turbulent contributions, obtained by removing the roughness-coherent terms according to equations~\eqref{eq:flow_decomposition}. The present decomposition, accounting for the modulation of the overlying turbulence, reduces significantly the signature of the roughness-coherent flow. The remaining signature is overall much weaker than in the full signal, and is mostly prevalent in \vT. For \uT, our results show essentially no footprint of the texture, even for the larger \kp\ studied. In any event, the decomposition is based on a fundamentally linearised approach, assuming that the roughness lengthscales are much smaller than those over which the background overlying shear varies \citep{Zhang2016}, and can be expected to fail eventually as \kp\ is increase. \begin{figure} \centering \vspace{0.5cm}% \includegraphics[width=1.0\textwidth]{snapshots_decomposition_v_w_h09_c_2}% \mylab{-0.67\textwidth}{-.20cm}{$\Lxp$}% \mylab{-0.19\textwidth}{-.20cm}{$\Lxp$}% \mylab{-1.005\textwidth}{5.60cm}{$\Lzp$}% \mylab{-1.005\textwidth}{1.94cm}{$\Lzp$}% \mylab{-0.980\textwidth}{7.00cm}{\aaa.1)}% \mylab{-0.980\textwidth}{3.35cm}{\bbb.1)}% \mylab{-0.495\textwidth}{7.00cm}{\aaa.2)}% \mylab{-0.495\textwidth}{3.35cm}{\bbb.2)}% \vspace{0.1cm}% \caption{Instantaneous realisation for case C09. (\aaa) spanwise velocity, at $y^+ \approx 0.3$. (\bbb) wall-normal velocity at $y^+ \approx 1$. (\aaa.1) and (\bbb.1), full signals; (\aaa.2) and (\bbb.2), turbulent contributions obtained using equations~\eqref{eq:flow_decomposition}.} \label{fig:snapshots_decomposition_h09_bw} \end{figure} The modulation of the roughness-coherent flow by the background turbulence is analogous to the modulation of near-wall turbulence by the outer-layer dynamics \citep{Mathis2009}. \citet{Zhang2016} have recently revisited this problem, and propose a formulation similar to equations~\eqref{eq:flow_decomposition}. Also recently, \citet{Anderson2016} observed that the modulation of near-wall turbulence is present in flows over rough surfaces. In our direct numerical simulations, \Retau\ is not sufficiently high to reproduce large-scale dynamics, so the background turbulence is essentially that of near-wall, small-scale dynamics. At larger \Retau, we could expect a cascading modulation, where large scales modulate small scales in the background turbulence, and the full background turbulence modulates the texture-coherent flow. \begin{figure} \centering \vspace{.5cm} \includegraphics[width=\textwidth]{spectra_u_v_w_uv_clean_comparison_h06_y05}% \mylab{-0.865\textwidth}{5.35cm}{$ k_x k_z E^+_{uu}$}% \mylab{-0.625\textwidth}{5.35cm}{$ k_x k_z E^+_{vv}$}% \mylab{-0.390\textwidth}{5.35cm}{$ k_x k_z E^+_{ww}$}% \mylab{-0.165\textwidth}{5.35cm}{$-k_x k_z E^+_{uv}$}% \mylab{-1.040\textwidth}{4.1cm}{\rotatebox{90}{full}}% \mylab{-1.040\textwidth}{1.3cm}{\rotatebox{90}{turbulent}}% \caption{Premultiplied energy spectra of the full velocity signal and its background turbulent component, $k_x k_z E^+_{uu}$, $k_x k_z E^+_{vv}$ and $k_x k_z E^+_{ww}$, and cospectrum of the Reynolds stress, $k_x k_z E^+_{uv}$, for case C06, at $\yp = 2$ for $v$ and $\yp = 0.5$ for the rest.} \label{fig:spectra_u_w_uv_clean_comparison_h06_y05} \centering \vspace{1.0cm} \includegraphics[width=\textwidth]{spectra_u_v_w_uv_clean_comparison_h18_y05}% \mylab{-0.865\textwidth}{5.35cm}{$ k_x k_z E^+_{uu}$}% \mylab{-0.625\textwidth}{5.35cm}{$ k_x k_z E^+_{vv}$}% \mylab{-0.390\textwidth}{5.35cm}{$ k_x k_z E^+_{ww}$}% \mylab{-0.165\textwidth}{5.35cm}{$-k_x k_z E^+_{uv}$}% \mylab{-1.040\textwidth}{4.1cm}{\rotatebox{90}{full}}% \mylab{-1.040\textwidth}{1.3cm}{\rotatebox{90}{turbulent}}% \caption{Premultiplied energy spectra of the full velocity signal and its background turbulent component, $k_x k_z E^+_{uu}$, $k_x k_z E^+_{vv}$ and $k_x k_z E^+_{ww}$, and cospectrum of the Reynolds stress, $k_x k_z E^+_{uv}$, for case C18, at $\yp = 2$ for $v$ and $\yp = 0.5$ for the rest.} \label{fig:spectra_u_w_uv_clean_comparison_h18_y05} \end{figure} Beyond instantaneous realisations, the spectral densities of the different flow variables provide quantitative, statistical evidence to evaluate the proposed decomposition. Figures~\ref{fig:spectra_u_w_uv_clean_comparison_h06_y05} and~\ref{fig:spectra_u_w_uv_clean_comparison_h18_y05} show premultiplied spectra and cospectra of the full velocity, as well as those of the background turbulence variables, for a roughness of $\kp \approx 6$ and one of $\kp \approx 18$. The full flow signals exhibit a large spike at the wavelengths of the texture, \sx\ and \sz, as well as its corresponding subharmonics. However, the surrounding wavelengths also contain a substantial amount of energy, in a similar fashion to the effect observed in figure~\ref{fig:one_d_cut_phys_and_spect_u_h06_bw_JFM} in one dimension. These regions are the signature of the amplitude modulation of the roughness-coherent flow. Using the classical triple decomposition, without the modulation of the roughness-coherent component, removes the wavelength of the texture only, as shown in figure~\ref{fig:one_d_cut_phys_and_spect_u_h06_bw_JFM}(\bbb.2). In addition to the wavelengths of the roughness-coherent flow and the background turbulence, we observe very elongated regions with the wavelength of the roughness in $z$ and the range of wavelengths of the background turbulence in $x$, or vice versa. These are the signature of cross-terms BT--RC in equation~\eqref{eq:flow_decomposition}. Let us take for instance the term \uT\uRu, which essentially arises from the interaction of overlying streaks with the texture. In figure~\ref{fig:snapshots_decomposition_u_h09_bw}(\aaa), it can be observed that the region of high $u$ corresponding to a streak is broken down by the canyons formed by the roughness, so that within the footprint of the streak there are streamwise-aligned, alternating stripes of high and low $u$. The signature of this in spectral space will have the streamwise wavelength of streaks, but the spanwise wavelength of the texture. For small roughness textures, as in figure~\ref{fig:spectra_u_w_uv_clean_comparison_h06_y05}, the scale separation between the turbulent and roughness contributions is large enough that they can essentially be extracted by Fourier filtering. We exploited this in the example shown in figures~\ref{fig:one_d_cut_phys_and_spect_u_h06_bw_JFM}(\ccc.1) and~\ref{fig:one_d_cut_phys_and_spect_u_h06_bw_JFM}(\ccc.2). However, for larger \kp, as shown in figure~\ref{fig:spectra_u_w_uv_clean_comparison_h18_y05}, the elongated regions mentioned above overlap with the turbulent contribution, which makes a pass-band filter ill-suited. Nevertheless, equations~\eqref{eq:flow_decomposition}, interpreted as a filter, provide a tool to extract the turbulent contribution when Fourier filtering is not possible due to an overlap of wavelengths. In \S\ref{sec:the_turbulent_component} this decomposition is used to extract the background turbulence component and analyse the effects of roughness on it. Before that, in \S\ref{sec:rough_comp}, the roughness-coherent contribution is characterised, and a model to predict it is proposed. \section{The roughness-coherent component}\label{sec:rough_comp} In smooth walls, the mean velocity is a function of the wall-normal coordinate alone. However, in rough surfaces, we can define a time-averaged mean velocity that not only depends on $y$, but is also a function of the $x$ and $z$ coordinates. This space-dependent mean flow minus the conventional mean velocity, $U(y)$, is the roughness-coherent contribution introduced in the previous section, which is steady and coherent in space with the roughness texture. If we focus on individual roughness elements, the coherent flow can be thought of as the flow around the obstacles of the roughness geometry driven by the overlying shear. As the flow is deflected from and surrounds the obstacles, it generates a three-dimensional velocity field. The roughness-coherent component can be obtained by averaging the flow in time. Since all geometries in the present work are made up of a periodic pattern, the roughness-coherent contribution will also be periodic, with the same wavelength of the roughness texture. This contribution is therefore obtained by ensemble averaging over time and over the periodic texture units as in \citet{Seo2015}. \begin{figure} \centering \includegraphics[width=1.0\textwidth]{exponential_decay_rough_component_2} \caption{Rms of the roughness-coherent velocity components above the roughness crests. \protect\blueline, collocated posts; \protect\greenline, spanwise-staggered posts; \protect\purpleline, streamwise-staggered posts; \protect\redline, collocated posts of two heights. The reference lines, \protect\blacklinedash, have slopes of $1.5\pi$, $1\pi$ and $1.25\pi$, respectively.} \label{fig:exponential_decay_rough_component} \end{figure} The coherent flow thus obtained decays above the roughness crests with height. In all our cases, the roughness-coherent components of the velocity have heavily decayed at a distance of $\sim\k$, shorter than the commonly accepted height of the roughness-sublayer, $\sim3\k$ \citep{Raupach1991,Flack2007}. The rms of the roughness-coherent components of the velocity, whose squares are commonly referred to as dispersive stresses \citep{Raupach1982}, are depicted in figure~\ref{fig:exponential_decay_rough_component} for several roughness textures and sizes. The decay is of the form $\sim \exp(-y/k)$ and is observed to scale with the roughness height, \k, rather than the spacing, $s$. The rate of decay is observed to be different for the three velocities, and is fastest for $u$ and slowest for $v$. For all direct numerical simulations, the magnitude of the fluctuations, and in particular that of the wall-normal component, is below $2$ percent of \utau\ at one roughness height above the roughness crests. These results are consistent with experiments, where dispersive stresses are found to vanish at $y \approx \k$ \citep{Cheng2002,Florens2013}. For vanishingly small \k, the roughness-coherent flow can be thought of as the flow induced around the roughness elements driven by a steady, homogeneous overlying shear. This concept was already used by \citet{Luc1991}, where they considered riblets of a vanishingly small size, so that they perceive the overlying turbulence as steady and homogeneous. Notice that, for small roughness, in the transitionally rough regime, the time-scales and length-scales of the overlying background-turbulent fluctuations are much larger than those of roughness. These latter fluctuations are quasi-steady and quasi-homogeneous with respect to the characteristic scales of the surface, i.e.\ they vary slowly and over long distances. The concept of a quasi-steady, quasi-homogeneous limit was formalised by \citet{Zhang2016} for the interaction between the overlying large-scales of the outer region and the smaller and faster near-wall fluctuations, and a similar framework would apply here. \begin{figure} \centering \includegraphics[width=1\textwidth]{vR_vertical_09_18_24} \caption{Wall-normal velocity for cases (left) C09, (centre) C18 and (right) C24. Shaded, roughness-coherent contribution from direct numerical simulations; contours, steady laminar model. Red and solid indicate positive values, blue and dashed indicate negative values.} \label{fig:vR_vertical_09_18_24} \end{figure} \begin{figure} \centering \includegraphics[width=1.0\textwidth]{rms_comparison_laminar} \includegraphics[width=1.0\textwidth]{rms_comparison_laminar_stagz} \caption{Rms of the roughness-coherent contribution for the collocated and streamwise-staggered roughness. Solid, results from direct numerical simulations; dashed, results from the laminar model simulations. Blue to red, cases C06 to C18 and SX06 to SX18.} \label{fig:rms_comparison_laminar_1} \end{figure} \begin{figure} \centering \includegraphics[width=.75\textwidth]{rms_conditional_maximum_and_vel_tips_3}% \mylab{-0.682\textwidth}{3.40cm}{\aaa)}% \mylab{-0.285\textwidth}{3.40cm}{\bbb)}% \caption{(\aaa) Mean streamwise velocity at the roughness crests. (\bbb) Maximum streamwise roughness-coherent velocity as a function of the mean streamwise velocity at the roughness tips. \protect\bluecircle, collocated posts; \protect\greendiamond, spanwise staggered posts; \protect\purpletriangle, streamwise-staggered posts; \protect\redsquare, collocated posts of two heights. Empty symbols correspond to estimations from the laminar model. Linear regression with slopes: \dashed, $0.82$; and \chndot, $0.47$.} \label{fig:velocity_tips} \end{figure} The roughness-coherent flow for small \kp, as suggested above, can be modelled as the flow induced by a steady and homogeneous overlying background flow. Therefore, to approximate the roughness-coherent contribution, we conduct steady, laminar simulations using the numerical methodology described in \S\ref{sec:methodology}, but where the periodic domain only contains one texture element. The mean shear and viscosity are adjusted to match the same \kp\ of the corresponding direct numerical simulations. For small but finite values of \kp, these numerical domains are too small to sustain turbulence \citep{Jimenez1991}, and result in laminar, steady flows, which provide estimates of the roughness-coherent contribution. For instance, figure~\ref{fig:vR_vertical_09_18_24} compares the wall-normal roughness-coherent velocity obtained from the direct numerical simulations by ensemble averaging to the laminar model. Laminar simulations begin to deviate for the intermediate case, C18, but they still exhibit good qualitative agreement for the larger case, C24. Notice that, even for the smallest \kp, the flow is not symmetric and does not behave as purely viscous. It is therefore necessary to consider the advective terms, in contrast with the Stokes-flow analysis of \citet{Luc1991}. This model also allows us to predict the rms fluctuations of the roughness-coherent flow. Figure~\ref{fig:rms_comparison_laminar_1} depicts data from our direct numerical simulations compared against those from the laminar model, and shows good agreement for $\kp \lesssim 15$ for all our roughness surfaces. Notice that this method can also be used to estimate properties of the mean velocity profile close to the rough surface, such as the mean streamwise velocity at the roughness crests, by averaging along the $x$ and $z$ directions, as shown in figure~\ref{fig:velocity_tips}. \section{The background turbulence component}\label{sec:the_turbulent_component} Roughness does not only excite the wavelengths of the surface texture, but also modifies the background turbulence. This can be observed in the rms fluctuations that incorporate effects from both the roughness contribution, studied in the previous section, and the background turbulence. The streamwise rms fluctuations, shown in figure~\ref{fig:rms_outer_units_uvw}, decrease near the wall, and in particular the peak of intensity lowers as the roughness size increases, while a significant growth occurs at the roughness crests in a similar fashion to that in figure~\ref{fig:rms_comparison_laminar_1}. This decrease in the peak of intensity can only be caused by a decrease, and therefore modification, of the rms fluctuations of the background-turbulent component. The wall-normal and spanwise rms fluctuations present an increase of intensity across the entire roughness-sublayer, from the roughness crests to their near-wall intensity peak. The near-wall intensity peak of the streamwise vorticity fluctuation also increases, save for the largest case, which flattens in magnitude and almost disappears, this being a symptom of roughness altering the near-wall cycle. Notice that these modifications of the rms fluctuations extend to a distance of $\sim 2\k$, larger than the decay distance of the roughness-coherent signal observed in the previous section. However, beyond that distance, the rms fluctuations resemble those in smooth-wall turbulence, in agreement with the outer-layer similarity hypothesis \citep{Townsend1976}. \begin{figure} \centering \includegraphics[width=1.0\textwidth]{rms_outer_units_uvw_together}% \mylab{-0.915\textwidth}{3.40cm}{$u^{\prime +}$}% \mylab{-0.915\textwidth}{1.50cm}{$v^{\prime +}$}% \mylab{-0.940\textwidth}{2.56cm}{$w^{\prime +}$}% \mylab{-0.732\textwidth}{4.4cm}{\aaa)}% \mylab{-0.382\textwidth}{4.4cm}{\bbb)}% \mylab{-0.032\textwidth}{4.4cm}{\ccc)}% \caption{Full rms fluctuations. Blue to red, cases C06 to C36; black, smooth channel. The arrows indicate increasing roughness size. (\aaa) Streamwise, wall-normal and spanwise velocity fluctuations; (\bbb) Reynolds stress; (\ccc) streamwise vorticity fluctuations.} \label{fig:rms_outer_units_uvw} \end{figure} In this section, we analyse the effect of roughness on the background turbulence and, in particular, on the rms fluctuations. The rms fluctuations of the full signal, as shown in figure~\ref{fig:rms_outer_units_uvw}, contain contributions from both the turbulent-background and roughness-coherent components. However, the decomposition of equations~\eqref{eq:flow_decomposition} can be used to derive approximate expressions for the rms velocities from which the rms fluctuations of the background turbulence can be extracted. For the geometries studied in this paper, the leading terms are \begin{subequations} \begin{align} \langle u^{\prime 2} \rangle =& \left< \uT^{2} \right> + \left< \uRu^2 \right> \\ +& \left< \uRu^{2} \right> \left< \frac{\uT^{2}}{\meanU^2} \right> + \left< \uRv^{2} \right> \left< \frac{\vT^{2}}{\tilV^2} \right> + \left< \uRw^{2} \right> \left< \frac{\wT^{2}}{\tilW^2} \right>, \nonumber \\ \langle v^{\prime 2} \rangle =& \left< \vT^{2} \right> + \left< \vRu^2 \right> \\ +& \left< \vRu^{2} \right> \left< \frac{\uT^{2}}{\meanU^2} \right> + \left< \vRv^{2} \right> \left< \frac{\vT^{2}}{\tilV^2} \right> + \left< \vRw^{2} \right> \left< \frac{\wT^{2}}{\tilW^2} \right>, \nonumber \\ \langle w^{\prime 2} \rangle =& \left< \wT^{2} \right> + \left< \wRu^2 \right> \\ +& \left< \wRu^{2} \right> \left< \frac{\uT^{2}}{\meanU^2} \right> + \left< \wRv^{2} \right> \left< \frac{\vT^{2}}{\tilV^2} \right> + \left< \wRw^{2} \right> \left< \frac{\wT^{2}}{\tilW^2} \right>, \nonumber \\ \langle u^{\prime} v^{\prime} \rangle =& \left< \uT \vT \right> + \left< \uRu \vRu \right> \\ +& \left< \uRu \vRu \right> \left< \frac{\uT^{2}}{\meanU^2} \right> + \left< \uRv \vRv \right> \left< \frac{\vT^{2}}{\tilV^2} \right> + \left< \uRw \vRw \right> \left< \frac{\wT^{2}}{\tilW^2} \right> \nonumber \\ +& \left< \uRu \vRv \right> \left< \frac{\uT \vT}{\meanU \tilV} \right>,\nonumber \end{align}% \label{eq:flow_decomposition_rms}% \end{subequations}% where the angled brackets indicate temporal and x-z-spatial averaging, and the prime refers to fluctuations with respect to the mean. The full expressions including the terms that are negligible for our geometries can be found in appendix~\ref{appendixA}. Equations~\ref{eq:flow_decomposition_rms} are adequate approximations only for small roughness, as long as equations~\eqref{eq:flow_decomposition} hold. The coherent--background cross terms, which are zero in the conventional triple decomposition, can be of the same order of magnitude as the coherent--coherent terms. Equations~\eqref{eq:flow_decomposition_rms} can be used to extract the rms fluctuations of the background-turbulent contribution from the full and the roughness-coherent signals. \begin{figure} \vspace{0.3cm} \centering \includegraphics[width=\textwidth]{rms_clean_uv_3}% \mylab{-0.700\textwidth}{14.85cm}{\aaa.1)}% \mylab{-0.383\textwidth}{14.85cm}{\aaa.2)}% \mylab{-0.063\textwidth}{14.85cm}{\aaa.3)}% \mylab{-0.700\textwidth}{10.25cm}{\bbb.1)}% \mylab{-0.383\textwidth}{10.25cm}{\bbb.2)}% \mylab{-0.063\textwidth}{10.25cm}{\bbb.3)}% \mylab{-0.700\textwidth}{05.67cm}{\ccc.1)}% \mylab{-0.383\textwidth}{05.67cm}{\ccc.2)}% \mylab{-0.063\textwidth}{05.67cm}{\ccc.3)}% \mylab{-0.700\textwidth}{01.10cm}{\ddd.1)}% \mylab{-0.383\textwidth}{01.10cm}{\ddd.2)}% \mylab{-0.063\textwidth}{01.10cm}{\ddd.3)}% \caption{Rms fluctuations of the background turbulent flow. (\aaa) Reynolds stress, \uT\vT; (\bbb) streamwise velocity, \uT; (\ccc) wall-normal velocity, \vT; (\ddd) spanwise velocity, \wT. Blue to red, cases C06 to C24; black, smooth channel; the arrow indicates increasing \kp.} \label{fig:rms_clean_uv} \end{figure} \begin{figure} \centering \hspace{-0.8cm}% \includegraphics{protrusion_height_and_Du_2}% \caption{Virtual origins for different geometries and \kp. \protect\blackcross, \protup; \protect\emptyblackcircle, \Dup; and \protect\blackplus, \Djp. Blue collocated posts; green, spanwise-staggered posts; purple, streamwise-staggered posts; red, collocated posts of two heights.} \label{fig:protrusion_height_and_Du} \end{figure} The rms fluctuations of the background turbulence are shifted towards the wall, as if they perceived a smooth wall, or a virtual origin, below the roughness crests. In the first column of panels in figure~\ref{fig:rms_clean_uv}, the rms fluctuations of the background turbulence are compared with those in smooth-wall turbulence. The decomposition of equations~\eqref{eq:flow_decomposition_rms} removes from the background turbulence rms's the near-wall peaks observed for the full rms's in figure~\ref{fig:rms_outer_units_uvw}. The fluctuations are shifted towards the wall, but otherwise display a similar shape to those of smooth-wall turbulence close to the wall. We refer to this displacements as virtual origins, since the rms fluctuations behave as if they had an origin below the roughness crests. This can be interpreted as the height below the roughness crests at which they would to go to zero if extended as smooth-wall rms fluctuations. The virtual origin of the streamwise rms fluctuations, \Dup, is obtained as the depth below the roughness crests at which $\uT^{\prime +}$ would zero out, when extrapolated from its profile above the crests. When $\uT^{\prime+}$ is portrayed versus the height measured from that origin, as in figure~\ref{fig:rms_clean_uv}(\bbb.2), a good collapse with smooth wall data is observed in the first few wall units of height. However, this collapse does not extend outside the roughness-sublayer, where all curves should converge to the smooth-wall case. According to Townsend's outer-layer similarity hypothesis \citep{Townsend1976}, sufficiently far from the wall, effectively outside the roughness sublayer, all turbulent fluctuations are independent of the surface condition when normalised in wall units. In the second column of panels in figures~\ref{fig:rms_clean_uv}, the origin of the rms fluctuations is set at \Dup\ for all variables. We observe that this virtual origin does not adequately collapse any rms fluctuation other than that of the streamwise velocity very near the wall. We observe that the streamwise virtual origin, \Du, is related to the apparent origin of the mean velocity profile. Determining the correct zero-plane for the law of the wall is a question that has always been present in roughness studies. This reference level for the mean velocity profile is usually referred to as displacement height, and it is in essence equivalent to what we have defined as virtual origins, as it is a shift in the $y$-coordinate. \citet{Jackson1981} proposes a displacement height, \Dj, based on the centroid of the total stress below the roughness crests, i.e.\ the height at which the mean surface drag appears to act, \begin{equation} \Djp = \int_{\kp} \left(\frac{dU^{+}}{dy^{+}} {\ReStressp} \right) d\yp. \label{eq:JacksonDisplacementHeight} \end{equation} Similarly, since this displacement is essentially a virtual origin, we can also define another virtual origin for the mean velocity profile, $\protup$, as the distance from the roughness crests at which it would go to zero. This definition is equivalent to that used above for \Dup, where $\protup$ can be obtained by linearly extrapolating the mean velocity profile at the wall. In figure~\ref{fig:protrusion_height_and_Du}, we observe that $\protup$, \Dup\ and \Djp\ are generally similar for different roughness configurations and sizes. Further away from the wall, where the influence of the roughness-coherent flow is negligible, the rms fluctuations suggest that turbulence behaves as smooth-wall, canonical turbulence with a virtual origin \Duvp. The virtual origin of the Reynolds shear stress, \Duv\, appears to be the virtual origin of turbulence outside the roughness sublayer \citep{GGMadrid2018,Fairhall2018}. Unlike for the rms fluctuations of the three velocity components, the shape near the wall of the Reynolds shear stress does not drastically change with roughness. In figure~\ref{fig:rms_clean_uv}(\aaa.3), we observe that using the virtual origin of its rms fluctuations, \Duv, not only collapses the region near the wall, but the entire curve. In the third column of panels in figure~\ref{fig:rms_clean_uv}, the origin of the rms fluctuations is set at \Duv\ for all variables. The rms fluctuations, including the streamwise ones, converge to smooth-wall turbulence rms fluctuations outside the roughness-sublayer. Very near the wall, different variables would extrapolate to zero at different heights, as is particularly evident for $\uT^{\prime+}$ and $\wT^{\prime+}$, which experience virtual origins shallower than \Duvp. Beyond this, up to at least $\kp \approx 15$, the curves show an excellent collapse with smooth wall data. This suggests that, up to that \kp, turbulence remains essentially canonical, i.e.\ smooth-wall-like. \begin{figure} \centering \vspace{.6cm} \includegraphics[width=\textwidth]{outer_spectra_u_v_uv_3_y8_KH_band}% \mylab{-0.82\textwidth}{13.6cm}{$ k_x k_z E_{uu}^+$}% \mylab{-0.51\textwidth}{13.6cm}{$ k_x k_z E_{vv}^+$}% \mylab{-0.21\textwidth}{13.6cm}{$ - k_x k_z E_{uv}^+$}% \caption{Two-dimensional premultiplied spectra of the streamwise and wall-normal velocity components, and cospectrum of the Reynolds stress at $\yp = 8$, from top to bottom cases C12, C15, C18 and C24. Shaded, background-turbulent component; \protect\blackline, smooth-wall data at the equivalent height above the corresponding virtual origin; \protect\redlinedash\ and \protect\bluelinedash, positive and negative difference between the rough and smooth-wall results. Vertical dashed lines indicate $\lambda_x^+ = 100$ and $250$. Contours indicate the same value in wall units.} \label{fig:outer_spectra_u_v_uv_y8} \end{figure} To further explore the modifications of the background turbulence by roughness within the roughness-sublayer, we analyse its two-dimensional energy spectra and cospectra. As introduced in \S\ref{sec:flow_decomp}, the decomposition can be used to obtain the two-dimensional energy spectra of the background turbulence, without the footprint of roughness. Figure~\ref{fig:outer_spectra_u_v_uv_y8} shows the turbulent premultiplied spectra of \uT, \vT\ and premultiplied cospectra of \uT\vT, together with smooth-wall results at the equivalent height accounting for the corresponding virtual origin. For this roughness, the spectra present little changes for $\kp \lesssim 12$. As size increases the spectra and cospectra start to be modified: the energy at large $\lambda_x^+$ decreases, while at smaller $\lambda_x^+$ there is an increase of energy. The decrease of energy at large wavelengths is particularly clear for the streamwise velocity component. There is also a noticeable change in the spanwise direction. The spectra and cospectra, especially that of $v$, display an increase of energy at small $\lambda_x^+$ and a wider range of $\lambda_z^+$. This increase of energy is centred approximately at $\lambda_x^+ \approx 150$, being particularly clear for $E_{vv}$. \section{Shear-flow instability}\label{sec:kelvin_helmholtz} The spectral energy densities in figure~\ref{fig:outer_spectra_u_v_uv_y8} indicate the regions where energy increases or decreases with respect to smooth wall turbulence. Energy increases at short streamwise wavelengths, $\lambda_x$, for a broad range of $\lambda_z$, both larger and smaller than the characteristic $\lambda_z$ of smooth-wall turbulence. The values of $\lambda_x$ at which energy increases, $\lambda_x^+ \approx 100$--$200$, appear to be independent of \kp. Although significantly more intense, similar modifications of the energy spectra were observed on riblets, a particular case of roughness. This increase in energy was found to be due to the formation of a shear flow instability \citep{GarM2011}. These instabilities are a common feature in obstructed flows \citep{Ghisalberti2009}, and have been observed on flows over plant canopies \citep{Fin2000} and permeable substrates \citep{Bre2006}. Although we do not observed them directly in our numerical simulations, the concentration of energy for a narrow range of $\lambda_x^+$ suggests a receptivity to this wavelengths that could be connected to a similar shear-flow instability of the mean velocity profile, for which we analyse the stability properties in this section. \begin{figure} \centering \includegraphics[width=\textwidth]{ampl_vs_lx}% \mylab{-0.905\textwidth}{5.25cm}{\aaa)}% \mylab{-0.390\textwidth}{5.25cm}{\bbb)}% \caption{(\aaa) Growth rate $\sigma^+ = \text{Im}\left(\omega^+\right)$ of the most amplified mode as a function of the longitudinal wavelength $\lambda_x^+$. (\bbb) Maximum growth rate $\sigma^+$ as a function of the roughness height. Blue to red, results for the mean velocity profiles for cases C06 to C36.} \label{fig:ampl_vs_lx} \end{figure} We focus on Kelvin-Helmholtz-like instabilities, which are essentially spanwise coherent, linear and inviscid. Previous studies have shown that the instability is essentially a property of the mean profile \citep{Beneddine2016}, although it is modulated by the effect of the complex substrate on the fluctuating flow \citep{Raupach1991,White2007,Zampogna2016b}, as well as by viscous effects \citep{Jim2001,Luminari2016,GG2018}. Since we aim to assess this phenomenon only qualitatively, we conduct a simplified analysis, two-dimensional in $x$ and $y$, inviscid and linear, where the flow is allow to fluctuate freely around the mean profile, neglecting the presence of the solid obstacles. We seek wavelike solutions for the velocity and pressure perturbations, of the form \mbox{$f=\hat{f}\exp[i(\alpha_x x + \alpha_z z - \omega t)]$}, which allows for a modal analysis. The linearised problem becomes then Rayleigh's equation \citep{Rayleigh1879} \begin{equation} \left((\meanU-c)(\partial_{yy} - k^2) - \partial_{yy}\meanU \right) \hat{v} = 0, \label{eq:rayleigh} \end{equation} where $\alpha_x$ and $\alpha_z$ are the wave numbers in the streamwise and spanwise directions respectively, $\hat{v}$ is the corresponding perturbation mode of the wall-normal velocity, with $\hat{v}=0$ at the troughs, $k^2 = \alpha_x^2 + \alpha_z^2$, $\omega$ is the complex frequency, and $c$ is the complex phase velocity defined as $\omega = \alpha_x c$. Note that, according to Squire's theorem, for any streamwise wavelength $\alpha_x$ the most amplified mode is two-dimensional, $\alpha_z = 0$. The mean velocity profiles, \meanU, are directly extracted from our DNSs, and include the region below the roughness crests. Notice that the effect of roughness is exclusively introduced through the mean velocity profile. More precise studies include, for instance, a drag force model below the roughness or canopy tips \citep{Py2006,Luminari2016,AK2018}, at the cost of an increased cost and complexity. The results of the stability analysis, portrayed in figure~\ref{fig:ampl_vs_lx}(\aaa), show an instability for the mean flow predominantly for wavelengths $\lambda_x^+ \approx 100$--$150$. This result is in rough agreement with the modifications observed in the energy spectra and cospectra in figure~\ref{fig:outer_spectra_u_v_uv_y8}, where energy concentrates at $\lambda_x^+ \sim 150$, and does not significantly change with \kp. This could be expected, as previous studies have shown that the lengthscales of the instability are set by the curvature of the mean velocity profile, independently of the lenghtscales in the substrate geometry \citep{White2007,GarM2011,GG2018}. However, our simplified model exhibits a maximum for the instability at $\kp \approx 15$, as depicted in figure~\ref{fig:ampl_vs_lx}(\bbb), while the changes in the energy spectra increase monotonically with \kp. Nevertheless, the results suggest that the wavelengths in which energy concentrates in the DNSs are the most receptive from the point of view of the stability of the mean flow. \section{Skin friction: towards a predictive model}\label{sec:stress_breakdown} \begin{figure} \centering \includegraphics[width=.9\textwidth]{DU_vs_kp_Duv_DJ_vpwall_4}% \mylab{-0.820\textwidth}{10.40cm}{\aaa)}% \mylab{-0.380\textwidth}{10.40cm}{\bbb)}% \mylab{-0.820\textwidth}{4.90cm}{\ccc)}% \mylab{-0.380\textwidth}{4.90cm}{\ddd)}% \caption{Roughness function represented versus (\aaa) roughness height, (\bbb) Jackson's displacement height, (\ccc) wall-normal velocity fluctuations at the roughness crests, and (\ddd)~virtual origin of turbulence. \protect\bluecircle, collocated posts; \protect\greendiamond, spanwise-staggered posts; \protect\purpletriangle,~streamwise staggered posts; \protect\redsquare, collocated posts of two heights; \protect\blacklinedash , linear regressions $16.6\, v_t^{\prime +}$ and $0.78\, \Duvp$} \label{fig:DU_vs_kp_and_Duv} \end{figure} In the Introduction we discuss the main drawbacks of the equivalent sand roughness, \ksp, which for historical reasons has been widely used to characterise rough surfaces. However, \ksp\ can neither be predicted a priori, nor describes appropriately the transitionally rough regime. The latter is explicitly highlighted by \citet{Jim2004}, who shows that a collapse of the fully rough regime does not guarantee such a collapse in the transitionally rough regime, as shown in figure~\ref{fig:transitional_roughness_adapted}. Therefore, \ksp\ is not a suitable parameter to predict \DUp. Likewise, \kp\ presents similar problems, as it is roughly proportional to \ksp\ \citep{Schlichting1936}. Figure~\ref{fig:DU_vs_kp_and_Duv} shows \DUp\ as a function of the roughness element height, \kp, and of Jackson's displacement height, \Djp. Both capture the trend of increasing \DUp\ for increasing roughness size, but display a strong dependence with the type of roughness surface. \citet{Orlandi2006a} find a strong linear correlation between $\DUp-\Utipsp$ and the rms fluctuations of the wall-normal velocity at the roughness crests, \vtipsp, as shown in figure~\ref{fig:DU_vs_kp_and_Duv}(\ccc) for our simulations. Similarly, a linear relationship between $\DUp-\Utipsp$ and \Duvp\ is also observed in figure~\ref{fig:DU_vs_kp_and_Duv}(\ddd). As introduced earlier, \Duvp\ is the shift of the Reynolds stress below the roughness crests, and can be interpreted as the apparent position of the origin for turbulence. Both \vtipsp\ and \Duvp\ establish a connection between the roughness function and the effect of the roughness surface on the flow. The mean momentum equation is used below to explore this relationship between the roughness function, \DUp, and the virtual origin of the Reynolds shear stress, \Duvp. The goal is to obtain an expression for the roughness function. The procedure followed here is similar to that in \citet{GarM2011} to study the contributions to \DUp. In a turbulent channel the mean momentum equation along the streamwise direction is \begin{align} \ReStress + \nu \frac{dU}{dy} &= u^2_{\tau} \frac{\delta'-y_r}{\delta'}, \label{eq:total_streess_with_dimensions} \end{align}% where $y_r$ is the wall-normal coordinate measured from the virtual origin of the mean velocity profile, $y_r = y - \protu$, and the apparent half-height of the channel has previously been defined as $\delta' = \delta + \protu$. This allows us to define a common origin $y_r = 0$ for the mean velocity profiles under different setup configurations. Note that $\protu$ is positive and $\delta' > \delta$. Scaling equation~\eqref{eq:total_streess_with_dimensions} in viscous units gives \begin{align} {\ReStressp} + \frac{dU^{+}}{dy^{+}} &= \frac{\delta^{\prime+}-y_r^{+}}{\delta^{\prime+}}. \label{eq:total_streess_with_no_dimensions} \end{align} This expression is valid above the roughness crests, $\yp > 0$ or $\yp_r > \protup$. Integrating equation~\eqref{eq:total_streess_with_no_dimensions} allows us to obtain $U^+$, and thus an expression for the roughness function, \DUp, as the difference in $U^+$ between rough and smooth-wall cases. At a distance $H^+$ sufficiently far from the wall, where outer-layer similarity holds and the mean velocity profile is logarithmic, the roughness function is $\DUp = U^+_r(H^+) + U^+_s(H^+)$. Let us denote by the subscripts `$r$' and `$s$' the variables in a rough and smooth-wall channel, respectively. Equation~\eqref{eq:total_streess_with_no_dimensions} can then be integrated between two heights \begin{subequations} \begin{align} \int^{H^+}_{h_s^+}{\ReStressp[s]} \, dy^+ + U^{+}_s\left(H^+\right) - U^{+}_s\left(h_s^+\right) &= (H^+ - h_s^+) -\frac{1}{2}\frac{{H^+}^2 - {h_s^+}^2}{\delta^{\prime+}_s} \label{eq:stress_integrals_smooth},\\ \int^{H^+}_{h_r^+}{\ReStressp[r]} \, dy^+ + U^{+}_r\left(H^+\right) - {U^{+}_r}\left(h_r^+\right) &= (H^+ - h_r^+) -\frac{1}{2}\frac{{H^+}^2 - {h_r^+}^2}{\delta^{\prime+}_r}, \label{eq:stress_integrals_rough} \end{align} \label{eq:stress_integrals_smooth_and_rough}% \end{subequations}% where the lower bounds of integration, $h_r^+$ and $h_s^+$, can in principle be different for the rough and the reference smooth case, but for equation~\eqref{eq:total_streess_with_dimensions} to hold, $h_r^+ \geq \protup$ is required. An expression for the roughness function, $\DUp$, can be obtained by subtracting equation~\eqref{eq:stress_integrals_smooth} from~\eqref{eq:stress_integrals_rough}. Taking $h^+ = h_s^+ = h_r^+ = \protup$, we then have \begin{equation} \DUp = U^{+}_r\left(H^+\right) - U^{+}_s\left(H^+\right) = \Tterm_1 + \Tterm_2 + \Tterm_3, \label{eq:stress_integrals_DU} \end{equation} where \begin{subequations} \begin{align} \Tterm_1 =& -\left( \int^{H^+}_{h^+}{\ReStressp[r]} \, dy^+ - \int^{H^+}_{h^+}{\ReStressp[s]} \, dy^+ \right), \label{eq:stress_integrals_A1}\\ \Tterm_2 =& {U^{+}_r}\left(h^+\right) - {U^{+}_s}\left(h^+\right), \label{eq:stress_integrals_A2}\\ \Tterm_3 =& - \frac{1}{2} \left( \frac{{H^+}^2 - {h^+}^2}{\delta^{\prime+}_r} - \frac{{H^+}^2 - {h^+}^2}{\delta^{\prime+}_s}\right). \label{eq:stress_integrals_A3}% \end{align}% \label{eq:stress_integrals_A}% \end{subequations}% The first term, $\Tterm_1$, encapsulates the increase in Reynolds stress that roughness produces compared to that over a smooth wall. Over conventional roughness, the Reynolds stress increases near the wall and hence the negative contribution of this term towards \DUp. Drag-reducing surfaces produce large slip velocities that overcome the effect of $\Tterm_1$, resulting in a net reduction of drag. Similarly, roughness also displays a mean velocity at the roughness crests, which is captured by the first term in $\Tterm_2$. However, when the change in the virtual origin of the mean velocity profile is accounted for, by the second term in $\Tterm_2$, the net result is generally negative. The first contribution is simply the mean velocity at the roughness crests, \Utips. The other contribution to $\Tterm_2$ is the mean velocity of the smooth-wall channel at the roughness crests equivalent height, that is what the mean velocity would be at the tips if the rough wall had no effect on the mean velocity profile. The term $\Tterm_2$ then represents the difference between the actual mean velocity at the roughness crests and the ideal velocity that would have been achieved at such height without roughness. Notice that for small roughness, $\Tterm_2 \approx 0$. As size increases, the advective terms gain relevance at the roughness crests and the magnitude of $\Tterm_2$ increases. Finally, $\Tterm_3$ accounts for Reynolds-number discrepancies between the different simulations, being zero if $\delta_r^{\prime+} = \delta_s^{\prime+}$. In essence, the term $\Tterm_3$ is obtained by integrating the total stress, i.e.\ the linear, right-hand-side of equation~\eqref{eq:total_streess_with_no_dimensions}. The intersect of the linear total stress at different $\delta^+$ causes relative variations in $\Tterm_3$ of order $\delta^{\prime+}_r/\delta^{\prime+}_s$. \begin{figure} \centering \includegraphics[width=.762\textwidth]{R_stress_breakdown_08_reordered}% \mylab{-.730\textwidth}{.665\textwidth}{\aaa)}% \mylab{-.335\textwidth}{.665\textwidth}{\bbb)}% \mylab{-.730\textwidth}{.320\textwidth}{\ccc)}% \mylab{-.335\textwidth}{.320\textwidth}{\ddd)}% \caption{Contributions to \DUp\ for (\aaa) collocated posts, (\bbb) collocated posts of two heights, (\ccc) spanwise-staggered posts, and (\ddd) streamwise-staggered posts. \protect\blacktri, $T1$; \protect\blacksquar, $T2$; and \protect\blackdiamond, $T3$; \protect\blackcircle, $\DUp = T1 + T2 +T3$.} \label{fig:stress_breakdown} \end{figure} In our simulations, $\Tterm_3$ contributes significantly to $\DUp$. The simulations are at slightly different \Retau, which generates setup-dependent contributions to this term. To isolate these effects, we propose an alternative breakdown, $\DUp = T1 + T2 + T3$, where \begin{subequations} \begin{align} T1 =& -\left( \frac{\delta_s^{\prime+}}{\delta_r^{\prime+}} \int^{H^+}_{h^+}{\ReStressp[r]} \, dy^+ - \int^{H^+}_{h^+}{\ReStressp[s]} \, dy^+ \right), \label{eq:stress_integrals_T1}\\ T2 =& {U^{+}_r}\left(h^+\right) - {U^{+}_s}\left(h^+\right), \label{eq:stress_integrals_T2}\\ \begin{split} T3 =& \left( \frac{\delta_s^{\prime+}}{\delta_r^{\prime+}}-1\right)\int^{H^+}_{h^+}{\ReStressp[r]} \, dy^+ \underbrace{- \frac{1}{2} \left( \frac{{H^+}^2 - {h^+}^2}{\delta^{\prime+}_r} - \frac{{H^+}^2 - {h^+}^2}{\delta^{\prime+}_s}\right)}_{\Tterm_3}. \end{split}% \label{eq:stress_integrals_T4}% \end{align}% \label{eq:stress_integrals}% \end{subequations}% These expressions are obtained by adding and subtracting $\delta^{\prime+}_s/\delta^{\prime+}_r\int \langle uv \rangle_r^+$ to equation~\eqref{eq:stress_integrals_A}, and rearranging. In this form, the term $|T3| \ll |T1|, |T2|$, and the expression $\DUp = \Tterm_1 + \Tterm_2$ is still recovered for $\delta_r^{\prime+} = \delta_s^{\prime+}$. By rescaling ${\ReStressp[r]}$ by the ratio of channel heights, $\dsp/\drp$, $T1$ is less dependent to small variations of the frictional Reynolds number, and thus cases with slightly different $\delta^+$ can be more fairly compared. Results of equations~\eqref{eq:stress_integrals} used on our rough geometries are portrayed in figure~\ref{fig:stress_breakdown}. The term $T1$ contributes the most towards \DUp. In our geometries, the term $T2$ is observed to always be negative. However, some particular cases with two-dimensional roughness, such as riblets, have also proven to induce a positive, and therefore drag reducing, $T2$ term \citep{GarM2011}. For $\delta_r^+ = \delta_s^+$, equations~\eqref{eq:stress_integrals_A} and~\eqref{eq:stress_integrals} simplify to \begin{subequations} \begin{align} T1 = \mathcal{T}1 =& \int^{\delta^{\prime+}_s}_{h^+}\left( \minusReStressp[r] - \minusReStressp[s] \right)\, dy^+,\\ T2 = \mathcal{T}2 =& {U^{+}_r}\left(h^+\right) - {U^{+}_s}\left(h^+\right).% \end{align}% \label{eq:stress_integrals_simple}% \end{subequations}% Equations~\eqref{eq:stress_integrals_simple} present in a clearer manner the components of \DUp, as it is caused by the change in Reynolds stress as well as the difference between the mean velocity at the roughness crests and that over a reference smooth wall at the same height from the virtual origin. \begin{figure} \centering \includegraphics[width=.97\textwidth]{stress_estimation_06_reordered}% \mylab{-.940\textwidth}{.465\textwidth}{\aaa.1)}% \mylab{-.695\textwidth}{.465\textwidth}{\bbb.1)}% \mylab{-.452\textwidth}{.465\textwidth}{\ccc.1)}% \mylab{-.205\textwidth}{.465\textwidth}{\ddd.1)}% \mylab{-.940\textwidth}{.225\textwidth}{\aaa.2)}% \mylab{-.695\textwidth}{.225\textwidth}{\bbb.2)}% \mylab{-.452\textwidth}{.225\textwidth}{\ccc.2)}% \mylab{-.205\textwidth}{.225\textwidth}{\ddd.2)}% \caption{Results from DNSs and estimates based on equations~\eqref{eq:stress_integrals_simple}. \protect\blacktri,~$\Tterm_1$; \protect\blacksquar,~$\Tterm_2$; \protect\blackcircle,~\DUp. (\aaa) Collocated posts; (\bbb) collocated posts of two heights; (\ccc) spanwise-staggered posts; and (\ddd) streamwise-staggered posts. Solid symbols, estimates; empty symbols, DNSs.} \label{fig:stress_breakdown_2} \end{figure} Now we explore the potential of equations~\eqref{eq:stress_integrals_simple} for predicting \DUp. Based on the discussion in \S\ref{sec:rough_comp} and \S\ref{sec:the_turbulent_component}, we suggest a model for the contributions $\Tterm_1$ and $\Tterm_2$ to estimate \DUp. Let us assume that the statistics for a turbulent flow over a smooth wall at the desired \Retau\ are available. Therefore, only the terms from roughness, $U_r^+(h^+)$ and $\minusReStressp[r](\yp)$, need to be modelled. For small roughness size, the velocity at the roughness crests, $U_r^+(h^+)$, can be estimated from the laminar model for the coherent flow presented in \S\ref{sec:rough_comp}. In \S\ref{sec:the_turbulent_component} it is shown how for small \kp\ the main effect of roughness on the Reynolds stress, \minusReStressp[r], is as a shift \Duvp\ towards the wall, but otherwise the Reynolds stress closely resembles that of smooth-wall turbulence. As a result the effective displacement of the Reynolds stress is $\Duvp - \protup$, since the origin is at a depth \protup\ below the roughness tips. We can express this relation as if the Reynolds stress of a rough wall was that of smooth-wall turbulence shifted to the corresponding virtual origin, i.e.\ $\minusReStressp[r](\yp) \approx \minusReStressp[s](\yp_\star)$, where $\yp_\star$ is an auxiliary wall-normal coordinate that displaces \minusReStressp[s]. This auxiliary coordinate $\yp_\star$ is defined such that near the wall, at $\yp_r = h^+$, $\minusReStressp[r](\yp_r = h^+) \approx \minusReStressp[s](\yp_r = h^+ + \Duvp - \protup)$. Notice that a mere shift of \minusReStressp[s] leads to a new $\delta^{\prime +}$. Instead, to keep $\delta^{\prime +}$ constant, $\yp_\star$ is linearly transformed, with $\minusReStressp[r](\yp_r = \delta^{\prime+}) \approx \minusReStressp[s](\yp_r = \delta^{\prime+})$. The change in Reynolds stress, accounted for in the term $\Tterm_1$, can therefore be expressed as \begin{equation} \Tterm_1 \approx \int^{\delta^+}_{h^+}\left( \minusReStressp[s](\yp_\star) - \minusReStressp[s](\yp) \right)\, dy^+,\\ \label{eq:stress_integrals_T1_simplified} \end{equation} where \begin{equation} \yp_\star = \left(\frac{\delta^{\prime+}-\Duvp}{\delta^{\prime+}-\protup }\right)\left(\yp_r - \protup\right) + \Duvp. \end{equation}% Results of this model are portrayed in figure~\ref{fig:stress_breakdown_2}. In addition, the values of \hrp\ and \Utips, used to estimate $\Tterm_2$, are estimated from the laminar model for the roughness-coherent contribution, presented in \S\ref{sec:rough_comp}. The model appears to estimate the initial trend of \DUp\ with relatively good agreement up to values of $-\DUp\lesssim 2$, i.e. capturing the region of initial increase of drag with $\DCf/C_f \lesssim 25\%$. For larger roughness, the results begin to deviate more significantly. These results show the potential of the model described by equations~\eqref{eq:stress_integrals_simple} and~\eqref{eq:stress_integrals_T1_simplified} to estimate \DUp\ as it departs from the hydraulically smooth regime. Further work needs to be undertaken in order to extend the model to the entire transitionally rough regime, as well as to obtain an estimate for \Duvp. Additionally, its applicability to random roughness must be analysed, especially for the purpose of industrial applications. \section{Conclusions}\label{sec:conclusions} In the present work we have investigated the interaction between roughness and near-wall turbulence. We have focused on the transitionally rough regime, to capture the effects that trigger the departure from the hydraulically smooth regime. We propose a triple decomposition where the roughness-coherent contribution is modulated in amplitude by the overlying background-turbulent flow. Using this decomposition, a background turbulence component, essentially free of any footprint from the roughness texture, can be extracted. The roughness-coherent component, resulting from the ensemble average of the flow field, is systematically studied as roughness size increases. This component presents an exponential decay with $y/\k$. The rate of decay depends on the velocity component, with the wall-normal velocity experiencing the slowest decay. All components seem to essentially vanish for $y \lesssim \k$. However, the region where background turbulence is affected by the roughness surface, the roughness-sublayer, extends to a height of \mbox{$y/\k \approx 2$--$3$}. A laminar model is proposed to estimate the roughness-coherent component. The model results agree well with DNS results for roughness sizes that produce offsets of $\DUp \lesssim 2$. It also provides estimates for the mean velocity at the roughness crests, \Utipsp, and the virtual origin of the mean velocity profile, \protup. Using the proposed triple decomposition, the roughness-coherent contribution is extracted and the changes produced in the background turbulence can be isolated and analysed. For a large extent of the transitionally rough regime, $\DUp \lesssim 4$, the main effect of roughness is a displacement of the rms fluctuations and the Reynolds stress towards the wall. This is interpreted as turbulence perceiving the wall at a certain virtual origin below the roughness crests. We observe a good agreement between \protup, \Dup\ and \Djp, the origins perceived by the mean flow, the streamwise velocity fluctuations and the displacement height, respectively. This supports Jackson's methodology for defining the displacement height for the law of the wall. However, the near-wall turbulence appears to experience a different virtual origin, essentially that of the Reynolds stress, \Duvp. This origin presents a strong correlation with \DUp, similar to that observed for the wall-normal velocity fluctuations by \citet{Orlandi2006a}. As the roughness size increases and the effect on the background turbulence ceases to be a mere shift, the spectral energy density increases at short streamwise wavelengths, especially for the wall-normal velocity. This increase tends to concentrate at $\lambda_x^+ \approx 150$. Results from a simplified linear stability model suggest that this concentration is related to an increased receptivity for $\lambda_x^+ \approx 100$--$150$, produced by the inflexionality of the mean velocity profile. The mean momentum equation has been integrated to identify different contributions to the roughness function, \DUp, and in particular to analyse the role of the virtual origin \Duvp. The main contribution is the change in Reynolds stress. For small roughness, this is essentially due to the shift \Duvp, as the Reynolds stress remains otherwise smooth-wall-like. The second contribution to \DUp\ is proportional to the defect of the mean velocity at the height of the roughness crests, compared to a smooth-wall flow. This defect is generally positive, in which case it increases drag.\\ N.A-E.\ and C.T.F.\ were supported by the Engineering and Physical Sciences Research Council under a Doctoral Training Account, grant EP/M506485/1. This work was partly supported by the European Research Council through the II Multiflow Summer Workshop. We also express our gratitude to A.~Sharma for helpful conversations about shear-flow instabilities and their analysis.